Merge remote-tracking branch 'origin/feature/DM/nflg-bom' into feature/DM/nflg-bom

This commit is contained in:
曹鹏飞 2024-06-03 14:09:53 +08:00
commit f496771201
2 changed files with 4 additions and 3 deletions

View File

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

View File

@ -116,7 +116,7 @@ public abstract class EBomToPbomBase {
for (String key : listMp.keySet()) { for (String key : listMp.keySet()) {
List<BomNewEbomParentVO> voList = listMp.get(key); List<BomNewEbomParentVO> voList = listMp.get(key);
BomNewEbomParentVO ent = voList.get(0); 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); result.add(ent);
} }
return result; return result;
@ -155,7 +155,7 @@ public abstract class EBomToPbomBase {
return oldParent; return oldParent;
} else { } else {
BomNewPbomParentEntity pBomParent = new BomNewPbomParentEntity(); BomNewPbomParentEntity pBomParent = new BomNewPbomParentEntity();
BeanUtil.copyProperties(parentVo, pBomParent); BeanUtil.copyProperties(parentVo, pBomParent,"sourceRowId");
pBomParent.setSourceRowId(parentVo.getBomRowId()); pBomParent.setSourceRowId(parentVo.getBomRowId());
pBomParent.setRowId(IdWorker.getId()); pBomParent.setRowId(IdWorker.getId());
pBomParent.setStatus(PBomStatusEnum.WAIT_PUBLISH.getValue()); pBomParent.setStatus(PBomStatusEnum.WAIT_PUBLISH.getValue());