PBOM发布时,pbom在工作表时,当创建人为本人或版本大于当前版本则覆盖
This commit is contained in:
parent
ed45236c00
commit
96f7923e26
|
|
@ -85,7 +85,7 @@ public abstract class EBomToPbomBase {
|
||||||
|
|
||||||
//当子级为F项或Z项时-无需转的父级物料
|
//当子级为F项或Z项时-无需转的父级物料
|
||||||
protected Set<String> childDelMaterialNos = new HashSet<>();
|
protected Set<String> childDelMaterialNos = new HashSet<>();
|
||||||
private BomNewPbomParentEntity ;
|
|
||||||
|
|
||||||
public abstract void convert();
|
public abstract void convert();
|
||||||
|
|
||||||
|
|
@ -188,6 +188,8 @@ public abstract class EBomToPbomBase {
|
||||||
else if (Objects.nonNull(oldParent) && oldParent.getStatus() < EBomStatusEnum.PUBLISHED.getValue()) {
|
else if (Objects.nonNull(oldParent) && oldParent.getStatus() < EBomStatusEnum.PUBLISHED.getValue()) {
|
||||||
//if (oldParent.getCreatedBy().equals(parentVo.getCreatedBy())) {
|
//if (oldParent.getCreatedBy().equals(parentVo.getCreatedBy())) {
|
||||||
if (ConvertToPBomModelEnum.OVERRIDE.equalsValue(convertMode.getValue())) {
|
if (ConvertToPBomModelEnum.OVERRIDE.equalsValue(convertMode.getValue())) {
|
||||||
|
//当bom创建人为本人 或 版本大于当前版本则覆盖
|
||||||
|
if (oldParent.getCreatedBy().equals(parentVo.getCreatedBy()) || VersionUtil.compare(parentVo.getCurrentVersion(),oldParent.getCurrentVersion())>0){
|
||||||
SpringUtil.getBean(BomNewPbomChildService.class).getBaseMapper().deleteByMap(ImmutableMap.of("parent_row_id", oldParent.getRowId()));
|
SpringUtil.getBean(BomNewPbomChildService.class).getBaseMapper().deleteByMap(ImmutableMap.of("parent_row_id", oldParent.getRowId()));
|
||||||
// this.delParentRowIds.add(oldParent.getRowId());
|
// this.delParentRowIds.add(oldParent.getRowId());
|
||||||
oldParent.setSourceRowId(parentVo.getBomRowId());
|
oldParent.setSourceRowId(parentVo.getBomRowId());
|
||||||
|
|
@ -197,7 +199,7 @@ public abstract class EBomToPbomBase {
|
||||||
oldParent.setDeptRowId(SessionUtil.getDepartRowId());
|
oldParent.setDeptRowId(SessionUtil.getDepartRowId());
|
||||||
this.pBomParentResult.add(oldParent);
|
this.pBomParentResult.add(oldParent);
|
||||||
return oldParent;
|
return oldParent;
|
||||||
// }
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// 降parentVo 及其子节点标记为不转换
|
// 降parentVo 及其子节点标记为不转换
|
||||||
|
|
|
||||||
|
|
@ -192,14 +192,16 @@ public abstract class FormalEBomToPbomBase {
|
||||||
else if (Objects.nonNull(oldParent) && oldParent.getStatus() < EBomStatusEnum.PUBLISHED.getValue()) {
|
else if (Objects.nonNull(oldParent) && oldParent.getStatus() < EBomStatusEnum.PUBLISHED.getValue()) {
|
||||||
//if (oldParent.getCreatedBy().equals(parentVo.getCreatedBy())) {
|
//if (oldParent.getCreatedBy().equals(parentVo.getCreatedBy())) {
|
||||||
if (ConvertToPBomModelEnum.OVERRIDE.equalsValue(convertMode.getValue())) {
|
if (ConvertToPBomModelEnum.OVERRIDE.equalsValue(convertMode.getValue())) {
|
||||||
SpringUtil.getBean(BomNewPbomChildService.class).getBaseMapper().deleteByMap(ImmutableMap.of("parent_row_id", oldParent.getRowId()));
|
if (oldParent.getCreatedBy().equals(parentVo.getCreatedBy()) || VersionUtil.compare(parentVo.getCurrentVersion(),oldParent.getCurrentVersion())>0) {
|
||||||
oldParent.setSourceRowId(parentVo.getBomRowId());
|
SpringUtil.getBean(BomNewPbomChildService.class).getBaseMapper().deleteByMap(ImmutableMap.of("parent_row_id", oldParent.getRowId()));
|
||||||
oldParent.setCreatedTime(LocalDateTime.now());
|
oldParent.setSourceRowId(parentVo.getBomRowId());
|
||||||
oldParent.setCreatedBy(SessionUtil.getUserCode());
|
oldParent.setCreatedTime(LocalDateTime.now());
|
||||||
oldParent.setDeptName(SessionUtil.getDepartName());
|
oldParent.setCreatedBy(SessionUtil.getUserCode());
|
||||||
oldParent.setDeptRowId(SessionUtil.getDepartRowId());
|
oldParent.setDeptName(SessionUtil.getDepartName());
|
||||||
this.pBomParentResult.add(oldParent);
|
oldParent.setDeptRowId(SessionUtil.getDepartRowId());
|
||||||
return oldParent;
|
this.pBomParentResult.add(oldParent);
|
||||||
|
return oldParent;
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// 降parentVo 及其子节点标记为不转换
|
// 降parentVo 及其子节点标记为不转换
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue