| | |
| | | DeviceLedger byId = deviceLedgerService.getById(deviceRepairDto.getDeviceLedgerId()); |
| | | deviceRepairDto.setDeviceName(byId.getDeviceName()); |
| | | deviceRepairDto.setDeviceModel(byId.getDeviceModel()); |
| | | deviceRepairDto.setAreaId(byId.getAreaId()); |
| | | if (deviceRepairDto.getStatus() == null) { |
| | | deviceRepairDto.setStatus(STATUS_PENDING_REPAIR); |
| | | } |
| | |
| | | if (oldDeviceRepair == null) { |
| | | return AjaxResult.error("报修记录不存在"); |
| | | } |
| | | Long effectiveDeviceLedgerId = deviceRepairDto.getDeviceLedgerId() != null |
| | | ? deviceRepairDto.getDeviceLedgerId() |
| | | : oldDeviceRepair.getDeviceLedgerId(); |
| | | DeviceLedger byId = deviceLedgerService.getById(effectiveDeviceLedgerId); |
| | | if (byId != null) { |
| | | deviceRepairDto.setDeviceName(byId.getDeviceName()); |
| | | deviceRepairDto.setDeviceModel(byId.getDeviceModel()); |
| | | deviceRepairDto.setAreaId(byId.getAreaId()); |
| | | } |
| | | if (deviceRepairDto.getStatus() != null |
| | | && deviceRepairDto.getStatus() == STATUS_COMPLETED |
| | | && (oldDeviceRepair.getStatus() == null |