|
@@ -514,6 +514,7 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
}
|
|
|
//更新商户设备授权
|
|
|
List<DeviceInfo> deviceInfos = this.listByIds(deviceIds);
|
|
|
+ List<DeviceStatus> deviceStatuses = new ArrayList<>();
|
|
|
for (DeviceInfo deviceInfo : deviceInfos) {
|
|
|
Integer deviceType = deviceInfo.getDeviceType();
|
|
|
Long deviceId = deviceInfo.getDeviceId();
|
|
@@ -553,24 +554,16 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
}
|
|
|
//绑定关系
|
|
|
deviceInfo.setMercId(mercId).setMercCode(mercCode).setAlgorithmId(algorithmId).setMercName(mercName);
|
|
|
+ //标记机器可交易
|
|
|
+ DeviceStatus deviceStatus = new DeviceStatus()
|
|
|
+ .setDeviceId(deviceInfo.getDeviceId())
|
|
|
+ .setIsPay(true);
|
|
|
+ deviceStatuses.add(deviceStatus);
|
|
|
}
|
|
|
saveOrUpdateBatch(deviceInfos);
|
|
|
-// //原来存在的设备关系,不在最终设备列表中的移除
|
|
|
-// if (CollUtil.isNotEmpty(devices)) {
|
|
|
-// List<Long> oldIds = new ArrayList<>();
|
|
|
-// List<Long> removeIds = new ArrayList<>();
|
|
|
-// devices.forEach(device -> oldIds.add(device.getDeviceId()));
|
|
|
-// oldIds.forEach(deviceId -> {
|
|
|
-// //不在最终设备列表中的待移除
|
|
|
-// if (!deviceIds.contains(deviceId)) {
|
|
|
-// removeIds.add(deviceId);
|
|
|
-// }
|
|
|
-// });
|
|
|
-// if (CollUtil.isNotEmpty(removeIds)) {
|
|
|
-// List<DeviceInfo> removeList = this.listByIds(removeIds);
|
|
|
-// removeMerRefDevices(removeList, parentId);
|
|
|
-// }
|
|
|
-// }
|
|
|
+ if (Emptys.check(deviceStatuses)) {
|
|
|
+ deviceStatusService.updateBatchById(deviceStatuses);
|
|
|
+ }
|
|
|
return R.ok(Boolean.TRUE);
|
|
|
}
|
|
|
|