|
|
|
@ -5,6 +5,7 @@ import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.rulematch.containerbin
|
|
|
|
|
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.model.MesContainerSnBindModel;
|
|
|
|
|
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;
|
|
|
|
@ -65,8 +66,8 @@ public class MesPackageContainerSnServiceImpl implements IMesPackageContainerSnS
|
|
|
|
|
* @param sn
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public ResultBean packageContain(String organizeCode,String userName, String containSn, String sn) {
|
|
|
|
|
ResultBean resultBean = ResultBean.success();
|
|
|
|
|
public MesContainerSnBindModel packageContain(String organizeCode,String userName, String containSn, String sn) {
|
|
|
|
|
MesContainerSnBindModel mesContainerSnBindModel = MesContainerSnBindModel.builder().build();
|
|
|
|
|
try {
|
|
|
|
|
// 是否是容器包容器
|
|
|
|
|
boolean isContainerToContainer = false;
|
|
|
|
@ -78,16 +79,17 @@ public class MesPackageContainerSnServiceImpl implements IMesPackageContainerSnS
|
|
|
|
|
}
|
|
|
|
|
// 如果是容器套容器
|
|
|
|
|
if (isContainerToContainer) {
|
|
|
|
|
containerToContainer(organizeCode,userName, mesContainerSn, produceSn);
|
|
|
|
|
mesContainerSnBindModel = containerToContainer(organizeCode,userName, mesContainerSn, produceSn);
|
|
|
|
|
}
|
|
|
|
|
}catch (ImppBusiException e) {
|
|
|
|
|
resultBean.setErrorMsg(e.getErrorDetail());
|
|
|
|
|
resultBean.setSuccess(false);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return resultBean;
|
|
|
|
|
return mesContainerSnBindModel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<MesContainerSnPart> getMesContainerSnParts(String organizeCode, String containSn) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<MesContainerSnPart> mesContainerSnParts = getMesContainerSnPart(organizeCode, containSn);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -110,8 +112,10 @@ public class MesPackageContainerSnServiceImpl implements IMesPackageContainerSnS
|
|
|
|
|
return mesContainerSnParts;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ResultBean containerToContainer(String organizeCode,String userName, MesContainerSn masterContainerSn, MesContainerSn subContainerSn) {
|
|
|
|
|
ResultBean resultBean = ResultBean.success();
|
|
|
|
|
public MesContainerSnBindModel containerToContainer(String organizeCode, String userName, MesContainerSn masterContainerSn, MesContainerSn subContainerSn) {
|
|
|
|
|
|
|
|
|
|
MesContainerSnBindModel model = MesContainerSnBindModel.builder().build();
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
// 获取容器类型
|
|
|
|
|
MesContainerType mesContainerType = getMesContainerType(organizeCode, masterContainerSn.getContainerSn(), masterContainerSn.getContainerTypeCode());
|
|
|
|
@ -167,16 +171,20 @@ public class MesPackageContainerSnServiceImpl implements IMesPackageContainerSnS
|
|
|
|
|
MesContainerPackageDetail mesContainerPackageDetailBean = crreateMesContainerPackageDetail(userName, masterContainerSn, subContainerSn, masterContainerPackage);
|
|
|
|
|
|
|
|
|
|
MesContainerPackageDetailBinding containerPackageDetailBinding = createContainerPackageDetailBinding(masterContainerPackage, mesContainerPackageDetailBean, MesExtEnumUtil.CONTAINER_RAW_SN_BINDING_STATUS.BINDING, userName);
|
|
|
|
|
subPackageDetails.add(mesContainerPackageDetailBean);
|
|
|
|
|
|
|
|
|
|
model.setContainerPackage(masterContainerPackage);
|
|
|
|
|
model.setPackageDetails(subPackageDetails);
|
|
|
|
|
model.addPackageDetailBinding(containerPackageDetailBinding);
|
|
|
|
|
|
|
|
|
|
containerPackageRepository.save(masterContainerPackage);
|
|
|
|
|
containerPackageDetailRepository.save(mesContainerPackageDetailBean);
|
|
|
|
|
packageDetailBindingRepository.save(containerPackageDetailBinding);
|
|
|
|
|
|
|
|
|
|
}catch (ImppBusiException e) {
|
|
|
|
|
resultBean.setErrorMsg(e.getErrorDetail());
|
|
|
|
|
resultBean.setSuccess(false);
|
|
|
|
|
log.error("系统异常", e.getErrorDetail());
|
|
|
|
|
}
|
|
|
|
|
return resultBean;
|
|
|
|
|
return model;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private MesContainerPackage createMesContainerPackage(String userName, MesContainerSn masterContainerSn) {
|
|
|
|
|