From adef68a81dd088985c4e8836eff86520d9c92e8a Mon Sep 17 00:00:00 2001 From: jason Date: Tue, 15 Apr 2025 10:23:04 +0800 Subject: [PATCH] =?UTF-8?q?46317=20PCN=EF=BC=9A=E5=8F=91=E8=BF=90=E7=9C=8B?= =?UTF-8?q?=E6=9D=BF=E6=9C=80=E8=BF=91=E5=8F=91=E8=BF=90VIN=E6=B5=81?= =?UTF-8?q?=E6=B0=B4=E5=8F=B7=E3=80=81=E5=BD=93=E5=A4=A9=E6=95=B4=E8=BD=A6?= =?UTF-8?q?=E6=95=B0=E3=80=81=E7=94=9F=E4=BA=A7JPH=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../busi/MesShippingKanbanCfgServiceImpl.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesShippingKanbanCfgServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesShippingKanbanCfgServiceImpl.java index 7e699dc..1e8edfa 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesShippingKanbanCfgServiceImpl.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesShippingKanbanCfgServiceImpl.java @@ -875,8 +875,8 @@ public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgSer } String strCustInfoSeq = custInfoSeq != null ? Long.toString(custInfoSeq) : ""; - if (strCustInfoSeq.length() >= 6) { - values.add(strCustInfoSeq.substring(strCustInfoSeq.length() - 6)); + if (strCustInfoSeq.length() >= 5) { + values.add(strCustInfoSeq.substring(strCustInfoSeq.length() - 5)); } else { values.add(strCustInfoSeq); } @@ -1031,7 +1031,7 @@ public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgSer hql.append(" and l.modifyDatetime BETWEEN :startDateTime AND :endDateTime "); hql.append(" and s.shippingGroupCode in (:shippingGroupCode) "); hql.append(" group by s.shippingGroupCode "); - List ddd = entityManager.createQuery(hql.toString()) + List dataList = entityManager.createQuery(hql.toString()) .setParameter("organizeCode", cfg.getOrganizeCode()) .setParameter("isValid", CommonEnumUtil.VALID) .setParameter("isDeleted", CommonEnumUtil.FALSE) @@ -1042,11 +1042,11 @@ public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgSer .getResultList(); Map shippingGroupCount = new HashMap<>(); - if (!CollectionUtils.isEmpty(ddd)) { - for (Map dd : ddd) { - Object totalCount = dd.get("totalCount"); + if (!CollectionUtils.isEmpty(dataList)) { + for (Map data : dataList) { + Object totalCount = data.get("totalCount"); if (totalCount != null) { - shippingGroupCount.put(dd.get("shippingGroupCode").toString(), totalCount.toString()); + shippingGroupCount.put(data.get("shippingGroupCode").toString(), String.format("%.0f", (Double)totalCount)); } } } @@ -1129,8 +1129,8 @@ public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgSer .setParameter("organizeCode", cfg.getOrganizeCode()) .setParameter("isValid", CommonEnumUtil.VALID) .setParameter("isDeleted", CommonEnumUtil.FALSE) - .setParameter("startDateTime", DateUtil.formatDate(nowTime)) - .setParameter("endDateTime", DateUtil.formatDate(prevHourTime)) + .setParameter("startDateTime", DateUtil.formatDate(prevHourTime)) + .setParameter("endDateTime", DateUtil.formatDate(nowTime)) .getResultList(); // Use a map to store counts for quick access @@ -1138,7 +1138,7 @@ public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgSer .collect(Collectors.toMap( map -> map.get("workCenterCode").toString(), map -> map.get("totalCount").toString(), - (existing, replacement) -> existing // Handle duplicates if any + (existing, replacement) -> existing )); // Collect counts for each shipping group