|
|
|
@@ -6,7 +6,7 @@ import java.util.Date; |
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import com.simple.enums.EnumAppType;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.log4j.Logger;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.http.HttpEntity;
|
|
|
|
@@ -23,6 +23,7 @@ import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
import com.simple.domain.po.WxAppinfo;
|
|
|
|
import com.simple.domain.po.WxUserVisit;
|
|
|
|
import com.simple.enums.EnumAppType;
|
|
|
|
import com.simple.service.WxAppinfoService;
|
|
|
|
import com.simple.service.WxUserVisitService;
|
|
|
|
|
|
|
|
@@ -59,16 +60,16 @@ public class WxAppVisitSchedule { |
|
|
|
appInfo.setType(EnumAppType.C.getCode());
|
|
|
|
PageInfo<WxAppinfo> page = WxAppinfoService.listAsPage(appInfo, 1, 10000);
|
|
|
|
for(WxAppinfo w :page.getList()) {
|
|
|
|
w.getAppId();
|
|
|
|
w.getSecret();
|
|
|
|
w.getTenantId();
|
|
|
|
//TODO 因为数据库表里数据问题,暂时不通过这种方式处理
|
|
|
|
if(StringUtils.isBlank(w.getAppId())||StringUtils.isBlank(w.getSecret())) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
getData(yesterday,w.getAppId(),w.getSecret(),w.getTenantId());
|
|
|
|
}
|
|
|
|
// TODO hardcode appId
|
|
|
|
String appId = "wx8eb8275b78db4ede";
|
|
|
|
String key ="76c43df01296998d8ce12383f213ac10";
|
|
|
|
String talentId ="456";
|
|
|
|
getData(yesterday,appId,key,talentId);
|
|
|
|
// TODO hardcode appId
|
|
|
|
// String appId = "wx8eb8275b78db4ede";
|
|
|
|
// String key ="76c43df01296998d8ce12383f213ac10";
|
|
|
|
// String talentId ="456";
|
|
|
|
// getData(yesterday,appId,key,talentId);
|
|
|
|
}catch(Exception e) {
|
|
|
|
logger.error("获取微信访问数据失败",e);
|
|
|
|
}
|
|
|
|
@@ -101,7 +102,8 @@ public class WxAppVisitSchedule { |
|
|
|
logger.info(JSON.toJSONString(itemMap));
|
|
|
|
WxUserVisit v = new WxUserVisit();
|
|
|
|
// TODO hardcode appId
|
|
|
|
v.setAppId("wx8eb8275b78db4ede");
|
|
|
|
// v.setAppId("wx8eb8275b78db4ede");
|
|
|
|
v.setAppId(appId);
|
|
|
|
String time = itemMap.get("ref_date")+"";
|
|
|
|
Date date = new SimpleDateFormat("yyyyMMdd").parse(time);
|
|
|
|
v.setDayDate(date);
|
|
|
|
|