|
@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
@@ -990,24 +991,32 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
public List<AppWbsTreeContractVO> searchNodeAllTableAndFile(String primaryKeyId, String type, String
|
|
|
contractId, String projectId) {
|
|
|
List<AppWbsTreeContractVO> vos = this.searchNodeAllTable(primaryKeyId, type, contractId, projectId, null);
|
|
|
+ List<AppWbsTreeContractVO> voList = new ArrayList<>();
|
|
|
+ List<TableFile> files2 = tableFileService.list(new LambdaQueryWrapper<TableFile>()
|
|
|
+ .eq(TableFile::getTabId,primaryKeyId));
|
|
|
if (vos != null && vos.size() > 0) {
|
|
|
List<Long> list = vos.stream().map(AppWbsTreeContractVO::getPKeyId).collect(Collectors.toList());
|
|
|
List<TableFile> files = tableFileService.getAllFileByIds(list);
|
|
|
if (files != null && files.size() > 0) {
|
|
|
Map<String, List<TableFile>> map = files.parallelStream()
|
|
|
.collect(Collectors.groupingBy(TableFile::getTabId));
|
|
|
- List<AppWbsTreeContractVO> voList = new ArrayList<>();
|
|
|
for (AppWbsTreeContractVO vo : vos) {
|
|
|
if (map.get(vo.getPKeyId() + "") != null && map.get(vo.getPKeyId() + "").size() > 0) {
|
|
|
vo.setFileList(map.get(vo.getPKeyId() + ""));
|
|
|
voList.add(vo);
|
|
|
}
|
|
|
}
|
|
|
- return voList;
|
|
|
}
|
|
|
- return null;
|
|
|
}
|
|
|
- return null;
|
|
|
+ /** 如果存在节点附件,末尾追加节点附件*/
|
|
|
+ if (files2 != null && files2.size() > 0){
|
|
|
+ WbsTreeContract treeContract = this.getOne(new LambdaQueryWrapper<WbsTreeContract>()
|
|
|
+ .eq(WbsTreeContract::getPKeyId,primaryKeyId));
|
|
|
+ AppWbsTreeContractVO vo = BeanUtil.copyProperties(treeContract, AppWbsTreeContractVO.class);
|
|
|
+ vo.setFileList(files2);
|
|
|
+ voList.add(vo);
|
|
|
+ }
|
|
|
+ return voList;
|
|
|
}
|
|
|
|
|
|
@Override
|