|
@@ -1307,6 +1307,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
List<SysRichFunction> functionDpartList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "查看负责部门");
|
|
List<SysRichFunction> functionDpartList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "查看负责部门");
|
|
List<SysRichFunction> functionTimeList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "查看工时统计");
|
|
List<SysRichFunction> functionTimeList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "查看工时统计");
|
|
List<SysRichFunction> functionCostList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "查看成本统计");
|
|
List<SysRichFunction> functionCostList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "查看成本统计");
|
|
|
|
+ List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
|
|
List<Integer> deptRelatedProjectIds = new ArrayList<>();
|
|
List<Integer> deptRelatedProjectIds = new ArrayList<>();
|
|
List<Integer> manProjectIds = null;
|
|
List<Integer> manProjectIds = null;
|
|
//判断查看权限
|
|
//判断查看权限
|
|
@@ -1367,6 +1368,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
|
|
BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
|
|
List<List<String>> allList=null ;
|
|
List<List<String>> allList=null ;
|
|
List<String> sumRow = null;
|
|
List<String> sumRow = null;
|
|
|
|
+ List<UserCustom> userCustoms = userCustomMapper.selectList(new QueryWrapper<UserCustom>().eq("company_id", companyId));
|
|
if(type==0){
|
|
if(type==0){
|
|
List<String> headList = new ArrayList<String>();
|
|
List<String> headList = new ArrayList<String>();
|
|
//headList.add("项目编号");
|
|
//headList.add("项目编号");
|
|
@@ -1379,6 +1381,9 @@ 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"));
|
|
|
|
+ for (UserCustom userCustom : userCustoms) {
|
|
|
|
+ headList.add(userCustom.getName());
|
|
|
|
+ }
|
|
//hours:仅导出工时;cost:导出成本;hoursAndCost:导出成本和工时;
|
|
//hours:仅导出工时;cost:导出成本;hoursAndCost:导出成本和工时;
|
|
if ("hours".equals(exportContent) && functionTimeList.size()>0){
|
|
if ("hours".equals(exportContent) && functionTimeList.size()>0){
|
|
//headList.add("工时(h)");
|
|
//headList.add("工时(h)");
|
|
@@ -1416,7 +1421,10 @@ 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("");
|
|
-
|
|
|
|
|
|
+ //针对项目合计行,自定义的字段要空出来
|
|
|
|
+ for (UserCustom userCustom : userCustoms) {
|
|
|
|
+ headList.add("");
|
|
|
|
+ }
|
|
if ("hours".equals(exportContent) && functionTimeList.size()>0){
|
|
if ("hours".equals(exportContent) && functionTimeList.size()>0){
|
|
rowData.add(((Double)map.get("cost")).toString());
|
|
rowData.add(((Double)map.get("cost")).toString());
|
|
}else if ("cost".equals(exportContent) && functionCostList.size()>0){
|
|
}else if ("cost".equals(exportContent) && functionCostList.size()>0){
|
|
@@ -1451,10 +1459,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
membRowData.add((String)map.get("projectCode"));
|
|
membRowData.add((String)map.get("projectCode"));
|
|
membRowData.add((String)map.get("project"));
|
|
membRowData.add((String)map.get("project"));
|
|
membRowData.add((String)map.get("categoryName"));
|
|
membRowData.add((String)map.get("categoryName"));
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
membRowData.add("");
|
|
membRowData.add("");
|
|
membRowData.add("");
|
|
membRowData.add("");
|
|
membRowData.add("");
|
|
membRowData.add("");
|
|
|
|
+
|
|
}
|
|
}
|
|
if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
membRowData.add((String)("$userName="+membMap.get("corpwxUserId")+"$"));
|
|
membRowData.add((String)("$userName="+membMap.get("corpwxUserId")+"$"));
|
|
@@ -1467,7 +1477,27 @@ 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"));
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ String creatorId = (String)membMap.get("creatorId");
|
|
|
|
+ User us = userList.stream().filter(u->u.getId().equals(creatorId)).findFirst().get();
|
|
|
|
+ for (int i = 0; i < userCustoms.size(); i++) {
|
|
|
|
+ switch (i){
|
|
|
|
+ case 0:
|
|
|
|
+ membRowData.add(us.getPlate1()==null?"":us.getPlate1());
|
|
|
|
+ break;
|
|
|
|
+ case 1:
|
|
|
|
+ membRowData.add(us.getPlate2()==null?"":us.getPlate2());
|
|
|
|
+ break;
|
|
|
|
+ case 2:
|
|
|
|
+ membRowData.add(us.getPlate3()==null?"":us.getPlate3());
|
|
|
|
+ break;
|
|
|
|
+ case 3:
|
|
|
|
+ membRowData.add(us.getPlate4()==null?"":us.getPlate4());
|
|
|
|
+ break;
|
|
|
|
+ case 4:
|
|
|
|
+ membRowData.add(us.getPlate5()==null?"":us.getPlate5());
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
if ("hours".equals(exportContent) && functionTimeList.size()>0){
|
|
if ("hours".equals(exportContent) && functionTimeList.size()>0){
|
|
membRowData.add(((Double)membMap.get("cost")).toString());
|
|
membRowData.add(((Double)membMap.get("cost")).toString());
|
|
}else if ("cost".equals(exportContent) && functionCostList.size()>0){
|
|
}else if ("cost".equals(exportContent) && functionCostList.size()>0){
|
|
@@ -1492,6 +1522,10 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
sumRow.add("");
|
|
sumRow.add("");
|
|
sumRow.add("");
|
|
sumRow.add("");
|
|
sumRow.add("");
|
|
sumRow.add("");
|
|
|
|
+ sumRow.add("");
|
|
|
|
+ for (UserCustom userCustom : userCustoms) {
|
|
|
|
+ headList.add("");
|
|
|
|
+ }
|
|
if ("hours".equals(exportContent) && 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));
|
|
}else if ("cost".equals(exportContent) && functionCostList.size()>0){
|
|
}else if ("cost".equals(exportContent) && functionCostList.size()>0){
|
|
@@ -1507,7 +1541,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
|
|
|
allList.add(sumRow);
|
|
allList.add(sumRow);
|
|
}else{
|
|
}else{
|
|
- List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
|
|
|
|
List<Object> projectNames = list.stream().map(mp -> mp.get("project")).collect(Collectors.toList());
|
|
List<Object> projectNames = list.stream().map(mp -> mp.get("project")).collect(Collectors.toList());
|
|
List<Object> projectCodes = list.stream().map(mp -> mp.get("projectCode")).collect(Collectors.toList());
|
|
List<Object> projectCodes = list.stream().map(mp -> mp.get("projectCode")).collect(Collectors.toList());
|
|
List<Object> projectIds = list.stream().map(mp -> mp.get("id")).collect(Collectors.toList());
|
|
List<Object> projectIds = list.stream().map(mp -> mp.get("id")).collect(Collectors.toList());
|