手动合并test上的代码:设计岗用户可维护自己的数据,数据来源包括(原始Bom、sap 、excel、mdm、变更)
This commit is contained in:
parent
9f45527909
commit
e3fc5b2361
|
|
@ -2425,7 +2425,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
|
|
||||||
List<BomNewEbomChildEntity> delChildList = SpringUtil.getBean(BomNewEbomChildService.class).list(queryChildWrapper);
|
List<BomNewEbomChildEntity> delChildList = SpringUtil.getBean(BomNewEbomChildService.class).list(queryChildWrapper);
|
||||||
|
|
||||||
List<BomNewEbomChildEntity> delTagList = new ArrayList<>();
|
List<BomNewEbomChildEntity> deletingTagList = new ArrayList<>();
|
||||||
|
|
||||||
//检查原始bom里过来数据是否包含正常数据
|
//检查原始bom里过来数据是否包含正常数据
|
||||||
// List<BomNewEbomChildEntity> check1List = delChildList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_BOM.getValue(), u.getSource())
|
// List<BomNewEbomChildEntity> check1List = delChildList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_BOM.getValue(), u.getSource())
|
||||||
|
|
@ -2448,30 +2448,34 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
//原始bom不正常
|
//原始bom不正常 ,
|
||||||
List<BomNewEbomChildEntity> s1List = delChildList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_BOM.getValue(), u.getSource())
|
//24/10/15需求变更原始bom正常数据可删除
|
||||||
&& !Objects.equals(u.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())).collect(Collectors.toList());
|
// List<BomNewEbomChildEntity> toDel1List = delChildList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_BOM.getValue(), u.getSource())
|
||||||
if (CollectionUtil.isNotEmpty(s1List)) {
|
// && !Objects.equals(u.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())).collect(Collectors.toList());
|
||||||
delTagList.addAll(s1List);
|
// if (CollectionUtil.isNotEmpty(s1List)) {
|
||||||
}
|
// delTagList.addAll(s1List);
|
||||||
|
// }
|
||||||
|
|
||||||
//手动创建
|
//手动创建
|
||||||
List<BomNewEbomChildEntity> s2List = delChildList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_EXCE.getValue(), u.getSource())
|
//可删数据来源包含全部
|
||||||
|| Objects.equals(EBomSourceEnum.FROM_MDM.getValue(), u.getSource())
|
// List<BomNewEbomChildEntity> toDel2List = delChildList.stream().filter(u ->
|
||||||
|| Objects.equals(EBomSourceEnum.FROM_CHANGE.getValue(), u.getSource())
|
// Objects.equals(EBomSourceEnum.FROM_EXCE.getValue(), u.getSource())
|
||||||
|
// || Objects.equals(EBomSourceEnum.FROM_MDM.getValue(), u.getSource())
|
||||||
).collect(Collectors.toList());
|
// || Objects.equals(EBomSourceEnum.FROM_CHANGE.getValue(), u.getSource())
|
||||||
|
// || Objects.equals(EBomSourceEnum.FROM_SAP.getValue(), u.getSource())
|
||||||
|
// || Objects.equals(EBomSourceEnum.FROM_BOM.getValue(), u.getSource())
|
||||||
|
// ).collect(Collectors.toList());
|
||||||
|
|
||||||
//工艺岗可以删自己的和设计岗(手动、excel),
|
//工艺岗可以删自己的和设计岗(手动、excel),
|
||||||
// 设计自己删除自己
|
// 设计自己删除自己
|
||||||
//工艺岗用户1 可以删工艺岗用户2 的数据?
|
//工艺岗用户1 可以删工艺岗用户2 的数据?
|
||||||
if (CollectionUtil.isNotEmpty(s2List)) {
|
if (CollectionUtil.isNotEmpty(delChildList)) {
|
||||||
for (BomNewEbomChildEntity vo :
|
for (BomNewEbomChildEntity vo :
|
||||||
s2List) {
|
delChildList) {
|
||||||
if (userRoleService.technician()) { //工艺岗可删
|
if (userRoleService.technician()) { //工艺岗可删
|
||||||
delTagList.add(vo);
|
deletingTagList.add(vo);
|
||||||
} else if (userRoleService.designer() && vo.getCreatedBy().equals(SessionUtil.getUserCode())) { //自己的数据可删
|
} else if (userRoleService.designer() && vo.getCreatedBy().equals(SessionUtil.getUserCode())) { //自己的数据可删
|
||||||
delTagList.add(vo);
|
deletingTagList.add(vo);
|
||||||
} else {
|
} else {
|
||||||
throw new NflgBusinessException(STATE.Error, StrUtil.format("{}数据不是你的,无权删除", vo.getMaterialNo()));
|
throw new NflgBusinessException(STATE.Error, StrUtil.format("{}数据不是你的,无权删除", vo.getMaterialNo()));
|
||||||
|
|
||||||
|
|
@ -2479,12 +2483,12 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CollectionUtil.isNotEmpty(delTagList)) {
|
if (CollectionUtil.isNotEmpty(deletingTagList)) {
|
||||||
List<Long> rowIdList = delTagList.stream().map(BomNewEbomChildEntity::getRowId).collect(Collectors.toList());
|
List<Long> rowIdList = deletingTagList.stream().map(BomNewEbomChildEntity::getRowId).collect(Collectors.toList());
|
||||||
if (CollectionUtil.isNotEmpty(rowIdList)) {
|
if (CollectionUtil.isNotEmpty(rowIdList)) {
|
||||||
ebomChildService.removeByIds(rowIdList);
|
ebomChildService.removeByIds(rowIdList);
|
||||||
//将对应的parent设置为根节点
|
//将对应的parent设置为根节点
|
||||||
setRootIs1(delTagList.stream().map(BomNewEbomChildEntity::getMaterialNo).collect(Collectors.toList()), SessionUtil.getUserCode());
|
setRootIs1(deletingTagList.stream().map(BomNewEbomChildEntity::getMaterialNo).collect(Collectors.toList()), SessionUtil.getUserCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue