diff --git a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesPartShippingGroupService.java b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesPartShippingGroupService.java index 1f2f515..0b5cd9e 100644 --- a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesPartShippingGroupService.java +++ b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesPartShippingGroupService.java @@ -3,6 +3,7 @@ package cn.estsh.i3plus.ext.mes.pcn.api.busi; import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; import cn.estsh.i3plus.pojo.mes.bean.MesPartShippingGroup; import cn.estsh.i3plus.pojo.mes.bean.MesPartShippingGroupDetail; +import cn.estsh.i3plus.pojo.mes.bean.shipping.MesLoadingList; import cn.estsh.i3plus.pojo.mes.bean.shipping.MesShippingOrderManagement; import cn.estsh.i3plus.pojo.mes.model.MesShippingOrderManagementModel; import cn.estsh.impp.framework.boot.util.ResultBean; @@ -32,4 +33,6 @@ public interface IMesPartShippingGroupService { @ApiOperation(value = "发运组明细") MesPartShippingGroupDetail getMesPartShippingGroupDetailByPartNo(String organizeCode, String shippingGroupCode, String partNo); + + boolean isFirstInstall(MesPartShippingGroup shippingGroup, MesLoadingList loadingList); } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesPartShippingGroupService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesPartShippingGroupService.java index 4a66698..9b1704c 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesPartShippingGroupService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesPartShippingGroupService.java @@ -8,14 +8,14 @@ import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesPcnException; import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords; import cn.estsh.i3plus.mes.pcn.api.iservice.base.IConfigService; import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; +import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil; import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; import cn.estsh.i3plus.pojo.base.util.StringUtil; -import cn.estsh.i3plus.pojo.mes.bean.MesConfig; -import cn.estsh.i3plus.pojo.mes.bean.MesLabelTemplate; -import cn.estsh.i3plus.pojo.mes.bean.MesPartShippingGroup; -import cn.estsh.i3plus.pojo.mes.bean.MesPartShippingGroupDetail; +import cn.estsh.i3plus.pojo.mes.bean.*; +import cn.estsh.i3plus.pojo.mes.bean.shipping.MesLoadingList; import cn.estsh.i3plus.pojo.mes.bean.shipping.MesShippingOrderManagement; +import cn.estsh.i3plus.pojo.mes.repository.IMesLoadingGroupRepository; import cn.estsh.i3plus.pojo.mes.repository.MesConfigRepository; import cn.estsh.i3plus.pojo.mes.repository.MesPartShippingGroupDetailRepository; import cn.estsh.i3plus.pojo.mes.repository.MesPartShippingGroupRepository; @@ -29,6 +29,7 @@ import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; import java.util.List; +import java.util.Objects; @Service @Slf4j @@ -49,6 +50,9 @@ public class MesPartShippingGroupService implements IMesPartShippingGroupService @Autowired private MesConfigRepository mesConfigRao; + @Autowired + private IMesLoadingGroupRepository loadingGroupRDao; + public List findAll(MesPartShippingGroup partShippingGroup) { DdlPackBean packBean = DdlPackBean.getDdlPackBean(partShippingGroup.getOrganizeCode()); DdlPreparedPack.getStringEqualPack(partShippingGroup.getShippingGroupCode(), MesPcnExtConstWords.SHIPPING_GROUP_CODE, packBean); @@ -109,4 +113,15 @@ public class MesPartShippingGroupService implements IMesPartShippingGroupService return mesPartShippingGroupDetailRepository.getByProperty(packBean); } + @Override + public boolean isFirstInstall(MesPartShippingGroup shippingGroup, MesLoadingList loadingList) { + DdlPackBean packBean = DdlPackBean.getDdlPackBean(loadingList.getOrganizeCode()); + DdlPreparedPack.getStringEqualPack(loadingList.getLoadingGroupNo(), "loadingGroupNo", packBean); + MesLoadingGroup loadingGroup = loadingGroupRDao.getByProperty(packBean); + if (loadingGroup != null && loadingGroup.getIsFirstInstall() != null) { + return Objects.equals(loadingGroup.getIsFirstInstall(), CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()); + } + return Objects.equals(shippingGroup.getIsFirstInstall(), CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()); + } + } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesShippingLoadingCheckService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesShippingLoadingCheckService.java index 06cb1a7..0b3763c 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesShippingLoadingCheckService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesShippingLoadingCheckService.java @@ -164,6 +164,7 @@ public class MesShippingLoadingCheckService implements IMesShippingLoadingCheckS checkLoadingList(model, organizeCode, loadingList); //查询零件发运组 MesPartShippingGroup shippingGroup = getMesPartShippingGroup(organizeCode, loadingList.getPartShippingGroupCode()); + final boolean isFirstInstall = mesPartShippingGroupService.isFirstInstall(shippingGroup, loadingList); MesLoadingGroup loadingGroup = loadingList.getLoadingGroupId() != null ? mesLoadingGroupRDao.getById(loadingList.getLoadingGroupId()) : null; boolean scanflg = false; for (MesLoadingListDetail loadingListDetail : model.getDetailList()) { @@ -210,7 +211,7 @@ public class MesShippingLoadingCheckService implements IMesShippingLoadingCheckS //根据扫描的装车单找到是否先装车配置 //若配置为否,则查询装车单中所有的发运单是否都进行【排序发运校验】完成,若【排序发运校验】没完成,则提示,先进行排序发运校验。 - if (!Objects.equals(shippingGroup.getIsFirstInstall(), MesCommonConstant.TRUE_INTEGER)) { + if (!isFirstInstall) { DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode); DdlPreparedPack.getNumEqualPack(loadingListDetail.getShippingId(),"id",packBean); MesShippingOrderManagement orderManagement = shippingOrderManagementRepository.getByProperty(packBean); 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 60d9762..6896540 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 @@ -466,7 +466,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService throw new ImppBusiException(String.format("【%s】此发运单配置是否装车为是,但没生成装车单,请检查数据!", shippingOrderManagement.getShippingCode())); } //判断是否先装车 - if (isFirstInstall(partShippingGroup, loadingList)) { + if (mesPartShippingGroupService.isFirstInstall(partShippingGroup, loadingList)) { //若没进行装车校验,则提示【%s】此发运单对应的【%s】此装车单状态为【%s】,请选择状态为【%s】的数据 if (loadingList.getStatus() != MesExtEnumUtil.MES_LOADING_STATUS.SCANNED.getValue()) { throw new ImppBusiException(String.format("【%s】此发运单对应的【%s】此装车单状态为【%s】,请选择状态为【%s】的数据!请检查数据!", @@ -638,14 +638,6 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService return orderManagement; } - private boolean isFirstInstall(MesPartShippingGroup shippingGroup, MesLoadingList loadingList) { - MesLoadingGroup loadingGroup = loadingList.getLoadingGroupId() != null ? mesLoadingGroupRDao.getById(loadingList.getLoadingGroupId()) : null; - if (loadingGroup != null && loadingGroup.getIsFirstInstall() != null) { - return Objects.equals(loadingGroup.getIsFirstInstall(), CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()); - } - return Objects.equals(shippingGroup.getIsFirstInstall(), CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()); - } - public void saveDate(MesShippingOrderManagement orderManagement, MesSortShippingCheckModel model, String organizeCode, String userInfo) { boolean isUnpack = orderManagement.getStatus() == MesExtEnumUtil.SHIPPING_ORDER_STATUS.UNPACKING.getValue(); //若发运单状态为创建或发布 则写入开始扫描时间 @@ -667,7 +659,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService //零件发运组 MesPartShippingGroup shippingGroup = Objects.isNull(model.getMesPartShippingGroup()) ? getMesPartShippingGroup(orderManagement.getOrganizeCode(), orderManagement.getShippingGroupCode()) : model.getMesPartShippingGroup(); - final boolean isFirstInstall = isFirstInstall(shippingGroup, loadingList); + final boolean isFirstInstall = mesPartShippingGroupService.isFirstInstall(shippingGroup, loadingList); //根据发运单查询装车单明细信息 if (isFirstInstall) { //反填装车单信息到发运单