|
|
@ -54,7 +54,7 @@ public class MesContainerBindCooperationPackageService extends MesAbstractContai
|
|
|
|
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue()});
|
|
|
|
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue()});
|
|
|
|
|
|
|
|
|
|
|
|
for (MesPackingDefine packingDefine : packingDefines) {
|
|
|
|
for (MesPackingDefine packingDefine : packingDefines) {
|
|
|
|
Double qty = checkPackingDefine(organizeCode, packingDefine, barcode);
|
|
|
|
Double qty = checkPackingDefine(organizeCode, packingDefine, barcode, model.getPartNo());
|
|
|
|
if (qty != null && qty > 0) {
|
|
|
|
if (qty != null && qty > 0) {
|
|
|
|
result.put(MesPcnExtConstWords.QTY, qty);
|
|
|
|
result.put(MesPcnExtConstWords.QTY, qty);
|
|
|
|
result.put(MesPcnExtConstWords.RESULT, true);
|
|
|
|
result.put(MesPcnExtConstWords.RESULT, true);
|
|
|
@ -64,7 +64,7 @@ public class MesContainerBindCooperationPackageService extends MesAbstractContai
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private Double checkPackingDefine(String organizeCode, MesPackingDefine packingDefine, String barcode) {
|
|
|
|
private Double checkPackingDefine(String organizeCode, MesPackingDefine packingDefine, String barcode, String rulePartNo) {
|
|
|
|
//解析获取信息保存
|
|
|
|
//解析获取信息保存
|
|
|
|
if (StringUtils.isEmpty(packingDefine.getSplitChar())) {
|
|
|
|
if (StringUtils.isEmpty(packingDefine.getSplitChar())) {
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
@ -74,7 +74,10 @@ public class MesContainerBindCooperationPackageService extends MesAbstractContai
|
|
|
|
//工厂校验
|
|
|
|
//工厂校验
|
|
|
|
checkOrganizeCode(organizeCode, packingDefine, split);
|
|
|
|
checkOrganizeCode(organizeCode, packingDefine, split);
|
|
|
|
//获取物料信息是否存在
|
|
|
|
//获取物料信息是否存在
|
|
|
|
getMesPart(organizeCode, packingDefine, split);
|
|
|
|
MesPart part = getMesPart(organizeCode, packingDefine, split);
|
|
|
|
|
|
|
|
if (part == null || !Objects.equals(part.getPartNo(), rulePartNo)) {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
//获取数量信息是否存在
|
|
|
|
//获取数量信息是否存在
|
|
|
|
return getQty(packingDefine, split);
|
|
|
|
return getQty(packingDefine, split);
|
|
|
|
} catch (Exception ex) {
|
|
|
|
} catch (Exception ex) {
|
|
|
@ -96,7 +99,7 @@ public class MesContainerBindCooperationPackageService extends MesAbstractContai
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void getMesPart(String organizeCode, MesPackingDefine packingDefine, String[] split) {
|
|
|
|
private MesPart getMesPart(String organizeCode, MesPackingDefine packingDefine, String[] split) {
|
|
|
|
if (StringUtils.isEmpty(packingDefine.getPartNoIndex()) || packingDefine.getPartNoIndex() > split.length
|
|
|
|
if (StringUtils.isEmpty(packingDefine.getPartNoIndex()) || packingDefine.getPartNoIndex() > split.length
|
|
|
|
|| StringUtils.isEmpty(split[packingDefine.getPartNoIndex() - 1])) {
|
|
|
|
|| StringUtils.isEmpty(split[packingDefine.getPartNoIndex() - 1])) {
|
|
|
|
MesPcnException.throwMesBusiException("物料号所在位置不存在,请检查数据!");
|
|
|
|
MesPcnException.throwMesBusiException("物料号所在位置不存在,请检查数据!");
|
|
|
@ -121,16 +124,17 @@ public class MesContainerBindCooperationPackageService extends MesAbstractContai
|
|
|
|
MesPcnException.throwMesBusiException("客户零件号[%s]未绑定物料号数据,请检查数据!", split[packingDefine.getPartNoIndex() - 1]);
|
|
|
|
MesPcnException.throwMesBusiException("客户零件号[%s]未绑定物料号数据,请检查数据!", split[packingDefine.getPartNoIndex() - 1]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
checkPart(organizeCode, partNo);
|
|
|
|
return checkPart(organizeCode, partNo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void checkPart(String organizeCode, String partNo) {
|
|
|
|
private MesPart checkPart(String organizeCode, String partNo) {
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
DdlPreparedPack.getStringEqualPack(partNo, MesPcnExtConstWords.PART_NO, packBean);
|
|
|
|
DdlPreparedPack.getStringEqualPack(partNo, MesPcnExtConstWords.PART_NO, packBean);
|
|
|
|
MesPart mesPart = mesPartRDao.getByProperty(packBean);
|
|
|
|
MesPart mesPart = mesPartRDao.getByProperty(packBean);
|
|
|
|
if (Objects.isNull(mesPart)) {
|
|
|
|
if (Objects.isNull(mesPart)) {
|
|
|
|
MesPcnException.throwMesBusiException("物料[%s]信息不存在,请检查数据!", partNo);
|
|
|
|
MesPcnException.throwMesBusiException("物料[%s]信息不存在,请检查数据!", partNo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return mesPart;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private Double getQty(MesPackingDefine packingDefine, String[] split) {
|
|
|
|
private Double getQty(MesPackingDefine packingDefine, String[] split) {
|
|
|
|