Commit 0aa2d3dd by qwmqiuwenmin

fix

parent f5ccce52
......@@ -508,12 +508,12 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
// this.addSon(subList, wxEnterpriseId, parent,corpid,suiteid);
RedisUtil.lock("init_enterprise_" + wxEnterpriseId,60 * 60L);
String taskId = StringUtil.randomUUID();
List<com.gic.wechat.api.dto.qywx.DepartmentDTO> list = this.qywxDepartmentApiService.listSelfDepartment(corpid, contactSecret, 0);
logger.info("企业所有部门数据:{}", JSON.toJSONString(list));
//List<com.gic.wechat.api.dto.qywx.DepartmentDTO> list = this.qywxDepartmentApiService.listSelfDepartment(corpid, contactSecret, 1);
// logger.info("企业所有部门数据:{}", JSON.toJSONString(list));
// if(CollectionUtils.isNotEmpty(list)){
// this.addAllDepartment(list, 0, wxEnterpriseId, corpid, contactSecret,taskId);
// }
// insertMQ(0,wxEnterpriseId, corpid,contactSecret,taskId);
insertMQ(0,wxEnterpriseId, corpid,contactSecret,taskId);
RedisUtil.unlock("init_enterprise_" + wxEnterpriseId);
}
......@@ -547,6 +547,16 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
List<com.gic.wechat.api.dto.qywx.DepartmentDTO> list = this.qywxDepartmentApiService.listSelfDepartment(corpid, contactSecret, parentId);
String chainId = "0";
String chainName = "0";
List<com.gic.wechat.api.dto.qywx.DepartmentDTO> handerList = new ArrayList<>();
if(parentId == 0){
for (com.gic.wechat.api.dto.qywx.DepartmentDTO departmentDTO : list) {
if(departmentDTO.getParentid() == 0){
handerList.add(departmentDTO);
}
}
}else{
handerList = list;
}
if(parentId != 0){
TabHaobanDepartment parent = this.departmentService.getByWxId(parentId + "", wxEnterpriseId);
if(parent != null){
......@@ -556,11 +566,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
}
if(level == 4){
return;
}
for (com.gic.wechat.api.dto.qywx.DepartmentDTO departmentDTO : list) {
for (com.gic.wechat.api.dto.qywx.DepartmentDTO departmentDTO : handerList) {
insertMQ(departmentDTO.getParentid(),wxEnterpriseId, corpid,contactSecret,taskId);
try {
TabHaobanDepartment exist = this.departmentService.getByWxId(departmentDTO.getId() + "", wxEnterpriseId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment