lengfaqiang пре 2 година
родитељ
комит
0955d340fa
100 измењених фајлова са 3371 додато и 899 уклоњено
  1. 0 1
      slope-common/pom.xml
  2. 0 77
      slope-common/slope-common-bom/pom.xml
  3. 4 2
      slope-common/slope-common-core/pom.xml
  4. 15 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/EnvConstant.java
  5. 67 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/enums/AliyunOssFileTypeEnum.java
  6. 116 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/enums/DictEnum.java
  7. 57 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/enums/DictTypeEnum.java
  8. 56 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/enums/FileDisposeLayoutEnum.java
  9. 78 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/enums/FileEnum.java
  10. 12 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/exception/GlobalSystemExceptionHandler.java
  11. 29 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/exception/NotLoginException.java
  12. 69 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/auth/AbstractLoginUser.java
  13. 47 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/auth/LoginBase.java
  14. 52 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/auth/LoginEnterpriseInfo.java
  15. 74 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/auth/LoginUserInfo.java
  16. 39 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/auth/UserAccessMenuInfo.java
  17. 27 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/auth/context/AbstractLoginContext.java
  18. 95 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/auth/context/LoginEnterpriseHolder.java
  19. 140 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/auth/context/LoginUserHolder.java
  20. 38 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/auth/context/SignBase.java
  21. 40 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/AddressDefaultTypeEnum.java
  22. 42 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ApprovalEnum.java
  23. 52 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/BannerDistrictEnum.java
  24. 186 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CarWaybillEnum.java
  25. 164 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CarWaybillQueryEnum.java
  26. 45 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CertificateTypeEnum.java
  27. 37 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ChargingTypeEnum.java
  28. 59 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ClientTypeEnum.java
  29. 39 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ContractStatusEnum.java
  30. 38 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ContractTrackEnum.java
  31. 36 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CooperateApplyTypeEnum.java
  32. 44 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CooperateStatusEnum.java
  33. 40 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CooperateTypeEnum.java
  34. 84 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/EntTypeEnum.java
  35. 35 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/EntryTypeEnum.java
  36. 64 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/GlobalTransactionalEnum.java
  37. 44 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/LoginMethodEnum.java
  38. 184 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/LogisticsOrderEnum.java
  39. 36 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/MenuTypeEnum.java
  40. 62 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/OrderRuleEnum.java
  41. 68 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ProjectStatusEnum.java
  42. 62 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/RedisOrderGenerateEnum.java
  43. 35 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/SigningWayEnum.java
  44. 36 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/SystemTypeEnum.java
  45. 49 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/TaxRateTypeEnum.java
  46. 82 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/file/FileInfo.java
  47. 1 2
      slope-common/slope-common-core/src/main/java/com/sckw/core/utils/LocUtils.java
  48. 226 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/utils/OrderGenerateSeqNoUtils.java
  49. 57 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/utils/OrderGenerateUtils.java
  50. 31 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/utils/OrderUtils.java
  51. 2 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/utils/PasswordUtils.java
  52. 1 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/utils/RegularUtils.java
  53. 2 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/utils/workerUtils.java
  54. 0 34
      slope-common/slope-common-core/src/main/java/com/sckw/core/web/config/CustomConfig.java
  55. 0 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/web/config/GlobalTransactionalConfig.java
  56. 2 1
      slope-common/slope-common-core/src/main/java/com/sckw/core/web/request/HttpClientUtil.java
  57. 0 1
      slope-common/slope-common-core/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  58. 8 2
      slope-common/slope-common-datasource/pom.xml
  59. 1 0
      slope-common/slope-common-excel/pom.xml
  60. 1 1
      slope-common/slope-common-excel/src/main/java/com/sckw/excel/config/easyexcel/CustomCellWeightWeightConfig.java
  61. 0 50
      slope-common/slope-common-excel/src/main/java/com/sckw/excel/translate/SourceUtil.java
  62. 0 20
      slope-common/slope-common-excel/src/main/java/com/sckw/excel/translate/Sources.java
  63. 0 117
      slope-common/slope-common-excel/src/main/java/com/sckw/excel/translate/Translator.java
  64. 0 43
      slope-common/slope-common-excel/src/main/java/com/sckw/excel/translate/annotation/Translate.java
  65. 0 21
      slope-common/slope-common-excel/src/main/java/com/sckw/excel/translate/annotation/Translates.java
  66. 0 72
      slope-common/slope-common-excel/src/main/java/com/sckw/excel/translate/context/Enums.java
  67. 0 87
      slope-common/slope-common-excel/src/main/java/com/sckw/excel/translate/context/Organization.java
  68. 0 48
      slope-common/slope-common-excel/src/main/java/com/sckw/excel/translate/context/Source.java
  69. 0 55
      slope-common/slope-common-excel/src/main/java/com/sckw/excel/translate/enums/Source.java
  70. 0 40
      slope-common/slope-common-excel/src/main/java/com/sckw/excel/translate/properties/TranslateProperties.java
  71. 0 87
      slope-common/slope-common-excel/src/main/java/com/sckw/excel/translate/wrapper/AbstractTranslator.java
  72. 0 87
      slope-common/slope-common-excel/src/main/java/com/sckw/excel/translate/wrapper/TranslateWrapper.java
  73. 1 0
      slope-common/slope-common-log/pom.xml
  74. 1 0
      slope-common/slope-common-redis/pom.xml
  75. 1 0
      slope-common/slope-common-remote/pom.xml
  76. 2 2
      slope-common/slope-common-sms/pom.xml
  77. 1 0
      slope-common/slope-common-stream/pom.xml
  78. 1 0
      slope-common/slope-common-tdengine/pom.xml
  79. 1 0
      slope-common/slope-common-xxljob/pom.xml
  80. 1 1
      slope-common/slope-common-xxljob/src/main/java/com/sckw/xxljob/config/XxlJobAutoConfiguration.java
  81. 0 0
      slope-common/slope-common-xxljob/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  82. 4 4
      slope-modules-api/pom.xml
  83. 45 0
      slope-modules/slope-detection/pom.xml
  84. 1 1
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/SlopeDetectionApplication.java
  85. 19 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/common/config/DB.java
  86. 21 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/common/config/DynamicDataSource.java
  87. 40 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/common/config/DynamicDataSourceAspect.java
  88. 35 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/common/config/DynamicDataSourceSwitcher.java
  89. 53 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/common/config/MultipleDataSourceConfig.java
  90. 25 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/TdengineDemoController.java
  91. 2 2
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwtLogisticsOrderMapper.java
  92. 20 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/tdengine/SlopeDataMapper.java
  93. 1 1
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwtLogisticsOrder.java
  94. 21 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/tdengine/SlopeData.java
  95. 1 1
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/MysqlDemoService.java
  96. 23 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/TdengineDemoService.java
  97. 1 0
      slope-modules/slope-detection/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  98. 38 38
      slope-modules/slope-detection/src/main/resources/bootstrap-local.yml
  99. 1 0
      slope-modules/slope-detection/src/main/resources/bootstrap.yml
  100. 1 1
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwtLogisticsOrderMapper.xml

+ 0 - 1
slope-common/pom.xml

@@ -12,7 +12,6 @@
     <artifactId>slope-common</artifactId>
     <packaging>pom</packaging>
     <modules>
-        <module>slope-common-bom</module>
         <module>slope-common-core</module>
         <module>slope-common-xxljob</module>
         <module>slope-common-stream</module>

+ 0 - 77
slope-common/slope-common-bom/pom.xml

@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>com.sckw</groupId>
-        <artifactId>slope-common</artifactId>
-        <version>1.0.0</version>
-    </parent>
-
-    <groupId>com.sckw</groupId>
-    <artifactId>slope-common-bom</artifactId>
-    <version>1.0.0</version>
-    <packaging>pom</packaging>
-    <description>common依赖项</description>
-
-
-    <properties>
-        <maven.compiler.source>17</maven.compiler.source>
-        <maven.compiler.target>17</maven.compiler.target>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    </properties>
-    <dependencyManagement>
-        <dependencies>
-            <!-- 核心模块 -->
-            <dependency>
-                <groupId>com.sckw</groupId>
-                <artifactId>slope-common-startup</artifactId>
-                <version>${project.version}</version>
-            </dependency>
-
-            <dependency>
-                <groupId>com.sckw</groupId>
-                <artifactId>slope-common-core</artifactId>
-                <version>${project.version}</version>
-            </dependency>
-
-            <dependency>
-                <groupId>com.sckw</groupId>
-                <artifactId>slope-common-xxljob</artifactId>
-                <version>${project.version}</version>
-            </dependency>
-
-            <dependency>
-                <groupId>com.sckw</groupId>
-                <artifactId>slope-common-stream</artifactId>
-                <version>${project.version}</version>
-            </dependency>
-
-            <dependency>
-                <groupId>com.sckw</groupId>
-                <artifactId>slope-common-remote</artifactId>
-                <version>${project.version}</version>
-            </dependency>
-
-            <dependency>
-                <groupId>com.sckw</groupId>
-                <artifactId>slope-common-redis</artifactId>
-                <version>${project.version}</version>
-            </dependency>
-
-            <dependency>
-                <groupId>com.sckw</groupId>
-                <artifactId>slope-common-excel</artifactId>
-                <version>${project.version}</version>
-            </dependency>
-
-            <dependency>
-                <groupId>com.sckw</groupId>
-                <artifactId>slope-common-datasource</artifactId>
-                <version>${project.version}</version>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
-</project>

+ 4 - 2
slope-common/slope-common-core/pom.xml

@@ -10,12 +10,13 @@
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>slope-common-core</artifactId>
-<!--    <version>1.0.0</version>-->
+    <version>1.0.0</version>
     <description>核心基础</description>
 
     <properties>
         <maven.compiler.source>17</maven.compiler.source>
         <maven.compiler.target>17</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>
 
     <dependencies>
@@ -153,7 +154,8 @@
 
         <dependency>
             <groupId>com.sckw</groupId>
-            <artifactId>sckw-common-redis</artifactId>
+            <artifactId>slope-common-redis</artifactId>
+            <version>1.0.0</version>
         </dependency>
 
         <!--mybatis-plus 依赖-->

+ 15 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/EnvConstant.java

@@ -0,0 +1,15 @@
+package com.sckw.core.common.enums;
+
+/**
+ * @desc: 环境常量
+ * @author: yzc
+ * @date: 2023-09-28 17:14
+ */
+public class EnvConstant {
+
+    public static final String LOCAL = "local";
+    public static final String DEV = "dev";
+    public static final String TEST = "test";
+    public static final String PROD = "prod";
+
+}

+ 67 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/enums/AliyunOssFileTypeEnum.java

@@ -0,0 +1,67 @@
+package com.sckw.core.common.enums.enums;
+
+/**
+ * @author lfdc
+ * @version 1.0
+ * @className AliyunOssFileTypeEnum
+ * @description 阿里云文件类型
+ * @company sckw
+ * @date 2023-06-05 13:06:54
+ */
+public enum AliyunOssFileTypeEnum {
+    BMP(".bmp","image/bmp"),
+    GIF(".gif","image/gif"),
+    JPEG(".jpeg","image/jpeg"),
+    JPG(".jpg","image/jpeg"),
+    PNG(".png","image/jpeg"),
+    HTML(".html","text/html"),
+    XML(".xml","text/xml"),
+    TXT(".txt","application/octet-stream"),
+    SQL(".sql","application/octet-stream"),
+    VSD(".vsd","application/vnd.visio"),
+    PDF(".pdf","application/pdf"),
+    PPT(".ppt","application/vnd.ms-powerpoint"),
+    PPTX(".pptx","application/vnd.ms-powerpoint"),
+    DOC(".doc","application/msword"),
+    DOCX(".docx","application/msword"),
+    XLS(".xls","application/vnd.ms-excel"),
+    XLSX(".xlsx","application/vnd.ms-excel"),
+    CSV(".csv","application/vnd.ms-excel");
+
+
+    String code;
+
+
+    String text;
+
+
+    AliyunOssFileTypeEnum() {
+    }
+
+
+    AliyunOssFileTypeEnum(String code, String text) {
+        this.code = code;
+        this.text = text;
+    }
+
+
+    public String getCode() {
+        return code;
+    }
+
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+
+    public String getText() {
+        return text;
+    }
+
+
+    public void setText(String text) {
+        this.text = text;
+    }
+
+}

+ 116 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/enums/DictEnum.java

@@ -0,0 +1,116 @@
+package com.sckw.core.common.enums.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @author lfdc
+ * @description 枚举字典
+ * @date 2023-07-07 14:07:23
+ */
+@Getter
+@AllArgsConstructor
+public enum DictEnum {
+    /**
+     *
+     */
+    SYSTEM_MSG("msg_category", "SYSTEM", "系统消息"),
+    BUSINESS_MSG("msg_category", "BUSINESS", "业务消息"),
+    SMS_REGISTER("send_sms_type", "register", "短信注册"),
+    SMS_LOGIN("send_sms_type", "login", "短信登录"),
+    SMS_UPDATE_PASSWORD("send_sms_type", "updatePassword", "短信修改密码"),
+    PRICE_TYPE_0("price_type", "0", "元/吨"),
+    PRICE_TYPE_1("price_type", "1", "元/车"),
+    WEIGHT_CAR_0("weight_car", "0", "吨/车"),
+    WEIGHT_CAR_1("weight_car", "1", "公斤/车"),
+    TRANSPORT_TYPE_0("transport_type", "0", "公斤/车"),
+    TRANSPORT_TYPE_1("transport_type", "1", "吨/车"),
+    UNIT_TYPE_0("unit_type","0", "吨"),
+    UNIT_TYPE_1("unit_type","1", "方"),
+    UNIT_TYPE_2("unit_type","2", "箱"),
+    UNIT_TYPE_3("unit_type","3", "件"),
+    UNIT_TYPE_4("unit_type","4", "其他"),
+    TAX_RATE_0("tax_rate","13", "13%"),
+    TAX_RATE_1("tax_rate","11", "11%"),
+    TAX_RATE_2("tax_rate","10", "10%"),
+    TRADE_TYPE_01("trade_type", "11", "预付款-汇付"),
+    TRADE_TYPE_02("trade_type", "12", "预付款-新生"),
+    TRADE_TYPE_03("trade_type", "13", "预付款-中信"),
+    TRADE_TYPE_1("trade_type", "2", "货到付款"),
+    TRADE_TYPE_2("trade_type", "3", "线下付款"),
+    PICKUP_TYPE_0("pickup_type", "0", "供应配送"),
+    PICKUP_TYPE_1("pickup_type", "1", "采方自提"),
+    DELIVERY_TYPE_0("delivery_type", "0", "签发交付"),
+    DELIVERY_TYPE_1("delivery_type", "1", "签收交付"),
+    TORDER_SOURCE_1("tOrder_source", "1", "采购下单"),
+    TORDER_SOURCE_2("tOrder_source", "2", "代客下单"),
+    TORDER_STATUS_0("tOrder_status", "0", "已保存"),
+    TORDER_STATUS_1("tOrder_status", "1", "待受理"),
+    TORDER_STATUS_2("tOrder_status", "2", "已退回"),
+    TORDER_STATUS_3("tOrder_status", "3", "待签约"),
+    TORDER_STATUS_4("tOrder_status", "4", "执行中"),
+    TORDER_STATUS_5("tOrder_status", "5", "已完结"),
+    TORDER_STATUS_6("tOrder_status", "6", "已对账"),
+    TORDER_STATUS_7("tOrder_status", "7", "已结算"),
+    CONTRACT_STATUS_0("contract_status", "1", "待签约"),
+    CONTRACT_STATUS_1("contract_status", "0", "已签约"),
+    SETTLEMENT_CYCLE_0("settlement_cycle", "0", "周结"),
+    SETTLEMENT_CYCLE_1("settlement_cycle", "1", "月结"),
+    SETTLEMENT_CYCLE_2("settlement_cycle", "2", "季结"),
+    SIGNING_TYPE_1("signing_type", "1", "线上签约"),
+    SIGNING_TYPE_2("signing_type", "2", "线下签约"),
+    TORDER_ADDRESS_TYPE_1("tOrder_address_type", "1", "装货地址"),
+    TORDER_ADDRESS_TYPE_2("tOrder_address_type", "2", "卸货地址"),
+    TORDER_UNIT_TYPE_1("tOrder_unit_type", "1", "采购单位"),
+    TORDER_UNIT_TYPE_2("tOrder_unit_type", "2", "销售单位"),
+    ADDRESS_TYPE_0("address_type", "0", "矿山"),
+    INDUSTRY_TYPE_0("industry_type", "0", "砂石"),
+    CLASSIFICATION_TYPE_0("classification_type", "0", "石料"),
+    CATEGORY_TYPE_0("category_type", "0", "山砂"),
+    PRODUCT_NAME_TYPE_0("product_name_type", "0", "毛石"),
+    GOODS_STATUS_0("goods_status", "0", "已保存"),
+    GOODS_STATUS_1("goods_status", "1", "上架中"),
+    GOODS_STATUS_2("goods_status", "2", "已下架"),
+    CHARGING_TYPE_1("charging_type", "1", "按装货量") ,
+    CHARGING_TYPE_2("charging_type", "2", "按卸货量") ,
+    CHARGING_TYPE_3("charging_type", "3", "按车次"),
+    SIGNING_WAY_1("signing_way", "1", "线上签约"),
+    SIGNING_WAY_2("signing_way", "2", "线下签约"),
+    TRANSPORT_DEMAND_STATUS_0("transport_demand_status", "0","已保存"),
+    TRANSPORT_DEMAND_STATUS_1("transport_demand_status", "1","上架中"),
+    TRANSPORT_DEMAND_STATUS_2("transport_demand_status", "2","已下架"),
+    WANT_BUY_STATUS_0("want_buy_status", "0","已保存"),
+    WANT_BUY_STATUS_1("want_buy_status", "1","上架中"),
+    WANT_BUY_STATUS_2("want_buy_status", "2","已下架"),
+    PREPAID_LIMIT_NO("prepaid_limit", "0","否"),
+    PREPAID_LIMIT_YES("prepaid_limit", "1","是"),
+    ;
+
+    private final String type;
+    private final String value;
+    private final String label;
+
+    public static String getLabel(String type, String value) {
+        for (DictEnum dict : DictEnum.values()) {
+            if (dict.getType().equals(type) && dict.getValue().equals(value)) {
+                return dict.getLabel();
+            }
+        }
+        return null;
+    }
+    public static List<DictEnum> getEnumsByType(String type) {
+        List<DictEnum> list = new ArrayList<>();
+        for (DictEnum dict : DictEnum.values()) {
+            if (dict.getType().equals(type) ) {
+                list.add(dict);
+            }
+        }
+        return list.stream().sorted(Comparator.comparing(DictEnum::getValue)).collect(Collectors.toList());
+    }
+
+}

+ 57 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/enums/DictTypeEnum.java

@@ -0,0 +1,57 @@
+package com.sckw.core.common.enums.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @desc: 字典类型枚举
+ * @author: yzc
+ * @date: 2023-07-10 16:46
+ */
+@Getter
+@AllArgsConstructor
+public enum DictTypeEnum {
+    MSG_CATEGORY("msg_category", "消息分类"),
+    MSG_STATUS("msg_status", "消息状态"),
+    SEND_SMS_TYPE("send_sms_type", "发送短信类型"),
+    INTEGRAL_TYPE("integral_type", "积分类型"),
+    UNIT_TYPE("unit_type", "商品单位类型"),
+    TAX_RATE("tax_rate", "商品税率"),
+    PRICE_TYPE("price_type", "运价方式"),
+    TRADE_TYPE("trade_type", "支付方式"),
+    PICKUP_TYPE("pickup_type", "提货方式"),
+    DELIVERY_TYPE("delivery_type", "交付类型"),
+    TORDER_SOURCE("tOrder_source", "交易订单来源"),
+    TRANSPORT_TYPE("transport_type", "运输方式"),
+    TORDER_STATUS("tOrder_status", "交易订单状态"),
+    CONTRACT_STATUS("contract_status", "合同状态"),
+    TORDER_ADDRESS_TYPE("tOrder_address_type", "交易订单地址类型"),
+    TORDER_UNIT_TYPE("tOrder_unit_type", "交易订单单位类型"),
+    ADDRESS_TYPE("address_type", "地址类型"),
+    INDUSTRY_TYPE("industry_type", "行业类型"),
+    SETTLEMENT_CYCLE("settlement_cycle", "结算周期"),
+    SIGNING_TYPE("signing_type", "签约方式"),
+    CLASSIFICATION_TYPE("classification_type", "分类类型"),
+    CATEGORY_TYPE("category_type", "类别类型"),
+    PRODUCT_NAME_TYPE("product_name_type", "品名类型"),
+    GOODS_STATUS("goods_status", "商品状态"),
+    CHARGING_TYPE("charging_type", "计费方式") ,
+    COLOR_TYPE("color_type", "车辆颜色"),
+    ENERGY_TYPE("energy_type", "能源类型"),
+    TRUCK_TYPE("truck_type", "车辆类型"),
+    USE_TYPE("use_type", "使用性质"),
+    APPROVED_DRIVING("approved_driving", "准驾车型"),
+    SIGNING_WAY("signing_way", "签约方式"),
+    WEIGHT_CAR("weight_car", "以车的限重"),
+    TAX_RATE_TYPE("tax_rate_type", "合理损耗单位"),
+    TRANSPORT_DEMAND_STATUS("transport_demand_status", "运需状态"),
+    PREPAID_LIMIT("prepaid_limit", "预付限额"),
+    WANT_BUY_STATUS("want_buy_status", "求购状态"),
+    ORDER_SOURCE("order_source", "订单来源"),
+    ;
+
+    private final String type;
+    private final String name;
+
+
+}

+ 56 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/enums/FileDisposeLayoutEnum.java

@@ -0,0 +1,56 @@
+package com.sckw.core.common.enums.enums;
+
+/**
+ * @author lfdc
+ * @description 文件格式布局枚举
+ * @date 2023-10-07 09:10:42
+ */
+public enum FileDisposeLayoutEnum {
+
+    /**
+     * ?x-oss-process=image/resize,m_lfit,h_200,w_200
+     *
+     * 图片格式只能是:JPG、PNG、BMP、GIF、WebP、TIFF。
+     */
+
+    /**
+     * oss裁剪比例大小-左
+     */
+    OSS_ABBREVIATE_LEFT(FileEnum.FILE_STORE_TYPE_OSS.getFileType(), "?x-oss-process=image/resize,m_lfit,h_", "OSS设置文件大小"),
+
+    /**
+     * oss裁剪比例大小-右
+     */
+    OSS_ABBREVIATE_RIGHT(FileEnum.FILE_STORE_TYPE_OSS.getFileType(), ",w_", "OSS设置文件大小"),
+    /**
+     * oss按照比例缩放
+     */
+    OSS_LESSEN(FileEnum.FILE_STORE_TYPE_OSS.getFileType(), "?x-oss-process=image/resize,p_", "按百分比缩放"),
+    /**
+     * 七牛云缩略图
+     */
+    KODO_ABBREVIATE(FileEnum.FILE_STORE_TYPE_ALIYUN.getFileType(), "-indexthumb", "缩略图"),
+    ;
+
+    private final String type;
+    private final String parameter;
+    private final String description;
+
+    public String getType() {
+        return type;
+    }
+
+    public String getParameter() {
+        return parameter;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    FileDisposeLayoutEnum(String type, String parameter, String description) {
+        this.type = type;
+        this.parameter = parameter;
+        this.description = description;
+    }
+}

+ 78 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/enums/FileEnum.java

@@ -0,0 +1,78 @@
+package com.sckw.core.common.enums.enums;
+/**
+ * @author lfdc
+ * @version 1.0
+ * @className FileEnum
+ * @description 文件上传保存地址
+ * @company sckw
+ * @date 2023-06-02 16:06:43
+ */
+public enum FileEnum {
+
+
+    /**
+     * 本地存储地址
+     */
+    Local_Address("1","/image", "本地上传保存地址"),
+    /**
+     * 用户存储地址
+     */
+    User_Address("2","/user", "用户存储地址"),
+    /**
+     * 企业存储地址
+     */
+    Enterprise_Address("3","/enterprise", "企业存储地址"),
+    /**
+     * 合同存储地址
+     */
+    CONTRACT_ADDRESS("4","/contract", "合同存储地址"),
+    /**
+     * 文件存储地址
+     */
+    DOCUMENT_ADDRESS("5","/excel", "文件存储地址"),
+
+    /**
+     * 文件存储方式-上传oss
+     */
+    FILE_STORE_TYPE_OSS("OSS","OSS","上传OSS"),
+    /**
+     文件存储方式-上传七牛云
+     *
+     */
+    FILE_STORE_TYPE_ALIYUN("kodo","qiniuyun","上传七牛云");
+
+    private final String fileType;
+    private final String fileAddress;
+    private final String fileDescription;
+
+    public String getFileType() {
+        return fileType;
+    }
+
+    public String getFileAddress() {
+        return fileAddress;
+    }
+
+    public String getFileDescription() {
+        return fileDescription;
+    }
+
+    FileEnum(String fileType, String fileAddress, String fileDescription) {
+        this.fileType = fileType;
+        this.fileAddress = fileAddress;
+        this.fileDescription = fileDescription;
+    }
+
+
+
+
+    public static String getValue(String fileType) {
+        for (FileEnum ele : FileEnum.values()) {
+            if (ele.getFileType().equals(fileType)) {
+                return ele.getFileAddress();
+            }
+        }
+        return null;
+    }
+
+}

+ 12 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/exception/GlobalSystemExceptionHandler.java

@@ -63,6 +63,18 @@ public class GlobalSystemExceptionHandler {
     }
 
 
+    /**
+     * NotLoginException处理
+     *
+     * @param ex
+     * @return
+     */
+    @ResponseBody
+    @ExceptionHandler(NotLoginException.class)
+    public HttpResult notLoginException(NotLoginException ex) {
+        log.error("用户未登录, message={}, param={}", ex.getMsg(), ex.getParam());
+        return HttpResult.error(HttpStatus.TOKEN_INVALID_CODE, HttpStatus.UN_LOGIN_MESSAGE, ex.getMessage());
+    }
 
     @ResponseBody
     @ExceptionHandler(MissingServletRequestParameterException.class)

+ 29 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/exception/NotLoginException.java

@@ -0,0 +1,29 @@
+package com.sckw.core.exception;
+
+import lombok.Getter;
+
+/**
+ * @Author yzc
+ * @Description 未登陆异常
+ * @createTime 2023年06月08日 10:05:00
+ */
+@Getter
+public class NotLoginException extends  RuntimeException {
+
+    /**
+     * 异常信息
+    **/
+    private String msg;
+    private Object[] param;
+
+    public NotLoginException(String msg) {
+        super(msg);
+        this.msg = msg;
+    }
+    public NotLoginException(String msg, Object... param){
+        super(msg);
+        this.msg = msg;
+        this.param=param;
+    }
+
+}

+ 69 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/auth/AbstractLoginUser.java

@@ -0,0 +1,69 @@
+/**
+ * Copyright 2018-2020 stylefeng & fengshuonan (sn93@qq.com)
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.sckw.core.model.auth;
+
+import java.util.Set;
+
+/**
+ * 登录中的用户信息
+ * <p>
+ * 为何类型是泛型,因为具体的项目不知道类型是什么
+ * @author fengshuonan
+ * @date 2017-11-09-下午5:47
+ */
+public interface AbstractLoginUser {
+
+    /**
+     * @description 获取用户唯一id
+     * @author fengshuonan
+     * @Date 2018/8/10 9:49
+     * @return
+     **/
+    <T> T getUserUniqueId();
+
+    /**
+     * @description 获取用户唯一id
+     * @author fengshuonan
+     * @Date 2018/8/10 9:49
+     * @return
+     **/
+    <T> T getAppId();
+
+    /**
+     * @description 获取角色id的集合
+     * @author fengshuonan
+     * @Date 2018/8/10 9:49
+     * @return
+     **/
+    <T> Set<T> getRoleIds();
+
+    /**
+     * @description 角色编码集合
+     * @author fengshuonan
+     * @Date 2018/8/10 9:49
+     * @return
+     **/
+    <T> Set<T> getRoleCodes();
+
+    /**
+     * @description 包含的资源权限url
+     * @author fengshuonan
+     * @Date 2018/8/10 9:49
+     * @return
+     **/
+    <T> Set<T> getResourceUrls();
+
+}

+ 47 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/auth/LoginBase.java

@@ -0,0 +1,47 @@
+package com.sckw.core.model.auth;
+
+import lombok.Data;
+
+/**
+ * @author zk
+ * @description 登录信息
+ * @date 2020/06/12 09:06:14
+ */
+@Data
+public class LoginBase {
+
+    /**
+     * 账号
+     */
+    private String account;
+
+    /**
+     * 密码
+     */
+    private String password;
+
+    /**
+     * 验证码
+     */
+    private String captcha;
+
+    /**
+     * 系统类型(1 运营管理中心/2 运营管理中心/3 官网/4 司机应用)
+     */
+    private String systemType;
+
+    /**
+     * 客户端类型(ios 苹果设备/android 安卓设备/pc 浏览器/pc-background 管理系统)
+     */
+    private String clientType;
+
+    /**
+     * 登录方式1 账号密码登录/2账号短信登录/3单账号登录
+     */
+    private int loginMethod;
+
+    /**
+     * 用户类型(1 表示官网 )
+     */
+    private String userType;
+}

+ 52 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/auth/LoginEnterpriseInfo.java

@@ -0,0 +1,52 @@
+package com.sckw.core.model.auth;
+
+import lombok.Data;
+import java.util.Date;
+
+/**
+ * 登录中的用户企业信息
+ * @Author zhaokang
+ * @date 2020/04/13 0021
+ */
+@Data
+public class LoginEnterpriseInfo {
+    /**
+     * 用户所属企业id
+     */
+    private Long id;
+    /**
+     * 用户所属企业名称
+     */
+    private String firmName;
+    /**
+     * 用户类型
+     */
+    private int userType;
+    /**
+     * 用户分支类型(1承运商企业、2车主)
+     */
+    private int branchType;
+    /**
+     * 资料审批状态(0未审批、1通过、2未通过、3审批中)
+     */
+    private int approval;
+    /**
+     * 用户状态(-1删除、0正常、1已锁)
+     */
+    private int status;
+
+    /**
+     * 交通安培账号状态
+     */
+    private int jtaqStatus;
+
+    /**
+     * 交通安培账号删除标识
+     */
+    private int jtaqDelFlag;
+
+    /**
+     * 企业注册时间
+     */
+    private Date regTime;
+}

+ 74 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/auth/LoginUserInfo.java

@@ -0,0 +1,74 @@
+package com.sckw.core.model.auth;
+
+import lombok.Data;
+
+/**
+ * 登录中的用户信息
+ * @Author zhaokang
+ * @date 2020/04/13 0021
+ */
+@Data
+public class LoginUserInfo {
+    /**
+     * 用户id
+     */
+    private Long id;
+    /**
+     * 用户所属系统
+     */
+    private Integer systemType;
+    /**
+     * 用户账号
+     */
+    private String account;
+    /**
+     * 用户姓名
+     */
+    private String userName;
+    /**
+     * 用户电话
+     */
+    private String phone;
+    /**
+     *是否主账号(0是/1否)
+     */
+    private int isMain;
+    /**
+     *用户账号状态(0正常/1锁定)
+     */
+    private int status;
+    /**
+     * 用户所属企业id
+     */
+    private Long entId;
+    /**
+     * 用户登录终端
+     */
+    private String clientType;
+    /**
+     * 用户所属机构id
+     */
+    private Long deptId;
+    /**
+     * (司机)
+     */
+    private String userIds;
+
+
+    public LoginUserInfo() {
+    }
+
+    public LoginUserInfo(Long id, Integer systemType, String account, String userName, String phone,
+                         int isMain, int status, Long entId, String clientType, Long deptId) {
+        this.id = id;
+        this.systemType = systemType;
+        this.account = account;
+        this.userName = userName;
+        this.phone = phone;
+        this.isMain = isMain;
+        this.status = status;
+        this.entId = entId;
+        this.clientType = clientType;
+        this.deptId = deptId;
+    }
+}

+ 39 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/auth/UserAccessMenuInfo.java

@@ -0,0 +1,39 @@
+package com.sckw.core.model.auth;
+
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @author czh
+ * @desc 查询用户菜单返参
+ * @date 2023/6/13
+ */
+@Data
+public class UserAccessMenuInfo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -7179541798171846390L;
+
+    /**
+     * 菜单ID
+     */
+    private long menuId;
+
+    /**
+     * 菜单名
+     */
+    private String name;
+
+    /**
+     * 地址
+     */
+    private String url;
+
+    /**
+     * 后端接口地址
+     */
+    private String links;
+
+}

+ 27 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/auth/context/AbstractLoginContext.java

@@ -0,0 +1,27 @@
+package com.sckw.core.model.auth.context;
+
+import com.sckw.core.model.auth.AbstractLoginUser;
+
+/**
+ * 快速获取登录信息上下文
+ * @author fengshuonan
+ * @date 2018-02-05 16:58
+ */
+public interface AbstractLoginContext {
+
+    /**
+     * @description 获取当前用户的token
+     * @author fengshuonan
+     * @dae 018-02-05 9:49
+     * @return token
+     **/
+    String getCurrentUserToken();
+
+    /**
+     * @description 获取当前用户
+     * @author fengshuonan
+     * @dae 2018-02-05 9:49
+     * @return
+     **/
+    <T extends AbstractLoginUser> T getLoginUser();
+}

+ 95 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/auth/context/LoginEnterpriseHolder.java

@@ -0,0 +1,95 @@
+package com.sckw.core.model.auth.context;
+
+import com.sckw.core.model.auth.LoginEnterpriseInfo;
+
+/**
+ * 当前登录用户企业的临时保存容器
+ * @Author zhaokang
+ * @date 2020/04/13 0021
+ */
+public class LoginEnterpriseHolder {
+    private static final ThreadLocal<LoginEnterpriseInfo> LONGIN_ENTERPRISE_HOLDER = new ThreadLocal<LoginEnterpriseInfo>();
+
+    /**
+     * 赋值
+     * @author zhaokang
+     * @Date 2020/04/13 0021
+     */
+    public static void set(LoginEnterpriseInfo loginEnterpriseInfo) {
+        LONGIN_ENTERPRISE_HOLDER.set(loginEnterpriseInfo);
+    }
+
+    /**
+     * 取值
+     * @author zhaokang
+     * @Date 2020/04/13 0021
+     */
+    public static LoginEnterpriseInfo get() {
+        return LONGIN_ENTERPRISE_HOLDER == null ? null : LONGIN_ENTERPRISE_HOLDER.get();
+    }
+
+    /**
+     * 删除保存的用户
+     * @author zhaokang
+     * @Date 2020/04/13 0021
+     */
+    public static void remove() {
+        LONGIN_ENTERPRISE_HOLDER.remove();
+    }
+
+    /**
+     * 用户所属企业id
+     * @author zhaokang
+     * @Date 2020/04/13 0021
+     */
+    public static Long getEntId(){
+        return LONGIN_ENTERPRISE_HOLDER.get() == null ? null : LONGIN_ENTERPRISE_HOLDER.get().getId();
+    }
+
+    /**
+     * 用户所属企业名称
+     * @author zhaokang
+     * @Date 2020/04/13 0021
+     */
+    public static String getFirmName(){
+        return LONGIN_ENTERPRISE_HOLDER.get() == null ? null : LONGIN_ENTERPRISE_HOLDER.get().getFirmName();
+    }
+
+    /**
+     * 用户类型
+     * @author zhaokang
+     * @Date 2020/04/13 0021
+     */
+    public static Integer getUserType(){
+        return LONGIN_ENTERPRISE_HOLDER.get() == null ? null : LONGIN_ENTERPRISE_HOLDER.get().getUserType();
+    }
+
+    /**
+     * 资料审批状态(1通过、0未审批、2未通过、3审批中)
+     * @author zhaokang
+     * @Date 2020/04/13 0021
+     */
+    public static Integer getApproval(){
+        return LONGIN_ENTERPRISE_HOLDER.get() == null ? null : LONGIN_ENTERPRISE_HOLDER.get().getApproval();
+    }
+
+    /**
+     * 用户状态(-1删除、0正常、1已锁)
+     * @author zhaokang
+     * @Date 2020/04/13 0021
+     */
+    public static Integer getStatus(){
+        return LONGIN_ENTERPRISE_HOLDER.get() == null ? null : LONGIN_ENTERPRISE_HOLDER.get().getStatus();
+    }
+
+    /**
+     * 用户分支类型
+     * @author zk
+     * @date 2021/3/16 11:24
+     **/
+    public static Integer getBranchType(){
+        return LONGIN_ENTERPRISE_HOLDER.get() == null ? null : LONGIN_ENTERPRISE_HOLDER.get().getBranchType();
+    }
+
+
+}

+ 140 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/auth/context/LoginUserHolder.java

@@ -0,0 +1,140 @@
+package com.sckw.core.model.auth.context;//package com.sckw.core.model.auth.context;
+//
+//import com.sckw.core.model.auth.LoginUserInfo;
+//
+///**
+// * 当前登录用户的临时保存容器
+// * @Author zhaokang
+// * @date 2020/04/13 0021
+// */
+//public class LoginUserHolder {
+//
+//    private static final ThreadLocal<LoginUserInfo> LONGIN_USER_HOLDER = new ThreadLocal<LoginUserInfo>();
+//
+//    /**
+//     * 赋值
+//     * @author zhaokang
+//     * @Date 2020/04/13 0021
+//     */
+//    public static void set(LoginUserInfo loginUserInfo) {
+//        LONGIN_USER_HOLDER.set(loginUserInfo);
+//    }
+//
+//    /**
+//     * 取值
+//     * @author zhaokang
+//     * @Date 2020/04/13 0021
+//     */
+//    public static LoginUserInfo get() {
+//        return LONGIN_USER_HOLDER == null ? null : LONGIN_USER_HOLDER.get();
+//    }
+//
+//    /**
+//     * 删除保存的用户
+//     * @author zhaokang
+//     * @Date 2020/04/13 0021
+//     */
+//    public static void remove() {
+//        LONGIN_USER_HOLDER.remove();
+//    }
+//
+//    /**
+//     * 用户id
+//     * @author zhaokang
+//     * @Date 2020/04/13 0021
+//     */
+//    public static Long getUserId(){
+//        return LONGIN_USER_HOLDER.get() == null ? null : LONGIN_USER_HOLDER.get().getId();
+//    }
+//
+//    /**
+//     * 用户所属系统
+//     * @author zhaokang
+//     * @Date 2020/04/13 0021
+//     */
+//    public static Integer getSystemType(){
+//        return LONGIN_USER_HOLDER.get() == null ? null : LONGIN_USER_HOLDER.get().getSystemType();
+//    }
+//
+//    /**
+//     * 用户账号
+//     * @author zhaokang
+//     * @Date 2020/04/13 0021
+//     */
+//    public static String getAccount(){
+//        return LONGIN_USER_HOLDER.get() == null ? null : LONGIN_USER_HOLDER.get().getAccount();
+//    }
+//
+//    /**
+//     * 用户姓名
+//     * @author zhaokang
+//     * @Date 2020/04/13 0021
+//     */
+//    public static String getUserName(){
+//        return LONGIN_USER_HOLDER.get() == null ? null : LONGIN_USER_HOLDER.get().getUserName();
+//    }
+//
+//    /**
+//     * 用户电话
+//     * @author zhaokang
+//     * @Date 2020/04/13 0021
+//     */
+//    public static String getPhone(){
+//        return LONGIN_USER_HOLDER.get() == null ? null : LONGIN_USER_HOLDER.get().getPhone();
+//    }
+//
+//    /**
+//     * 是否主账号(0是/1否)
+//     * @author zhaokang
+//     * @Date 2020/04/13 0021
+//     */
+//    public static Integer getIsMain(){
+//        return LONGIN_USER_HOLDER.get() == null ? null : LONGIN_USER_HOLDER.get().getIsMain();
+//    }
+//
+//    /**
+//     * 用户账号状态(0正常/1锁定)
+//     * @author zhaokang
+//     * @Date 2020/04/13 0021
+//     */
+//    public static Integer getStatus(){
+//        return LONGIN_USER_HOLDER.get() == null ? null : LONGIN_USER_HOLDER.get().getStatus();
+//    }
+//
+//    /**
+//     * 用户所属企业
+//     * @author zhaokang
+//     * @Date 2020/04/13 0021
+//     */
+//    public static Long getEntId(){
+//        return LONGIN_USER_HOLDER.get() == null ? null : LONGIN_USER_HOLDER.get().getEntId();
+//    }
+//
+//    /**
+//     * 用户登录终端
+//     * @author zhaokang
+//     * @Date 2020/04/13 0021
+//     */
+//    public static String getClientType(){
+//        return LONGIN_USER_HOLDER.get() == null ? null : LONGIN_USER_HOLDER.get().getClientType();
+//    }
+//
+//    /**
+//     * 用户机构
+//     * @author zhaokang
+//     * @Date 2020/04/13 0021
+//     */
+//    public static Long getDeptId(){
+//        return LONGIN_USER_HOLDER.get() == null ? null : LONGIN_USER_HOLDER.get().getDeptId();
+//    }
+//
+//    /**
+//     * (司机)
+//     * @author zhaokang
+//     * @Date 2020/04/13 0021
+//     */
+//    public static String getUserIds(){
+//        return LONGIN_USER_HOLDER.get() == null ? null : LONGIN_USER_HOLDER.get().getUserIds();
+//    }
+//
+//}

+ 38 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/auth/context/SignBase.java

@@ -0,0 +1,38 @@
+package com.sckw.core.model.auth.context;
+
+import lombok.Data;
+
+import java.util.Map;
+
+/**
+ * @author zk
+ * @description 获取铭文请求参数
+ * @date 2020/08/15 16:11:10
+ */
+@Data
+public class SignBase {
+    /**
+     * 铭文
+     */
+    private String sign;
+
+    /**
+     * 公钥
+     */
+    private String accessKey;
+
+    /**
+     * 私钥
+     */
+    private String accessSecret;
+
+    /**
+     * 时间戳
+     */
+    private Long timeStamp;
+
+    /**
+     * 请求参数
+     */
+    private Map<String, Object> params;
+}

+ 40 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/AddressDefaultTypeEnum.java

@@ -0,0 +1,40 @@
+package com.sckw.core.model.enums;
+
+import lombok.Getter;
+
+/**
+ * @author czh
+ * @desc 默认地址类型
+ * @date 2023/6/15
+ */
+@Getter
+public enum AddressDefaultTypeEnum {
+
+    //普通
+    NO(0, ""),
+    //装货地址
+    SHIPMENT(1, "装货"),
+    //收货地址
+    TAKE(2, "卸货"),
+    //装/卸
+    BOTH(3, "装/卸");
+
+    private final int code;
+
+    private final String name;
+
+    AddressDefaultTypeEnum(int code, String name){
+        this.code = code;
+        this.name = name;
+    }
+
+    public static AddressDefaultTypeEnum getName(int code){
+        for (AddressDefaultTypeEnum addressDefaultTypeEnum : values()) {
+            if (addressDefaultTypeEnum.getCode() == code) {
+                return addressDefaultTypeEnum;
+            }
+        }
+        return null;
+    }
+
+}

+ 42 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ApprovalEnum.java

@@ -0,0 +1,42 @@
+package com.sckw.core.model.enums;
+
+import lombok.Getter;
+
+/**
+ * @author czh
+ * @desc 审批状态枚举
+ * @date 2023/6/15
+ */
+@Getter
+public enum ApprovalEnum {
+
+    //未审批
+    NO(0, "待认证"),
+    //通过
+    OK(1, "已认证"),
+    //未通过
+    PASS(2, "已驳回"),
+    //审批中
+    PROCESS(3, "待审批"),
+    //更新中,待审批
+    REFRESH(4, "更新中");
+
+    private final int code;
+
+    private final String name;
+
+    ApprovalEnum(int code, String name){
+        this.code = code;
+        this.name = name;
+    }
+
+    public static String getName(int code){
+        for (ApprovalEnum approvalEnum : values()) {
+            if (approvalEnum.getCode() == code) {
+                return approvalEnum.getName();
+            }
+        }
+        return null;
+    }
+
+}

+ 52 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/BannerDistrictEnum.java

@@ -0,0 +1,52 @@
+package com.sckw.core.model.enums;
+
+import lombok.Getter;
+
+/**
+ * @author sky
+ * @desc 默认地址类型
+ * @date 2023/6/15
+ */
+@Getter
+public enum BannerDistrictEnum {
+
+    //首页
+    BANNER_ZERO(0, "首页"),
+    //建材市场
+    BANNER_ONE(1, "建材市场"),
+    //求购大厅
+    BANNER_TWO(2, "求购大厅"),
+    //运需广场
+    BANNER_THREE(3, "运需广场"),
+    //运力大厅
+    BANNER_FOUR(4, "运力大厅"),
+    //金融服务
+    BANNER_FIVE(5, "金融服务"),
+    //车后服务
+    BANNER_SIX(6,"车后服务"),
+    //绿智新能
+    BANNER_SEVEN(7,"绿智新能");
+
+
+
+    
+
+    private final int code;
+
+    private final String name;
+
+    BannerDistrictEnum(int code, String name){
+        this.code = code;
+        this.name = name;
+    }
+
+    public static BannerDistrictEnum getName(int code){
+        for (BannerDistrictEnum addressDefaultTypeEnum : values()) {
+            if (addressDefaultTypeEnum.getCode() == code) {
+                return addressDefaultTypeEnum;
+            }
+        }
+        return null;
+    }
+
+}

+ 186 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CarWaybillEnum.java

@@ -0,0 +1,186 @@
+package com.sckw.core.model.enums;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author lfdc
+ * @description 车辆运单状态枚举
+ * @date 2023-07-14 14:07:23
+ */
+public enum CarWaybillEnum {
+    /**
+     * 待接单
+     */
+    PENDING_ORDER(1, "pendingOrder", "1", "待接单"),
+    /**
+     * 待出车
+     */
+    PENDING_VEHICLE(2, "pendingVehicle", "2", "待出车"),
+    /**
+     * 已出车
+     */
+    EXIT_COMPLETED(3, "exitCompleted", "3", "已出车"),
+    /**
+     * 到达装货点
+     */
+    WAIT_LOADING(4, "waitLoading", "4", "到达装货点"),
+    /**
+     * 已装货
+     */
+    COMPLETION_LOADING(5, "completionLoading", "5", "已装货"),
+    /**
+     * 到达卸货点
+     */
+    WAIT_UNLOADING(6, "waitUnloading", "6", "到达卸货点"),
+    /**
+     * 已卸货
+     */
+    COMPLETION_UNLOADING(7, "completionUnloading", "7", "已卸货"),
+    /**
+     * 已核-通过
+     */
+    APPROVAL_PASS(8, "approvalPass", "8", "审核通过"),
+    /**
+     * 拒接单
+     */
+    REJECT_ORDER(9, "rejectOrder", "9", "拒接单"),
+    /**
+     * 拒出车
+     */
+    REFUSE_TRAFFIC(10, "refuseTraffic", "10", "拒出车"),
+    /**
+     * 已撤销
+     */
+    REVOKED(11, "revoked", "11", "撤回"),
+    /**
+     * 已核单-不通过[审核不通过]
+     */
+    APPROVAL_NO_PASS(12, "revoked", "12", "核单驳回"),
+    /**
+     * 单证更新审核中
+     */
+    APPROVAL_IN(13, "approvalIn", "13", "单证更新审核中"),
+    ;
+
+    private final Integer code;
+    private final String value;
+    private final String status;
+    private final String destination;
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public String getDestination() {
+        return destination;
+    }
+
+    CarWaybillEnum(Integer code, String value, String status, String destination) {
+        this.code = code;
+        this.value = value;
+        this.status = status;
+        this.destination = destination;
+    }
+
+    public static String getLogisticsOrderValue(Integer code) {
+        for (CarWaybillEnum waybillEnum : CarWaybillEnum.values()) {
+            if (waybillEnum.getCode().equals(code)) {
+                return waybillEnum.getValue();
+            }
+        }
+        return null;
+    }
+
+    public static String getWaybillOrderDestination(String status) {
+        for (CarWaybillEnum waybillEnum : CarWaybillEnum.values()) {
+            if (waybillEnum.getStatus().equals(status)) {
+                return waybillEnum.getDestination();
+            }
+        }
+        return null;
+    }
+
+    public static String getName(Integer code) {
+        for (CarWaybillEnum waybillEnum : CarWaybillEnum.values()) {
+            if (waybillEnum.getCode().equals(code)) {
+                return waybillEnum.getDestination();
+            }
+        }
+        return null;
+    }
+
+    public static List<Integer> getCodes() {
+        List<Integer> codes = new ArrayList<>();
+        for (CarWaybillEnum waybillEnum : CarWaybillEnum.values()) {
+            codes.add(waybillEnum.getCode());
+        }
+        return codes;
+    }
+
+    public static List<String> getStringCodes() {
+        List<String> codes = new ArrayList<>();
+        for (CarWaybillEnum waybillEnum : CarWaybillEnum.values()) {
+            codes.add(waybillEnum.getStatus());
+        }
+        return codes;
+    }
+
+    /**
+     * @param code 状态码
+     * @desc 是否可以变更司机
+     * @author zk
+     * @date 2023/8/2
+     **/
+    public static boolean changeDriver(int code) {
+        if (code == CarWaybillEnum.COMPLETION_UNLOADING.getCode()
+                || code == CarWaybillEnum.APPROVAL_PASS.getCode()
+                || code == CarWaybillEnum.REJECT_ORDER.getCode()
+                || code == CarWaybillEnum.REFUSE_TRAFFIC.getCode()
+                || code == CarWaybillEnum.REVOKED.getCode()
+                || code == CarWaybillEnum.APPROVAL_NO_PASS.getCode()) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * @param code 状态码
+     * @desc 是否可以变更司机/车辆
+     * @author zk
+     * @date 2023/8/2
+     **/
+    public static boolean changeTruck(int code) {
+        if (code == CarWaybillEnum.PENDING_ORDER.getCode()
+                || code == CarWaybillEnum.PENDING_VEHICLE.getCode()) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 获取编码以及注释
+     *
+     * @return
+     */
+    public static String getCodeAndDestination() {
+        StringBuilder sb = new StringBuilder();
+        for (CarWaybillEnum value : CarWaybillEnum.values()) {
+            sb.append(value.getCode()+":").append(value.destination).append(";");
+        }
+        return sb.toString();
+    }
+
+    public static void main(String[] args) {
+        String codeAndDestination = getCodeAndDestination();
+        System.out.println(codeAndDestination);
+    }
+}

+ 164 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CarWaybillQueryEnum.java

@@ -0,0 +1,164 @@
+package com.sckw.core.model.enums;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author lfdc
+ * @description 车辆运单状态枚举[仅查询使用]
+ * @date 2023-07-14 14:07:23
+ */
+public enum CarWaybillQueryEnum {
+    /**
+     * 待接单
+     */
+    PENDING_ORDER(1, "pendingOrder", "1", "待接单"),
+    /**
+     * 待出车
+     */
+    PENDING_VEHICLE(2, "pendingVehicle", "2", "待出车"),
+    /**
+     * 已出车
+     */
+    EXIT_COMPLETED(3, "exitCompleted", "3", "已出车"),
+    /**
+     * 到达装货点
+     */
+    WAIT_LOADING(4, "waitLoading", "4", "到达装货点"),
+    /**
+     * 已装货
+     */
+    COMPLETION_LOADING(5, "completionLoading", "5", "已装货"),
+    /**
+     * 到达卸货点
+     */
+    WAIT_UNLOADING(6, "waitUnloading", "6", "到达卸货点"),
+    /**
+     * 已卸货
+     */
+    COMPLETION_UNLOADING(7, "completionUnloading", "7", "已卸货"),
+    /**
+     * 已核-通过
+     */
+    APPROVAL_PASS(8, "approvalPass", "8", "审核通过"),
+    /**
+     * 拒接单
+     */
+    REJECT_ORDER(9, "rejectOrder", "9", "拒接单"),
+    /**
+     * 拒出车
+     */
+    REFUSE_TRAFFIC(10, "refuseTraffic", "10", "拒出车"),
+    /**
+     * 已撤销
+     */
+    REVOKED(11, "revoked", "11", "单趟撤回"),
+    /**
+     * 已核单-不通过[审核不通过]
+     */
+    APPROVAL_NO_PASS(12, "revoked", "12", "核单驳回"),
+    /**
+     * 单证更新审核中
+     */
+    APPROVAL_IN(13, "approvalIn", "13", "单证更新审核中"),
+
+    /**
+     * 单证审核
+     */
+    DOCUMENT_CHECK(100, "documentCheck", "100", "单证审核"),
+
+    /**
+     * 已作废
+     */
+    ABROGATE(200, "abrogate", "200", "已作废"),
+    ;
+
+    private final Integer code;
+    private final String value;
+    private final String status;
+    private final String destination;
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public String getDestination() {
+        return destination;
+    }
+
+    CarWaybillQueryEnum(Integer code, String value, String status, String destination) {
+        this.code = code;
+        this.value = value;
+        this.status = status;
+        this.destination = destination;
+    }
+
+    public static String getLogisticsOrderValue(Integer code) {
+        for (CarWaybillQueryEnum waybillEnum : CarWaybillQueryEnum.values()) {
+            if (waybillEnum.getCode().equals(code)) {
+                return waybillEnum.getValue();
+            }
+        }
+        return null;
+    }
+
+    public static String getWaybillOrderDestination(String status) {
+        for (CarWaybillQueryEnum waybillEnum : CarWaybillQueryEnum.values()) {
+            if (waybillEnum.getStatus().equals(status)) {
+                return waybillEnum.getDestination();
+            }
+        }
+        return null;
+    }
+
+    public static String getName(Integer code) {
+        for (CarWaybillQueryEnum waybillEnum : CarWaybillQueryEnum.values()) {
+            if (waybillEnum.getCode().equals(code)) {
+                return waybillEnum.getDestination();
+            }
+        }
+        return null;
+    }
+
+    public static List<Integer> getCodes() {
+        List<Integer> codes = new ArrayList<>();
+        for (CarWaybillQueryEnum waybillEnum : CarWaybillQueryEnum.values()) {
+            codes.add(waybillEnum.getCode());
+        }
+        return codes;
+    }
+
+    public static List<String> getStringCodes() {
+        List<String> codes = new ArrayList<>();
+        for (CarWaybillQueryEnum waybillEnum : CarWaybillQueryEnum.values()) {
+            codes.add(waybillEnum.getStatus());
+        }
+        return codes;
+    }
+
+    /**
+     * @param code 状态码
+     * @desc 是否可以变更司机/车辆
+     * @author zk
+     * @date 2023/8/2
+     **/
+    public static boolean changeDriverAndTruck(int code) {
+        if (code == CarWaybillQueryEnum.COMPLETION_UNLOADING.getCode()
+                || code == CarWaybillQueryEnum.APPROVAL_PASS.getCode()
+                || code == CarWaybillQueryEnum.REJECT_ORDER.getCode()
+                || code == CarWaybillQueryEnum.REFUSE_TRAFFIC.getCode()
+                || code == CarWaybillQueryEnum.REVOKED.getCode()
+                || code == CarWaybillQueryEnum.APPROVAL_NO_PASS.getCode()) {
+            return false;
+        }
+        return true;
+    }
+}

+ 45 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CertificateTypeEnum.java

@@ -0,0 +1,45 @@
+package com.sckw.core.model.enums;
+
+import lombok.Getter;
+
+/**
+ * @author czh
+ * @desc 证照类型枚举
+ * @date 2023/6/15
+ */
+@Getter
+public enum CertificateTypeEnum {
+
+    //联系人身份证
+    CONTACTS_IDCARD(1, "联系人身份证"),
+    //法人身份证
+    CORPORATION_IDCARD(2, "法人身份证"),
+    //营业执照
+    BUSINESSLICENSE(3, "营业执照"),
+    //道路运输许可证
+    ROADLICENSE(4, "道路运输许可证"),
+    //开户许可证号
+    ACCOUNT(5, "开户许可证号"),
+    //授权证书
+    AUTHORIZE(6, "授权证书"),
+    //电子签章授权书
+    SIGNATURES(7, "电子签章授权书");
+
+    private final int code;
+
+    private final String name;
+
+    CertificateTypeEnum(int code, String name){
+        this.code = code;
+        this.name = name;
+    }
+
+    public static CertificateTypeEnum getName(int code){
+        for (CertificateTypeEnum certificateTypeEnum : values()) {
+            if (certificateTypeEnum.getCode() == code) {
+                return certificateTypeEnum;
+            }
+        }
+        return null;
+    }
+}

+ 37 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ChargingTypeEnum.java

@@ -0,0 +1,37 @@
+package com.sckw.core.model.enums;
+
+import lombok.Getter;
+
+/**
+ * @author czh
+ * @desc 计费方式枚举
+ * @date 2023/7/14
+ */
+@Getter
+public enum ChargingTypeEnum {
+
+    //装货量
+    ON(1, "装货量"),
+    //卸货量
+    OFF(2, "卸货量"),
+    //车次
+    CAR(3, "车次");
+
+    private final int code;
+
+    private final String name;
+
+    ChargingTypeEnum(int code, String name){
+        this.code = code;
+        this.name = name;
+    }
+
+    public static ChargingTypeEnum getName(int code){
+        for (ChargingTypeEnum chargingTypeEnum : values()) {
+            if (chargingTypeEnum.getCode() == code) {
+                return chargingTypeEnum;
+            }
+        }
+        return null;
+    }
+}

+ 59 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ClientTypeEnum.java

@@ -0,0 +1,59 @@
+package com.sckw.core.model.enums;
+
+import com.sckw.core.model.constant.Global;
+
+/**
+ * @Description 客户端类型枚举
+ * @Author dengyinghui
+ * @Date 2019/4/16
+ */
+public enum ClientTypeEnum {
+    //浏览器-官网
+    pc("浏览器", "pc"),
+    app("app", "app"),
+    //苹果设备
+    ios("苹果设备", "ios"),
+    //安卓设备
+    android("安卓设备",  "android"),
+    //移动设备
+    mobile("移动端", "mobile"),
+    //第三方API调用
+    api("API调用", "api"),
+    //所有终端
+    terminal("终端", "terminal");
+
+    private String name;
+
+    private String value;
+
+    private ClientTypeEnum(String name, String value){
+        this.name = name;
+        this.value = value;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    public static int expireTime(String clientType) {
+        if (clientType.equals(pc.getValue())) {
+            return Global.PC_TOKEN_EXPIRE;
+        } else if (clientType.equals(ios.getValue()) || clientType.equals(android.getValue())) {
+            return Global.APP_TOKEN_EXPIRE;
+        } else {
+            return Global.COMMON_EXPIRE;
+        }
+    }
+}

+ 39 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ContractStatusEnum.java

@@ -0,0 +1,39 @@
+package com.sckw.core.model.enums;
+
+import lombok.Getter;
+
+/**
+ * @author czh
+ * @desc 合同状态
+ * @date 2023/7/14
+ */
+@Getter
+public enum ContractStatusEnum {
+    //已签约
+    SIGNED(0, "已签约"),
+    //已完结
+    COMPLETE(2, "已完结"),
+    //已保存
+    SAVE(3, "已保存"),
+    //签约中
+    SUBMIT(1, "待签约");
+
+    private final int code;
+
+    private final String name;
+
+    ContractStatusEnum(int code, String name) {
+        this.code = code;
+        this.name = name;
+    }
+
+    public static ContractStatusEnum getName(int code) {
+        for (ContractStatusEnum contractTrackEnum : values()) {
+            if (contractTrackEnum.getCode() == code) {
+                return contractTrackEnum;
+            }
+        }
+        return null;
+    }
+
+}

+ 38 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ContractTrackEnum.java

@@ -0,0 +1,38 @@
+package com.sckw.core.model.enums;
+
+import lombok.Getter;
+
+/**
+ * @author czh
+ * @desc 合同审批状态
+ * @date 2023/7/14
+ */
+@Getter
+public enum ContractTrackEnum {
+
+    //签约中
+    SIGNING(1, "发起签约"),
+    //已签约
+    SIGNED(0, "已签约"),
+    //已完结
+    OVER(2, "已完结");
+
+    private final int code;
+
+    private final String name;
+
+    ContractTrackEnum(int code, String name) {
+        this.code = code;
+        this.name = name;
+    }
+
+    public static ContractTrackEnum getName(int code) {
+        for (ContractTrackEnum contractTrackEnum : values()) {
+            if (contractTrackEnum.getCode() == code) {
+                return contractTrackEnum;
+            }
+        }
+        return null;
+    }
+
+}

+ 36 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CooperateApplyTypeEnum.java

@@ -0,0 +1,36 @@
+package com.sckw.core.model.enums;
+
+import lombok.Getter;
+
+/**
+ * @author czh
+ * @desc 合作单位申请类型枚举
+ * @date 2023/6/15
+ */
+@Getter
+public enum CooperateApplyTypeEnum {
+
+    //我方发起
+    US(1, "我方发起"),
+    //对方发起
+    TARGET(2, "对方发起");
+
+    private final int code;
+
+    private final String name;
+
+    CooperateApplyTypeEnum(int code, String name){
+        this.code = code;
+        this.name = name;
+    }
+
+    public static CooperateApplyTypeEnum getName(int code) {
+        for (CooperateApplyTypeEnum cooperateApplyTypeEnum : values()) {
+            if (cooperateApplyTypeEnum.getCode() == code) {
+                return cooperateApplyTypeEnum;
+            }
+        }
+        return null;
+    }
+
+}

+ 44 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CooperateStatusEnum.java

@@ -0,0 +1,44 @@
+package com.sckw.core.model.enums;
+
+import lombok.Getter;
+
+import java.util.Map;
+
+/**
+ * @author czh
+ * @desc 合作状态
+ * @date 2023/6/15
+ */
+@Getter
+public enum CooperateStatusEnum {
+
+    //审核中
+    PROCESS(0, "审核中"),
+    //合作中
+    OK(1, "合作中"),
+    //已解除
+    PASS(2, "已解除"),
+    //已拒绝
+    REFUSE(3, "已驳回"),
+    //已撤销
+    CANCEL(4, "已撤销");
+
+    private final int code;
+
+    private final String name;
+
+    CooperateStatusEnum(int code, String name) {
+        this.code = code;
+        this.name = name;
+    }
+
+    public static String getName(int code) {
+        for (CooperateStatusEnum cooperateStatusEnum : values()) {
+            if (cooperateStatusEnum.getCode() == code) {
+                return cooperateStatusEnum.getName();
+            }
+        }
+        return null;
+    }
+
+}

+ 40 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CooperateTypeEnum.java

@@ -0,0 +1,40 @@
+package com.sckw.core.model.enums;
+
+import lombok.Getter;
+
+/**
+ * @author czh
+ * @desc 合作类型
+ * @date 2023/6/15
+ */
+@Getter
+public enum CooperateTypeEnum {
+
+    //供应商
+    SUPPLIER(1, "供应商"),
+    //采购商
+    PURCHASER(2, "采购商"),
+    //托运商
+    CONSIGN(3, "托运商"),
+    //承运商
+    CARRIAGE(4, "承运商");
+
+    private final int code;
+
+    private final String name;
+
+    CooperateTypeEnum(int code, String name){
+        this.code = code;
+        this.name = name;
+    }
+
+    public static CooperateTypeEnum getName(int code){
+        for (CooperateTypeEnum cooperateStatusEnum : values()) {
+            if (cooperateStatusEnum.getCode() == code) {
+                return cooperateStatusEnum;
+            }
+        }
+        return null;
+    }
+
+}

+ 84 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/EntTypeEnum.java

@@ -0,0 +1,84 @@
+package com.sckw.core.model.enums;
+
+import com.sckw.core.model.constant.Global;
+import com.sckw.core.utils.StringUtils;
+import lombok.Getter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author czh
+ * @desc 企业类型枚举
+ * @date 2023/6/15
+ */
+@Getter
+public enum EntTypeEnum {
+
+    //供应商
+    SUPPLIER(1, "供应商"),
+    //采购商
+    PURCHASER(2, "采购商"),
+    //4PL物流  托运 承运
+    LOGISTICS3(3, "4PL物流"),
+    //3PL物流  承运
+    LOGISTICS4(4, "3PL物流");
+
+    private final int code;
+
+    private final String name;
+
+    EntTypeEnum(int code, String name){
+        this.code = code;
+        this.name = name;
+    }
+
+    public static EntTypeEnum getName(int code) {
+        for (EntTypeEnum entTypeEnum : values()) {
+            if (entTypeEnum.getCode() == code) {
+                return entTypeEnum;
+            }
+        }
+        return null;
+    }
+
+    public static String getNames(String entTypes) {
+        List entNames = new ArrayList();
+        EntTypeEnum [] entTypeEnums = EntTypeEnum.values();
+        for (EntTypeEnum entTypeEnum:entTypeEnums) {
+            if (entTypes.contains(String.valueOf(entTypeEnum.getCode()))) {
+                entNames.add(entTypeEnum.getName());
+            }
+        }
+        return String.join(Global.COMMA, entNames);
+    }
+
+    /**
+     * @param entTypes 企业属性
+     * @desc 校验企业是否为托运单位(供应商、采购商、4P物流)
+     * @author zk
+     * @date 2023/10/7
+     **/
+    public static Boolean check(String entTypes) {
+        if (StringUtils.isBlank(entTypes)) {
+            return null;
+        }
+        return entTypes.contains(String.valueOf(EntTypeEnum.SUPPLIER.getCode()))
+                || entTypes.contains(String.valueOf(EntTypeEnum.PURCHASER.getCode()))
+                || entTypes.contains(String.valueOf(EntTypeEnum.LOGISTICS3.getCode()));
+    }
+
+    /**
+     * @param entTypes 企业属性
+     * @desc 校验企业是否为承运单位(4P物流、3P物流)
+     * @author zk
+     * @date 2023/10/7
+     **/
+    public static Boolean carrier(String entTypes) {
+        if (StringUtils.isBlank(entTypes)) {
+            return null;
+        }
+        return entTypes.contains(String.valueOf(EntTypeEnum.LOGISTICS3.getCode()))
+                || entTypes.contains(String.valueOf(EntTypeEnum.LOGISTICS4.getCode()));
+    }
+}

+ 35 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/EntryTypeEnum.java

@@ -0,0 +1,35 @@
+package com.sckw.core.model.enums;
+
+import lombok.Getter;
+
+/**
+ * @author czh
+ * @desc 企业入驻方式
+ * @date 2023/6/15
+ */
+@Getter
+public enum EntryTypeEnum {
+
+    //自主入驻
+    SELF(1, "自主入驻"),
+    //平台接入
+    PLATFORM(2, "平台接入");
+
+    private final int code;
+
+    private final String name;
+
+    EntryTypeEnum(int code, String name){
+        this.code = code;
+        this.name = name;
+    }
+
+    public static EntryTypeEnum getName(int code) {
+        for (EntryTypeEnum entryTypeEnum : values()) {
+            if (entryTypeEnum.getCode() == code) {
+                return entryTypeEnum;
+            }
+        }
+        return null;
+    }
+}

+ 64 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/GlobalTransactionalEnum.java

@@ -0,0 +1,64 @@
+package com.sckw.core.model.enums;
+
+import org.springframework.util.ObjectUtils;
+
+/**
+ * @author lfdc
+ * @version 1.0
+ * @className GlobalTransactionalEnum
+ * @description 全局事务枚举值
+ * @company sckw
+ * @date 2023-06-05 13:06:54
+ */
+public enum GlobalTransactionalEnum {
+    /**
+     * 默认全局事务
+     */
+    DEFAULT_TX_GROUP(1, "default_tx_group"),
+    /**
+     * 对应系统服务全局事务
+     */
+    SCKW_SYSTEM_SEATA_SERVICE_GROUP(2, "sckw-system-seata-service-group"),
+    /**
+     * 对应报表服务全局事务
+     */
+    SCKW_REPORT_SEATA_SERVICE_GROUP(3, "sckw-report-seata-service-group"),
+    /**
+     * 对应运输服务全局事务
+     */
+    SCKW_TRANSPORT_SEATA_SERVICE_GROUP(4, "sckw-transport-seata-service-group"),
+    ;
+
+    private final Integer code;
+    private final String name;
+
+    GlobalTransactionalEnum(Integer code, String name) {
+        this.code = code;
+        this.name = name;
+    }
+    public Integer getCode() {
+        return code;
+    }
+    public String getName() {
+        return name;
+    }
+    public static String getValue(Integer code) {
+        for (GlobalTransactionalEnum ele : GlobalTransactionalEnum.values()) {
+            if (ele.getCode().equals(code)) {
+                return ele.getName();
+            }
+        }
+        return null;
+    }
+    String getGlobalTransactionalEnum(Integer code) {
+        if (ObjectUtils.isEmpty(code)) {
+            return null;
+        }
+        for (GlobalTransactionalEnum globalTransactionalEnum : GlobalTransactionalEnum.values()) {
+            if (globalTransactionalEnum.getCode().equals(code)) {
+                return globalTransactionalEnum.getName();
+            }
+        }
+        return null;
+    }
+}

+ 44 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/LoginMethodEnum.java

@@ -0,0 +1,44 @@
+package com.sckw.core.model.enums;
+
+/**
+ * @Description 登录类型枚举
+ * @Author zk
+ * @Date 2020/06/15
+ */
+public enum LoginMethodEnum {
+    ORDINARY(1, "账号密码登录"),
+    SMS(2,  "短信登录"),
+    ACCOUNT(3,  "账号登录");
+
+    private int value;
+
+    private String name;
+
+    /**
+     * @description 构造方法
+     * @author zk
+     * @date 2020/6/08 11:28
+     * @param value 键 name 值
+     * @return
+     **/
+    private LoginMethodEnum(int value, String name){
+        this.name = name;
+        this.value = value;
+    }
+
+    public int getValue() {
+        return value;
+    }
+
+    public void setValue(int value) {
+        this.value = value;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 184 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/LogisticsOrderEnum.java

@@ -0,0 +1,184 @@
+package com.sckw.core.model.enums;
+
+import com.sckw.core.common.enums.NumberConstant;
+import lombok.Getter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author lfdc
+ * @description 物流订单-单据状态
+ * @date 2023-07-07 14:07:23
+ */
+@Getter
+public enum LogisticsOrderEnum {
+    /**
+     * 物流订单-待签约
+     */
+    TO_BE_PLANNED(0, "waitingSigning", "0", "待签约"),
+    /**
+     * 物流订单-待接单
+     */
+    PENDING_ORDER(1, "pendingOrder", "1", "待接单"),
+    /**
+     * 物流订单-待派车
+     */
+    WAIT_DELIVERY(2, "waitDelivery", "2", "待派车"),
+    /**
+     * 物流订单-运输中
+     */
+    IN_TRANSIT(3, "inTransit", "3", "运输中"),
+    /**
+     * 物流订单-已完成
+     */
+    //    WAIT_LOADING(4, "waitLoading", "4", "待装货"),
+//    WAIT_UNLOADING(5, "waitUnLoading", "5", "待卸货"),
+    HAVE_FINISHED(4, "haveFinished", "4", "已完成"),
+    /**
+     * 物流订单-已对账
+     */
+    HAVE_RECONCILED(5, "haveReconciled", "5", "已对账"),
+    /**
+     * 物流订单-已结算
+     */
+    HAVE_ALREADY_SETTLED(6, "haveAlreadySettled", "6", "已结算"),
+    /**
+     * 物流订单-已退回
+     */
+    SEND_BACK(7, "sendBack", "7", "已退回"),
+
+    REJECT_ORDER(8, "rejectOrder", "8", "已拒单"),
+
+    CANCEL_ORDER(9, "cancelOrder", "9", "已撤销"),
+    ;
+
+    private final Integer code;
+    private final String value;
+    private final String status;
+    private final String destination;
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public String getDestination() {
+        return destination;
+    }
+
+    LogisticsOrderEnum(Integer code, String value, String status, String destination) {
+        this.code = code;
+        this.value = value;
+        this.status = status;
+        this.destination = destination;
+    }
+
+    public static String getLogisticsOrderValue(Integer code) {
+        for (LogisticsOrderEnum logisticsOrderEnum : LogisticsOrderEnum.values()) {
+            if (logisticsOrderEnum.getCode().equals(code)) {
+                return logisticsOrderEnum.getValue();
+            }
+        }
+        return null;
+    }
+
+    public static String getName(Integer code) {
+        for (LogisticsOrderEnum logisticsOrderEnum : LogisticsOrderEnum.values()) {
+            if (logisticsOrderEnum.getCode().equals(code)) {
+                return logisticsOrderEnum.getDestination();
+            }
+        }
+        return null;
+    }
+
+    public static List<Integer> getCodeList() {
+        List<Integer> codeList = new ArrayList<>(NumberConstant.SIXTEEN);
+        for (LogisticsOrderEnum value : LogisticsOrderEnum.values()) {
+            codeList.add(value.getCode());
+        }
+        return codeList;
+    }
+
+    /**
+     * 获取所有的状态
+     *
+     * @return
+     */
+    public static List<String> getCodeStringList() {
+        List<String> codeList = new ArrayList<>(NumberConstant.SIXTEEN);
+        for (LogisticsOrderEnum value : LogisticsOrderEnum.values()) {
+            codeList.add(value.getStatus());
+        }
+        return codeList;
+    }
+
+
+    public static String getDestination(String status) {
+        for (LogisticsOrderEnum logisticsOrderEnum : LogisticsOrderEnum.values()) {
+            if (logisticsOrderEnum.getStatus().equals(status)) {
+                return logisticsOrderEnum.getDestination();
+            }
+        }
+        return null;
+    }
+
+    public static LogisticsOrderEnum getLogisticsOrderEnumByCode(Integer code) {
+        for (LogisticsOrderEnum logisticsOrderEnum : LogisticsOrderEnum.values()) {
+            if (logisticsOrderEnum.getCode().equals(code)) {
+                return logisticsOrderEnum;
+            }
+        }
+        return null;
+    }
+
+    public static LogisticsOrderEnum getEntityByCode(Integer code) {
+        for (LogisticsOrderEnum logisticsOrderEnum : LogisticsOrderEnum.values()) {
+            if (logisticsOrderEnum.getCode().equals(code)) {
+                return logisticsOrderEnum;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * @param status 物流订单状态
+     * @description 校验物流订单是否运输完成
+     * @author zk
+     * @date 2023/7/31
+     **/
+    public static boolean transportCompleted(int status) {
+        if (status != LogisticsOrderEnum.HAVE_FINISHED.getCode()
+                && status != LogisticsOrderEnum.HAVE_RECONCILED.getCode()
+                && status != LogisticsOrderEnum.HAVE_ALREADY_SETTLED.getCode()) {
+            return false;
+        }
+        return true;
+    }
+
+
+    /**
+     * 获取编码以及注释
+     *
+     * @return
+     */
+    public static String getCodeAndDestination() {
+        StringBuilder sb = new StringBuilder();
+        for (LogisticsOrderEnum value : LogisticsOrderEnum.values()) {
+            sb.append(value.getCode()+":").append(value.destination).append(";");
+        }
+        return sb.toString();
+    }
+
+    public static void main(String[] args) {
+        String codeAndDestination = getCodeAndDestination();
+        System.out.println(codeAndDestination);
+    }
+}

+ 36 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/MenuTypeEnum.java

@@ -0,0 +1,36 @@
+package com.sckw.core.model.enums;
+
+import lombok.Getter;
+
+/**
+ * @author czh
+ * @desc 菜单类型
+ * @date 2023/6/15
+ */
+@Getter
+public enum MenuTypeEnum {
+
+    //菜单
+    DIRECTORY(1, "菜单"),
+    //通过
+    BUTTON(2, "按钮");
+
+    private final int code;
+
+    private final String name;
+
+    MenuTypeEnum(int code, String name){
+        this.code = code;
+        this.name = name;
+    }
+
+    public static MenuTypeEnum getName(int code){
+        for (MenuTypeEnum menuTypeEnum : values()) {
+            if (menuTypeEnum.getCode() == code) {
+                return menuTypeEnum;
+            }
+        }
+        return null;
+    }
+
+}

+ 62 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/OrderRuleEnum.java

@@ -0,0 +1,62 @@
+package com.sckw.core.model.enums;
+
+/**
+ * @author lfdc
+ * @description redis生成编号 key枚举定义
+ * @date 2023-08-25 15:07:23
+ */
+public enum OrderRuleEnum {
+
+    /**
+     * 物流订单
+     */
+    LOGISTICS_ORDER("logisticsOrder", "T", "物流订单业务类别"),
+
+    /**
+     * 贸易订单
+     */
+    TRADE_ORDER("tradeOrder", "B", "贸易订单业务类别"),
+
+    /**
+     * 运单
+     */
+    WAYBILL_ORDER("waybillOrder", "T", "运单业务类别"),
+
+    /**
+     * 对账
+     */
+    LEDGER_LOGISTICS_ORDER("ledgerLogisticsOrder", "TR", "物流对账业务类别"),
+    LEDGER_TRADE_ORDER("ledgerTradeOrder", "BR", "贸易对账业务类别"),
+
+    /**
+     * 结算
+     */
+    SETTLEMENT_LOGISTICS_ORDER("settlementLogisticsOrder", "TP", "物流结算业务类别"),
+    SETTLEMENT_TRADE_ORDER("settlementTradeOrder", "BP", "贸易结算业务类别")    ;
+
+
+    private final String value;
+    private final String code;
+    private final String destination;
+
+
+    OrderRuleEnum(String value, String code, String destination) {
+        this.value = value;
+        this.code = code;
+        this.destination = destination;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public String getDestination() {
+        return destination;
+    }
+
+
+}

+ 68 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ProjectStatusEnum.java

@@ -0,0 +1,68 @@
+package com.sckw.core.model.enums;
+
+import lombok.Getter;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Getter
+public enum ProjectStatusEnum {
+    /**
+     *
+     */
+    SET_UP(0, "立项"),
+    RUNNING(1, "施工中"),
+    FINISH(2, "已竣工"),
+    ;
+    public static Map<Integer, ProjectStatusEnum> MAPS = new HashMap<>();
+
+    static {
+        for (ProjectStatusEnum e : values()) {
+            MAPS.put(e.getCode(), e);
+        }
+    }
+
+    private final Integer code;
+    private final String name;
+
+    ProjectStatusEnum(Integer code, String name) {
+        this.code = code;
+        this.name = name;
+    }
+
+    public static ProjectStatusEnum codeOf(Integer code) {
+        for (ProjectStatusEnum logisticsOrderEnum : ProjectStatusEnum.values()) {
+            if (logisticsOrderEnum.getCode().equals(code)) {
+                return logisticsOrderEnum;
+            }
+        }
+        return null;
+    }
+
+    public static ProjectStatusEnum getProjectStatusEnumByCode(Integer code) {
+        for (ProjectStatusEnum logisticsOrderEnum : ProjectStatusEnum.values()) {
+            if (logisticsOrderEnum.getCode().equals(code)) {
+                return logisticsOrderEnum;
+            }
+        }
+        return null;
+    }
+
+    public static  String getDestination(Integer code){
+        for (ProjectStatusEnum logisticsOrderEnum : ProjectStatusEnum.values()) {
+            if (logisticsOrderEnum.getCode().equals(code)) {
+                return logisticsOrderEnum.getName();
+            }
+        }
+        return null;
+    }
+
+    public static  String getName(Integer code){
+        for (ProjectStatusEnum logisticsOrderEnum : ProjectStatusEnum.values()) {
+            if (logisticsOrderEnum.getCode().equals(code)) {
+                return logisticsOrderEnum.getName();
+            }
+        }
+        return null;
+    }
+}

+ 62 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/RedisOrderGenerateEnum.java

@@ -0,0 +1,62 @@
+package com.sckw.core.model.enums;
+
+import lombok.Getter;
+
+/**
+ * @author lfdc
+ * @description redis生成编号 key枚举定义
+ * @date 2023-08-25 15:07:23
+ */
+@Getter
+public enum RedisOrderGenerateEnum {
+    /**
+     * 物流订单key
+     */
+    LOGISTICS_ORDER("logisticsOrder","logistics_order_no_generator:","物流订单key"),
+
+    /**
+     * 物流订单-分包key
+     */
+    LOGISTICS_SUBCONTRACT_ORDER("logisticsOrder","logistics_subcontract_order_no_generator:","物流订单-分包key"),
+
+    TRADE_ORDER("tradeOrder","trade_order_no_generator:","贸易订单key"),
+
+    /**
+     * 车辆运单key
+     */
+    WAYBILL_ORDER("waybillOrder","waybill_order_no_generator:","车辆运单key"),
+
+    /**
+     * 对账key
+     */
+    LEDGER_CHECKING("ledger","logistics_order_no_generator:","对账key"),
+    /**
+     * 结算key
+     */
+    SETTLEMENT_CHECKING("settlement","logistics_order_no_generator:","结算key"),
+    ;
+
+
+    private final String value;
+    private final String key;
+    private final String name;
+
+    public String getValue() {
+        return value;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    RedisOrderGenerateEnum(String value, String key, String name) {
+        this.value = value;
+        this.key = key;
+        this.name = name;
+    }
+
+}

+ 35 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/SigningWayEnum.java

@@ -0,0 +1,35 @@
+package com.sckw.core.model.enums;
+
+import lombok.Getter;
+
+/**
+ * @author czh
+ * @desc 签约方式
+ * @date 2023/7/14
+ */
+@Getter
+public enum SigningWayEnum {
+
+    //线上签约
+    ONLINE(1, "线上签约"),
+    //线下签约
+    OFFLINE(2, "线下签约");
+
+    private final int code;
+
+    private final String name;
+
+    SigningWayEnum(int code, String name){
+        this.code = code;
+        this.name = name;
+    }
+
+    public static SigningWayEnum getName(int code){
+        for (SigningWayEnum signingWayEnum : values()) {
+            if (signingWayEnum.getCode() == code) {
+                return signingWayEnum;
+            }
+        }
+        return null;
+    }
+}

+ 36 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/SystemTypeEnum.java

@@ -0,0 +1,36 @@
+package com.sckw.core.model.enums;
+
+import lombok.Getter;
+
+/**
+ * @author czh
+ * @desc 系统类型枚举
+ * @date 2023/6/15
+ */
+@Getter
+public enum SystemTypeEnum {
+    //运营端
+    MANAGE(1, "运营端"),
+    //企业开户
+    COMPANY(2, "企业端"),
+    //司机
+    DRIVER(3, "司机端");
+
+    private final Integer code;
+
+    private final String name;
+
+    SystemTypeEnum(Integer code, String name){
+        this.code = code;
+        this.name = name;
+    }
+
+    public static SystemTypeEnum getName(Integer code){
+        for (SystemTypeEnum systemTypeEnum : values()) {
+            if (systemTypeEnum.getCode().equals(code)) {
+                return systemTypeEnum;
+            }
+        }
+        return null;
+    }
+}

+ 49 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/TaxRateTypeEnum.java

@@ -0,0 +1,49 @@
+package com.sckw.core.model.enums;
+
+import lombok.Data;
+
+/**
+ * desc 合理损耗单位
+ * author zk
+ * date 2023/9/4 0004
+ */
+public enum TaxRateTypeEnum {
+
+    //‰
+    PERCENT(0, "‰", 1000),
+    //%
+    MILLIMETER(1, "%", 100);
+
+    private final Integer code;
+
+    private final String name;
+
+    private final Integer value;
+
+    TaxRateTypeEnum(Integer code, String name, Integer value){
+        this.code = code;
+        this.name = name;
+        this.value = value;
+    }
+
+    public static TaxRateTypeEnum getName(Integer code){
+        for (TaxRateTypeEnum typeEnum : values()) {
+            if (typeEnum.getCode().equals(code)) {
+                return typeEnum;
+            }
+        }
+        return null;
+    }
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public Integer getValue() {
+        return value;
+    }
+}

+ 82 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/file/FileInfo.java

@@ -0,0 +1,82 @@
+package com.sckw.core.model.file;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @author lfdc
+ * @description 文件信息
+ * @date 2023-07-03 15:07:00
+ */
+@Data
+public class FileInfo implements Serializable {
+
+    /**
+     * 文件上传类型 oss/qiniuyun
+     */
+    @NotBlank(message = "文件上传类型不能为空")
+    private String type;
+
+    /**
+     * 文件原名称
+     */
+    @NotBlank(message = "文件原名称不能为空")
+    private String fileOriginalName;
+    /**
+     * 文件加密key
+     */
+    @NotBlank(message = "文件加密key不能为空")
+    private String fileMd5;
+
+    /**
+     * 文件新名称
+     */
+    @NotBlank(message = "文件新名称不能为空")
+    private String fileName;
+    /**
+     * 文件后缀
+     */
+    @NotBlank(message = "文件后缀不能为空")
+    private String fileSuffix;
+    /**
+     * 文件大小  默认为mb
+     */
+    @NotNull(message = "文件大小不能为空")
+    private BigDecimal fileSize;
+
+    /**
+     * 文件相对路径
+     */
+    @NotBlank(message = "文件相对路径不能为空")
+    private String filePath;
+    /**
+     * 文件绝对路径
+     */
+    @NotBlank(message = "文件绝对路径不能为空")
+    private String fileAbsolutePath;
+
+    @JsonFormat(timezone = "yyyy-MM-dd HH:mm:ss")
+    @NotBlank
+    private String createTime;
+
+    @NotNull(message = "文件修改人不能为空")
+    private Long updateBy;
+    @NotNull(message = "文件上传人不能为空")
+    private Long createBy;
+
+    @NotBlank
+    @JsonFormat(timezone = "yyyy-MM-dd HH:mm:ss")
+    private String updateTime;
+
+    @NotNull(message = "文件删除标志不能为空")
+    private Integer delFlag;
+
+    @NotNull(message = "文件状态不能为空")
+    private Integer status;
+
+}

+ 1 - 2
slope-common/slope-common-core/src/main/java/com/sckw/core/utils/LocUtils.java

@@ -1,5 +1,6 @@
 package com.sckw.core.utils;
 
+import java.io.IOException;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.sckw.core.model.constant.Global;
@@ -10,8 +11,6 @@ import org.apache.http.client.methods.HttpGet;
 import org.apache.http.impl.client.HttpClients;
 import org.apache.http.util.EntityUtils;
 
-import java.io.IOException;
-
 public class LocUtils {
 
     static String GD_KEY = "739ace2ede6fe1e2f4ae3bcba890833c";

+ 226 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/utils/OrderGenerateSeqNoUtils.java

@@ -0,0 +1,226 @@
+package com.sckw.core.utils;
+
+import com.sckw.core.common.enums.StringConstant;
+import com.sckw.core.model.enums.OrderRuleEnum;
+import com.sckw.core.model.enums.RedisOrderGenerateEnum;
+import com.sckw.redis.utils.RedissonUtils;
+import jakarta.annotation.Resource;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.support.atomic.RedisAtomicLong;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.Objects;
+
+/**
+ * @author lfdc
+ * @description 物流订单编号生成工具类
+ * @date 2023-08-25 16:08:41
+ */
+@Slf4j
+@Component
+public class OrderGenerateSeqNoUtils {
+
+
+    @Resource
+    private RedisTemplate redisTemplate;
+
+    /**
+     * 物流订单编号生成
+     *
+     * @param redisOrderGenerateEnum 传入指定枚举的key
+     * @param prefix                 业务类别
+     * @param orderType              单据创建类型
+     * @param level                  所属几级分包
+     * @param number                 同级分包次数
+     * @return
+     */
+    public static String getSeqNo(RedisOrderGenerateEnum redisOrderGenerateEnum, OrderRuleEnum prefix, String orderType, String level, String number) {
+        if (prefix == null) {
+            throw new RuntimeException("Order Generate SeqNo Error");
+        }
+        Date now = new Date();
+        String appendKey = getKey(redisOrderGenerateEnum, prefix, now);
+        //设置过期时间,这里设置为当天的23:59:59
+        Long secondsDay = DateUtils.getSecondsDay();
+        Long seq = generate(appendKey, secondsDay);
+        String date = DateUtils.formatDateToYYMMDD(now);
+        String sequence = String.format("%04d", seq);
+        /**拼接业务编号*/
+        String seqNo = prefix.getCode() + date + sequence;
+        /**extendBusiness 根据实际业务是否需要 */
+        String seqNoEnd = extendBusiness(seqNo, orderType, level, number);
+        log.info("KEY:{}, 序列号生成:{}, 过期时间:{}秒", appendKey, seqNo, secondsDay);
+        return seqNoEnd;
+    }
+
+    private static String extendBusiness(String seqNo, String orderType, String level, String number) {
+        return seqNo + orderType + level + number;
+    }
+
+    /**
+     * 拼接redis key 公共key+[业务标识]+日期
+     *
+     * @param redisOrderGenerateEnum
+     * @param prefix
+     * @param date
+     * @return
+     */
+    public static String getKey(RedisOrderGenerateEnum redisOrderGenerateEnum, OrderRuleEnum prefix, Date date) {
+        StringBuilder stringBuilder = new StringBuilder();
+        StringBuilder appendKey = stringBuilder.append(redisOrderGenerateEnum.getKey()).append(prefix.getCode()).append(DateUtils.formatDate(date));
+        return appendKey.toString();
+    }
+
+    /**
+     * 拼接redis key 公共key+[业务标识]+日期
+     *
+     * @param redisOrderGenerateEnum
+     * @param prefix
+     * @param date
+     * @return
+     */
+    public static String getKey(RedisOrderGenerateEnum redisOrderGenerateEnum, OrderRuleEnum prefix, Date date,String lOrderId) {
+        StringBuilder stringBuilder = new StringBuilder();
+        StringBuilder appendKey = stringBuilder.append(redisOrderGenerateEnum.getKey()).append(prefix.getCode()).append(DateUtils.formatDate(date)).append(lOrderId);
+        return appendKey.toString();
+    }
+
+    /**
+     * 拼接redis key 公共key+[业务标识]不携带日期
+     *
+     * @param redisOrderGenerateEnum
+     * @param prefix
+     * @param str
+     * @return
+     */
+    public static String getKeyNotDate(RedisOrderGenerateEnum redisOrderGenerateEnum, OrderRuleEnum prefix, String str) {
+        StringBuilder stringBuilder = new StringBuilder();
+        StringBuilder appendKey = new StringBuilder();
+        if (StringUtils.isNotEmpty(str)) {
+            appendKey = stringBuilder.append(redisOrderGenerateEnum.getKey()).append(prefix.getCode()).append(str);
+        } else {
+            appendKey = stringBuilder.append(redisOrderGenerateEnum.getKey()).append(prefix.getCode());
+        }
+        return appendKey.toString();
+    }
+
+    /**
+     * //返回当前redis中的key的最大值
+     *
+     * @param redisTemplate
+     * @param key           redisKey
+     * @param expireTime    过期时间
+     * @return
+     */
+    public long generate(RedisTemplate<?, ?> redisTemplate, String key, Date expireTime) {
+        //RedisAtomicLong为原子类,根据传入的key和redis链接工厂创建原子类
+        RedisAtomicLong counter = new RedisAtomicLong(key, redisTemplate.getConnectionFactory());
+        //设置过期时间
+        counter.expireAt(expireTime);
+        //返回redis中key的值,内部实现下面详细说明
+        return counter.incrementAndGet();
+    }
+
+
+    /**
+     * 返回当前redis中的key的最大值
+     *
+     * @param key        redisKey
+     * @param expireTime 过期时间
+     * @return
+     */
+    public static long generate(String key, Long expireTime) {
+        //RedisAtomicLong counter = new RedisAtomicLong(key, redisTemplate.getConnectionFactory());
+//        //设置过期时间
+//        counter.expireAt(expireTime);
+//        //返回redis中key的值,内部实现下面详细说明
+//        return counter.incrementAndGet();
+        return RedissonUtils.getAtomicLong(key, expireTime);
+    }
+
+
+    /**
+     * redis 根据key需要减一
+     *
+     * @param redisOrderGenerateEnum
+     * @param prefix
+     * @return
+     */
+    public static String getSeqNoMinusOne(RedisOrderGenerateEnum redisOrderGenerateEnum, OrderRuleEnum prefix) {
+        if (prefix == null) {
+            throw new RuntimeException("Order Generate SeqNo Error");
+        }
+        Date now = new Date();
+        String appendKey = getKey(redisOrderGenerateEnum, prefix, now);
+        //设置过期时间,这里设置为当天的23:59:59
+        Long secondsDay = DateUtils.getSecondsDay();
+        Long seq = getMinusOne(appendKey, secondsDay);
+        String date = DateUtils.formatDateToYYMMDD(now);
+        String sequence = String.format("%04d", seq);
+        /**拼接业务编号*/
+        String seqNo = prefix.getCode() + date + sequence;
+        log.info("KEY:{}, 序列号生成:{}, 过期时间:{}秒", appendKey, seqNo, secondsDay);
+        return seqNo;
+    }
+
+    public static long getMinusOne(String key, Long expireTime) {
+        long seq = RedissonUtils.decrementAndGet(key, expireTime);
+//        RedisAtomicLong counter = new RedisAtomicLong(key, redisTemplate.getConnectionFactory());
+//        //设置过期时间
+//        counter.expireAt(expireTime);
+//        //返回redis中key的值,内部实现下面详细说明
+//        return counter.incrementAndGet();
+        return seq;
+    }
+
+
+    /**
+     * 贸易订单/对账/结算生成规则
+     *
+     * @param redisOrderGenerateEnum 传入枚举指定的key
+     * @param prefix                 业务类别
+     * @return
+     */
+    public static String getOtherSeqNo(RedisOrderGenerateEnum redisOrderGenerateEnum, OrderRuleEnum prefix) {
+        if (Objects.isNull(prefix)) {
+            throw new RuntimeException("Order Generate SeqNo Error");
+        }
+        Date now = new Date();
+        String appendKey = getKey(redisOrderGenerateEnum, prefix, now);
+        //设置过期时间,这里设置为当天的23:59:59
+        Long secondsDay = DateUtils.getSecondsDay();
+        Long seq = generate(appendKey, secondsDay);
+        String date = DateUtils.formatDateToYYMMDD(now);
+        String sequence = String.format("%04d", seq);
+        /**拼接业务编号*/
+        String seqNo = prefix.getCode() + date + sequence;
+        log.info("KEY:{}, 序列号生成:{}, 过期时间:{}秒", appendKey, seqNo, secondsDay);
+        return seqNo;
+    }
+
+
+    /**
+     * 车辆运单编号规则生成
+     *
+     * @param redisOrderGenerateEnum 传入枚举指定的key
+     * @param prefix                 业务类别
+     * @return
+     */
+    public static String getWaybillSeqNo(RedisOrderGenerateEnum redisOrderGenerateEnum, OrderRuleEnum prefix, String pidOrderNo) {
+        if (Objects.isNull(prefix)) {
+            throw new RuntimeException("Order Generate SeqNo Error");
+        }
+        String appendKey = getKeyNotDate(redisOrderGenerateEnum, prefix, pidOrderNo);
+        //设置过期时间,这里设置为当天的23:59:59
+        Long secondsDay = DateUtils.getSecondsDay();
+        Long seq = generate(appendKey, secondsDay);
+        String sequence = com.sckw.core.utils.StringUtils.addZeroForNum(seq.toString(), 3);
+        /**拼接业务编号*/
+        String seqNo = pidOrderNo + StringConstant.HYPHEN + sequence;
+        log.info("KEY:{}, 序列号生成:{}, 过期时间:{}秒", appendKey, seqNo, secondsDay);
+        return seqNo;
+    }
+}

+ 57 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/utils/OrderGenerateUtils.java

@@ -0,0 +1,57 @@
+package com.sckw.core.utils;
+
+import com.sckw.redis.utils.RedissonUtils;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * @desc: 订单号生成工具类
+ * @author: yzc
+ * @date: 2023-07-12 19:10
+ */
+@Component
+public class OrderGenerateUtils {
+
+
+    /**
+     * 格式化的时间字符串
+     */
+    private static final SimpleDateFormat SDF = new SimpleDateFormat("yyyyMMddHHmmss");
+
+    /**
+     * redisson生成订单号 name
+     */
+    private static final String ORDER_NO_GENERATOR = "order_no_generator:";
+
+
+    /**
+     * redisson生成订单号 name(物流订单)
+     */
+    private static final String LOGISTICS_ORDER_NO_GENERATOR = "logistics_order_no_generator:";
+
+
+    /**
+     * @desc: 生成订单号
+     * @author: yzc
+     * @date: 2023-07-12 20:20
+     * @Param prefix:
+     * @return: java.lang.String
+     */
+    public static String generateOrderNo(String prefix) {
+        String date = getNowDateStr();
+        long orderId = RedissonUtils.getAtomicLong(ORDER_NO_GENERATOR + date,60L);
+        return String.format("%s%s%04d", prefix, date, orderId);
+    }
+
+    /**
+     * 获取当前时间年月日字符串
+     *
+     * @return
+     */
+    private static String getNowDateStr() {
+        return SDF.format(new Date());
+    }
+
+}

+ 31 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/utils/OrderUtils.java

@@ -0,0 +1,31 @@
+package com.sckw.core.utils;
+
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicLong;
+
+@Component
+public class OrderUtils {
+    private static final String ORDER_DATE_FORMAT = "yyyyMMddHHmmss";
+    private static final int ORDER_NUMBER_WIDTH = 4;
+    private static final SimpleDateFormat sdf = new SimpleDateFormat(ORDER_DATE_FORMAT);
+    private static final ConcurrentHashMap<String, AtomicLong> orderCounters = new ConcurrentHashMap<>();
+    private static String currentDateStr = "";
+
+    public static String generateOrderNo(String prefix) {
+        String currentDateString = sdf.format(new Date());
+        if (!currentDateString.equals(currentDateStr)) {
+            orderCounters.put(prefix, new AtomicLong(0));
+            currentDateStr = currentDateString;
+        }
+        // 获取或创建与前缀相关联的订单号计数器
+        AtomicLong counter = orderCounters.computeIfAbsent(prefix, key -> new AtomicLong(0));
+        // 自增并获取当前订单号
+        long orderId = counter.incrementAndGet();
+        // 格式化订单号
+        return String.format("%s%s%0" + ORDER_NUMBER_WIDTH + "d", prefix, currentDateString, orderId);
+    }
+}

+ 2 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/utils/PasswordUtils.java

@@ -1,5 +1,7 @@
 package com.sckw.core.utils;
 
+import com.alibaba.fastjson2.JSON;
+
 import java.security.MessageDigest;
 import java.util.UUID;
 

+ 1 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/utils/RegularUtils.java

@@ -1,5 +1,6 @@
 package com.sckw.core.utils;
 
+import java.math.BigDecimal;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 

+ 2 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/utils/workerUtils.java

@@ -1,5 +1,7 @@
 package com.sckw.core.utils;
 
+import org.w3c.dom.CDATASection;
+
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;

+ 0 - 34
slope-common/slope-common-core/src/main/java/com/sckw/core/web/config/CustomConfig.java

@@ -1,34 +0,0 @@
-package com.sckw.core.web.config;
-
-import lombok.Data;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Component;
-
-/**
- * @author czh
- * @desc 自定义配置类
- * @date 2023/6/16
- */
-@Data
-@Component
-public class CustomConfig {
-
-    /**
-     * 直接放行的请求链接
-     */
-    @Value("${links}")
-    private String links;
-
-//    /**
-//     * 是否允许一个账号绑定多个角色
-//     */
-//    @Value("${isBindManyRole}")
-//    private Integer isBindManyRole;
-
-//    /**
-//     * 需要token校验但不需要接口权限校验的请求链接
-//     */
-//    @Value("${withoutLinks}")
-//    private String withoutLinks;
-
-}

+ 0 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/web/config/GlobalTransactionalConfig.java


+ 2 - 1
slope-common/slope-common-core/src/main/java/com/sckw/core/web/request/HttpClientUtil.java

@@ -1,5 +1,6 @@
 package com.sckw.core.web.request;
 
+import com.alibaba.fastjson.JSON;
 import com.sckw.core.model.constant.Global;
 import com.sckw.core.utils.StringUtils;
 import lombok.extern.slf4j.Slf4j;
@@ -18,9 +19,9 @@ import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
 import org.apache.http.message.BasicNameValuePair;
 import org.apache.http.util.EntityUtils;
-
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 

+ 0 - 1
slope-common/slope-common-core/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@@ -1,7 +1,6 @@
 com.sckw.core.aspect.DaoAspect
 com.sckw.core.aspect.NoRepeatSubmitAspect
 com.sckw.core.exception.GlobalSystemExceptionHandler
-#com.sckw.core.web.config.CustomConfig
 com.sckw.core.config.MybatisPlusConfig
 com.sckw.core.config.JacksonConfig
 com.sckw.core.filter.ExceptionFilterConfig

+ 8 - 2
slope-common/slope-common-datasource/pom.xml

@@ -11,12 +11,11 @@
 
     <artifactId>slope-common-datasource</artifactId>
     <description>数据库连接</description>
-
     <properties>
         <maven.compiler.source>17</maven.compiler.source>
         <maven.compiler.target>17</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>
-
     <dependencies>
         <!--mysql-->
         <dependency>
@@ -36,6 +35,13 @@
             <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
         </dependency>
 
+        <!-- https://mvnrepository.com/artifact/com.taosdata.jdbc/taos-jdbcdriver -->
+        <dependency>
+            <groupId>com.taosdata.jdbc</groupId>
+            <artifactId>taos-jdbcdriver</artifactId>
+            <version>3.2.5</version>
+        </dependency>
+
         <!--ShardingSphere-JDBC-->
         <dependency>
             <groupId>org.apache.shardingsphere</groupId>

+ 1 - 0
slope-common/slope-common-excel/pom.xml

@@ -15,6 +15,7 @@
     <properties>
         <maven.compiler.source>17</maven.compiler.source>
         <maven.compiler.target>17</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>
 
     <dependencies>

+ 1 - 1
slope-common/slope-common-excel/src/main/java/com/sckw/excel/config/easyexcel/CustomCellWeightWeightConfig.java

@@ -8,10 +8,10 @@ import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
 import com.alibaba.excel.write.style.column.AbstractColumnWidthStyleStrategy;
 import com.sckw.core.common.enums.NumberConstant;
 import com.sckw.core.model.constant.Global;
-import com.sckw.core.utils.CollectionUtils;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.CellType;
 import org.apache.poi.ss.usermodel.Sheet;
+import org.springframework.util.CollectionUtils;
 
 import java.util.HashMap;
 import java.util.List;

+ 0 - 50
slope-common/slope-common-excel/src/main/java/com/sckw/excel/translate/SourceUtil.java

@@ -1,50 +0,0 @@
-package com.sckw.excel.translate;
-
-import com.sckw.core.exception.SourceInitializeException;
-import lombok.extern.slf4j.Slf4j;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- *
- * 数据源工具类
- *
- *
- * @author lfdc
- * @version v1
- * @create 2020-11-28 16:33:14
- * @copyright
- */
-@Slf4j
-//@Component
-//@Configuration
-public class SourceUtil {
-
-    public static Map<com.sckw.excel.translate.enums.Source,
-            com.sckw.excel.translate.context.Source> SOURCES_INSTANCE = new HashMap<>(2);
-
-    public static void put(com.sckw.excel.translate.enums.Source source,
-                           com.sckw.excel.translate.context.Source instance) {
-        SOURCES_INSTANCE.put(source, instance);
-    }
-
-    public static void remove(com.sckw.excel.translate.enums.Source source) {
-        SOURCES_INSTANCE.remove(source);
-    }
-
-    public static void clear() {
-        for (com.sckw.excel.translate.enums.Source source : SOURCES_INSTANCE.keySet()) {
-            SOURCES_INSTANCE.get(source).clear();
-        }
-    }
-
-    static Map<Integer, Object> get(com.sckw.excel.translate.enums.Source source) throws SourceInitializeException {
-        try {
-            return SOURCES_INSTANCE.get(source).get();
-        } catch (Exception e) {
-            log.error("failed to get data source, ex:{}", e.toString());
-            throw e;
-        }
-    }
-}

+ 0 - 20
slope-common/slope-common-excel/src/main/java/com/sckw/excel/translate/Sources.java

@@ -1,20 +0,0 @@
-package com.sckw.excel.translate;
-
-/**
- *
- * 数据源常量
- *
- *
- * @author lfdc
- * @version v1
- * @create 2020-11-28 16:59:58
- * @copyright
- */
-public class Sources {
-
-    public static final String SOURCE_DICTIONARY = "source_dictionary";
-
-    public static final String SOURCE_ORGANIZATION = "source_organization";
-
-    public static final String SOURCE_ENUMERATE = "source_enumerate";
-}

+ 0 - 117
slope-common/slope-common-excel/src/main/java/com/sckw/excel/translate/Translator.java

@@ -1,117 +0,0 @@
-package com.sckw.excel.translate;
-
-
-import com.sckw.core.common.enums.NumberConstant;
-import com.sckw.core.exception.SourceInitializeException;
-import com.sckw.core.exception.TranslateException;
-import com.sckw.excel.translate.annotation.Translate;
-import com.sckw.excel.translate.annotation.Translates;
-import com.sckw.excel.translate.enums.Source;
-import com.sckw.excel.translate.wrapper.AbstractTranslator;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.lang.Nullable;
-import org.springframework.util.Assert;
-
-import java.util.*;
-
-/**
- *
- * 处理翻译字段
- *
- *
- * @author lfdc
- * @version v1
- * @create 2020-11-28 15:17:54
- * @copyright
- */
-@Slf4j
-public class Translator extends AbstractTranslator {
-
-
-
-    /**
-     * 对某个参数值进行翻译 传入编码或者ID并指定数据源
-     * 如果传入的编码值没有匹配的数据会返回NULL
-     *
-     * @param code 参数编码值
-     * @param source 数据源{@see com.***.g3.common.translate.enums.Source}
-     * @return 翻译后的值
-     * @throws TranslateException 初始化数据源失败时抛出异常
-     */
-    @Nullable
-    public static Object translate(Integer code, Source source) {
-        try {
-            return SourceUtil.get(source).get(code);
-        } catch (Exception e) {
-            throw new TranslateException("translation failed. ex:" + e.toString(), e);
-        }
-    }
-
-    /**
-     * 对多个参数值进行翻译 传入编码或者ID的集合并指定数据源
-     * 如果传入的编码值没有匹配的数据会返回原始值
-     *
-     * @param codes  参数编码值 list
-     * @param source 数据源 {@see com.owinfo.mpw.common.translate.enums.Source}
-     * @return 翻译后的值
-     * @throws TranslateException 初始化数据源失败时抛出异常
-     */
-    @Nullable
-    public static List<Integer> translate(List<Integer> codes, Source source) {
-        try {
-            Map<Integer, Object> sources = SourceUtil.get(source);
-            List<Integer> result = new ArrayList<>(codes.size());
-            for (Integer code : codes) {
-                Object target = sources.get(code);
-                if (target == null) {
-                    log.warn("the target value of the translation is null, fieldValue -> {}", code);
-                    result.add(code);
-                } else {
-//                    result.add(target.toString());
-                    result.add((Integer) target);
-                }
-            }
-            return result;
-        } catch (Exception e) {
-            throw new TranslateException("translation failed. ex:" + e.toString(), e);
-        }
-    }
-
-    /**
-     * 对集合中所有的实体进行翻译
-     * 需要在实体中使用 {@link Translates} 或者 {@link Translate} 指定需要翻译的字段
-     * 指定后当前集合都会按照配置的字段列表进行翻译所有实体
-     *
-     * @param list 需要翻译的源实体 不能为空
-     * @throws TranslateException 初始化数据源失败时抛出异常
-     */
-    public static void translate(List list) {
-        try {
-            Assert.isTrue(list != null && list.size() > NumberConstant.ZERO, "the data source cannot be empty");
-            Translates translates = list.get(0).getClass().getAnnotation(Translates.class);
-            if (translates != null && translates.value().length > NumberConstant.ZERO) {
-                translate(Arrays.asList(translates.value()), list, getSources());
-                return;
-            }
-            Translate translate = list.get(0).getClass().getAnnotation(Translate.class);
-            if (translate != null) {
-                translate(Collections.singletonList(translate), list, getSources());
-                return;
-            }
-            throw new IllegalArgumentException("must specify @Translates or @Translate");
-        } catch (Exception e) {
-            if (e instanceof TranslateException) {
-                throw (TranslateException) e;
-            }
-            throw new TranslateException("translation failed. ex:" + e.toString(), e);
-        }
-    }
-
-    public static Map<Source, Map<Integer, Object>> getSources() throws SourceInitializeException {
-        Map<Source, Map<Integer, Object>> sources = new HashMap<>(2);
-        //sources.put(Source.DICTIONARY, SourceUtil.get(Source.DICTIONARY));
-//        sources.put(Source.ORGANIZATION, SourceUtil.get(Source.ORGANIZATION));
-        sources.put(Source.ENUMS, SourceUtil.get(Source.ENUMS));
-        return sources;
-    }
-}

+ 0 - 43
slope-common/slope-common-excel/src/main/java/com/sckw/excel/translate/annotation/Translate.java

@@ -1,43 +0,0 @@
-package com.sckw.excel.translate.annotation;
-
-
-import java.lang.annotation.*;
-
-/**
- *
- * 对某个字段进行翻译
- *
- * 可以标注在类和方法上
- * 1. 标注在类上:适用于对整个实体的指定字段进行翻译
- * 2. 标注在方法上:适用于对方法的返回值中的data数据实体进行翻译
- *
- * 标注在类和方法上时,如果同时存在@Translates和@Translate,则@Translates会生效,@Translate不会生效
- *
- * @author lfdc
- * @version v1
- * @create 2020-11-28 15:36:35
- * @copyright
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.TYPE, ElementType.METHOD})
-@Repeatable(Translates.class)
-@Documented
-public @interface Translate {
-    /**
-     * 需要翻译的字段
-     */
-    String field();
-    /**
-     * 指定数据源
-     */
-    com.sckw.excel.translate.enums.Source source()
-            default com.sckw.excel.translate.enums.Source.ENUMS;
-    /**
-     * 字段值为字符串
-     */
-    boolean isString() default true;
-    /**
-     * 字段值为数组
-     */
-    boolean isArray() default false;
-}

+ 0 - 21
slope-common/slope-common-excel/src/main/java/com/sckw/excel/translate/annotation/Translates.java

@@ -1,21 +0,0 @@
-package com.sckw.excel.translate.annotation;
-
-import java.lang.annotation.*;
-
-/**
- *
- * 组合注解
- * 用于指定翻译多个字段
- *
- * @author lfdc
- * @version v1
- * @create 2020-11-28 15:37:35
- * @copyright
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.TYPE, ElementType.METHOD})
-@Documented
-public @interface Translates {
-
-    Translate[] value();
-}

+ 0 - 72
slope-common/slope-common-excel/src/main/java/com/sckw/excel/translate/context/Enums.java

@@ -1,72 +0,0 @@
-package com.sckw.excel.translate.context;
-
-import com.sckw.core.common.enums.NumberConstant;
-import com.sckw.core.exception.SourceInitializeException;
-import com.sckw.excel.translate.Sources;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.Ordered;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.stereotype.Component;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-/**
- * @author lfdc
- * @version v1
- * @create 2022-01-24 16:23:31
- * @copyright
- */
-@Component("enumsSource")
-public class Enums implements Source, Ordered {
-
-    @Autowired
-    private RedisTemplate<String, Object> redisTemplate;
-
-
-    public Enums() {
-        initial();
-    }
-
-    @Override
-    @SuppressWarnings("unchecked")
-    public Map<Integer, Object> get() throws SourceInitializeException {
-        Object values = redisTemplate.opsForValue().get(Sources.SOURCE_ENUMERATE);
-        if (values == null) {
-            return flush();
-        }
-        return (Map<Integer, Object>) values;
-    }
-
-    /**
-     * 该方法获取枚举数据
-     * @return
-     * @throws SourceInitializeException
-     */
-    @Override
-    @SuppressWarnings("unchecked")
-    public Map<Integer, Object> flush() throws SourceInitializeException {
-        try {
-            Map<Integer, Object> source = new HashMap<>(NumberConstant.SIXTEEN);
-//            source.putAll(Stream.of(OrderCancelEnum.values()).collect(Collectors.toMap(OrderCancelEnum::getCode, OrderCancelEnum::getMsg)));
-//            source.putAll(Stream.of(WarehouseCheckEnum.values()).collect(Collectors.toMap(WarehouseCheckEnum::getCode, WarehouseCheckEnum::getMsg)));
-//            source.putAll(Stream.of(LogisticsOrderEnum.values()).collect(Collectors.toMap(LogisticsOrderEnum::getCode, LogisticsOrderEnum::getDestination)));
-            redisTemplate.opsForValue().set(Sources.SOURCE_ENUMERATE, source, 1, TimeUnit.DAYS);
-            return source;
-        } catch (Exception e) {
-            throw new SourceInitializeException("failed to get enumerate cache data, ex:" + e.toString());
-        }
-    }
-
-    @Override
-    public void clear() {
-        redisTemplate.delete(Sources.SOURCE_ENUMERATE);
-    }
-
-    @Override
-    public int getOrder() {
-        return Ordered.LOWEST_PRECEDENCE;
-    }
-
-}

+ 0 - 87
slope-common/slope-common-excel/src/main/java/com/sckw/excel/translate/context/Organization.java

@@ -1,87 +0,0 @@
-package com.sckw.excel.translate.context;
-
-import com.alibaba.fastjson.JSON;
-import com.sckw.core.common.enums.NumberConstant;
-import com.sckw.excel.translate.Sources;
-import com.sckw.core.exception.SourceInitializeException;
-import com.sckw.excel.translate.properties.TranslateProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.Ordered;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.stereotype.Component;
-import org.springframework.util.Assert;
-import org.springframework.web.client.RestTemplate;
-
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-/**
- *
- * 组织机构信息数据源
- *
- *
- * @author lfdc
- * @version v1
- * @create 2020-11-28 14:18:49
- * @copyright
- */
-@Component(value = "organizationSource")
-public class Organization implements Source, Ordered {
-
-    @Autowired
-    private RedisTemplate<String, Object> redisTemplate;
-
-    @Autowired
-    private RestTemplate restTemplate;
-
-    @Autowired
-    private TranslateProperties properties;
-
-    public Organization() {
-        initial();
-    }
-
-    @Override
-    @SuppressWarnings("unchecked")
-    public Map<Integer, Object> get() throws SourceInitializeException {
-        Object values = redisTemplate.opsForValue().get(Sources.SOURCE_ORGANIZATION);
-        if (values == null) {
-            return flush();
-        }
-        return (Map<Integer, Object>) values;
-    }
-
-    @Override
-    @SuppressWarnings("unchecked")
-    public Map<Integer, Object> flush() throws SourceInitializeException {
-        try {
-            String content = restTemplate.postForObject(properties.getOrganizationUrl(), null, String.class);
-            Map<String, Object> result = JSON.parseObject(content, Map.class);
-
-            Object status = result.get("status");
-            Assert.isTrue(status != null && (Integer) status == NumberConstant.TWO_HUNDRED, "The status code returned is failure");
-
-            Object data = result.get("data");
-            if (data != null) {
-                Map<Integer, Object> source = (Map<Integer, Object>) result.get("data");
-                if (!source.isEmpty()) {
-                    redisTemplate.opsForValue().set(Sources.SOURCE_ORGANIZATION, source, properties.getExpireTime(), TimeUnit.MINUTES);
-                    return source;
-                }
-            }
-            throw new SourceInitializeException("the resulting organization cache data is empty");
-        } catch (Exception e) {
-            throw new SourceInitializeException("failed to get organization cache data, ex:" + e.toString());
-        }
-    }
-
-    @Override
-    public void clear() {
-        redisTemplate.delete(Sources.SOURCE_ORGANIZATION);
-    }
-
-    @Override
-    public int getOrder() {
-        return Ordered.LOWEST_PRECEDENCE;
-    }
-}

+ 0 - 48
slope-common/slope-common-excel/src/main/java/com/sckw/excel/translate/context/Source.java

@@ -1,48 +0,0 @@
-package com.sckw.excel.translate.context;
-
-
-import com.sckw.core.exception.SourceInitializeException;
-import com.sckw.excel.translate.SourceUtil;
-
-import java.util.Map;
-
-/**
- *
- * 翻译数据的数据源
- *
- *
- * @author lfdc
- * @version v1
- * @create 2020-11-28 14:15:00
- * @copyright
- */
-public interface Source {
-
-    /**
-     * 获取数据源
-     * @return key value格式的数据
-     * @throws SourceInitializeException 初始化数据源失败时抛出的异常
-     */
-    Map<Integer, Object> get() throws SourceInitializeException;
-
-    /**
-     * 刷新数据源
-     * @return 新的数据源
-     * @throws SourceInitializeException 初始化数据源失败时抛出的异常
-     */
-    Map<Integer, Object> flush() throws SourceInitializeException;
-
-    /**
-     * 清除数据源
-     */
-    void clear();
-
-    /**
-     * 初始化
-     */
-    default void initial() {
-        SourceUtil.put(com.sckw.excel.translate.enums.Source.valueOf(this.getClass()), this);
-    }
-
-
-}

+ 0 - 55
slope-common/slope-common-excel/src/main/java/com/sckw/excel/translate/enums/Source.java

@@ -1,55 +0,0 @@
-package com.sckw.excel.translate.enums;
-
-/**
- *
- * 数据源枚举
- *
- *
- * @author lfdc
- * @version v1
- * @create 2020-12-01 11:18:37
- * @copyright
- */
-public enum Source {
-
-    TEST("com.sckw.excel.translate.context.Enums"),
-    /**
-     * 字典
-     */
-    DICTIONARY("context.Dictionary"),
-    /**
-     * 人员机构
-     */
-    ORGANIZATION("com.sckw.excel.translate.context.Organization"),
-    /**
-     * 枚举值
-     */
-    ENUMS("com.sckw.excel.translate.context.Enums");
-
-    private String clazz;
-
-    Source(String clazz) {
-        this.clazz = clazz;
-    }
-
-    public String getClazz() {
-        return clazz;
-    }
-
-    public static <T extends com.sckw.excel.translate.context.Source> Source valueOf(Class<T> clazz) {
-        String clazzName = clazz.getName();
-        if (clazzName.equals(DICTIONARY.getClazz())) {
-            return DICTIONARY;
-        }
-        if (clazzName.equals(ORGANIZATION.getClazz())) {
-            return ORGANIZATION;
-        }
-        if (clazzName.equals(ENUMS.getClazz())) {
-            return ENUMS;
-        }
-//        if (clazzName.equals(TEST.getClazz())) {
-//            return TEST;
-//        }
-        return null;
-    }
-}

+ 0 - 40
slope-common/slope-common-excel/src/main/java/com/sckw/excel/translate/properties/TranslateProperties.java

@@ -1,40 +0,0 @@
-package com.sckw.excel.translate.properties;
-
-import jakarta.validation.constraints.NotBlank;
-import lombok.Getter;
-import lombok.Setter;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.cloud.context.config.annotation.RefreshScope;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.core.annotation.Order;
-import org.springframework.validation.annotation.Validated;
-
-
-/**
- *
- * 翻译的参数配置
- *
- *
- * @author lfdc
- * @version v1
- * @create 2020-11-30 17:22:34
- * @copyright
- */
-@Order(9)
-@Configuration
-@Getter
-@Setter
-@Validated
-@RefreshScope
-public class TranslateProperties {
-
-    /**
-     * 数据源的缓存时间 单位为分钟
-     */
-    @Value("${translate.cache:60}")
-    private long expireTime;
-
-    @Value("${translate.organizationUrl}")
-    @NotBlank(message = "translate.organizationUrl can't be null")
-    private String organizationUrl;
-}

+ 0 - 87
slope-common/slope-common-excel/src/main/java/com/sckw/excel/translate/wrapper/AbstractTranslator.java

@@ -1,87 +0,0 @@
-package com.sckw.excel.translate.wrapper;
-
-
-import com.sckw.core.common.enums.NumberConstant;
-import com.sckw.core.exception.TranslateException;
-import com.sckw.excel.translate.annotation.Translate;
-import com.sckw.excel.translate.annotation.Translates;
-import com.sckw.excel.translate.enums.Source;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.util.Assert;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-/**
- *
- * 翻译器的抽象类
- *
- *
- * @author lfdc
- * @version v1
- * @create 2021-03-31 11:28:25
- * @copyright
- */
-@Slf4j
-public abstract class AbstractTranslator {
-
-
-    protected static void translate(List<Translate> translates, List list, Map<Source, Map<Integer, Object>> sources) {
-        for (Object obj : list) {
-            translate(translates, obj, sources);
-        }
-    }
-
-    protected static List<Translate> getTranslates(Method method) {
-        Translates translates = method.getAnnotation(Translates.class);
-        if (translates != null && translates.value().length > NumberConstant.ZERO) {
-            return Arrays.asList(translates.value());
-        }
-        return Collections.singletonList(method.getAnnotation(Translate.class));
-    }
-
-    @SuppressWarnings("unchecked")
-    protected static void translate(List<Translate> translates, Object obj, Map<Source, Map<Integer, Object>> sources) {
-        Class<?> clazz = obj.getClass();
-        for (Translate translate : translates) {
-            try {
-                Field field;
-                try {
-                    field = clazz.getDeclaredField(translate.field());
-                } catch (NoSuchFieldException e) {
-                    //try to get from the super class
-                    if (clazz.getSuperclass() != null) {
-                        field = clazz.getSuperclass().getDeclaredField(translate.field());
-                    } else {
-                        throw e;
-                    }
-                }
-
-                Assert.notNull(field, "the field specified by @Translate cannot be matched in the returned entity, field -> " + translate.field());
-                field.setAccessible(true);
-                if (translate.isArray()) {
-                    translate(translates, (List) field.get(obj), sources);
-                } else if (translate.isString()) {
-                    Map<Integer, Object> source = sources.get(translate.source());
-                    Object fieldVal = field.get(obj);
-                    if (fieldVal == null || StringUtils.isEmpty(fieldVal.toString())) {
-                        continue;
-                    }
-                    Object target = source.get(fieldVal);
-                    if (target != null) {
-                        field.set(obj, target);
-                    } else {
-                        log.warn("the target value of the translation is null, fieldValue -> {}", fieldVal);
-                    }
-                }
-            } catch (Exception e) {
-                throw new TranslateException("translation failed. Processing error, " + e.toString());
-            }
-        }
-    }
-}

+ 0 - 87
slope-common/slope-common-excel/src/main/java/com/sckw/excel/translate/wrapper/TranslateWrapper.java

@@ -1,87 +0,0 @@
-package com.sckw.excel.translate.wrapper;
-
-
-import com.sckw.core.web.response.result.Result;
-import com.sckw.excel.translate.Translator;
-import com.sckw.excel.translate.annotation.Translate;
-import com.sckw.excel.translate.enums.Source;
-import lombok.extern.slf4j.Slf4j;
-import org.aspectj.lang.ProceedingJoinPoint;
-import org.aspectj.lang.annotation.Around;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Pointcut;
-import org.aspectj.lang.reflect.MethodSignature;
-import org.springframework.core.Ordered;
-import org.springframework.stereotype.Component;
-
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-/**
- *
- * translate aop
- *
- *
- * @author lfdc
- * @version v1
- * @create 2020-11-28 15:48:35
- * @copyright
- */
-@Component
-@Aspect
-@Slf4j
-public class TranslateWrapper implements Ordered {
-
-    public TranslateWrapper() {
-        log.info("The translator is loading complete. source -> {}", Arrays.toString(Source.values()));
-    }
-
-    @Pointcut("@annotation(com.sckw.excel.translate.annotation.Translates) || @annotation(com.sckw.excel.translate.annotation.Translate)")
-    public void annotationWrapper(){}
-
-    @Around(value = "annotationWrapper()")
-    @SuppressWarnings("unchecked")
-    public Object annotationHandler(ProceedingJoinPoint joinPoint) throws Throwable {
-
-        Object obj = joinPoint.proceed();
-        if(obj == null) {
-            log.warn("translate failed, method return value is null");
-            throw new IllegalArgumentException("method return value is null");
-        }
-
-        Result result = (Result) obj;
-        if (result.nonSuccess() || result.getData() == null || result.getData().getBody() == null) {
-            return obj;
-        }
-
-        Map<Source, Map<Integer, Object>> sources = Translator.getSources();
-
-        Method method = ((MethodSignature) joinPoint.getSignature()).getMethod();
-        List<Translate> translates = Translator.getTranslates(method);
-
-        Object body = result.getData().getBody();
-        if(body instanceof List) {
-            Translator.translate(translates, (List) body, sources);
-        } else if(body instanceof Map) {
-            Map<String, Object> results = (Map<String, Object>) body;
-            results.values().forEach(value -> {
-                if(value instanceof List) {
-                    Translator.translate(translates, (List) value, sources);
-                } else {
-                    Translator.translate(translates, value, sources);
-                }
-            });
-        } else {
-            Translator.translate(translates, body, sources);
-        }
-
-        return obj;
-    }
-
-    @Override
-    public int getOrder() {
-        return Ordered.LOWEST_PRECEDENCE;
-    }
-}

+ 1 - 0
slope-common/slope-common-log/pom.xml

@@ -14,6 +14,7 @@
     <properties>
         <maven.compiler.source>17</maven.compiler.source>
         <maven.compiler.target>17</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>
 
     <dependencies>

+ 1 - 0
slope-common/slope-common-redis/pom.xml

@@ -15,6 +15,7 @@
     <properties>
         <maven.compiler.source>17</maven.compiler.source>
         <maven.compiler.target>17</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>
 
     <dependencies>

+ 1 - 0
slope-common/slope-common-remote/pom.xml

@@ -15,6 +15,7 @@
     <properties>
         <maven.compiler.source>17</maven.compiler.source>
         <maven.compiler.target>17</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>
 
     <dependencies>

+ 2 - 2
slope-common/slope-common-sms/pom.xml

@@ -15,14 +15,14 @@
     <properties>
         <maven.compiler.source>17</maven.compiler.source>
         <maven.compiler.target>17</maven.compiler.target>
-        <slope-common-core.version>1.0.0</slope-common-core.version>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>
 
     <dependencies>
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>slope-common-core</artifactId>
-            <version>${slope-common-core.version}</version>
+            <version>1.0.0</version>
         </dependency>
 
         <dependency>

+ 1 - 0
slope-common/slope-common-stream/pom.xml

@@ -15,6 +15,7 @@
     <properties>
         <maven.compiler.source>17</maven.compiler.source>
         <maven.compiler.target>17</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>
 
     <dependencies>

+ 1 - 0
slope-common/slope-common-tdengine/pom.xml

@@ -14,6 +14,7 @@
     <properties>
         <maven.compiler.source>17</maven.compiler.source>
         <maven.compiler.target>17</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <slope-common-core.version>1.0.0</slope-common-core.version>
     </properties>
 

+ 1 - 0
slope-common/slope-common-xxljob/pom.xml

@@ -15,6 +15,7 @@
     <properties>
         <maven.compiler.source>17</maven.compiler.source>
         <maven.compiler.target>17</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>
 
     <dependencies>

+ 1 - 1
slope-common/slope-common-xxljob/src/main/java/com/sckw/xxljob/config/XxlJobAutoConfiguration.java

@@ -12,8 +12,8 @@ import org.springframework.context.annotation.Bean;
  * @author: yzc
  * @date: 2023-06-15 9:29
  */
-@EnableConfigurationProperties
 @Slf4j
+@EnableConfigurationProperties
 public class XxlJobAutoConfiguration {
 
     @Value("${xxl.job.admin.addresses}")

+ 0 - 0
slope-common/slope-common-xxljob/src/main/resources/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports → slope-common/slope-common-xxljob/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports


+ 4 - 4
slope-modules-api/pom.xml

@@ -18,10 +18,10 @@
 
     <artifactId>slope-modules-api</artifactId>
     <packaging>pom</packaging>
-    <modules>
-        <module>slope-modules-bom</module>
-        <module>slope-crossService-api</module>
-    </modules>
+<!--    <modules>-->
+<!--        <module>slope-modules-bom</module>-->
+<!--        <module>slope-crossService-api</module>-->
+<!--    </modules>-->
 
     <properties>
         <maven.compiler.source>17</maven.compiler.source>

+ 45 - 0
slope-modules/slope-detection/pom.xml

@@ -44,11 +44,56 @@
             <version>1.0.0</version>
         </dependency>
 
+        <dependency>
+            <groupId>com.sckw</groupId>
+            <artifactId>slope-common-redis</artifactId>
+            <version>1.0.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.sckw</groupId>
+            <artifactId>slope-common-excel</artifactId>
+            <version>1.0.0</version>
+        </dependency>
+
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>slope-common-tdengine</artifactId>
             <version>1.0.0</version>
         </dependency>
 
+        <!-- validation -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-validation</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.sckw</groupId>
+            <artifactId>slope-common-log</artifactId>
+            <version>1.0.0</version>
+        </dependency>
     </dependencies>
+
+    <!--在build中配置resources,来防止我们资源导出失败的问题-->
+    <build>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <includes>
+                    <include>**/*.properties</include>
+                    <include>**/*.xml</include>
+                </includes>
+                <filtering>true</filtering>
+            </resource>
+            <resource>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**/*.properties</include>
+                    <include>**/*.xml</include>
+                </includes>
+                <filtering>true</filtering>
+            </resource>
+        </resources>
+    </build>
 </project>

+ 1 - 1
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/SlopeDetectionApplication.java

@@ -13,7 +13,7 @@ import org.springframework.boot.SpringApplication;
  */
 @SckwRemoteApplication
 @SckwCloudApplication
-@MapperScan("com.sckw.slope.detection.dao")
+@MapperScan("com.sckw.slope.detection.dao.*")
 public class SlopeDetectionApplication {
     public static void main(String[] args) {
         SpringApplication.run(SlopeDetectionApplication.class, args);

+ 19 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/common/config/DB.java

@@ -0,0 +1,19 @@
+//package com.sckw.slope.detection.common.config;
+//
+//import java.lang.annotation.ElementType;
+//import java.lang.annotation.Retention;
+//import java.lang.annotation.RetentionPolicy;
+//import java.lang.annotation.Target;
+//
+///**
+// * @author lfdc
+// * @description
+// * @date 2023-10-24 15:10:59
+// */
+//
+//@Retention(RetentionPolicy.RUNTIME)
+//@Target({ElementType.TYPE, ElementType.METHOD})
+//public @interface DB{
+//    String value() default "master";
+//
+//}

+ 21 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/common/config/DynamicDataSource.java

@@ -0,0 +1,21 @@
+//package com.sckw.slope.detection.common.config;
+//
+//import lombok.extern.slf4j.Slf4j;
+//import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
+//
+///**
+// * @author lfdc
+// * @description
+// * @date 2023-10-24 16:10:00
+// */
+//@Slf4j
+//public class DynamicDataSource extends AbstractRoutingDataSource {
+//
+//
+//    @Override
+//    protected Object determineCurrentLookupKey() {
+//        log.info("------------------当前数据源 {}", DynamicDataSourceSwitcher.getDataSource());
+//        return DynamicDataSourceSwitcher.getDataSource();
+//    }
+//
+//}

+ 40 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/common/config/DynamicDataSourceAspect.java

@@ -0,0 +1,40 @@
+//package com.sckw.slope.detection.common.config;
+//
+//import org.aspectj.lang.annotation.After;
+//import org.aspectj.lang.annotation.Aspect;
+//import org.aspectj.lang.annotation.Before;
+//import org.aspectj.lang.annotation.Pointcut;
+//import org.springframework.core.annotation.Order;
+//import org.springframework.stereotype.Component;
+//
+///**
+// * @author lfdc
+// * @description 切换数据源 选择非master数据源时, 通过切面切换数据源
+// * @date 2023-10-24 16:10:03
+// */
+//@Aspect
+//@Component
+//@Order(1)
+//public class DynamicDataSourceAspect {
+//    /**
+//     * 切入点只对@Service注解的类上的@Db注解生效 , 无注解 , 默认使用master
+//     * @param db
+//     */
+//    @Pointcut(value="@within(org.springframework.stereotype.Service) && @annotation(db)" )
+//    public void dynamicDataSourcePointCut(DB db){}
+//
+//    @Before(value = "dynamicDataSourcePointCut(db)")
+//    public void switchDataSource(DB db) {
+//        DynamicDataSourceSwitcher.setDataSource(db.value());
+//    }
+//
+//    /**
+//     * 切点执行完后 切换成主数据库
+//     * @param db
+//     */
+//    @After(value="dynamicDataSourcePointCut(db)")
+//    public void after(DB db){
+//        DynamicDataSourceSwitcher.cleanDataSource();
+//    }
+//
+//}

+ 35 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/common/config/DynamicDataSourceSwitcher.java

@@ -0,0 +1,35 @@
+//package com.sckw.slope.detection.common.config;
+//
+//import com.sckw.core.utils.StringUtils;
+//import lombok.extern.slf4j.Slf4j;
+//
+///**
+// * @author lfdc
+// * @description
+// * @date 2023-10-24 15:10:59
+// */
+//@Slf4j
+//public class DynamicDataSourceSwitcher {
+//
+//
+//    public static final String Mater = "master";
+//    public static final String Slave1 = "td";
+//
+//    private static final ThreadLocal<String> contextHolder = new ThreadLocal<>();
+//
+//    public static void setDataSource(String name) {
+//        log.info("-------- 设置数据源数据源为 :{} ", name);
+//        contextHolder.set(name);
+//    }
+//
+//    public static String getDataSource() {
+//        if (StringUtils.isEmpty(contextHolder.get())) {
+//            setDataSource(Mater);
+//        }
+//        return contextHolder.get();
+//    }
+//
+//    public static void cleanDataSource() {
+//        contextHolder.remove();
+//    }
+//}

+ 53 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/common/config/MultipleDataSourceConfig.java

@@ -0,0 +1,53 @@
+//package com.sckw.slope.detection.common.config;
+//
+//import com.alibaba.druid.pool.DruidDataSource;
+//import lombok.extern.slf4j.Slf4j;
+//import org.springframework.beans.factory.annotation.Qualifier;
+//import org.springframework.boot.context.properties.ConfigurationProperties;
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.context.annotation.Primary;
+//import org.springframework.stereotype.Component;
+//
+//import javax.sql.DataSource;
+//import java.util.HashMap;
+//import java.util.Map;
+//
+///**
+// * @author lfdc
+// * @description
+// * @date 2023-10-24 16:10:02
+// */
+//@Slf4j
+//@Component
+//public class MultipleDataSourceConfig {
+//    @Bean("master")
+//    @ConfigurationProperties(prefix = "spring.datasource.dynamic.master")
+//    public DataSource createMasterDataSource(){
+//        return new DruidDataSource();
+//    }
+//
+//    @Bean("td")
+//    @ConfigurationProperties(prefix = "spring.datasource.dynamic.td")
+//    public DataSource createSlave1DataSource(){
+//        return new DruidDataSource();
+//    }
+//
+//    /**
+//     * 设置动态数据源,通过@Primary 来确定主DataSource
+//     * @return
+//     */
+//    @Bean
+//    @Primary
+//    public DataSource createDynamicDataSource(@Qualifier("master") DataSource master, @Qualifier("td") DataSource slave1){
+//        DynamicDataSource dynamicDataSource = new DynamicDataSource();
+//        //设置默认数据源
+//        dynamicDataSource.setDefaultTargetDataSource(master);
+//        //配置多数据源
+//        Map<Object, Object> map = new HashMap<>();
+//        map.put("master",master);
+//        map.put("td",slave1);
+//        dynamicDataSource.setTargetDataSources(map);
+//        return  dynamicDataSource;
+//    }
+//
+//}

+ 25 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/TdengineDemoController.java

@@ -0,0 +1,25 @@
+package com.sckw.slope.detection.controller;
+
+import com.sckw.slope.detection.service.TdengineDemoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author lfdc
+ * @description
+ * @date 2023-10-24 13:10:04
+ */
+@RestController
+@RequestMapping("/tdengine")
+public class TdengineDemoController {
+
+    @Autowired
+    TdengineDemoService tdengineDemoService;
+
+    @RequestMapping(value = "/tdengine",method = RequestMethod.GET)
+    public void tdengineDemo(){
+        tdengineDemoService.tdengineDemo();
+    }
+}

+ 2 - 2
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwtLogisticsOrderMapper.java

@@ -3,11 +3,11 @@ package com.sckw.slope.detection.dao.mysql;
 
 import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.sckw.slope.detection.model.KwtLogisticsOrder;
+import com.sckw.slope.detection.model.dos.mysql.KwtLogisticsOrder;
 import org.apache.ibatis.annotations.Mapper;
 
 
-@DS("master")
+@DS("mysql")
 @Mapper
 public interface KwtLogisticsOrderMapper extends BaseMapper<KwtLogisticsOrder> {
 

+ 20 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/tdengine/SlopeDataMapper.java

@@ -0,0 +1,20 @@
+package com.sckw.slope.detection.dao.tdengine;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.sckw.slope.detection.model.dos.tdengine.SlopeData;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * @author lfdc
+ * @description
+ * @date 2023-10-25 09:10:17
+ */
+@DS("td")
+@Mapper
+public interface SlopeDataMapper {
+
+    List<SlopeData> selectAll();
+
+}

+ 1 - 1
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/KwtLogisticsOrder.java → slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwtLogisticsOrder.java

@@ -1,4 +1,4 @@
-package com.sckw.slope.detection.model;
+package com.sckw.slope.detection.model.dos.mysql;
 
 import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;

+ 21 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/tdengine/SlopeData.java

@@ -0,0 +1,21 @@
+package com.sckw.slope.detection.model.dos.tdengine;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * @author lfdc
+ * @description
+ * @date 2023-10-25 09:10:21
+ */
+@Data
+public class SlopeData implements Serializable {
+    private LocalDateTime ts;
+    private LocalDateTime rawId;
+    private String deviceId;
+    private String itemName;
+    private String itemValue;
+    private LocalDateTime createTime;
+}

+ 1 - 1
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/MysqlDemoService.java

@@ -3,7 +3,7 @@ package com.sckw.slope.detection.service;
 
 import com.alibaba.fastjson2.JSONObject;
 import com.sckw.slope.detection.dao.mysql.KwtLogisticsOrderMapper;
-import com.sckw.slope.detection.model.KwtLogisticsOrder;
+import com.sckw.slope.detection.model.dos.mysql.KwtLogisticsOrder;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 

+ 23 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/TdengineDemoService.java

@@ -0,0 +1,23 @@
+package com.sckw.slope.detection.service;
+
+import com.sckw.slope.detection.dao.tdengine.SlopeDataMapper;
+import com.sckw.slope.detection.model.dos.tdengine.SlopeData;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author lfdc
+ * @description
+ * @date 2023-10-25 09:10:15
+ */
+@Service
+public class TdengineDemoService {
+    @Autowired
+    SlopeDataMapper slopeDataMapper;
+
+    public void tdengineDemo() {
+        List<SlopeData> list = slopeDataMapper.selectAll();
+    }
+}

+ 1 - 0
slope-modules/slope-detection/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@@ -0,0 +1 @@
+#com.sckw.slope.detection.common.config.MultipleDataSourceConfig

+ 38 - 38
slope-modules/slope-detection/src/main/resources/bootstrap-local.yml

@@ -1,27 +1,27 @@
 spring:
-  #  cloud:
-  #    nacos:
-  #      discovery:
-  #        # 服务注册地址
-  #        server-addr: 10.10.10.230:8848
-  #        # 命名空间
-  #        namespace: slope-manage-service
-  #        # 共享配置
-  #        group: slope-manage-service
-  #      config:
-  #        # 配置中心地址
-  #        server-addr: 10.10.10.230:8848
-  #        # 配置文件格式
-  #        file-extension: yaml
-  #        # 命名空间
-  #        namespace: slope-manage-service
-  #        # 共享配置
-  #        group: slope-manage-service
-  #        #可以读多个配置文件  需要在同一个命名空间下面可以是不同的组
-  #        extension-configs:
-  #          - dataId: sckw-common.yml
-  #            group: slope-manage-service
-  #            refresh: true
+  cloud:
+    nacos:
+      discovery:
+        # 服务注册地址
+        server-addr: 10.10.10.230:8848
+        # 命名空间
+        namespace: slope-manage-service
+        # 共享配置
+        group: slope-manage-service
+      config:
+        # 配置中心地址
+        server-addr: 10.10.10.230:8848
+        # 配置文件格式
+        file-extension: yaml
+        # 命名空间
+        namespace: slope-manage-service
+        # 共享配置
+        group: slope-manage-service
+        #可以读多个配置文件  需要在同一个命名空间下面可以是不同的组
+        extension-configs:
+          - dataId: slope-common.yml
+            group: slope-manage-service
+            refresh: true
   data:
     #redis
     redis:
@@ -68,21 +68,21 @@ spring:
           username: sckw_dev
           password: Yy123...
           driver-class-name: com.mysql.jdbc.Driver
-#          hikari:
-#            # 最小空闲连接数,未设置则默认为是maximumPoolSize
-#            minimum-idle: 5
-#            # 最大连接数,默认10
-#            maximum-pool-size: 10
-#            # 自动提交事务行为,默认true
-#            auto-commit: true
-#            #连接允许被闲置在池中的最大时间(毫秒),超时则被释放(retired),默认:10分钟
-#            idle-timeout: 600000
-#            # 连接池名字
-#            pool-name: OrderHikariCP
-#            # 连接的最大生命周期(毫秒),超时而且没被使用则被释放(retired),默认:30分钟
-#            max-lifetime: 1800000
-#            # 等待连接池分配连接的最大时长(毫秒)默认:30秒
-#            connection-timeout: 30000
+          hikari:
+            # 最小空闲连接数,未设置则默认为是maximumPoolSize
+            minimum-idle: 5
+            # 最大连接数,默认10
+            maximum-pool-size: 10
+            # 自动提交事务行为,默认true
+            auto-commit: true
+            #连接允许被闲置在池中的最大时间(毫秒),超时则被释放(retired),默认:10分钟
+            idle-timeout: 600000
+            # 连接池名字
+            pool-name: OrderHikariCP
+            # 连接的最大生命周期(毫秒),超时而且没被使用则被释放(retired),默认:30分钟
+            max-lifetime: 1800000
+            # 等待连接池分配连接的最大时长(毫秒)默认:30秒
+            connection-timeout: 30000
         td:
           url: jdbc:TAOS-RS://10.10.10.221:6041/devices?charset=UTF-8&locale=en_US.UTF-8&timezone=UTC-8
           username: root

+ 1 - 0
slope-modules/slope-detection/src/main/resources/bootstrap.yml

@@ -4,6 +4,7 @@ server:
 spring:
   application:
     name: sckw-slope
+#    name: slope-detection
   profiles:
     active: dev
   main:

+ 1 - 1
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwtLogisticsOrderMapper.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.sckw.slope.detection.dao.mysql.KwtLogisticsOrderMapper">
-    <resultMap id="BaseResultMap" type="com.sckw.slope.detection.model.KwtLogisticsOrder">
+    <resultMap id="BaseResultMap" type="com.sckw.slope.detection.model.dos.mysql.KwtLogisticsOrder">
         <id column="id" jdbcType="BIGINT" property="id"/>
         <result column="ent_id" jdbcType="BIGINT" property="entId"/>
         <result column="type" jdbcType="BIGINT" property="type"/>

Неке датотеке нису приказане због велике количине промена