From 8e64f19220268a9e375c955afa4e8f404ed88859 Mon Sep 17 00:00:00 2001
From: qushaowei <qushaowei@163.com>
Date: 星期六, 25 五月 2024 16:54:36 +0800
Subject: [PATCH] 主页 技术状态、三保、报修明细接口

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/CalibrationOrderController.java |  373 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 373 insertions(+), 0 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 2f108ad..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
@@ -1210,4 +1210,377 @@
         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