From c33eedaf999b84dd8377aba96d8aeeeba264b4f6 Mon Sep 17 00:00:00 2001 From: hyingbo <1363390067@qq.com> Date: 星期二, 09 九月 2025 15:07:35 +0800 Subject: [PATCH] mdc首页功能迁移 --- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcHomeController.java | 124 +++++++---------------------------------- 1 files changed, 22 insertions(+), 102 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 248d69a..fb7219c 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 @@ -46,131 +46,49 @@ @Resource private IMdcHomeService mdcHomeService; + @ApiOperation(value = "MDC棣栭〉鎺ュ彛-鏌ヨ鎵�鏈夎溅闂�", notes = "MDC棣栭〉鎺ュ彛-鏌ヨ鎵�鏈夎溅闂�") + @GetMapping("/getAllWorkShop") + public Result<List<MdcProduction>> getAllWorkShop() { + return Result.OK(mdcHomeService.getAllWorkShop()); + } + @ApiOperation(value = "MDC棣栭〉鎺ュ彛-璁惧杩愯鐘舵�佺粺璁�", notes = "MDC棣栭〉鎺ュ彛-璁惧杩愯鐘舵�佺粺璁�") @GetMapping("/equipmentStatusStatistics") - public Result<?> equipmentStatusStatistics(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()); - } else if (userType.equals(MdcConstant.USER_TYPE_2)) { - //宸ユ 鏌ヨ鐢ㄦ埛鎷ユ湁鐨勫伐娈垫潈闄� - key = mdcProductionService.findThreeProductionId(userId); - } - } - List<MdcCommonVo> resultMap = mdcHomeService.getEquipmentStatusStatistics(userId, key); + public Result<?> equipmentStatusStatistics(String productionId) { + List<MdcCommonVo> resultMap = mdcHomeService.getEquipmentStatusStatistics(productionId); Map<String, Object> map = new HashMap<>(); map.put("list", resultMap); - map.put("productionId", key); return Result.OK(map); } @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); + public Result<?> equipmentUtilizationStatistics(String productionId) { + List<MdcCommonVo> result = mdcHomeService.getEquipmentUtilizationStatistics(productionId); 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); + public Result<?> equipmentOEEStatistics(String productionId) { + List<MdcCommonVo> result = mdcHomeService.getEquipmentOeeStatistics(productionId); 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); + public Result<?> equipmentMonthStatistics(String productionId) { + MdcProduction mdcProduction = mdcProductionService.getOne(new LambdaQueryWrapper<MdcProduction>().eq(MdcProduction::getParentId, "")); + + String key = mdcProduction.getId(); + Map<String, Object> result = mdcHomeService.getEquipmentMonthStatistics(productionId); return Result.OK(result); } - @ApiOperation(value = "MDC棣栭〉鎺ュ彛-宸ユ绾у墠涓冨ぉ鍒╃敤鐜囨姌绾垮浘", notes = "MDC棣栭〉鎺ュ彛-宸ユ绾у墠涓冨ぉ鍒╃敤鐜囨姌绾垮浘") + @ApiOperation(value = "MDC棣栭〉鎺ュ彛-宸ユ绾у墠15澶╁埄鐢ㄧ巼鎶樼嚎鍥�", notes = "MDC棣栭〉鎺ュ彛-宸ユ绾у墠15澶╁埄鐢ㄧ巼鎶樼嚎鍥�") @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); + public Result<?> equipmentDayUtilizationStatistics(String productionId) { + Map<String, Object> result = mdcHomeService.getEquipmentDayUtilizationStatistics(productionId); return Result.OK(result); } @@ -249,6 +167,8 @@ return Result.OK(result); } + + @ApiOperation(value = "MDC棣栭〉鎺ュ彛-闂鍒楄〃", notes = "MDC棣栭〉鎺ュ彛-闂鍒楄〃") @GetMapping("/feedbackList") public Result<?> feedbackList(String productionCode) { -- Gitblit v1.9.3