From 63d50da13d256f7df075f37054a239740bf172ac Mon Sep 17 00:00:00 2001 From: qushaowei <qushaowei@163.com> Date: 星期四, 14 三月 2024 16:01:05 +0800 Subject: [PATCH] Merge branch 'master' of http://117.34.109.166:18448/r/mdc_430 into develop --- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcHomeController.java | 85 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 84 insertions(+), 1 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 901b846..970da2f 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 @@ -11,6 +11,7 @@ import org.jeecg.common.system.vo.LoginUser; import org.jeecg.modules.mdc.constant.MdcConstant; import org.jeecg.modules.mdc.service.IMdcEquipmentService; +import org.jeecg.modules.mdc.service.IMdcHomeService; import org.jeecg.modules.mdc.vo.MdcCommonVo; import org.jeecg.modules.system.entity.MdcProduction; import org.jeecg.modules.system.service.IMdcProductionService; @@ -20,6 +21,7 @@ import javax.annotation.Resource; import java.util.List; +import java.util.Map; /** * @author Lius @@ -37,6 +39,9 @@ @Resource private IMdcProductionService mdcProductionService; + + @Resource + private IMdcHomeService mdcHomeService; @ApiOperation(value = "MDC棣栭〉鎺ュ彛-璁惧杩愯鐘舵�佺粺璁�", notes = "MDC棣栭〉鎺ュ彛-璁惧杩愯鐘舵�佺粺璁�") @GetMapping("/equipmentStatusStatistics") @@ -60,7 +65,85 @@ key = mdcProductionService.findFirstProduction(userId, mdcProduction.getId()); } } - List<MdcCommonVo> resultMap = mdcEquipmentService.getEquipmentStatusStatistics(userId, key); + List<MdcCommonVo> resultMap = mdcHomeService.getEquipmentStatusStatistics(userId, key); return Result.OK(resultMap); } + + @ApiOperation(value = "MDC棣栭〉鎺ュ彛-璁惧鍒╃敤鐜囩粺璁�(鏄ㄦ棩)", notes = "MDC棣栭〉鎺ュ彛-璁惧杩愯鐘舵�佺粺璁�(鏄ㄦ棩)") + @GetMapping("/equipmentUtilizationStatistics") + public Result<?> equipmentUtilizationStatistics(String productionCode) { + LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + Integer userType = user.getUserType(); + 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 { + //鍒ゆ柇鏄叕鍙哥骇杩樻槸鍘傚尯 + MdcProduction mdcProduction = mdcProductionService.getOne(new LambdaQueryWrapper<MdcProduction>().eq(MdcProduction::getParentId, "")); + if (userType.equals(MdcConstant.USER_TYPE_4)) { + //鍏徃 + key = mdcProduction.getId(); + } else if (userType.equals(MdcConstant.USER_TYPE_3)) { + //鍘傚尯 + key = mdcProductionService.findFirstProduction(userId, mdcProduction.getId()); + } + } + List<MdcCommonVo> result = mdcHomeService.getEquipmentUtilizationStatistics(userId, key); + return Result.OK(result); + } + + @ApiOperation(value = "MDC棣栭〉鎺ュ彛-璁惧OEE缁熻(涓婃湀)", notes = "MDC棣栭〉鎺ュ彛-璁惧OEE缁熻(涓婃湀)") + @GetMapping("/equipmentOEEStatistics") + public Result<?> equipmentOEEStatistics(String productionCode) { + LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + Integer userType = user.getUserType(); + 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 { + //鍒ゆ柇鏄叕鍙哥骇杩樻槸鍘傚尯 + MdcProduction mdcProduction = mdcProductionService.getOne(new LambdaQueryWrapper<MdcProduction>().eq(MdcProduction::getParentId, "")); + if (userType.equals(MdcConstant.USER_TYPE_4)) { + //鍏徃 + key = mdcProduction.getId(); + } else if (userType.equals(MdcConstant.USER_TYPE_3)) { + //鍘傚尯 + key = mdcProductionService.findFirstProduction(userId, mdcProduction.getId()); + } + } + List<MdcCommonVo> result = mdcHomeService.getEquipmentOeeStatistics(userId, key); + return Result.OK(result); + } + + @ApiOperation(value = "MDC棣栭〉鎺ュ彛-璁惧OEE鍜屽埄鐢ㄧ巼缁熻鏌辩姸鍥�", notes = "MDC棣栭〉鎺ュ彛-璁惧OEE鍜屽埄鐢ㄧ巼缁熻鏌辩姸鍥�") + @GetMapping("/equipmentMonthStatistics") + public Result<?> equipmentMonthStatistics(String productionCode) { + LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + Integer userType = user.getUserType(); + 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 { + //鍒ゆ柇鏄叕鍙哥骇杩樻槸鍘傚尯 + MdcProduction mdcProduction = mdcProductionService.getOne(new LambdaQueryWrapper<MdcProduction>().eq(MdcProduction::getParentId, "")); + if (userType.equals(MdcConstant.USER_TYPE_4)) { + //鍏徃 + key = mdcProduction.getId(); + } else if (userType.equals(MdcConstant.USER_TYPE_3)) { + //鍘傚尯 + key = mdcProductionService.findFirstProduction(userId, mdcProduction.getId()); + } + } + Map<String, Object> result = mdcHomeService.getEquipmentMonthStatistics(userId, key); + return Result.OK(result); + } } -- Gitblit v1.9.3