|
@@ -166,49 +166,49 @@ public class TestController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private IMgsSupplyChainService mgsSupplyChainService;
|
|
private IMgsSupplyChainService mgsSupplyChainService;
|
|
-
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IKuaishouSupplyChainService ikuaishouSupplyChainService;
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/getData")
|
|
@GetMapping(value = "/getData")
|
|
public void getDate() throws Exception {
|
|
public void getDate() throws Exception {
|
|
|
|
|
|
- String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
|
|
|
|
- String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -10);
|
|
|
|
- String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
|
|
|
|
- List<String> days = DateUtils.getDays(startDate, endDate);
|
|
|
|
-
|
|
|
|
- List<JSONObject> cookies = mgsSupplyChainService.getCookie();
|
|
|
|
|
|
+ log.info("-------------------------获取快分销订单当天当小时数据开始--------------------------");
|
|
|
|
+ List<JSONObject> cookies = ikuaishouSupplyChainService.getCookie();
|
|
if (Check.isNull(cookies)) {
|
|
if (Check.isNull(cookies)) {
|
|
log.error("cookie数据为空");
|
|
log.error("cookie数据为空");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- JSONArray hourList = KuaishouHourEnum.getHourList();
|
|
|
|
- JSONArray minSecList = KuaishouMinSecEnum.getMinSecList();
|
|
|
|
- Map<Long, Long> itemMap = activityItemListService.getMgsItemList();
|
|
|
|
- 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");
|
|
|
|
- mgsSupplyChainService.getOrderList(cookie, 0, orderCreateTimeStart, orderCreateTimeEnd, itemMap);
|
|
|
|
-
|
|
|
|
|
|
+ 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 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);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|