ソースを参照

组织架构同步修改

yurk 2 年 前
コミット
88569c0824

+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java

@@ -2272,6 +2272,7 @@ public class WeiXinCorpController {
                 Department curDept = null;
                 if (deptId != companyRootDeptId) {
                     int parentId = deptObjJSONArray.getJSONObject(i).getIntValue("parentid");
+                    System.out.println("打印parentId"+parentId);
                     //部门不存在的话要生成部门
                     curDept = departmentMapper.selectOne(new QueryWrapper<Department>().eq("company_id", companyId).eq("corpwx_deptid", deptId));
                     if (curDept == null) {
@@ -2291,7 +2292,7 @@ public class WeiXinCorpController {
                                 departmentMapper.updateNullSuperior(curDept.getDepartmentId());
                             }
                         } else {
-                            if (curDept.getCorpwxDeptpid() == null) {
+                            if (curDept.getCorpwxDeptpid() == null||curDept.getCorpwxDeptpid()!=parentId) {
                                 //有父部门需要更新
                                 curDept.setCorpwxDeptpid(parentId);
                                 departmentMapper.updateById(curDept);