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