| | |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.eam.entity.DailyMaintenanceOrder; |
| | | import org.jeecg.modules.eam.entity.FinishTransferOrder; |
| | | import org.jeecg.modules.eam.entity.PrecisionInspection; |
| | | import org.jeecg.modules.eam.entity.*; |
| | | import org.jeecg.modules.eam.service.IDailyMaintenanceOrderService; |
| | | import org.jeecg.modules.eam.service.IPrecisionInspectionDetailService; |
| | | import org.jeecg.modules.eam.service.IPrecisionInspectionService; |
| | | import org.jeecg.modules.eam.service.IPrecisionParametersService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | |
| | | |
| | | @Autowired |
| | | private IDailyMaintenanceOrderService dailyMaintenanceOrderService; |
| | | |
| | | @Autowired |
| | | private IPrecisionInspectionDetailService precisionInspectionDetailService; |
| | | |
| | | @Autowired |
| | | private IPrecisionParametersService precisionParametersService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | |
| | | return super.importExcel(request, response, PrecisionInspection.class); |
| | | } |
| | | |
| | | /** |
| | | * 日常点检 |
| | | * qsw 2023-4-26 |
| | | */ |
| | | |
| | | @GetMapping("getPrecisionInspectionList") |
| | | public Result<?> getPrecisionInspectionList(@RequestParam(name = "maintenanceOrderId", required = true) String maintenanceOrderId) { |
| | | List<Map<String, Object>> precisionInspectionList = precisionInspectionService.getPrecisionInspectionList(maintenanceOrderId); |
| | | for (Map<String, Object> map : precisionInspectionList) { |
| | | String id = (String) map.get("id"); |
| | | List<PrecisionInspectionDetail> precisionInspectionDetails = precisionInspectionDetailService.lambdaQuery() |
| | | .eq(PrecisionInspectionDetail::getPrecisionInspectionId, id) |
| | | .eq(PrecisionInspectionDetail::getDelFlag, "0").list(); |
| | | for (PrecisionInspectionDetail precisionInspectionDetail : precisionInspectionDetails) { |
| | | String precisionParametersId = precisionInspectionDetail.getPrecisionParametersId(); |
| | | PrecisionParameters precisionParameters = precisionParametersService.getById(precisionParametersId); |
| | | precisionInspectionDetail.setPrecisionParametersName(precisionParameters.getName()); |
| | | } |
| | | |
| | | map.put("precisionInspectionDetails",precisionInspectionDetails); |
| | | } |
| | | return Result.ok(precisionInspectionList); |
| | | } |
| | | |
| | |
| | | DailyMaintenanceOrder maintenanceOrder = dailyMaintenanceOrderService.getById(preInspection.getMaintenanceOrderId()); |
| | | String precisionInspectionStatus = maintenanceOrder.getPrecisionInspectionStatus(); |
| | | |
| | | if ("0".equals(precisionInspectionStatus)){ |
| | | if ("0".equals(precisionInspectionStatus)){ |
| | | List<PrecisionInspectionDetail> precisionInspectionDetailList = precisionInspection.getPrecisionInspectionDetailList(); |
| | | for (PrecisionInspectionDetail precisionInspectionDetail : precisionInspectionDetailList) { |
| | | precisionInspectionDetailService.updateById(precisionInspectionDetail); |
| | | } |
| | | preInspection.setPrecisionInspectionUser(userId); |
| | | precisionInspectionService.updateById(preInspection); |
| | | |
| | | maintenanceOrder.setPrecisionInspectionStatus("1"); |
| | | dailyMaintenanceOrderService.updateById(maintenanceOrder); |
| | | }else if("1".equals(precisionInspectionStatus)){ |
| | | preInspection.setRepairDirectorUser(userId); |
| | | precisionInspectionService.updateById(preInspection); |
| | | |
| | | maintenanceOrder.setPrecisionInspectionStatus("2"); |
| | | dailyMaintenanceOrderService.updateById(maintenanceOrder); |
| | | }else if("2".equals(precisionInspectionStatus)){ |
| | | preInspection.setEachTolerance(precisionInspection.getEachTolerance()); |
| | | preInspection.setPartTolerance(precisionInspection.getPartTolerance()); |
| | | preInspection.setEquipmentInspectorUser(userId); |
| | | precisionInspectionService.updateById(preInspection); |
| | | |
| | | maintenanceOrder.setPrecisionInspectionStatus("3"); |
| | | dailyMaintenanceOrderService.updateById(maintenanceOrder); |
| | | } else if("3".equals(precisionInspectionStatus)){ |
| | | preInspection.setSparePart(precisionInspection.getSparePart()); |
| | | preInspection.setProcessPass(precisionInspection.getProcessPass()); |
| | | preInspection.setMeetProcessRequire(precisionInspection.getMeetProcessRequire()); |
| | | preInspection.setUseUnitDirectorUser(userId); |
| | | precisionInspectionService.updateById(preInspection); |
| | | |
| | | maintenanceOrder.setPrecisionInspectionStatus("4"); |
| | | dailyMaintenanceOrderService.updateById(maintenanceOrder); |
| | | }else if("4".equals(precisionInspectionStatus)){ |
| | | preInspection.setEquipmentInspectorSignUser(userId); |
| | | preInspection.setJudgmentResult(precisionInspection.getJudgmentResult()); |
| | | precisionInspectionService.updateById(preInspection); |
| | | |
| | | maintenanceOrder.setPrecisionInspectionStatus("5"); |
| | | maintenanceOrder.setStatus("8"); |
| | | dailyMaintenanceOrderService.updateById(maintenanceOrder); |
| | | } |
| | | |
| | | preInspection.setRemark(precisionInspection.getRemark()); |
| | | dailyMaintenanceOrderService.updateById(maintenanceOrder); |
| | | precisionInspectionService.updateById(preInspection); |
| | | |
| | | return Result.OK("审批成功!"); |
| | | } |