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