zoujiajian 11 bulan lalu
induk
melakukan
cd38184e95

+ 4 - 4
netflix-service/src/main/java/com/cyksj/service/vip/impl/VipFrontServiceImpl.java

@@ -222,7 +222,7 @@ public class VipFrontServiceImpl implements VipFrontService {
 				deductMoney = deductMoney.add(getGeneralRemainNumDeductMoney(relationId, goodsId, skuId, userIdList));
 			} else if (goodsId == Constant.MIDJOURNEY_GOODS_ID) {
 				//mj
-				deductMoney = deductMoney.add(getMjRemainNumDeductMoney(relationId, skuId, userIdList, relationExpiryTime));
+				deductMoney = deductMoney.add(getMjRemainNumDeductMoney(relationId, skuId, userIdList, relation.getStartTime()));
 			} else {
 				//该车票抵扣金额
 				deductMoney = deductMoney.add(getDeductMoneyFromTicket(relationId, userIdList, skuId, now, relation.getStartTime(), relationExpiryTime));
@@ -491,7 +491,7 @@ public class VipFrontServiceImpl implements VipFrontService {
 	/**
 	 * 获取mj剩余次数可抵扣金额
 	 */
-	private BigDecimal getMjRemainNumDeductMoney(Long relationId, Long skuId, List<Long> userIdList, Date relationExpiryTime) {
+	private BigDecimal getMjRemainNumDeductMoney(Long relationId, Long skuId, List<Long> userIdList, Date relationStartTime) {
 		BigDecimal deductMoney = BigDecimal.ZERO;
 		BigDecimal orderTotalMoney = BigDecimal.ZERO;
 		//总次数
@@ -545,7 +545,7 @@ public class VipFrontServiceImpl implements VipFrontService {
 				Integer remainFastNum = midjourneyUser.getMjFastNum();
 				Integer remainRelaxNum = midjourneyUser.getMjRelaxNum();
 				Integer usedNum = totalNum - remainFastNum - remainRelaxNum;
-				if (usedNum == 0 && DateUtil.isSameDay(now, relationExpiryTime)) {
+				if (usedNum == 0 && now.toDateStr().equals(DateUtil.format(relationStartTime, "yyyy-MM-dd"))) {
 					deductMoney = deductMoney.add(orderTotalMoney);
 				} else {
 					//每天单价
@@ -554,7 +554,7 @@ public class VipFrontServiceImpl implements VipFrontService {
 					//消耗的次数当月 值多少钱
 					BigDecimal consumeMoney = consumeRate.multiply(single.multiply(BigDecimal.valueOf(30)));
 					//该车票多长时间
-					Long thisDeductBetweenDay = DateUtil.betweenDay(now, relationExpiryTime, false) + 1;
+					Long thisDeductBetweenDay = DateUtil.betweenDay(now, relationStartTime, false) + 1;
 					//该车票抵扣金额
 					BigDecimal orderRemainMoney = single.multiply(BigDecimal.valueOf(thisDeductBetweenDay));
 					//最终可抵扣