|
@@ -102,20 +102,26 @@ public class CmsOrderController {
|
|
|
}
|
|
}
|
|
|
relationMapper.updateById(relation);
|
|
relationMapper.updateById(relation);
|
|
|
|
|
|
|
|
|
|
+ //GPT代充
|
|
|
|
|
+ Integer subRechargeNum = 1;
|
|
|
|
|
+ GoodsDonSku goodsDonSku = skuMapper.selectById(orderDon.getSkuId());
|
|
|
|
|
+ if (goodsDonSku.getRechargeType() == 2) {
|
|
|
|
|
+ subRechargeNum = 12;
|
|
|
|
|
+ }
|
|
|
//GPT代充
|
|
//GPT代充
|
|
|
if (orderDon.getGoodsId() == Constant.GPT_RECHARGE_GOODS_ID) {
|
|
if (orderDon.getGoodsId() == Constant.GPT_RECHARGE_GOODS_ID) {
|
|
|
//扣除次数
|
|
//扣除次数
|
|
|
Integer rechargeRemainNum = relation.getRechargeRemainNum();
|
|
Integer rechargeRemainNum = relation.getRechargeRemainNum();
|
|
|
if (rechargeRemainNum != null && rechargeRemainNum > 0) {
|
|
if (rechargeRemainNum != null && rechargeRemainNum > 0) {
|
|
|
int update = relationMapper.update(null, Wrappers.lambdaUpdate(GroupsRelation.class)
|
|
int update = relationMapper.update(null, Wrappers.lambdaUpdate(GroupsRelation.class)
|
|
|
- .set(GroupsRelation::getRechargeRemainNum, rechargeRemainNum - 1)
|
|
|
|
|
|
|
+ .set(GroupsRelation::getRechargeRemainNum, rechargeRemainNum - subRechargeNum)
|
|
|
.eq(GroupsRelation::getId, relationId)
|
|
.eq(GroupsRelation::getId, relationId)
|
|
|
.eq(GroupsRelation::getRechargeRemainNum, rechargeRemainNum));
|
|
.eq(GroupsRelation::getRechargeRemainNum, rechargeRemainNum));
|
|
|
if (update == 0) {
|
|
if (update == 0) {
|
|
|
throw BusinessRuntimeException.getInstance("更新用户代充剩余次数失败,请重试");
|
|
throw BusinessRuntimeException.getInstance("更新用户代充剩余次数失败,请重试");
|
|
|
}
|
|
}
|
|
|
//记录gpt代充记录
|
|
//记录gpt代充记录
|
|
|
- gptUserRechargeRecordService.recordGptUserRechargeNum(relation.getUserId(), relation.getId(), relation.getAccount(), 1, fcorpFollow != null ? fcorpFollow.getName() : null, "客服手动充值");
|
|
|
|
|
|
|
+ gptUserRechargeRecordService.recordGptUserRechargeNum(relation.getUserId(), relation.getId(), relation.getAccount(), -subRechargeNum, fcorpFollow != null ? fcorpFollow.getName() : null, "客服手动充值");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|