|
@@ -169,46 +169,48 @@ public class TestController {
|
|
@Autowired
|
|
@Autowired
|
|
private IKuaishouSupplyChainService ikuaishouSupplyChainService;
|
|
private IKuaishouSupplyChainService ikuaishouSupplyChainService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private YufuSupplyChainService yufuSupplyChainService;
|
|
|
|
+
|
|
|
|
|
|
@GetMapping(value = "/getData")
|
|
@GetMapping(value = "/getData")
|
|
public void getDate() throws Exception {
|
|
public void getDate() throws Exception {
|
|
|
|
|
|
- log.info("-------------------------获取快分销订单当天当小时数据开始--------------------------");
|
|
|
|
- List<JSONObject> cookies = ikuaishouSupplyChainService.getCookie();
|
|
|
|
|
|
+ String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
|
|
|
|
+ String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -4);
|
|
|
|
+ String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
|
|
|
|
+ List<String> days = DateUtils.getDays(startDate, endDate);
|
|
|
|
+
|
|
|
|
+ List<JSONObject> cookies = yufuSupplyChainService.getCookie();
|
|
if (Check.isNull(cookies)) {
|
|
if (Check.isNull(cookies)) {
|
|
log.error("cookie数据为空");
|
|
log.error("cookie数据为空");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- String date = DateUtils.getNowDate("yyyy-MM-dd");
|
|
|
|
- Integer nowHour = DateUtils.getNowHour();
|
|
|
|
- JSONArray hours = new JSONArray();
|
|
|
|
- hours.add(nowHour);
|
|
|
|
- if (nowHour >= 1) {
|
|
|
|
- hours.add(nowHour - 1);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ JSONArray hourList = KuaishouHourEnum.getHourList();
|
|
JSONArray minSecList = KuaishouMinSecEnum.getMinSecList();
|
|
JSONArray minSecList = KuaishouMinSecEnum.getMinSecList();
|
|
- Map<Long, Long> itemMap = activityItemListService.getItemMap();
|
|
|
|
- for (int i = 0; i < hours.size(); i++) {
|
|
|
|
- Integer hour = hours.getInteger(i);
|
|
|
|
- for (int j = 0; j < minSecList.size(); j++) {
|
|
|
|
- JSONObject minSecJson = minSecList.getJSONObject(j);
|
|
|
|
- String startTime = minSecJson.getString("startTime");
|
|
|
|
- String endTime = minSecJson.getString("endTime");
|
|
|
|
- String start = date + " " + hour + ":" + startTime;
|
|
|
|
- String end = date + " " + hour + ":" + endTime;
|
|
|
|
- System.err.println("开始时间:" + start);
|
|
|
|
- System.err.println("结束时间:" + end);
|
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
- Long orderCreateTimeStart = sdf.parse(start).getTime();
|
|
|
|
- Long orderCreateTimeEnd = sdf.parse(end).getTime();
|
|
|
|
- for (int p = 0; p < cookies.size(); p++) {
|
|
|
|
- JSONObject cookieJson = cookies.get(p);
|
|
|
|
- String cookie = cookieJson.getString("cookie");
|
|
|
|
- ikuaishouSupplyChainService.getOrderList(cookie, 0, orderCreateTimeStart, orderCreateTimeEnd, itemMap);
|
|
|
|
|
|
+ Map<Long, Long> itemMap = activityItemListService.getYufuItemList();
|
|
|
|
+ for (int z = 0; z < days.size(); z++) {
|
|
|
|
+ String date = days.get(z);
|
|
|
|
+ for (int i = 0; i < hourList.size(); i++) {
|
|
|
|
+ String hour = hourList.getString(i);
|
|
|
|
+ for (int j = 0; j < minSecList.size(); j++) {
|
|
|
|
+ JSONObject minSecJson = minSecList.getJSONObject(j);
|
|
|
|
+ String startTime = minSecJson.getString("startTime");
|
|
|
|
+ String endTime = minSecJson.getString("endTime");
|
|
|
|
+ String start = date + hour + startTime;
|
|
|
|
+ String end = date + hour + endTime;
|
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ Long orderCreateTimeStart = sdf.parse(start).getTime();
|
|
|
|
+ Long orderCreateTimeEnd = sdf.parse(end).getTime();
|
|
|
|
+ for (int p = 0; p < cookies.size(); p++) {
|
|
|
|
+ JSONObject cookieJson = cookies.get(p);
|
|
|
|
+ String cookie = cookieJson.getString("cookie");
|
|
|
|
+ yufuSupplyChainService.getOrderList(cookie, 0, orderCreateTimeStart, orderCreateTimeEnd, itemMap);
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|