|
@@ -14,11 +14,9 @@ import org.jeecg.common.util.DateUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import javax.print.DocFlavor;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
+
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -40,28 +38,27 @@ public class KuaishouOrderLIstGetJob {
|
|
|
@XxlJob("getActivityItemList")
|
|
|
public void getActivityItemList() throws Exception {
|
|
|
log.info("-------------------------快分销招商活动商品数据开始--------------------------");
|
|
|
- String cookie = ikuaishouSupplyChainService.getCookie();
|
|
|
- if (Check.isNull(cookie)) {
|
|
|
+ List<JSONObject> cookies = ikuaishouSupplyChainService.getCookie();
|
|
|
+ if (Check.isNull(cookies)) {
|
|
|
log.error("cookie数据为空");
|
|
|
return;
|
|
|
}
|
|
|
Map<Long, Integer> itemMap = activityInfoService.getItemMap();
|
|
|
-
|
|
|
- List<JSONObject> activityIdList = activityInfoService.getActivityIdList();
|
|
|
- if (!Check.isNull(activityIdList)) {
|
|
|
- for (int i = 0; i < activityIdList.size(); i++) {
|
|
|
- JSONObject jsonObject = activityIdList.get(i);
|
|
|
- Long activityId = jsonObject.getLong("activityId");
|
|
|
- Integer activityStatus = jsonObject.getInteger("activityStatus");
|
|
|
-
|
|
|
- activityItemListService.getActivityItemList(cookie, 0, activityId,activityStatus,itemMap);
|
|
|
- Thread.sleep(1000);
|
|
|
+ for (int j = 0; j < cookies.size(); j++) {
|
|
|
+ JSONObject cookieJson = cookies.get(j);
|
|
|
+ Long id = cookieJson.getLong("id");
|
|
|
+ String cookie = cookieJson.getString("cookie");
|
|
|
+ List<JSONObject> activityIdList = activityInfoService.getActivityIdList(id);
|
|
|
+ if (!Check.isNull(activityIdList)) {
|
|
|
+ for (int i = 0; i < activityIdList.size(); i++) {
|
|
|
+ JSONObject jsonObject = activityIdList.get(i);
|
|
|
+ Long activityId = jsonObject.getLong("activityId");
|
|
|
+ Integer activityStatus = jsonObject.getInteger("activityStatus");
|
|
|
+ activityItemListService.getActivityItemList(cookie, 0, activityId, activityStatus, itemMap);
|
|
|
+ Thread.sleep(1000);
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
@@ -71,14 +68,17 @@ public class KuaishouOrderLIstGetJob {
|
|
|
@XxlJob("getActivityInfo")
|
|
|
public void getActivityInfo() throws Exception {
|
|
|
log.info("-------------------------快分销招商活动数据开始--------------------------");
|
|
|
- String cookie = ikuaishouSupplyChainService.getCookie();
|
|
|
- if (Check.isNull(cookie)) {
|
|
|
+ List<JSONObject> cookies = ikuaishouSupplyChainService.getCookie();
|
|
|
+ if (Check.isNull(cookies)) {
|
|
|
log.error("cookie数据为空");
|
|
|
return;
|
|
|
}
|
|
|
- activityInfoService.getActivityInfo(cookie, 0);
|
|
|
-
|
|
|
-
|
|
|
+ for (int i = 0; i < cookies.size(); i++) {
|
|
|
+ JSONObject cookieJson = cookies.get(i);
|
|
|
+ Long id = cookieJson.getLong("id");
|
|
|
+ String cookie = cookieJson.getString("cookie");
|
|
|
+ activityInfoService.getActivityInfo(id, cookie, 0);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -93,7 +93,14 @@ public class KuaishouOrderLIstGetJob {
|
|
|
String firstDay = monthStartAndEnd.get("firstDay");
|
|
|
String lastDay = monthStartAndEnd.get("lastDay");
|
|
|
List<String> days = DateUtils.getDays(firstDay, lastDay);
|
|
|
- String cookie = ikuaishouSupplyChainService.getCookie();
|
|
|
+
|
|
|
+ List<JSONObject> cookies = ikuaishouSupplyChainService.getCookie();
|
|
|
+ if (Check.isNull(cookies)) {
|
|
|
+ log.error("cookie数据为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
JSONArray hourList = KuaishouHourEnum.getHourList();
|
|
|
JSONArray minSecList = KuaishouMinSecEnum.getMinSecList();
|
|
|
Map<Long, Long> itemMap = activityItemListService.getItemMap();
|
|
@@ -112,8 +119,11 @@ public class KuaishouOrderLIstGetJob {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
Long orderCreateTimeStart = sdf.parse(start).getTime();
|
|
|
Long orderCreateTimeEnd = sdf.parse(end).getTime();
|
|
|
- ikuaishouSupplyChainService.getOrderList(cookie, 0, orderCreateTimeStart, orderCreateTimeEnd, itemMap);
|
|
|
-
|
|
|
+ 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);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -127,8 +137,8 @@ public class KuaishouOrderLIstGetJob {
|
|
|
@XxlJob("nowMonthyOrderGet")
|
|
|
public void nowMonthyOrderGet() throws Exception {
|
|
|
log.info("-------------------------获取快分销订单当前月数据开始数据开始--------------------------");
|
|
|
- String cookie = ikuaishouSupplyChainService.getCookie();
|
|
|
- if (Check.isNull(cookie)) {
|
|
|
+ List<JSONObject> cookies = ikuaishouSupplyChainService.getCookie();
|
|
|
+ if (Check.isNull(cookies)) {
|
|
|
log.error("cookie数据为空");
|
|
|
return;
|
|
|
}
|
|
@@ -154,8 +164,11 @@ public class KuaishouOrderLIstGetJob {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
Long orderCreateTimeStart = sdf.parse(start).getTime();
|
|
|
Long orderCreateTimeEnd = sdf.parse(end).getTime();
|
|
|
- ikuaishouSupplyChainService.getOrderList(cookie, 0, orderCreateTimeStart, orderCreateTimeEnd, itemMap);
|
|
|
-
|
|
|
+ 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);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -170,8 +183,8 @@ public class KuaishouOrderLIstGetJob {
|
|
|
@XxlJob("yesterdayOrderGet")
|
|
|
public void yesterdayOrderGet() throws Exception {
|
|
|
log.info("-------------------------获取快分销订单昨日数据开始数据开始--------------------------");
|
|
|
- String cookie = ikuaishouSupplyChainService.getCookie();
|
|
|
- if (Check.isNull(cookie)) {
|
|
|
+ List<JSONObject> cookies = ikuaishouSupplyChainService.getCookie();
|
|
|
+ if (Check.isNull(cookies)) {
|
|
|
log.error("cookie数据为空");
|
|
|
return;
|
|
|
}
|
|
@@ -193,8 +206,11 @@ public class KuaishouOrderLIstGetJob {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
Long orderCreateTimeStart = sdf.parse(start).getTime();
|
|
|
Long orderCreateTimeEnd = sdf.parse(end).getTime();
|
|
|
- ikuaishouSupplyChainService.getOrderList(cookie, 0, orderCreateTimeStart, orderCreateTimeEnd, itemMap);
|
|
|
-
|
|
|
+ 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);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -206,13 +222,12 @@ public class KuaishouOrderLIstGetJob {
|
|
|
@XxlJob("beforeYesterdayOrderGet")
|
|
|
public void beforeYesterdayOrderGet() throws Exception {
|
|
|
log.info("-------------------------获取快分销订单前日数据开始数据开始--------------------------");
|
|
|
- String cookie = ikuaishouSupplyChainService.getCookie();
|
|
|
- if (Check.isNull(cookie)) {
|
|
|
+ List<JSONObject> cookies = ikuaishouSupplyChainService.getCookie();
|
|
|
+ if (Check.isNull(cookies)) {
|
|
|
log.error("cookie数据为空");
|
|
|
return;
|
|
|
}
|
|
|
String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
|
|
|
- // String startDateate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
|
|
|
String date = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -2);
|
|
|
JSONArray hourList = KuaishouHourEnum.getHourList();
|
|
|
JSONArray minSecList = KuaishouMinSecEnum.getMinSecList();
|
|
@@ -230,7 +245,11 @@ public class KuaishouOrderLIstGetJob {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
Long orderCreateTimeStart = sdf.parse(start).getTime();
|
|
|
Long orderCreateTimeEnd = sdf.parse(end).getTime();
|
|
|
- ikuaishouSupplyChainService.getOrderList(cookie, 0, orderCreateTimeStart, orderCreateTimeEnd, itemMap);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -243,8 +262,8 @@ public class KuaishouOrderLIstGetJob {
|
|
|
@XxlJob("nowHourOrderGet")
|
|
|
public void nowHourOrderGet() throws Exception {
|
|
|
log.info("-------------------------获取快分销订单当天当小时数据开始--------------------------");
|
|
|
- String cookie = ikuaishouSupplyChainService.getCookie();
|
|
|
- if (Check.isNull(cookie)) {
|
|
|
+ List<JSONObject> cookies = ikuaishouSupplyChainService.getCookie();
|
|
|
+ if (Check.isNull(cookies)) {
|
|
|
log.error("cookie数据为空");
|
|
|
return;
|
|
|
}
|
|
@@ -263,7 +282,12 @@ public class KuaishouOrderLIstGetJob {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
Long orderCreateTimeStart = sdf.parse(start).getTime();
|
|
|
Long orderCreateTimeEnd = sdf.parse(end).getTime();
|
|
|
- ikuaishouSupplyChainService.getOrderList(cookie, 0, orderCreateTimeStart, orderCreateTimeEnd, itemMap);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -277,8 +301,8 @@ public class KuaishouOrderLIstGetJob {
|
|
|
@XxlJob("frontHourOrderGet")
|
|
|
public void frontHourOrderGet() throws Exception {
|
|
|
log.info("-------------------------获取快分销订单当天数据开始--------------------------");
|
|
|
- String cookie = ikuaishouSupplyChainService.getCookie();
|
|
|
- if (Check.isNull(cookie)) {
|
|
|
+ List<JSONObject> cookies = ikuaishouSupplyChainService.getCookie();
|
|
|
+ if (Check.isNull(cookies)) {
|
|
|
log.error("cookie数据为空");
|
|
|
return;
|
|
|
}
|
|
@@ -299,7 +323,11 @@ public class KuaishouOrderLIstGetJob {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
Long orderCreateTimeStart = sdf.parse(start).getTime();
|
|
|
Long orderCreateTimeEnd = sdf.parse(end).getTime();
|
|
|
- ikuaishouSupplyChainService.getOrderList(cookie, 0, orderCreateTimeStart, orderCreateTimeEnd, itemMap);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|