|
@@ -338,25 +338,38 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
deviceInfo.setMercId(mercId).setMercCode(mercCode).setAlgorithmId(algorithmId).setMercName(mercName);
|
|
|
}
|
|
|
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 (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);
|
|
|
+// }
|
|
|
+// }
|
|
|
return R.ok(Boolean.TRUE);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 解绑机器
|
|
|
+ *
|
|
|
+ * @param dto
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public R<Boolean> unBindMercDevice(DeviceInfoDto.MercDeviceUnBindDto dto) {
|
|
|
+ Long parentId = dto.getParentId();
|
|
|
+ List<DeviceInfo> deviceInfos = this.listByIds(dto.getDeviceIds());
|
|
|
+ return R.ok(removeMerRefDevices(deviceInfos, parentId));
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 批量移除商户设备绑定关系
|
|
|
*
|