Commit debb96c6 by 杨林龙

解决解绑以后可以看到之前工单的BUG

1 parent a0cfa4a9
......@@ -1560,7 +1560,7 @@ public class VehicleService extends AbstractCommonService {
}
// 解绑设备
List<String> unbindSnList = unbindVehicleDevice(sourceVehicleDeviceList, currentDeviceInfoDtoMap, vehicle.getUpdatedBy());
List<String> unbindSnList = unbindVehicleDevice(sourceVehicleDeviceList, currentDeviceInfoDtoMap, vehicle);
log.info("vehicle bind device vehicleId:{}, snList:{}", vehicle.getId(), JSONObject.toJSONString(bindSnList));
log.info("vehicle unbind device vehicleId:{}, snList:{}", vehicle.getId(), JSONObject.toJSONString(unbindSnList));
......@@ -1618,7 +1618,7 @@ public class VehicleService extends AbstractCommonService {
}
// 解绑设备
private List<String> unbindVehicleDevice(List<VehicleDevice> sourceVehicleDeviceList, Map<String, DeviceInfoDto> deviceInfoDtoMap, Long updatedBy) {
private List<String> unbindVehicleDevice(List<VehicleDevice> sourceVehicleDeviceList, Map<String, DeviceInfoDto> deviceInfoDtoMap, Vehicle vehicle) {
if (CollectionUtil.isEmpty(sourceVehicleDeviceList)) {
return null;
}
......@@ -1631,12 +1631,18 @@ public class VehicleService extends AbstractCommonService {
}
vehicleDevice.setBindStatus(ConstantsDevice.UN_BIND_VEHICLE_STATUS);
vehicleDevice.setUpdatedDate(new Date());
vehicleDevice.setUpdatedBy(updatedBy);
vehicleDevice.setUpdatedBy(vehicle.getUpdatedBy());
vehicleDeviceService.updateByPrimaryKey(vehicleDevice);
deleteSnList.add(vehicleDevice.getSn());
// 修改设备解绑状态
updateDeviceActiveStatus(vehicleDevice.getSn(), updatedBy, ConstantsDevice.DEVICE_UN_ACTIVED);
updateDeviceActiveStatus(vehicleDevice.getSn(), vehicle.getUpdatedBy(), ConstantsDevice.DEVICE_UN_ACTIVED);
if (vehicle.getWorkOrderId() != null) {
//解绑设备时同步删除工单车辆设备,工单车辆设备数据可能不存在
int delCnt = workOrderVehicleDeviceMapper.deleteByWorkOrderIdAndSn(vehicle.getWorkOrderId(), vehicleDevice.getSn());
log.info("换绑设备同步删除工单车辆设备{}", delCnt);
}
}
return deleteSnList;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!