46987 MES&PCN-装箱防错功能,增加配置开关 “包装码中是否为客户零件号”,默认逻辑关闭,为是则包装条码中的零件号为客户零件号。

uat-temp-nht-2505160000-46987
jason 2 months ago
parent 1a2c6efd58
commit 7680553d4e

@ -81,6 +81,10 @@ public class MesBoxingErrorProofingService implements IMesBoxingErrorProofingSer
@Autowired
private MesCustomerPartRepository mesCustomerPartRDao;
@Autowired
private MesCustPartInvoicedRepository partInvoicedRao;
@Override
public ListPager<MesPackageDetail> queryMesPackageDetailByPager(MesPackage mesPackage, Pager pager) {
@ -641,15 +645,22 @@ public class MesBoxingErrorProofingService implements IMesBoxingErrorProofingSer
}
String partNo = split[packingDefine.getPartNoIndex() - 1];
if (Objects.equals(packingDefine.getPackBarcodeCustPartNo(), CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue())) {
DdlPackBean packBean = DdlPackBean.getDdlPackBean(mesPackageDetail.getOrganizeCode());
DdlPreparedPack.getStringEqualPack(partNo, MesPcnExtConstWords.CUST_PART_NO, packBean);
MesCustomerPart mesCustomerPart = mesCustomerPartRDao.getByProperty(packBean);
if (mesCustomerPart == null) {
MesPcnException.throwMesBusiException("客户零件号[%s]信息不存在,请检查数据!", partNo);
DdlPackBean invoicePackBean = DdlPackBean.getDdlPackBean(mesPackageDetail.getOrganizeCode());
DdlPreparedPack.getStringEqualPack(partNo, MesPcnExtConstWords.CUST_PART_NO, invoicePackBean);
MesCustPartInvoiced invoiced = partInvoicedRao.getByProperty(invoicePackBean);
if (invoiced != null && !StringUtils.isEmpty(invoiced.getPartNo())) {
partNo = invoiced.getPartNo();
} else {
DdlPackBean packBean = DdlPackBean.getDdlPackBean(mesPackageDetail.getOrganizeCode());
DdlPreparedPack.getStringEqualPack(partNo, MesPcnExtConstWords.CUST_PART_NO, packBean);
MesCustomerPart mesCustomerPart = mesCustomerPartRDao.getByProperty(packBean);
if (mesCustomerPart == null) {
MesPcnException.throwMesBusiException("客户零件号[%s]信息不存在,请检查数据!", partNo);
}
partNo = mesCustomerPart.getErpPartNo();
}
partNo = mesCustomerPart.getErpPartNo();
if (StringUtils.isEmpty(partNo)) {
MesPcnException.throwMesBusiException("客户零件号[%s]未绑定物料号数据,请检查数据!", mesCustomerPart.getCustPartNo());
MesPcnException.throwMesBusiException("客户零件号[%s]未绑定物料号数据,请检查数据!", split[packingDefine.getPartNoIndex() - 1]);
}
}
return getPart(mesPackageDetail.getOrganizeCode(), partNo);

Loading…
Cancel
Save