|
@@ -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);
|