|
@@ -7966,7 +7966,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public HttpRespMsg getTimeCostByGroupProject(String startDate, String endDate, Integer pageIndex, Integer pageSize, Integer groupId, Integer projectId, HttpServletRequest request) {
|
|
|
+ public HttpRespMsg getTimeCostByGroupProject(String startDate, String endDate, Integer pageIndex, Integer pageSize, Integer groupId, Integer projectId,Integer projectMainId, HttpServletRequest request) {
|
|
|
String token = request.getHeader("TOKEN");
|
|
|
User user = userMapper.selectById(token);
|
|
|
Integer companyId = user.getCompanyId();
|
|
@@ -7993,11 +7993,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
if(pageIndex!=null&&pageSize!=null){
|
|
|
Integer startIndex = (pageIndex-1)*pageSize;
|
|
|
Integer endIndex = pageSize*pageIndex;
|
|
|
- record = projectMapper.selectWithGroupProject(companyId,startDate,endDate, startIndex, endIndex, projectId,inchagerIds,groupId);
|
|
|
+ record = projectMapper.selectWithGroupProject(companyId,startDate,endDate, startIndex, endIndex, projectId,projectMainId,inchagerIds,groupId);
|
|
|
}else {
|
|
|
- record=projectMapper.selectWithGroupProject(companyId,startDate,endDate, null, null, projectId,inchagerIds,groupId);
|
|
|
+ record=projectMapper.selectWithGroupProject(companyId,startDate,endDate, null, null, projectId,projectMainId,inchagerIds,groupId);
|
|
|
}
|
|
|
- total =projectMapper.selectCountWithGroupProject(companyId,startDate,endDate, null, null, projectId,inchagerIds,groupId);
|
|
|
+ total =projectMapper.selectCountWithGroupProject(companyId,startDate,endDate, null, null, projectId,projectMainId,inchagerIds,groupId);
|
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
|
map.put("records", record);
|
|
|
map.put("total", total);
|
|
@@ -8006,10 +8006,10 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public HttpRespMsg exportGroupWithProjectTimeCost(String startDate, String endDate, Integer pageIndex, Integer pageSize, Integer groupId, Integer projectId, HttpServletRequest request) {
|
|
|
+ public HttpRespMsg exportGroupWithProjectTimeCost(String startDate, String endDate, Integer pageIndex, Integer pageSize, Integer groupId, Integer projectId,Integer projectMainId, HttpServletRequest request) {
|
|
|
HttpRespMsg httpRespMsg=new HttpRespMsg();
|
|
|
HttpRespMsg timeCostByGroup = getTimeCostByGroup(startDate, endDate, null, null, groupId, projectId, request);
|
|
|
- HttpRespMsg timeCostByGroupProject = getTimeCostByGroupProject(startDate, endDate, null, null, groupId, projectId, request);
|
|
|
+ HttpRespMsg timeCostByGroupProject = getTimeCostByGroupProject(startDate, endDate, null, null, groupId, projectId,projectMainId, request);
|
|
|
HashMap<String,Object> timeCostByGroupData = (HashMap<String, Object>) timeCostByGroup.data;
|
|
|
HashMap<String,Object> timeCostByGroupProjectData = (HashMap<String, Object>) timeCostByGroupProject.data;
|
|
|
List<Map<String,Object>> timeCostByGroupList= (List<Map<String, Object>>) timeCostByGroupData.get("records");
|
|
@@ -8618,6 +8618,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
sb.append("项目同步操作,新增的项目编号:[");
|
|
|
if(projectList!=null &&projectList.size()>0){
|
|
|
for (Project project : projectList) {
|
|
|
+ if(project.getProjectCode()==null){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
if(timeType.getMainProjectState()==1){
|
|
|
Optional<ProjectMain> mainOptional = projectMainList.stream().filter(pm ->pm.getName()!=null&& pm.getName().equals(project.getProjectMainName())).findFirst();
|
|
|
if(!mainOptional.isPresent()){
|
|
@@ -8641,6 +8644,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
}
|
|
|
for (Project project : projectList) {
|
|
|
+ if(project.getProjectCode()==null){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
Optional<Project> first = allProject.stream().filter(ap ->ap.getProjectCode()!=null&& ap.getProjectCode().equals(project.getProjectCode())).findFirst();
|
|
|
if(first.isPresent()){
|
|
|
message+="已存在项目["+first.get().getProjectName()+"]";
|
|
@@ -8730,6 +8736,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
sb.append("项目同步操作,更新的项目编号:[");
|
|
|
if(projectList!=null &&projectList.size()>0){
|
|
|
for (Project project : projectList) {
|
|
|
+ if(project.getProjectCode()==null){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
Optional<Project> first = allProject.stream().filter(ap ->ap.getProjectCode()!=null&& ap.getProjectCode().equals(project.getProjectCode())).findFirst();
|
|
|
Optional<User> user = userList.stream().filter(ul ->ul.getJobNumber()!=null&&ul.getJobNumber().equals(project.getInchargerId())).findFirst();
|
|
|
if(user.isPresent()){
|
|
@@ -8750,6 +8759,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
List<Integer> idList = changeProjectList.stream().map(Project::getId).collect(Collectors.toList());
|
|
|
idList.add(-1);
|
|
|
List<TaskGroup> groupList = taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().in("project_id", idList));
|
|
|
+ List<Participation> allParticipationList = participationMapper.selectList(new QueryWrapper<Participation>().in("project_id", idList));
|
|
|
List<Participation> participationList=new ArrayList<>();
|
|
|
for (Project project : changeProjectList) {
|
|
|
List<TaskGroup> taskGroupList = project.getTaskGroupList();
|
|
@@ -8773,10 +8783,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
//项目负责人要加到参与人中
|
|
|
Participation participation=new Participation();
|
|
|
if(project.getInchargerId()!=null&&project.getInchargerId().length()==19){
|
|
|
- participationMapper.delete(new QueryWrapper<Participation>().eq("project_id",project.getId()).eq("user_id",project.getId()));
|
|
|
- participation.setUserId(project.getInchargerId());
|
|
|
- participation.setProjectId(project.getId());
|
|
|
- participationMapper.insert(participation);
|
|
|
+ boolean b = allParticipationList.stream().anyMatch(al -> al.getProjectId().equals(project.getId()) && al.getUserId().equals(project.getInchargerId()));
|
|
|
+ if(!b){
|
|
|
+ participation.setUserId(project.getInchargerId());
|
|
|
+ participation.setProjectId(project.getId());
|
|
|
+ participationMapper.insert(participation);
|
|
|
+ }
|
|
|
}
|
|
|
//项目参与人处理 只增不减
|
|
|
List<Map<String, Object>> participations = project.getParticipations();
|
|
@@ -8786,6 +8798,10 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
if(map.get("participationId")!=null){
|
|
|
Optional<User> first = userList.stream().filter(ul -> ul.getJobNumber() != null && ul.getJobNumber().equals(String.valueOf(map.get("participationId")))).findFirst();
|
|
|
if(first.isPresent()){
|
|
|
+ boolean b = allParticipationList.stream().anyMatch(al -> al.getUserId().equals(first.get().getId()) && al.getProjectId().equals(project.getId()));
|
|
|
+ if(b){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
p.setProjectId(project.getId());
|
|
|
p.setUserId(first.get().getId());
|
|
|
participationList.add(p);
|
|
@@ -8801,6 +8817,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}else if(changeType.equals("delete_project")){
|
|
|
sb.append("项目同步操作,删除的项目名称:[");
|
|
|
for (Project project : projectList) {
|
|
|
+ if(project.getProjectCode()==null){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
Optional<Project> first = allProject.stream().filter(ap ->ap.getProjectCode()!=null&& ap.getProjectCode().equals(project.getProjectCode())).findFirst();
|
|
|
if(first.isPresent()){
|
|
|
project.setId(first.get().getId());
|