| | |
| | | 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.MdcProduction; |
| | | 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; |
| | |
| | | @RequestMapping("/eam/calibrationOrder") |
| | | @Slf4j |
| | | public class CalibrationOrderController { |
| | | |
| | | /** |
| | | * 用户类型(1 普通成员 2 工段 3 分厂/中心 4 公司) |
| | | */ |
| | | private static final Integer USER_TYPE_1 = 1; |
| | | private static final Integer USER_TYPE_2 = 2; |
| | | private static final Integer USER_TYPE_3 = 3; |
| | | private static final Integer USER_TYPE_4 = 4; |
| | | |
| | | /** |
| | | * 车间层级类型(1 公司 2 分厂、中心 3 工段) |
| | | */ |
| | | private static final String ORG_TYPE_1 = "1"; |
| | | private static final String ORG_TYPE_2 = "2"; |
| | | private static final String ORG_TYPE_3 = "3"; |
| | | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private ICalibrationOrderService calibrationOrderService; |
| | | @Autowired |
| | |
| | | |
| | | @Autowired |
| | | private IPrecisionParametersTemplateDetailService precisionParametersTemplateDetailService; |
| | | |
| | | @Autowired |
| | | private ITechnologyStatusService technologyStatusService; |
| | | |
| | | @Autowired |
| | | private ISysFileNameService sysFileNameService; |
| | | |
| | | @Autowired |
| | | private ISysDepartService sysDepartService; |
| | | // @Autowired |
| | | // private IUploadRelaService uploadRelaService; |
| | | // @Autowired |
| | | // private IUploadService uploadService; |
| | | |
| | | private ISysBaseAPI sysBaseApi; |
| | | |
| | | @Autowired |
| | | private IAreaService areaService; |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | |
| | | 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(ObjectUtils.isNotNull(depart)?depart.getDepartName():""); |
| | | } |
| | | List<Map<String, Object>> precisionParameterList = calibrationOrderService.getPrecisionParameterList(equipmentId); |
| | | record.setPrecisionParameterList(precisionParameterList); |
| | | if("4".equals(status)){ |
| | | if("data".equals(managementMode)){ |
| | | List<CalibrationOrderDetail> calibrationOrderDetails = calibrationOrderDetailService.lambdaQuery() |
| | | .eq(CalibrationOrderDetail::getCalibrationOrderId, id) |
| | | .eq(CalibrationOrderDetail::getJudgmentResult, "fail") |
| | | .eq(CalibrationOrderDetail::getDelFlag,"0").list(); |
| | | if(calibrationOrderDetails.size()>0){ |
| | | record.setCalibrationResult("异常"); |
| | | }else{ |
| | | record.setCalibrationResult("正常"); |
| | | } |
| | | }else{ |
| | | List<CalibrationOrderReport> calibrationOrderReports = calibrationOrderReportService.lambdaQuery() |
| | | .eq(CalibrationOrderReport::getCalibrationOrderId, id) |
| | | .eq(CalibrationOrderReport::getJudgmentResult, "fail") |
| | | .eq(CalibrationOrderReport::getDelFlag, "0").list(); |
| | | if(calibrationOrderReports.size()>0){ |
| | | record.setCalibrationResult("异常"); |
| | | }else{ |
| | | record.setCalibrationResult("正常"); |
| | | } |
| | | } |
| | | } |
| | | // List<Map<String, Object>> precisionParameterList = calibrationOrderService.getPrecisionParameterList(equipmentId); |
| | | // record.setPrecisionParameterList(precisionParameterList); |
| | | // if("4".equals(status)){ |
| | | // if("data".equals(managementMode)){ |
| | | // List<CalibrationOrderDetail> calibrationOrderDetails = calibrationOrderDetailService.lambdaQuery() |
| | | // .eq(CalibrationOrderDetail::getCalibrationOrderId, id) |
| | | // .eq(CalibrationOrderDetail::getJudgmentResult, "fail") |
| | | // .eq(CalibrationOrderDetail::getDelFlag,"0").list(); |
| | | // if(calibrationOrderDetails.size()>0){ |
| | | // record.setCalibrationResult("异常"); |
| | | // }else{ |
| | | // record.setCalibrationResult("正常"); |
| | | // } |
| | | // }else{ |
| | | // List<CalibrationOrderReport> calibrationOrderReports = calibrationOrderReportService.lambdaQuery() |
| | | // .eq(CalibrationOrderReport::getCalibrationOrderId, id) |
| | | // .eq(CalibrationOrderReport::getJudgmentResult, "fail") |
| | | // .eq(CalibrationOrderReport::getDelFlag, "0").list(); |
| | | // if(calibrationOrderReports.size()>0){ |
| | | // record.setCalibrationResult("异常"); |
| | | // }else{ |
| | | // record.setCalibrationResult("正常"); |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | return Result.OK(pageList); |
| | | } |
| | |
| | | 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); |
| | | } |
| | | |
| | | /** |
| | |
| | | Equipment equipment = equipmentService.getById(equipmentId); |
| | | if(ObjectUtils.isNotNull(equipment)){ |
| | | LocalDate currentDate = LocalDate.now(); |
| | | |
| | | // 添加30天 |
| | | // 添加维护周期的日期 |
| | | String checkPeriod = equipment.getCheckPeriod(); |
| | | if(StringUtils.isNotBlank(checkPeriod)){ |
| | | LocalDate dateAfter30Days = currentDate.plusDays(Integer.parseInt(checkPeriod)); |
| | |
| | | calibrationOrderService.updateById(calibrationOrder); |
| | | return Result.OK("编辑成功!"); |
| | | } |
| | | |
| | | /** |
| | | *首页公司级 技术状态数量统计 |
| | | * qsw 2024-3-13 |
| | | */ |
| | | @GetMapping("getFactoryEquipmentTechnologyStatusList") |
| | | public Result<?> getFactoryEquipmentTechnologyStatusList() { |
| | | List<Map<String, Object>> list = calibrationOrderService.getFactoryEquipmentTechnologyStatusList(); |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | /** |
| | | *首页公司级 设备报修情况统计 |
| | | * qsw 2024-3-13 |
| | | */ |
| | | @GetMapping("getFactoryReportRepairEquipmentList") |
| | | public Result<?> getFactoryReportRepairEquipmentList() { |
| | | List<Map<String, Object>> list = calibrationOrderService.getFactoryReportRepairEquipmentList(); |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | /** |
| | | *首页公司级 本月三保计划 |
| | | * qsw 2024-3-14 |
| | | */ |
| | | @GetMapping("getFactoryThisMonthMaintenanceList") |
| | | public Result<?> getFactoryThisMonthMaintenanceList() { |
| | | List<Map<String, Object>> list = calibrationOrderService.getFactoryThisMonthMaintenanceList(); |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | /** |
| | | *首页公司级 下月三保计划 |
| | | * qsw 2024-3-14 |
| | | */ |
| | | @GetMapping("getFactoryNextMonthMaintenanceList") |
| | | public Result<?> getFactoryNextMonthMaintenanceList() { |
| | | List<Map<String, Object>> list = calibrationOrderService.getFactoryNextMonthMaintenanceList(); |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | /** |
| | | *首页公司级 本月三保完成数量 |
| | | * qsw 2024-3-14 |
| | | */ |
| | | @GetMapping("getFactoryThisMonthMaintenanceFinishList") |
| | | public Result<?> getFactoryThisMonthMaintenanceFinishList() { |
| | | List<Map<String, Object>> list = calibrationOrderService.getFactoryThisMonthMaintenanceFinishList(); |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | /** |
| | | *首页公司级 下下月三保计划 |
| | | * qsw 2024-3-14 |
| | | */ |
| | | @GetMapping("getFactoryNextNextMonthMaintenanceList") |
| | | public Result<?> getFactoryNextNextMonthMaintenanceList() { |
| | | List<Map<String, Object>> list = calibrationOrderService.getFactoryNextNextMonthMaintenanceList(); |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | *首页(二级页面)技术状态数量统计 |
| | | * qsw 2024-3-13 |
| | | */ |
| | | @GetMapping("getEquipmentTechnologyStatusList") |
| | | public Result<?> getEquipmentTechnologyStatusList(String productionCode) { |
| | | |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | Integer userType = user.getUserType(); |
| | | List<Map<String, Object>> list = null; |
| | | if(USER_TYPE_4.equals(userType)){ |
| | | if(StringUtils.isBlank(productionCode)){ |
| | | list = calibrationOrderService.getFactoryEquipmentTechnologyStatusList(); |
| | | }else{ |
| | | String orgType = calibrationOrderService.findOrgType(productionCode); |
| | | if(ORG_TYPE_2.equals(orgType)){ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "1").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getEquipmentTechnologyStatusList(area.getId(),""); |
| | | } |
| | | }else if(ORG_TYPE_3.equals(orgType)){ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getEquipmentTechnologyStatusList("",area.getId()); |
| | | } |
| | | } |
| | | } |
| | | }else if(USER_TYPE_3.equals(userType)){ |
| | | String code = calibrationOrderService.findProductionCode(user.getId()); |
| | | if(StringUtils.isBlank(productionCode)){ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, code).eq(Area::getType, "1").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getEquipmentTechnologyStatusList(area.getId(),""); |
| | | } |
| | | }else{ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getEquipmentTechnologyStatusList("",area.getId()); |
| | | } |
| | | } |
| | | }else if(USER_TYPE_2.equals(userType)){ |
| | | String areaProductionCode = calibrationOrderService.findAreaProductionCode(user.getId()); |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, areaProductionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getEquipmentTechnologyStatusList("",area.getId()); |
| | | } |
| | | } |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | /** |
| | | *首页(二级页面)设备报修情况统计 |
| | | * qsw 2024-3-13 |
| | | */ |
| | | @GetMapping("getReportRepairEquipmentList") |
| | | public Result<?> getReportRepairEquipmentList(String productionCode) { |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | Integer userType = user.getUserType(); |
| | | List<Map<String, Object>> list = null; |
| | | if(USER_TYPE_4.equals(userType)){ |
| | | if(StringUtils.isBlank(productionCode)){ |
| | | list = calibrationOrderService.getFactoryReportRepairEquipmentList(); |
| | | }else{ |
| | | String orgType = calibrationOrderService.findOrgType(productionCode); |
| | | if(ORG_TYPE_2.equals(orgType)){ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "1").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getReportRepairEquipmentList(area.getId(),""); |
| | | } |
| | | }else if(ORG_TYPE_3.equals(orgType)){ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getReportRepairEquipmentList("",area.getId()); |
| | | } |
| | | } |
| | | } |
| | | }else if(USER_TYPE_3.equals(userType)){ |
| | | String code = calibrationOrderService.findProductionCode(user.getId()); |
| | | if(StringUtils.isBlank(productionCode)){ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, code).eq(Area::getType, "1").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getReportRepairEquipmentList(area.getId(),""); |
| | | } |
| | | }else{ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getReportRepairEquipmentList("",area.getId()); |
| | | } |
| | | } |
| | | }else if(USER_TYPE_2.equals(userType)){ |
| | | String areaProductionCode = calibrationOrderService.findAreaProductionCode(user.getId()); |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, areaProductionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getReportRepairEquipmentList("",area.getId()); |
| | | } |
| | | } |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | /** |
| | | *首页(二级页面)本月三保计划 |
| | | * qsw 2024-3-14 |
| | | */ |
| | | @GetMapping("getThisMonthMaintenanceList") |
| | | public Result<?> getThisMonthMaintenanceList(String productionCode) { |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | Integer userType = user.getUserType(); |
| | | List<Map<String, Object>> list = null; |
| | | if(USER_TYPE_4.equals(userType)){ |
| | | if(StringUtils.isBlank(productionCode)){ |
| | | list = calibrationOrderService.getFactoryThisMonthMaintenanceList(); |
| | | }else{ |
| | | String orgType = calibrationOrderService.findOrgType(productionCode); |
| | | if(ORG_TYPE_2.equals(orgType)){ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "1").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getThisMonthMaintenanceList(area.getId(),""); |
| | | } |
| | | }else if(ORG_TYPE_3.equals(orgType)){ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getThisMonthMaintenanceList("",area.getId()); |
| | | } |
| | | } |
| | | } |
| | | }else if(USER_TYPE_3.equals(userType)){ |
| | | String code = calibrationOrderService.findProductionCode(user.getId()); |
| | | if(StringUtils.isBlank(productionCode)){ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, code).eq(Area::getType, "1").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getThisMonthMaintenanceList(area.getId(),""); |
| | | } |
| | | }else{ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getThisMonthMaintenanceList("",area.getId()); |
| | | } |
| | | } |
| | | }else if(USER_TYPE_2.equals(userType)){ |
| | | String areaProductionCode = calibrationOrderService.findAreaProductionCode(user.getId()); |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, areaProductionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getThisMonthMaintenanceList("",area.getId()); |
| | | } |
| | | } |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | /** |
| | | *首页(二级页面)下月三保计划 |
| | | * qsw 2024-3-14 |
| | | */ |
| | | @GetMapping("getNextMonthMaintenanceList") |
| | | public Result<?> getNextMonthMaintenanceList(String productionCode) { |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | Integer userType = user.getUserType(); |
| | | List<Map<String, Object>> list = null; |
| | | if(USER_TYPE_4.equals(userType)){ |
| | | if(StringUtils.isBlank(productionCode)){ |
| | | list = calibrationOrderService.getFactoryNextMonthMaintenanceList(); |
| | | }else{ |
| | | String orgType = calibrationOrderService.findOrgType(productionCode); |
| | | if(ORG_TYPE_2.equals(orgType)){ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "1").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getNextMonthMaintenanceList(area.getId(),""); |
| | | } |
| | | }else if(ORG_TYPE_3.equals(orgType)){ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getNextMonthMaintenanceList("",area.getId()); |
| | | } |
| | | } |
| | | } |
| | | }else if(USER_TYPE_3.equals(userType)){ |
| | | String code = calibrationOrderService.findProductionCode(user.getId()); |
| | | if(StringUtils.isBlank(productionCode)){ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, code).eq(Area::getType, "1").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getNextMonthMaintenanceList(area.getId(),""); |
| | | } |
| | | }else{ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getNextMonthMaintenanceList("",area.getId()); |
| | | } |
| | | } |
| | | }else if(USER_TYPE_2.equals(userType)){ |
| | | String areaProductionCode = calibrationOrderService.findAreaProductionCode(user.getId()); |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, areaProductionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getNextMonthMaintenanceList("",area.getId()); |
| | | } |
| | | } |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | /** |
| | | *首页(二级页面)下下月三保计划 |
| | | * qsw 2024-3-14 |
| | | */ |
| | | @GetMapping("getNextNextMonthMaintenanceList") |
| | | public Result<?> getNextNextMonthMaintenanceList(String productionCode) { |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | Integer userType = user.getUserType(); |
| | | List<Map<String, Object>> list = null; |
| | | if(USER_TYPE_4.equals(userType)){ |
| | | if(StringUtils.isBlank(productionCode)){ |
| | | list = calibrationOrderService.getFactoryNextNextMonthMaintenanceList(); |
| | | }else{ |
| | | String orgType = calibrationOrderService.findOrgType(productionCode); |
| | | if(ORG_TYPE_2.equals(orgType)){ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "1").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getNextNextMonthMaintenanceList(area.getId(),""); |
| | | } |
| | | }else if(ORG_TYPE_3.equals(orgType)){ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getNextNextMonthMaintenanceList("",area.getId()); |
| | | } |
| | | } |
| | | } |
| | | }else if(USER_TYPE_3.equals(userType)){ |
| | | String code = calibrationOrderService.findProductionCode(user.getId()); |
| | | if(StringUtils.isBlank(productionCode)){ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, code).eq(Area::getType, "1").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getNextNextMonthMaintenanceList(area.getId(),""); |
| | | } |
| | | }else{ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getNextNextMonthMaintenanceList("",area.getId()); |
| | | } |
| | | } |
| | | }else if(USER_TYPE_2.equals(userType)){ |
| | | String areaProductionCode = calibrationOrderService.findAreaProductionCode(user.getId()); |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, areaProductionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getNextNextMonthMaintenanceList("",area.getId()); |
| | | } |
| | | } |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | /** |
| | | *首页(二级页面)本月三保完成数量 |
| | | * qsw 2024-3-14 |
| | | */ |
| | | @GetMapping("getThisMonthMaintenanceFinishList") |
| | | public Result<?> getThisMonthMaintenanceFinishList(String productionCode) { |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | Integer userType = user.getUserType(); |
| | | List<Map<String, Object>> list = null; |
| | | if(USER_TYPE_4.equals(userType)){ |
| | | if(StringUtils.isBlank(productionCode)){ |
| | | list = calibrationOrderService.getFactoryThisMonthMaintenanceFinishList(); |
| | | }else{ |
| | | String orgType = calibrationOrderService.findOrgType(productionCode); |
| | | if(ORG_TYPE_2.equals(orgType)){ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "1").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getThisMonthMaintenanceFinishList(area.getId(),""); |
| | | } |
| | | }else if(ORG_TYPE_3.equals(orgType)){ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getThisMonthMaintenanceFinishList("",area.getId()); |
| | | } |
| | | } |
| | | } |
| | | }else if(USER_TYPE_3.equals(userType)){ |
| | | String code = calibrationOrderService.findProductionCode(user.getId()); |
| | | if(StringUtils.isBlank(productionCode)){ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, code).eq(Area::getType, "1").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getThisMonthMaintenanceFinishList(area.getId(),""); |
| | | } |
| | | }else{ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getThisMonthMaintenanceFinishList("",area.getId()); |
| | | } |
| | | } |
| | | }else if(USER_TYPE_2.equals(userType)){ |
| | | String areaProductionCode = calibrationOrderService.findAreaProductionCode(user.getId()); |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, areaProductionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getThisMonthMaintenanceFinishList("",area.getId()); |
| | | } |
| | | } |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | /** |
| | | * 工段级 三保延期数量 |
| | | * qsw 2024-3-20 |
| | | */ |
| | | @GetMapping("get3MaintenancePostponeCount") |
| | | public Result<?> get3MaintenancePostponeCount(String productionCode) { |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | Integer userType = user.getUserType(); |
| | | List<Map<String, Object>> list = null; |
| | | if(USER_TYPE_4.equals(userType)){ |
| | | if(StringUtils.isNotBlank(productionCode)){ |
| | | String orgType = calibrationOrderService.findOrgType(productionCode); |
| | | if(ORG_TYPE_3.equals(orgType)){ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.get3MaintenancePostponeCount(area.getId()); |
| | | } |
| | | } |
| | | } |
| | | }else if(USER_TYPE_3.equals(userType)){ |
| | | if(StringUtils.isNotBlank(productionCode)){ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.get3MaintenancePostponeCount(area.getId()); |
| | | } |
| | | } |
| | | }else if(USER_TYPE_2.equals(userType)){ |
| | | String areaProductionCode = calibrationOrderService.findAreaProductionCode(user.getId()); |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, areaProductionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.get3MaintenancePostponeCount(area.getId()); |
| | | } |
| | | } |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | /** |
| | | * 工段级 三保超期数量 |
| | | * qsw 2024-3-20 |
| | | */ |
| | | @GetMapping("get3MaintenanceOverdueCount") |
| | | public Result<?> get3MaintenanceOverdueCount(String productionCode) { |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | Integer userType = user.getUserType(); |
| | | List<Map<String, Object>> list = null; |
| | | if(USER_TYPE_4.equals(userType)){ |
| | | if(StringUtils.isNotBlank(productionCode)){ |
| | | String orgType = calibrationOrderService.findOrgType(productionCode); |
| | | if(ORG_TYPE_3.equals(orgType)){ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.get3MaintenanceOverdueCount(area.getId()); |
| | | } |
| | | } |
| | | } |
| | | }else if(USER_TYPE_3.equals(userType)){ |
| | | if(StringUtils.isNotBlank(productionCode)){ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.get3MaintenanceOverdueCount(area.getId()); |
| | | } |
| | | } |
| | | }else if(USER_TYPE_2.equals(userType)){ |
| | | String areaProductionCode = calibrationOrderService.findAreaProductionCode(user.getId()); |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, areaProductionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.get3MaintenanceOverdueCount(area.getId()); |
| | | } |
| | | } |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | /** |
| | | *首页二保计划展示 |
| | | * qsw 2024-3-15 |
| | | */ |
| | | @GetMapping("getTwoMaintenancePlanList") |
| | | public Result<?> getTwoMaintenancePlanList(String productionCode) { |
| | | List<Map<String, Object>> twoMaintenancePlanList = calibrationOrderService.getTwoMaintenancePlanList(productionCode); |
| | | return Result.ok(twoMaintenancePlanList); |
| | | } |
| | | |
| | | /** |
| | | *首页 第四级 对应工区下,设备台账信息展示; |
| | | * qsw 2024-4-22 |
| | | */ |
| | | @GetMapping("getAreaEquipmentList") |
| | | public Result<?> getAreaEquipmentList(String equipmentNum) { |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | Integer userType = user.getUserType(); |
| | | List<Map<String, Object>> list = null; |
| | | if(!USER_TYPE_1.equals(userType)){ |
| | | list = calibrationOrderService.getAreaEquipmentList(equipmentNum,"",null); |
| | | } |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | /** |
| | | *首页 第四级 对应工区下,所有设备台账信息展示; |
| | | * qsw 2024-4-22 |
| | | */ |
| | | @GetMapping("getAllAreaEquipmentList") |
| | | public Result<?> getAllAreaEquipmentList(String productionCode) { |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | Integer userType = user.getUserType(); |
| | | List<Map<String, Object>> list = null; |
| | | if(!USER_TYPE_1.equals(userType)){ |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getAreaEquipmentList("",area.getId(),null); |
| | | } |
| | | }else{ |
| | | List<Map<String, Object>> operationCertificatelist = calibrationOrderService.getOperationCertificate(user.getUsername()); |
| | | if(operationCertificatelist.size()>0){ |
| | | String equipmentIds = (String)operationCertificatelist.get(0).get("equipmentIds"); |
| | | List<String> strings = Arrays.asList(equipmentIds.split(",")); |
| | | list = calibrationOrderService.getAreaEquipmentList("","",strings); |
| | | } |
| | | } |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | /** |
| | | *首页 第四级 对应工区下,所有设备台账信息展示; |
| | | * qsw 2024-4-22 |
| | | */ |
| | | @GetMapping("getOperationCertificate") |
| | | public Result<?> getOperationCertificate() { |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | List<Map<String, Object>> list = calibrationOrderService.getOperationCertificate(user.getUsername()); |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | } |