From 63a5530a85e6eaf7f8be733e87d32af2d16477a8 Mon Sep 17 00:00:00 2001 From: qushaowei <qushaowei@163.com> Date: 星期日, 07 四月 2024 13:39:02 +0800 Subject: [PATCH] 设备管理 报表打印修改 --- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcHomeController.java | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 47 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 c037e46..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; @@ -20,6 +21,7 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -63,10 +65,16 @@ } 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); - return Result.OK(resultMap); + Map<String, Object> map = new HashMap<>(); + map.put("list", resultMap); + map.put("producitonId", key); + return Result.OK(map); } @ApiOperation(value = "MDC棣栭〉鎺ュ彛-璁惧鍒╃敤鐜囩粺璁�(鏄ㄦ棩)", notes = "MDC棣栭〉鎺ュ彛-璁惧杩愯鐘舵�佺粺璁�(鏄ㄦ棩)") @@ -146,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