|
@@ -4,11 +4,9 @@ package com.management.platform.controller;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.management.platform.entity.Project;
|
|
|
import com.management.platform.entity.ProjectRequirement;
|
|
|
+import com.management.platform.entity.Task;
|
|
|
import com.management.platform.entity.TaskGroup;
|
|
|
-import com.management.platform.mapper.ProjectMapper;
|
|
|
-import com.management.platform.mapper.ProjectRequirementMapper;
|
|
|
-import com.management.platform.mapper.TaskGroupMapper;
|
|
|
-import com.management.platform.mapper.UserMapper;
|
|
|
+import com.management.platform.mapper.*;
|
|
|
import com.management.platform.service.ProjectRequirementService;
|
|
|
import com.management.platform.util.ExcelUtil;
|
|
|
import com.management.platform.util.HttpRespMsg;
|
|
@@ -59,6 +57,8 @@ public class ProjectRequirementController {
|
|
|
private ProjectRequirementService projectRequirementService;
|
|
|
@Resource
|
|
|
private TaskGroupMapper taskGroupMapper;
|
|
|
+ @Resource
|
|
|
+ private TaskMapper taskMapper;
|
|
|
|
|
|
@RequestMapping("/addOrMod")
|
|
|
public HttpRespMsg addOrMod(ProjectRequirement record) {
|
|
@@ -89,6 +89,15 @@ public class ProjectRequirementController {
|
|
|
projectIds = taskGroups.stream().map(TaskGroup::getProjectId).collect(Collectors.toList());
|
|
|
}
|
|
|
List<ProjectRequirement> projectRequirements = projectRequirementMapper.customSelect(companyId, startDate, projectId, projectIds.size()==0?null:projectIds, startIndex, pageSize,reStartDate,reEndDate);
|
|
|
+ List<Integer> collect = projectRequirements.stream().map(pr -> pr.getProjectId()).collect(Collectors.toList());
|
|
|
+ List<Task> milepostList=taskMapper.selectMilepost(collect);
|
|
|
+ projectRequirements.forEach(pr->{
|
|
|
+ milepostList.forEach(mp->{
|
|
|
+ if(pr.getProjectId().equals(mp.getProjectId())){
|
|
|
+ pr.setMilepost(mp);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
long total=projectRequirementMapper.selectCountByDate(companyId, startDate, projectId, projectIds.size()==0?null:projectIds, startIndex, pageSize,reStartDate,reEndDate);
|
|
|
HashMap map = new HashMap();
|
|
|
map.put("total", total);
|
|
@@ -106,8 +115,17 @@ public class ProjectRequirementController {
|
|
|
now = now.minusDays(7);
|
|
|
String startDate = DateTimeFormatter.ofPattern("yyyy-MM-dd").format(now);
|
|
|
List<ProjectRequirement> projectRequirementList = projectRequirementMapper.customSelect(companyId,startDate, null, null, null, null,null,null);
|
|
|
+ List<Integer> collect = projectRequirementList.stream().map(pr -> pr.getProjectId()).collect(Collectors.toList());
|
|
|
+ List<Task> milepostList=taskMapper.selectMilepost(collect);
|
|
|
+ projectRequirementList.forEach(pr->{
|
|
|
+ milepostList.forEach(mp->{
|
|
|
+ if(pr.getProjectId().equals(mp.getProjectId())){
|
|
|
+ pr.setMilepost(mp);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
List<List<String>> dataList=new ArrayList<>();
|
|
|
- String[] titleString={"项目编号","项目名称","近七日活跃人员","人员需求","任务需求","开始时间","结束时间"};
|
|
|
+ String[] titleString={"项目编号","项目名称","近七日活跃人员","人员需求","任务需求","合同要求","参与部门进度","里程碑进度","开始时间","结束时间"};
|
|
|
List<String> nameList = Arrays.asList(titleString);
|
|
|
dataList.add(nameList);
|
|
|
projectRequirementList.forEach(pr->{
|
|
@@ -117,13 +135,24 @@ public class ProjectRequirementController {
|
|
|
resultData.add(pr.getActiveUsers());
|
|
|
resultData.add(pr.getMembReq());
|
|
|
resultData.add(pr.getTaskReq());
|
|
|
+ resultData.add(pr.getContractReq());
|
|
|
+ resultData.add(pr.getDepartmentSpeed());
|
|
|
+ if(pr.getMilepost()!=null){
|
|
|
+ resultData.add(pr.getMilepost().getName()+"-完成时间:"+pr.getMilepost().getFinishDate());
|
|
|
+ }else{
|
|
|
+ resultData.add("");
|
|
|
+ }
|
|
|
if(pr.getStartDate()!=null){
|
|
|
String s=df.format(pr.getStartDate());
|
|
|
resultData.add(s);
|
|
|
+ }else {
|
|
|
+ resultData.add("");
|
|
|
}
|
|
|
if(pr.getEndDate()!=null){
|
|
|
String s1=df.format(pr.getEndDate());
|
|
|
resultData.add(s1);
|
|
|
+ }else {
|
|
|
+ resultData.add("");
|
|
|
}
|
|
|
dataList.add(resultData);
|
|
|
});
|
|
@@ -176,12 +205,16 @@ public class ProjectRequirementController {
|
|
|
XSSFCell codeCell = row.getCell(0);
|
|
|
XSSFCell taskReqCell = row.getCell(1);
|
|
|
XSSFCell membReqCell = row.getCell(2);
|
|
|
- XSSFCell startDateCell = row.getCell(3);
|
|
|
- XSSFCell endDateCell = row.getCell(4);
|
|
|
+ XSSFCell contractReqCell = row.getCell(3);
|
|
|
+ XSSFCell departmentSpeedCell = row.getCell(4);
|
|
|
+ XSSFCell startDateCell = row.getCell(5);
|
|
|
+ XSSFCell endDateCell = row.getCell(6);
|
|
|
|
|
|
if (codeCell != null)codeCell.setCellType(CellType.STRING);
|
|
|
if (taskReqCell != null)taskReqCell.setCellType(CellType.STRING);
|
|
|
if (membReqCell != null)membReqCell.setCellType(CellType.STRING);
|
|
|
+ if (contractReqCell != null)contractReqCell.setCellType(CellType.STRING);
|
|
|
+ if (departmentSpeedCell != null)departmentSpeedCell.setCellType(CellType.STRING);
|
|
|
if (startDateCell != null)startDateCell.setCellType(CellType.NUMERIC);
|
|
|
if (endDateCell != null)endDateCell.setCellType(CellType.NUMERIC);
|
|
|
ProjectRequirement projectRequirement=new ProjectRequirement();
|
|
@@ -198,8 +231,10 @@ public class ProjectRequirementController {
|
|
|
}else{
|
|
|
list.forEach(li->{
|
|
|
projectRequirement.setProjectId(li.getId());
|
|
|
- projectRequirement.setTaskReq(StringUtils.isEmpty(taskReqCell.getStringCellValue())?"":taskReqCell.getStringCellValue());
|
|
|
- projectRequirement.setMembReq(StringUtils.isEmpty(membReqCell.getStringCellValue())?"":membReqCell.getStringCellValue());
|
|
|
+ projectRequirement.setTaskReq(StringUtils.isEmpty(taskReqCell)?"":taskReqCell.getStringCellValue());
|
|
|
+ projectRequirement.setMembReq(StringUtils.isEmpty(membReqCell)?"":membReqCell.getStringCellValue());
|
|
|
+ projectRequirement.setContractReq(StringUtils.isEmpty(contractReqCell)?"":contractReqCell.getStringCellValue());
|
|
|
+ projectRequirement.setDepartmentSpeed(StringUtils.isEmpty(departmentSpeedCell)?"":departmentSpeedCell.getStringCellValue());
|
|
|
if(startDateCell!=null){
|
|
|
projectRequirement.setStartDate(startDateCell.getDateCellValue());
|
|
|
}else {
|