fix: 微信支付,创建失败,问题修复。
This commit is contained in:
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.intc.common.core.exception.ServiceException;
|
||||
import com.intc.fishery.constant.DefineDeviceWarnCode;
|
||||
import com.intc.fishery.domain.Device;
|
||||
import com.intc.fishery.domain.PayDevice;
|
||||
import com.intc.fishery.domain.PayOrder;
|
||||
@@ -313,15 +314,22 @@ public class PayOrderBusinessServiceImpl implements PayOrderBusinessService {
|
||||
// 计算新的到期时间
|
||||
Date newDeadTime = calculateNewDeadTime(device.getDeadTime(), payDevice.getAddMonth());
|
||||
|
||||
// 更新设备到期时间
|
||||
// 清除 warnCode 中的「设备到期」标志位(续费后恢复正常状态)
|
||||
Integer oldWarnCode = device.getWarnCode();
|
||||
Integer newWarnCode = oldWarnCode != null
|
||||
? (oldWarnCode & ~DefineDeviceWarnCode.DeviceTimeDead)
|
||||
: 0;
|
||||
|
||||
// 更新设备到期时间,并同步清除到期告警位
|
||||
deviceMapper.update(null,
|
||||
new LambdaUpdateWrapper<Device>()
|
||||
.eq(Device::getId, device.getId())
|
||||
.set(Device::getDeadTime, newDeadTime)
|
||||
.set(Device::getWarnCode, newWarnCode)
|
||||
);
|
||||
|
||||
log.info("更新设备到期时间: deviceId={}, serialNum={}, newDeadTime={}",
|
||||
device.getId(), device.getSerialNum(), newDeadTime);
|
||||
log.info("续费成功,更新设备到期时间并清除到期告警: deviceId={}, serialNum={}, newDeadTime={}, oldWarnCode={}, newWarnCode={}",
|
||||
device.getId(), device.getSerialNum(), newDeadTime, oldWarnCode, newWarnCode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user