| | |
| | | import com.ruoyi.device.service.DeviceDefectRecordService; |
| | | import com.ruoyi.device.service.IDeviceLedgerService; |
| | | import com.ruoyi.device.service.IDeviceRepairService; |
| | | import com.ruoyi.measuringinstrumentledger.service.SparePartsRequisitionRecordService; |
| | | import com.ruoyi.other.service.TempFileService; |
| | | import com.ruoyi.sales.mapper.CommonFileMapper; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | |
| | | @Autowired |
| | | private TempFileService tempFileService; |
| | | |
| | | @Autowired |
| | | private SparePartsRequisitionRecordService sparePartsRequisitionRecordService; |
| | | |
| | | @Override |
| | | public IPage<DeviceRepairDto> queryPage(Page page, DeviceRepairDto deviceRepairDto) { |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void submitDeviceMaintain(DeviceRepair deviceRepair) { |
| | | if (deviceRepair == null || deviceRepair.getId() == null) { |
| | | throw new ServiceException("报修单ID不能为空"); |
| | |
| | | if (!this.updateById(existing)) { |
| | | throw new ServiceException("提交维修失败"); |
| | | } |
| | | sparePartsRequisitionRecordService.processSparePartsUse( |
| | | existing.getDeviceLedgerId(), |
| | | existing.getDeviceName(), |
| | | existing.getId(), |
| | | 0, |
| | | "维修", |
| | | deviceRepair.getSparePartsUseList()); |
| | | clearDefectRecordsIfNeeded(existing.getId()); |
| | | } |
| | | |