Explorar o código

Merge branch 'master' of http://47.100.37.243:10080/wutt/manHourHousekeeper

Lijy %!s(int64=2) %!d(string=hai) anos
pai
achega
46bb9d451e

+ 31 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -4943,6 +4943,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
 
     @Override
     public HttpRespMsg batchAddMembToGroup(String membIdArray, String groupIds) {
+        User user = userMapper.selectById(request.getHeader("token"));
         List<String> membArray = JSONArray.parseArray(membIdArray, String.class);
         List<Integer> groupArray = JSONArray.parseArray(groupIds, Integer.class);
         List<GroupParticipator> gpList = groupParticipatorMapper.selectList(new QueryWrapper<GroupParticipator>().in("group_id", groupArray));
@@ -4965,6 +4966,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             List<Integer> collect = addToGpList.stream().map(GroupParticipator::getGroupId).collect(Collectors.toList());
             List<TaskGroup> taskGroups = taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().in("id", collect));
             List<Integer> projectIds = taskGroups.stream().map(TaskGroup::getProjectId).collect(Collectors.toList());
+            List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().in("id", projectIds));
             List<Participation> participationList = participationMapper.selectList(new QueryWrapper<Participation>().in("project_id", projectIds));
             List<Participation> addPartiToProject = new ArrayList<>();
             for (Integer proId : projectIds) {
@@ -4976,6 +4978,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                         addPartiToProject.add(p);
                     }
                 }
+                Optional<Project> first = projectList.stream().filter(pl -> pl.getId().equals(proId)).findFirst();
+                if(first.isPresent()){
+                    OperationRecord operationRecord=new OperationRecord();
+                    operationRecord.setModuleName("项目管理")
+                            .setContent("批量添加分组参与人")
+                            .setCompanyId(first.get().getCompanyId())
+                            .setOperationTime(LocalDateTime.now())
+                            .setProjectName(first.get().getProjectName())
+                            .setOperatorName(user.getName());
+                    operationRecordService.save(operationRecord);
+                }
             }
             if (addPartiToProject.size() > 0) {
                 participationService.saveBatch(addPartiToProject);
@@ -5725,10 +5738,10 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
     @Override
     public HttpRespMsg batchSetParticipation(HttpServletRequest request,String  projectIdArray,String userIds) {
         HttpRespMsg msg=new HttpRespMsg();
-        Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
+        User user = userMapper.selectById(request.getHeader("token"));
         List<Integer> array = JSONArray.parseArray(projectIdArray, Integer.class);
         List<String> userIdList = JSONArray.parseArray(userIds, String.class);
-        List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", companyId).in("id",array));
+        List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", user.getCompanyId()).in("id",array));
         List<Participation> list=new ArrayList<>();
         for (Project project : projectList) {
             List<Participation> participationList = participationMapper.selectList(new QueryWrapper<Participation>().eq("project_id", project.getId()));
@@ -5742,6 +5755,14 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 participation.setUserId(s);
                 list.add(participation);
             }
+            OperationRecord operationRecord=new OperationRecord();
+            operationRecord.setModuleName("项目管理")
+                           .setOperatorName(user.getName())
+                           .setProjectName(project.getProjectName())
+                           .setCompanyId(user.getCompanyId())
+                           .setOperationTime(LocalDateTime.now())
+                           .setContent("批量添加项目参与人");
+            operationRecordService.save(operationRecord);
         }
         participationService.saveBatch(list);
         return msg;
@@ -6632,6 +6653,14 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 participation.setUserId(inchargerId);
                 participationMapper.insert(participation);
             }
+            OperationRecord operationRecord=new OperationRecord();
+            operationRecord.setOperatorName(user.getName());
+            operationRecord.setProjectName(project.getProjectName());
+            operationRecord.setCompanyId(project.getCompanyId());
+            operationRecord.setOperationTime(LocalDateTime.now());
+            operationRecord.setContent("批量操作:[设置项目负责人为:"+inchargerId+"]");
+            operationRecord.setModuleName("项目管理");
+            operationRecordService.save(operationRecord);
         }
         return httpRespMsg;
     }

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java

@@ -1468,14 +1468,14 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                 HSSFRow row = sheet.createRow(rowNum);
                 row.createCell(0).setCellValue(rowNum);
                 if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                    row.createCell(1).setCellValue("$userName="+item.getCorpwxUserid()==null?"":item.getCorpwxUserid()+"$");
+                    row.createCell(1).setCellValue("$userName="+(item.getCorpwxUserid()==null?" ":item.getCorpwxUserid())+"$");
                 }else {
                     row.createCell(1).setCellValue(item.getName());
                 }
                 row.createCell(2).setCellValue(item.getRoleName());
                 row.createCell(3).setCellValue(item.getPhone());
                 if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                    row.createCell(4).setCellValue("$departmentName="+item.getCorpwxDeptid()==null?"":item.getCorpwxDeptid()+"$");
+                    row.createCell(4).setCellValue("$departmentName="+(item.getCorpwxDeptid()==null?" ":item.getCorpwxDeptid())+"$");
                 }else {
                     row.createCell(4).setCellValue(item.getDepartmentName());
                 }