Commit a50246a3 authored by 李健华's avatar 李健华

部分数据类型修改

parent 41e8dbbd
......@@ -7,7 +7,7 @@ import cn.quantgroup.xyqb.model.webchat.AccessTokenResponse;
public interface IWechatFollowService {
AccessTokenResponse getToken();
JsonResult executeWechatFollowStatus(String nextOpenId, Integer period);
JsonResult executeWechatFollowStatus(String nextOpenId, String period);
void executeTask();
}
......@@ -59,8 +59,10 @@ public class WechatFollowServiceImpl implements IWechatFollowService {
private String customerInfoListBatchUrl;
// 部门
private Integer departmentId = 2;
@Resource
private IHttpService httpService;
......@@ -78,14 +80,15 @@ public class WechatFollowServiceImpl implements IWechatFollowService {
private JdbcTemplate jdbcTemplate;
// 公众号
private final String WECHAT_ACCOUNT = "wechatAccount";
private final Integer WECHAT_ACCOUNT = 1;
//企业微信
private final String ENTERPRISE_WECHAT = "enterpriseWechat";
private final Integer ENTERPRISE_WECHAT = 2;
// 公众号类型
private final String WECHAT_XYQB = "xyqb";
private List<String> unionIdList;
@PostConstruct
......@@ -124,7 +127,7 @@ public class WechatFollowServiceImpl implements IWechatFollowService {
}
@Override
public JsonResult executeWechatFollowStatus(String nextOpenId, Integer period) {
public JsonResult executeWechatFollowStatus(String nextOpenId, String period) {
AccessTokenResponse token = getToken();
String userListUrlFormat = String.format(userListUrl, token.getAccessToken(), nextOpenId);
try {
......@@ -139,7 +142,7 @@ public class WechatFollowServiceImpl implements IWechatFollowService {
String openIdStrs = String.join("\',\'", openIds);
openIdStrs = "\'" + openIdStrs + "\'";
// 添加公众号数据
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 app_name='%s' and `open_id` IN (%s)", WECHAT_ACCOUNT, period, WECHAT_XYQB, openIdStrs);
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 app_name='%s' and `open_id` IN (%s)", WECHAT_ACCOUNT, period, WECHAT_XYQB, openIdStrs);
jdbcTemplate.update(sql);
}
if (nextOpenId != "") {
......@@ -164,14 +167,15 @@ public class WechatFollowServiceImpl implements IWechatFollowService {
// 初始化任务数据
// initTask();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("YYYYMMdd");
Integer period = Integer.parseInt(simpleDateFormat.format(new Date()));
String period = simpleDateFormat.format(new Date());
// 微信公众号关注数据更新
executeWechatFollowStatus("", period);
// 企业微信关注数据更新
executeEnterpriseFollowStatus("", period);
}
private JsonResult executeEnterpriseFollowStatus(String s, Integer period) {
private JsonResult executeEnterpriseFollowStatus(String s, String period) {
try {
String response = httpService.get(qyAccessTokenUrl);
......@@ -201,7 +205,7 @@ public class WechatFollowServiceImpl implements IWechatFollowService {
return null;
}
private void batchQueryCustomerDetailInfo(String accessToken, List<String> userIdList, String cursor, Integer period) {
private void batchQueryCustomerDetailInfo(String accessToken, List<String> userIdList, String cursor, String period) {
// 查询客户详情
HashMap<String, Object> parameters = new HashMap<>();
parameters.put("userid_list", userIdList);
......
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