Browse Source

修改导出预估工时审核导出

yusm 8 months ago
parent
commit
67d7e4da29

+ 16 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/GroupBudgetReviewController.java

@@ -234,8 +234,14 @@ public class GroupBudgetReviewController {
             queryWrapper.eq(GroupBudgetReview::getCreatorId,checkUserId);
             queryWrapper.eq(GroupBudgetReview::getCreatorId,checkUserId);
         }
         }
         List<GroupBudgetReview> list = groupBudgetReviewService.list(queryWrapper);
         List<GroupBudgetReview> list = groupBudgetReviewService.list(queryWrapper);
+        List<Integer> projectIdList=new ArrayList<>();
+        if (!list.isEmpty()) {
+            projectIdList = list.stream().map(GroupBudgetReview::getProjectId).distinct().collect(Collectors.toList());
+        }
+        List<Project> projectList = projectMapper.selectList(new LambdaQueryWrapper<Project>().in(Project::getId, projectIdList).eq(Project::getCompanyId, companyId));
         List<List<String>> dataList=new ArrayList<>();
         List<List<String>> dataList=new ArrayList<>();
         List<String> titleList=new ArrayList<>();
         List<String> titleList=new ArrayList<>();
+        titleList.add("项目编号");
         titleList.add("项目名称");
         titleList.add("项目名称");
         titleList.add("分组名称");
         titleList.add("分组名称");
         titleList.add("提交人");
         titleList.add("提交人");
@@ -249,6 +255,16 @@ public class GroupBudgetReviewController {
         dataList.add(titleList);
         dataList.add(titleList);
         for (GroupBudgetReview groupBudgetReview : list) {
         for (GroupBudgetReview groupBudgetReview : list) {
             List<String> item=new ArrayList<>();
             List<String> item=new ArrayList<>();
+            if (!projectList.isEmpty()){
+                Optional<Project> optional = projectList.stream().filter(p -> p.getId().equals(groupBudgetReview.getProjectId())).findFirst();
+                if (optional.isPresent()){
+                    item.add(optional.get().getProjectCode());
+                }else {
+                    item.add("");
+                }
+            }else {
+                item.add("");
+            }
             item.add(groupBudgetReview.getProjectName());
             item.add(groupBudgetReview.getProjectName());
             item.add(groupBudgetReview.getGroupName());
             item.add(groupBudgetReview.getGroupName());
             if((wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1)||(dingding!=null&&dingding.getContactNeedTranslate()==1)){
             if((wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1)||(dingding!=null&&dingding.getContactNeedTranslate()==1)){