|
|
|
@ -13,6 +13,7 @@ import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.util.StringUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesJisShipping;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesLoadingGroup;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesPartShippingGroup;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.shipping.MesLoadingList;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.shipping.MesLoadingListDetail;
|
|
|
|
@ -28,6 +29,8 @@ import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
import java.util.stream.IntStream;
|
|
|
|
|
import java.util.stream.LongStream;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description :
|
|
|
|
@ -54,6 +57,8 @@ public class MesShippingLoadingCheckService implements IMesShippingLoadingCheckS
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesPartShippingGroupService mesPartShippingGroupService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMesLoadingGroupRepository mesLoadingGroupRDao;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMesSortShippingCheckService mesSortShippingCheckService;
|
|
|
|
@ -159,6 +164,7 @@ public class MesShippingLoadingCheckService implements IMesShippingLoadingCheckS
|
|
|
|
|
checkLoadingList(model, organizeCode, loadingList);
|
|
|
|
|
//查询零件发运组
|
|
|
|
|
MesPartShippingGroup shippingGroup = getMesPartShippingGroup(organizeCode, loadingList.getPartShippingGroupCode());
|
|
|
|
|
MesLoadingGroup loadingGroup = loadingList.getLoadingGroupId() != null ? mesLoadingGroupRDao.getById(loadingList.getLoadingGroupId()) : null;
|
|
|
|
|
boolean scanflg = false;
|
|
|
|
|
for (MesLoadingListDetail loadingListDetail : model.getDetailList()) {
|
|
|
|
|
if (loadingListDetail.getShippingCode().equals(model.getShippingCode())) {
|
|
|
|
@ -184,6 +190,23 @@ public class MesShippingLoadingCheckService implements IMesShippingLoadingCheckS
|
|
|
|
|
throw new ImppBusiException(String.format("【%s】此发运单扫描顺序错误,请检查数据!", model.getShippingCode()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (loadingGroup != null && loadingGroup.getLoadingSeq() != null) {
|
|
|
|
|
IntStream scanSeqStream = model.getDetailList().stream().filter(k -> StringUtils.isEmpty(k.getScanSn()) && !Objects.equals(k.getTempStatus(), MesCommonConstant.TRUE_INTEGER)).mapToInt(MesLoadingListDetail::getScanSeq);
|
|
|
|
|
if (loadingGroup.getLoadingSeq() == MesExtEnumUtil.LOADING_SEQ_TYPE.POSITIVE_SEQ.getValue()) {
|
|
|
|
|
Integer minSeq = scanSeqStream.min().orElse(0);
|
|
|
|
|
//若扫描的不是最小顺序 则报错
|
|
|
|
|
if (!Objects.equals(minSeq, loadingListDetail.getScanSeq())) {
|
|
|
|
|
throw new ImppBusiException(String.format("【%s】此发运单应按装车扫描顺序正序扫描,请检查数据!", model.getShippingCode()));
|
|
|
|
|
}
|
|
|
|
|
} else if (loadingGroup.getLoadingSeq() == MesExtEnumUtil.LOADING_SEQ_TYPE.REVERSE_SEQ.getValue()) {
|
|
|
|
|
Integer maxSeq = scanSeqStream.max().orElse(0);
|
|
|
|
|
//若扫描的不是最小顺序 则报错
|
|
|
|
|
if (!Objects.equals(maxSeq, loadingListDetail.getScanSeq())) {
|
|
|
|
|
throw new ImppBusiException(String.format("【%s】此发运单应按装车扫描顺序倒序扫描,请检查数据!", model.getShippingCode()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//根据扫描的装车单找到是否先装车配置
|
|
|
|
|
//若配置为否,则查询装车单中所有的发运单是否都进行【排序发运校验】完成,若【排序发运校验】没完成,则提示,先进行排序发运校验。
|
|
|
|
|