From 0cb9a67f9601159f584eb0854c66033c15f09c53 Mon Sep 17 00:00:00 2001 From: hyingbo <1363390067@qq.com> Date: 星期三, 04 六月 2025 17:16:38 +0800 Subject: [PATCH] 设备利用率百分比调整 --- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcOeeInfoServiceImpl.java | 25 ++++++++++++++++++++----- 1 files changed, 20 insertions(+), 5 deletions(-) diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcOeeInfoServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcOeeInfoServiceImpl.java index 8a0648b..f6a7c9b 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcOeeInfoServiceImpl.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcOeeInfoServiceImpl.java @@ -205,7 +205,7 @@ mdcOeeInfo.setActuateLong(actuateLong); // 鏃堕棿寮�鍔ㄧ巼 --- 寮�鍔ㄦ椂闂�/璐熻嵎鏃堕棿 BigDecimal timeActuationRate = new BigDecimal(actuateLong).divide(new BigDecimal(loadLong), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP); - mdcOeeInfo.setTimeActuationRate(timeActuationRate); + mdcOeeInfo.setTimeActuationRate(timeActuationRate.compareTo(new BigDecimal(100)) > 0 ? new BigDecimal(100) : timeActuationRate); // 鏈夋晥杩愯鏃堕棿 --- 鎸夐渶姹傜淮鎶ら浂浠跺姞宸ユ�绘椂闀縷|绯荤粺涓昏酱璐熻浇鏃堕棿 Integer effectiveRunLong = 0; // Integer totalProcessLong = mdcPartProcessInfoService.selectTotalProcessLong(equipmentId, validDate); @@ -225,7 +225,7 @@ if (effectiveRunLong != 0 && actuateLong != 0) { performanceRate = new BigDecimal(effectiveRunLong).divide(new BigDecimal(actuateLong), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP); } - mdcOeeInfo.setPerformanceRate(performanceRate); + mdcOeeInfo.setPerformanceRate(performanceRate.compareTo(new BigDecimal(100)) > 0 ? new BigDecimal(100) : performanceRate); // 鍔犲伐闆朵欢鏁伴噺 --- 鎸夌淮鎶ゆ暟鎹粺璁″綋澶� // Integer processCount = mdcPartProcessInfoService.selectTotalProcessCount(equipmentId, validDate); // mdcOeeInfo.setProcessCount(processCount); @@ -244,17 +244,17 @@ Integer passCount = mdcJcRcJobreportService.selectTotalPassCount(equipmentId, validDate); mdcOeeInfo.setPassCount(passCount); // 鍚堟牸鐜� --- 鍚堟牸鏁�/鍔犲伐鏁� - BigDecimal passRate = BigDecimal.ZERO; + BigDecimal passRate = new BigDecimal("100"); if (processCount != 0 && passCount != 0) { passRate = new BigDecimal(passCount).divide(new BigDecimal(processCount), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP); } - mdcOeeInfo.setPassRate(passRate); + mdcOeeInfo.setPassRate(passRate.compareTo(new BigDecimal(100)) > 0 ? new BigDecimal(100) : passRate); // OEE --- 鏃堕棿寮�鍔ㄧ巼 * 鎬ц兘寮�鍔ㄧ巼 * 涓�娆″悎鏍肩巼 BigDecimal oee = BigDecimal.ZERO; if (!timeActuationRate.equals(BigDecimal.ZERO) && !performanceRate.equals(BigDecimal.ZERO) && !passRate.equals(BigDecimal.ZERO)) { oee = timeActuationRate.multiply(performanceRate).multiply(passRate).divide(new BigDecimal("10000"), 4, RoundingMode.HALF_UP); } - mdcOeeInfo.setOee(oee); + mdcOeeInfo.setOee(oee.compareTo(new BigDecimal(100)) > 0 ? new BigDecimal(100) : oee); result.add(mdcOeeInfo); } } @@ -262,4 +262,19 @@ super.saveBatch(result); } + @Override + public List<MdcOeeInfo> findByEquIdsAndDate(List<String> equipmentIdList, String start, String end) { + return this.baseMapper.findByEquIdsAndDate(equipmentIdList, start, end); + } + + @Override + public List<MdcOeeInfo> findByEquIdAndDate(String equipmentId, String start, String end) { + return this.baseMapper.findByEquIdAndDate(equipmentId, start, end); + } + + @Override + public BigDecimal findByEquIdAndMonth(String equipmentId, String month) { + return this.baseMapper.findByEquIdAndMonth(equipmentId, month); + } + } -- Gitblit v1.9.3