diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesSortShippingCheckService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesSortShippingCheckService.java index f7b69d9..c541b46 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesSortShippingCheckService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesSortShippingCheckService.java @@ -966,10 +966,31 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService if (StringUtil.isEmpty(detail.getVin())) { MesPcnException.throwMesBusiException("发运单【%s】零件号【%s】vin号为空,请检查数据", orderManagement.getShippingCode(), detail.getPartNo()); } - final boolean matchCfgValue = mesConfigService.checkCfgValueIsContainItem(orderManagement.getOrganizeCode(), MesPcnExtConstWords.MES_SHIPPING_QUEUE_SAVE_CFG, null, null, ",", orderManagement.getShippingGroupCode()); + final boolean matchCfgValue = mesConfigService.checkCfgValueIsContainItem(orderManagement.getOrganizeCode(), MesPcnExtConstWords.MES_SHIPPING_QUEUE_SAVE_CFG, MesPcnExtConstWords.MES_SHIPPING_QUEUE_SAVE_CFG, null, ",", orderManagement.getShippingGroupCode()); if (!matchCfgValue) { return; } + int limitValue = 0; + List limitConfig = mesConfigService.getConfigList(orderManagement.getOrganizeCode(), MesPcnExtConstWords.MES_SHIPPING_QUEUE_SAVE_CFG, "LIMIT", null); + if (!CollectionUtils.isEmpty(limitConfig)) { + String strLimitValue = limitConfig.get(0).getCfgValue(); + if (!StringUtil.isEmpty(strLimitValue)) { + try { + limitValue = Integer.parseInt(strLimitValue); + } catch (Exception ignored) { + + } + } + } + if (limitValue > 0) { + DdlPackBean packBean = DdlPackBean.getDdlPackBean(orderManagement.getOrganizeCode()); + DdlPreparedPack.getStringEqualPack(orderManagement.getShippingGroupCode(), "shippingGroupCode", packBean); + DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.QUEUE_ORDER_STATUS.CREATE.getValue(), "queueStatus", packBean); + int count = shippingQueueRDao.findByHqlWhereCount(packBean); + if (count >= limitValue) { + MesPcnException.throwMesBusiException("当前发运组【%s】的发运队列已满,请稍后重试!", orderManagement.getShippingGroupCode()); + } + } MesShippingQueue mesShippingQueue = new MesShippingQueue(); mesShippingQueue.setOrganizeCode(orderManagement.getOrganizeCode());