| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult updateDeviceRepair(DeviceRepair deviceRepair) { |
| | | DeviceRepair oldDeviceRepair = this.getById(deviceRepair.getId()); |
| | | // 处理备件使用情况 |
| | | if (CollectionUtils.isNotEmpty(deviceRepair.getSparePartsUseList())) { |
| | | List<Long> sparePartIds = new ArrayList<>(); |
| | |
| | | SparePartsRequisitionRecord record = new SparePartsRequisitionRecord(); |
| | | record.setSourceType(0); // 0 维修 |
| | | record.setSourceId(deviceRepair.getId()); |
| | | record.setDeviceLedgerId(deviceRepair.getDeviceLedgerId()); |
| | | record.setDeviceLedgerId(oldDeviceRepair.getDeviceLedgerId()); |
| | | record.setSparePartsId(sparePartUse.getId()); |
| | | record.setQuantity(sparePartUse.getQuantity()); |
| | | sparePartsRequisitionRecordService.save(record); |