流程生产订单赋值生产BOM字段
This commit is contained in:
parent
34b1fbe65d
commit
9bb3a751d8
|
@ -0,0 +1,48 @@
|
|||
package nc.bs.mmpac.pmo.pac0002.bp.rule;
|
||||
|
||||
import nc.bs.logging.Logger;
|
||||
import nc.bs.uapbd.util.MyHelper;
|
||||
import nc.impl.pubapp.pattern.rule.IRule;
|
||||
import nc.vo.mmpac.pmo.pac0002.entity.PMOAggVO;
|
||||
import nc.vo.mmpac.pmo.pac0002.entity.PMOHeadVO;
|
||||
import nc.vo.mmpac.pmo.pac0002.entity.PMOItemVO;
|
||||
import nc.vo.org.FactoryVO;
|
||||
import nc.vo.pub.BusinessException;
|
||||
|
||||
/**
|
||||
* 流程生产订单赋值生产BOM字段
|
||||
*
|
||||
* @author mzr
|
||||
* @date 2025/7/15
|
||||
*/
|
||||
public class BeforePmoBomRule implements IRule<PMOAggVO> {
|
||||
|
||||
@Override
|
||||
public void process(PMOAggVO[] vos) {
|
||||
try {
|
||||
for (PMOAggVO vo : vos) {
|
||||
PMOHeadVO headVO = vo.getParentVO();
|
||||
String pkOrg = headVO.getPk_org();
|
||||
|
||||
MyHelper.getStrValByCondition(FactoryVO.getDefaultTableName(), FactoryVO.CODE,
|
||||
FactoryVO.PK_FACTORY + " = '" + pkOrg + "'");
|
||||
// 只有箱变公司才赋值生产BOM字段
|
||||
if (!"C030".equals(pkOrg)) {
|
||||
continue;
|
||||
}
|
||||
// 箱变公司赋值生产BOM的相关字段 cbomversionid vbomversion
|
||||
PMOItemVO[] pmoItemVOS = vo.getChildrenVO();
|
||||
for (PMOItemVO pmoItemVO : pmoItemVOS) {
|
||||
// vsrctype 来源单据类型 来源销售订单的需要赋值
|
||||
if ("30".equals(pmoItemVO.getVsrctype())) {
|
||||
pmoItemVO.setVbomversion(""); // 生产BOM版本号
|
||||
pmoItemVO.setCbomversionid(""); // 生产BOM版本
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
Logger.error("BeforePmoBomRule-exp:" + e.getMessage(), e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue