From 7a8840d7a9f86378408756df12021fdea7755278 Mon Sep 17 00:00:00 2001 From: Houjie <714924425@qq.com> Date: 星期五, 11 七月 2025 14:37:22 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamDashboardController.java | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 40 insertions(+), 2 deletions(-) diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamDashboardController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamDashboardController.java index 8e4a1b1..880018f 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamDashboardController.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamDashboardController.java @@ -3,17 +3,22 @@ import cn.hutool.core.collection.CollectionUtil; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.parser.Feature; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.fasterxml.jackson.databind.ObjectMapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.SecurityUtils; import org.jeecg.common.api.vo.Result; import org.jeecg.common.constant.CommonConstant; +import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.util.DateUtils; import org.jeecg.common.util.TranslateDictTextUtils; -import org.jeecg.modules.eam.constant.EquipmentMaintenanceStatus; -import org.jeecg.modules.eam.constant.EquipmentRepairStatus; +import org.jeecg.modules.eam.constant.*; import org.jeecg.modules.eam.entity.EamEquipment; +import org.jeecg.modules.eam.entity.EamInspectionOrder; +import org.jeecg.modules.eam.entity.EamRepairOrder; +import org.jeecg.modules.eam.entity.EamWeekMaintenanceOrder; import org.jeecg.modules.eam.service.*; import org.jeecg.modules.eam.vo.*; import org.springframework.beans.factory.annotation.Autowired; @@ -247,4 +252,37 @@ return Result.error("鏁版嵁杞瘧澶辫触锛�"); } } + + @ApiOperation(value = "H5棣栭〉-寰呮墽琛屽伐鍗曟暟閲忕粺璁�", notes = "H5棣栭〉-寰呮墽琛屽伐鍗曟暟閲忕粺璁�") + @GetMapping(value = "/pendingExecOrderCountBySelf") + public Result<?> pendingExecOrderCountBySelf() { + LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + String post = user.getPost(); + Map<String, Integer> countMap = CollectionUtil.newHashMap(); + if (BusinessCodeConst.PCR0001.equals(post)) { + //鏄搷浣滃伐锛屾煡璇㈠緟鐐规宸ュ崟銆佸緟鍛ㄤ繚宸ュ崟 + List<EamInspectionOrder> unExecInspectionOrderList = inspectionOrderService.list(new LambdaQueryWrapper<EamInspectionOrder>() + .eq(EamInspectionOrder::getOperator, user.getUsername()) + .eq(EamInspectionOrder::getInspectionStatus, InspectionStatus.UNDER_INSPECTION.name()) + .eq(EamInspectionOrder::getDelFlag, CommonConstant.DEL_FLAG_0)); + List<EamWeekMaintenanceOrder> unExecMaintenanceOrderList = weekMaintenanceOrderService.list(new LambdaQueryWrapper<EamWeekMaintenanceOrder>() + .eq(EamWeekMaintenanceOrder::getOperator, user.getUsername()) + .eq(EamWeekMaintenanceOrder::getMaintenanceStatus, WeekMaintenanceStatusEnum.UNDER_MAINTENANCE.name()) + .eq(EamWeekMaintenanceOrder::getDelFlag, CommonConstant.DEL_FLAG_0)); + countMap.put("unExecInspectionOrderCount", unExecInspectionOrderList.size()); + countMap.put("unExecMaintenanceOrderCount", unExecMaintenanceOrderList.size()); + countMap.put("unExecRepairOrderCount", 0); + } + if (BusinessCodeConst.PCR0002.equals(post)) { + //鏄淮淇伐锛屾煡璇㈠緟缁翠慨宸ュ崟 + List<EamRepairOrder> unExecRepairOrderList = repairOrderService.list(new LambdaQueryWrapper<EamRepairOrder>() + .eq(EamRepairOrder::getRepairer, user.getUsername()) + .eq(EamRepairOrder::getRepairStatus, EquipmentRepairStatus.UNDER_REPAIR.name()) + .eq(EamRepairOrder::getDelFlag, CommonConstant.DEL_FLAG_0)); + countMap.put("unExecInspectionOrderCount", 0); + countMap.put("unExecMaintenanceOrderCount", 0); + countMap.put("unExecRepairOrderCount", unExecRepairOrderList.size()); + } + return Result.OK(countMap); + } } -- Gitblit v1.9.3