|
@@ -1,3 +1,4 @@
|
|
|
+
|
|
|
package org.jeecg.modules.ctop.controller;
|
|
|
|
|
|
import cn.com.ctop.common.module.entity.CtopOauthToken;
|
|
@@ -137,7 +138,8 @@ public class TestController {
|
|
|
|
|
|
@Autowired
|
|
|
private IBatchService batchService;
|
|
|
- static ExecutorService videoService = Executors.newFixedThreadPool(10);
|
|
|
+ static ExecutorService videoService = Executors.newFixedThreadPool(3);
|
|
|
+ static ExecutorService jy = Executors.newFixedThreadPool(2);
|
|
|
@Autowired
|
|
|
private IMaterialUploadService materialUploadService;
|
|
|
@Autowired
|
|
@@ -145,7 +147,7 @@ public class TestController {
|
|
|
@Autowired
|
|
|
private IRefreshTokenService refreshTokenService;
|
|
|
@Autowired
|
|
|
- private IKuaishouSupplyChainService ikuaishouSupplyChainService;
|
|
|
+ private IMgsSupplyChainService ikuaishouSupplyChainService;
|
|
|
@Autowired
|
|
|
private IWechatCheckinDataService wechatCheckinDataService;
|
|
|
@Autowired
|
|
@@ -158,33 +160,118 @@ public class TestController {
|
|
|
@Autowired
|
|
|
private IJiaoYangFenXiaoService jiaoYangFenXiaoService;
|
|
|
|
|
|
- public static void main(String[] args) {
|
|
|
- List<String> days = DateUtils.getDays("2023-08-01", "2023-09-25");
|
|
|
- System.err.println(days);
|
|
|
- }
|
|
|
+ @Autowired
|
|
|
+ private IKuaishouSupplyChainService kuaishouSupplyChainService;
|
|
|
|
|
|
|
|
|
+ /* public static void main(String[] args) {
|
|
|
+ List<JSONObject> cookies = kuaishouSupplyChainService.getCookie();
|
|
|
+ if (Check.isNull(cookies)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0; i < cookies.size(); i++) {
|
|
|
+ JSONObject jsonObject = cookies.get(i);
|
|
|
+ String cookie = jsonObject.getString("cookie");
|
|
|
+ kuaishouSupplyChainService.getRuiXuanCcrInfo(cookie, 100, "ruixuan");
|
|
|
+
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+
|
|
|
|
|
|
@GetMapping(value = "/getData")
|
|
|
public void getDate(String startDate, String endDate) throws Exception {
|
|
|
|
|
|
- String cookie = jiaoYangFenXiaoService.getCookieById(341063986L);
|
|
|
- if (Check.isNull(cookie)) {
|
|
|
+ log.info("-------------------------获取快分销订单当前月数据开始数据开始--------------------------");
|
|
|
+ List<JSONObject> cookies = ikuaishouSupplyChainService.getCookie();
|
|
|
+ if (Check.isNull(cookies)) {
|
|
|
log.error("cookie数据为空");
|
|
|
return;
|
|
|
}
|
|
|
- String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
|
|
|
- Long statDate = Long.valueOf(nowDate.replace("-", ""));
|
|
|
- List<JSONObject> accountList = jiaoYangFenXiaoService.getAccountList();
|
|
|
- for (int i = 0; i < accountList.size(); i++) {
|
|
|
- JSONObject jsonObject = accountList.get(i);
|
|
|
- Long id = jsonObject.getLong("id");
|
|
|
- String name = jsonObject.getString("name");
|
|
|
- jiaoYangFenXiaoService.getItemTop(cookie,statDate, id, name, 0);
|
|
|
+
|
|
|
+ List<String> days = DateUtils.getDays("2024-02-25", "2024-03-05");
|
|
|
+ JSONArray hourList = KuaishouHourEnum.getHourList();
|
|
|
+ JSONArray minSecList = KuaishouMinSecEnum.getMinSecList();
|
|
|
+ Map<Long, Long> itemMap = activityItemListService.getItemMap();
|
|
|
+ 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");
|
|
|
+ videoService.submit(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ try {
|
|
|
+ ikuaishouSupplyChainService.getOrderList(cookie, 0, orderCreateTimeStart, orderCreateTimeEnd, itemMap);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @GetMapping(value = "/getJyData")
|
|
|
+ public void getJyData() throws Exception {
|
|
|
+
|
|
|
+ log.info("-------------------------获取快分销订单当前月数据开始数据开始--------------------------");
|
|
|
+ List<JSONObject> cookies = jiaoYangFenXiaoService.getCookie();
|
|
|
+ if (Check.isNull(cookies)) {
|
|
|
+ log.error("cookie数据为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ List<String> days = DateUtils.getDays("2023-12-01", "2024-02-28");
|
|
|
+ JSONArray hourList = KuaishouHourEnum.getHourList();
|
|
|
+ JSONArray minSecList = KuaishouMinSecEnum.getMinSecList();
|
|
|
+
|
|
|
+ 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");
|
|
|
+ jy.submit(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ try {
|
|
|
+ jiaoYangFenXiaoService.getOrderList(cookie, 0, orderCreateTimeStart, orderCreateTimeEnd);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@GetMapping(value = "/getSettlementData")
|
|
|
public void getsettlementData(String startDay, String endDay) throws Exception {
|
|
|
List<String> days = DateUtils.getDays(startDay, endDay);
|