Commit 4c7bc159 by jinxin

定时同步企业微信通讯录列表

parent b99f847f
......@@ -348,5 +348,12 @@ public interface StaffApiService {
* @param params 企业微信id,多个按”,“隔开
*/
com.gic.api.base.commons.ServiceResponse<Boolean> updateExternalUserId(String params);
/**
* 定时任务
* 同步企业微信通讯录列表
* @param params 回调参数
* @return
*/
com.gic.api.base.commons.ServiceResponse<Boolean> syncQywxStaffList(String params) ;
}
......@@ -89,4 +89,9 @@ public interface WxEnterpriseMapper {
*/
List<TabHaobanWxEnterprise> listAllByWxSecurityType(@Param("wxSecurityType") Integer wxSecurityType);
void updateWxaAppid(@Param("wxEnterpriseId") String wxEnterpriseId,@Param("wxaAppid")String wxaAppid);
/**
* 根据是否配置回调地址查询所有企业微信
* @return
*/
List<WxEnterpriseDTO> listWxEnterpriseByCallbackFlag(@Param("callbackFlag")Integer callbackFlag);
}
\ No newline at end of file
......@@ -93,4 +93,10 @@ public interface WxEnterpriseService {
*/
void deleteByWxEnterpriseId(String wxEnterpriseId,String wxaAppid) ;
/**
* 根据是否配置回调地址查询所有企业微信
* @return
*/
List<WxEnterpriseDTO> listWxEnterpriseByCallbackFlag(Integer callbackFlag);
}
......@@ -311,4 +311,9 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
public void deleteByWxEnterpriseId(String wxEnterpriseId,String wxaAppid) {
this.mapper.updateWxaAppid(wxEnterpriseId,wxaAppid);
}
@Override
public List<WxEnterpriseDTO> listWxEnterpriseByCallbackFlag(Integer callbackFlag) {
return this.mapper.listWxEnterpriseByCallbackFlag(callbackFlag);
}
}
......@@ -1204,4 +1204,23 @@ public class StaffApiServiceImpl implements StaffApiService {
logger.info("定时刷新成员外部联系人结束");
return com.gic.api.base.commons.ServiceResponse.success(true);
}
@Override
public com.gic.api.base.commons.ServiceResponse<Boolean> syncQywxStaffList(String params) {
logger.info("定时刷新企业微信通讯录列表信息");
//查询所有未配置回调地址的自建应用
List<WxEnterpriseDTO> enterpriseDTOList = wxEnterpriseService.listWxEnterpriseByCallbackFlag(0);
if(CollUtil.isNotEmpty(enterpriseDTOList)){
for (WxEnterpriseDTO dto : enterpriseDTOList){
String wxEnterpriseId = dto.getWxEnterpriseId();
logger.info("开始刷新:{}",wxEnterpriseId);
String taskId = dealSyncOperationApiService.createQywxTask(wxEnterpriseId, "后门同步企业微信架构", "定时同步处理", "后门同步企业微信架构");
String ret = dealSyncOperationApiService.dealQywxDepartment(taskId, wxEnterpriseId);
if (null != ret) {
logger.info("企业微信id:{},异常信息返回:{}",wxEnterpriseId,ret);
}
}
}
return null;
}
}
......@@ -594,4 +594,13 @@
where wx_enterprise_id = #{wxEnterpriseId}
</update>
<select id="listWxEnterpriseByCallbackFlag" resultType="com.gic.haoban.manage.api.dto.WxEnterpriseDTO" >
select
<include refid="Base_Column_List"/>
from tab_haoban_wx_enterprise
where
status_flag = 1
and callback_flag = #{callbackFlag}
</select>
</mapper>
\ No newline at end of file
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