|
@@ -4296,7 +4296,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public HttpRespMsg importData(String userId, MultipartFile multipartFile,Integer key, HttpServletRequest request) {
|
|
|
+ public HttpRespMsg importData(String userId, MultipartFile multipartFile,Integer key,@RequestParam(defaultValue = "0") Integer changeParticipation, HttpServletRequest request) {
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
User user = userMapper.selectById(userId);
|
|
|
TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
|
|
@@ -4610,9 +4610,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
project.setId(updateProject.getId());
|
|
|
projectMapper.updateById(project);
|
|
|
}else {
|
|
|
- if(projectMapper.insert(project)>0){
|
|
|
-
|
|
|
- }
|
|
|
+ projectMapper.insert(project);
|
|
|
}
|
|
|
importCount++;
|
|
|
//处理子项目
|
|
@@ -4790,6 +4788,10 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
//批量保存
|
|
|
List<Participation> finalOldPartList = oldPartList;
|
|
|
List<Participation> addPartList = participationList.stream().filter(newP-> !finalOldPartList.stream().anyMatch(oldP->oldP.getUserId().equals(newP.getUserId()))).collect(Collectors.toList());
|
|
|
+ if(changeParticipation==1){
|
|
|
+ participationService.remove(new LambdaQueryWrapper<Participation>().eq(project.getId()!=null,Participation::getProjectId,project.getId()));
|
|
|
+ addPartList = participationList;
|
|
|
+ }
|
|
|
if (addPartList.size() > 0) {
|
|
|
participationService.saveBatch(addPartList);
|
|
|
}
|
|
@@ -6024,6 +6026,10 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
//批量保存
|
|
|
List<Participation> finalOldPartList = oldPartList;
|
|
|
List<Participation> addPartList = participationList.stream().filter(newP-> !finalOldPartList.stream().anyMatch(oldP->oldP.getUserId().equals(newP.getUserId()))).collect(Collectors.toList());
|
|
|
+ if(changeParticipation==1){
|
|
|
+ participationService.remove(new LambdaQueryWrapper<Participation>().eq(project.getId()!=null,Participation::getProjectId,project.getId()));
|
|
|
+ addPartList = participationList;
|
|
|
+ }
|
|
|
if (addPartList.size() > 0) {
|
|
|
participationService.saveBatch(addPartList);
|
|
|
}
|
|
@@ -12984,6 +12990,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
map.put("userProgress",targetLsit);
|
|
|
}
|
|
|
+ //处理项目下的负责组长
|
|
|
+ List<Integer> needProjectIds = resultList.stream().map(m -> Integer.valueOf(String.valueOf(m.get("projectId")))).collect(Collectors.toList());
|
|
|
+ List<Participation> participationList = participationMapper.selectList(new LambdaQueryWrapper<Participation>().in(Participation::getProjectId, needProjectIds));
|
|
|
+ List<String> needUserIds = participationList.stream().map(m -> String.valueOf(m.getUserId())).collect(Collectors.toList());
|
|
|
+ List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>().in(User::getId, needUserIds));
|
|
|
+ resultList.forEach(r->{
|
|
|
+ List<Participation> targetParticipationList = participationList.stream().filter(p -> p.getProjectId().equals(Integer.valueOf(String.valueOf(r.get("projectId"))))).collect(Collectors.toList());
|
|
|
+ List<String> targetUserIds = targetParticipationList.stream().map(m -> String.valueOf(m.getUserId())).collect(Collectors.toList());
|
|
|
+ String targetUserString = userList.stream().filter(u -> targetUserIds.contains(u.getId()) && u.getRoleId().equals(30770)).map(User::getName).collect(Collectors.joining(","));
|
|
|
+ r.put("teamLeader",targetUserString);
|
|
|
+ });
|
|
|
Map<String,Object> resultMap=new HashMap<>();
|
|
|
resultMap.put("record",resultList);
|
|
|
resultMap.put("total",total);
|
|
@@ -13006,10 +13023,13 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
titleList.add("项目名称");
|
|
|
titleList.add("项目分类");
|
|
|
titleList.add("项目编号");
|
|
|
+ titleList.add("开始时间");
|
|
|
+ titleList.add("截止时间");
|
|
|
titleList.add("分配工时");
|
|
|
titleList.add("已消耗工时");
|
|
|
titleList.add("已消耗工时成本");
|
|
|
titleList.add("剩余工时");
|
|
|
+ titleList.add("负责组长");
|
|
|
titleList.add("参与员工");
|
|
|
dataList.add(titleList);
|
|
|
for (Map<String, Object> map : mapList) {
|
|
@@ -13017,10 +13037,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
item.add(String.valueOf(map.get("projectName")));
|
|
|
item.add(String.valueOf(map.get("categoryName")));
|
|
|
item.add(String.valueOf(map.get("projectCode")));
|
|
|
+ item.add(String.valueOf(map.get("planStartDate")));
|
|
|
+ item.add(String.valueOf(map.get("planEndDate")));
|
|
|
item.add(String.valueOf(map.get("planHour")));
|
|
|
item.add(String.valueOf(map.get("realHour")));
|
|
|
item.add(String.valueOf(map.get("realCost")));
|
|
|
item.add(String.valueOf(map.get("residueHour")));
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
+ item.add("$userName="+String.valueOf(map.get("teamLeader"))+"$");
|
|
|
+ }else {
|
|
|
+ item.add(String.valueOf(map.get("teamLeader")));
|
|
|
+ }
|
|
|
List<Map<String, Object>> userProgress = (List<Map<String, Object>>) map.get("userProgress");
|
|
|
StringBuilder sb=new StringBuilder();
|
|
|
for (int i = 0; i < userProgress.size(); i++) {
|
|
@@ -13056,8 +13083,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
|
User user = userMapper.selectById(request.getHeader("token"));
|
|
|
Integer companyId = user.getCompanyId();
|
|
|
- boolean viewAll = sysFunctionService.hasPriviledge(user.getRoleId(), "全部员工项目进度表");
|
|
|
- boolean incharger = sysFunctionService.hasPriviledge(user.getRoleId(), "负责部门员工项目进度表");
|
|
|
+ boolean viewAll = sysFunctionService.hasPriviledge(user.getRoleId(), "全部员工任务进度表");
|
|
|
+ boolean incharger = sysFunctionService.hasPriviledge(user.getRoleId(), "负责部门员工任务进度表");
|
|
|
List<Department> allDeptList = departmentMapper.selectList(new LambdaQueryWrapper<Department>().eq(Department::getCompanyId, companyId));
|
|
|
List<Map<String,Object>> resultList;
|
|
|
Long total;
|
|
@@ -13195,12 +13222,15 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
row_first.add("");
|
|
|
row_first.add("");
|
|
|
row_first.add("");
|
|
|
+ row_first.add("");
|
|
|
+ row_first.add("");
|
|
|
+ row_first.add("");
|
|
|
for (int i = 0; i < row_first.size(); i++) {
|
|
|
SXSSFCell tempCell = row0.createCell(i);
|
|
|
tempCell.setCellValue(row_first.get(i));
|
|
|
tempCell.setCellStyle(headStyle);
|
|
|
}
|
|
|
- sheet.addMergedRegion(new CellRangeAddress(0,0,2,6));
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(0,0,2,9));
|
|
|
sheet.addMergedRegion(new CellRangeAddress(0,1,0,0));
|
|
|
sheet.addMergedRegion(new CellRangeAddress(0,1,1,1));
|
|
|
//第二行
|
|
@@ -13214,6 +13244,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
row_second.add("项目任务");
|
|
|
row_second.add("计划工时");
|
|
|
row_second.add("消耗工时");
|
|
|
+ row_second.add("剩余工时");
|
|
|
+ row_second.add("项目开始时间");
|
|
|
+ row_second.add("项目截止时间");
|
|
|
for (int i = 0; i < row_second.size(); i++) {
|
|
|
SXSSFCell tempCell = row1.createCell(i);
|
|
|
tempCell.setCellValue(row_second.get(i));
|
|
@@ -13249,13 +13282,16 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
list.add(String.valueOf(maps.get(i).get("taskName")));
|
|
|
list.add(String.valueOf(maps.get(i).get("planHour")));
|
|
|
list.add(String.valueOf(maps.get(i).get("consumeTime")));
|
|
|
+ list.add(String.valueOf(maps.get(i).get("residue")));
|
|
|
+ list.add(String.valueOf(maps.get(i).get("planStartDate")));
|
|
|
+ list.add(String.valueOf(maps.get(i).get("planEndDate")));
|
|
|
}
|
|
|
}
|
|
|
int k=0;
|
|
|
for(int i = 0;i<mapList.size();i++){
|
|
|
SXSSFRow tempRow = sheet.createRow(rowNum++);
|
|
|
tempRow.setHeight((short)500);
|
|
|
- for(int j=0;j<7;j++){
|
|
|
+ for(int j=0;j<10;j++){
|
|
|
SXSSFCell tempCell = tempRow.createCell(j);
|
|
|
String cellValue = "";
|
|
|
tempCell.setCellStyle(cellStyle);
|