From 6877bf8d6020cfd3d787036e70de9b04c3eadeea Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期一, 23 六月 2025 09:26:17 +0800
Subject: [PATCH] 计算OEE任务调整

---
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcOeeInfoServiceImpl.java |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 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 151297f..aed617f 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
@@ -204,12 +204,10 @@
                     mdcOeeInfo.setTimeActuationRate(timeActuationRate);
                     // 鏈夋晥杩愯鏃堕棿 --- 鎸夐渶姹傜淮鎶ら浂浠跺姞宸ユ�绘椂闀縷|绯荤粺涓昏酱璐熻浇鏃堕棿
                     Integer effectiveRunLong = 0;
-                    Integer totalProcessLong = mdcPartProcessInfoService.selectTotalProcessLong(equipmentId, validDate);
-                    if (totalProcessLong == 0) {
-                        //鏌ヨ璁惧杩愯鏃堕棿
-                        effectiveRunLong = mdcEquipmentStatisticalInfoService.selectProcessLong(equipmentId, validDate.replace("-", ""));
-                    } else {
-                        effectiveRunLong = totalProcessLong;
+//                    Integer totalProcessLong = mdcPartProcessInfoService.selectTotalProcessLong(equipmentId, validDate);
+                    effectiveRunLong = mdcEquipmentStatisticalInfoService.selectProcessLong(equipmentId, validDate.replace("-", ""));
+                    if (effectiveRunLong == null) {
+                        effectiveRunLong = 0;
                     }
                     mdcOeeInfo.setEffectiveRunLong(effectiveRunLong);
                     // 鎬ц兘寮�鍔ㄧ巼 --- 鏈夋晥杩愯鏃堕棿/寮�鍔ㄦ椂闂�
@@ -217,7 +215,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);
@@ -225,7 +223,7 @@
                     Integer passCount = mdcPartProcessInfoService.selectTotalPassCount(equipmentId, validDate);
                     mdcOeeInfo.setPassCount(passCount);
                     // 鍚堟牸鐜� --- 鍚堟牸鏁�/鍔犲伐鏁�
-                    BigDecimal passRate = BigDecimal.ONE;
+                    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);
                     }

--
Gitblit v1.9.3