Browse Source

1111

master
liupopo 2 years ago
parent
commit
5b043da55f
  1. 0
      warehousing-system/warehouse数据库设计文档_1.0.0.doc
  2. BIN
      yxt-supervise-cyf/docs/sheji/favicon_logosc.zip
  3. 2
      yxt-supervise-dbcenter/docs/databases/conf_brand_proportion.sql
  4. 6
      yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/CrawlTask.java
  5. 2
      yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/ZhjSpider.java
  6. 7
      yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/ZhjSpiderConfig.java
  7. 54
      yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/test/java/com/yxt/supervise/dbcenter/HttpUtilTester.java
  8. 6
      yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/test/java/com/yxt/supervise/dbcenter/YxtSuperviseDbcenterApplicationTests.java
  9. 37
      yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinventorylog/GdInventoryLog.java
  10. 24
      yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinventorylog/GdInventoryLogQuery.java
  11. 8
      yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinventorylog/GdInventoryLogVo.java
  12. 8
      yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdlinventorylog/GdIinventoryLog.java
  13. 8
      yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdlinventorylog/GdIinventoryLogVo.java

0
warehousing-system/warehouse数据库设计文档_1.0.0.doc

BIN
yxt-supervise-cyf/docs/sheji/favicon_logosc.zip

Binary file not shown.

2
yxt-supervise-dbcenter/docs/databases/conf_brand_proportion.sql

@ -22,7 +22,7 @@ SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
DROP TABLE IF EXISTS `conf_brand_proportion`;
CREATE TABLE `conf_brand_proportion` (
`id` int(11) NOT NULL COMMENT 'id',
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`brandSid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '品牌Sid',
`brandName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '品牌名称',
`typeName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '占比名称',

6
yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/CrawlTask.java

@ -27,13 +27,13 @@ public class CrawlTask {
* 描述 : 每天上午10点30分抓取数据并保存到数据库. <br/>
* <p>
*/
@Scheduled(cron = "0 30 10 * * ?")
@Scheduled(cron = "0 0 5 * * ?")
public void pullZhjData() {
String currDay = DateUtil.format(DateUtil.offsetDay(new Date(), -1), "yyyy-MM-dd");
String purchaseDay = DateUtil.format(DateUtil.offsetDay(new Date(), -2), "yyyy-MM-dd");
// String purchaseDay = DateUtil.format(DateUtil.offsetDay(new Date(), -2), "yyyy-MM-dd");
ThreadUtil.execute(() -> crawlSalesAmountService.pullData(currDay));
ThreadUtil.execute(() -> crawlSalesDishesService.pullData(currDay));
ThreadUtil.execute(() -> crawlPurchaseService.pullData(purchaseDay));
ThreadUtil.execute(() -> crawlPurchaseService.pullData(currDay));
}
}

2
yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/ZhjSpider.java

@ -173,7 +173,7 @@ public class ZhjSpider {
public static ZhjResp dopost(Map<String, Object> paramMap) {
HttpRequest request = ZhjSpiderConfig.fillHeaders(HttpRequest.post(url));
String result = request.form(paramMap).execute().body();
L.debug("param:{}######result:{}", paramMap.toString(), result);
L.info("param:{}######result:{}", paramMap.toString(), result);
ZhjResp bean = JSONUtil.toBean(result, ZhjResp.class);
return bean;
}

7
yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/ZhjSpiderConfig.java

@ -25,8 +25,9 @@ public class ZhjSpiderConfig {
private static void initHeaders() {
CACHE_HEADERS = new HashMap<>();
CACHE_HEADERS.put("cookie", "cna=QZ74GyioHjsCAWpxs/DlZflP; qbi_locale=zh-CN; x_login_pk=19b6a50a88ee4c8cbeacee4420345262; csrf_token=be21ee6f-fb65-4978-b58f-53bc1ad0e7a6; qbi_version=2; qbi_redirected=1; xlly_s=1; isg=BPn5lzNHubARqWVPDzIOHAr9CGXTBu24S0hh_Bss2SCfoho0YlOFiBw0JKZUGoXw");
CACHE_HEADERS.put("x-csrf-token", "be21ee6f-fb65-4978-b58f-53bc1ad0e7a6");
CACHE_HEADERS.put("x-gw-referer", "https://bi.aliyuncs.com/token3rd/dashboard/view/pc.htm?pageId=85c4af04-1910-4005-8e47-742af1acb713&accessToken=d8c021cd40ad94b2d500d12229b57c3e&dd_orientation=auto&qbi_version_param=2");
// CACHE_HEADERS.put("cookie", "cna=QZ74GyioHjsCAWpxs/DlZflP; qbi_locale=zh-CN; x_login_pk=19b6a50a88ee4c8cbeacee4420345262; xlly_s=1; qbi_version=1; qbi_redirected=1; csrf_token=f66e628f-d681-4be5-855e-56e77886e002; isg=BIqKYOxE2qEZjVZawN-NAZ2Y23Asew7V-iD6yBTCI11JxyuB_Q3P5fXx1zMbN4Zt");
CACHE_HEADERS.put("x-csrf-token", "f66e628f-d681-4be5-855e-56e77886e002");
CACHE_HEADERS.put("x-gw-referer", "https://bi.aliyuncs.com/token3rd/dashboard/view/pc.htm?pageId=85c4af04-1910-4005-8e47-742af1acb713&accessToken=d8c021cd40ad94b2d500d12229b57c3e&dd_orientation=auto&qbi_version_param=1");
// CACHE_HEADERS.put("x-gw-referer", "https://bi.aliyuncs.com/token3rd/dashboard/view/pc.htm?pageId=85c4af04-1910-4005-8e47-742af1acb713&accessToken=d8c021cd40ad94b2d500d12229b57c3e&dd_orientation=auto");
}
}

54
yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/test/java/com/yxt/supervise/dbcenter/HttpUtilTester.java

@ -0,0 +1,54 @@
package com.yxt.supervise.dbcenter;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.yxt.supervise.dbcenter.zhj.crawl.ZhjSpiderConfig;
import com.yxt.supervise.dbcenter.zhj.crawl.spider.ZhjResp;
import org.junit.jupiter.api.Test;
import java.net.HttpCookie;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class HttpUtilTester {
private static String olapQueryParam_salesAmount = "{\"componentId\":\"52dece2d-ba6d-452e-8497-f94baff096c4\",\"componentName\":\"指标看板-熟溢香支付方式_knief\",\"configs\":[{\"type\":\"field\",\"config\":{\"fields\":[{\"guid\":\"31ce439f-747c-45d0-8f35-51fe9daea91e\",\"fid\":\"5805bc15e1\",\"areaType\":\"row\"},{\"guid\":\"6e8c6afd-038a-4644-85c1-ffb813dc8614\",\"fid\":\"fa1b7a0d21\",\"areaType\":\"column\",\"aggregate\":\"sum\"}]},\"cubeId\":\"90bb4e6c-c315-465b-9c3b-74a22a0d84e6\"},{\"type\":\"paging\",\"cubeId\":\"90bb4e6c-c315-465b-9c3b-74a22a0d84e6\",\"config\":{\"limit\":1000,\"offset\":0,\"pagedByAllDim\":true}},{\"type\":\"beforeAggregateCondition\",\"cubeId\":\"90bb4e6c-c315-465b-9c3b-74a22a0d84e6\",\"config\":{\"logicalOperator\":\"AND\",\"conditions\":[{\"field\":{\"fid\":\"3fd928d207\"},\"functionalOperator\":\"in\",\"args\":[{\"valueType\":\"string\",\"value\":\"POS点餐\"},{\"valueType\":\"string\",\"value\":\"会员充值\"},{\"valueType\":\"string\",\"value\":\"扫码点餐\"},{\"valueType\":\"string\",\"value\":\"美团外卖点餐\"},{\"valueType\":\"string\",\"value\":\"饿了么外卖点餐\"}]},{\"logicalOperator\":\"AND\",\"conditions\":[{\"field\":{\"fid\":\"15784307a1\",\"dateTrunc\":\"day\"},\"functionalOperator\":\"greaterThanOrEqual\",\"args\":[{\"valueType\":\"string\",\"value\":\"VAR_DATE_STR\"}]},{\"field\":{\"fid\":\"15784307a1\",\"dateTrunc\":\"day\"},\"functionalOperator\":\"lessThanOrEqual\",\"args\":[{\"valueType\":\"string\",\"value\":\"VAR_DATE_STR\"}]}]}]}},{\"type\":\"queryConfig\",\"cubeId\":\"90bb4e6c-c315-465b-9c3b-74a22a0d84e6\",\"config\":{\"needCount\":false,\"queryCount\":false,\"queryDetail\":false}},{\"type\":\"advancedParam\",\"cubeId\":\"90bb4e6c-c315-465b-9c3b-74a22a0d84e6\",\"config\":{\"autoInsightParam\":{\"enable\":false},\"wordCloudParam\":{},\"summarizeParams\":[],\"trendLineParams\":[],\"forecastParams\":[],\"anomalyDetectionParams\":[],\"clusteringParams\":[],\"groupParam\":null}},{\"type\":\"annotationParam\",\"cubeId\":\"90bb4e6c-c315-465b-9c3b-74a22a0d84e6\",\"config\":{\"measureThresholdParams\":[],\"inflectionPointParams\":[]}}],\"dataType\":\"general\",\"reportId\":\"85c4af04-1910-4005-8e47-742af1acb713\"}";
private static String reportId = "85c4af04-1910-4005-8e47-742af1acb713";
private static String urla = "https://bi.aliyuncs.com/api/v2/biPlatform/query/byQueryParam";
@Test
void sptest() {
String url = "https://bi.aliyuncs.com/token3rd/dashboard/view/pc.htm?pageId=85c4af04-1910-4005-8e47-742af1acb713&accessToken=d8c021cd40ad94b2d500d12229b57c3e&dd_orientation=auto";
HttpRequest request = HttpRequest.get(url);
HttpResponse execute = request.execute();
Map<String,String> mm = new HashMap<>();
List<HttpCookie> cookies = execute.getCookies();
for (HttpCookie c : cookies ) {
String name = c.getName();
String value = c.getValue();
mm.put(name,value);
}
System.out.println();
String olapQueryParam = olapQueryParam_salesAmount.replace("VAR_DATE_STR", "2023-055-13");
String componentId = "52dece2d-ba6d-452e-8497-f94baff096c4";
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("olapQueryParam", olapQueryParam);
paramMap.put("componentId", componentId);
paramMap.put("reportId", reportId);
paramMap.put("componentType", "66");
String result = HttpRequest.post(urla)
.header("cookie", "cna=QZ74GyioHjsCAWpxs/DlZflP; qbi_locale=zh-CN; x_login_pk="+mm.get("x_login_pk")+"; qbi_version=1; csrf_token=hello123456")
.header("x-csrf-token", "hello123456")
.header("x-gw-referer", "https://bi.aliyuncs.com/token3rd/dashboard/view/pc.htm?pageId=85c4af04-1910-4005-8e47-742af1acb713&accessToken=d8c021cd40ad94b2d500d12229b57c3e&dd_orientation=auto&qbi_version_param=1")
.form(paramMap).execute().body();
System.out.println( result);
}
}

6
yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/test/java/com/yxt/supervise/dbcenter/YxtSuperviseDbcenterApplicationTests.java

@ -24,10 +24,10 @@ class YxtSuperviseDbcenterApplicationTests {
@Test
void contextLoads() {
String currDay = "2023-05-11";
String currDay = "2023-05-13";
// crawlSalesAmountService.pullData(currDay);
crawlSalesDishesService.pullData(currDay);
crawlSalesAmountService.pullData(currDay);
// crawlSalesDishesService.pullData(currDay);
// crawlPurchaseService.pullData(currDay);
}

37
yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinventorylog/GdInventoryLog.java

@ -0,0 +1,37 @@
package com.yxt.supervise.customer.api.gdinventorylog;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yxt.common.core.domain.EntityWithId;
import lombok.Data;
import java.util.Date;
/**
* @author wangpengfei
* @date 2023/4/24 13:45
*/
@Data
@TableName("gd_inventory_log")
public class GdInventoryLog extends EntityWithId {
public GdInventoryLog() {
}
public GdInventoryLog(String fileFullPath) {
this.fileFullPath = fileFullPath;
}
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime = new Date(); // 记录创建时间/
private String remarks; // 备注说明/
private String fileFullPath; // 文件完整路径/
private String outFilePath; // 汇总文件路径
// private String outfile; //输出文件名
private String fileUrl; //文件下载地址
private int allNum; // 总记录数/
private int validNum; // 有效记录数/
private long durations; // 程序运行时长/
private int errRowNum; // 出错的条数/
private String orderDate; // 单据日期
}

24
yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinventorylog/GdInventoryLogQuery.java

@ -0,0 +1,24 @@
package com.yxt.supervise.customer.api.gdinventorylog;
import com.yxt.common.core.query.Query;
public class GdInventoryLogQuery implements Query {
private String dataDateStart; // 数据日期
private String dataDateEnd; // 数据日期
public String getDataDateStart() {
return dataDateStart;
}
public void setDataDateStart(String dataDateStart) {
this.dataDateStart = dataDateStart;
}
public String getDataDateEnd() {
return dataDateEnd;
}
public void setDataDateEnd(String dataDateEnd) {
this.dataDateEnd = dataDateEnd;
}
}

8
yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinventorylog/GdInventoryLogVo.java

@ -0,0 +1,8 @@
package com.yxt.supervise.customer.api.gdinventorylog;
/**
* @author wangpengfei
* @date 2023/4/24 13:46
*/
public class GdInventoryLogVo {
}

8
yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdlinventorylog/GdIinventoryLog.java

@ -1,8 +0,0 @@
package com.yxt.supervise.customer.api.gdlinventorylog;
/**
* @author wangpengfei
* @date 2023/4/24 13:45
*/
public class GdIinventoryLog {
}

8
yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdlinventorylog/GdIinventoryLogVo.java

@ -1,8 +0,0 @@
package com.yxt.supervise.customer.api.gdlinventorylog;
/**
* @author wangpengfei
* @date 2023/4/24 13:46
*/
public class GdIinventoryLogVo {
}
Loading…
Cancel
Save