|
|
@@ -101,7 +101,7 @@ public class ClaudeCodeServiceImpl implements ClaudeCodeService {
|
|
|
renewExpiryTime = DateUtil.offsetMonth(DateTime.now(), sku.getMonths());
|
|
|
}
|
|
|
isUpgrade = true;
|
|
|
- saveClaudeCodeRenewExpiryRecord(orderId, relationUserId, relationId, renewExpiryTime, skuId);
|
|
|
+ saveClaudeCodeRenewExpiryRecord(orderId, relationUserId, relationId, skuId);
|
|
|
}
|
|
|
generateOrUpdateClaudeCodeUser(relationUserId, relationId, codePoints, codeCreditRecovery, expiryTime, isUpgrade, orderId, skuId, renewExpiryTime, sku.getSpecVal());
|
|
|
try {
|
|
|
@@ -390,25 +390,7 @@ public class ClaudeCodeServiceImpl implements ClaudeCodeService {
|
|
|
|
|
|
@Override
|
|
|
public void handleClaudeCodeUserPackageSku(GroupsRelation relation, GoodsDonSku sku, Long orderId) {
|
|
|
- Long groupsId = relation.getGroupsId();
|
|
|
- GroupsTrips groupsTrips = groupsMapper.selectById(groupsId);
|
|
|
- GoodsDonSku oriRelationSku = skuMapper.selectById(groupsTrips.getSkuId());
|
|
|
- Integer oriRelationSkuCodePoints = oriRelationSku.getCodePoints();
|
|
|
- Integer presentCodePoints = sku.getCodePoints();
|
|
|
- Long oriRelationSkuId = oriRelationSku.getId();
|
|
|
- Long toUseSkuId = sku.getId();
|
|
|
- //若是续费升级 记录此时续费升级的过期时间
|
|
|
- Boolean isUpgrade = false;
|
|
|
- Date renewExpiryTime = null;
|
|
|
- if (oriRelationSkuCodePoints <= presentCodePoints && !ObjectUtil.equal(oriRelationSkuId, toUseSkuId)) {
|
|
|
- if (sku.getDays() != null) {
|
|
|
- renewExpiryTime = DateUtil.offsetDay(DateTime.now(), sku.getDays());
|
|
|
- } else {
|
|
|
- renewExpiryTime = DateUtil.offsetMonth(DateTime.now(), sku.getMonths());
|
|
|
- }
|
|
|
- isUpgrade = true;
|
|
|
- saveClaudeCodeRenewExpiryRecord(orderId, relation.getUserId(), relation.getId(), renewExpiryTime, sku.getId());
|
|
|
- }
|
|
|
+ generateOrUpdateClaudeCodeUserInfo(orderId, relation.getId(), relation.getUserId(), sku, 2);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -510,13 +492,12 @@ public class ClaudeCodeServiceImpl implements ClaudeCodeService {
|
|
|
/**
|
|
|
* 记录claude code 续费升级的过期时间
|
|
|
*/
|
|
|
- private void saveClaudeCodeRenewExpiryRecord(Long orderId, Long relationUserId, Long relationId, Date expiryTime, Long skuId) {
|
|
|
+ private void saveClaudeCodeRenewExpiryRecord(Long orderId, Long relationUserId, Long relationId, Long skuId) {
|
|
|
ClaudeCodeUserRenewExpiryRecord renewExpiryRecord = new ClaudeCodeUserRenewExpiryRecord();
|
|
|
renewExpiryRecord.setOrderId(orderId);
|
|
|
renewExpiryRecord.setUserId(relationUserId);
|
|
|
renewExpiryRecord.setRelationId(relationId);
|
|
|
renewExpiryRecord.setRenewSkuId(skuId);
|
|
|
- renewExpiryRecord.setExpiryTime(expiryTime);
|
|
|
claudeCodeUserRenewExpiryRecordMapper.insert(renewExpiryRecord);
|
|
|
}
|
|
|
|