EBOM-物料和图号搜索
This commit is contained in:
parent
16f53a4fdb
commit
2112e9f648
|
|
@ -115,7 +115,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (StrUtil.isNotBlank(materialNo)) {
|
if (StrUtil.isNotBlank(materialNo)) {
|
||||||
List<String> parentMaterialByMaterialNo = getParentMaterialByMaterialNo(materialNo, !userRoleService.technician());
|
List<String> parentMaterialByMaterialNo = getParentMaterialByMaterialNo(materialNo, !userRoleService.technician()).stream().collect(Collectors.toList());
|
||||||
if (CollUtil.isNotEmpty(parentMaterialByMaterialNo)) {
|
if (CollUtil.isNotEmpty(parentMaterialByMaterialNo)) {
|
||||||
List<BomNewEbomParentVO> parents = this.getBaseMapper().getParentForMaterialNoSeach(parentMaterialByMaterialNo);
|
List<BomNewEbomParentVO> parents = this.getBaseMapper().getParentForMaterialNoSeach(parentMaterialByMaterialNo);
|
||||||
List<BomNewEbomParentVO> childs = this.getBaseMapper().getChildForMaterialNoSeach(parentMaterialByMaterialNo, materialNo);
|
List<BomNewEbomParentVO> childs = this.getBaseMapper().getChildForMaterialNoSeach(parentMaterialByMaterialNo, materialNo);
|
||||||
|
|
@ -132,7 +132,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
returnResult = result;
|
returnResult = result;
|
||||||
}
|
}
|
||||||
//动态判断异常
|
//动态判断异常
|
||||||
CheckEBomExceptoinDynamic.check(returnResult.getRecords());
|
// CheckEBomExceptoinDynamic.check(returnResult.getRecords());
|
||||||
return returnResult;
|
return returnResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -147,12 +147,15 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
resutlData.setPages(1);
|
resutlData.setPages(1);
|
||||||
resutlData.setCurrent(1L);
|
resutlData.setCurrent(1L);
|
||||||
List<BomNewEbomParentVO> all = new ArrayList<>();
|
List<BomNewEbomParentVO> all = new ArrayList<>();
|
||||||
all.addAll(resultParents);
|
// all.addAll(resultParents);
|
||||||
all.addAll(childs);
|
all.addAll(childs);
|
||||||
List<BomNewEbomParentVO> result = new ArrayList<>();
|
List<BomNewEbomParentVO> result = new ArrayList<>();
|
||||||
for (BomNewEbomParentVO vo : resultParents) {
|
for (BomNewEbomParentVO vo : resultParents) {
|
||||||
vo.setParentRowId(0L);
|
//vo.setParentRowId(0L);
|
||||||
result.addAll(CTreeUtils.toTree(0L, all, BomNewEbomParentVO::getParentRowId, BomNewEbomParentVO::getBomRowId));
|
List<BomNewEbomParentVO> da=new ArrayList<>();
|
||||||
|
da.addAll(childs);
|
||||||
|
da.add(vo);
|
||||||
|
result.addAll(CTreeUtils.toTree(0L, da, BomNewEbomParentVO::getParentRowId, BomNewEbomParentVO::getBomRowId));
|
||||||
}
|
}
|
||||||
resutlData.setRecords(result);
|
resutlData.setRecords(result);
|
||||||
return resutlData;
|
return resutlData;
|
||||||
|
|
@ -165,9 +168,9 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
* @param materialNo
|
* @param materialNo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<String> getParentMaterialByMaterialNo(String materialNo, Boolean selfIs) {
|
public Set<String> getParentMaterialByMaterialNo(String materialNo, Boolean selfIs) {
|
||||||
BomNewEbomMaterialUseEntity materialBom = bomNewEbomMaterialUseService.lambdaQuery().eq(BomNewEbomMaterialUseEntity::getMaterialNo, materialNo).one();
|
BomNewEbomMaterialUseEntity materialBom = bomNewEbomMaterialUseService.lambdaQuery().eq(BomNewEbomMaterialUseEntity::getMaterialNo, materialNo).one();
|
||||||
List<String> result = new ArrayList<>();
|
Set<String> result = new HashSet<>();
|
||||||
if (Objects.nonNull(materialBom) && StrUtil.isNotBlank(materialBom.getParentMaterialNo())) {
|
if (Objects.nonNull(materialBom) && StrUtil.isNotBlank(materialBom.getParentMaterialNo())) {
|
||||||
Set<String> relSkuNo = Sets.newHashSet(StrUtil.split(materialBom.getParentMaterialNo(), ","));
|
Set<String> relSkuNo = Sets.newHashSet(StrUtil.split(materialBom.getParentMaterialNo(), ","));
|
||||||
if (selfIs && CollUtil.isNotEmpty(relSkuNo)) {
|
if (selfIs && CollUtil.isNotEmpty(relSkuNo)) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue