فهرست منبع

工时成本导出

cs 2 سال پیش
والد
کامیت
408f94e45f

+ 4 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectController.java

@@ -234,16 +234,16 @@ public class ProjectController {
      * 导出查询者所在公司每个项目的工时成本
      * 导出查询者所在公司每个项目的工时成本
      */
      */
     @RequestMapping("/exportTimeCost")
     @RequestMapping("/exportTimeCost")
-    public HttpRespMsg exportTimeCost(String startDate, String endDate, Integer projectId, String userId, Boolean projectSum,Integer type,Integer deptId,@RequestParam(defaultValue = "1") Integer stateKey) {
-        return projectService.exportTimeCost(startDate, endDate, projectId, userId, projectSum,type,deptId,stateKey, request);
+    public HttpRespMsg exportTimeCost(String exportContent,String startDate, String endDate, Integer projectId, String userId, Boolean projectSum,Integer type,Integer deptId,@RequestParam(defaultValue = "1") Integer stateKey) {
+        return projectService.exportTimeCost(exportContent,startDate, endDate, projectId, userId, projectSum,type,deptId,stateKey, request);
     }
     }
 
 
     /**
     /**
      * 导出查询者所在公司每个项目分类的工时成本
      * 导出查询者所在公司每个项目分类的工时成本
      */
      */
     @RequestMapping("/exportTimeCostByCategory")
     @RequestMapping("/exportTimeCostByCategory")
-    public HttpRespMsg exportTimeCostByCategory(String startDate, String endDate, Integer projectCategoryId, String userId, Boolean projectSum,Integer type) {
-        return projectService.exportTimeCostByCategory(startDate, endDate, projectCategoryId, userId, projectSum,type, request);
+    public HttpRespMsg exportTimeCostByCategory(String exportContent,String startDate, String endDate, Integer projectCategoryId, String userId, Boolean projectSum,Integer type) {
+        return projectService.exportTimeCostByCategory(exportContent,startDate, endDate, projectCategoryId, userId, projectSum,type, request);
     }
     }
 
 
     /**
     /**

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ProjectService.java

@@ -58,7 +58,7 @@ public interface ProjectService extends IService<Project> {
 
 
     HttpRespMsg getAllMembCost(String startDate, String endDate, Integer projectId, HttpServletRequest request);
     HttpRespMsg getAllMembCost(String startDate, String endDate, Integer projectId, HttpServletRequest request);
 
 
-    HttpRespMsg exportTimeCost(String startDate, String endDate, Integer projectId,String userId, Boolean projectSum,Integer type,Integer deptId,Integer stateKey,HttpServletRequest request);
+    HttpRespMsg exportTimeCost(String exportContent,String startDate, String endDate, Integer projectId,String userId, Boolean projectSum,Integer type,Integer deptId,Integer stateKey,HttpServletRequest request);
 
 
     HttpRespMsg updateProgress(Integer id, Integer progress, HttpServletRequest request);
     HttpRespMsg updateProgress(Integer id, Integer progress, HttpServletRequest request);
 
 
@@ -143,7 +143,7 @@ public interface ProjectService extends IService<Project> {
 
 
     HttpRespMsg getTimeCostByCategory(String startDate, String endDate, String userId, HttpServletRequest request);
     HttpRespMsg getTimeCostByCategory(String startDate, String endDate, String userId, HttpServletRequest request);
 
 
-    HttpRespMsg exportTimeCostByCategory(String startDate, String endDate, Integer projectCategoryId, String userId, Boolean projectSum, Integer type, HttpServletRequest request);
+    HttpRespMsg exportTimeCostByCategory(String exportContent,String startDate, String endDate, Integer projectCategoryId, String userId, Boolean projectSum, Integer type, HttpServletRequest request);
 
 
     HttpRespMsg getUserWorkingTimeList(String userId, Integer projectId, String startDate, String endDate, Integer pageIndex, Integer pageSize,HttpServletRequest request,Integer departmentId);
     HttpRespMsg getUserWorkingTimeList(String userId, Integer projectId, String startDate, String endDate, Integer pageIndex, Integer pageSize,HttpServletRequest request,Integer departmentId);
 
 

+ 148 - 53
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -1118,7 +1118,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
 
 
     //导出查询者所在公司每个项目的工时成本,包括项目人员明细统计
     //导出查询者所在公司每个项目的工时成本,包括项目人员明细统计
     @Override
     @Override
-    public HttpRespMsg exportTimeCost(String startDate, String endDate,Integer projectId, String userId, Boolean projectSum,Integer type,Integer deptId, Integer stateKey,HttpServletRequest request) {
+    public HttpRespMsg exportTimeCost(String exportContent,String startDate, String endDate,Integer projectId, String userId, Boolean projectSum,Integer type,Integer deptId, Integer stateKey,HttpServletRequest request) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         try {
         try {
             User targetUser = userMapper.selectById(request.getHeader("Token"));
             User targetUser = userMapper.selectById(request.getHeader("Token"));
@@ -1192,14 +1192,22 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 headList.add(MessageUtils.message("entry.personnel"));
                 headList.add(MessageUtils.message("entry.personnel"));
                 //headList.add("部门");
                 //headList.add("部门");
                 headList.add(MessageUtils.message("excel.department"));
                 headList.add(MessageUtils.message("excel.department"));
-                if(functionTimeList.size()>0){
+                //hours:仅导出工时;cost:导出成本;hoursAndCost:导出成本和工时;
+                if ("hours".equals(exportContent) && functionTimeList.size()>0){
                     //headList.add("工时(h)");
                     //headList.add("工时(h)");
                     headList.add(MessageUtils.message("entry.workHours")+"(h)");
                     headList.add(MessageUtils.message("entry.workHours")+"(h)");
-                }
-                if(functionCostList.size()>0){
+                }else if ("cost".equals(exportContent) && functionCostList.size()>0){
                     //headList.add("成本(元)");
                     //headList.add("成本(元)");
                     headList.add(MessageUtils.message("entry.cost")+"(元)");
                     headList.add(MessageUtils.message("entry.cost")+"(元)");
+                }else {
+                    if(functionTimeList.size()>0 && functionCostList.size()>0){
+                        //headList.add("工时(h)");
+                        headList.add(MessageUtils.message("entry.workHours")+"(h)");
+                        //headList.add("成本(元)");
+                        headList.add(MessageUtils.message("entry.cost")+"(元)");
+                    }
                 }
                 }
+
                 allList=new ArrayList<>();
                 allList=new ArrayList<>();
                 allList.add(headList);
                 allList.add(headList);
                 double totalCostTime = 0;
                 double totalCostTime = 0;
@@ -1219,11 +1227,16 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     rowData.add((String)map.get("categoryName"));
                     rowData.add((String)map.get("categoryName"));
                     rowData.add("");
                     rowData.add("");
                     rowData.add("");
                     rowData.add("");
-                    if(functionTimeList.size()>0){
+
+                    if ("hours".equals(exportContent) && functionTimeList.size()>0){
                         rowData.add(((Double)map.get("cost")).toString());
                         rowData.add(((Double)map.get("cost")).toString());
-                    }
-                    if(functionCostList.size()>0){
+                    }else if ("cost".equals(exportContent) && functionCostList.size()>0){
                         rowData.add(((BigDecimal)map.get("costMoney")).toString());
                         rowData.add(((BigDecimal)map.get("costMoney")).toString());
+                    }else {
+                        if(functionTimeList.size()>0 && functionCostList.size()>0){
+                            rowData.add(((Double)map.get("cost")).toString());
+                            rowData.add(((BigDecimal)map.get("costMoney")).toString());
+                        }
                     }
                     }
                     if (projectSum != null && projectSum == true) {
                     if (projectSum != null && projectSum == true) {
                         allList.add(rowData);
                         allList.add(rowData);
@@ -1263,12 +1276,18 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                             membRowData.add((String)membMap.get("name"));
                             membRowData.add((String)membMap.get("name"));
                             membRowData.add((String)membMap.get("departmentName"));
                             membRowData.add((String)membMap.get("departmentName"));
                         }
                         }
-                        if(functionTimeList.size()>0){
+
+                        if ("hours".equals(exportContent) && functionTimeList.size()>0){
                             membRowData.add(((Double)membMap.get("cost")).toString());
                             membRowData.add(((Double)membMap.get("cost")).toString());
-                        }
-                        if(functionCostList.size()>0){
+                        }else if ("cost".equals(exportContent) && functionCostList.size()>0){
                             membRowData.add(((BigDecimal)membMap.get("costMoney")).toString());
                             membRowData.add(((BigDecimal)membMap.get("costMoney")).toString());
+                        }else {
+                            if(functionTimeList.size()>0 && functionCostList.size()>0){
+                                membRowData.add(((Double)membMap.get("cost")).toString());
+                                membRowData.add(((BigDecimal)membMap.get("costMoney")).toString());
+                            }
                         }
                         }
+
                         allList.add(membRowData);
                         allList.add(membRowData);
                     }
                     }
                 }
                 }
@@ -1280,12 +1299,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 sumRow.add("");
                 sumRow.add("");
                 sumRow.add("");
                 sumRow.add("");
                 sumRow.add("");
                 sumRow.add("");
-                if(functionTimeList.size()>0){
+                if ("hours".equals(exportContent) && functionTimeList.size()>0){
                     sumRow.add(""+new BigDecimal(totalCostTime).setScale(1, BigDecimal.ROUND_HALF_UP));
                     sumRow.add(""+new BigDecimal(totalCostTime).setScale(1, BigDecimal.ROUND_HALF_UP));
-                }
-                if(functionCostList.size()>0){
+                }else if ("cost".equals(exportContent) && functionCostList.size()>0){
                     sumRow.add(totalMoneyCost.toString());
                     sumRow.add(totalMoneyCost.toString());
+                }else {
+                    if(functionTimeList.size()>0 && functionCostList.size()>0){
+                        sumRow.add(""+new BigDecimal(totalCostTime).setScale(1, BigDecimal.ROUND_HALF_UP));
+                        sumRow.add(totalMoneyCost.toString());
+                    }
                 }
                 }
+
                 allList.add(sumRow);
                 allList.add(sumRow);
             }else{
             }else{
                 List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
                 List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
@@ -1295,23 +1319,36 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 //headList.add("人员");
                 //headList.add("人员");
                 headList.add(MessageUtils.message("entry.personnel"));
                 headList.add(MessageUtils.message("entry.personnel"));
                 projectNames.forEach(pn->{
                 projectNames.forEach(pn->{
-                    if(functionTimeList.size()>0){
+                    if ("hours".equals(exportContent) && functionTimeList.size()>0){
                         //headList.add(String.valueOf(pn)+"/工时");
                         //headList.add(String.valueOf(pn)+"/工时");
                         headList.add(String.valueOf(pn)+"/"+MessageUtils.message("entry.workHours"));
                         headList.add(String.valueOf(pn)+"/"+MessageUtils.message("entry.workHours"));
-                    }
-                    if(functionCostList.size()>0){
+                    }else if ("cost".equals(exportContent) && functionCostList.size()>0){
                         //headList.add(String.valueOf(pn)+"/成本");
                         //headList.add(String.valueOf(pn)+"/成本");
                         headList.add(String.valueOf(pn)+"/"+MessageUtils.message("entry.cost"));
                         headList.add(String.valueOf(pn)+"/"+MessageUtils.message("entry.cost"));
+                    }else {
+                        if(functionTimeList.size()>0 && functionCostList.size()>0){
+                            //headList.add(String.valueOf(pn)+"/工时");
+                            headList.add(String.valueOf(pn)+"/"+MessageUtils.message("entry.workHours"));
+                            //headList.add(String.valueOf(pn)+"/成本");
+                            headList.add(String.valueOf(pn)+"/"+MessageUtils.message("entry.cost"));
+                        }
                     }
                     }
                 });
                 });
-                if(functionTimeList.size()>0){
+                if ("hours".equals(exportContent) && functionTimeList.size()>0){
                     //headList.add("合计/工时");
                     //headList.add("合计/工时");
                     headList.add(MessageUtils.message("entry.total")+"/"+MessageUtils.message("entry.workHours"));
                     headList.add(MessageUtils.message("entry.total")+"/"+MessageUtils.message("entry.workHours"));
-                }
-                if(functionCostList.size()>0){
+                }else if ("cost".equals(exportContent) && functionCostList.size()>0){
                     //headList.add("合计/成本");
                     //headList.add("合计/成本");
                     headList.add(MessageUtils.message("entry.total")+"/"+MessageUtils.message("entry.cost"));
                     headList.add(MessageUtils.message("entry.total")+"/"+MessageUtils.message("entry.cost"));
+                }else {
+                    if(functionTimeList.size()>0 && functionCostList.size()>0){
+                        //headList.add("合计/工时");
+                        headList.add(MessageUtils.message("entry.total")+"/"+MessageUtils.message("entry.workHours"));
+                        //headList.add("合计/成本");
+                        headList.add(MessageUtils.message("entry.total")+"/"+MessageUtils.message("entry.cost"));
+                    }
                 }
                 }
+
                 allList=new ArrayList<>();
                 allList=new ArrayList<>();
                 allList.add(headList);
                 allList.add(headList);
                 //统计当前所有项目所有人的时间成本投入
                 //统计当前所有项目所有人的时间成本投入
@@ -1325,28 +1362,42 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     for(Object i:projectIds){
                     for(Object i:projectIds){
                         List<Map<String, Object>> resultList = mapList.stream().filter(mp -> mp.get("projectId").equals(i)).collect(Collectors.toList());
                         List<Map<String, Object>> resultList = mapList.stream().filter(mp -> mp.get("projectId").equals(i)).collect(Collectors.toList());
                         if(resultList.size()>0){
                         if(resultList.size()>0){
-                            if(functionTimeList.size()>0){
+                            if ("hours".equals(exportContent) && functionTimeList.size()>0){
                                 membRowData.add(String.valueOf(resultList.get(0).get("cost")));
                                 membRowData.add(String.valueOf(resultList.get(0).get("cost")));
-                            }
-                            if(functionCostList.size()>0){
+                            }else if ("cost".equals(exportContent) && functionCostList.size()>0){
                                 membRowData.add(String.valueOf(resultList.get(0).get("costMoney")));
                                 membRowData.add(String.valueOf(resultList.get(0).get("costMoney")));
+                            }else {
+                                if(functionTimeList.size()>0 && functionCostList.size()>0){
+                                    membRowData.add(String.valueOf(resultList.get(0).get("cost")));
+                                    membRowData.add(String.valueOf(resultList.get(0).get("costMoney")));
+                                }
                             }
                             }
+
                             costTime += (Double)resultList.get(0).get("cost");
                             costTime += (Double)resultList.get(0).get("cost");
                             moneyCost = moneyCost.add((BigDecimal)resultList.get(0).get("costMoney"));
                             moneyCost = moneyCost.add((BigDecimal)resultList.get(0).get("costMoney"));
                         }else{
                         }else{
-                            if(functionTimeList.size()>0){
+                            if ("hours".equals(exportContent) && functionTimeList.size()>0){
                                 membRowData.add("");
                                 membRowData.add("");
-                            }
-                            if(functionCostList.size()>0){
+                            }else if ("cost".equals(exportContent) && functionCostList.size()>0){
                                 membRowData.add("");
                                 membRowData.add("");
+                            }else {
+                                if(functionTimeList.size()>0 && functionCostList.size()>0){
+                                    membRowData.add("");
+                                    membRowData.add("");
+                                }
                             }
                             }
+
                         }
                         }
                     }
                     }
-                    if(functionTimeList.size()>0){
+                    if ("hours".equals(exportContent) && functionTimeList.size()>0){
                         membRowData.add(""+new BigDecimal(costTime).setScale(1, BigDecimal.ROUND_HALF_UP));
                         membRowData.add(""+new BigDecimal(costTime).setScale(1, BigDecimal.ROUND_HALF_UP));
-                    }
-                    if(functionCostList.size()>0){
+                    }else if ("cost".equals(exportContent) && functionCostList.size()>0){
                         membRowData.add(moneyCost.toString());
                         membRowData.add(moneyCost.toString());
+                    }else {
+                        if(functionTimeList.size()>0 && functionCostList.size()>0){
+                            membRowData.add(""+new BigDecimal(costTime).setScale(1, BigDecimal.ROUND_HALF_UP));
+                            membRowData.add(moneyCost.toString());
+                        }
                     }
                     }
                     if(mapList.size()>0){
                     if(mapList.size()>0){
                         allList.add(membRowData);
                         allList.add(membRowData);
@@ -5430,7 +5481,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
     }
     }
 
 
     @Override
     @Override
-    public HttpRespMsg exportTimeCostByCategory(String startDate, String endDate, Integer projectCategoryId, String userId, Boolean projectSum, Integer type, HttpServletRequest request) {
+    public HttpRespMsg exportTimeCostByCategory(String exportContent,String startDate, String endDate, Integer projectCategoryId, String userId, Boolean projectSum, Integer type, HttpServletRequest request) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         try {
         try {
             //根据系统配置的员工成本计算方式,按固定时薪还是固定月薪,分情况计算。
             //根据系统配置的员工成本计算方式,按固定时薪还是固定月薪,分情况计算。
@@ -5471,14 +5522,21 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 List<String> headList = new ArrayList<String>();
                 List<String> headList = new ArrayList<String>();
                 //headList.add("项目分类");
                 //headList.add("项目分类");
                 headList.add(MessageUtils.message("entry.projectType"));
                 headList.add(MessageUtils.message("entry.projectType"));
-                if(functionTimeList.size()>0){
+                if ("hours".equals(exportContent) && functionTimeList.size()>0){
                     //headList.add("工时(h)");
                     //headList.add("工时(h)");
                     headList.add(MessageUtils.message("entry.workHours")+"(h)");
                     headList.add(MessageUtils.message("entry.workHours")+"(h)");
-                }
-                if(functionCostList.size()>0){
+                }else if ("cost".equals(exportContent) && functionCostList.size()>0){
                     //headList.add("成本(元)");
                     //headList.add("成本(元)");
                     headList.add(MessageUtils.message("entry.cost")+"(元)");
                     headList.add(MessageUtils.message("entry.cost")+"(元)");
+                }else {
+                    if(functionTimeList.size()>0 && functionCostList.size()>0){
+                        //headList.add("工时(h)");
+                        headList.add(MessageUtils.message("entry.workHours")+"(h)");
+                        //headList.add("成本(元)");
+                        headList.add(MessageUtils.message("entry.cost")+"(元)");
+                    }
                 }
                 }
+
                 allList=new ArrayList<>();
                 allList=new ArrayList<>();
                 allList.add(headList);
                 allList.add(headList);
                 double totalCostTime = 0;
                 double totalCostTime = 0;
@@ -5494,11 +5552,15 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     totalCostTime += (Double)map.get("cost");
                     totalCostTime += (Double)map.get("cost");
                     List<String> rowData = new ArrayList<String>();
                     List<String> rowData = new ArrayList<String>();
                     rowData.add((String)map.get("categoryName"));
                     rowData.add((String)map.get("categoryName"));
-                    if(functionTimeList.size()>0){
+                    if ("hours".equals(exportContent) && functionTimeList.size()>0){
                         rowData.add(((Double)map.get("cost")).toString());
                         rowData.add(((Double)map.get("cost")).toString());
-                    }
-                    if(functionCostList.size()>0){
+                    }else if ("cost".equals(exportContent) && functionCostList.size()>0){
                         rowData.add(((BigDecimal)map.get("costMoney")).toString());
                         rowData.add(((BigDecimal)map.get("costMoney")).toString());
+                    }else {
+                        if(functionTimeList.size()>0 && functionCostList.size()>0){
+                            rowData.add(((Double)map.get("cost")).toString());
+                            rowData.add(((BigDecimal)map.get("costMoney")).toString());
+                        }
                     }
                     }
                     allList.add(rowData);
                     allList.add(rowData);
                 }
                 }
@@ -5506,12 +5568,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 sumRow=new ArrayList<>();
                 sumRow=new ArrayList<>();
                 //sumRow.add("合计");
                 //sumRow.add("合计");
                 sumRow.add(MessageUtils.message("entry.total"));
                 sumRow.add(MessageUtils.message("entry.total"));
-                if(functionTimeList.size()>0){
+                if ("hours".equals(exportContent) && functionTimeList.size()>0){
                     sumRow.add(""+new BigDecimal(totalCostTime).setScale(1, BigDecimal.ROUND_HALF_UP));
                     sumRow.add(""+new BigDecimal(totalCostTime).setScale(1, BigDecimal.ROUND_HALF_UP));
-                }
-                if(functionCostList.size()>0){
+                }else if ("cost".equals(exportContent) && functionCostList.size()>0){
                     sumRow.add(totalMoneyCost.toString());
                     sumRow.add(totalMoneyCost.toString());
+                }else {
+                    if(functionTimeList.size()>0 && functionCostList.size()>0){
+                        sumRow.add(""+new BigDecimal(totalCostTime).setScale(1, BigDecimal.ROUND_HALF_UP));
+                        sumRow.add(totalMoneyCost.toString());
+                    }
                 }
                 }
+
                 allList.add(sumRow);
                 allList.add(sumRow);
             }else{
             }else{
                 List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
                 List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
@@ -5521,23 +5588,37 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 //headList.add("人员");
                 //headList.add("人员");
                 headList.add(MessageUtils.message("entry.personnel"));
                 headList.add(MessageUtils.message("entry.personnel"));
                 projectCategoryNameS.forEach(pc->{
                 projectCategoryNameS.forEach(pc->{
-                    if(functionTimeList.size()>0){
+                    if ("hours".equals(exportContent) && functionTimeList.size()>0){
                         //headList.add(String.valueOf(pc)+"/工时");
                         //headList.add(String.valueOf(pc)+"/工时");
                         headList.add(String.valueOf(pc)+"/"+MessageUtils.message("entry.workHours"));
                         headList.add(String.valueOf(pc)+"/"+MessageUtils.message("entry.workHours"));
-                    }
-                    if(functionCostList.size()>0){
+                    }else if ("cost".equals(exportContent) && functionCostList.size()>0){
                         //headList.add(String.valueOf(pc)+"/成本");
                         //headList.add(String.valueOf(pc)+"/成本");
                         headList.add(String.valueOf(pc)+"/"+MessageUtils.message("entry.cost"));
                         headList.add(String.valueOf(pc)+"/"+MessageUtils.message("entry.cost"));
+                    }else {
+                        if(functionTimeList.size()>0 && functionCostList.size()>0){
+                            //headList.add(String.valueOf(pc)+"/工时");
+                            headList.add(String.valueOf(pc)+"/"+MessageUtils.message("entry.workHours"));
+                            //headList.add(String.valueOf(pc)+"/成本");
+                            headList.add(String.valueOf(pc)+"/"+MessageUtils.message("entry.cost"));
+                        }
                     }
                     }
+
                 });
                 });
-                if(functionTimeList.size()>0){
+                if ("hours".equals(exportContent) && functionTimeList.size()>0){
                     //headList.add("工时/合计");
                     //headList.add("工时/合计");
                     headList.add(MessageUtils.message("entry.workHours")+"/"+MessageUtils.message("entry.total"));
                     headList.add(MessageUtils.message("entry.workHours")+"/"+MessageUtils.message("entry.total"));
-                }
-                if(functionCostList.size()>0){
+                }else if ("cost".equals(exportContent) && functionCostList.size()>0){
                     //headList.add("成本/合计");
                     //headList.add("成本/合计");
                     headList.add(MessageUtils.message("entry.cost")+"/"+MessageUtils.message("entry.total"));
                     headList.add(MessageUtils.message("entry.cost")+"/"+MessageUtils.message("entry.total"));
+                }else {
+                    if(functionTimeList.size()>0 && functionCostList.size()>0){
+                        //headList.add("工时/合计");
+                        headList.add(MessageUtils.message("entry.workHours")+"/"+MessageUtils.message("entry.total"));
+                        //headList.add("成本/合计");
+                        headList.add(MessageUtils.message("entry.cost")+"/"+MessageUtils.message("entry.total"));
+                    }
                 }
                 }
+
                 allList=new ArrayList<>();
                 allList=new ArrayList<>();
                 allList.add(headList);
                 allList.add(headList);
                 //统计当前所有项目所有人的时间成本投入
                 //统计当前所有项目所有人的时间成本投入
@@ -5555,29 +5636,43 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     for(Object i:projectCategorys){
                     for(Object i:projectCategorys){
                         List<Map<String, Object>> resultList = mapList.stream().filter(mp -> mp.get("category").equals(i)).collect(Collectors.toList());
                         List<Map<String, Object>> resultList = mapList.stream().filter(mp -> mp.get("category").equals(i)).collect(Collectors.toList());
                         if(resultList.size()>0){
                         if(resultList.size()>0){
-                            if(functionTimeList.size()>0){
+                            if ("hours".equals(exportContent) && functionTimeList.size()>0){
                                 membRowData.add(String.valueOf(resultList.get(0).get("cost")));
                                 membRowData.add(String.valueOf(resultList.get(0).get("cost")));
-                            }
-                            if(functionCostList.size()>0){
+                            }else if ("cost".equals(exportContent) && functionCostList.size()>0){
                                 membRowData.add(String.valueOf(resultList.get(0).get("costMoney")));
                                 membRowData.add(String.valueOf(resultList.get(0).get("costMoney")));
+                            }else {
+                                if(functionTimeList.size()>0 && functionCostList.size()>0){
+                                    membRowData.add(String.valueOf(resultList.get(0).get("cost")));
+                                    membRowData.add(String.valueOf(resultList.get(0).get("costMoney")));
+                                }
                             }
                             }
+
                             costTime += (Double)resultList.get(0).get("cost");
                             costTime += (Double)resultList.get(0).get("cost");
                             moneyCost = moneyCost.add((BigDecimal)resultList.get(0).get("costMoney"));
                             moneyCost = moneyCost.add((BigDecimal)resultList.get(0).get("costMoney"));
                         }else{
                         }else{
-                            if(functionTimeList.size()>0){
+                            if ("hours".equals(exportContent) && functionTimeList.size()>0){
                                 membRowData.add("");
                                 membRowData.add("");
-                            }
-                            if(functionCostList.size()>0){
+                            }else if ("cost".equals(exportContent) && functionCostList.size()>0){
                                 membRowData.add("");
                                 membRowData.add("");
+                            }else {
+                                if(functionTimeList.size()>0 && functionCostList.size()>0){
+                                    membRowData.add("");
+                                    membRowData.add("");
+                                }
                             }
                             }
                         }
                         }
                     }
                     }
-                    if(functionTimeList.size()>0){
+                    if ("hours".equals(exportContent) && functionTimeList.size()>0){
                         membRowData.add(""+new BigDecimal(costTime).setScale(1, BigDecimal.ROUND_HALF_UP));
                         membRowData.add(""+new BigDecimal(costTime).setScale(1, BigDecimal.ROUND_HALF_UP));
-                    }
-                    if(functionCostList.size()>0){
+                    }else if ("cost".equals(exportContent) && functionCostList.size()>0){
                         membRowData.add(moneyCost.toString());
                         membRowData.add(moneyCost.toString());
+                    }else {
+                        if(functionTimeList.size()>0 && functionCostList.size()>0){
+                            membRowData.add(""+new BigDecimal(costTime).setScale(1, BigDecimal.ROUND_HALF_UP));
+                            membRowData.add(moneyCost.toString());
+                        }
                     }
                     }
+
                     if(mapList.size()>0){
                     if(mapList.size()>0){
                         allList.add(membRowData);
                         allList.add(membRowData);
                     }
                     }