| | |
| | | import org.jeecg.modules.eam.entity.*; |
| | | import org.jeecg.modules.eam.service.*; |
| | | import org.jeecg.modules.eam.vo.CalibrationOrderPage; |
| | | import org.jeecg.modules.eam.vo.SysFileNameVo; |
| | | import org.jeecg.modules.system.entity.SysDepart; |
| | | import org.jeecg.modules.system.service.ISysDepartService; |
| | | import org.jeecgframework.poi.excel.ExcelImportUtil; |
| | | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
| | | import org.jeecgframework.poi.excel.entity.ExportParams; |
| | |
| | | |
| | | @Autowired |
| | | private IPrecisionParametersTemplateDetailService precisionParametersTemplateDetailService; |
| | | |
| | | @Autowired |
| | | private ITechnologyStatusService technologyStatusService; |
| | | |
| | | @Autowired |
| | | private ISysFileNameService sysFileNameService; |
| | | |
| | | @Autowired |
| | | private ISysDepartService sysDepartService; |
| | | // @Autowired |
| | | // private IUploadRelaService uploadRelaService; |
| | | // @Autowired |
| | |
| | | String managementMode = record.getManagementMode(); |
| | | String equipmentId = record.getEquipmentId(); |
| | | Equipment equipment = equipmentService.getById(equipmentId); |
| | | String useId = equipment.getUseId(); |
| | | SysDepart depart = sysDepartService.getById(useId); |
| | | if(equipment != null){ |
| | | record.setEquipmentNum(equipment.getNum()); |
| | | record.setEquipmentName(equipment.getName()); |
| | | record.setEquipmentModel(equipment.getModel()); |
| | | record.setEquipmentSpecification(equipment.getSpecification()); |
| | | record.setEquipmentImportance(equipment.getEquipmentImportanceId()); |
| | | record.setUseDepartName(depart.getDepartName()); |
| | | } |
| | | // List<Map<String, Object>> precisionParameterList = calibrationOrderService.getPrecisionParameterList(equipmentId); |
| | | // record.setPrecisionParameterList(precisionParameterList); |
| | |
| | | for (CalibrationOrderDetail calibrationOrderDetail : calibrationOrderDetails) { |
| | | calibrationOrderDetailService.removeById(calibrationOrderDetail); |
| | | } |
| | | addAndEdit(calibrationOrder); |
| | | // addAndEdit(calibrationOrder); |
| | | return Result.OK("编辑成功!"); |
| | | } |
| | | |
| | |
| | | public Result<String> addNew(@RequestBody CalibrationOrder calibrationOrder) { |
| | | calibrationOrder.setStatus("1"); |
| | | calibrationOrderService.save(calibrationOrder); |
| | | addAndEdit(calibrationOrder); |
| | | |
| | | String equipmentId = calibrationOrder.getEquipmentId(); |
| | | Equipment equipment = equipmentService.getById(equipmentId); |
| | | String equipmentImportance = equipment.getEquipmentImportanceId(); |
| | | if("D".equals(equipmentImportance)){ |
| | | this.createTechnologyStatus(calibrationOrder); |
| | | } |
| | | |
| | | // addAndEdit(calibrationOrder); |
| | | return Result.OK("添加成功!"); |
| | | } |
| | | |
| | | void createTechnologyStatus(CalibrationOrder calibrationOrder){ |
| | | List<SysFileNameVo> sysFileName = sysFileNameService.getSysFileName("9"); |
| | | TechnologyStatus technologyStatus = new TechnologyStatus(); |
| | | technologyStatus.setOrderId(calibrationOrder.getId()); |
| | | technologyStatus.setReceipts(sysFileName.get(0).getReceipts()); |
| | | technologyStatusService.save(technologyStatus); |
| | | } |
| | | |
| | | /** |
| | | * 设备检定工单 创建时通过设备获取设备精度参数 |
| | | * qsw 2023-7-18 |