Commit 46bb5c96 by 墨竹

feat:企微同步通讯录处理部门

parent 6b12a7a9
......@@ -27,7 +27,7 @@ import com.gic.wechat.api.service.qywx.QywxDepartmentApiService;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import com.google.common.collect.Sets;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -189,6 +189,10 @@ public class MessageApiServiceImpl implements MessageApiService {
private void dealUser(QywxCallBackDTO qywxCallBackDTO) {
String userid = qywxCallBackDTO.getUserid();
log.info("成员同步开始:userid:{}", userid);
if (StringUtils.isBlank(userid)) {
log.info("成员不存在,{}", qywxCallBackDTO.getAuthCorpId());
return;
}
TabHaobanWxEnterprise enterprise = this.enterpriseService.getEnterpriseBycorpId(qywxCallBackDTO.getAuthCorpId());
if (enterprise == null) {
log.info("授权企业不存在,{}", qywxCallBackDTO.getAuthCorpId());
......@@ -323,7 +327,7 @@ public class MessageApiServiceImpl implements MessageApiService {
}
departmentDTO.setParentDepartmentId(parentDepartment.getDepartmentId());
departmentDTO.setChainId(parentDepartment.getChainId() + Constant.ID_SEPARATOR + parentDepartment.getDepartmentId());
departmentDTO.setChainName(parentDepartment.getChainName() + Constant.NAME_SEPARATOR + parentDepartment.getChainName());
departmentDTO.setChainName(parentDepartment.getChainName() + parentDepartment.getChainName());
departmentDTO.setLevel(parentDepartment.getLevel() + 1);
}
departmentDTO.setWxEnterpriseId(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