|
@@ -1131,6 +1131,9 @@ public class WeiXinCorpController {
|
|
|
if (parentDept != null) {
|
|
|
department.setSuperiorId(parentDept.getDepartmentId());
|
|
|
departmentMapper.updateById(department);
|
|
|
+ } else {
|
|
|
+ //父部门不存在,自己变成一级部门
|
|
|
+ departmentMapper.updateNullSuperior(department.getDepartmentId());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1153,11 +1156,10 @@ public class WeiXinCorpController {
|
|
|
}
|
|
|
if (jsonObject.has("Name")) {
|
|
|
//发生了部门名称变化
|
|
|
- System.out.println("部门名称变化了,请处理==企业微信部门id="+deptId);
|
|
|
String remoteCorpConcactAccessToken = getRemoteCorpConcactAccessToken(wxCorpInfo);
|
|
|
String url = TRANSMIT_SERVER_GET_DEPTDETAIL.replace(TRANSMIT_SERVER_STR, wxCorpInfo.getContactServer()).replace("ACCESS_TOKEN", remoteCorpConcactAccessToken).replace("DEPTID", ""+deptId);
|
|
|
String result = restTemplate.getForObject(url, String.class);
|
|
|
- System.out.println("部门返回数据:"+result);
|
|
|
+// System.out.println("部门返回数据:"+result);
|
|
|
JSONObject resultObj = JSONObject.parseObject(JSONObject.parseObject(result).getString("data"));
|
|
|
if (resultObj.getInteger("errcode") == 0) {
|
|
|
JSONObject serverDept = resultObj.getJSONObject("department");
|
|
@@ -2272,7 +2274,6 @@ 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) {
|