From 9b015b51b72ba050b4c38a6ba79eb45b7065e67d Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期四, 25 七月 2024 10:11:52 +0800
Subject: [PATCH] 调整sql

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/CalibrationOrderController.java |  952 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 948 insertions(+), 4 deletions(-)

diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/CalibrationOrderController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/CalibrationOrderController.java
index 43afffa..30b0141 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/CalibrationOrderController.java
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/CalibrationOrderController.java
@@ -25,6 +25,10 @@
 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;
@@ -58,6 +62,25 @@
 @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
@@ -70,12 +93,24 @@
 
     @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;
     /**
      * 鍒嗛〉鍒楄〃鏌ヨ
      *
@@ -458,14 +493,18 @@
             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);
+//            List<Map<String, Object>> precisionParameterList = calibrationOrderService.getPrecisionParameterList(equipmentId);
+//            record.setPrecisionParameterList(precisionParameterList);
 //            if("4".equals(status)){
 //                if("data".equals(managementMode)){
 //                    List<CalibrationOrderDetail> calibrationOrderDetails = calibrationOrderDetailService.lambdaQuery()
@@ -503,7 +542,7 @@
         for (CalibrationOrderDetail calibrationOrderDetail : calibrationOrderDetails) {
             calibrationOrderDetailService.removeById(calibrationOrderDetail);
         }
-        addAndEdit(calibrationOrder);
+//        addAndEdit(calibrationOrder);
         return Result.OK("缂栬緫鎴愬姛!");
     }
 
@@ -532,8 +571,24 @@
     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);
     }
 
     /**
@@ -639,4 +694,893 @@
         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 = calibrationOrderService.getAreaEquipmentList(equipmentNum,"",null);
+        for (Map<String, Object> map : list) {
+           String equipmentId =  (String)map.get("id");
+            List<Map<String, Object>> counts = calibrationOrderService.getEquipmentReportRepairCount(equipmentId);
+            if(counts.size()>0){
+                map.put("repairCount",counts.get(0).get("repairCount"));
+            }else{
+                map.put("repairCount","0");
+            }
+        }
+        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);
+                for (Map<String, Object> map : list) {
+                    String equipmentId =  (String)map.get("id");
+                    List<Map<String, Object>> counts = calibrationOrderService.getEquipmentReportRepairCount(equipmentId);
+                    if(counts.size()>0){
+                        map.put("repairCount",counts.get(0).get("repairCount"));
+                    }else{
+                        map.put("repairCount","0");
+                    }
+                }
+            }
+        }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);
+                for (Map<String, Object> map : list) {
+                    String equipmentId =  (String)map.get("id");
+                    List<Map<String, Object>> counts = calibrationOrderService.getEquipmentReportRepairCount(equipmentId);
+                    if(counts.size()>0){
+                        map.put("repairCount",counts.get(0).get("repairCount"));
+                    }else{
+                        map.put("repairCount","0");
+                    }
+                }
+            }
+        }
+        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);
+    }
+
+
+    /**
+     *棣栭〉 鎶�鏈姸鎬佺偣鍑诲脊鍑哄搴旀槑缁�
+     * qsw 2024-5-23
+     */
+    @GetMapping("showEquipmentByTechnologyStatus")
+    public Result<?> getEquipmentByTechnologyStatus(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize,String productionCode,String technologyStatus) {
+        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        Integer userType = user.getUserType();
+        IPage<Map<String, Object>> equipments = null;
+        if(USER_TYPE_4.equals(userType)){
+            if(StringUtils.isBlank(productionCode)){
+                equipments = calibrationOrderService.getEquipmentByTechnologyStatus(pageNo, pageSize, "", "", technologyStatus);
+            }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){
+                        equipments = calibrationOrderService.getEquipmentByTechnologyStatus(pageNo, pageSize, area.getId(), "", technologyStatus);
+                    }
+                }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){
+                        equipments = calibrationOrderService.getEquipmentByTechnologyStatus(pageNo, pageSize, "", area.getId(), technologyStatus);
+                    }
+                }
+            }
+        }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){
+                    equipments = calibrationOrderService.getEquipmentByTechnologyStatus(pageNo, pageSize, area.getId(), "", technologyStatus);
+                }
+            }else{
+                Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0));
+                if(area != null){
+                    equipments = calibrationOrderService.getEquipmentByTechnologyStatus(pageNo, pageSize, "", area.getId(), technologyStatus);
+                }
+            }
+        }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){
+                equipments = calibrationOrderService.getEquipmentByTechnologyStatus(pageNo, pageSize, "", area.getId(), technologyStatus);
+            }
+        }
+        return Result.ok(equipments);
+    }
+
+
+    /**
+     *棣栭〉 璁惧鎶ヤ慨鎯呭喌缁熻鏄庣粏灞曠ず
+     * qsw 2024-5-25
+     */
+    @GetMapping("showEquipmentByReportRepair")
+    public Result<?> getEquipmentByReportRepair(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize,String productionCode,String isStop) {
+        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        Integer userType = user.getUserType();
+        IPage<Map<String, Object>> equipments = null;
+        if(USER_TYPE_4.equals(userType)){
+            if(StringUtils.isBlank(productionCode)){
+                equipments = calibrationOrderService.getEquipmentByReportRepair(pageNo, pageSize, "", "", isStop);
+            }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){
+                        equipments = calibrationOrderService.getEquipmentByReportRepair(pageNo, pageSize, area.getId(), "", isStop);
+                    }
+                }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){
+                        equipments = calibrationOrderService.getEquipmentByReportRepair(pageNo, pageSize, "", area.getId(), isStop);
+                    }
+                }
+            }
+        }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){
+                    equipments = calibrationOrderService.getEquipmentByReportRepair(pageNo, pageSize, area.getId(), "", isStop);
+                }
+            }else{
+                Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0));
+                if(area != null){
+                    equipments = calibrationOrderService.getEquipmentByReportRepair(pageNo, pageSize, "", area.getId(), isStop);
+                }
+            }
+        }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){
+                equipments = calibrationOrderService.getEquipmentByReportRepair(pageNo, pageSize, "", area.getId(), isStop);
+            }
+        }
+        return Result.ok(equipments);
+    }
+
+    /**
+     *棣栭〉鏈湀涓変繚璁″垝鏄庣粏
+     * qsw 2024-3-14
+     */
+    @GetMapping("showThisMonthMaintenanceList")
+    public Result<?> showThisMonthMaintenanceList(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize,String productionCode) {
+        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        Integer userType = user.getUserType();
+        IPage<Map<String, Object>> equipments = null;
+        if(USER_TYPE_4.equals(userType)){
+            if(StringUtils.isBlank(productionCode)){
+                equipments = calibrationOrderService.showThisMonthMaintenanceList(pageNo, pageSize, "", "");
+            }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){
+                        equipments = calibrationOrderService.showThisMonthMaintenanceList(pageNo, pageSize, 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){
+                        equipments = calibrationOrderService.showThisMonthMaintenanceList(pageNo, pageSize, "", 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){
+                    equipments = calibrationOrderService.showThisMonthMaintenanceList(pageNo, pageSize, 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){
+                    equipments = calibrationOrderService.showThisMonthMaintenanceList(pageNo, pageSize, "", 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){
+                equipments = calibrationOrderService.showThisMonthMaintenanceList(pageNo, pageSize, "", area.getId());
+            }
+        }
+        return Result.ok(equipments);
+    }
+
+
+    /**
+     *棣栭〉涓嬫湀涓変繚璁″垝鏄庣粏灞曠ず
+     * qsw 2024-3-14
+     */
+    @GetMapping("showNextMonthMaintenanceList")
+    public Result<?> showNextMonthMaintenanceList(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize,String productionCode) {
+        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        Integer userType = user.getUserType();
+        IPage<Map<String, Object>> equipments = null;
+        if(USER_TYPE_4.equals(userType)){
+            if(StringUtils.isBlank(productionCode)){
+                equipments = calibrationOrderService.showNextMonthMaintenanceList(pageNo, pageSize, "", "");
+            }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){
+                        equipments = calibrationOrderService.showNextMonthMaintenanceList(pageNo, pageSize, 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){
+                        equipments = calibrationOrderService.showNextMonthMaintenanceList(pageNo, pageSize, "", 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){
+                    equipments = calibrationOrderService.showNextMonthMaintenanceList(pageNo, pageSize, 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){
+                    equipments = calibrationOrderService.showNextMonthMaintenanceList(pageNo, pageSize, "", 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){
+                equipments = calibrationOrderService.showNextMonthMaintenanceList(pageNo, pageSize, "", area.getId());
+            }
+        }
+        return Result.ok(equipments);
+    }
+
+    /**
+     *棣栭〉锛堜簩绾ч〉闈級涓嬩笅鏈堜笁淇濊鍒掓槑缁�
+     * qsw 2024-3-14
+     */
+    @GetMapping("showNextNextMonthMaintenanceList")
+    public Result<?> showNextNextMonthMaintenanceList(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize,String productionCode) {
+        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        Integer userType = user.getUserType();
+//        List<Map<String, Object>> list = null;
+        IPage<Map<String, Object>> equipments = null;
+        if(USER_TYPE_4.equals(userType)){
+            if(StringUtils.isBlank(productionCode)){
+                equipments = calibrationOrderService.showNextNextMonthMaintenanceList(pageNo, pageSize, "", "");
+            }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){
+                        equipments = calibrationOrderService.showNextNextMonthMaintenanceList(pageNo, pageSize, 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){
+                        equipments = calibrationOrderService.showNextNextMonthMaintenanceList(pageNo, pageSize, "", 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){
+                    equipments = calibrationOrderService.showNextNextMonthMaintenanceList(pageNo, pageSize, 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){
+                    equipments = calibrationOrderService.showNextNextMonthMaintenanceList(pageNo, pageSize, "", 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){
+                equipments = calibrationOrderService.showNextNextMonthMaintenanceList(pageNo, pageSize, "", area.getId());
+            }
+        }
+        return Result.ok(equipments);
+    }
+
+    /**
+     *棣栭〉锛堜簩绾ч〉闈級鏈湀涓変繚瀹屾垚璁惧鏄庣粏
+     * qsw 2024-3-14
+     */
+    @GetMapping("showThisMonthMaintenanceFinishList")
+    public Result<?> showThisMonthMaintenanceFinishList(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize,String productionCode) {
+        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        Integer userType = user.getUserType();
+        IPage<Map<String, Object>> equipments = null;
+        if(USER_TYPE_4.equals(userType)){
+            if(StringUtils.isBlank(productionCode)){
+                equipments = calibrationOrderService.showThisMonthMaintenanceFinishList(pageNo, pageSize, "", "");
+            }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){
+                        equipments = calibrationOrderService.showThisMonthMaintenanceFinishList(pageNo, pageSize, 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){
+                        equipments = calibrationOrderService.showThisMonthMaintenanceFinishList(pageNo, pageSize, "", 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){
+                    equipments = calibrationOrderService.showThisMonthMaintenanceFinishList(pageNo, pageSize, 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){
+                    equipments = calibrationOrderService.showThisMonthMaintenanceFinishList(pageNo, pageSize, "", 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){
+                equipments = calibrationOrderService.showThisMonthMaintenanceFinishList(pageNo, pageSize, "", area.getId());
+            }
+        }
+        return Result.ok(equipments);
+    }
+
+    /**
+     * 宸ユ绾� 涓変繚寤舵湡鏁伴噺鏄庣粏
+     * qsw 2024-3-20
+     */
+    @GetMapping("show3MaintenancePostponeList")
+    public Result<?> show3MaintenancePostponeList(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize,String productionCode) {
+        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        Integer userType = user.getUserType();
+        IPage<Map<String, Object>> equipments = 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){
+                        equipments = calibrationOrderService.show3MaintenancePostponeCount(pageNo, pageSize,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){
+                    equipments = calibrationOrderService.show3MaintenancePostponeCount(pageNo, pageSize,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){
+                equipments = calibrationOrderService.show3MaintenancePostponeCount(pageNo, pageSize,area.getId());
+            }
+        }
+        return Result.ok(equipments);
+    }
+
+    /**
+     * 宸ユ绾� 涓変繚瓒呮湡鏁伴噺鏄庣粏
+     * qsw 2024-3-20
+     */
+    @GetMapping("show3MaintenanceOverdueList")
+    public Result<?> show3MaintenanceOverdueList(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize,String productionCode) {
+        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        Integer userType = user.getUserType();
+        IPage<Map<String, Object>> equipments = 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){
+                        equipments = calibrationOrderService.show3MaintenanceOverdueCount(pageNo, pageSize, 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){
+                    equipments = calibrationOrderService.show3MaintenanceOverdueCount(pageNo, pageSize, 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){
+                equipments = calibrationOrderService.show3MaintenanceOverdueCount(pageNo, pageSize, area.getId());
+            }
+        }
+        return Result.ok(equipments);
+    }
+
+
+
+
 }

--
Gitblit v1.9.3