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 1e8edfa..2ab04cf 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 @@ -1121,7 +1121,7 @@ public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgSer // Use a single query to fetch counts grouped by work center code List productionCounts = entityManager.createQuery( - "SELECT new map(pr.workCenterCode as workCenterCode, COUNT(pr) as totalCount) " + + "SELECT new map(pr.workCenterCode as workCenterCode, COUNT(DISTINCT(pr.productSn)) as totalCount) " + "FROM " + MesProductionRecord.class.getName() + " pr " + "WHERE pr.organizeCode = :organizeCode AND pr.isDeleted = :isDeleted AND pr.isValid = :isValid " + "AND pr.createDatetime BETWEEN :startDateTime AND :endDateTime " + diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/sortshipping/strategy/ChengDuVolvoShippingPrintStrategyService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/sortshipping/strategy/ChengDuVolvoShippingPrintStrategyService.java index 40d48a3..c48e243 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/sortshipping/strategy/ChengDuVolvoShippingPrintStrategyService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/sortshipping/strategy/ChengDuVolvoShippingPrintStrategyService.java @@ -118,10 +118,14 @@ public class ChengDuVolvoShippingPrintStrategyService extends SortShippingDispat return null; } + String productionDate = ""; List rackIdList = new ArrayList<>(); for (MesCimVolvoJisRackIdDetail rackIdDetail : rackIdDetails) { if (rackIdDetail.getJisRackIdFid() != null && !rackIdList.contains(rackIdDetail.getJisRackIdFid())) { rackIdList.add(rackIdDetail.getJisRackIdFid()); + if (StringUtils.isEmpty(productionDate)) { + productionDate = rackIdDetail.getProductionDate(); + } } } DdlPackBean rackPackBean = DdlPackBean.getDdlPackBean(organizeCode); @@ -183,7 +187,7 @@ public class ChengDuVolvoShippingPrintStrategyService extends SortShippingDispat model.setPackageId(rackId.getJisRackId()); model.setPackageBarCode(rackId.getJisRackId()); model.setProcess("LDJIS"); - model.setDate("P" + TimeTool.getDateTimeShort().substring(2)); + model.setDate("P" + (StringUtils.isEmpty(productionDate) ? "" : productionDate.substring(2, 8))); return model; }