Переглянути джерело

fix GPT代充车票未配置代充信息兜底

zoujiajian 1 рік тому
батько
коміт
a8852491e2

+ 13 - 0
netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java

@@ -3176,6 +3176,19 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 			//生成所需的claude code用户信息
 			claudeCodeService.generateOrUpdateClaudeCodeUserInfo(orderDon.getId(), orderDon.getRelationId(), orderDon.getUserId(), sku, orderDon.getOrderType());
 		}
+		//GPT代充 回调兜底
+		if (orderDon.getGoodsId() == Constant.GPT_RECHARGE_GOODS_ID) {
+			GroupsRelation relation = groupsRelationMapper.selectById(orderDon.getRelationId());
+			if (relation.getRechargeStatus() == null) {
+				log.info("代充类型车票relationId:{}未配置代充状态,重新设置代充车票信息", relation.getId());
+				relation.setRechargeStatus(GroupsRelation.RechargeStatus.waiting);
+				relation.setSubmitTime(DateTime.now());
+				//代充次数
+				relation.setRechargeNum(sku.getMonths());
+				relation.setRechargeRemainNum(relation.getRechargeNum());
+				groupsRelationMapper.updateById(relation);
+			}
+		}
 	}
 
 	private void handleUserMirrorSHopOrderDon(OrderDon orderDon) throws Exception {