流程生产订单赋值生产BOM字段-增加产品的限制条件

This commit is contained in:
mzr 2025-11-17 20:10:15 +08:00
parent e277722ba4
commit c1841cbf25
1 changed files with 5 additions and 2 deletions

View File

@ -45,13 +45,16 @@ public class BeforePmoBomRule implements IRule<PMOAggVO> {
// vsrctype 来源单据类型 来源销售订单的需要赋值
if ("30".equals(pmoItemVO.getVsrctype())) {
// BOM状态 (FBomBillstatusEnum) 是否需要判断BOM的状态
String cmaterialvid = pmoItemVO.getCmaterialvid();
// 根据bom版本号查询BOM(销售订单号+行号)
String bomVersion = pmoItemVO.getVsrccode() + "-" + pmoItemVO.getVsrcrowno();
String whereSql = BomVO.PK_ORG + " = '" + pkOrg + "' AND " + BomVO.HVERSION + " = '" + bomVersion + "'";
String whereSql = BomVO.PK_ORG + " = '" + pkOrg + "'" +
" AND " + BomVO.HVERSION + " = '" + bomVersion + "'" +
" AND " + BomVO.HCMATERIALID + " = '" + cmaterialvid + "'";
// NCCForUAPLogger.debug("whereSql:" + whereSql);
String bomId = MyHelper.getStrValByCondition(BomVO.TABLE_NAME, BomVO.CBOMID, whereSql);
if (StringUtils.isEmpty(bomId)) {
throw new BusinessException("未找到版本号(" + bomVersion + ")对应的BOM");
throw new BusinessException("未找到版本号(" + bomVersion + ")对应的BOM,whereSql = " + whereSql);
}
pmoItemVO.setVbomversion(bomVersion); // 生产BOM版本号
pmoItemVO.setCbomversionid(bomId); // 生产BOM版本