|
|
|
@ -184,6 +184,60 @@ public class MesShippingOrderManagementService extends BaseMesService<MesShippin
|
|
|
|
|
//判断是否修改发运组,如果不修改发运组,则不修改明细
|
|
|
|
|
if (!bean.getShippingGroupCode().equals(originBean.getShippingGroupCode())) {
|
|
|
|
|
|
|
|
|
|
DdlPackBean partShipGroupPackBean = DdlPackBean.getDdlPackBean(bean.getOrganizeCode());
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(bean.getShippingGroupCode(), "shippingGroupCode", partShipGroupPackBean);
|
|
|
|
|
MesPartShippingGroup partShippingGroup = partShippingGroupRepository.getByProperty(partShipGroupPackBean);
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isEmpty(partShippingGroup)) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
.setErrorDetail("【%s】零件发运组数据为空,请检查数据", bean.getShippingGroupCode())
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isEmpty(partShippingGroup.getIsLoading()) || partShippingGroup.getIsLoading() == 0) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
.setErrorDetail("【%s】零件发运组是否有装车不能为空,请检查数据", bean.getShippingGroupCode())
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isEmpty(partShippingGroup.getIsFirstInstall()) || partShippingGroup.getIsFirstInstall() == 0) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
.setErrorDetail("【%s】零件发运组是否先装车不能为空,请检查数据", bean.getShippingGroupCode())
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isEmpty(partShippingGroup.getIsEnableMemory()) || partShippingGroup.getIsEnableMemory() == 0) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
.setErrorDetail("【%s】零件发运组是否启用记忆不能为空,请检查数据", bean.getShippingGroupCode())
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DdlPackBean custDockPackBean = DdlPackBean.getDdlPackBean(bean.getOrganizeCode());
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(bean.getCustCode(), "custCode", custDockPackBean);
|
|
|
|
|
MesCustomerDock customerDock = customerDockRepository.getByProperty(custDockPackBean);
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isEmpty(customerDock)) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
.setErrorDetail("【%s】客户零件号未维护客户道口,请检查数据", bean.getCustCode())
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bean.setCustDockCode(customerDock.getCustDockCode());
|
|
|
|
|
bean.setPartShippingId(partShippingGroup.getId());
|
|
|
|
|
bean.setShippingType(MesExtEnumUtil.SHIPPING_ORDER_TYPE.SORT_SHIPPING.getValue());
|
|
|
|
|
bean.setIsLoading(partShippingGroup.getIsLoading());
|
|
|
|
|
bean.setIsFirstInstall(partShippingGroup.getIsFirstInstall());
|
|
|
|
|
bean.setIsEnableMemory(partShippingGroup.getIsEnableMemory());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DdlPackBean detailPackBean = DdlPackBean.getDdlPackBean(bean.getOrganizeCode());
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(bean.getShippingCode(), "shippingCode", detailPackBean);
|
|
|
|
|
List<MesShippingOrderManagementDetail> detailDeleteList = detailService.findAll(detailPackBean);
|
|
|
|
@ -193,7 +247,7 @@ public class MesShippingOrderManagementService extends BaseMesService<MesShippin
|
|
|
|
|
});
|
|
|
|
|
//查询物料发运组数据
|
|
|
|
|
DdlPackBean shipGroupPackBean = DdlPackBean.getDdlPackBean(bean.getOrganizeCode());
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(bean.getShippingGroupCode(), "shippingGroupNo", shipGroupPackBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(bean.getShippingGroupCode(), "shippingGroupCode", shipGroupPackBean);
|
|
|
|
|
List<MesPartShippingGroupDetail> shippingGroupDetailList = shippingGroupDetailService.findAll(shipGroupPackBean);
|
|
|
|
|
if (CollectionUtils.isEmpty(shippingGroupDetailList)) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|