|
@@ -10048,7 +10048,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public HttpRespMsg projectGroupAndCategoryWorkTime(HttpServletRequest request, String startDate, String endDate, Integer projectId,Integer pageIndex,Integer pageSize) {
|
|
|
+ public HttpRespMsg projectGroupAndCategoryWorkTime(HttpServletRequest request, String startDate, String endDate, Integer projectId,String groupNames, Integer pageIndex,Integer pageSize) {
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
Integer start = (pageIndex-1)*pageSize;
|
|
|
Integer size = pageSize*pageIndex;
|
|
@@ -10070,8 +10070,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
inchagerIds.add(-1);
|
|
|
}
|
|
|
}
|
|
|
- List<Map<String,Object>> projectGroupAndCategoryList=projectMapper.getProjectGroupAndCategoryList(startDate,endDate,projectId,user.getCompanyId(),start,size,inchagerIds);
|
|
|
- long total=projectMapper.getProjectGroupAndCategoryCount(startDate,endDate,projectId,user.getCompanyId(),null,null,inchagerIds);
|
|
|
+ List<String> gpNamesList = null;
|
|
|
+ if (!StringUtils.isEmpty(groupNames)) {
|
|
|
+ gpNamesList = Arrays.stream(groupNames.split(",")).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ List<Map<String,Object>> projectGroupAndCategoryList = projectMapper.getProjectGroupAndCategoryList(startDate,endDate,projectId,user.getCompanyId(),start,size,inchagerIds, gpNamesList);
|
|
|
+ long total=projectMapper.getProjectGroupAndCategoryCount(startDate,endDate,projectId,user.getCompanyId(),null,null,inchagerIds, gpNamesList);
|
|
|
List<Integer> projectIds = projectGroupAndCategoryList.stream().map(pl ->Integer.valueOf(String.valueOf(pl.get("projectId")))).distinct().collect(Collectors.toList());
|
|
|
if(projectIds.size()==0){
|
|
|
projectIds.add(-1);
|
|
@@ -10081,7 +10085,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
List<String> stagesNameList = stagesList.stream().map(sl -> sl.getStagesName()).distinct().collect(Collectors.toList());
|
|
|
stagesNameList.add("非阶段");
|
|
|
titleList.addAll(stagesNameList);
|
|
|
- List<Map<String,Object>> projectGroupAndCategoryData=projectMapper.getProjectGroupAndCategoryData(startDate,endDate,projectId,user.getCompanyId(),start,size,projectIds);
|
|
|
+ List<Map<String,Object>> projectGroupAndCategoryData=projectMapper.getProjectGroupAndCategoryData(startDate,endDate,projectId,user.getCompanyId(),start,size,projectIds, gpNamesList);
|
|
|
for (Map<String, Object> item : projectGroupAndCategoryList) {
|
|
|
List<Map<String, Object>> list = projectGroupAndCategoryData.stream().filter(pl -> pl.get("groupId").equals(item.get("groupId")) && pl.get("projectId").equals(item.get("projectId"))).collect(Collectors.toList());
|
|
|
item.put("categoryList",list);
|
|
@@ -10095,12 +10099,16 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public HttpRespMsg exportProjectGroupAndCategoryWorkTime(HttpServletRequest request, String startDate, String endDate, Integer projectId) {
|
|
|
+ public HttpRespMsg exportProjectGroupAndCategoryWorkTime(HttpServletRequest request, String startDate, String endDate, Integer projectId, String groupNames) {
|
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
|
User user = userMapper.selectById(request.getHeader("token"));
|
|
|
List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", user.getCompanyId()));
|
|
|
- List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "全部任务阶段工时");
|
|
|
- List<SysRichFunction> functionInchargeList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "负责项目任务阶段工时");
|
|
|
+ List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "全部分组阶段工时");
|
|
|
+ List<SysRichFunction> functionInchargeList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "负责项目分组阶段工时");
|
|
|
+ List<String> gpNamesList = null;
|
|
|
+ if (!StringUtils.isEmpty(groupNames)) {
|
|
|
+ gpNamesList = Arrays.stream(groupNames.split(",")).collect(Collectors.toList());
|
|
|
+ }
|
|
|
//判断查看权限
|
|
|
List<Integer> inchagerIds=null;
|
|
|
if(functionAllList.size()==0){
|
|
@@ -10115,7 +10123,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
inchagerIds.add(-1);
|
|
|
}
|
|
|
}
|
|
|
- List<Map<String,Object>> projectGroupAndCategoryList=projectMapper.getProjectGroupAndCategoryList(startDate,endDate,projectId,user.getCompanyId(),null,null,inchagerIds);
|
|
|
+ List<Map<String,Object>> projectGroupAndCategoryList=projectMapper.getProjectGroupAndCategoryList(startDate,endDate,projectId,user.getCompanyId(),null,null,inchagerIds, gpNamesList);
|
|
|
List<Integer> projectIds = projectGroupAndCategoryList.stream().map(pl ->Integer.valueOf(String.valueOf(pl.get("projectId")))).distinct().collect(Collectors.toList());
|
|
|
if(projectIds.size()==0){
|
|
|
projectIds.add(-1);
|
|
@@ -10131,7 +10139,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
titleList.addAll(stagesNameList);
|
|
|
List<List<String>> dataList=new ArrayList<>();
|
|
|
dataList.add(titleList);
|
|
|
- List<Map<String,Object>> projectGroupAndCategoryData=projectMapper.getProjectGroupAndCategoryData(startDate,endDate,projectId,user.getCompanyId(),null,null,projectIds);
|
|
|
+ List<Map<String,Object>> projectGroupAndCategoryData=projectMapper.getProjectGroupAndCategoryData(startDate,endDate,projectId,user.getCompanyId(),null,null,projectIds, gpNamesList);
|
|
|
for (Map<String, Object> item : projectGroupAndCategoryList) {
|
|
|
List<String> stringList=new ArrayList<>();
|
|
|
List<Map<String, Object>> list = projectGroupAndCategoryData.stream().filter(pl -> pl.get("groupId").equals(item.get("groupId")) && pl.get("projectId").equals(item.get("projectId"))).collect(Collectors.toList());
|