Преглед на файлове

1. 修复资源需求分页失效问题
2. 解决企业微信新增员工自动加入项目参与人问题

seyason преди 2 месеца
родител
ревизия
cf5cd52bb1

+ 26 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java

@@ -1107,6 +1107,20 @@ public class WeiXinCorpController {
                             contactSyncLogMapper.insert(contactSyncLog);
                         }else {
                             userMapper.insert(user);
+                            //处理项目参与人
+                            if (user.getDepartmentId() != null && user.getDepartmentId() != 0) {
+                                List<Participation> toAddList = new ArrayList<>();
+                                projectDeptRelateMapper.selectList(new QueryWrapper<ProjectDeptRelate>().eq("department_id", user.getDepartmentId()).eq("company_id", companyId))
+                                        .forEach(projectDeptRelate -> {
+                                            Participation participation = new Participation();
+                                            participation.setProjectId(projectDeptRelate.getProjectId());
+                                            participation.setUserId(user.getId());
+                                            toAddList.add(participation);
+                                        });
+                                if (toAddList.size() > 0) {
+                                    participationMapper.insertBatch(toAddList);
+                                }
+                            }
                             wxCorpInfoService.getUserByCompanyIdAndTransferLicense(companyId,user.getCorpwxUserid());
                             contactSyncLog.setResult(1);
                             //contactSyncLog.setMsg("同步成功");
@@ -1208,6 +1222,18 @@ public class WeiXinCorpController {
                                         List<Department> allDeptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
                                         changeUser.setDepartmentCascade(convertDepartmentIdToCascade(changeUser.getDepartmentId(), allDeptList));
                                         userMapper.updateById(changeUser);
+                                        //处理项目参与人
+                                        List<Participation> toAddList = new ArrayList<>();
+                                        projectDeptRelateMapper.selectList(new QueryWrapper<ProjectDeptRelate>().eq("department_id", changeUser.getDepartmentId()).eq("company_id", companyId))
+                                                .forEach(projectDeptRelate -> {
+                                                    Participation participation = new Participation();
+                                                    participation.setProjectId(projectDeptRelate.getProjectId());
+                                                    participation.setUserId(changeUser.getId());
+                                                    toAddList.add(participation);
+                                                });
+                                        if (toAddList.size() > 0) {
+                                            participationMapper.insertBatch(toAddList);
+                                        }
                                     }
                                 }
                             }

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectRequirementMapper.xml

@@ -57,11 +57,11 @@
                  #{item}
              </foreach>
          </if>
-        <if test="reStartDate != null and reEndDate !=null">
+        <if test="reStartDate != null and reEndDate != null">
             and project_requirement.start_date>=#{reStartDate} and project_requirement.end_date&lt;=#{reEndDate}
         </if>
         order by project.id asc
-        <if test="startIndex!=null and startIndex!='' and pageSize!=null and pageSize!=''">
+        <if test="startIndex != null and pageSize != null">
             limit #{startIndex}, #{pageSize}
         </if>
     </select>