zoujiajian 10 mesi fa
parent
commit
6ae693467b

+ 11 - 2
netflix-service/src/main/java/com/cyksj/service/claude/impl/ClaudeCodeServiceImpl.java

@@ -1067,7 +1067,11 @@ public class ClaudeCodeServiceImpl implements ClaudeCodeService {
 			BigDecimal orderMoney = renewOrderDon.getMoney().add(Optional.ofNullable(renewOrderDon.getBalance()).orElse(BigDecimal.ZERO));
 			GoodsDonSku presentSku = skuMapper.selectById(renewSkuId);
 			if (orderMoney.compareTo(BigDecimal.ZERO) == 0) {
-				orderMoney = presentSku.getPrice();
+				if (presentSku.getDays() != null) {
+					relationExpiryTime = DateUtil.offsetDay(relationExpiryTime, -presentSku.getDays());
+				} else {
+					relationExpiryTime = DateUtil.offsetMonth(relationExpiryTime, -presentSku.getMonths());
+				}
 			}
 			Long betweenDay = DateUtil.betweenDay(now, renewExpiryTime, false) + 1;
 			//当天购买的按规格原价抵扣
@@ -1097,7 +1101,12 @@ public class ClaudeCodeServiceImpl implements ClaudeCodeService {
 				GoodsDonSku thisRenewSku = skuMapper.selectById(skuId);
 				BigDecimal thisOrderMoney = thisRenewOrderDon.getMoney().add(Optional.ofNullable(thisRenewOrderDon.getBalance()).orElse(BigDecimal.ZERO));
 				if (thisOrderMoney.compareTo(BigDecimal.ZERO) == 0) {
-					thisOrderMoney = thisRenewSku.getPrice();
+					if (presentSku.getDays() != null) {
+						relationExpiryTime = DateUtil.offsetDay(relationExpiryTime, -presentSku.getDays());
+					} else {
+						relationExpiryTime = DateUtil.offsetMonth(relationExpiryTime, -presentSku.getMonths());
+					}
+					continue;
 				}
 				//当天购买的按规格原价抵扣
 				BigDecimal thisRenewDeductMoney = BigDecimal.ZERO;