Commit 7742ac02 authored by 李健华's avatar 李健华

修改oneId相关企业微信配置

parent a50246a3
...@@ -49,6 +49,15 @@ public class WechatFollowServiceImpl implements IWechatFollowService { ...@@ -49,6 +49,15 @@ public class WechatFollowServiceImpl implements IWechatFollowService {
@Value("${wechat.secret}") @Value("${wechat.secret}")
private String secret; private String secret;
@Value("${qywechat.corpid}")
private String corpid;
@Value("${qywehcat.secret}")
private String qySecret;
// 部门
@Value("${qywehcat.departmentId}")
private Integer departmentId;
private String accessTokenUrl; private String accessTokenUrl;
private String userListUrl; private String userListUrl;
...@@ -59,8 +68,6 @@ public class WechatFollowServiceImpl implements IWechatFollowService { ...@@ -59,8 +68,6 @@ public class WechatFollowServiceImpl implements IWechatFollowService {
private String customerInfoListBatchUrl; private String customerInfoListBatchUrl;
// 部门
private Integer departmentId = 2;
@Resource @Resource
...@@ -97,7 +104,7 @@ public class WechatFollowServiceImpl implements IWechatFollowService { ...@@ -97,7 +104,7 @@ public class WechatFollowServiceImpl implements IWechatFollowService {
accessTokenUrl = String.format("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s", appId, secret); accessTokenUrl = String.format("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s", appId, secret);
userListUrl = "https://api.weixin.qq.com/cgi-bin/user/get?access_token=%s&next_openid=%s"; userListUrl = "https://api.weixin.qq.com/cgi-bin/user/get?access_token=%s&next_openid=%s";
// 企业微信 // 企业微信
qyAccessTokenUrl = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=wwd6e3a8c6bc4f3763&corpsecret=5SvwrDrf0tapQZnKLcmDJ9nprQ7zEard_mzXCqNm06Y"; qyAccessTokenUrl = String.format("https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=%s&corpsecret=%s", corpid, qySecret);
// 成员列表 // 成员列表
departmentUserListUrl = "https://qyapi.weixin.qq.com/cgi-bin/user/simplelist?access_token=%s&department_id=%s&fetch_child=1"; departmentUserListUrl = "https://qyapi.weixin.qq.com/cgi-bin/user/simplelist?access_token=%s&department_id=%s&fetch_child=1";
//批量获取客户详情 //批量获取客户详情
...@@ -170,7 +177,7 @@ public class WechatFollowServiceImpl implements IWechatFollowService { ...@@ -170,7 +177,7 @@ public class WechatFollowServiceImpl implements IWechatFollowService {
String period = simpleDateFormat.format(new Date()); String period = simpleDateFormat.format(new Date());
// 微信公众号关注数据更新 // 微信公众号关注数据更新
executeWechatFollowStatus("", period); // executeWechatFollowStatus("", period);
// 企业微信关注数据更新 // 企业微信关注数据更新
executeEnterpriseFollowStatus("", period); executeEnterpriseFollowStatus("", period);
} }
...@@ -224,7 +231,7 @@ public class WechatFollowServiceImpl implements IWechatFollowService { ...@@ -224,7 +231,7 @@ public class WechatFollowServiceImpl implements IWechatFollowService {
String unionIdStrs = String.join("\',\'", unionIds); String unionIdStrs = String.join("\',\'", unionIds);
unionIdStrs = "\'" + unionIdStrs + "\'"; unionIdStrs = "\'" + unionIdStrs + "\'";
// String sql = String.format("INSERT INTO wechat_enterprise(`unionid`) values ('%s')", String.join(",", unionIdAll)); // String sql = String.format("INSERT INTO wechat_enterprise(`unionid`) values ('%s')", String.join(",", unionIdAll));
String sql = String.format("INSERT INTO wechat_info_relation(`user_id`, `open_id`, `union_id`, `type`, `period`) SELECT `user_id`, `open_id`, `union_id`, '%s', %s from wechat_userinfo where `union_id` IN (%s)", ENTERPRISE_WECHAT, period, unionIdStrs); String sql = String.format("INSERT INTO wechat_info_relation(`user_id`, `open_id`, `union_id`, `type`, `task_period`) SELECT `user_id`, `open_id`, `union_id`, '%s', %s from wechat_userinfo where `union_id` IN (%s)", ENTERPRISE_WECHAT, period, unionIdStrs);
jdbcTemplate.update(sql); jdbcTemplate.update(sql);
} }
......
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