去掉修改排序号的值

This commit is contained in:
10002327 2024-09-02 10:46:06 +08:00
parent ef5e9e23ae
commit 2ab79e68bc
1 changed files with 0 additions and 11 deletions

View File

@ -414,18 +414,7 @@ public class EbomApi extends BaseApi {
checkDeleteRule(dto);
bomNewEbomParentService.deleteBomChild(dto.getDelDatas(), dto.getParent());
//修改排序号的值按照物料编码升序 by 10002327 0830
if(CollectionUtil.isNotEmpty(dto.getDatas())){
List<BomNewEbomParentVO> copyList = ListUtil.toCopyOnWriteArrayList(dto.getDatas());
List<BomNewEbomParentVO> sortedList = copyList.stream().sorted(Comparator.comparing(BaseMaterialVO::getMaterialNo)).collect(Collectors.toList());
Map<String,String> materialMap = sortedList.stream().collect(Collectors.toMap(BaseMaterialVO::getMaterialNo,bom -> {
int idx = sortedList.indexOf(bom);
return StrUtil.padPre(String.valueOf(idx + 1),3,'0');
},(k1,k2)->k1));
dto.getDatas().forEach(bom -> bom.setOrderNumber(materialMap.getOrDefault(bom.getMaterialNo(),bom.getOrderNumber())));
}
BomNewEbomParentVO temporary = bomNewEbomParentService.temporary(dto);
return ResultVO.success(temporary);
}