|
@@ -633,6 +633,9 @@ public class MiddleMeterApplyServiceImpl extends BaseServiceImpl<MiddleMeterAppl
|
|
|
if (dto.getCurrent() == null || dto.getSize() == null){
|
|
|
throw new ServiceException("请传入分页信息");
|
|
|
}
|
|
|
+ if (dto.getContractIdRelation() != null){
|
|
|
+ dto.setContractId(dto.getContractIdRelation());
|
|
|
+ }
|
|
|
Integer current = dto.getCurrent();
|
|
|
Integer size = dto.getSize();
|
|
|
Integer start = (current-1) * size;
|
|
@@ -670,38 +673,41 @@ public class MiddleMeterApplyServiceImpl extends BaseServiceImpl<MiddleMeterAppl
|
|
|
}
|
|
|
}
|
|
|
//查询节点资料
|
|
|
- List<WbsFileVO> voList = baseMapper.getNodeData(ids);
|
|
|
- //节点划分
|
|
|
- if (voList.size() != 0){
|
|
|
- StringBuilder str = new StringBuilder();
|
|
|
- for (WbsFileVO vo : voList) {
|
|
|
- str.append(vo.getAncestors()+",");
|
|
|
- }
|
|
|
- str.deleteCharAt(str.length() -1);
|
|
|
- List<Long> longs = Func.toLongList(str.toString());
|
|
|
- HashSet<Long> set = new HashSet<>(longs);
|
|
|
- List<WbsTreeContract> infoList = baseMapper.getAllAncestors(set,dto.getContractId());
|
|
|
- if (infoList.size() == 0){
|
|
|
- throw new ServiceException("未获取到节点划分信息");
|
|
|
- }
|
|
|
- Map<Long, WbsTreeContract> map = infoList.stream().collect(Collectors.toMap(l -> l.getId(), l -> l));
|
|
|
- for (WbsFileVO vo : voList) {
|
|
|
- List<Long> longList = Func.toLongList(vo.getAncestors());
|
|
|
- Collections.reverse(longList);
|
|
|
- StringBuilder str2 = new StringBuilder();
|
|
|
- if (vo.getNodeType() == 6){
|
|
|
- for (Long aLong : longList) {
|
|
|
- WbsTreeContract info = map.get(aLong);
|
|
|
- str2.append(info.getNodeName()+"/");
|
|
|
- if (info.getNodeType() == 4){
|
|
|
- break;
|
|
|
+ List<WbsFileVO> voList = new ArrayList<>();
|
|
|
+ if (ids.size() != 0) {
|
|
|
+ voList = baseMapper.getNodeData(ids);
|
|
|
+ //节点划分
|
|
|
+ if (voList.size() != 0) {
|
|
|
+ StringBuilder str = new StringBuilder();
|
|
|
+ for (WbsFileVO vo : voList) {
|
|
|
+ str.append(vo.getAncestors() + ",");
|
|
|
+ }
|
|
|
+ str.deleteCharAt(str.length() - 1);
|
|
|
+ List<Long> longs = Func.toLongList(str.toString());
|
|
|
+ HashSet<Long> set = new HashSet<>(longs);
|
|
|
+ List<WbsTreeContract> infoList = baseMapper.getAllAncestors(set, dto.getContractId());
|
|
|
+ if (infoList.size() == 0) {
|
|
|
+ throw new ServiceException("未获取到节点划分信息");
|
|
|
+ }
|
|
|
+ Map<Long, WbsTreeContract> map = infoList.stream().collect(Collectors.toMap(l -> l.getId(), l -> l));
|
|
|
+ for (WbsFileVO vo : voList) {
|
|
|
+ List<Long> longList = Func.toLongList(vo.getAncestors());
|
|
|
+ Collections.reverse(longList);
|
|
|
+ StringBuilder str2 = new StringBuilder();
|
|
|
+ if (vo.getNodeType() == 6) {
|
|
|
+ for (Long aLong : longList) {
|
|
|
+ WbsTreeContract info = map.get(aLong);
|
|
|
+ str2.append(info.getNodeName() + "/");
|
|
|
+ if (info.getNodeType() == 4) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
+ str2.deleteCharAt(str2.length() - 1);
|
|
|
+ } else {
|
|
|
+ str2.append(vo.getNodeName());
|
|
|
}
|
|
|
- str2.deleteCharAt(str2.length() -1);
|
|
|
- }else {
|
|
|
- str2.append(vo.getNodeName());
|
|
|
+ vo.setPartName(str2.toString());
|
|
|
}
|
|
|
- vo.setPartName(str2.toString());
|
|
|
}
|
|
|
}
|
|
|
iPage.setRecords(voList);
|