fix:子账号不充值后,回调后,更新设备有效期,问题修复。
This commit is contained in:
@@ -336,16 +336,18 @@ public class PayOrderBusinessServiceImpl implements PayOrderBusinessService {
|
||||
return;
|
||||
}
|
||||
|
||||
// 批量更新设备到期时间
|
||||
// 批量更新设备到期时间(忽略租户过滤,因为设备可能由IOT模块写入,租户ID可能不一致)
|
||||
for (PayDevice payDevice : payDevices) {
|
||||
Device device = deviceMapper.selectOne(
|
||||
new LambdaQueryWrapper<Device>()
|
||||
.eq(Device::getSerialNum, payDevice.getSerialNum())
|
||||
.eq(Device::getUserId, payDevice.getUserId())
|
||||
// 仅通过 serialNum 查找设备,不限制 userId,因为允许代充(支付者可能与设备所有者不同)
|
||||
Device device = TenantHelper.ignore(() ->
|
||||
deviceMapper.selectOne(
|
||||
new LambdaQueryWrapper<Device>()
|
||||
.eq(Device::getSerialNum, payDevice.getSerialNum())
|
||||
)
|
||||
);
|
||||
|
||||
if (device == null) {
|
||||
log.warn("设备不存在: serialNum={}, userId={}", payDevice.getSerialNum(), payDevice.getUserId());
|
||||
log.warn("设备不存在: serialNum={}", payDevice.getSerialNum());
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user