|
|
@@ -345,18 +345,18 @@ public class IotInspectOrderServiceImpl implements IotInspectOrderService {
|
|
|
pmsMessage.sendMessage(iotInspectOrderDO.getId(), iotInspectOrderDO.getInspectOrderTitle(), PmsConstants.GENERATE_INSPECT, k, user.getMobile());
|
|
|
List<IotDeviceSimple> iotDeviceDOS = iotDeviceMapper.selectCodeAndNameList();
|
|
|
//写入子表
|
|
|
- Set<Long> collect = results.stream().map(IotInspectOrderDetailDO::getDeviceId).collect(Collectors.toSet());
|
|
|
- List<IotInspectOrderDeviceDO> inspectDevices = new ArrayList<>();
|
|
|
- collect.forEach(deviceId -> iotDeviceDOS.stream().filter(g -> deviceId.equals(g.getId())).findFirst().ifPresent(iotDeviceDO -> {
|
|
|
- IotInspectOrderDeviceDO iotInspectOrderDeviceDO = new IotInspectOrderDeviceDO();
|
|
|
- iotInspectOrderDeviceDO.setDeviceId(deviceId);
|
|
|
- iotInspectOrderDeviceDO.setOrderId(iotInspectOrderDO.getId());
|
|
|
- iotInspectOrderDeviceDO.setDeviceName(iotDeviceDO.getDeviceName());
|
|
|
- iotInspectOrderDeviceDO.setDeviceCode(iotDeviceDO.getDeviceCode());
|
|
|
- iotInspectOrderDeviceDO.setDeleted(false);
|
|
|
- inspectDevices.add(iotInspectOrderDeviceDO);
|
|
|
- }));
|
|
|
- iotInspectOrderDeviceMapper.insertBatch(inspectDevices);
|
|
|
+// Set<Long> collect = results.stream().map(IotInspectOrderDetailDO::getDeviceId).collect(Collectors.toSet());
|
|
|
+// List<IotInspectOrderDeviceDO> inspectDevices = new ArrayList<>();
|
|
|
+// collect.forEach(deviceId -> iotDeviceDOS.stream().filter(g -> deviceId.equals(g.getId())).findFirst().ifPresent(iotDeviceDO -> {
|
|
|
+// IotInspectOrderDeviceDO iotInspectOrderDeviceDO = new IotInspectOrderDeviceDO();
|
|
|
+// iotInspectOrderDeviceDO.setDeviceId(deviceId);
|
|
|
+// iotInspectOrderDeviceDO.setOrderId(iotInspectOrderDO.getId());
|
|
|
+// iotInspectOrderDeviceDO.setDeviceName(iotDeviceDO.getDeviceName());
|
|
|
+// iotInspectOrderDeviceDO.setDeviceCode(iotDeviceDO.getDeviceCode());
|
|
|
+// iotInspectOrderDeviceDO.setDeleted(false);
|
|
|
+// inspectDevices.add(iotInspectOrderDeviceDO);
|
|
|
+// }));
|
|
|
+// iotInspectOrderDeviceMapper.insertBatch(inspectDevices);
|
|
|
});
|
|
|
});
|
|
|
}
|