|
|
@@ -584,16 +584,19 @@ public class GptRechargeServiceImpl implements GptRechargeService {
|
|
|
if (rechargeStatus == GroupsRelation.RechargeStatus.recharge_error) {
|
|
|
rechargeErrorInfo = result;
|
|
|
}
|
|
|
- relationMapper.update(null, Wrappers.lambdaUpdate(GroupsRelation.class)
|
|
|
- .set(rechargeStatus == GroupsRelation.RechargeStatus.recharge_error, GroupsRelation::getRechargeRemainNum, rechargeRemainNum + 1)
|
|
|
- .set(GroupsRelation::getRechargeStatus, rechargeStatus)
|
|
|
- .set(expiryTime != null, GroupsRelation::getStartTime, startTime)
|
|
|
- .set(expiryTime != null, GroupsRelation::getExpiryTime, expiryTime)
|
|
|
- .set(StrUtil.isNotEmpty(rechargeErrorInfo), GroupsRelation::getRechargeErrorInfo, rechargeErrorInfo)
|
|
|
- .eq(GroupsRelation::getId, relation.getId())
|
|
|
- .le(GroupsRelation::getRechargeRemainNum, relation.getRechargeNum())
|
|
|
- .eq(GroupsRelation::getRechargeStatus, GroupsRelation.RechargeStatus.recharging));
|
|
|
- //记录代充记录
|
|
|
+ int update = relationMapper.update(null, Wrappers.lambdaUpdate(GroupsRelation.class)
|
|
|
+ .set(rechargeStatus == GroupsRelation.RechargeStatus.recharge_error, GroupsRelation::getRechargeRemainNum, rechargeRemainNum + 1)
|
|
|
+ .set(GroupsRelation::getRechargeStatus, rechargeStatus)
|
|
|
+ .set(expiryTime != null, GroupsRelation::getStartTime, startTime)
|
|
|
+ .set(expiryTime != null, GroupsRelation::getExpiryTime, expiryTime)
|
|
|
+ .set(StrUtil.isNotEmpty(rechargeErrorInfo), GroupsRelation::getRechargeErrorInfo, rechargeErrorInfo)
|
|
|
+ .eq(GroupsRelation::getId, relation.getId())
|
|
|
+ .le(GroupsRelation::getRechargeRemainNum, relation.getRechargeNum())
|
|
|
+ .eq(GroupsRelation::getRechargeStatus, GroupsRelation.RechargeStatus.recharging));
|
|
|
+ if (update == 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //记录代充记录
|
|
|
if (rechargeStatus == GroupsRelation.RechargeStatus.complete) {
|
|
|
String remark = "自动代充";
|
|
|
if (StrUtil.isNotBlank(relation.getOperator())) {
|