Commit a0f6dd8b by 蘑菇

Merge remote-tracking branch 'origin/developer' into developer

parents b5f25d77 e03c0b52
...@@ -485,26 +485,26 @@ public class DepartmentApiServiceImpl implements DepartmentApiService { ...@@ -485,26 +485,26 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
@Override @Override
public void initwxDepartment(String corpid, String contactSecret, String wxEnterpriseId) { public void initwxDepartment(String corpid, String contactSecret, String wxEnterpriseId) {
// logger.info("【同步企业微信】wxEnterpriseId={}","init-enterprise-" + wxEnterpriseId); logger.info("【同步企业微信】wxEnterpriseId={}","init-enterprise-" + wxEnterpriseId);
// String key = "init-enterprise-" + wxEnterpriseId; String key = "init-enterprise-" + wxEnterpriseId;
// if(RedisUtil.getCache(key) == null){ if(RedisUtil.getCache(key) == null){
// RedisUtil.setCache(key,1, 60 * 60L); RedisUtil.setCache(key,1, 60 * 60L);
// String taskId = StringUtil.randomUUID(); String taskId = StringUtil.randomUUID();
// List<com.gic.wechat.api.dto.qywx.DepartmentDTO> list = this.qywxDepartmentApiService.listSelfDepartment(corpid, contactSecret, null); List<com.gic.wechat.api.dto.qywx.DepartmentDTO> list = this.qywxDepartmentApiService.listSelfDepartment(corpid, contactSecret, null);
// logger.info("企业所有部门数据:{}", JSON.toJSONString(list)); logger.info("企业所有部门数据:{}", JSON.toJSONString(list));
// if(CollectionUtils.isNotEmpty(list)){ if(CollectionUtils.isNotEmpty(list)){
// this.addAllDepartment(list, 0, wxEnterpriseId, corpid, contactSecret,taskId); this.addAllDepartment(list, 0, wxEnterpriseId, corpid, contactSecret,taskId);
// } }
// }else{ }else{
// RedisUtil.delCache(key); RedisUtil.delCache(key);
// }
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 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);
// }
} }
......
...@@ -109,9 +109,16 @@ public class ApplicationController extends WebBaseController{ ...@@ -109,9 +109,16 @@ public class ApplicationController extends WebBaseController{
WxEnterpriseDTO enterpriseDTO = this.wxEnterpriseApiService.getOne(wxEnterpriseId); WxEnterpriseDTO enterpriseDTO = this.wxEnterpriseApiService.getOne(wxEnterpriseId);
if(enterpriseDTO != null){ if(enterpriseDTO != null){
if(StringUtils.isNotBlank(enterpriseDTO.getContactSecret()) && enterpriseDTO.getContactFlag() != null && enterpriseDTO.getContactFlag() == 0){ if(StringUtils.isNotBlank(enterpriseDTO.getContactSecret()) && enterpriseDTO.getContactFlag() != null && enterpriseDTO.getContactFlag() == 0){
this.departmentApiService.initwxDepartmentMQ(enterpriseDTO.getWxEnterpriseId()); // this.departmentApiService.initwxDepartmentMQ(enterpriseDTO.getWxEnterpriseId());
enterpriseDTO.setContactFlag(1); // enterpriseDTO.setContactFlag(1);
wxEnterpriseApiService.update(enterpriseDTO); // wxEnterpriseApiService.update(enterpriseDTO);
log.info("【初始化部门调用】{},{},{}",RouterConstant.INIT_WX_DEPARTMENT_SERVICENAME,RouterConstant.INIT_WX_DEPARTMENT_METHODNAME,wxEnterpriseId);
try {
GICMQClientUtil.getClientInstance().sendCommonMessage(RouterConstant.ROUTERTYPE, wxEnterpriseId,
RouterConstant.INIT_WX_DEPARTMENT_SERVICENAME, RouterConstant.INIT_WX_DEPARTMENT_METHODNAME);
} catch (Exception e) {
log.info(e.getMessage(),e);
}
} }
} }
...@@ -126,14 +133,14 @@ public class ApplicationController extends WebBaseController{ ...@@ -126,14 +133,14 @@ public class ApplicationController extends WebBaseController{
if(enterpriseDTO != null){ if(enterpriseDTO != null){
if(StringUtils.isNotBlank(enterpriseDTO.getContactSecret()) && enterpriseDTO.getContactFlag() != null){ if(StringUtils.isNotBlank(enterpriseDTO.getContactSecret()) && enterpriseDTO.getContactFlag() != null){
// //
// log.info("【初始化部门调用】{},{},{}",RouterConstant.INIT_WX_DEPARTMENT_SERVICENAME,RouterConstant.INIT_WX_DEPARTMENT_METHODNAME,wxEnterpriseId); log.info("【初始化部门调用】{},{},{}",RouterConstant.INIT_WX_DEPARTMENT_SERVICENAME,RouterConstant.INIT_WX_DEPARTMENT_METHODNAME,wxEnterpriseId);
// try { try {
// GICMQClientUtil.getClientInstance().sendCommonMessage(RouterConstant.ROUTERTYPE, wxEnterpriseId, GICMQClientUtil.getClientInstance().sendCommonMessage(RouterConstant.ROUTERTYPE, wxEnterpriseId,
// RouterConstant.INIT_WX_DEPARTMENT_SERVICENAME, RouterConstant.INIT_WX_DEPARTMENT_METHODNAME); RouterConstant.INIT_WX_DEPARTMENT_SERVICENAME, RouterConstant.INIT_WX_DEPARTMENT_METHODNAME);
// } catch (Exception e) { } catch (Exception e) {
// log.info(e.getMessage(),e); log.info(e.getMessage(),e);
// } }
this.departmentApiService.initwxDepartment(enterpriseDTO.getCorpid(), enterpriseDTO.getContactSecret(), enterpriseDTO.getWxEnterpriseId()); // this.departmentApiService.initwxDepartment(enterpriseDTO.getCorpid(), enterpriseDTO.getContactSecret(), enterpriseDTO.getWxEnterpriseId());
} }
} }
......
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