|
|
|
@ -1,7 +1,11 @@
|
|
|
|
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.base;
|
|
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesPackageContainerSnService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.rulematch.containerbind.ContainerBindManager;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.rulematch.containerbind.checkqty.MesAbstractContainerBindCheckQtyService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesPcnException;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesContainerPartsModel;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.codemaker.SnowflakeIdMaker;
|
|
|
|
@ -18,9 +22,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -141,6 +143,23 @@ public class MesPackageContainerSnServiceImpl implements IMesPackageContainerSnS
|
|
|
|
|
|
|
|
|
|
List<MesContainerPackageDetail> subPackageDetails = getMesContainerPackageDetail(organizeCode, subContainerSn.getContainerSn(), false);
|
|
|
|
|
// 调用涛哥的根据条码对应标包验证。todo
|
|
|
|
|
MesAbstractContainerBindCheckQtyService checkQtyService = ContainerBindManager.INSTANCE.getCheckQtyService(MesExtEnumUtil.CONTAINER_TYPE_MIX_TYPE.getByValue(mesContainerType.getMixType()));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (MesContainerPackageDetail subPackageDetail : subPackageDetails) {
|
|
|
|
|
MesContainerPartsModel containerPart = MesContainerPartsModel.builder()
|
|
|
|
|
.partNo(subPackageDetail.getPartNo())
|
|
|
|
|
.build();
|
|
|
|
|
MesContainerPartsModel containerPartTwo = MesContainerPartsModel.builder()
|
|
|
|
|
.partNo(subPackageDetail.getPartNo())
|
|
|
|
|
.qty(subPackageDetail.getQty())
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
|
|
Map<String, Object> checkQtyResult = checkQtyService.doCheck(organizeCode, masterContainerPackage, masterPackageDetails, containerPart, Arrays.asList(containerPartTwo));
|
|
|
|
|
if (checkQtyResult != null && Objects.equals(checkQtyResult.get(MesPcnExtConstWords.RESULT), false)) {
|
|
|
|
|
MesPcnException.throwMesBusiException(checkQtyResult.get(MesPcnExtConstWords.MESSAGE).toString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (masterContainerPackage == null) {
|
|
|
|
|
masterContainerPackage = createMesContainerPackage(userName, masterContainerSn);
|
|
|
|
|