Commit 1bf76dea by qwmqiuwenmin

fix

parent 5d97088f
...@@ -160,5 +160,7 @@ public interface DepartmentApiService { ...@@ -160,5 +160,7 @@ public interface DepartmentApiService {
ServiceResponse<List<DepartmentDTO>> listStoreListByStaffId(String wxUserId); ServiceResponse<List<DepartmentDTO>> listStoreListByStaffId(String wxUserId);
void initwxDepartmentMQ(String res); void initwxDepartmentMQ(String res);
boolean initLock(String wxEnterpriseId);
} }
...@@ -513,6 +513,12 @@ public class DepartmentApiServiceImpl implements DepartmentApiService { ...@@ -513,6 +513,12 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
RedisUtil.unlock("init_enterprise_" + wxEnterpriseId); RedisUtil.unlock("init_enterprise_" + wxEnterpriseId);
} }
@Override
public boolean initLock(String wxEnterpriseId){
return RedisUtil.isLocked("init_enterprise_" + wxEnterpriseId);
}
private void addAllDepartment(List<com.gic.wechat.api.dto.qywx.DepartmentDTO> list, Integer parentId, private void addAllDepartment(List<com.gic.wechat.api.dto.qywx.DepartmentDTO> list, Integer parentId,
......
...@@ -109,9 +109,14 @@ public class ApplicationController extends WebBaseController{ ...@@ -109,9 +109,14 @@ 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.initwxDepartment(enterpriseDTO.getCorpid(), enterpriseDTO.getContactSecret(), enterpriseDTO.getWxEnterpriseId());
enterpriseDTO.setContactFlag(1); log.info("【初始化部门调用】{},{},{}",RouterConstant.INIT_WX_DEPARTMENT_SERVICENAME,RouterConstant.INIT_WX_DEPARTMENT_METHODNAME,wxEnterpriseId);
wxEnterpriseApiService.update(enterpriseDTO); 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);
}
} }
} }
...@@ -162,7 +167,7 @@ public class ApplicationController extends WebBaseController{ ...@@ -162,7 +167,7 @@ public class ApplicationController extends WebBaseController{
String wxEnterpriseId = login.getWxEnterpriseId(); String wxEnterpriseId = login.getWxEnterpriseId();
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){ if(StringUtils.isNotBlank(enterpriseDTO.getContactSecret()) && enterpriseDTO.getContactFlag() != null && enterpriseDTO.getContactFlag() == 0){
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 {
......
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