From 4bd74ded216856176d47a87f69572084023be329 Mon Sep 17 00:00:00 2001 From: Lius <Lius2225@163.com> Date: 星期二, 02 四月 2024 16:49:19 +0800 Subject: [PATCH] 工段级看板接口 --- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcHomeController.java | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 42 insertions(+), 0 deletions(-) diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcHomeController.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcHomeController.java index 970f4fb..65d39c8 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcHomeController.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcHomeController.java @@ -10,6 +10,7 @@ import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.system.vo.LoginUser; import org.jeecg.modules.mdc.constant.MdcConstant; +import org.jeecg.modules.mdc.entity.MdcOverallEquipmentEfficiency; import org.jeecg.modules.mdc.service.IMdcEquipmentService; import org.jeecg.modules.mdc.service.IMdcHomeService; import org.jeecg.modules.mdc.vo.MdcCommonVo; @@ -64,6 +65,9 @@ } else if (userType.equals(MdcConstant.USER_TYPE_3)) { //鍘傚尯 key = mdcProductionService.findFirstProduction(userId, mdcProduction.getId()); + } else if (userType.equals(MdcConstant.USER_TYPE_2)) { + //宸ユ 鏌ヨ鐢ㄦ埛鎷ユ湁鐨勫伐娈垫潈闄� + key = mdcProductionService.findThreeProductionId(userId); } } List<MdcCommonVo> resultMap = mdcHomeService.getEquipmentStatusStatistics(userId, key); @@ -150,4 +154,42 @@ Map<String, Object> result = mdcHomeService.getEquipmentMonthStatistics(userId, key); return Result.OK(result); } + + @ApiOperation(value = "MDC棣栭〉鎺ュ彛-宸ユ绾у墠涓冨ぉ鍒╃敤鐜囨姌绾垮浘", notes = "MDC棣栭〉鎺ュ彛-宸ユ绾у墠涓冨ぉ鍒╃敤鐜囨姌绾垮浘") + @GetMapping("/equipmentDayUtilizationStatistics") + public Result<?> equipmentDayUtilizationStatistics(String productionCode) { + LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + String userId = user.getId(); + String key = ""; + if (StringUtils.isNotBlank(productionCode)) { + //鍘傚尯 + MdcProduction mdcProduction = mdcProductionService.getOne(new LambdaQueryWrapper<MdcProduction>().eq(MdcProduction::getProductionCode, productionCode).eq(MdcProduction::getDelFlag, CommonConstant.DEL_FLAG_0.toString())); + key = mdcProduction.getId(); + } else { + //宸ユ 鏌ヨ鐢ㄦ埛鎷ユ湁鐨勫伐娈垫潈闄� + key = mdcProductionService.findThreeProductionId(userId); + } + Map<String, Object> result = mdcHomeService.getEquipmentDayUtilizationStatistics(userId, key); + return Result.OK(result); + } + + @ApiOperation(value = "MDC棣栭〉鎺ュ彛-涓婃湀鍚勮澶嘜EE缁熻", notes = "MDC棣栭〉鎺ュ彛-涓婃湀鍚勮澶嘜EE缁熻") + @GetMapping("/equipmentOEEMonthStatistics") + public Result<?> equipmentOEEMonthStatistics(String productionCode) { + LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + String userId = user.getId(); + String key = ""; + if (StringUtils.isNotBlank(productionCode)) { + //鍘傚尯 + MdcProduction mdcProduction = mdcProductionService.getOne(new LambdaQueryWrapper<MdcProduction>().eq(MdcProduction::getProductionCode, productionCode).eq(MdcProduction::getDelFlag, CommonConstant.DEL_FLAG_0.toString())); + key = mdcProduction.getId(); + } else { + //宸ユ 鏌ヨ鐢ㄦ埛鎷ユ湁鐨勫伐娈垫潈闄� + key = mdcProductionService.findThreeProductionId(userId); + } + List<MdcOverallEquipmentEfficiency> result = mdcHomeService.getEquipmentOEEMonthStatistics(userId, key); + return Result.OK(result); + } + + } -- Gitblit v1.9.3