zoujiajian 11 maanden geleden
bovenliggende
commit
72856b6d48

+ 8 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/GroupsRelation.java

@@ -169,6 +169,14 @@ public class GroupsRelation extends BaseEntity {
      */
     private Boolean isVip;
 
+
+    /**
+     * 是否是claude code 续费
+     */
+    @DbIgnore
+    @TableField(exist = false)
+    private Boolean isClaudeCodeRenew;
+
     /**
      * 是否是claude code 续费升级
      */

+ 7 - 3
netflix-service/src/main/java/com/cyksj/service/exchange/impl/ExchangeCodeServiceImpl.java

@@ -391,11 +391,14 @@ public class ExchangeCodeServiceImpl extends ServiceImpl<ExchangeCodeMapper, Exc
 			orderDonMapper.insert(orderDon);
 			log.info("用户{}兑换规格:{}车位成功", user.getId(), orderDon.getSkuId());
 
-			if (relation.getIsClaudeCodeUpgrade() != null && relation.getIsClaudeCodeUpgrade()) {
-				//claude code 是否升级
+			if (relation.getIsClaudeCodeRenew() != null && relation.getIsClaudeCodeRenew()) {
+				//claude code续费
 				orderDon.setOrderType(2);
 				orderDonMapper.updateById(orderDon);
-				claudeCodeService.handleClaudeCodeUserPackageSku(relation, sku, orderDon.getId());
+				//续费且升级
+				if (relation.getIsClaudeCodeUpgrade() != null && relation.getIsClaudeCodeUpgrade()) {
+					claudeCodeService.handleClaudeCodeUserPackageSku(relation, sku, orderDon.getId());
+				}
 			}
 		}
 		if (orderDonTye == OrderDon.Type.EX_CODE) {
@@ -444,6 +447,7 @@ public class ExchangeCodeServiceImpl extends ServiceImpl<ExchangeCodeMapper, Exc
 				relation.setExpiryTime(expiryTime);
 				groupsRelationMapper.updateById(relation);
 				//同规格只加时长
+				relation.setIsClaudeCodeRenew(Boolean.TRUE);
 				if (relationSku.getCodePoints() != sku.getCodePoints()) {
 					relation.setIsClaudeCodeUpgrade(true);
 				}