1、转PBOM

This commit is contained in:
大米 2024-06-03 14:04:10 +08:00
parent 39f9cdae60
commit da5fcd54cf
2 changed files with 4 additions and 3 deletions

View File

@ -71,10 +71,11 @@ public class EBomToPBom extends EBomToPbomBase {
//合并子级
for (BomNewEbomParentVO eb : mergeChild) {
BomNewPbomChildEntity childEnt = new BomNewPbomChildEntity();
BeanUtil.copyProperties(eb, childEnt);
BeanUtil.copyProperties(eb, childEnt,"sourceRowId");
childEnt.setRowId(IdWorker.getId());
childEnt.setParentRowId(parentEnt.getRowId());
childEnt.setFacCode(facCode);
childEnt.setSourceRowId(eb.getRowId());
childEnt.setIdentityNo(StrUtil.join("-", parentEnt.getMaterialNo(), eb.getMaterialNo()));
this.pBomChildResult.add(childEnt);
}

View File

@ -116,7 +116,7 @@ public abstract class EBomToPbomBase {
for (String key : listMp.keySet()) {
List<BomNewEbomParentVO> voList = listMp.get(key);
BomNewEbomParentVO ent = voList.get(0);
ent.setNum(voList.stream().map(aa -> aa.getNum()).reduce(BigDecimal.ZERO, BigDecimal::add));
ent.setNum(voList.stream().filter(u->Objects.nonNull(u.getNum())).map(aa -> aa.getNum()).reduce(BigDecimal.ZERO, BigDecimal::add));
result.add(ent);
}
return result;
@ -155,7 +155,7 @@ public abstract class EBomToPbomBase {
return oldParent;
} else {
BomNewPbomParentEntity pBomParent = new BomNewPbomParentEntity();
BeanUtil.copyProperties(parentVo, pBomParent);
BeanUtil.copyProperties(parentVo, pBomParent,"sourceRowId");
pBomParent.setSourceRowId(parentVo.getBomRowId());
pBomParent.setRowId(IdWorker.getId());
pBomParent.setStatus(PBomStatusEnum.WAIT_PUBLISH.getValue());