Commit feafa6fc by qwmqiuwenmin

fix

parent c6eff86d
......@@ -507,15 +507,20 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
// DepartmentDTO parent = EntityUtil.changeEntityByJSON(DepartmentDTO.class,departmentService.selectById(parentId));
// this.addSon(subList, wxEnterpriseId, parent,corpid,suiteid);
logger.info("【同步企业微信】wxEnterpriseId={}","init_enterprise_" + wxEnterpriseId);
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, null);
logger.info("企业所有部门数据:{}", JSON.toJSONString(list));
if(CollectionUtils.isNotEmpty(list)){
this.addAllDepartment(list, 0, wxEnterpriseId, corpid, contactSecret,taskId);
String key = "init_enterprise_" + wxEnterpriseId;
if(RedisUtil.getCache(key) != null){
RedisUtil.setCache(key, 60 * 60L);
String taskId = StringUtil.randomUUID();
List<com.gic.wechat.api.dto.qywx.DepartmentDTO> list = this.qywxDepartmentApiService.listSelfDepartment(corpid, contactSecret, null);
logger.info("企业所有部门数据:{}", JSON.toJSONString(list));
if(CollectionUtils.isNotEmpty(list)){
this.addAllDepartment(list, 0, wxEnterpriseId, corpid, contactSecret,taskId);
}
}
RedisUtil.delCache(key);
//RedisUtil.lock("init_enterprise_" + wxEnterpriseId,60 * 60L);
//insertMQ(0,wxEnterpriseId, corpid,contactSecret,taskId);
RedisUtil.unlock("init_enterprise_" + wxEnterpriseId);
//RedisUtil.unlock("init_enterprise_" + 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