소스 검색

Merge branch 'dev' of http://git.sckaiwu.cn/17358629955/sckw-service-platform into dev-pdy

sptkw 2 년 전
부모
커밋
371cb7ec35
100개의 변경된 파일6237개의 추가작업 그리고 807개의 파일을 삭제
  1. 107 12
      pom.xml
  2. 34 1
      sckw-auth/pom.xml
  3. 88 43
      sckw-auth/src/main/java/com/sckw/auth/controller/AuthController.java
  4. 0 25
      sckw-auth/src/main/java/com/sckw/auth/controller/ExceptionController.java
  5. 1 1
      sckw-auth/src/main/java/com/sckw/auth/model/vo/req/BusinessLicenseReqVo.java
  6. 0 1
      sckw-auth/src/main/java/com/sckw/auth/model/vo/req/ForgetPasswordReqVo.java
  7. 40 0
      sckw-auth/src/main/java/com/sckw/auth/model/vo/req/GetRegisterSmsReqVo.java
  8. 42 0
      sckw-auth/src/main/java/com/sckw/auth/model/vo/req/LoginBase.java
  9. 2 2
      sckw-auth/src/main/java/com/sckw/auth/model/vo/req/LoginReqVo.java
  10. 0 1
      sckw-auth/src/main/java/com/sckw/auth/model/vo/req/RegisterReqVo.java
  11. 2 3
      sckw-auth/src/main/java/com/sckw/auth/model/vo/req/UpdatePasswordReqVo.java
  12. 25 0
      sckw-auth/src/main/java/com/sckw/auth/model/vo/res/EntInfoResVo.java
  13. 113 0
      sckw-auth/src/main/java/com/sckw/auth/model/vo/res/LoginResVo1.java
  14. 17 8
      sckw-auth/src/main/java/com/sckw/auth/service/IAuthService.java
  15. 343 43
      sckw-auth/src/main/java/com/sckw/auth/service/impl/AuthServiceImpl.java
  16. 153 0
      sckw-auth/src/main/resources/bootstrap-lfdc.yml
  17. 29 0
      sckw-auth/src/main/resources/bootstrap-test.yml
  18. 0 199
      sckw-auth/src/main/resources/logback-spring.xml
  19. 1 0
      sckw-common/pom.xml
  20. 4 1
      sckw-common/sckw-common-bom/pom.xml
  21. 8 0
      sckw-common/sckw-common-core/pom.xml
  22. 20 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/annotation/Log.java
  23. 26 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/annotation/RepeatSubmit.java
  24. 2 2
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/aspect/DaoAspect.java
  25. 80 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/aspect/LogAspect.java
  26. 59 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/aspect/NoRepeatSubmitAspect.java
  27. 5 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/NumberConstant.java
  28. 22 4
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/StringConstant.java
  29. 115 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/enums/DictEnum.java
  30. 42 11
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/enums/DictTypeEnum.java
  31. 25 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/config/JacksonConfig.java
  32. 5 2
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/exception/BusinessException.java
  33. 37 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/exception/CustomPromptException.java
  34. 35 7
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/exception/GlobalSystemExceptionHandler.java
  35. 19 10
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/filter/ExceptionFilterConfig.java
  36. 14 6
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/filter/LoginFilter.java
  37. 0 27
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/filter/LoginFilterConfig.java
  38. 180 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/filter/RequestCheckFilter.java
  39. 134 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/filter/RequestCheckInterceptor.java
  40. 140 140
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/auth/context/LoginUserHolder.java
  41. 3 3
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/base/BaseModel.java
  42. 57 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/base/IdsList.java
  43. 24 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/base/TimeBase.java
  44. 45 4
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/constant/Global.java
  45. 40 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/AddressDefaultTypeEnum.java
  46. 4 4
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/ApprovalEnum.java
  47. 52 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/BannerDistrictEnum.java
  48. 154 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/CarWaybillEnum.java
  49. 164 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/CarWaybillQueryEnum.java
  50. 37 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/ChargingTypeEnum.java
  51. 13 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/ClientTypeEnum.java
  52. 39 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/ContractStatusEnum.java
  53. 38 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/ContractTrackEnum.java
  54. 36 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/CooperateApplyTypeEnum.java
  55. 44 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/CooperateStatusEnum.java
  56. 40 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/CooperateTypeEnum.java
  57. 19 4
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/EntTypeEnum.java
  58. 35 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/EntryTypeEnum.java
  59. 64 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/GlobalTransactionalEnum.java
  60. 44 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/LoginMethodEnum.java
  61. 165 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/LogisticsOrderEnum.java
  62. 62 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/OrderRuleEnum.java
  63. 50 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/ProjectStatusEnum.java
  64. 62 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/RedisOrderGenerateEnum.java
  65. 35 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/SigningWayEnum.java
  66. 6 6
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/SystemTypeEnum.java
  67. 49 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/TaxRateTypeEnum.java
  68. 11 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/page/PageHelperUtil.java
  69. 63 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/page/PageRes.java
  70. 4 3
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/page/PageResult.java
  71. 25 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/vo/BaseList.java
  72. 2 3
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/vo/FileInfoVO.java
  73. 6 1
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/vo/TableStatisticRes.java
  74. 7 1
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/vo/TableTop.java
  75. 2 2
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/AsyncThreadUtils.java
  76. 73 30
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/BeanUtils.java
  77. 29 2
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/CollectionUtils.java
  78. 720 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/DateUtils.java
  79. 69 1
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/EncryUtil.java
  80. 52 42
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/FileUtils.java
  81. 87 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/ListToPageDataUntil.java
  82. 175 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/ListUtils.java
  83. 90 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/LogUtil.java
  84. 39 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/NumberUtils.java
  85. 492 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/OkHttpUtils.java
  86. 226 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/OrderGenerateSeqNoUtils.java
  87. 57 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/OrderGenerateUtils.java
  88. 31 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/OrderUtils.java
  89. 59 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/PageData.java
  90. 7 1
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/PasswordUtils.java
  91. 94 4
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/RegularUtils.java
  92. 63 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/StringTimeUtil.java
  93. 235 135
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/StringUtils.java
  94. 3 3
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/workerUtils.java
  95. 50 2
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/constant/HttpStatus.java
  96. 28 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/context/LoginUserHolder.java
  97. 1 1
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/model/EntCertificateInfo.java
  98. 72 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/model/LoginEntInfo.java
  99. 11 2
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/model/LoginUserInfo.java
  100. 4 4
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/model/ValiList.java

+ 107 - 12
pom.xml

@@ -36,8 +36,8 @@
         <snakeyaml.version>2.0</snakeyaml.version>
         <springdoc.version>2.1.0</springdoc.version>
         <redisson.version>3.21.3</redisson.version>
-        <fastjson.version>2.0.32</fastjson.version>
-        <easyexcel.version>3.0.5</easyexcel.version>
+        <fastjson.version>2.0.38</fastjson.version>
+        <easyexcel.version>3.3.2</easyexcel.version>
         <cglib.version>3.3.0</cglib.version>
         <commons-io.version>2.11.0</commons-io.version>
         <alicloud-sms.version>2.2.0.RELEASE</alicloud-sms.version>
@@ -52,6 +52,14 @@
         <pagehelper-spring-boot-starter.version>1.4.7</pagehelper-spring-boot-starter.version>
         <junit.version>4.13.2</junit.version>
         <xxljob.version>2.4.0</xxljob.version>
+        <project.version>1.0.0</project.version>
+        <!--maven插件版本声明-->
+        <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
+        <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
+        <maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
+        <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
+        <maven-install-plugin.version>3.0.1</maven-install-plugin.version>
+        <maven-deploy-plugin.version>3.0.0</maven-deploy-plugin.version>
     </properties>
 
     <dependencyManagement>
@@ -108,7 +116,6 @@
             </dependency>
 
 
-
             <!-- apache dubbo -->
             <dependency>
                 <groupId>org.apache.dubbo</groupId>
@@ -331,25 +338,113 @@
 
     <profiles>
         <profile>
-            <id>pdy</id>
+            <id>dev</id>
+            <properties>
+                <profiles.active>dev</profiles.active>
+                <nacos.server>10.10.10.230:8848</nacos.server>
+                <nacos.namespace>sckw-service-platform-dev</nacos.namespace>
+            </properties>
+        </profile>
+        <!--测试环境-->
+        <profile>
+            <id>test</id>
             <properties>
-                <!-- 环境标识,需要与配置文件的名称相对应 -->
-                <profiles.active>pdy</profiles.active>
-                <nacos.server>127.0.0.1:8848</nacos.server>
-                <nacos.namespace>sckw_zk</nacos.namespace>
+                <profiles.active>test</profiles.active>
+                <nacos.server>10.10.10.224:8848</nacos.server>
+                <nacos.namespace>sckw-service-platform</nacos.namespace>
             </properties>
-            <activation>
-                <!-- 默认环境 -->
-                <activeByDefault>true</activeByDefault>
-            </activation>
         </profile>
     </profiles>
     <build>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-clean-plugin</artifactId>
+                    <version>${maven-clean-plugin.version}</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-compiler-plugin</artifactId>
+                    <version>${maven-compiler-plugin.version}</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-deploy-plugin</artifactId>
+                    <version>${maven-deploy-plugin.version}</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-install-plugin</artifactId>
+                    <version>${maven-install-plugin.version}</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-jar-plugin</artifactId>
+                    <version>${maven-jar-plugin.version}</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-resources-plugin</artifactId>
+                    <version>${maven-resources-plugin.version}</version>
+                    <configuration>
+                        <propertiesEncoding>${project.build.sourceEncoding}</propertiesEncoding>
+                        <delimiters>
+                            <delimiter>@</delimiter>
+                        </delimiters>
+                        <useDefaultDelimiters>false</useDefaultDelimiters>
+                    </configuration>
+                </plugin>
+                <plugin>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-maven-plugin</artifactId>
+                    <version>${spring-boot.version}</version>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-clean-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-deploy-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-install-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>17</source>
+                    <target>17</target>
+                    <encoding>UTF-8</encoding>
+                </configuration>
+            </plugin>
+        </plugins>
         <resources>
             <resource>
                 <directory>src/main/resources</directory>
+                <!-- 关闭过滤 -->
+                <filtering>false</filtering>
+                <includes>
+                    <include>**/*</include>
+                </includes>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+                <!-- 启用过滤 即该资源中的变量将会被过滤器中的值替换 -->
                 <filtering>true</filtering>
+                <!--资源-->
+                <includes>
+                    <include>**/*.properties</include>
+                    <include>**/*.yml</include>
+                </includes>
             </resource>
         </resources>
     </build>
+
 </project>

+ 34 - 1
sckw-auth/pom.xml

@@ -48,6 +48,39 @@
             <artifactId>sckw-system-api</artifactId>
         </dependency>
 
-    </dependencies>
+        <dependency>
+            <groupId>com.sckw</groupId>
+            <artifactId>sckw-message-api</artifactId>
+        </dependency>
 
+        <dependency>
+            <groupId>com.sckw</groupId>
+            <artifactId>sckw-fleet-api</artifactId>
+        </dependency>
+
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <excludes>
+                        <exclude>
+                            <groupId>org.projectlombok</groupId>
+                            <artifactId>lombok</artifactId>
+                        </exclude>
+                    </excludes>
+                    <mainClass>com.sckw.auth.AuthApplication</mainClass>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>

+ 88 - 43
sckw-auth/src/main/java/com/sckw/auth/controller/AuthController.java

@@ -1,13 +1,16 @@
 package com.sckw.auth.controller;
 
-import com.sckw.auth.model.vo.req.ForgetPasswordReqVo;
-import com.sckw.auth.model.vo.req.LoginReqVo;
-import com.sckw.auth.model.vo.req.RegisterReqVo;
-import com.sckw.auth.model.vo.req.UpdatePasswordReqVo;
+import com.sckw.auth.model.vo.req.*;
 import com.sckw.auth.service.IAuthService;
-import com.sckw.core.exception.SystemException;
+import com.sckw.core.common.enums.enums.DictEnum;
+import com.sckw.core.model.enums.LoginMethodEnum;
+import com.sckw.core.model.enums.SystemTypeEnum;
+import com.sckw.core.utils.RegularUtils;
+import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.response.HttpResult;
+import com.sckw.redis.constant.RedisConstant;
+import com.sckw.redis.utils.RedissonUtils;
 import jakarta.validation.Valid;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -24,6 +27,51 @@ public class AuthController {
     @Autowired
     private IAuthService authService;
 
+    /**
+     * @param
+     * @return
+     * @description 登录参数校验
+     * @author zk
+     * @date 2020/6/14 18:14
+     **/
+    public HttpResult checkParams(LoginBase params) {
+        if (StringUtils.isBlank(params.getSystemType())) {
+            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "应用服务类型不能为空!");
+        }
+        if (StringUtils.isBlank(params.getClientType())) {
+            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "客户端类型不能为空!");
+        }
+        if (StringUtils.isBlank(params.getAccount())) {
+            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "请输入您的账号!");
+        }
+        if (params.getLoginMethod() == LoginMethodEnum.ORDINARY.getValue() && StringUtils.isBlank(params.getPassword())) {
+            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "请输入您的密码!");
+        }
+
+        if (params.getLoginMethod() == LoginMethodEnum.SMS.getValue() && !RegularUtils.matchs(RegularUtils.PHONE_REG, params.getAccount())) {
+            return HttpResult.error(HttpStatus.PARAMETERS_PATTERN_ERROR_CODE, "手机号格式不正确,请检查并重新输入!");
+        }
+        if (params.getLoginMethod() == LoginMethodEnum.SMS.getValue() && StringUtils.isBlank(params.getCaptcha())) {
+            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "请输入您的验证码!");
+        }
+        String key = StringUtils.format(RedisConstant.MESSAGE_SMS_VERIFY_CODE_VALUE_KEY, DictEnum.SMS_LOGIN.getValue(), params.getAccount());
+
+        RedissonUtils.putString(key, params.getCaptcha(), RedisConstant.SMS_VERIFY_CODE_VALID_TIME);
+        String smsCaptcha = RedissonUtils.getString(key);
+        if (params.getLoginMethod() == LoginMethodEnum.SMS.getValue() && StringUtils.isBlank(smsCaptcha)) {
+            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "验证码已过期,请重新获取!");
+        }
+        if (params.getLoginMethod() == LoginMethodEnum.SMS.getValue() && StringUtils.isBlank(smsCaptcha)) {
+            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "验证码已过期,请重新获取!");
+        }
+        if (params.getLoginMethod() == LoginMethodEnum.SMS.getValue() && !smsCaptcha.equals(params.getCaptcha())) {
+            return HttpResult.error(HttpStatus.UN_LOGIN_CODE, "验证码不正确,请检查并重新输入!");
+        }
+
+        return HttpResult.ok();
+    }
+    /**--------------------------------------------------------------------------------------------------------------**/
+
     /**
      * @param reqVo 登录入参
      * @return HttpResult
@@ -32,48 +80,46 @@ public class AuthController {
      * @date: 2023/6/16
      */
     @PostMapping("/login")
-    public HttpResult login(@Valid @RequestBody LoginReqVo reqVo) throws SystemException {
-        return HttpResult.ok(authService.login(reqVo));
-    }
+    public HttpResult login(@Valid @RequestBody LoginReqVo reqVo,
+                            @RequestHeader(name = "Client-Type", required = true) String clientType,
+                            @RequestHeader(name = "System-Type", required = true) int systemType) {
+        reqVo.setSystemType(systemType);
+        reqVo.setClientType(clientType);
+        LoginBase loginBase = new LoginBase();
+        loginBase.setAccount(reqVo.getAccount());
+        loginBase.setPassword(reqVo.getPassword());
+        loginBase.setCaptcha(reqVo.getCaptcha());
+        loginBase.setSystemType(systemType);
+        loginBase.setClientType(clientType);
 
-    /**
-     * @param reqDto 注册
-     * @return HttpResult
-     * @desc: 用户注册
-     * @author: czh
-     * @date: 2023/6/16
-     */
-    @PostMapping("/register")
-    public HttpResult register(@Valid @RequestBody RegisterReqVo reqDto) throws SystemException {
-        authService.register(reqDto);
-        return HttpResult.ok(HttpStatus.MSG_007);
-    }
+        loginBase.setLoginMethod(LoginMethodEnum.ORDINARY.getValue());
+        if (StringUtils.isNotBlank(loginBase.getCaptcha())) {
+            loginBase.setLoginMethod(LoginMethodEnum.SMS.getValue());
+        }
 
-    /**
-     * @param reqDto 忘记密码入参
-     * @return HttpResult
-     * @desc: 忘记密码
-     * @author: czh
-     * @date: 2023/6/19
-     */
-    @PostMapping("/forgetPassword")
-    public HttpResult forgetPassword(@Valid @RequestBody ForgetPasswordReqVo reqDto) throws SystemException {
-        authService.forgetPassword(reqDto);
-        return HttpResult.ok(HttpStatus.MSG_002);
-    }
+        /**参数校验**/
+        HttpResult result = checkParams(loginBase);
+        if (result.getCode() != HttpStatus.SUCCESS_CODE) {
+            return result;
+        }
 
-    /**
-     * @param {password 旧密码、newPassword 新密码、account 账号}
-     * @description 修改密码
-     * @author zk
-     * @date 2023/06/02
-     **/
-    @PostMapping("/updatePassword")
-    public HttpResult updatePassword(@Valid @RequestBody UpdatePasswordReqVo reqVo) {
-        authService.updatePassword(reqVo);
-        return HttpResult.ok(HttpStatus.MSG_002);
+        /**运营端/企业端登录(PC/APP)**/
+        if (loginBase.getSystemType() == SystemTypeEnum.MANAGE.getCode()
+                || loginBase.getSystemType() == SystemTypeEnum.COMPANY.getCode()) {
+            return authService.commonAuth(loginBase);
+        }
+
+        /**司机端**/
+        if (loginBase.getSystemType() == SystemTypeEnum.DRIVER.getCode()) {
+            return authService.driverAuth(loginBase);
+        }
+
+        return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, HttpStatus.GLOBAL_EXCEPTION_MESSAGE);
     }
 
+
+
+
     /**
      * @param id 主键ID
      * @description 重置密码
@@ -86,5 +132,4 @@ public class AuthController {
         return HttpResult.ok(HttpStatus.MSG_001);
     }
 
-
 }

+ 0 - 25
sckw-auth/src/main/java/com/sckw/auth/controller/ExceptionController.java

@@ -1,25 +0,0 @@
-package com.sckw.auth.controller;
-
-import com.sckw.core.web.response.HttpResult;
-import jakarta.servlet.http.HttpServletRequest;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * @author czh
- * @desc TODO
- * @date 2023/6/14
- */
-@RestController
-@RequestMapping("/error")
-public class ExceptionController {
-
-    /**
-     * 重新抛出异常
-     */
-    @PostMapping("/throwError")
-    public HttpResult exception(HttpServletRequest request) {
-        return HttpResult.error(Integer.parseInt(request.getAttribute("code").toString()), request.getAttribute("message").toString());
-    }
-}

+ 1 - 1
sckw-auth/src/main/java/com/sckw/auth/model/vo/req/BusinessLicenseReqVo.java

@@ -35,7 +35,7 @@ public class BusinessLicenseReqVo implements Serializable {
     /**
      * 证书正面
      */
-    private String certificateMian;
+    private String certificateMain;
 
     /**
      * 证书反面

+ 0 - 1
sckw-auth/src/main/java/com/sckw/auth/model/vo/req/ForgetPasswordReqVo.java

@@ -39,7 +39,6 @@ public class ForgetPasswordReqVo implements Serializable {
     /**
      * 系统类型(1运营端、2企业开户)
      */
-    @NotNull(message = "系统类型不能为空")
     private int systemType;
 
 }

+ 40 - 0
sckw-auth/src/main/java/com/sckw/auth/model/vo/req/GetRegisterSmsReqVo.java

@@ -0,0 +1,40 @@
+package com.sckw.auth.model.vo.req;
+
+import jakarta.validation.constraints.NotBlank;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+@Data
+public class GetRegisterSmsReqVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -6344151610477939870L;
+
+    /**
+     * 企业名称
+     */
+    @NotBlank(message = "企业名称不能为空")
+    private String entName;
+
+    /**
+     * 企业代表人
+     */
+    @NotBlank(message = "企业代表人不能为空")
+    private String name;
+
+    /**
+     * 手机号
+     */
+    @NotBlank(message = "联系电话不能为空")
+    private String phone;
+
+    /**
+     * 系统类型(1运营端、2企业开户)
+     */
+    private Integer systemType;
+
+
+
+}

+ 42 - 0
sckw-auth/src/main/java/com/sckw/auth/model/vo/req/LoginBase.java

@@ -0,0 +1,42 @@
+package com.sckw.auth.model.vo.req;
+
+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 int systemType;
+
+    /**
+     * 客户端类型(ios 苹果设备/android 安卓设备/pc 浏览器/pc-background 管理系统)
+     */
+    private String clientType;
+
+    /**
+     * 登录方式1 账号密码登录/2账号短信登录/3单账号登录
+     */
+    private int loginMethod;
+}

+ 2 - 2
sckw-auth/src/main/java/com/sckw/auth/model/vo/req/LoginReqVo.java

@@ -28,13 +28,13 @@ public class LoginReqVo implements Serializable {
     /**
      * 设备类型
      */
-    @NotBlank(message = "设备类型不能为空")
+//    @NotBlank(message = "设备类型不能为空")
     private String clientType;
 
     /**
      * 系统类型
      */
-    @NotNull(message = "系统类型不能为空")
+//    @NotNull(message = "系统类型不能为空")
     private Integer systemType;
 
     /**

+ 0 - 1
sckw-auth/src/main/java/com/sckw/auth/model/vo/req/RegisterReqVo.java

@@ -39,7 +39,6 @@ public class RegisterReqVo implements Serializable {
     /**
      * 系统类型(1运营端、2企业开户)
      */
-    @NotNull(message = "系统类型不能为空")
     private Integer systemType;
 
     /**

+ 2 - 3
sckw-auth/src/main/java/com/sckw/auth/model/vo/req/UpdatePasswordReqVo.java

@@ -21,8 +21,8 @@ public class UpdatePasswordReqVo implements Serializable {
     /**
      * 账号
      */
-    @NotBlank(message = "账号不能为空")
-    private String account;
+    @NotNull(message = "id不能为空")
+    private Long id;
 
     /**
      * 旧密码
@@ -39,7 +39,6 @@ public class UpdatePasswordReqVo implements Serializable {
     /**
      * 系统类型(1运营端、2企业开户)
      */
-    @NotNull(message = "系统类型不能为空")
     private int systemType;
 
 }

+ 25 - 0
sckw-auth/src/main/java/com/sckw/auth/model/vo/res/EntInfoResVo.java

@@ -42,6 +42,26 @@ public class EntInfoResVo {
      */
     private Boolean valid;
 
+    /**
+     * 企业联系人
+     */
+    private String contacts;
+
+    /**
+     * 联系电话
+     */
+    private String phone;
+
+    /**
+     * 法人姓名
+     */
+    private String legalName;
+
+    /**
+     * 法人联系电话
+     */
+    private String legalPhone;
+
     /**
      * 机构信息
      */
@@ -52,4 +72,9 @@ public class EntInfoResVo {
      */
     private List<EntCertificateResDto> certificateInfo;
 
+    /**
+     * 企业属性
+     */
+    private String entTypes;
+
 }

+ 113 - 0
sckw-auth/src/main/java/com/sckw/auth/model/vo/res/LoginResVo1.java

@@ -0,0 +1,113 @@
+package com.sckw.auth.model.vo.res;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.sckw.core.utils.LongToStringUtils;
+import com.sckw.system.api.model.dto.res.KwsRoleResDto;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author zk
+ * @desc TODO
+ * @date 2023/8/10 0010
+ */
+@Data
+public class LoginResVo1 implements Serializable {
+
+    /**
+     * 用户id
+     */
+    @JsonSerialize(using = LongToStringUtils.class)
+    private long id;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 账号
+     */
+    private String account;
+
+    /**
+     * 电话
+     */
+    private String phone;
+
+    /**
+     * 头像
+     */
+    private String photo;
+
+    /**
+     * 角色名称
+     */
+    private String roleName;
+
+    /**
+     * 是否是企业管理(0是 1否)
+     */
+    private Integer isMain;
+
+    /**
+     * 状态
+     */
+    private Integer status;
+
+    /**
+     * 企业Id
+     */
+    @JsonSerialize(using = LongToStringUtils.class)
+    private Long entId;
+
+    /**
+     * 企业名称
+     */
+    private String firmName;
+
+    /**
+     * 资料审批状态(0未审批、1通过、2未通过、3审批中)
+     */
+    private Integer approval;
+
+    /**
+     * 是否有效
+     */
+    private Boolean valid;
+
+
+    /**
+     * 企业类型(名称)
+     */
+    private String entTypeNames;
+
+    /**
+     * 推送设备id
+     */
+    private String clientId;
+
+    /**
+     * 设备类型
+     */
+    private String clientType;
+
+    /**
+     * 系统类型(1运营端、2企业开户、3司机端)
+     */
+    private Integer systemType;
+
+    /**
+     * 设备类型
+     */
+    private String token;
+
+    private Long deptId;
+
+    private Long roleId;
+
+}

+ 17 - 8
sckw-auth/src/main/java/com/sckw/auth/service/IAuthService.java

@@ -3,6 +3,7 @@ package com.sckw.auth.service;
 import com.sckw.auth.model.vo.req.*;
 import com.sckw.auth.model.vo.res.LoginResVo;
 import com.sckw.core.exception.SystemException;
+import com.sckw.core.web.response.HttpResult;
 
 /**
  *
@@ -32,14 +33,6 @@ public interface IAuthService {
      */
     void forgetPassword(ForgetPasswordReqVo reqDto);
 
-    /**
-     * @param reqVo 修改密码入参
-     * @desc: 修改密码
-     * @author: czh
-     * @date: 2023/7/3
-     */
-    void updatePassword(UpdatePasswordReqVo reqVo);
-
     /**
      * @param id 用户id
      * @desc: 重置密码
@@ -47,4 +40,20 @@ public interface IAuthService {
      * @date: 2023/7/3
      */
     void resetPassword(Long id);
+
+    /**
+     * 司机端登录
+     * @param loginBase
+     * @return
+     */
+    HttpResult driverAuth(LoginBase loginBase);
+
+    /**
+     * @param loginBase {}
+     * @desc 运营/企业账号登陆
+     * @author zk
+     * @date 2023/7/26
+     **/
+    HttpResult commonAuth(LoginBase loginBase);
+
 }

+ 343 - 43
sckw-auth/src/main/java/com/sckw/auth/service/impl/AuthServiceImpl.java

@@ -2,31 +2,31 @@ package com.sckw.auth.service.impl;
 
 import cn.hutool.core.date.DateUtil;
 import com.alibaba.fastjson.JSON;
-import com.sckw.auth.model.vo.req.ForgetPasswordReqVo;
-import com.sckw.auth.model.vo.req.LoginReqVo;
-import com.sckw.auth.model.vo.req.RegisterReqVo;
-import com.sckw.auth.model.vo.req.UpdatePasswordReqVo;
+import com.sckw.auth.model.vo.req.*;
 import com.sckw.auth.model.vo.res.DeptInfoResVo;
 import com.sckw.auth.model.vo.res.EntInfoResVo;
 import com.sckw.auth.model.vo.res.LoginResVo;
+import com.sckw.auth.model.vo.res.LoginResVo1;
 import com.sckw.auth.util.AsyncFactory;
+import com.sckw.core.common.enums.enums.DictEnum;
+import com.sckw.core.model.enums.ClientTypeEnum;
+import com.sckw.core.model.enums.LoginMethodEnum;
 import com.sckw.core.model.enums.SystemTypeEnum;
-import com.sckw.core.utils.StringUtils;
+import com.sckw.core.utils.*;
 import com.sckw.core.web.model.EntCertificateInfo;
 import com.sckw.core.web.model.LoginEntInfo;
 import com.sckw.core.web.model.LoginUserInfo;
-import com.sckw.system.api.model.dto.req.ForgetPasswordReqDto;
-import com.sckw.system.api.model.dto.req.UpdatePasswordReqDto;
-import com.sckw.system.api.model.dto.req.UserLoginReqDto;
+import com.sckw.core.web.response.HttpResult;
+import com.sckw.fleet.api.RemoteFleetService;
+import com.sckw.fleet.api.model.vo.RDriverDetailVo;
+import com.sckw.redis.constant.RedisConstant;
+import com.sckw.system.api.RemoteSystemService;
+import com.sckw.system.api.model.dto.req.*;
 import com.sckw.system.api.model.dto.res.KwsRoleResDto;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.constant.Global;
-import com.sckw.core.utils.BeanUtils;
-import com.sckw.core.utils.CollectionUtils;
-import com.sckw.core.utils.EncryUtil;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.redis.utils.RedissonUtils;
-import com.sckw.system.api.model.dto.req.RegisterReqDto;
 import com.sckw.system.api.model.dto.res.*;
 import com.sckw.auth.service.IAuthService;
 import com.sckw.system.api.RemoteUserService;
@@ -46,12 +46,17 @@ import java.util.*;
 @Service
 public class AuthServiceImpl implements IAuthService {
 
-    @DubboReference(version = "2.0.0", group = "design", check = false)
+    @DubboReference(version = "1.0.0", group = "design", check = false)
     private RemoteUserService remoteUserService;
 
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private RemoteSystemService systemService;
+
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private RemoteFleetService fleetService;
 
     @Override
-    public LoginResVo login(LoginReqVo reqDto) throws SystemException {
+    public LoginResVo login(LoginReqVo reqDto) {
         /*1、根据账号密码或者手机号校验码登录, 手机号后面处理*/
         KwsUserResDto kwsUser = checkLogin(reqDto);
         LoginResVo loginResVo = new LoginResVo();
@@ -59,7 +64,7 @@ public class AuthServiceImpl implements IAuthService {
         BeanUtils.copyProperties(kwsUser, loginResVo);
 
         //平台管理员直接过了
-        if (kwsUser.getIsMain() == Global.YES && kwsUser.getSystemType() == SystemTypeEnum.MANAGE.getCode()) {
+        if (kwsUser.getIsMain() == Global.YES && kwsUser.getSystemType().equals(SystemTypeEnum.MANAGE.getCode())) {
             afterProcessor(loginResVo);
             return loginResVo;
         }
@@ -82,8 +87,6 @@ public class AuthServiceImpl implements IAuthService {
             afterProcessor(loginResVo);
             return loginResVo;
         }
-        EntInfoResVo entInfoResVo = new EntInfoResVo();
-        entInfoResVo.setDeptInfo(BeanUtils.copyToList(kwsDepts, DeptInfoResVo.class));
 
         /*3、查企业*/
         //目前一个人只能归属于一个企业,所以这里取第一个就行
@@ -94,7 +97,16 @@ public class AuthServiceImpl implements IAuthService {
             afterProcessor(loginResVo);
             return loginResVo;
         }
+
+        EntInfoResVo entInfoResVo = new EntInfoResVo();
         BeanUtils.copyProperties(kwsEnterpriseResDto, entInfoResVo);
+        entInfoResVo.setDeptInfo(BeanUtils.copyToList(kwsDepts, DeptInfoResVo.class));
+
+        //查企业类型
+        List<EntTypeResDto> entTypeResDtos = remoteUserService.queryEntTypeById(entId);
+        if (CollectionUtils.isNotEmpty(entTypeResDtos)) {
+            entInfoResVo.setEntTypes(String.join(Global.COMMA, entTypeResDtos.stream().map(EntTypeResDto::getType).map(String::valueOf).distinct().toList()));
+        }
         loginResVo.setEntInfo(entInfoResVo);
 
         /* 4、查资质*/
@@ -102,8 +114,8 @@ public class AuthServiceImpl implements IAuthService {
         entInfoResVo.setCertificateInfo(entCertificateResDtoList);
 
         //企业资质有效性判断  1、当前资质没过期,且状态是已认证  2、只要有认证过一次就算有效  参数判断
-        String checkType = "2";
-        if (checkType.equals("1")) {
+        String checkType = String.valueOf(Global.NUMERICAL_TWO);
+        if (checkType.equals(Global.NUMERICAL_ONE)) {
             for (EntCertificateResDto entCertificateResDto : entCertificateResDtoList) {
                 Date expireTime = entCertificateResDto.getExpireTime();
                 entInfoResVo.setValid(DateUtil.compare(new Date(), expireTime) <= 0);
@@ -123,7 +135,7 @@ public class AuthServiceImpl implements IAuthService {
         return loginResVo;
     }
 
-    private KwsUserResDto checkLogin(LoginReqVo reqDto) throws SystemException {
+    private KwsUserResDto checkLogin(LoginReqVo reqDto) {
         List<KwsUserResDto> kwsUsers = remoteUserService.checkUserBase(reqDto.getAccount(), reqDto.getSystemType());
         KwsUserResDto kwsUser = kwsUsers.get(0);
         //密码校验、验证码
@@ -131,11 +143,11 @@ public class AuthServiceImpl implements IAuthService {
             remoteUserService.checkPassword(reqDto.getPassword(), kwsUser.getPassword());
         } else {
             String key = Global.USER_LOGIN_CAPTCHA + reqDto.getSystemType() + Global.COLON + kwsUser.getAccount();
-            String captcha = RedissonUtils.getString(key);
-            if (StringUtils.isBlank(captcha) || StringUtils.isBlank(reqDto.getCaptcha()) || !reqDto.getCaptcha().equals(captcha)) {
-                throw new SystemException(HttpStatus.PARAMETERS_MISSING_CODE, HttpStatus.CAPCHA_ERROR);
-            }
-            RedissonUtils.delete(key);
+//            String captcha = RedissonUtils.getString(key);
+//            if (StringUtils.isBlank(captcha) || StringUtils.isBlank(reqDto.getCaptcha()) || !reqDto.getCaptcha().equals(captcha)) {
+//                throw new SystemException(HttpStatus.PARAMETERS_MISSING_CODE, HttpStatus.CAPCHA_ERROR);
+//            }
+//            RedissonUtils.delete(key);
         }
         return kwsUser;
     }
@@ -162,12 +174,11 @@ public class AuthServiceImpl implements IAuthService {
     @Transactional(rollbackFor = {})
     public void register(RegisterReqVo reqVo) {
         /*校验验证码*/
-        String key = Global.USER_LOGIN_CAPTCHA + reqVo.getPhone() + Global.COLON + reqVo.getSystemType();
+        String key = StringUtils.format(RedisConstant.MESSAGE_SMS_VERIFY_CODE_VALUE_KEY, DictEnum.SMS_REGISTER.getValue(), reqVo.getPhone());
         String sms = RedissonUtils.getString(key);
         if (!reqVo.getCaptcha().equals(sms)) {
             throw new SystemException(HttpStatus.CODE_10301, HttpStatus.CAPTCHA_ERROR);
         }
-
         RegisterReqDto registerReqDto = new RegisterReqDto();
         BeanUtils.copyProperties(reqVo, registerReqDto);
         remoteUserService.register(registerReqDto);
@@ -176,25 +187,17 @@ public class AuthServiceImpl implements IAuthService {
 
 
     @Override
-    public void forgetPassword(ForgetPasswordReqVo reqDto) throws SystemException {
+    public void forgetPassword(ForgetPasswordReqVo reqDto) {
         ForgetPasswordReqDto forgetPasswordReqDto = new ForgetPasswordReqDto();
         BeanUtils.copyProperties(reqDto, forgetPasswordReqDto);
         remoteUserService.forgetPassword(forgetPasswordReqDto);
     }
 
-    @Override
-    public void updatePassword(UpdatePasswordReqVo reqVo) throws SystemException {
-        UpdatePasswordReqDto updatePassword = new UpdatePasswordReqDto();
-        BeanUtils.copyProperties(reqVo, updatePassword);
-        remoteUserService.updatePassword(updatePassword);
-    }
-
     @Override
     public void resetPassword(Long id) {
         remoteUserService.resetPassword(id);
     }
 
-
     static class AsyncProcess implements Runnable {
 
         private final LoginResVo loginResVo;
@@ -234,7 +237,7 @@ public class AuthServiceImpl implements IAuthService {
                 return;
             }
             //单独存用户企业
-            RedissonUtils.putString(Global.getFullUserEntKey(loginResVo.getSystemType(), loginResVo.getId()), JSON.toJSONString(entInfo), Global.PC_TOKEN_EXPIRE);
+//            RedissonUtils.putString(Global.getFullUserEntKey(loginResVo.getSystemType(), loginResVo.getId()), JSON.toJSONString(entInfo), Global.PC_TOKEN_EXPIRE);
 
             //存企业信息
             saveEntLoginInfo(entInfo);
@@ -248,12 +251,8 @@ public class AuthServiceImpl implements IAuthService {
          */
         private void saveEntLoginInfo(EntInfoResVo entInfo) {
             LoginEntInfo loginEntInfo = new LoginEntInfo();
-            loginEntInfo.setId(entInfo.getId());
-            loginEntInfo.setFirmName(entInfo.getFirmName());
-            loginEntInfo.setApproval(entInfo.getApproval());
-            loginEntInfo.setRegTime(entInfo.getRegTime());
+            BeanUtils.copyProperties(entInfo, loginEntInfo);
             loginEntInfo.setCertificateInfo(BeanUtils.copyToList(entInfo.getCertificateInfo(), EntCertificateInfo.class));
-            loginEntInfo.setValid(entInfo.getValid());
             RedissonUtils.putString(Global.REDIS_ENTERPRISE_PREFIX + entInfo.getId(), JSON.toJSONString(loginEntInfo), Global.PC_TOKEN_EXPIRE);
         }
 
@@ -276,6 +275,7 @@ public class AuthServiceImpl implements IAuthService {
             EntInfoResVo entInfo = loginResVo.getEntInfo();
             if (!Objects.isNull(entInfo)) {
                 loginUserInfo.setEntId(entInfo.getId());
+                loginUserInfo.setEntName(entInfo.getFirmName());
                 List<DeptInfoResVo> deptInfo = entInfo.getDeptInfo();
                 if (!CollectionUtils.isEmpty(deptInfo)) {
                     loginUserInfo.setDeptIds(String.join(",", deptInfo.stream().map(item -> String.valueOf(item.getId())).toList()));
@@ -292,6 +292,307 @@ public class AuthServiceImpl implements IAuthService {
          * @date: 2023/6/28
          */
         private void SaveToCache(LoginResVo loginResVo) {
+            //存权限菜单
+            long id = loginResVo.getId();
+            List<UserAccessMenuInfoResDto> userAccessMenuInfo = remoteUserService.queryUserAccessMenu(id);
+            if (CollectionUtils.isEmpty(userAccessMenuInfo)) {
+                RedissonUtils.delete(Global.REDIS_SYS_MENU_PREFIX + loginResVo.getClientType() + Global.COLON + id);
+                log.error("未查询到用户{}的菜单权限", id);
+                return;
+            }
+
+            List<String> menus = new ArrayList<>();
+            for (UserAccessMenuInfoResDto userAccessMenuInfoResDto : userAccessMenuInfo) {
+                String links = userAccessMenuInfoResDto.getLinks();
+                if (StringUtils.isNotBlank(links)) {
+                    menus.addAll(Arrays.asList(userAccessMenuInfoResDto.getLinks().split(",")));
+                }
+            }
+            RedissonUtils.putSet(Global.REDIS_SYS_MENU_PREFIX + loginResVo.getClientType() + Global.COLON + id, menus);
+        }
+
+        /**
+         * @param loginResVo 登录返参
+         * @desc: 存登录记录信息
+         * @author: czh
+         * @date: 2023/6/28
+         */
+        private void SaveLoginInfo(LoginResVo loginResVo) {
+            long userId = loginResVo.getId();
+            UserLoginReqDto currentDayLogin = remoteUserService.currentDayLogin(userId);
+            UserLoginReqDto userLoginReqDto = new UserLoginReqDto();
+            userLoginReqDto.setPid(Objects.isNull(currentDayLogin) ? "" : String.valueOf(currentDayLogin.getId()));
+            userLoginReqDto.setIp("");
+            userLoginReqDto.setUserAgent("");
+            userLoginReqDto.setUserId(loginResVo.getId());
+            userLoginReqDto.setToken(loginResVo.getToken());
+            userLoginReqDto.setValidTime("");
+            userLoginReqDto.setFirst(Objects.isNull(currentDayLogin) ? Global.YES : Global.NO);
+            userLoginReqDto.setLock(Global.NO);
+            userLoginReqDto.setType(Global.NO);
+            userLoginReqDto.setSource(loginResVo.getClientType());
+            remoteUserService.saveUserLogin(userLoginReqDto);
+        }
+
+    }
+
+    /**-------------------------------------------------------------------------------------------------------------->**/
+    /**
+     * @param loginBase {}
+     * @desc 司机账号登陆
+     * @author zk
+     * @date 2023/7/26
+     **/
+    @Override
+    public HttpResult driverAuth(LoginBase loginBase) {
+        /**查询用户信息**/
+        RDriverDetailVo driver = fleetService.findDriverDetai(loginBase.getAccount());
+        /**信息校验**/
+        if (driver == null) {
+            return HttpResult.error(HttpStatus.QUERY_FAIL_CODE, "账号不存在,请检查并重新输入!");
+        }
+        if (loginBase.getLoginMethod() == LoginMethodEnum.ORDINARY.getValue()
+                && !PasswordUtils.validatePassword(loginBase.getPassword(), driver.getPassword())) {
+            return HttpResult.error(HttpStatus.CODE_10301, "密码不正确,请检查并重新输入!");
+        }
+        if (driver.getStatus() == Global.YES) {
+            return HttpResult.error(HttpStatus.CODE_10301, "您的账号已冻结,如需帮助,请致电平台客服!");
+        }
+        //企业信息
+        EntCacheResDto enterprise = systemService.queryEntDetails(driver.getEntId());
+
+        /**生成token**/
+        String token = generateToken(loginBase, driver.getId());
+        if (StringUtils.isBlank(token)) {
+            return HttpResult.error(HttpStatus.CODE_10301, "生成密钥失败,请联系系统管理员!");
+        }
+
+        /**缓存信息**/
+        AsyncFactory.execute(new AsyncProcess1(loginBase, null, driver, enterprise, remoteUserService));
+
+        /**数据组装**/
+        LoginResVo1 loginRes = new LoginResVo1();
+        loginRes.setId(driver.getId());
+        loginRes.setName(driver.getName());
+        loginRes.setAccount(loginBase.getAccount());
+        loginRes.setPhone(driver.getPhone());
+        loginRes.setStatus(driver.getStatus());
+        loginRes.setEntId(driver.getEntId());
+        loginRes.setFirmName(enterprise != null ? enterprise.getFirmName() : null);
+        loginRes.setApproval(enterprise != null ? enterprise.getApproval() : null);
+        loginRes.setEntTypeNames(enterprise != null ? enterprise.getEntTypeNames() : null);
+        loginRes.setClientType(loginBase.getClientType());
+        loginRes.setSystemType(loginBase.getSystemType());
+        loginRes.setToken(token);
+        return HttpResult.ok(loginRes);
+    }
+
+    /**
+     * @param loginBase {}
+     * @desc 运营/企业账号登陆
+     * @author zk
+     * @date 2023/7/26
+     **/
+    @Override
+    public HttpResult commonAuth(LoginBase loginBase) {
+        /**查询用户信息**/
+        KwsUserResDto user = systemService.queryUserDetails(loginBase.getAccount(), loginBase.getSystemType());
+        /**信息校验**/
+        if (user == null) {
+            return HttpResult.error(HttpStatus.QUERY_FAIL_CODE, "账号不存在,请检查并重新输入!");
+        }
+        if (loginBase.getLoginMethod() == LoginMethodEnum.ORDINARY.getValue()
+                && !PasswordUtils.validatePassword(loginBase.getPassword(), user.getPassword())) {
+            return HttpResult.error(HttpStatus.CODE_10301, "密码不正确,请检查并重新输入!");
+        }
+        if (user.getStatus() == Global.YES) {
+            return HttpResult.error(HttpStatus.CODE_10301, "您的账号已冻结,如需帮助,请致电平台客服!");
+        }
+        //企业信息
+        EntCacheResDto enterprise = systemService.queryEntDetails(user.getEntId());
+        if (loginBase.getSystemType() == SystemTypeEnum.COMPANY.getCode() && enterprise == null) {
+            return HttpResult.error(HttpStatus.QUERY_FAIL_CODE, "账号没有归属企业,请检查并重新输入!");
+        }
+        if (enterprise != null && enterprise.getStatus() == Global.YES) {
+            return HttpResult.error(HttpStatus.QUERY_FAIL_CODE, "企业已冻结,如需帮助,请致电平台客服!");
+        }
+
+        /**生成token**/
+        String token = generateToken(loginBase, user.getId());
+        if (StringUtils.isBlank(token)) {
+            return HttpResult.error(HttpStatus.CODE_10301, "生成密钥失败,请联系系统管理员!");
+        }
+
+        /**缓存信息**/
+        AsyncFactory.execute(new AsyncProcess1(loginBase, user, null, enterprise, remoteUserService));
+
+        /**数据组装**/
+        LoginResVo1 loginRes = new LoginResVo1();
+        loginRes.setId(user.getId());
+        loginRes.setName(user.getName());
+        loginRes.setAccount(loginBase.getAccount());
+        loginRes.setPhone(user.getPhone());
+        loginRes.setPhoto(user.getPhoto());
+        loginRes.setIsMain(user.getIsMain());
+        loginRes.setStatus(user.getStatus());
+        loginRes.setRoleName(user.getRoleName());
+        loginRes.setClientId(user.getClientId());
+        loginRes.setEntId(user.getEntId());
+        loginRes.setFirmName(enterprise != null ? enterprise.getFirmName() : null);
+        loginRes.setApproval(enterprise != null ? enterprise.getApproval() : null);
+        loginRes.setEntTypeNames(enterprise != null ? enterprise.getEntTypeNames() : null);
+        loginRes.setClientType(loginBase.getClientType());
+        loginRes.setSystemType(loginBase.getSystemType());
+        loginRes.setToken(token);
+        loginRes.setDeptId(user.getDeptId());
+        loginRes.setRoleId(user.getRoleId());
+        if (user.getSystemType().equals(SystemTypeEnum.MANAGE.getCode())) {
+            loginRes.setValid(true);
+        } else {
+            loginRes.setValid(!Objects.isNull(enterprise) && enterprise.getValid());
+        }
+
+        return HttpResult.ok(loginRes);
+    }
+
+    /**
+     * @param loginBase {}
+     * @param userId 用户ID
+     * @desc 生成token
+     * @author zk
+     * @date 2023/8/18
+     **/
+    private String generateToken(LoginBase loginBase, Long userId) {
+        Map<String, Object> info = new HashMap<>(Global.NUMERICAL_SIXTEEN);
+        info.put("userId", userId);
+        info.put("account", loginBase.getAccount());
+        info.put("clientType", loginBase.getClientType());
+        info.put("systemType", loginBase.getSystemType());
+//        info.put("timestamp", System.currentTimeMillis());
+        String key = Global.getFullUserTokenKey(loginBase.getClientType(), userId);
+        String token = EncryUtil.encryV1(Global.PRI_KEY, JSON.toJSONString(info));
+        int expireTime = ClientTypeEnum.expireTime(loginBase.getClientType());
+        RedissonUtils.putString(key, token, expireTime);
+        return token;
+    }
+
+    static class AsyncProcess1 implements Runnable {
+        private final LoginBase loginBase;
+
+        private final KwsUserResDto user;
+
+        private final RDriverDetailVo driver;
+
+        private final EntCacheResDto enterprise;
+
+        private final RemoteUserService remoteUserService;
+
+        public AsyncProcess1(LoginBase loginBase, KwsUserResDto user, RDriverDetailVo driver, EntCacheResDto enterprise ,
+                             RemoteUserService remoteUserService) {
+            this.loginBase = loginBase;
+            this.user = user;
+            this.driver = driver;
+            this.enterprise = enterprise;
+            this.remoteUserService = remoteUserService;
+        }
+
+        @Override
+        public void run() {
+            //司机信息
+            SaveDriverToCache(loginBase, driver);
+
+            //用户信息
+            SaveUserToCache(loginBase, user);
+
+            //企业信息
+            SaveEntToCache(enterprise);
+        }
+
+        /**
+         * @param ent 企业信息
+         * @desc: 缓存存企业信息
+         * @author: czh
+         * @date: 2023/7/3
+         */
+        private void SaveEntToCache(EntCacheResDto ent) {
+            if (ent == null) {
+                return;
+            }
+            String key = Global.getFullUserEntKey(ent.getId());
+            RedissonUtils.putString(key, JSON.toJSONString(ent), Global.APP_TOKEN_EXPIRE);
+        }
+
+        /**
+         * @param loginBase 登录信息
+         * @param driver 司机信息
+         * @desc: 缓存司机信息
+         * @author: czh
+         * @date: 2023/7/3
+         */
+        private void SaveDriverToCache(LoginBase loginBase, RDriverDetailVo driver) {
+            if (driver == null) {
+                return;
+            }
+            //存用户登录信息
+            LoginUserInfo loginUserInfo = new LoginUserInfo();
+            loginUserInfo.setId(driver.getId());
+            loginUserInfo.setSystemType(SystemTypeEnum.DRIVER.getCode());
+            loginUserInfo.setAccount(driver.getPhone());
+            loginUserInfo.setUserName(driver.getName());
+            loginUserInfo.setPhone(driver.getPhone());
+            loginUserInfo.setStatus(driver.getStatus());
+            loginUserInfo.setEntId(enterprise != null ? enterprise.getId() : null);
+            loginUserInfo.setEntName(enterprise != null ? enterprise.getFirmName() : null);
+            loginUserInfo.setClientType(loginBase.getClientType());
+            int expireTime = ClientTypeEnum.expireTime(loginBase.getClientType());
+            String key = Global.getFullUserLoginKey(loginUserInfo.getSystemType(), loginUserInfo.getId());
+            RedissonUtils.putString(key, JSON.toJSONString(loginUserInfo), Global.APP_TOKEN_EXPIRE);
+        }
+
+        /**
+         * @param loginBase 登录信息
+         * @param user 用户信息
+         * @desc: 缓存用户信息
+         * @author: czh
+         * @date: 2023/7/3
+         */
+        private void SaveUserToCache(LoginBase loginBase, KwsUserResDto user) {
+            if (user == null) {
+                return;
+            }
+            //存用户登录信息
+            LoginUserInfo loginUserInfo = new LoginUserInfo();
+            loginUserInfo.setId(user.getId());
+            loginUserInfo.setSystemType(loginBase.getSystemType());
+            loginUserInfo.setClientType(loginBase.getClientType());
+            loginUserInfo.setAccount(user.getPhone());
+            loginUserInfo.setUserName(user.getName());
+            loginUserInfo.setPhone(user.getPhone());
+            loginUserInfo.setStatus(user.getStatus());
+            loginUserInfo.setIsMain(user.getIsMain());
+            loginUserInfo.setEntId(user.getEntId());
+            loginUserInfo.setEntName(enterprise != null ? enterprise.getFirmName() : null);
+
+            //普通用户需要填充数据权限
+            if (user.getIsMain().equals(Global.NO)) {
+                loginUserInfo.setAuthUserIdList(remoteUserService.queryAuthUserList(user.getId()));
+            }
+
+            int expireTime = ClientTypeEnum.expireTime(loginBase.getClientType());
+            String key = Global.getFullUserLoginKey(loginUserInfo.getSystemType(), loginUserInfo.getId());
+            RedissonUtils.putString(key, JSON.toJSONString(loginUserInfo), Global.APP_TOKEN_EXPIRE);
+
+            //存缓存请求地址
+            SaveMenusToCache(user);
+        }
+
+        /**
+         * @param loginResVo 登录返参
+         * @desc: 存缓存请求地址
+         * @author: czh
+         * @date: 2023/6/28
+         */
+        private void SaveMenusToCache(KwsUserResDto loginResVo) {
             //存权限菜单
             long id = loginResVo.getId();
             List<UserAccessMenuInfoResDto> userAccessMenuInfo = remoteUserService.queryUserAccessMenu(id);
@@ -335,5 +636,4 @@ public class AuthServiceImpl implements IAuthService {
         }
 
     }
-
 }

+ 153 - 0
sckw-auth/src/main/resources/bootstrap-lfdc.yml

@@ -0,0 +1,153 @@
+spring:
+  cloud:
+    nacos:
+      discovery:
+        # 服务注册地址
+        server-addr: 10.10.10.230:8848
+        # 命名空间
+        namespace: sckw_lfdc
+        # 共享配置
+        group: sckw-service-platform
+      config:
+        # 配置中心地址
+        server-addr: 10.10.10.230:8848
+        # 配置文件格式
+        file-extension: yaml
+        # 命名空间
+        namespace: sckw_lfdc
+        # 共享配置
+        group: sckw-service-platform
+        #可以读多个配置文件  需要在同一个命名空间下面可以是不同的组
+        extension-configs:
+          - dataId: sckw-common.yml
+            group: sckw-service-platform
+            refresh: true
+  data:
+    redis:
+      host: 10.10.10.230
+      password: dev
+      port: 6379
+      database: 1
+      timeout: 10000
+#oss上传
+aliyun:
+  oss:
+    endpoint: oss-cn-chengdu.aliyuncs.com
+    accessKeyId: LTAI5tPEbubCGq5Rdwygbz4Q
+    secret: 7mQLWMaBJeZPRV1SRGogctYGXwppjQ
+    bucket: kaiwu-saas
+#直接放行的请求链接
+links: /auth/login,/auth/register,/auth/resetPassword,/auth/updatePassword,/auth/forgetPassword,/auth/auth,/auth/smsAuth
+
+#是否允许一个账号绑定多个角色
+isBindManyRole: 0
+#
+#    sentinel:
+#      transport:
+#        client-ip: ${spring.cloud.client.ip-address} # 获取本机IP地址
+#        port: 8719  #默认8719端口,如果被占用会向上扫描。
+#        #控制台地址
+#        dashboard: 127.0.0.1:19527
+#      log:
+#        #日志路径
+#        dir: logs/sentinel
+#        # 默认将调用链路收敛,导致链路流控效果无效
+#        web-context-unify: false
+#        #持久化nacos配置中
+#      datasource:
+#        #sentinel-rule: # 唯一名称可自定义
+#        #限流
+#        flow:
+#          nacos:
+#            # 设置Nacos的连接地址、命名空间和Group ID
+#            namespace: sckw-service-platform-dev
+#            server-addr: ${spring.cloud.nacos.discovery.server-addr}
+#            # username: ${spring.cloud.nacos.discovery.username}
+#            # password: ${spring.cloud.nacos.discovery.password}
+#            # 设置Nacos中配置文件的命名规则
+#            #            data-id:  ${spring.application.name}-sentinel-flow-rules
+#            data-id: sckw-auth-sentinel-flow-rules
+#            group-id: SENTINEL_GROUP
+#            data-type: json
+#            # 必填的重要字段,指定当前规则类型是"限流"
+#            rule-type: flow
+#        #熔断
+#        degrade:
+#          nacos:
+#            namespace: sckw-service-platform-dev
+#            server-addr: ${spring.cloud.nacos.discovery.server-addr}
+#            #data-id: ${spring.application.name}-sentinel-degrade-rules
+#            data-id: sckw-auth-sentinel-degrade-rules
+#            group-id: SENTINEL_GROUP
+#            #熔断
+#            rule-type: degrade
+#      #取消慢加载
+#      eager: true
+#  data:
+#    redis:
+#      #redis机器ip
+#      host: 127.0.0.1
+#      #redis端口
+#      port: 6379
+#      #redis密码
+#      password:
+#      #数据库
+#      database: 1
+#      #redis超时时间(毫秒),如果不设置,取默认值2000
+#      timeout: 10000
+#      #最大空闲数
+#      maxIdle: 300
+#        #连接池的最大数据库连接数。设为0表示无限制,如果是jedis 2.4以后用redis.maxTotal
+#        #maxActive=600
+#        #控制一个pool可分配多少个jedis实例,用来替换上面的redis.maxActive,如果是jedis 2.4以后用该属性
+#      maxTotal: 1000
+#        #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
+#      maxWaitMillis: 1000
+#        #连接的最小空闲时间 默认1800000毫秒(30分钟)
+#      minEvictableIdleTimeMillis: 300000
+#        #每次释放连接的最大数目,默认3
+#      numTestsPerEvictionRun: 1024
+#        #逐出扫描的时间间隔(毫秒) 如果为负数,则不运行逐出线程, 默认-1
+#      timeBetweenEvictionRunsMillis: 30000
+#        #是否在从池中取出连接前进行检验,如果检验失败,则从池中去除连接并尝试取出另一个
+#      testOnBorrow: true
+#        #在空闲时检查有效性, 默认false
+#      testWhileIdle: true
+#        #连接池最大连接数(如果配置<=0,则没有限制)
+#      jedis:
+#        pool:
+#          max-active: -1
+#  datasource:
+#    dynamic:
+#      primary: master #设置默认的数据源或者数据源组,默认值即为master
+#      strict: false #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
+#      datasource:
+#        master:
+#          url: jdbc:mysql://10.10.10.230:3306/sckw_system?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
+#          username: sckw_dev
+#          password: Yy123...
+#          driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
+#        slave_1:
+#          url: jdbc:mysql://10.10.10.230:3306/sckw_system?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
+#          username: sckw_dev
+#          password: Yy123...
+#          driver-class-name: com.mysql.jdbc.Driver
+#
+#dubbo:
+#  application:
+#    name: auth-dubbo-server
+#    # 该配置在producer-server中是没有的,但是在consumer这里要配置一下
+#    # 如果不配置这个QOS的端口,它会延用dubbo自动生成的端口,在启动的时候,QOS注册就会提示该端口已经被使用的错误
+#    # 虽然启动时有打印端口已经被使用的错误,但是依旧可以正常启动服务,并且dubbo也可以正常调用,但是为了解决启动报错还是加上这个端口
+#    # 这个也是apache官方给出的解决方案,这个端口不能给-1,它不会自动找到一个可用的端口,给-1会报错,端口1-65535自己选择一个
+#    qos-port: 3334
+#  protocol:
+#    name: dubbo
+#    # port为-1表示自动找一个可用的端口
+#    port: -1
+#  registry:
+#    address: nacos://${spring.cloud.nacos.discovery.server-addr}
+#    group: ${spring.cloud.nacos.config.group}
+#    protocol: nacos
+#
+#links: /auth/login,/kwsUser/resetPassword,/kwsUser/updatePassword,/kwsUser/forgetPassword

+ 29 - 0
sckw-auth/src/main/resources/bootstrap-test.yml

@@ -0,0 +1,29 @@
+spring:
+  cloud:
+    nacos:
+      discovery:
+      # 服务注册地址
+        server-addr: @nacos.server@
+        # 命名空间
+        namespace: @nacos.namespace@
+        # 共享配置
+        group: sckw-service-platform
+      config:
+      # 配置中心地址
+        server-addr: @nacos.server@
+        # 命名空间
+        namespace: @nacos.namespace@
+        # 共享配置
+        group: sckw-service-platform
+        # 配置文件格式
+        file-extension: yaml
+        shared-configs:
+          - data-id: sckw-common.yml
+            group: sckw-common
+            refresh: true
+
+        #可以读多个配置文件 需要在同一个命名空间下面可以是不同的组
+        extension-configs:
+          - dataId: sckw-common.yml
+            group: sckw-service-platform
+            refresh: true

+ 0 - 199
sckw-auth/src/main/resources/logback-spring.xml

@@ -1,199 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 -->
-<!-- scan:当此属性设置为true时,配置文档如果发生改变,将会被重新加载,默认值为true -->
-<!-- scanPeriod:设置监测配置文档是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。
-                 当scan为true时,此属性生效。默认的时间间隔为1分钟。 -->
-<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
-<configuration  scan="true" scanPeriod="10 seconds">
-    <contextName>logback</contextName>
-    <springProperty scope="context" name="applicationName" source="spring.application.name" defaultValue="service"/>
-
-    <!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义后,可以使“${}”来使用变量。 -->
-    <property name="log.path" value="/logs/${applicationName}" />
-
-    <!--0. 日志格式和颜色渲染 -->
-    <!-- 彩色日志依赖的渲染类 -->
-    <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
-    <conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
-    <conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
-    <!-- 彩色日志格式 -->
-    <property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
-
-    <!--1. 输出到控制台-->
-    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
-        <!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
-        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
-            <level>debug</level>
-        </filter>
-        <encoder>
-            <Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
-            <!-- 设置字符集 -->
-            <charset>UTF-8</charset>
-        </encoder>
-    </appender>
-
-    <!--2. 输出到文档-->
-    <!-- 2.1 level为 DEBUG 日志,时间滚动输出  -->
-    <appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <!-- 正在记录的日志文档的路径及文档名 -->
-        <file>${log.path}/web_debug.log</file>
-        <!--日志文档输出格式-->
-        <encoder>
-            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
-            <charset>UTF-8</charset> <!-- 设置字符集 -->
-        </encoder>
-        <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <!-- 日志归档 -->
-            <fileNamePattern>${log.path}/web-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
-            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
-                <maxFileSize>100MB</maxFileSize>
-            </timeBasedFileNamingAndTriggeringPolicy>
-            <!--日志文档保留天数-->
-            <maxHistory>15</maxHistory>
-        </rollingPolicy>
-        <!-- 此日志文档只记录debug级别的 -->
-        <filter class="ch.qos.logback.classic.filter.LevelFilter">
-            <level>debug</level>
-            <onMatch>ACCEPT</onMatch>
-            <onMismatch>DENY</onMismatch>
-        </filter>
-    </appender>
-
-    <!-- 2.2 level为 INFO 日志,时间滚动输出  -->
-    <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <!-- 正在记录的日志文档的路径及文档名 -->
-        <file>${log.path}/web_info.log</file>
-        <!--日志文档输出格式-->
-        <encoder>
-            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
-            <charset>UTF-8</charset>
-        </encoder>
-        <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <!-- 每天日志归档路径以及格式 -->
-            <fileNamePattern>${log.path}/web-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
-            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
-                <maxFileSize>100MB</maxFileSize>
-            </timeBasedFileNamingAndTriggeringPolicy>
-            <!--日志文档保留天数-->
-            <maxHistory>15</maxHistory>
-        </rollingPolicy>
-        <!-- 此日志文档只记录info级别的 -->
-        <filter class="ch.qos.logback.classic.filter.LevelFilter">
-            <level>info</level>
-            <onMatch>ACCEPT</onMatch>
-            <onMismatch>DENY</onMismatch>
-        </filter>
-    </appender>
-
-    <!-- 2.3 level为 WARN 日志,时间滚动输出  -->
-    <appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <!-- 正在记录的日志文档的路径及文档名 -->
-        <file>${log.path}/web_warn.log</file>
-        <!--日志文档输出格式-->
-        <encoder>
-            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
-            <charset>UTF-8</charset> <!-- 此处设置字符集 -->
-        </encoder>
-        <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <fileNamePattern>${log.path}/web-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
-            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
-                <maxFileSize>100MB</maxFileSize>
-            </timeBasedFileNamingAndTriggeringPolicy>
-            <!--日志文档保留天数-->
-            <maxHistory>15</maxHistory>
-        </rollingPolicy>
-        <!-- 此日志文档只记录warn级别的 -->
-        <filter class="ch.qos.logback.classic.filter.LevelFilter">
-            <level>warn</level>
-            <onMatch>ACCEPT</onMatch>
-            <onMismatch>DENY</onMismatch>
-        </filter>
-    </appender>
-
-    <!-- 2.4 level为 ERROR 日志,时间滚动输出  -->
-    <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <!-- 正在记录的日志文档的路径及文档名 -->
-        <file>${log.path}/web_error.log</file>
-        <!--日志文档输出格式-->
-        <encoder>
-            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
-            <charset>UTF-8</charset> <!-- 此处设置字符集 -->
-        </encoder>
-        <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <fileNamePattern>${log.path}/web-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
-            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
-                <maxFileSize>100MB</maxFileSize>
-            </timeBasedFileNamingAndTriggeringPolicy>
-            <!--日志文档保留天数-->
-            <maxHistory>15</maxHistory>
-        </rollingPolicy>
-        <!-- 此日志文档只记录ERROR级别的 -->
-        <filter class="ch.qos.logback.classic.filter.LevelFilter">
-            <level>ERROR</level>
-            <onMatch>ACCEPT</onMatch>
-            <onMismatch>DENY</onMismatch>
-        </filter>
-    </appender>
-
-    <!--
-        <logger>用来设置某一个包或者具体的某一个类的日志打印级别、
-        以及指定<appender>。<logger>仅有一个name属性,
-        一个可选的level和一个可选的addtivity属性。
-        name:用来指定受此logger约束的某一个包或者具体的某一个类。
-        level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
-              还有一个特俗值INHERITED或者同义词NULL,代表强制执行上级的级别。
-              如果未设置此属性,那么当前logger将会继承上级的级别。
-        addtivity:是否向上级logger传递打印信息。默认是true。
-        <logger name="org.springframework.web" level="info"/>
-        <logger name="org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor" level="INFO"/>
-    -->
-    <!-- hibernate logger -->
-    <logger name="com.atguigu" level="debug" />
-    <!-- Spring framework logger -->
-    <logger name="org.springframework" level="debug" additivity="false"></logger>
-
-
-    <!--
-        使用mybatis的时候,sql语句是debug下才会打印,而这里我们只配置了info,所以想要查看sql语句的话,有以下两种操作:
-        第一种把<root level="info">改成<root level="DEBUG">这样就会打印sql,不过这样日志那边会出现很多其他消息
-        第二种就是单独给dao下目录配置debug模式,代码如下,这样配置sql语句会打印,其他还是正常info级别:
-        【logging.level.org.mybatis=debug logging.level.dao=debug】
-     -->
-
-    <!--
-        root节点是必选节点,用来指定最基础的日志输出级别,只有一个level属性
-        level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
-        不能设置为INHERITED或者同义词NULL。默认是DEBUG
-        可以包含零个或多个元素,标识这个appender将会添加到这个logger。
-    -->
-
-    <!-- 4. 最终的策略 -->
-    <!-- 4.1 开发环境:打印控制台-->
-    <springProfile name="dev">
-        <logger name="com.sdcm.pmp" level="debug"/>
-    </springProfile>
-
-    <root level="info">
-        <appender-ref ref="CONSOLE" />
-        <appender-ref ref="DEBUG_FILE" />
-        <appender-ref ref="INFO_FILE" />
-        <appender-ref ref="WARN_FILE" />
-        <appender-ref ref="ERROR_FILE" />
-    </root>
-
-    <!-- 4.2 生产环境:输出到文档 -->
-    <springProfile name="pro">
-        <root level="info">
-            <appender-ref ref="CONSOLE" />
-            <appender-ref ref="DEBUG_FILE" />
-            <appender-ref ref="INFO_FILE" />
-            <appender-ref ref="ERROR_FILE" />
-            <appender-ref ref="WARN_FILE" />
-        </root>
-    </springProfile>
-
-</configuration>

+ 1 - 0
sckw-common/pom.xml

@@ -24,6 +24,7 @@
         <module>sckw-common-sentinel</module>
         <module>sckw-common-seata</module>
         <module>sckw-common-startup</module>
+        <module>sckw-common-log</module>
     </modules>
 
     <properties>

+ 4 - 1
sckw-common/sckw-common-bom/pom.xml

@@ -9,7 +9,10 @@
     <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>
+    </properties>
     <dependencyManagement>
         <dependencies>
             <!-- 核心模块 -->

+ 8 - 0
sckw-common/sckw-common-core/pom.xml

@@ -170,5 +170,13 @@
             <artifactId>mybatis-plus-extension</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>com.squareup.okhttp3</groupId>
+            <artifactId>okhttp</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents.client5</groupId>
+            <artifactId>httpclient5</artifactId>
+        </dependency>
     </dependencies>
 </project>

+ 20 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/annotation/Log.java

@@ -0,0 +1,20 @@
+package com.sckw.core.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * @desc: 自定义日志注解
+ * @author: yzc
+ * @date: 2023-08-02 9:20
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Log {
+
+    /**
+     * 日志描述
+     * @return
+     */
+    String description() default "";
+}

+ 26 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/annotation/RepeatSubmit.java

@@ -0,0 +1,26 @@
+package com.sckw.core.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * @author czh
+ * @desc 重复请求校验
+ * @date 2023/9/1
+ */
+@Inherited
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface RepeatSubmit {
+
+    /**
+     * 间隔时间(ms),小于此时间视为重复提交
+     */
+    long interval() default 5000;
+
+    /**
+     * 提示消息
+     */
+    String message() default "请求频率限制,请稍候再试";
+
+}

+ 2 - 2
sckw-common/sckw-common-core/src/main/java/com/sckw/core/aspect/DaoAspect.java

@@ -60,10 +60,10 @@ public class DaoAspect {
                 }
                 Long userId = LoginUserHolder.getUserId();
                 objs.forEach(obj -> {
-                    if (isProperty(obj, UPDATE_BY) && Objects.isNull(BeanUtils.getProperty(obj, UPDATE_BY)) && userId != null) {
+                    if (isProperty(obj, UPDATE_BY) && userId != null) {
                         BeanUtils.setProperty(obj, UPDATE_BY, userId);
                     }
-                    if (isProperty(obj, UPDATE_TIME) && Objects.isNull(BeanUtils.getProperty(obj, UPDATE_TIME))) {
+                    if (isProperty(obj, UPDATE_TIME)) {
                         BeanUtils.setProperty(obj, UPDATE_TIME, new Date());
                     }
                 });

+ 80 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/aspect/LogAspect.java

@@ -0,0 +1,80 @@
+package com.sckw.core.aspect;
+
+import com.alibaba.fastjson.JSON;
+import com.sckw.core.annotation.Log;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.time.DateFormatUtils;
+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.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+/**
+ * @desc: controller请求切面增强
+ * @author: yzc
+ * @date: 2023-08-02 9:21
+ */
+@Aspect
+@Component
+@Slf4j
+public class LogAspect {
+    private static final String TIME_PATTERN = "yyyy-MM-dd HH:mm:ss:SSS";
+
+    @Pointcut("@annotation(l)")
+    public void loggerPointcut(Log l) {
+    }
+
+    @Around(value = "loggerPointcut(l)", argNames = "p,l")
+    public Object around(ProceedingJoinPoint p, Log l) throws Throwable {
+        Object result = null;
+        //开始时间
+        Date startTime = new Date();
+        String targetName = p.getTarget().getClass().getName();
+        String methodName = p.getSignature().getName();
+        Object[] args = p.getArgs();
+        Stream<?> stream = ArrayUtils.isEmpty(args) ? Stream.empty() : Arrays.stream(args);
+        List<Object> logArgs = stream
+                .filter(arg -> (!(arg instanceof HttpServletRequest) && !(arg instanceof HttpServletResponse)) && !(arg instanceof MultipartFile))
+                .collect(Collectors.toList());
+        //过滤后序列化无异常
+        String param = JSON.toJSONString(logArgs);
+        String exception = "";
+        try {
+            //执行结果,返回参数
+            result = p.proceed();
+        } catch (Throwable e) {
+            exception = e.getMessage();
+            //异常抛出
+            throw e;
+        } finally {
+            Date endTime = new Date();
+            long time = endTime.getTime() - startTime.getTime();
+            Boolean slowRequest = (time > 1500L);
+            log.info("{}:{}.{}," +
+                            "param={}," +
+                            "result={}," +
+                            "exception={}," +
+                            "[{}->{}],slowRequest{}=[{}]", l.description(), targetName, methodName,
+                    param,
+                    JSON.toJSONString(result),
+                    exception,
+                    DateFormatUtils.format(startTime, TIME_PATTERN),
+                    DateFormatUtils.format(endTime, TIME_PATTERN),
+                    slowRequest,
+                    time);
+        }
+        return result;
+    }
+
+}

+ 59 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/aspect/NoRepeatSubmitAspect.java

@@ -0,0 +1,59 @@
+package com.sckw.core.aspect;
+
+import com.sckw.core.annotation.RepeatSubmit;
+import com.sckw.core.exception.SystemException;
+import com.sckw.core.model.constant.Global;
+import com.sckw.core.utils.StringUtils;
+import com.sckw.core.web.context.LoginUserHolder;
+import com.sckw.redis.utils.RedissonUtils;
+import jakarta.servlet.http.HttpServletRequest;
+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.reflect.MethodSignature;
+import org.springframework.web.context.request.RequestAttributes;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import java.lang.reflect.Method;
+import java.util.Objects;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author czh
+ * @desc 防重复提交
+ * @date 2023/9/1
+ */
+@Aspect
+@Slf4j
+public class NoRepeatSubmitAspect {
+
+    @Around("@annotation(com.sckw.core.annotation.RepeatSubmit)")
+    public Object doAround(ProceedingJoinPoint pjp) throws Throwable {
+        RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
+        ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) requestAttributes;
+        HttpServletRequest request = servletRequestAttributes.getRequest();
+        String url = request.getRequestURI();
+        Long userId = LoginUserHolder.getUserId();
+        if (Objects.isNull(userId)) {
+            return pjp.proceed();
+        }
+
+        String key = Global.getRepeatSubmitKey(userId, url);
+        String res = RedissonUtils.getString(key);
+        MethodSignature signature = (MethodSignature) pjp.getSignature();
+        Method method = signature.getMethod();
+        RepeatSubmit annotation = method.getAnnotation(RepeatSubmit.class);
+        long interval = annotation.interval();
+        if (StringUtils.isNotBlank(res)) {
+            if (System.currentTimeMillis() - Long.parseLong(res) < interval) {
+                throw new SystemException(annotation.message());
+            }
+            return pjp.proceed();
+        }
+
+        RedissonUtils.putString(key, String.valueOf(System.currentTimeMillis()), interval, TimeUnit.MILLISECONDS);
+        return pjp.proceed();
+    }
+}

+ 5 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/NumberConstant.java

@@ -1,5 +1,7 @@
 package com.sckw.core.common.enums;
 
+import java.math.BigDecimal;
+
 /**
  * @description:    定义常量
  * @author: LengFaQiang
@@ -18,6 +20,7 @@ public final class NumberConstant {
     public static final int EIGHT = 8;
     public static final int NINE = 9;
     public static final int TEN = 10;
+    public static final int ELEVEN = 11;
     public static final int TWELVE = 12;
     public static final int THREETEEN = 13;
     public static final int FOURTEEN = 14;
@@ -61,6 +64,8 @@ public final class NumberConstant {
     public static final double NEGATICE_ONE_HUNDRED_EIGHTY = -180.0D;
     public static final int COOKIE_TIMEN = 300;
 
+    public static final BigDecimal ONE_HUNDRED = new BigDecimal("100.00");
+
     public NumberConstant() {
     }
 }

+ 22 - 4
sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/StringConstant.java

@@ -1,7 +1,9 @@
 package com.sckw.core.common.enums;
 
+import java.time.format.DateTimeFormatter;
+
 /**
- * @description:    定义字符串常量
+ * @description: 定义字符串常量
  * @author: LengFaQiang
  * @copyright
  * @create: 2022-01-27 16:02
@@ -11,18 +13,34 @@ public final class StringConstant {
     public static final String LEFT_SEPARATORS = "//";
     public static final String RIGHT_SEPARATOR = "\\";
     public static final String COLON = ":";
+    public static final String SEMICOLON = ";";
     public static final String POINT = ".";
-    public static final String COMMA=",";
+
+    public static final String COMMA = ",";
+
+    /**
+     * 中横线
+     */
+    public static final String HYPHEN = "-";
+
+    /**
+     * 下划线
+     */
+    public static final String UNDERLINE = "_";
     public static final String HTTP_STRING = "http";
     public static final String HTTPS_STRING = "https";
     public static final String B = "B";
     public static final String KB = "KB";
+
     public static final String MB = "MB";
     public static final String G = "G";
     public static final String GB = "GB";
-
+    public static final String DEFAULT_DATE_PATTERN = "yyyy-MM-dd HH:mm:ss";
+    public static final String DEF_DATE_FORMAT = "yyyy-MM-dd";
+    public static final DateTimeFormatter YYYY_MM_DD_HH_MM_SS = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+    public static final DateTimeFormatter YYYY_MM_DD = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+    public static final DateTimeFormatter HH_MM_SS = DateTimeFormatter.ofPattern("HH:mm:ss");
     public static final String DATE_YYYYMMDD = "yyyyMMdd";
-
     public static final String ENCODING_UTF_EIGHT = "UTF-8";
     public static final String ENCODING_UTF_SIXTEEN = "UTF-16";
     public static final String ENCODING_GBK = "GBK";

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

@@ -0,0 +1,115 @@
+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;
+
+/**
+ * @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)).toList();
+    }
+
+}

+ 42 - 11
sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/enums/DictTypeEnum.java

@@ -4,21 +4,52 @@ import lombok.AllArgsConstructor;
 import lombok.Getter;
 
 /**
- * @author lfdc
- * @description 枚举字典
- * @date 2023-07-07 14:07:23
+ * @desc: 字典类型枚举
+ * @author: yzc
+ * @date: 2023-07-10 16:46
  */
 @Getter
 @AllArgsConstructor
 public enum DictTypeEnum {
-    PRICE_TYPE_0("price_type", "0", "元/吨"),
-    PRICE_TYPE_1("price_type", "1", "元/车"),
-    UNIT_TYPE_0("unit", "0", "吨"),
-    UNIT_TYPE_1("unit", "1", "方"),
-    UNIT_TYPE_2("unit", "2", "箱"),
-    UNIT_TYPE_3("unit", "3", "件");
+    MSG_CATEGORY("msg_category", "消息分类"),
+    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", "求购状态"),
+    ;
+
     private final String type;
-    private final String value;
-    private final String label;
+    private final String name;
+
 
 }

+ 25 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/config/JacksonConfig.java

@@ -0,0 +1,25 @@
+package com.sckw.core.config;
+
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import java.math.BigInteger;
+
+/**
+ * @desc: Jackson全局转化long类型为String,解决jackson序列化时传入前端Long类型缺失精度问题(js解析只能解析到16位)
+ * @author: yzc
+ * @date: 2023-07-17 11:19
+ */
+@Configuration
+public class JacksonConfig {
+    @Bean
+    public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilderCustomizer() {
+        return jacksonObjectMapperBuilder -> {
+            jacksonObjectMapperBuilder.serializerByType(BigInteger.class, ToStringSerializer.instance);
+            jacksonObjectMapperBuilder.serializerByType(Long.class, ToStringSerializer.instance);
+            jacksonObjectMapperBuilder.serializerByType(Long.TYPE, ToStringSerializer.instance);
+        };
+    }
+}

+ 5 - 2
sckw-common/sckw-common-core/src/main/java/com/sckw/core/exception/BusinessException.java

@@ -2,6 +2,8 @@ package com.sckw.core.exception;
 
 import lombok.Getter;
 
+import java.io.Serial;
+
 /**
  * @Author yzc
  * @Description 自定义业务异常
@@ -9,11 +11,12 @@ import lombok.Getter;
  */
 @Getter
 public class BusinessException extends RuntimeException {
-
+    @Serial
+    private static final long serialVersionUID = 4515565480123536390L;
     /**
      * 异常信息
      **/
-    private String msg;
+    private final String msg;
     private Object[] param;
 
     public BusinessException(String msg) {

+ 37 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/exception/CustomPromptException.java

@@ -0,0 +1,37 @@
+package com.sckw.core.exception;
+
+import lombok.Getter;
+
+import java.io.Serial;
+
+/**
+ * @Author yzc
+ * @Description 前端自定义提示异常
+ * @createTime 2023年06月08日 10:05:00
+ */
+@Getter
+public class CustomPromptException extends RuntimeException {
+
+    @Serial
+    private static final long serialVersionUID = -295458079254252674L;
+    /**
+     * 异常信息
+     **/
+    private final String msg;
+    private final Integer code;
+    private Object[] param;
+
+    public CustomPromptException(Integer code,String msg) {
+        super(msg);
+        this.code = code;
+        this.msg = msg;
+    }
+
+    public CustomPromptException(Integer code,String msg, Object... param) {
+        super(msg);
+        this.code = code;
+        this.msg = msg;
+        this.param = param;
+    }
+
+}

+ 35 - 7
sckw-common/sckw-common-core/src/main/java/com/sckw/core/exception/GlobalSystemExceptionHandler.java

@@ -9,12 +9,12 @@ import org.springframework.context.annotation.Configuration;
 import org.springframework.util.CollectionUtils;
 import org.springframework.validation.FieldError;
 import org.springframework.web.bind.MethodArgumentNotValidException;
+import org.springframework.web.bind.MissingServletRequestParameterException;
 import org.springframework.web.bind.annotation.ExceptionHandler;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.RestControllerAdvice;
 
 import java.util.List;
-import java.util.Objects;
 import java.util.Set;
 
 @Slf4j
@@ -24,10 +24,18 @@ public class GlobalSystemExceptionHandler {
 
     @ExceptionHandler(value = SystemException.class)
     @ResponseBody
-    public HttpResult handlerRuntimeException(SystemException e) {
+    public HttpResult handlerSystemException(SystemException e) {
+        log.error("业务异常:", e);
         return HttpResult.error(e.getCode(), e.getMessage());
     }
 
+    @ExceptionHandler(value = RuntimeException.class)
+    @ResponseBody
+    public HttpResult handlerRuntimeException(RuntimeException e) {
+        log.error("业务异常:", e);
+        return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
+    }
+
     /**
      * BusinessException处理
      *
@@ -37,10 +45,24 @@ public class GlobalSystemExceptionHandler {
     @ResponseBody
     @ExceptionHandler(BusinessException.class)
     public HttpResult businessExceptionHandler(BusinessException ex) {
-        log.info("业务异常,message={},param={}", ex.getMsg(), ex.getParam());
+        log.error("业务异常,message={},param={}", ex.getMsg(), ex.getParam());
         return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, ex.getMessage());
     }
 
+    /**
+     * 前端自定义提示异常
+     *
+     * @param ex
+     * @return
+     */
+    @ResponseBody
+    @ExceptionHandler(CustomPromptException.class)
+    public HttpResult customPromptExceptionHandler(CustomPromptException ex) {
+        log.error("前端自定义提示异常,code={},message={},param={}", ex.getCode(), ex.getMsg(), ex.getParam());
+        return HttpResult.error(ex.getCode(), ex.getMessage());
+    }
+
+
     /**
      * NotLoginException处理
      *
@@ -50,10 +72,16 @@ public class GlobalSystemExceptionHandler {
     @ResponseBody
     @ExceptionHandler(NotLoginException.class)
     public HttpResult notLoginException(NotLoginException ex) {
-        log.info("用户未登录, message={}, param={}", ex.getMsg(), ex.getParam());
+        log.error("用户未登录, message={}, param={}", ex.getMsg(), ex.getParam());
         return HttpResult.error(HttpStatus.UN_LOGIN_CODE, HttpStatus.UN_LOGIN_MESSAGE, ex.getMessage());
     }
 
+    @ResponseBody
+    @ExceptionHandler(MissingServletRequestParameterException.class)
+    public HttpResult noArgs(MissingServletRequestParameterException ex) {
+        String format = "参数:[%s]不能为空";
+        return HttpResult.error(HttpStatus.PARAMETERS_PATTERN_ERROR_CODE, String.format(format, ex.getParameterName()));
+    }
 
     /**
      * 注解校验异常处理
@@ -77,14 +105,14 @@ public class GlobalSystemExceptionHandler {
             }
         }
         String errMsg = sb.toString();
-        log.info("参数校验异常m:{}", errMsg);
+        log.error("参数校验异常:{}", errMsg);
         return HttpResult.error(HttpStatus.PARAMETERS_PATTERN_ERROR_CODE, errMsg);
     }
 
     @ResponseBody
     @ExceptionHandler(ConstraintViolationException.class)
     public HttpResult constraintViolationExceptionHandler(ConstraintViolationException ex) {
-        log.info("参数校验异常c:{}", ex.getMessage());
+        log.error("参数校验异常c:{}", ex.getMessage());
         Set<ConstraintViolation<?>> constraintViolations = ex.getConstraintViolations();
         StringBuilder sb = new StringBuilder();
         if (!CollectionUtils.isEmpty(constraintViolations)) {
@@ -110,7 +138,7 @@ public class GlobalSystemExceptionHandler {
     @ExceptionHandler(Exception.class)
     public HttpResult defaultExceptionHandler(Exception ex) {
         log.error("系统异常", ex);
-        return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, HttpStatus.GLOBAL_EXCEPTION_MESSAGE);
+        return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, ex.toString());
     }
 
 }

+ 19 - 10
sckw-common/sckw-common-core/src/main/java/com/sckw/core/filter/ExceptionFilterConfig.java

@@ -2,28 +2,37 @@ package com.sckw.core.filter;
 
 import com.sckw.core.exception.SystemException;
 import jakarta.servlet.*;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
+import org.springframework.web.filter.OncePerRequestFilter;
+import org.springframework.web.servlet.HandlerExceptionResolver;
 
 import java.io.IOException;
 
 /**
  * @author czh
- * @desc TODO
+ * @desc 过滤器的异常抛出
  * @date 2023/6/14
  */
 @Component
-public class ExceptionFilterConfig implements Filter {
+@Slf4j
+public class ExceptionFilterConfig extends OncePerRequestFilter {
+
+    @Autowired
+    @Qualifier("handlerExceptionResolver")
+    private HandlerExceptionResolver resolver;
+
     @Override
-    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
+    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
         try {
-            filterChain.doFilter(servletRequest, servletResponse);
+            filterChain.doFilter(request, response);
         } catch (SystemException e) {
-            // 传递异常信息
-            servletRequest.setAttribute("code", e.getCode());
-            servletRequest.setAttribute("message", e.getMessage());
-            // 指定处理该请求的处理器
-            RequestDispatcher requestDispatcher = servletRequest.getRequestDispatcher("/error/throwError");
-            requestDispatcher.forward(servletRequest, servletResponse);
+            // 会交到 Springmvc的全局异常处理器那里
+            resolver.resolveException(request, response, null, e);
         }
     }
 }

+ 14 - 6
sckw-common/sckw-common-core/src/main/java/com/sckw/core/filter/LoginFilter.java

@@ -1,11 +1,8 @@
 package com.sckw.core.filter;
 
-import cn.hutool.core.date.DateUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
-import com.sckw.core.model.enums.ApprovalEnum;
 import com.sckw.core.model.enums.SystemTypeEnum;
-import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.web.config.CustomConfig;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.constant.Global;
@@ -14,7 +11,6 @@ import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.constant.RequestConstant;
 import com.sckw.core.web.context.LoginUserHolder;
-import com.sckw.core.web.model.EntCertificateInfo;
 import com.sckw.core.web.model.LoginEntInfo;
 import com.sckw.core.web.model.LoginUserInfo;
 import com.sckw.redis.utils.RedissonUtils;
@@ -64,6 +60,7 @@ public class LoginFilter implements Filter {
      */
     @Override
     public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws ServletException, IOException, SystemException{
+
         HttpServletRequest request = (HttpServletRequest) servletRequest;
         String requestUri = request.getRequestURI();
         /*1、不用token的接口直接放行*/
@@ -91,12 +88,19 @@ public class LoginFilter implements Filter {
         String systemType = request.getHeader(RequestConstant.SYSTEM_TYPE);
         String userInfo = RedissonUtils.getString(Global.getFullUserLoginKey(Integer.parseInt(systemType), Long.parseLong(key), clientType));
         if (StringUtils.isBlank(userInfo)) {
-            throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.ACCOUNT_NOT_EXISTS);
+            throw new SystemException(HttpStatus.UN_LOGIN_CODE, HttpStatus.UN_LOGIN_MESSAGE);
         }
 
         //将redis里的用户信息存入内存中,避免业务操作多次从redis获取值*/
         LoginUserInfo loginUserInfo = JSONObject.parseObject(userInfo, LoginUserInfo.class);
         LoginUserHolder.set(loginUserInfo);
+        //暂时这样写一下,有的接口需要给LoginUserHolder赋值
+        if ("/kwsMenu/findMenuTree".equals(requestUri) || "/kwsDept/findDeptTree".equals(requestUri)) {
+            RedissonUtils.putString(Global.getFullUserLoginKey(Integer.parseInt(systemType), Long.parseLong(key), clientType), JSON.toJSONString(loginUserInfo), Global.PC_TOKEN_EXPIRE);
+            filterChain.doFilter(servletRequest, servletResponse);
+            LoginUserHolder.remove();
+            return;
+        }
 
         /*3、平台管理员直接放行*/
         if (loginUserInfo.getIsMain() == Global.YES && Integer.parseInt(systemType) == SystemTypeEnum.MANAGE.getCode()) {
@@ -113,7 +117,10 @@ public class LoginFilter implements Filter {
         }
 
         /*4、企业信息等校验*/
-        checkEntInfo(loginUserInfo);
+        //特殊处理,认证接口不校验资质
+        if (!"/kwsEnt/register".equals(requestUri)) {
+            checkEntInfo(loginUserInfo);
+        }
 
         RedissonUtils.putString(Global.getFullUserLoginKey(Integer.parseInt(systemType), Long.parseLong(key), clientType), JSON.toJSONString(loginUserInfo), Global.PC_TOKEN_EXPIRE);
         filterChain.doFilter(servletRequest, servletResponse);
@@ -143,6 +150,7 @@ public class LoginFilter implements Filter {
             LoginUserHolder.remove();
             throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.ENTCERTIFICATES_INVAILD);
         }
+        RedissonUtils.putString(Global.REDIS_ENTERPRISE_PREFIX + entId, enterpriseInfo, Global.PC_TOKEN_EXPIRE);
 //        int approval = loginEntInfo.getApproval();
 //        if (approval == ApprovalEnum.NO.getCode() || approval == ApprovalEnum.PROCESS.getCode() || approval == ApprovalEnum.PASS.getCode()) {
 //            LoginUserHolder.remove();

+ 0 - 27
sckw-common/sckw-common-core/src/main/java/com/sckw/core/filter/LoginFilterConfig.java

@@ -1,27 +0,0 @@
-//package com.sckw.core.filter;
-//
-//import jakarta.annotation.Resource;
-//import org.springframework.boot.web.servlet.FilterRegistrationBean;
-//import org.springframework.context.annotation.Bean;
-//import org.springframework.context.annotation.Configuration;
-//import org.springframework.core.annotation.Order;
-//import org.springframework.stereotype.Component;
-//
-///**
-// * @author czh
-// * @desc TODO
-// * @date 2023/6/14
-// */
-//@Component
-//public class LoginFilterConfig {
-//
-//
-//    @Bean
-//    public FilterRegistrationBean registerBusExceptionFilter() {
-//        FilterRegistrationBean registration = new FilterRegistrationBean();
-//        registration.setFilter(new ExceptionFilterConfig());
-//        registration.setName("ExceptionFilter");
-//        registration.setOrder(-1);
-//        return registration;
-//    }
-//}

+ 180 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/filter/RequestCheckFilter.java

@@ -0,0 +1,180 @@
+package com.sckw.core.filter;
+
+import com.alibaba.fastjson.JSON;
+import com.sckw.core.model.constant.Global;
+import com.sckw.core.model.enums.ClientTypeEnum;
+import com.sckw.core.model.enums.SystemTypeEnum;
+import com.sckw.core.utils.EncryUtil;
+import com.sckw.core.utils.NumberUtils;
+import com.sckw.core.utils.StringUtils;
+import com.sckw.core.web.config.CustomConfig;
+import com.sckw.core.web.constant.HttpStatus;
+import com.sckw.core.web.constant.RequestConstant;
+import com.sckw.core.web.context.LoginEntHolder;
+import com.sckw.core.web.context.LoginUserHolder;
+import com.sckw.core.web.model.LoginEntInfo;
+import com.sckw.core.web.model.LoginUserInfo;
+import com.sckw.core.web.response.HttpResult;
+import com.sckw.core.web.response.ResponseUtil;
+import com.sckw.redis.utils.RedissonUtils;
+import jakarta.annotation.PostConstruct;
+import jakarta.servlet.*;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.io.IOException;
+import java.util.*;
+
+/**
+ * @desc: 登录过滤
+ * @author: czh
+ * @date: 2023/6/14
+ */
+public class RequestCheckFilter implements Filter {
+    @Autowired
+    CustomConfig customConfig;
+
+    private static final List<String> EXCLUDEPATH = new ArrayList<>();
+
+    private static final String REGISTER = "/kwsEnt/register";
+
+    /**
+     * @desc: 初始化放行路径
+     * @author: czh
+     */
+    @PostConstruct
+    private void initExcludePath() {
+        String links = customConfig.getLinks();
+        if (StringUtils.isNotBlank(links)) {
+            EXCLUDEPATH.addAll(Arrays.asList(links.split(Global.COMMA)));
+        }
+    }
+
+    @Override
+    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse,
+                         FilterChain filterChain) throws IOException, ServletException {
+        HttpServletRequest request = (HttpServletRequest) servletRequest;
+        HttpServletResponse response = (HttpServletResponse) servletResponse;
+        String token = request.getHeader(RequestConstant.TOKEN);
+        String clientType = request.getHeader(RequestConstant.CLIENT_TYPE);
+        String systemType = request.getHeader(RequestConstant.SYSTEM_TYPE);
+        String requestUri = request.getRequestURI();
+
+        /*1、非token校验接口放行*/
+        if (EXCLUDEPATH.contains(requestUri)) {
+            filterChain.doFilter(servletRequest, servletResponse);
+            return;
+        }
+
+        /*2、校验token**/
+        /*2.1、校验token非空*/
+        if (StringUtils.isBlank(token)) {
+            ResponseUtil.writer(response, HttpResult.error(HttpStatus.UN_LOGIN_CODE, HttpStatus.UN_LOGIN_MESSAGE));
+            return;
+        }
+
+        /*2.2、token解析*/
+        Map<String, Object> tokenMap = EncryUtil.descryV2(Global.PRI_KEY, token);
+        if (tokenMap == null) {
+            ResponseUtil.writer(response, HttpResult.error(HttpStatus.TOKEN_INVALID_CODE, HttpStatus.TOKEN_INVALID_MESSAGE));
+            return;
+        }
+
+        /*2.3、从redis获取用户登录token*/
+        Long userId = StringUtils.isNotBlank(tokenMap.get("userId")) ? NumberUtils.parseLong(tokenMap.get("userId")) : null;
+        String redisUserToken = RedissonUtils.getString(Global.getFullUserTokenKey(clientType, userId));
+        if (StringUtils.isBlank(redisUserToken)) {
+            ResponseUtil.writer(response, HttpResult.error(HttpStatus.TOKEN_INVALID_CODE, HttpStatus.TOKEN_INVALID_MESSAGE));
+            return;
+        }
+
+        /*2.4、请求token和redis中token不一致,说明账号在别处登录了*/
+        if (!token.equals(redisUserToken)) {
+            ResponseUtil.writer(response, HttpResult.error(HttpStatus.ACCOUNT_OTHER_LOGIN_CODE, HttpStatus.ACCOUNT_OTHER_LOGIN_MESSAGE));
+            return;
+        }
+
+        /*3、校验登录用户信息*/
+        String key = Global.getFullUserLoginKey(NumberUtils.parseInt(systemType), userId);
+        String userInfoStr = RedissonUtils.getString(key);
+        LoginUserInfo loginUserInfo = StringUtils.isNotBlank(userInfoStr) ? JSON.parseObject(userInfoStr, LoginUserInfo.class) : null;
+        if (StringUtils.isBlank(userInfoStr) || loginUserInfo == null) {
+            ResponseUtil.writer(response, HttpResult.error(HttpStatus.TOKEN_INVALID_CODE, HttpStatus.TOKEN_INVALID_MESSAGE));
+            return;
+        }
+
+
+        if (loginUserInfo.getIsMain() == Global.YES && Integer.parseInt(systemType) == SystemTypeEnum.MANAGE.getCode()) {
+            LoginUserHolder.set(loginUserInfo);
+            RedissonUtils.putString(Global.getFullUserTokenKey(clientType, userId), token, ClientTypeEnum.expireTime(clientType));
+            RedissonUtils.putString(Global.getFullUserLoginKey(NumberUtils.parseInt(systemType), loginUserInfo.getId()), JSON.toJSONString(loginUserInfo), Global.APP_TOKEN_EXPIRE);
+            RedissonUtils.putString(Global.getFullUserTokenKey(clientType, userId), token, ClientTypeEnum.expireTime(clientType));
+            filterChain.doFilter(servletRequest, servletResponse);
+            LoginUserHolder.remove();
+            return;
+        }
+
+        //校验用户账号是否冻结
+        if (loginUserInfo.getStatus() == Global.YES) {
+            ResponseUtil.writer(response, HttpResult.error(HttpStatus.TOKEN_INVALID_CODE, "您的账号已被冻结,请联系系统管理员!"));
+            return;
+        }
+
+        /*4、登录中的企业信息*/
+        String loginEntStr = RedissonUtils.getString(Global.getFullUserEntKey(loginUserInfo.getEntId()));
+        LoginEntInfo loginEntInfo = StringUtils.isNotBlank(loginEntStr) ? JSON.parseObject(loginEntStr, LoginEntInfo.class) : null;
+        if ((StringUtils.isBlank(loginEntStr) || loginEntInfo == null) && NumberUtils.parseInt(systemType) != SystemTypeEnum.MANAGE.getCode()) {
+            ResponseUtil.writer(response, HttpResult.error(HttpStatus.TOKEN_INVALID_CODE, HttpStatus.UN_LOGIN_MESSAGE));
+            return;
+        } else {
+            //校验用户企业是否冻结
+            if (Objects.isNull(loginEntInfo) || loginEntInfo.getStatus() == Global.YES) {
+                ResponseUtil.writer(response, HttpResult.error(HttpStatus.TOKEN_INVALID_CODE, "您所属企业已被冻结,请联系系统管理员!"));
+                return;
+            }
+
+            //校验用户企业审批状态
+            if (!loginEntInfo.getValid() && !REGISTER.equals(requestUri)) {
+                ResponseUtil.writer(response, HttpResult.error(HttpStatus.QUERY_FAIL_CODE, HttpStatus.ENTCERTIFICATES_INVAILD));
+                return;
+            }
+        }
+
+        /*5、请求权限校验*/
+        //非管理员有接口权限才放行
+        if (loginUserInfo.getIsMain() != Global.YES
+                && NumberUtils.parseInt(systemType) == SystemTypeEnum.MANAGE.getCode()
+                && !checkMenu(clientType, loginUserInfo.getId(), requestUri)) {
+            ResponseUtil.writer(response, HttpResult.error(HttpStatus.AUTHORITY_NO_CODE, HttpStatus.ACCESS_FIAL));
+            return;
+        }
+
+        LoginUserHolder.set(loginUserInfo);
+        LoginEntHolder.set(loginEntInfo);
+        RedissonUtils.putString(Global.getFullUserTokenKey(clientType, userId), token, ClientTypeEnum.expireTime(clientType));
+        RedissonUtils.putString(Global.getFullUserLoginKey(NumberUtils.parseInt(systemType), loginUserInfo.getId()), JSON.toJSONString(loginUserInfo), Global.APP_TOKEN_EXPIRE);
+        RedissonUtils.putString(Global.getFullUserEntKey(loginEntInfo.getId()), JSON.toJSONString(loginEntInfo), Global.APP_TOKEN_EXPIRE);
+        RedissonUtils.putString(Global.getFullUserTokenKey(clientType, userId), token, ClientTypeEnum.expireTime(clientType));
+        filterChain.doFilter(servletRequest, servletResponse);
+        LoginUserHolder.remove();
+        LoginEntHolder.remove();
+    }
+
+
+    /**
+     * @param userId 用户菜单权限key  url 当前请求url
+     * @return boolean
+     * @desc: 校验url权限
+     * @author: czh
+     * @date: 2023/6/28
+     */
+    private boolean checkMenu(String clientType, Long userId, String url) {
+        return RedissonUtils.contains(Global.REDIS_SYS_MENU_PREFIX + clientType + Global.COLON + userId, url);
+    }
+
+    public static void main(String[] args) {
+        Map<String, Object> tokenMap = EncryUtil.descryV2(Global.PRI_KEY, "dade5058e78847ca5672263c5b821fc09d06083611ab0f6d076af88f082f05384838b3714729e48088c6fc1d1c09763e85e35675a20ac9df50e443b92e1c18e06f9951c7d6a2905a79b889f8617ab143fc97350b5c68f0512f7c18dbf2e49eaf");
+        System.out.println(tokenMap);
+    }
+}

+ 134 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/filter/RequestCheckInterceptor.java

@@ -0,0 +1,134 @@
+//package com.sckw.core.filter;
+//
+//import com.sckw.core.annotation.RepeatSubmit;
+//import com.sckw.core.model.auth.context.LoginEnterpriseHolder;
+//import com.sckw.core.web.context.LoginUserHolder;
+//import jakarta.servlet.http.HttpServletRequest;
+//import jakarta.servlet.http.HttpServletResponse;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.lang.Nullable;
+//import org.springframework.web.method.HandlerMethod;
+//import org.springframework.web.servlet.HandlerInterceptor;
+//
+//import java.lang.reflect.Method;
+//import java.util.Map;
+//
+///**
+// * @author zk
+// * @desc 拦截器
+// * @date 2023/8/18
+// */
+//public class RequestCheckInterceptor implements HandlerInterceptor {
+//
+//    /**
+//     * @desc 请求处理之前执行
+//     * @author zk
+//     * @date 2023/8/18
+//     **/
+//    @Override
+//    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
+////        if (handler instanceof HandlerMethod) {
+////            HandlerMethod handlerMethod = (HandlerMethod) handler;
+////            Method method = handlerMethod.getMethod();
+////            //判断是否添加了防重复提交的注解
+////            RepeatSubmit annotation = method.getAnnotation(RepeatSubmit.class);
+////            if (annotation != null) {
+////                //判断该请求是否重复提交
+////                if (isRepeatSubmit(request, annotation)) {
+////                    //封装错误信息,直接返回
+////                    String message = annotation.message();
+////                    return false;
+////                }
+////            }
+////            return true;
+////        } else {
+////            return true;
+////        }
+//    }
+//
+//
+//    /**
+//     * @desc preHandle成功后执行
+//     * @author zk
+//     * @date 2023/8/18
+//     **/
+//    @Override
+//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, @Nullable Exception ex) throws Exception {
+//        LoginUserHolder.remove();
+//        LoginEnterpriseHolder.remove();
+//    }
+//
+//
+//    public boolean isRepeatSubmit(HttpServletRequest request, RepeatSubmit annotation)
+//    {
+//        String nowParams = "";
+//        if (request instanceof RepeatedlyRequestWrapper)
+//        {
+//            RepeatedlyRequestWrapper repeatedlyRequest = (RepeatedlyRequestWrapper) request;
+//            nowParams = HttpHelper.getBodyString(repeatedlyRequest);
+//        }
+//        //获取请求参数
+//        // body参数为空,获取Parameter的数据
+//        if (StringUtils.isEmpty(nowParams))
+//        {
+//            nowParams = JSON.toJSONString(request.getParameterMap());
+//        }
+//        Map<String, Object> nowDataMap = new HashMap<String, Object>();
+//        nowDataMap.put(REPEAT_PARAMS, nowParams);
+//        nowDataMap.put(REPEAT_TIME, System.currentTimeMillis());
+//
+//        // 请求地址(作为存进Redis的key值),没有使用url是因为所有请求的前缀都是一样的(http://ip地址:端口号),微服务
+//        项目使用nginx所在服务器的IP地址和端口号,之后再转发到网关。
+//        String url = request.getRequestURI();
+//        // 唯一值(没有消息头则使用请求地址)
+//        String submitKey = StringUtils.trimToEmpty(request.getHeader(header));
+//
+//        // 唯一标识(指定key + url + 消息头) 消息头相当于登录用户的唯一标识,唯一标识主要靠token区分。
+//        String cacheRepeatKey = CacheConstants.REPEAT_SUBMIT_KEY + url + submitKey;
+//        //从Redis获取锁
+//        Object sessionObj = redisCache.getCacheObject(cacheRepeatKey);
+//        if (sessionObj != null)
+//        {
+//            Map<String, Object> sessionMap = (Map<String, Object>) sessionObj;
+//            if (sessionMap.containsKey(url))
+//            {
+//                Map<String, Object> preDataMap = (Map<String, Object>) sessionMap.get(url);
+//                //如果请求地址相同、请求参数相同而且时间间隔小于间隔时间,则视为重复请求,直接返回。
+//                if (compareParams(nowDataMap, preDataMap) && compareTime(nowDataMap, preDataMap, annotation.interval()))
+//                {
+//                    return true;
+//                }
+//            }
+//        }
+//        //如果不是重复请求则将锁存进Redis中,过期时间为所设定的时间间隔然后返回。
+//        Map<String, Object> cacheMap = new HashMap<String, Object>();
+//        cacheMap.put(url, nowDataMap);
+//        redisCache.setCacheObject(cacheRepeatKey, cacheMap, annotation.interval(), TimeUnit.MILLISECONDS);
+//        return false;
+//    }
+//
+//    /**
+//     * 判断参数是否相同
+//     */
+//    private boolean compareParams(Map<String, Object> nowMap, Map<String, Object> preMap)
+//    {
+//        String nowParams = (String) nowMap.get(REPEAT_PARAMS);
+//        String preParams = (String) preMap.get(REPEAT_PARAMS);
+//        return nowParams.equals(preParams);
+//    }
+//
+//    /**
+//     * 判断两次间隔时间
+//     */
+//    private boolean compareTime(Map<String, Object> nowMap, Map<String, Object> preMap, int interval)
+//    {
+//        long time1 = (Long) nowMap.get(REPEAT_TIME);
+//        long time2 = (Long) preMap.get(REPEAT_TIME);
+//        if ((time1 - time2) < interval)
+//        {
+//            return true;
+//        }
+//        return false;
+//    }
+//
+//}

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

@@ -1,140 +1,140 @@
-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();
-    }
-
-}
+//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();
+//    }
+//
+//}

+ 3 - 3
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/base/BaseModel.java

@@ -1,7 +1,7 @@
 package com.sckw.core.model.base;
 
-import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import jakarta.validation.constraints.Size;
 import lombok.Data;
 import lombok.experimental.Accessors;
 
@@ -27,12 +27,13 @@ public class BaseModel implements Serializable {
 	/**
 	 * 备注
 	 */
+	@Size(max = 200, message = "备注长度不能超过200")
 	private String remark;
 
 	/**
 	 * 状态:0正常/1锁定
 	 */
-	private Integer status = 0;
+	private Integer status;
 
 	/**
 	 * 创建人
@@ -60,7 +61,6 @@ public class BaseModel implements Serializable {
 	/**
 	 * 删除标识(0正常/-1删除)
 	 */
-    @TableLogic
 	private Integer delFlag = 0;
 
 }

+ 57 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/base/IdsList.java

@@ -0,0 +1,57 @@
+package com.sckw.core.model.base;
+
+import com.sckw.core.utils.StringUtils;
+
+import java.util.List;
+
+/**
+ * ids处理接口类
+ *
+ * @author xucaiqin
+ * @date 2023-07-27 16:40:15
+ */
+public interface IdsList {
+    default String getId() {
+        return "";
+    }
+
+    default String getIds() {
+        return "";
+    }
+
+    /**
+     * 返回long类型的id
+     *
+     * @return Long
+     */
+    default Long getIdLong() {
+        String s;
+        if (StringUtils.isNotBlank(s = getId())) {
+            try {
+                return Long.parseLong(s);
+            } catch (NumberFormatException e) {
+                return null;
+            }
+        }
+        return null;
+    }
+
+    default Long changeId(String id) {
+        if (StringUtils.isNotBlank(id)) {
+            try {
+                return Long.parseLong(id);
+            } catch (NumberFormatException e) {
+                return null;
+            }
+        }
+        return null;
+    }
+
+    default List<Long> getIdList() {
+        return StringUtils.splitStrToList(getIds(), Long.class);
+    }
+
+    default List<String> getIdsList() {
+        return StringUtils.splitStrToList(getIds(), String.class);
+    }
+}

+ 24 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/base/TimeBase.java

@@ -0,0 +1,24 @@
+package com.sckw.core.model.base;
+
+import com.sckw.core.utils.StringTimeUtil;
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * @author xucaiqin
+ * @date 2023-07-27 19:30:53
+ */
+public interface TimeBase {
+    default String getStartDateTime(String time) {
+        if (StringUtils.isBlank(time)) {
+            return null;
+        }
+        return StringTimeUtil.fillStart(time);
+    }
+
+    default String getEndDateTime(String time) {
+        if (StringUtils.isBlank(time)) {
+            return null;
+        }
+        return StringTimeUtil.fillEnd(time);
+    }
+}

+ 45 - 4
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/constant/Global.java

@@ -36,7 +36,9 @@ public class Global {
     public static final int SHOW = 1;
     public static final int HIDE = 0;
     public static final int MINUS_ONE = -1;
-
+    /**正常/删除*/
+    public static final int DELETED = 1;
+    public static final int UN_DELETED = 0;
     /**是/否*/
     public static final int YES = 1;
     public static final int NO = 0;
@@ -63,6 +65,10 @@ public class Global {
     public static final int NUMERICAL_ONE = 1;
     public static final int NUMERICAL_TWO = 2;
     public static final int NUMERICAL_THREE = 3;
+    public static final int NUMERICAL_FOUR = 4;
+    public static final int NUMERICAL_EIGHT = 8;
+    public static final int NUMERICAL_TWELVE = 12;
+    public static final int NUMERICAL_SIXTEEN = 16;
 
     /**pid等于0的*/
     public static final String PID = "0";
@@ -79,16 +85,26 @@ public class Global {
     /**忘记密码获取验证码*/
     public static final String FORGET_SMS = "forget:";
 
+    /**忘记密码获取验证码*/
+    public static final String REPEAT_SUBMIT = "repeatSubmit:";
+
     /**用户登录验证码*/
     public static final String USER_LOGIN_CAPTCHA = "userLoginCaptcha:";
 
     /**redis用户信息前缀*/
     public static final String REDIS_USER_LOGIN_PREFIX = "userLoginInfo:";
     public static final String REDIS_USER_PREFIX = "userInfo:";
+    public static final String REDIS_USER_TOKEN_PREFIX = "userToken:";
 
     /**redis企业信息前缀*/
     public static final String REDIS_ENTERPRISE_PREFIX = "enterpriseInfo:";
 
+    /**redis区域信息前缀*/
+    public static final String REDIS_AREA_PREFIX = "areaInfo:";
+
+    /**redis区域信息前缀*/
+    public static final String REDIS_GROUP_AREA_PREFIX = "areaInfo:group:";
+
     /**redis用户菜单信息前缀*/
     public static final String REDIS_SYS_MENU_PREFIX = "sysMenu:";
 
@@ -115,9 +131,12 @@ public class Global {
     /**系统初始密码*/
     public static final String PASSWORD = "123456";
 
-    /**逗号*/
+    /**逗号-英文*/
     public static final String COMMA = ",";
 
+    /**逗号-中文*/
+    public static final String COMMA1 = ",";
+
     /**点*/
     public static final String DOT = ".";
 
@@ -139,6 +158,9 @@ public class Global {
     /**+符号**/
     public static final String PLUS = "+";
 
+    /**-符号*/
+    public static final String MINUS_SIGN = "-";
+
     /**#符号**/
     public static final String POUND = "#";
 
@@ -230,6 +252,9 @@ public class Global {
     public static final String CYCLE_MONTH = "月";
     public static final String CYCLE_YEAR = "年";
 
+    /**重量单位*/
+    public static final String UNIT_TON = "吨";
+    public static final String UNIT_KG = "千克";
 
     /**未读*/
     public static final Integer UN_READ = 0;
@@ -242,14 +267,25 @@ public class Global {
     /**已读*/
     public static final Integer READ = 1;
 
+
     /**完整的用户登录信息key*/
     public static String getFullUserLoginKey(Integer systemType, Long userId, String clientType) {
         return REDIS_USER_LOGIN_PREFIX + systemType + COLON + userId + COLON + clientType;
     }
 
+    /**完整的用户登录信息key*/
+    public static String getFullUserLoginKey(Integer systemType, Long userId) {
+        return REDIS_USER_LOGIN_PREFIX + systemType + COLON + userId;
+    }
+
+    /**完整的用户登录tokenkey*/
+    public static String getFullUserTokenKey(String clientType, Long userId) {
+        return REDIS_USER_TOKEN_PREFIX + clientType + COLON + userId;
+    }
+
     /**完整的用户企业信息key*/
-    public static String getFullUserEntKey(Integer systemType, Long userId) {
-        return REDIS_ENTERPRISE_PREFIX + systemType + COLON + userId;
+    public static String getFullUserEntKey(Long entId) {
+        return REDIS_ENTERPRISE_PREFIX + entId;
     }
 
     /**完整的用户菜单信息key*/
@@ -261,4 +297,9 @@ public class Global {
     public static String getForgetKey(Integer systemType, String account) {
         return FORGET_SMS + systemType + COLON + account;
     }
+
+    /**完整的校验重复请求key*/
+    public static String getRepeatSubmitKey(Long userId, String url) {
+        return REPEAT_SUBMIT + userId + COLON + url;
+    }
 }

+ 40 - 0
sckw-common/sckw-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;
+    }
+
+}

+ 4 - 4
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/ApprovalEnum.java

@@ -11,13 +11,13 @@ import lombok.Getter;
 public enum ApprovalEnum {
 
     //未审批
-    NO(0, "未审批"),
+    NO(0, "待认证"),
     //通过
-    OK(1, "通过"),
+    OK(1, "已认证"),
     //未通过
-    PASS(2, "未通过"),
+    PASS(2, "已驳回"),
     //审批中
-    PROCESS(3, "审批"),
+    PROCESS(3, "审批"),
     //更新中,待审批
     REFRESH(4, "更新中");
 

+ 52 - 0
sckw-common/sckw-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;
+    }
+
+}

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

@@ -0,0 +1,154 @@
+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 changeDriverAndTruck(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;
+    }
+}

+ 164 - 0
sckw-common/sckw-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;
+    }
+}

+ 37 - 0
sckw-common/sckw-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;
+    }
+}

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

@@ -1,5 +1,7 @@
 package com.sckw.core.model.enums;
 
+import com.sckw.core.model.constant.Global;
+
 /**
  * @Description 客户端类型枚举
  * @Author dengyinghui
@@ -8,6 +10,7 @@ package com.sckw.core.model.enums;
 public enum ClientTypeEnum {
     //浏览器-官网
     pc("浏览器", "pc"),
+    app("app", "app"),
     //苹果设备
     ios("苹果设备", "ios"),
     //安卓设备
@@ -43,4 +46,14 @@ public enum ClientTypeEnum {
     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
sckw-common/sckw-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
sckw-common/sckw-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
sckw-common/sckw-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
sckw-common/sckw-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 CooperateStatusEnum getName(int code) {
+        for (CooperateStatusEnum cooperateStatusEnum : values()) {
+            if (cooperateStatusEnum.getCode() == code) {
+                return cooperateStatusEnum;
+            }
+        }
+        return null;
+    }
+
+}

+ 40 - 0
sckw-common/sckw-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;
+    }
+
+}

+ 19 - 4
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/EntTypeEnum.java

@@ -1,7 +1,11 @@
 package com.sckw.core.model.enums;
 
+import com.sckw.core.model.constant.Global;
 import lombok.Getter;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * @author czh
  * @desc 企业类型枚举
@@ -14,10 +18,10 @@ public enum EntTypeEnum {
     SUPPLIER(1, "供应商"),
     //采购商
     PURCHASER(2, "采购商"),
-    //34PL物流
-    LOGISTICS34(3, "34PL物流"),
-    //43PL物流
-    LOGISTICS43(4, "43PL物流");
+    //4PL物流  托运 承运
+    LOGISTICS3(3, "4PL物流"),
+    //3PL物流  承运
+    LOGISTICS4(4, "3PL物流");
 
     private final int code;
 
@@ -36,4 +40,15 @@ public enum 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);
+    }
 }

+ 35 - 0
sckw-common/sckw-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
sckw-common/sckw-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
sckw-common/sckw-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;
+    }
+}

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

@@ -0,0 +1,165 @@
+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;
+    }
+}

+ 62 - 0
sckw-common/sckw-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;
+    }
+
+
+}

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

@@ -0,0 +1,50 @@
+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;
+    }
+}

+ 62 - 0
sckw-common/sckw-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
sckw-common/sckw-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;
+    }
+}

+ 6 - 6
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/SystemTypeEnum.java

@@ -12,22 +12,22 @@ public enum SystemTypeEnum {
     //运营端
     MANAGE(1, "运营端"),
     //企业开户
-    COMPANY(2, "企业开户"),
+    COMPANY(2, "企业"),
     //司机
-    DRIVER(3, "司机");
+    DRIVER(3, "司机");
 
-    private final int code;
+    private final Integer code;
 
     private final String name;
 
-    SystemTypeEnum(int code, String name){
+    SystemTypeEnum(Integer code, String name){
         this.code = code;
         this.name = name;
     }
 
-    public static SystemTypeEnum getName(int code){
+    public static SystemTypeEnum getName(Integer code){
         for (SystemTypeEnum systemTypeEnum : values()) {
-            if (systemTypeEnum.getCode() == code) {
+            if (systemTypeEnum.getCode().equals(code)) {
                 return systemTypeEnum;
             }
         }

+ 49 - 0
sckw-common/sckw-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;
+    }
+}

+ 11 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/page/PageHelperUtil.java

@@ -57,6 +57,17 @@ public class PageHelperUtil {
         return setPageResult(pageInfo);
     }
 
+    /**
+     * 将分页信息封装到统一的接口  针对于有复杂的业务组装接口
+     * @return PageResult
+     */
+    public static PageResult getPageResult(PageInfo<?> pageInfo, List<?> totalList, int pageSize) {
+        PageInfo<?> pageInfoTotal = new PageInfo<>(totalList);
+        pageInfo.setTotal(pageInfoTotal.getTotal());
+        pageInfo.setPageSize(pageSize);
+        return setPageResult(pageInfo);
+    }
+
     public static PageResult setPageResult(PageInfo<?> pageInfo){
         PageResult pageResult = new PageResult();
         pageResult.setPage(pageInfo.getPageNum());

+ 63 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/page/PageRes.java

@@ -1,7 +1,9 @@
 package com.sckw.core.model.page;
 
 import com.github.pagehelper.PageInfo;
+import com.sckw.core.utils.CollectionUtils;
 
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -34,9 +36,35 @@ public class PageRes<T> {
     protected List<T> list;
 
     public PageRes() {
+        this.list = new ArrayList<>();
+    }
+
+    public PageRes(int page, int pageSize, long size, int pages, List<T> list) {
+        this.page = page;
+        this.pageSize = pageSize;
+        this.size = size;
+        this.pages = pages;
+        this.list = list;
     }
 
     public PageRes(PageInfo<T> pageInfo) {
+        this.page = pageInfo.getPageNum();
+        this.pageSize = pageInfo.getPageSize();
+        this.size = pageInfo.getTotal();
+        this.pages = pageInfo.getPages();
+        this.list = CollectionUtils.isEmpty(pageInfo.getList()) ? new ArrayList<>() : pageInfo.getList();
+    }
+
+    public PageRes(PageInfo<T> pageInfo, List<T> list) {
+        this.page = pageInfo.getPageNum();
+        this.pageSize = pageInfo.getPageSize();
+        this.size = pageInfo.getTotal();
+        this.pages = pageInfo.getPages();
+        this.list = list;
+    }
+
+    public PageRes(List<T> list) {
+        PageInfo<T> pageInfo = new PageInfo<>(list);
         this.page = pageInfo.getPageNum();
         this.pageSize = pageInfo.getPageSize();
         this.size = pageInfo.getTotal();
@@ -44,6 +72,41 @@ public class PageRes<T> {
         this.list = pageInfo.getList();
     }
 
+    /**
+     * 构建返回数据
+     *
+     * @param pagInfo pageHelper的分页对象
+     * @param list    实际返回的数据集
+     * @return
+     */
+    public static <T> PageRes<T> build(PageInfo<?> pagInfo, List<T> list) {
+        PageRes<T> tPageRes = new PageRes<>();
+        tPageRes.setPage(pagInfo.getPageNum());
+        tPageRes.setPageSize(pagInfo.getPageSize());
+        tPageRes.setSize(pagInfo.getTotal());
+        tPageRes.setPages(pagInfo.getPages());
+        tPageRes.setList(list);
+        return tPageRes;
+    }
+
+    /**
+     * 手动对list进行分页数据处理
+     *
+     * @param page     当前页
+     * @param pageSize 每页大小
+     * @param list     总数据
+     * @return
+     */
+    public static <T> PageRes<T> handPage(int page, int pageSize, List<T> list) {
+        PageRes<T> tPageRes = new PageRes<>();
+        tPageRes.setPage(page);
+        tPageRes.setPageSize(pageSize);
+        tPageRes.setSize(list.size());
+        tPageRes.setPages(list.size() / pageSize + 1);
+        tPageRes.setList(list.stream().skip((long) (page - 1) * pageSize).limit(pageSize).toList());
+        return tPageRes;
+    }
+
     public void setPage(int page) {
         this.page = page;
     }

+ 4 - 3
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/page/PageResult.java

@@ -2,6 +2,7 @@ package com.sckw.core.model.page;
 
 import com.github.pagehelper.PageInfo;
 
+import java.io.Serializable;
 import java.util.List;
 import java.util.Map;
 
@@ -10,7 +11,7 @@ import java.util.Map;
  * @Author zk
  * @Date 2019/5/14
  */
-public class PageResult {
+public class PageResult implements Serializable {
 
     /**
      * 当前页数
@@ -66,12 +67,12 @@ public class PageResult {
         this.list = pageInfo.getList();
     }
 
-    public static <T> PageResult build(Integer page, Integer pageSize, Integer totalCount, List<T> records) {
+    public static <T> PageResult build(Integer page, Integer pageSize, Long totalCount, List<T> records) {
         PageResult pageResult = new PageResult();
         pageResult.setPage(page);
         pageResult.setPageSize(pageSize);
         pageResult.setSize(totalCount);
-        pageResult.setPages((totalCount + pageSize - 1) / pageSize);
+        pageResult.setPages((int) ((totalCount + pageSize - 1) / pageSize));
         pageResult.setList(records);
         return pageResult;
     }

+ 25 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/vo/BaseList.java

@@ -0,0 +1,25 @@
+package com.sckw.core.model.vo;
+
+import jakarta.validation.constraints.NotBlank;
+import lombok.Data;
+import org.hibernate.validator.constraints.Length;
+
+/**
+ * @author lfdc
+ * @description
+ * @date 2023-08-15 19:08:14
+ */
+@Data
+public class BaseList {
+    /**
+     * 数据id 逗号隔开
+     */
+    @NotBlank(message = "数据id不能为空")
+    private String ids;
+
+    /**
+     * 备注
+     */
+    @Length(max = 200,message = "备注长度错误最大长度:{max}")
+    private String remark;
+}

+ 2 - 3
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/vo/FileInfoVO.java

@@ -2,6 +2,7 @@ package com.sckw.core.model.vo;
 
 import lombok.Data;
 
+import java.io.Serializable;
 import java.math.BigDecimal;
 
 /**
@@ -10,9 +11,7 @@ import java.math.BigDecimal;
  * @date 2023-07-04 09:07:08
  */
 @Data
-public class FileInfoVO {
-
-
+public class FileInfoVO implements Serializable {
     /**
      * 文件上传类型 oss/qiniuyun
      */

+ 6 - 1
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/vo/TableStatisticRes.java

@@ -5,6 +5,8 @@ import lombok.Setter;
 import lombok.ToString;
 import lombok.experimental.Accessors;
 
+import java.io.Serial;
+import java.io.Serializable;
 import java.util.List;
 
 /**
@@ -16,7 +18,10 @@ import java.util.List;
 @Setter
 @ToString
 @Accessors(chain = true)
-public class TableStatisticRes {
+public class TableStatisticRes implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1699225803039367149L;
 
     /**
      * 表格顶部对象

+ 7 - 1
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/vo/TableTop.java

@@ -5,6 +5,9 @@ import lombok.Setter;
 import lombok.ToString;
 import lombok.experimental.Accessors;
 
+import java.io.Serial;
+import java.io.Serializable;
+
 /**
  * @desc: 表格顶部对象
  * @author: yzc
@@ -14,7 +17,10 @@ import lombok.experimental.Accessors;
 @Setter
 @ToString
 @Accessors(chain = true)
-public class TableTop {
+public class TableTop implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -2419518869931408146L;
 
     /**
      * tab名称

+ 2 - 2
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/AsyncThreadUtils.java

@@ -38,7 +38,7 @@ public class AsyncThreadUtils {
      * 直接提交任务,无返回值
      * @param task Runnable
      */
-    public static void submit(Runnable task){
+    public static void submit(Runnable task) {
         poolExecutor.submit(task);
     }
 
@@ -47,7 +47,7 @@ public class AsyncThreadUtils {
      * @param <T>
      * @return Future
      */
-    public static <T> Future<T> submit(Callable<T> task){
+    public static <T> Future<T> submit(Callable<T> task) {
         return poolExecutor.submit(task);
     }
 

+ 73 - 30
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/BeanUtils.java

@@ -1,12 +1,15 @@
 package com.sckw.core.utils;
 
 import cn.hutool.core.bean.BeanUtil;
+import com.sckw.core.model.constant.Global;
 
 import java.beans.PropertyDescriptor;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author zk
@@ -65,8 +68,9 @@ public class BeanUtils extends BeanUtil {
             return null;
         }
         int startIndex = 0;
-        if (fieldName.charAt(0) == UNDERLINE){
-            startIndex = 1;}
+        if (fieldName.charAt(0) == UNDERLINE) {
+            startIndex = 1;
+        }
         return "get"
                 + fieldName.substring(startIndex, startIndex + 1).toUpperCase()
                 + fieldName.substring(startIndex + 1);
@@ -98,41 +102,41 @@ public class BeanUtils extends BeanUtil {
      * @return: boolean 有则反之true 反之false
      *
     public static boolean isProperty(Object bean, String propertyName){
-        if (bean == null) {
-            return false;
-        }
-        Class<?> cls = bean.getClass();
-        PropertyDescriptor[] propertys = org.springframework.beans.BeanUtils.getPropertyDescriptors(cls);
-        for (PropertyDescriptor property : propertys){
-            String fieldName = property.getName();
-            if(fieldName != null && propertyName != null && fieldName.equals(propertyName)){
-                return true;
-            }
-        }
-        return false;
+    if (bean == null) {
+    return false;
+    }
+    Class<?> cls = bean.getClass();
+    PropertyDescriptor[] propertys = org.springframework.beans.BeanUtils.getPropertyDescriptors(cls);
+    for (PropertyDescriptor property : propertys){
+    String fieldName = property.getName();
+    if(fieldName != null && propertyName != null && fieldName.equals(propertyName)){
+    return true;
+    }
+    }
+    return false;
     }*/
 
 
     /**
+     * @param object
+     * @return boolean
      * @description 判断当前对象是否为空
      * @author jiangwei
      * @date 2020/9/18 14:40
-     * @param object
-     * @return boolean
      **/
-    public static boolean objCheckIsNull(Object object){
-        return objCheckIsNull(object,null,null);
+    public static boolean objCheckIsNull(Object object) {
+        return objCheckIsNull(object, null, null);
     }
 
     /**
+     * @param object           入参对象
+     * @param excludeNameList  要剔除的属性名称,没有就传空集合或者null
+     * @param excludeValueList 要剔除的数值,没有就传空集合或者null
+     * @return boolean
      * @description 判断当前对象是否为空(包括所有属性为空)
      * 可选则在判断规则中剔除某一字段,或者某一值
      * @author jiangwei
      * @date 2020/5/22 10:14
-     * @param object 入参对象
-     * @param excludeNameList 要剔除的属性名称,没有就传空集合或者null
-     * @param excludeValueList 要剔除的数值,没有就传空集合或者null
-     * @return boolean
      **/
     public static boolean objCheckIsNull(Object object, List<String> excludeNameList, List<Object> excludeValueList) {
 
@@ -194,26 +198,65 @@ public class BeanUtils extends BeanUtil {
     }
 
     /**
-     *
-     * @Title: isProperty
-     * @Description: 判断对象是否存在某属性
-     * @param bean 对象
+     * @param bean         对象
      * @param propertyName 属性
      * @return
+     * @Title: isProperty
+     * @Description: 判断对象是否存在某属性
      * @return: boolean 有则反之true 反之false
-     * */
-    public static boolean isProperty(Object bean, String propertyName){
+     */
+    public static boolean isProperty(Object bean, String propertyName) {
         if (bean == null) {
             return false;
         }
         Class<?> cls = bean.getClass();
         PropertyDescriptor[] propertys = org.springframework.beans.BeanUtils.getPropertyDescriptors(cls);
-        for (PropertyDescriptor property : propertys){
+        for (PropertyDescriptor property : propertys) {
             String fieldName = property.getName();
-            if(fieldName != null && propertyName != null && fieldName.equals(propertyName)){
+            if (fieldName != null && propertyName != null && fieldName.equals(propertyName)) {
                 return true;
             }
         }
         return false;
     }
+
+    /**
+     * @param source 源对象
+     * @param target 目标对象
+     * @desc source 属性值赋值给target
+     * @author zk
+     * @date 2023/7/18
+     **/
+    public static void copyPropertiesValue(Object source, Object target) {
+        // 获取实体类的所有属性,返回Field数组
+        Field[] field = target.getClass().getDeclaredFields();
+        // 遍历所有属性
+        for (int j = 0; j < field.length; j++) {
+            // 获取属性的名字
+            String fieldName = field[j].getName();
+            // 通过属性名称获取对象属性值
+            Object value = BeanUtils.getProperty(source, fieldName);
+            if (value != null) {
+                // 为对象属性赋值
+                BeanUtils.setProperty(target, fieldName, value);
+            }
+        }
+    }
+
+    public static Map<String, Object> convertToMap(Object yourObject) {
+        Map<String, Object> map = new HashMap<>(Global.NUMERICAL_SIXTEEN);
+        try {
+            Field[] fields = yourObject.getClass().getDeclaredFields();
+            for (Field field : fields) {
+                field.setAccessible(true);
+                String fieldName = field.getName();
+                Object fieldValue = field.get(yourObject);
+                map.put(fieldName, fieldValue);
+            }
+        } catch (IllegalAccessException e) {
+            throw new RuntimeException(e);
+        }
+        return map;
+    }
+
 }

+ 29 - 2
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/CollectionUtils.java

@@ -2,6 +2,8 @@ package com.sckw.core.utils;
 
 import cn.hutool.core.collection.CollectionUtil;
 import com.alibaba.fastjson.JSONObject;
+import com.sckw.core.model.constant.Global;
+
 import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
 import java.util.*;
@@ -228,7 +230,8 @@ public class CollectionUtils extends CollectionUtil {
 		if (list.size() == 0) {
 			return null;
 		}
-		Integer count = list.size(); // 记录总数
+		// 记录总数
+		Integer count = list.size();
 		int fromIndex = Math.min((page - 1) * pageSize,count);
 		int toIndex = Math.min(fromIndex + pageSize,count);
 
@@ -358,6 +361,10 @@ public class CollectionUtils extends CollectionUtil {
 	  System.out.println("retList==1==:" + outList);
 	  outList = change2(inList, "name", outList);
 	  System.out.println("retList==2==:" + JSONObject.toJSONString(outList));
+
+	  List list = toList("165159551228710912,165181777487335424,165181777487335425,165181777487335426", false);
+	  System.out.println(list);
+
     }
 
     /**
@@ -385,7 +392,7 @@ public class CollectionUtils extends CollectionUtil {
 	 * @throws IllegalAccessException
 	 */
 	public static Map beanToMap(Object object) throws Exception {
-		Map<String, Object> map = new HashMap<String, Object>();
+		Map<String, Object> map = new HashMap<>(Global.NUMERICAL_SIXTEEN);
 		Field[] fields = object.getClass().getDeclaredFields();
 		for (Field field : fields) {
 			field.setAccessible(true);
@@ -417,4 +424,24 @@ public class CollectionUtils extends CollectionUtil {
 		}
 		return object;
 	}
+
+	/**
+	 * @param str 数组转换值
+	 * @param bool true 原顺序、false 倒序
+	 * @desc 字符串转换集合
+	 * @author zk
+	 * @date 2023/8/7
+	 **/
+	public static List toList(String str, boolean bool) {
+		if (StringUtils.isNotBlank(str)) {
+			List idArray = Arrays.asList(str.split(Global.COMMA));
+			if (!bool) {
+				Collections.reverse(idArray);
+			}
+			return idArray;
+		} else {
+			return new ArrayList();
+		}
+	}
+
 }

+ 720 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/DateUtils.java

@@ -0,0 +1,720 @@
+package com.sckw.core.utils;
+
+import cn.hutool.core.date.DateUtil;
+import com.sckw.core.exception.BusinessException;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.*;
+import java.time.format.DateTimeFormatter;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Objects;
+
+/**
+ * 日期处理
+ *
+ * @author
+ */
+public class DateUtils extends DateUtil {
+    /**
+     * 时间格式(yyyy-MM-dd)
+     */
+    public final static String DATE_PATTERN = "yyyy-MM-dd";
+    /**
+     * 时间格式(yyyy-MM-dd HH:mm:ss)
+     */
+    public final static String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss";
+
+    public static String FORMAT2 = "yyyy-MM-dd HH:mm:ss";
+
+    public static String FORMAT3 = "yyyyMMddHHmmss";
+
+    public static String FORMAT4 = "yyMMddHHmmss";
+
+    public static String FORMAT5 = "yyMMddHHmmssSSS";
+
+    public static String FORMAT6 = "yyyyMMdd";
+
+    public static String FORMAT7 = "yyyy-MM-dd HH:mm";
+
+    public static String FORMAT8 = "yyMMdd";
+
+    public static String FORMAT9 = "yyyy/MM/dd";
+
+    public static String FORMAT10 = "yyyy-MM";
+
+    public static int THIRTEEN = 13;
+
+    /**
+     * 获取时间
+     *
+     * @return 返回当前时间
+     */
+    public static Date getDate() {
+        return new Date();
+    }
+
+    public static String getCurrentTime() {
+        Date day = new Date();
+        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        System.out.println(df.format(day));
+        return df.format(day);
+    }
+
+    public static String getCurrentTime(String format) {
+        Date day = new Date();
+        SimpleDateFormat df = new SimpleDateFormat(format);
+        System.out.println(df.format(day));
+        return df.format(day);
+    }
+
+    /**
+     * 获取时间
+     *
+     * @param timeStamp 时间戳
+     * @return Date
+     */
+    public static Date getDate(Long timeStamp) {
+        if (timeStamp == null || timeStamp <= 0) {
+            return null;
+        }
+        return new Date(timeStamp);
+    }
+
+    /**
+     * 日期格式化 日期格式为:yyyy-MM-dd
+     *
+     * @param date 日期
+     * @return 返回yyyy-MM-dd格式日期
+     */
+    public static String format(Date date) {
+        return format(date, DATE_PATTERN);
+    }
+
+    /**
+     * 日期格式化 日期格式为:yyyy-MM-dd HH:mm:ss
+     *
+     * @param date 日期
+     * @return 返回yyyy-MM-dd格式日期
+     */
+    public static String formatV1(Date date) {
+        return format(date, DATE_TIME_PATTERN);
+    }
+
+    /**
+     * 日期格式化 日期格式为:yyyy-MM-dd
+     *
+     * @param date    日期
+     * @param pattern 格式,如:DateUtils.DATE_TIME_PATTERN
+     * @return 返回yyyy-MM-dd格式日期
+     */
+    public static String format(Date date, String pattern) {
+        if (date != null) {
+            SimpleDateFormat df = new SimpleDateFormat(pattern);
+            return df.format(date);
+        }
+        return null;
+    }
+
+
+    /**
+     * 日期格式化 日期格式为:yyyy-MM-dd
+     *
+     * @param date 日期
+     * @return 返回yyMMdd格式日期
+     */
+    public static Date formatDate(String date) {
+        try {
+            if (date != null) {
+                SimpleDateFormat df = new SimpleDateFormat(DATE_TIME_PATTERN);
+                return df.parse(date);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+
+    /**
+     * 日期格式化 日期格式为:yyyy-MM-dd
+     *
+     * @param date 日期
+     * @return 返回yyMMdd格式日期
+     */
+    public static String formatDate(Date date) {
+        if (date != null) {
+            SimpleDateFormat df = new SimpleDateFormat(FORMAT8);
+            return df.format(date);
+        }
+        return null;
+    }
+
+
+    /**
+     * 日期格式化 日期格式为:yyyy-MM-dd
+     *
+     * @param expireDate 日期
+     * @return 返回yyMMdd格式日期
+     */
+    public static String formatDateToYYMMDD(Date expireDate) {
+        if (expireDate != null) {
+            String str = new SimpleDateFormat("yyMMdd").format(expireDate);
+            return str;
+        }
+        return null;
+    }
+
+    /**
+     * @param date
+     * @return String    返回类型
+     * @Title: getYear
+     * @Description: TODO(获取YYYY格式)
+     */
+    public static String getYear(Date date) {
+        return format(date, "yyyy");
+    }
+
+    /**
+     * @param date
+     * @return String    返回类型
+     * @Title: getMonth
+     * @Description: 获取月(获取MM格式)
+     */
+    public static String getMonth(Date date) {
+        return format(date, "MM");
+    }
+
+    /**
+     * @param date
+     * @return String    返回类型
+     * @Title: getTheDay
+     * @Description: 获取日期的天(dd格式)
+     */
+    public static String getTheDay(Date date) {
+        return format(date, "dd");
+    }
+
+    /**
+     * 方法描述:将时间转换为制定格式的日期时间字符串
+     *
+     * @param date
+     * @return
+     */
+    public static String dateToString(Date date, String pattern) {
+        SimpleDateFormat df;
+        String returnValue = "";
+
+        if (date != null) {
+            df = new SimpleDateFormat(pattern);
+            returnValue = df.format(date);
+        }
+        return (returnValue);
+    }
+
+    /**
+     * @param beginDateStr
+     * @param endDateStr
+     * @return long    返回类型
+     * @Title: getDaySub
+     * @Description: TODO(功能描述 : 时间相减得到天数)
+     */
+    public static long getDaySub(String beginDateStr, String endDateStr) {
+        long day = 0;
+        SimpleDateFormat format = new SimpleDateFormat(
+                "yyyy-MM-dd");
+        Date beginDate = null;
+        Date endDate = null;
+
+        try {
+            beginDate = format.parse(beginDateStr);
+            endDate = format.parse(endDateStr);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        day = (endDate.getTime() - beginDate.getTime()) / (24 * 60 * 60 * 1000);
+        // System.out.println("相隔的天数="+day);
+
+        return day;
+    }
+
+    /**
+     * 10位13位时间戳转String 格式(2018-10-15 16:03:27) 日期
+     *
+     * @param timestamp
+     * @param simpleDateFormatType 时间戳类型("yyyy-MM-dd HH:mm:ss")
+     * @return
+     */
+    public static String numberDateFormat(String timestamp, String simpleDateFormatType) {
+        //要转换的时间格式
+        SimpleDateFormat sdf = new SimpleDateFormat(simpleDateFormatType);
+        String date = null;
+        if (timestamp.length() == THIRTEEN) {
+            date = sdf.format(Long.parseLong(timestamp));
+        } else {
+            date = sdf.format(Long.parseLong(timestamp) * 1000);
+        }
+        return date;
+    }
+
+    /**
+     * 10位13位时间戳转Date
+     *
+     * @param timestamp            参数时间戳
+     * @param simpleDateFormatType 时间戳类型("yyyy-MM-dd HH:mm:ss")
+     * @return
+     */
+    public static Date numberDateFormatToDate(String timestamp, String simpleDateFormatType) {
+        //要转换的时间格式
+        SimpleDateFormat sdf = new SimpleDateFormat(simpleDateFormatType);
+        Date date = null;
+        try {
+            if (timestamp.length() == THIRTEEN) {
+                date = sdf.parse(sdf.format(Long.parseLong(timestamp)));
+            } else {
+                date = sdf.parse(sdf.format(Long.parseLong(timestamp) * 1000));
+            }
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return date;
+    }
+
+    /**
+     * Date转10位13位时间戳
+     *
+     * @param date 参数date
+     * @param n    需要转换成几位时间戳
+     * @return
+     */
+    public static String numberDateFormatToDate(Date date, int n) {
+        String result = null;
+        if (n == THIRTEEN) {
+            result = String.valueOf(date.getTime());
+        } else {
+            result = String.valueOf(date.getTime() / 1000);
+        }
+        return result;
+    }
+
+    /**
+     * @Author:Bernie
+     * @Params: seconds 秒数
+     * @Description: 通过秒数转换为时分秒
+     * @Date: 2019/7/18 0018 16:46
+     */
+    public static String getTimeBySecond(long seconds) {
+        //转换天数
+        long days = seconds / 86400;
+        //剩余秒数
+        seconds = seconds % 86400;
+        //转换小时数
+        long hours = seconds / 3600;
+        //剩余秒数
+        seconds = seconds % 3600;
+        //转换分钟
+        long minutes = seconds / 60;
+        //剩余秒数
+        seconds = seconds % 60;
+        if (0 < days) {
+            return days + "天," + hours + "小时," + minutes + "分," + seconds + "秒";
+        } else {
+            return (hours == 0 ? "00" : (hours >= 10 ? hours : "0" + hours)) + ":" + (minutes == 0 ? "00" : (minutes >= 10 ? minutes : "0" + minutes)) + ":" + (seconds == 0 ? "00" : (seconds >= 10 ? seconds : "0" + seconds)) + "秒";
+        }
+
+    }
+
+    /**
+     * @return java.lang.String
+     * @Description 转换iso格式
+     * @Author CHENJUN
+     * @Date 2020/7/10 14:49
+     * @params [isoDate]
+     */
+    public static long getDateFromISO(String isoDate) {
+        DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
+//        DateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        try {
+            return sdf.parse(isoDate).getTime();
+        } catch (ParseException e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+
+    public static long getDateFromDate(String date) {
+        DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+//        DateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        try {
+            return sdf.parse(date).getTime();
+        } catch (ParseException e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+
+    public static int getDifference(String start, String end) {
+        SimpleDateFormat simpleFormat = new SimpleDateFormat("yyyy-MM-dd");
+        /*天数差*/
+        Date fromDate1 = null, toDate1 = null;
+        try {
+            fromDate1 = simpleFormat.parse(start);
+            toDate1 = simpleFormat.parse(end);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        long from1 = fromDate1.getTime();
+        long to1 = toDate1.getTime();
+        int days = (int) ((to1 - from1) / (1000 * 60 * 60 * 24));
+        System.out.println("两个时间之间的天数差为:" + days);
+        return days;
+    }
+
+    /**
+     * @return 以小数格式显示的小时
+     * @Description 将毫秒转换成以小数格式显示的小时
+     * @Author SuiYingying
+     * @Date 2021/12/24 14:49
+     * @params time 毫秒格式的时间
+     */
+    public static String getHoursForLong(Long time) {
+        float newTime;
+        time = time / 1000;
+        newTime = (float) time % (1000 * 60 * 60 * 24) / (1000 * 60 * 60);
+        newTime = newTime * 1000;
+        return String.format("%.5f", newTime);
+    }
+
+    /**
+     * 获取当天剩余秒数
+     *
+     * @return
+     */
+    public static Long getSecondsDay() {
+        LocalDateTime nextDay = LocalDate.now().plusDays(1).atStartOfDay();
+        LocalDateTime now = LocalDateTime.now();
+        return Duration.between(now, nextDay).getSeconds();
+    }
+
+    /**
+     * 对日期的【秒】进行加/减
+     *
+     * @param date    日期
+     * @param seconds 秒数,负数为减
+     * @return 加/减几秒后的日期
+     */
+    public static Date addDateSeconds(Date date, int seconds) {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(date);
+        cal.add(Calendar.MINUTE, seconds);
+        return cal.getTime();
+    }
+
+    /**
+     * 对日期的【分钟】进行加/减
+     *
+     * @param date    日期
+     * @param minutes 分钟数,负数为减
+     * @return 加/减几分钟后的日期
+     */
+    public static Date addDateMinutes(Date date, int minutes) {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(date);
+        cal.add(Calendar.MINUTE, minutes);
+        return cal.getTime();
+    }
+
+    /**
+     * 对日期的【小时】进行加/减
+     *
+     * @param date  日期
+     * @param hours 小时数,负数为减
+     * @return 加/减几小时后的日期
+     */
+    public static Date addDateHours(Date date, int hours) {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(date);
+        cal.add(Calendar.HOUR, hours);
+        return cal.getTime();
+    }
+
+    /**
+     * 对日期的【天】进行加/减
+     *
+     * @param date 日期
+     * @param days 天数,负数为减
+     * @return 加/减几天后的日期
+     */
+    public static Date addDateDays(Date date, int days) {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(date);
+        cal.add(Calendar.DATE, days);
+        return cal.getTime();
+    }
+
+    /**
+     * 对日期的【周】进行加/减
+     *
+     * @param date  日期
+     * @param weeks 周数,负数为减
+     * @return 加/减几周后的日期
+     */
+    public static Date addDateWeeks(Date date, int weeks) {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(date);
+        cal.add(Calendar.DATE, weeks * 7);
+        return cal.getTime();
+    }
+
+    /**
+     * 对日期的【月】进行加/减
+     *
+     * @param date   日期
+     * @param months 月数,负数为减
+     * @return 加/减几月后的日期
+     */
+    public static Date addDateMonths(Date date, int months) {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(date);
+        cal.add(Calendar.MONTH, months);
+        return cal.getTime();
+    }
+
+    /**
+     * 对日期的【年】进行加/减
+     *
+     * @param date  日期
+     * @param years 年数,负数为减
+     * @return 加/减几年后的日期
+     */
+    public static Date addDateYears(Date date, int years) {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(date);
+        cal.add(Calendar.YEAR, years);
+        return cal.getTime();
+    }
+
+    /**
+     * 时间比较大小
+     *
+     * @param date1 日期
+     * @param date2 年数,负数为减
+     * @return -1 date1小于date2、0 date1等于date2、1 date1大于date2
+     */
+    public static int compareTo(Date date1, Date date2) {
+        return date1.compareTo(date2);
+    }
+
+    public static void main(String[] ager) throws InterruptedException {
+        Date newTime = new Date();
+        Date time = addDateMinutes(new Date(), 10);
+        int result = newTime.compareTo(time);
+        System.out.println(result);
+    }
+
+    /**
+     * ltf 获取
+     * 获取指定日期所在周的周一
+     *
+     * @param date
+     * @return
+     */
+    public static Date getFirstDayOfWeek(Date date) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        if (c.get(Calendar.DAY_OF_WEEK) == 1) {
+            c.add(Calendar.DAY_OF_MONTH, -1);
+        }
+        c.add(Calendar.DATE, c.getFirstDayOfWeek() - c.get(Calendar.DAY_OF_WEEK) + 1);
+        return c.getTime();
+    }
+
+    /**
+     * 获取startDate日期后month月的日期
+     *
+     * @param startDate 开始日期
+     * @param month     几个月后
+     * @return
+     * @author wenzhang
+     */
+    public static Date getMonthDate(Date startDate, int month) {
+        LocalDateTime localDateTime = startDate.toInstant()
+                .atZone(ZoneId.systemDefault())
+                .toLocalDateTime().plusMonths(month);
+        Date date = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
+        return date;
+    }
+
+    /**
+     * @param days
+     * @return
+     * @author wenzhang
+     */
+    public static Date getDateAdd(int days) {
+        SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
+        Calendar c = Calendar.getInstance();
+        c.add(Calendar.DAY_OF_MONTH, days);
+        return c.getTime();
+
+    }
+
+    /**
+     * 计算两个日期的月数
+     *
+     * @param startDate
+     * @param endDate
+     * @return
+     */
+    public static int getMonthSpace(String startDate, String endDate) throws Exception {
+        int monthCount = 0;
+        Calendar startCalendar = Calendar.getInstance();
+        Calendar endCalendar = Calendar.getInstance();
+        startCalendar.setTime(new SimpleDateFormat("yyyy-MM-dd").parse(startDate));
+        endCalendar.setTime(new SimpleDateFormat("yyyy-MM-dd").parse(endDate));
+
+        int year = endCalendar.get(Calendar.YEAR) - startCalendar.get(Calendar.YEAR);
+        int month = endCalendar.get(Calendar.MONTH) - startCalendar.get(Calendar.MONTH);
+        int day = Math.abs(endCalendar.get(Calendar.DATE) - startCalendar.get(Calendar.DATE));
+
+        if (year == 0 && month == 0) {
+            startCalendar.set(Calendar.DATE, 1);
+            endCalendar.set(Calendar.DATE, 1);
+            endCalendar.roll(Calendar.DATE, -1);
+            if (day == (endCalendar.get(Calendar.DATE) - startCalendar.get(Calendar.DATE))) {
+                // 两日期间满一个月
+                monthCount = 1;
+            } else {
+                // 两日期间不足一个月
+                monthCount = 0;
+            }
+            // 年份不同月份相同
+        } else if (year != 0 && month == 0) {
+            // 两日期间的天数,小于等于当月
+            if (startCalendar.get(Calendar.DATE) < endCalendar.get(Calendar.DATE)) {
+                monthCount = 1;
+            }
+            monthCount += year * 12 + month;
+        } else {
+            // 起始日期DATE 大于等于结束日期DATE
+            if (startCalendar.get(Calendar.DATE) >= endCalendar.get(Calendar.DATE)) {
+                monthCount = year * 12 + month;
+            } else {
+                monthCount = year * 12 + month + 1;
+            }
+        }
+
+        return monthCount;
+    }
+
+    /**
+     * @desc: 获取指定时间的1日/2周/3月/4年开始时间
+     * @author: yzc
+     * @date: 2023-09-12 10:20
+     * @Param dateType:
+     * @Param time:
+     * @return: java.util.Date
+     */
+    public static Date getStartTime(Integer dateType, LocalDateTime time) {
+        LocalDateTime startTime;
+        if (Objects.equals(dateType, 1)) {
+            startTime = LocalDateTime.of(time.toLocalDate(), LocalTime.MIN);
+        } else if (Objects.equals(dateType, 2)) {
+            startTime = LocalDateTime.of(time.toLocalDate().minusDays(6), LocalTime.MIN);
+        } else if (Objects.equals(dateType, 3)) {
+            startTime = LocalDateTime.of(time.toLocalDate().minusMonths(1).plusDays(1), LocalTime.MIN);
+        } else {
+            startTime = LocalDateTime.of(time.toLocalDate().minusYears(1).plusDays(1), LocalTime.MIN);
+        }
+        return formatDate(startTime);
+    }
+
+    /**
+     * @desc: 获取上1日/2周/3月/4年结束时间
+     * @author: yzc
+     * @date: 2023-09-12 10:21
+     * @Param dateType:
+     * @return: java.util.Date
+     */
+    public static Date getLastEndTime(Integer dateType) {
+        LocalDateTime endTime;
+        if (Objects.equals(dateType, 1)) {
+            endTime = LocalDateTime.of(LocalDate.now().minusDays(1), LocalTime.MAX);
+        } else if (Objects.equals(dateType, 2)) {
+            endTime = LocalDateTime.of(LocalDate.now().minusDays(7), LocalTime.MAX);
+        } else if (Objects.equals(dateType, 3)) {
+            endTime = LocalDateTime.of(LocalDate.now().minusMonths(1), LocalTime.MAX);
+        } else {
+            endTime = LocalDateTime.of(LocalDate.now().minusYears(1), LocalTime.MAX);
+        }
+        return formatDate(endTime);
+    }
+
+    /**
+     * @desc: 获取当前时间倒推一年开始时间
+     * @author: yzc
+     * @date: 2023-09-13 10:29
+     * @return: java.util.Date
+     */
+    public static Date getYearStartTime() {
+        //当前时间减去11个月
+        LocalDate localDate = LocalDate.now().minusMonths(11);
+        //获取localDate当月第一天
+        LocalDate date = LocalDate.of(localDate.getYear(), localDate.getMonth(), 1);
+        return formatDate(date.atStartOfDay());
+    }
+
+    /**
+     * @desc: 获取日期转换格式
+     * @author: yzc
+     * @date: 2023-09-13 9:32
+     * @Param dateType:  1日/3月/4年
+     * @return: java.lang.String
+     */
+    public static String getDateFormat(Integer dateType) {
+        String dateFormat;
+        switch (dateType) {
+            case 1 -> dateFormat = "%Y-%m-%d";
+            case 3 -> dateFormat = "%Y-%m";
+            case 4 -> dateFormat = "%Y";
+            default -> throw new BusinessException("Invalid dateType");
+        }
+        return dateFormat;
+    }
+
+    /**
+     * @desc: LocalDateTime转换为Date
+     * @author: yzc
+     * @date: 2023-09-11 16:42
+     * @Param time:
+     * @return: java.util.Date
+     */
+    public static Date formatDate(LocalDateTime time) {
+        return Date.from(time.atZone(ZoneId.systemDefault()).toInstant());
+    }
+
+    /**
+     * @desc: date转换为LocalDate
+     * @author: yzc
+     * @date: 2023-09-13 15:14
+     * @Param date:
+     * @return: java.time.LocalDate
+     */
+    public static LocalDate dateToLocalDate(Date date) {
+        return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
+    }
+
+    /**
+     * @desc: localDate转换为String
+     * @author: yzc
+     * @date: 2023-09-13 15:21
+     * @Param date:
+     * @Param pattern:
+     * @return: java.lang.String
+     */
+    public static String localDateToString(LocalDate date, String pattern) {
+        DateTimeFormatter fmt = DateTimeFormatter.ofPattern(pattern);
+        return date.format(fmt);
+    }
+}

+ 69 - 1
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/EncryUtil.java

@@ -78,6 +78,28 @@ public class EncryUtil {
     }
 
 
+    /**
+     * 加密
+     * @param appSecret 私钥
+     * @param orginStr 原始加密参数
+     * @author dengyinghui
+     * #date 2019/02/27
+     * @return
+     */
+    public static String encryV1(String appSecret, String orginStr){
+        try {
+            Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
+            Key key = new SecretKeySpec(toByteArray(appSecret), "AES");
+            cipher.init(Cipher.ENCRYPT_MODE, key);
+            byte[] encodeResult = cipher.doFinal(orginStr.getBytes());
+            return Hex.toHexString(encodeResult);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+
     /**
      *  字节数组转成16进制表示格式的字符串
      * @author dengyinghui
@@ -143,6 +165,52 @@ public class EncryUtil {
     }
 
 
+    /**
+     * 解密
+     * @param appSecret 私钥
+     * @param encryStr 加密了的字符串
+     * @author dengyinghui
+     * #date 2019/02/27
+     * @return
+     */
+    public synchronized static String descryV1(String appSecret, String encryStr) {
+        try {
+            Key key = new SecretKeySpec(toByteArray(appSecret), "AES");
+            Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
+            cipher.init(Cipher.DECRYPT_MODE, key);
+            byte[] decodeResult = cipher.doFinal(org.apache.commons.codec.binary.Hex.decodeHex(encryStr));
+            return new String(decodeResult);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+
+    /**
+     * 解密
+     * @param appSecret 私钥
+     * @param encryStr 加密了的字符串
+     * @author dengyinghui
+     * #date 2019/02/27
+     * @return
+     */
+    public synchronized static Map<String, Object> descryV2(String appSecret, String encryStr) {
+        try {
+            Key key = new SecretKeySpec(toByteArray(appSecret), "AES");
+            Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
+            cipher.init(Cipher.DECRYPT_MODE, key);
+            byte[] decodeResult = cipher.doFinal(org.apache.commons.codec.binary.Hex.decodeHex(encryStr));
+            String decodeStr = new String(decodeResult);
+
+            return JSON.parseObject(decodeStr, HashMap.class);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+
     /**
      * 解密
      * @param appSecret 私钥
@@ -192,7 +260,7 @@ public class EncryUtil {
      **/
     public static boolean checkSign(HttpServletRequest request, String accessSecret) {
         Enumeration<?> pNames = request.getParameterNames();
-        Map<String, Object> params = new HashMap<String, Object>();
+        Map<String, Object> params = new HashMap<>(Global.NUMERICAL_SIXTEEN);
         while (pNames.hasMoreElements()) {
             String pName = (String) pNames.nextElement();
             if (SIGN_KEY.equals(pName)) {

+ 52 - 42
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/FileUtils.java

@@ -54,7 +54,7 @@ public class FileUtils {
     private static String accessKeyId;
     private static String accessKeySecret;
     private static String bucketName;
-
+    private static FileUtils fileUtils;
 
     @Value("${aliyun.oss.endpoint}")
     private String oss_endpoint;
@@ -68,36 +68,60 @@ public class FileUtils {
     @Value("${aliyun.oss.bucket}")
     public String oss_bucketName;
 
-    public static FileInfo getFileDataList(MultipartFile file) {
-        FileInfo fileInfo =new FileInfo();
-        String oFileName = file.getOriginalFilename();
-        BigDecimal fileSize = FileUtils.getFileSize(file, StringConstant.KB);
-        fileInfo.setFileSize(fileSize);
-        fileInfo.setFileOriginalName(oFileName);
-        fileInfo.setFileSuffix(FilenameUtils.getExtension(oFileName));
-        return fileInfo;
+    private static void defalutOSS() {
+        if (StringUtils.isBlank(endpoint)) {
+            endpoint = DEFAULT_ENDPOINT;
+        }
+        if (StringUtils.isBlank(accessKeyId)) {
+            accessKeyId = DEFAULT_ACCESS_KEY_ID;
+        }
+        if (StringUtils.isBlank(accessKeySecret)) {
+            accessKeySecret = DEFAULT_ACCESS_KEY_SECRET;
+        }
+        if (StringUtils.isBlank(bucketName)) {
+            bucketName = DEFAULT_BUCKET_NAME;
+        }
     }
 
     @PostConstruct
-    public void setEndpoint() {
+    public void init() {
         endpoint = this.oss_endpoint;
-    }
-
-    @PostConstruct
-    public void setAccessKeyId() {
         accessKeyId = this.oss_accessKeyId;
-    }
-
-    @PostConstruct
-    public void setAccessKeySecret() {
         accessKeySecret = this.oss_accessKeySecret;
+        bucketName = this.oss_bucketName;
     }
 
-    @PostConstruct
-    public void setBucketName() {
-        bucketName = this.oss_bucketName;
+//    @PostConstruct
+//    public void setEndpoint() {
+//        endpoint = this.oss_endpoint;
+//    }
+//
+//    @PostConstruct
+//    public void setAccessKeyId() {
+//        accessKeyId = this.oss_accessKeyId;
+//    }
+//
+//    @PostConstruct
+//    public void setAccessKeySecret() {
+//        accessKeySecret = this.oss_accessKeySecret;
+//    }
+//
+//    @PostConstruct
+//    public void setBucketName() {
+//        bucketName = this.oss_bucketName;
+//    }
+
+    public static FileInfo getFileDataList(MultipartFile file) {
+        FileInfo fileInfo = new FileInfo();
+        String oFileName = file.getOriginalFilename();
+        BigDecimal fileSize = FileUtils.getFileSize(file, StringConstant.KB);
+        fileInfo.setFileSize(fileSize);
+        fileInfo.setFileOriginalName(oFileName);
+        fileInfo.setFileSuffix(FilenameUtils.getExtension(oFileName));
+        return fileInfo;
     }
 
+
     /**
      * 获取oss 地址前缀
      *
@@ -338,7 +362,7 @@ public class FileUtils {
             String fileName = FilenameUtils.getBaseName(file.getOriginalFilename());
             //生成随机唯一值,使用uuid,添加到文件名称里面 改成使用加密
             //fileName = PasswordUtils.md5(fileName);
-            fileName = PasswordUtils.md5(fileName);
+            fileName = PasswordUtils.md5(fileName) + System.currentTimeMillis();
             String fileSuffix = FileUtils.getFileSuffix(file.getOriginalFilename());
             //不带后缀
             fileInfo.setFileMd5(fileName);
@@ -381,21 +405,6 @@ public class FileUtils {
         return fileInfo;
     }
 
-    private static void defalutOSS() {
-        if (StringUtils.isBlank(endpoint)) {
-            endpoint = DEFAULT_ENDPOINT;
-        }
-        if (StringUtils.isBlank(accessKeyId)) {
-            accessKeyId = DEFAULT_ACCESS_KEY_ID;
-        }
-        if (StringUtils.isBlank(accessKeySecret)) {
-            accessKeySecret = DEFAULT_ACCESS_KEY_SECRET;
-        }
-        if (StringUtils.isBlank(bucketName)) {
-            bucketName = DEFAULT_BUCKET_NAME;
-        }
-    }
-
 
     /**
      * 获取文件上传大小
@@ -422,14 +431,14 @@ public class FileUtils {
     /**
      * 获取文件上传大小
      *
-     * @param file  当前默认使用 kb
+     * @param file 当前默认使用 kb
      * @return
      */
     public static BigDecimal getFileSize(MultipartFile file, String type) {
         long size = file.getSize();
         BigDecimal bigDecimal = new BigDecimal(NumberConstant.ZERO);
-        if (StringUtils.isBlank(type)){
-            type=StringConstant.KB;
+        if (StringUtils.isBlank(type)) {
+            type = StringConstant.KB;
         }
         switch (type) {
             case "B":
@@ -447,7 +456,7 @@ public class FileUtils {
             default:
                 throw new RuntimeException("file size error");
         }
-        bigDecimal.setScale(2,BigDecimal.ROUND_HALF_UP);
+        bigDecimal.setScale(2, BigDecimal.ROUND_HALF_UP);
         return bigDecimal;
     }
 
@@ -938,7 +947,8 @@ public class FileUtils {
         try {
             br = new BufferedReader(new StringReader(text));
             bw = new BufferedWriter(new FileWriter(file));
-            char[] buf = new char[1024 * 64];          //字符缓冲区
+            //字符缓冲区
+            char[] buf = new char[1024 * 64];
             int len;
             while ((len = br.read(buf)) != -1) {
                 bw.write(buf, 0, len);

+ 87 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/ListToPageDataUntil.java

@@ -0,0 +1,87 @@
+package com.sckw.core.utils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author lfdc
+ * @description List分页工具类
+ * @date 2023-08-03 18:08:07
+ */
+public class ListToPageDataUntil {
+    /**
+     * 数据集合的分页方法,根据传入总共的数据跟页码,返回页码所需要显示多少条的数据
+     * <BR/>采用泛型的方法,即为,list中为什么类型的数据就返回什么类型的数据
+     *
+     * @param List 带有需要进行分页的数据集合
+     * @param page 第几页
+     * @param rows 显示多少条数据
+     * @return 进过分页之后返回的数据
+     */
+    public static <T> PageData<T> getListToPageData(Integer page, Integer rows, List<T> List) {
+        PageData<T> data = new PageData<>();
+        List<T> datepaging = datepaging(List, page, rows);
+        //第几页,1开始
+        data.setPage(page);
+        //每页显示的条数
+        data.setPageSize(rows);
+        //总页数
+        int size = List.size();
+        int totalPage = size / rows;
+        data.setPages(totalPage);
+        //总条数
+        data.setSize(size);
+        //每页的内容
+        data.setList(datepaging);
+        return data;
+    }
+
+    /**
+     * 数据集合的分页方法,根据传入总共的数据跟页码,返回页码所需要显示多少条的数据
+     * <BR/>采用泛型的方法,即为,list中为什么类型的数据就返回什么类型的数据
+     *
+     * @param list 带有需要进行分页的数据集合
+     * @param page 第几页
+     * @param rows 显示多少条数据
+     * @return 进过分页之后返回的数据
+     */
+    private static <T> List<T> datepaging(List<T> list, Integer page, Integer rows) {
+        /*
+         * 经过测试发现当page为0或者小于时,也就是第0页时,程序会报错,所以需要处理一下page的值
+         * 先进行空值的判断,避免程序出现null异常
+         * 当page的值小于等于0时,我们让它的值为1
+         */
+        //参数的校验 当传入过来的list集合为null时,先进行实例化
+        if (list == null) {
+            list = new ArrayList<T>();
+        }
+        //当传入过来的page为null时,先进行赋值操作
+        if ((Object) page == null) {
+            page = 1;
+        }
+        //当传入过来的rows为null时,先进行赋值操作
+        if ((Object) rows == null) {
+            rows = 1;
+        }
+        if (page <= 0) {
+            page = 1;
+        }
+        //记录一下数据一共有多少条
+        int totalitems = list.size();
+        //实例化一个接受分页处理之后的数据
+        List<T> afterList = new ArrayList<T>();
+        /*
+         * 进行分页处理,采用for循环的方式来进行处理
+         * 首先for循环中,i应该从哪里开始:i应该从 (当前是第几页 -1 乘以 条数) 开始
+         * 然后for循环应该到哪里结束,也就是i应该小于:判断(开始的索引+显示条数)是不是大于总条数,如果大于就是总条数,如果小于就是(开始的索引+显示条数)
+         * 然后让i++
+         */
+        for (int i = (page - 1) * rows; i < (((page - 1) * rows) + rows > totalitems ? totalitems : ((page - 1) * rows) + rows); i++) {
+            //然后将数据存入afterList中
+            afterList.add(list.get(i));
+        }
+        //然后将处理后的数据集合进行返回
+        return afterList;
+    }
+
+}

+ 175 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/ListUtils.java

@@ -0,0 +1,175 @@
+package com.sckw.core.utils;
+
+import com.sckw.core.model.constant.Global;
+
+import java.util.*;
+
+/**
+ * @author lfdc
+ * @description listUtils
+ * @date 2023-08-08 11:08:11
+ */
+public class ListUtils {
+
+    /**
+     * 比较两个List集合是否相等
+     * <p>注:1. 如果一个List的引用为<code>null</code>,或者其包含的元素个数为0,那么该List在本逻辑处理中都算作空;
+     * <p>2. 泛型参数E涉及到对象,所以需要确保正确实现了对应对象的<code>equal()</code>方法。
+     *
+     * @param list1
+     * @param list2
+     * @return
+     */
+    public static <E> boolean isListEqual(List<E> list1, List<E> list2) {
+        // 两个list引用相同(包括两者都为空指针的情况)
+        if (list1 == list2) {
+            return true;
+        }
+
+        // 两个list都为空(包括空指针、元素个数为0)
+        if ((list1 == null && list2 != null && list2.size() == 0)
+                || (list2 == null && list1 != null && list1.size() == 0)) {
+            return true;
+        }
+
+        // 两个list元素个数不相同
+        if (list1.size() != list2.size()) {
+            return false;
+        }
+
+        // 两个list元素个数已经相同,再比较两者内容
+        // 采用这种可以忽略list中的元素的顺序
+        // 涉及到对象的比较是否相同时,确保实现了equals()方法
+        if (!list1.containsAll(list2) && !list2.containsAll(list1)) {
+            return false;
+        }
+
+        return true;
+    }
+
+    public static void main(String[] args) {
+        // desc-倒叙  asc-正序
+        String sortTyp = "asc";
+        // 组装测试数据
+        List<Map<String, Object>> list = initMapList();
+
+        // 单个map排序
+        Map<String, Object> map = list.get(0);
+        Map<String, Object> sortMap = sortMap(map, sortTyp);
+        // Map<String, Object> sortMap = sortByKey(map, false);
+        for (Map.Entry<String, Object> entry : sortMap.entrySet()) {
+            System.out.println("单个map排序" + sortTyp);
+            System.out.println(entry.getKey());
+        }
+
+        // List<map>根据某个字段排序
+        sortMapListByFeild(list, "age", sortTyp);
+        System.out.println("按年纪取最大的一条数据,其姓名是:" + list.get(0).get("name"));
+    }
+
+    /**
+     * List<Map>根据map字段排序
+     *
+     * @param list
+     * @param feild   排序字段
+     * @param sortTyp 排序方式 desc-倒序 asc-正序
+     * @return
+     */
+    public static List<Map<String, Object>> sortMapListByFeild(List<Map<String, Object>> list, String feild, String sortTyp) {
+        if (CollectionUtils.isNotEmpty(list)) {
+            // 方法1
+            list.sort((m1, m2) -> {
+                if ("desc".equals(sortTyp)) {
+                    return String.valueOf(m2.get(feild)).compareTo(String.valueOf(m1.get(feild)));
+                } else {
+                    return String.valueOf(m1.get(feild)).compareTo(String.valueOf(m2.get(feild)));
+                }
+            });
+
+            // 方法2 也ok噢
+            /*if (StringUtils.equals(sortTyp, "desc")) {
+                Collections.sort(list, (m1, m2)-> String.valueOf(m2.get(feild)).compareTo(String.valueOf(m1.get(feild)))); // lamuda排序
+            } else {
+                Collections.sort(list, (m1, m2)-> String.valueOf(m1.get(feild)).compareTo(String.valueOf(m2.get(feild)))); // lamuda排序
+            }*/
+        }
+
+        return list;
+    }
+
+    /**
+     * map排序
+     *
+     * @param map
+     * @return
+     */
+    public static Map<String, Object> sortMap(Map<String, Object> map, String sortTyp) {
+        try {
+            if ("desc".equals(sortTyp)) {
+                // 定义个倒叙的set
+                Set<String> sortSet = new TreeSet<>(Comparator.reverseOrder());
+                // 获取全部key,添加后就自然倒序了
+                sortSet.addAll(map.keySet());
+
+                Map<String, Object> resp = new LinkedHashMap<>();
+                for (String key : sortSet) {
+                    // 按顺序放入新map
+                    resp.put(key, map.get(key));
+                }
+
+                return resp;
+            } else {
+                // TreeMap 本身就是正序的
+                return new TreeMap<>(map);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return map;
+    }
+
+    /**
+     * 根据map的key排序
+     *
+     * @param map    待排序的map
+     * @param isDesc 是否降序,true:降序,false:升序
+     * @param <K>
+     * @param <V>
+     * @return
+     */
+    public static <K extends Comparable<? super K>, V> Map<K, V> sortByKey(Map<K, V> map, boolean isDesc) {
+        Map<K, V> result = new LinkedHashMap<>();
+        if (isDesc) {
+            map.entrySet().stream().sorted(Map.Entry.<K, V>comparingByKey().reversed())
+                    .forEachOrdered(e -> result.put(e.getKey(), e.getValue()));
+        } else {
+            map.entrySet().stream().sorted(Map.Entry.<K, V>comparingByKey())
+                    .forEachOrdered(e -> result.put(e.getKey(), e.getValue()));
+        }
+        return result;
+    }
+
+    private static List<Map<String, Object>> initMapList() {
+        List<Map<String, Object>> lists = new ArrayList<>();
+
+        Map<String, Object> map = new HashMap<>(Global.NUMERICAL_SIXTEEN);
+        map.put("name", "王五");
+        map.put("age", 55);
+        map.put("mobile", "15900001112");
+        lists.add(map);
+
+        Map<String, Object> map1 = new HashMap<>(Global.NUMERICAL_SIXTEEN);
+        map1.put("name", "李四");
+        map1.put("age", 18);
+        map1.put("mobile", "15900001111");
+        lists.add(map1);
+
+        Map<String, Object> map2 = new HashMap<>(Global.NUMERICAL_SIXTEEN);
+        map2.put("name", "赵六");
+        map2.put("age", 58);
+        map2.put("mobile", "13700001111");
+        lists.add(map2);
+
+        return lists;
+    }
+}

+ 90 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/LogUtil.java

@@ -0,0 +1,90 @@
+package com.sckw.core.utils;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+/**
+ * @Desc 日志打印工具类
+ * @Author zk
+ * @Date 2019/5/13
+ */
+public class LogUtil {
+    private static Logger logger = LogManager.getLogger(LogUtil.class);
+
+    public static String TITLE = "【矿拉拉平台】=====";
+
+    /**
+     * 获取异常信息
+     * @Author zk
+     * @param e 异常Exception
+     * @Date 2019/5/13
+     * @return
+     */
+    public static synchronized String getStackTraceInfo(Exception e){
+        StringWriter sw = new StringWriter();
+        e.printStackTrace(new PrintWriter(sw, true));
+        return sw.toString();
+    }
+
+    /**
+     * 打印日志
+     * @Author zk
+     * @param message 日志内容
+     * @Date 2019/5/13
+     * @return
+     */
+    public static synchronized void debug(String message){
+        logger.info(TITLE + message);
+    }
+
+    /**
+     * 打印日志
+     * @Author zk
+     * @param message 日志内容
+     * @Date 2019/5/13
+     * @return
+     */
+    public static synchronized void info(String message){
+        logger.info(TITLE + message);
+    }
+
+    public static synchronized void info(String message, Object params){
+        logger.info(TITLE + message,params);
+    }
+
+    /**
+     * 打印异常日志
+     * @Author zk
+     * @param message 日志内容
+     * @Date 2020/03/13
+     * @return
+     */
+    public static synchronized void error(String className, String methodName, String exceptionName, String message, String params){
+        logger.error(TITLE+"异常["+className+"."+methodName+"] 异常代码["+exceptionName+"] 异常信息["+message+"] 请求参数:"+params);
+    }
+
+    /**
+     * 打印异常日志
+     * @Author zk
+     * @param message 日志内容
+     * @Date 2020/03/13
+     * @return
+     */
+    public static synchronized void error(String className, String methodName, String exceptionName, String message){
+        logger.error(TITLE+"异常["+className+"."+methodName+"] 异常代码["+exceptionName+"] 异常信息["+message+"]");
+    }
+
+    /**
+     * 打印异常日志
+     * @Author zk
+     * @param message 日志内容
+     * @Date 2021/01/22
+     * @return
+     */
+    public static synchronized void error(String className, String message){
+        logger.error(TITLE+"异常["+className+"] 异常信息["+message+"]");
+    }
+
+}

+ 39 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/NumberUtils.java

@@ -24,6 +24,13 @@ public class NumberUtils {
         }
     }
 
+    public static Integer parseIntV1(Object obj) {
+        if (obj == null) {
+            return null;
+        }
+        return parseInt(obj, 0);
+    }
+
     public static int parseInt(Object obj) {
         return parseInt(obj, 0);
     }
@@ -43,6 +50,17 @@ public class NumberUtils {
         }
     }
 
+    public static Integer parseInteger(Object obj){
+        return parseInt(obj, 0);
+    }
+
+    public static Integer parseEmptyInteger(Object obj) {
+        if (obj == null) {
+            return null;
+        }
+        return parseInt(obj, 0);
+    }
+
     public static long parseLong(Object obj) {
         return parseLong(obj, 0L);
     }
@@ -61,6 +79,13 @@ public class NumberUtils {
         }
     }
 
+    public static Long parseEmptyLong(Object obj){
+        if (obj == null) {
+            return null;
+        }
+        return parseLong(obj, 0);
+    }
+
     public static float parseFloat(Object obj) {
         return parseFloat(obj, 0.0F);
     }
@@ -79,6 +104,13 @@ public class NumberUtils {
         }
     }
 
+    public static Float parseEmptyFloat(Object obj){
+        if (obj == null) {
+            return null;
+        }
+        return parseFloat(obj, 0);
+    }
+
     public static double parseDouble(Object str) {
         return parseDouble(str, 0.0D);
     }
@@ -97,6 +129,13 @@ public class NumberUtils {
         }
     }
 
+    public static Double parseEmptyDouble(Object obj){
+        if (obj == null) {
+            return null;
+        }
+        return parseDouble(obj, 0);
+    }
+
     public static BigDecimal parseBigDecimal(Object obj) {
         return parseBigDecimal(obj, new BigDecimal(0));
     }

+ 492 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/OkHttpUtils.java

@@ -0,0 +1,492 @@
+package com.sckw.core.utils;
+
+import com.alibaba.fastjson2.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+import okhttp3.*;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.hc.client5.http.classic.methods.HttpPost;
+import org.apache.hc.client5.http.entity.mime.FileBody;
+import org.apache.hc.client5.http.entity.mime.HttpMultipartMode;
+import org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder;
+import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
+import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
+import org.apache.hc.client5.http.impl.classic.HttpClients;
+import org.apache.hc.core5.http.ContentType;
+import org.apache.hc.core5.http.HttpEntity;
+import org.apache.hc.core5.http.io.entity.EntityUtils;
+import org.apache.http.client.methods.HttpRequestBase;
+import org.apache.http.protocol.HTTP;
+import org.jetbrains.annotations.NotNull;
+import org.springframework.util.CollectionUtils;
+
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSocketFactory;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+import java.io.File;
+import java.io.IOException;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.security.SecureRandom;
+import java.security.cert.X509Certificate;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author xcq
+ * @date 2023-02-21 10:42:20
+ **/
+@Slf4j
+public class OkHttpUtils {
+    private static volatile OkHttpClient okHttpClient = null;
+    private static volatile Semaphore semaphore = null;
+    private Map<String, String> headerMap;
+    private Map<String, String> paraMap;
+    private Map<String, String> bodyParaMap;
+    //json字符串
+    private String bodyParaString;
+    private String url;
+    private Request.Builder request;
+
+    /**
+     * 初始化okHttpClient,并且允许https访问
+     */
+    private OkHttpUtils() {
+        if (okHttpClient == null) {
+            synchronized (OkHttpUtils.class) {
+                if (okHttpClient == null) {
+                    TrustManager[] trustManagers = buildTrustManagers();
+                    okHttpClient = new OkHttpClient.Builder()
+                            .connectTimeout(15, TimeUnit.SECONDS)
+                            .writeTimeout(20, TimeUnit.SECONDS)
+                            .readTimeout(20, TimeUnit.SECONDS)
+                            .sslSocketFactory(createSSLSocketFactory(trustManagers), (X509TrustManager) trustManagers[0])
+                            .hostnameVerifier((hostName, session) -> true)
+                            .retryOnConnectionFailure(true)
+                            .build();
+                    addHeader("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36");
+                }
+            }
+        }
+    }
+
+    /**
+     * 用于异步请求时,控制访问线程数,返回结果
+     *
+     * @return
+     */
+    private static Semaphore getSemaphoreInstance() {
+        //只能1个线程同时访问
+        synchronized (OkHttpUtils.class) {
+            if (semaphore == null) {
+                semaphore = new Semaphore(0);
+            }
+        }
+        return semaphore;
+    }
+
+    /**
+     * 创建OkHttpUtils
+     *
+     * @return
+     */
+    public static OkHttpUtils builder() {
+        return new OkHttpUtils();
+    }
+
+    /**
+     * 添加url
+     *
+     * @param url
+     * @return
+     */
+    public OkHttpUtils url(String url) {
+        this.url = url;
+        return this;
+    }
+
+    /**
+     * 添加参数
+     *
+     * @param key   参数名
+     * @param value 参数值
+     * @return
+     */
+    public OkHttpUtils addPara(String key, String value) {
+        if (paraMap == null) {
+            paraMap = new LinkedHashMap<>(16);
+        }
+        paraMap.put(key, value);
+        return this;
+    }
+
+    /**
+     * 添加参数
+     *
+     * @param key   参数名
+     * @param value 参数值
+     * @return
+     */
+    public OkHttpUtils addBodyPara(String key, String value) {
+        if (bodyParaMap == null) {
+            bodyParaMap = new LinkedHashMap<>(16);
+        }
+        bodyParaMap.put(key, value);
+        return this;
+    }
+
+    public OkHttpUtils addBodyJsonStr(String string) {
+        bodyParaString = string;
+        return this;
+    }
+
+    /**
+     * 添加请求头
+     *
+     * @param key   参数名
+     * @param value 参数值
+     * @return
+     */
+    public OkHttpUtils addHeader(String key, String value) {
+        if (headerMap == null) {
+            headerMap = new LinkedHashMap<>(16);
+        }
+        headerMap.put(key, value);
+        return this;
+    }
+
+    /**
+     * 初始化get方法
+     *
+     * @return
+     */
+    public OkHttpUtils get() {
+        request = new Request.Builder().get();
+        request.url(buildUrl());
+        return this;
+    }
+
+    /**
+     * 初始化post方法
+     */
+    public OkHttpUtils postForm(JSONObject object, byte[] file) {
+        MultipartBody.Builder formBody = new MultipartBody.Builder();
+        formBody.setType(MultipartBody.FORM);
+
+        for (String s : object.keySet()) {
+            formBody.addFormDataPart(s, StringUtils.isBlank(object.getString(s)) ? "" : object.getString(s));
+        }
+        String fileName = UUIDUtils.get32UUID() + ".zip";
+        log.info("文件名:{}", fileName);
+        formBody.addFormDataPart("file", fileName, RequestBody.create(file));
+
+        RequestBody requestBody = formBody.build();
+        // params参数
+        request = new Request.Builder().post(requestBody).url(buildUrl());
+        return this;
+    }
+
+    /**
+     * 初始化post方法
+     *
+     * @param isJsonPost true等于json的方式提交数据,类似postman里post方法的raw
+     *                   false等于普通的表单提交
+     * @return
+     */
+    public OkHttpUtils post(boolean isJsonPost) {
+        RequestBody requestBody;
+        if (isJsonPost) {
+            String json;
+            if (StringUtils.isNotBlank(bodyParaString)) {
+                json = bodyParaString;
+            } else if (!CollectionUtils.isEmpty(bodyParaMap)) {
+                json = JSONObject.toJSONString(bodyParaMap);
+            } else {
+                json = "{}";
+            }
+            log.info("请求参数:{}", json);
+            requestBody = RequestBody.create(json, MediaType.parse("application/json; charset=utf-8"));
+        } else {
+            FormBody.Builder formBody = new FormBody.Builder();
+            if (bodyParaMap != null) {
+                bodyParaMap.forEach(formBody::add);
+            }
+            requestBody = formBody.build();
+        }
+        // params参数
+        request = new Request.Builder().post(requestBody).url(buildUrl());
+        return this;
+    }
+
+    private String buildUrl() {
+        StringBuilder urlBuilder = new StringBuilder(url);
+        if (paraMap != null) {
+            urlBuilder.append("?");
+            try {
+                for (Map.Entry<String, String> entry : paraMap.entrySet()) {
+                    urlBuilder.append(URLEncoder.encode(entry.getKey(), StandardCharsets.UTF_8)).
+                            append("=").
+                            append(URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8)).
+                            append("&");
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            urlBuilder.deleteCharAt(urlBuilder.length() - 1);
+        }
+        log.info("请求地址:\n" + urlBuilder.toString());
+        return urlBuilder.toString();
+    }
+
+    /**
+     * 文件下载同步请求
+     *
+     * @return
+     */
+    public byte[] fileSync() {
+        setHeader(request);
+        try (Response response = okHttpClient.newCall(request.build()).execute()) {
+            if (response.isSuccessful()) {
+                assert response.body() != null;
+                return response.body().bytes();
+            }
+            return new byte[0];
+        } catch (IOException e) {
+            e.printStackTrace();
+            return new byte[0];
+        }
+    }
+
+    /**
+     * 同步请求
+     *
+     * @return
+     */
+    public String sync() {
+        setHeader(request);
+        try (Response response = okHttpClient.newCall(request.build()).execute()) {
+            assert response.body() != null;
+            return response.body().string();
+        } catch (IOException e) {
+            e.printStackTrace();
+            return "请求失败:" + e.getMessage();
+        }
+    }
+
+    /**
+     * 异步请求,有返回值
+     */
+    public String async() {
+        StringBuilder buffer = new StringBuilder();
+        setHeader(request);
+        okHttpClient.newCall(request.build()).enqueue(new Callback() {
+            @Override
+            public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
+                assert response.body() != null;
+                buffer.append(response.body().string());
+                getSemaphoreInstance().release();
+            }
+
+            @Override
+            public void onFailure(@NotNull Call call, @NotNull IOException e) {
+                buffer.append("请求出错:").append(e.getMessage());
+
+            }
+        });
+        try {
+            getSemaphoreInstance().acquire();
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+        return buffer.toString();
+    }
+
+    /**
+     * 异步请求,带有接口回调
+     *
+     * @param callBack
+     */
+    public void async(ICallBack callBack) {
+        setHeader(request);
+        okHttpClient.newCall(request.build()).enqueue(new Callback() {
+
+            @Override
+            public void onFailure(@NotNull Call call, @NotNull IOException e) {
+                callBack.onFailure(call, e.getMessage());
+            }
+
+            @Override
+            public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
+                assert response.body() != null;
+                callBack.onSuccessful(call, response.body().string());
+            }
+        });
+    }
+
+    /**
+     * 为request添加请求头
+     *
+     * @param request
+     */
+    private void setHeader(Request.Builder request) {
+        if (headerMap != null) {
+            try {
+                for (Map.Entry<String, String> entry : headerMap.entrySet()) {
+                    request.addHeader(entry.getKey(), entry.getValue());
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+
+    /**
+     * 生成安全套接字工厂,用于https请求的证书跳过
+     *
+     * @return
+     */
+    private static SSLSocketFactory createSSLSocketFactory(TrustManager[] trustAllCerts) {
+        SSLSocketFactory ssfFactory = null;
+        try {
+            SSLContext sc = SSLContext.getInstance("SSL");
+            sc.init(null, trustAllCerts, new SecureRandom());
+            ssfFactory = sc.getSocketFactory();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return ssfFactory;
+    }
+
+    private static TrustManager[] buildTrustManagers() {
+        return new TrustManager[]{
+                new X509TrustManager() {
+                    @Override
+                    public void checkClientTrusted(X509Certificate[] chain, String authType) {
+                    }
+
+                    @Override
+                    public void checkServerTrusted(X509Certificate[] chain, String authType) {
+                    }
+
+                    @Override
+                    public X509Certificate[] getAcceptedIssuers() {
+                        return new X509Certificate[]{};
+                    }
+                }
+        };
+    }
+
+    /**
+     * 自定义一个接口回调
+     */
+    public interface ICallBack {
+
+        void onSuccessful(Call call, String data);
+
+        void onFailure(Call call, String errorMsg);
+
+    }
+
+
+    /**
+     * 使用示例
+     *
+     * @param args
+     * @author xcq
+     * @date 2023-02-21 10:47:28
+     **/
+    public static void main(String[] args) {
+        String address = "https://file.cloudpnr.com/app-86820a0f-8b13-479b-a466-b261af7290d5%2Fsaturnfile%2F48cf909816b142e5beec68988c1982b1%2F39189ab6-fac3-11ed-9690-0242ac110002.zip?Expires=1685254390&OSSAccessKeyId=LTAI6Yzq9tIYS57h&Signature=oNyqey777CjDk0IH5ZaniwTAdfg%3D";
+        byte[] file = OkHttpUtils.builder().url(address)
+                .get()
+                .fileSync();
+        /*通知中台*/
+        JSONObject tmp = new JSONObject();
+        tmp.put("status", StringUtils.equals("00000000", "00000000") ? "true" : "false");
+        tmp.put("msg", "");
+        log.info("交易确认异步通知中台入参:{}", tmp.toJSONString());
+
+        String sync = OkHttpUtils.builder().url("http://10.10.10.241:9505/notice/huifu/signal_agent_pay/S520267896211968001/00dd5d5dd4682ea3fad88a37ab48223a")
+                .postForm(tmp, file)
+                .sync();
+        log.info("交易确认异步通知中台返回->{}", sync);
+    }
+
+    /**
+     * post请求提交form-data上传文件
+     *
+     * @param url
+     * @return
+     */
+    public static String doPostUploadFile(String url, Map<String, Object> param) {
+        HttpPost httpPost = new HttpPost(url);
+        CloseableHttpResponse response = null;
+        String respContent = null;
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        try {
+            String boundary = "--" + UUIDUtils.get32UUID();
+            httpPost.setHeader("Content-Type", "multipart/form-data; boundary=" + boundary);
+            MultipartEntityBuilder builder = MultipartEntityBuilder.create().setMode(HttpMultipartMode.LEGACY);
+            builder.setCharset(StandardCharsets.UTF_8);
+            builder.setBoundary(boundary);
+            for (String key : param.keySet()) {
+                Object value = param.get(key);
+                if (value instanceof File file) {
+                    FileBody fileBody = new FileBody(file);
+                    builder.addBinaryBody(key, fileBody.getInputStream(), ContentType.DEFAULT_BINARY, fileBody.getFilename());
+                } else {
+                    builder.addBinaryBody(key, String.valueOf(value).getBytes(StandardCharsets.UTF_8));
+                }
+            }
+            HttpEntity entity = builder.build();
+            httpPost.setEntity(entity);
+            response = httpClient.execute(httpPost);
+            if (response != null) {
+                HttpEntity he = response.getEntity();
+                if (he != null) {
+                    respContent = EntityUtils.toString(he, HTTP.UTF_8);
+                }
+            } else {
+                log.error("对方响应的状态码不在符合的范围内!");
+                throw new RuntimeException();
+            }
+            return respContent;
+        } catch (Exception e) {
+            log.error("网络访问异常,请求url地址={},响应体={},error={}", url, response, e);
+            throw new RuntimeException();
+        } finally {
+            log.info("统一外网请求参数打印,post请求url地址={},响应={}", url, respContent);
+            try {
+                if (response != null) {
+                    response.close();
+                }
+                if (null != httpClient) {
+                    httpClient.close();
+                }
+            } catch (IOException e) {
+                log.error("请求链接释放异常", e);
+            }
+        }
+    }
+
+
+    /**
+     * 封装请求头
+     *
+     * @param paramsHeads
+     * @param httpMethod
+     */
+    private static void packageHeader(Map<String, String> paramsHeads, HttpRequestBase httpMethod) {
+        if (null != paramsHeads && paramsHeads.size() > 0) {
+            Set<Map.Entry<String, String>> entrySet = paramsHeads.entrySet();
+            for (Map.Entry<String, String> entry : entrySet) {
+                httpMethod.setHeader(entry.getKey(), entry.getValue());
+            }
+        }
+    }
+
+}

+ 226 - 0
sckw-common/sckw-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
sckw-common/sckw-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
sckw-common/sckw-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);
+    }
+}

+ 59 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/PageData.java

@@ -0,0 +1,59 @@
+package com.sckw.core.utils;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author lfdc
+ * @description
+ * @date 2023-08-03 18:08:09
+ */
+@Data
+public class PageData<T> {
+
+    /**
+     * 当前页
+     */
+    private int page;
+    /**
+     * 当前页的数量
+     */
+    private int pageSize;
+    /**
+     * 总条数
+     */
+    private int size;
+
+    /**
+     * 由于startRow和endRow不常用,这里说个具体的用法
+     * 可以在页面中"显示startRow到endRow 共size条数据"
+     * 当前页面第一个元素在数据库中的行号
+     */
+    private long startRow;
+    /**
+     * 当前页面最后一个元素在数据库中的行号
+     */
+    private long endRow;
+    /**
+     * 总页数
+     */
+    private int pages;
+    /**
+     * 前一页
+     */
+    private int prePage;
+    /**
+     * 下一页
+     */
+    private int nextPage;
+    /**
+     * 展示数据
+     */
+    private List list;
+
+    /**
+     * 是否为第一页
+     */
+    private boolean isFirstPage = false;
+}

+ 7 - 1
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/PasswordUtils.java

@@ -122,13 +122,19 @@ public class PasswordUtils {
 
     public static void main(String[] args) {
 
-        String password = PasswordUtils.entryptPassword(PasswordUtils.md5("18482106067"));
+        String password = PasswordUtils.entryptPassword(PasswordUtils.md5("18581845668"));
         String md5 = PasswordUtils.md5("123456");
         System.out.println(password);
         System.out.println(md5);
         System.out.println(validatePassword(md5, password));
 //        System.out.println(PasswordUtils.md5("czh"));
 //        System.out.println(PasswordUtils.entryptPassword(PasswordUtils.md5("czh")));
+        System.out.println(validatePassword(md5, "86e07d48c04c8a4bd9fe9dc819c608c43efda576b215995e9f138809"));
 
+
+        byte[] salt = Digests.generateSalt(SALT_SIZE);
+        byte[] hashPassword = Digests.sha1(md5.getBytes(), salt, HASH_INTERATIONS);
+        System.out.println(Encodes.encodeHex(salt));
+        System.out.println(Encodes.encodeHex(hashPassword));
     }
 }

+ 94 - 4
sckw-common/sckw-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;
 
@@ -23,11 +24,17 @@ public class RegularUtils {
      * 非负浮点型(包括0)
      */
     public static final String DECIMAL_REG1 = "^\\d+(\\.\\d+)?$";
+
     /**
-     *  数字和字母
+     * 数字和字母
      */
     public static final String NUMBER_AND_LATTER = "[0-9A-Za-z]{18}";
 
+    /**
+     * 数字和大写字母
+     */
+    public static final String NUMBER_AND_UPPERCASE_LATTER = "[0-9A-Z]";
+
     /**
      * 正整数和0
      */
@@ -44,16 +51,99 @@ public class RegularUtils {
     public static final String DOLLAR_BIG_BRACKETS = "(\\$\\{)([\\w]+)(\\})";
 
     /**
+     * 身份证
+     */
+    public static final String IDCARD = "(^\\d{18}$)|(^\\d{15}$)";
+    /**
+     * 车牌号
+     */
+//    public static final String TRUCK_NUMBER = "^[京津沪冀晋辽吉黑苏浙皖闽赣鲁豫鄂湘粤桂琼川黔云渝藏陕陇青宁新闽粤晋琼使领A_Z]{1}[A_Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$";
+//    public static final String TRUCK_NUMBER = "^[京津冀晋蒙辽吉黑沪苏浙皖闽赣鲁豫鄂湘粤桂琼川贵云渝藏陕甘青宁新]{1}[A-Z]{1}[DF]{1}[0-9a-zA-Z]{5}$";
+    /**
+     * 车牌校验  五位数车牌
+     */
+    public static final String TRUCK_NUMBER_FIVE = "^[京津冀晋蒙辽吉黑沪苏浙皖闽赣鲁豫鄂湘粤桂琼川贵云渝藏陕甘青宁新使]{1}[a-zA-Z]{1}[0-9a-zA-Z]{5}$";
+
+    /**
+     * 车牌校验  六位数车牌
+     */
+    public static final String TRUCK_NUMBER_SIX = "^[京津冀晋蒙辽吉黑沪苏浙皖闽赣鲁豫鄂湘粤桂琼川贵云渝藏陕甘青宁新使]{1}[a-zA-Z]{1}[0-9a-zA-Z]{6}$";
+
+    /**
+     * 中文汉字
+     */
+    public static final String CHINESE = "^[\\u4e00-\\u9fa5]{1,6}$";
+
+    /**
+     * 姓名相关
+     * (企业法人、企业代表、员工姓名、司机姓名)
+     */
+    public static final String NAME = "^[\\u4e00-\\u9fa5]{1,25}$";
+
+
+    /**
+     * 道路运输许可证号
+     */
+    public static final String ROAD_LICENCE = "(^\\d{12})";
+
+    /**
+     * @param
+     * @return
      * @description 校验
      * @author zk
      * @date 2020/5/9 14:38
-     * @param
-     * @return
      **/
-    public static boolean matchs(String regular, String str){
+    public static boolean matchs(String regular, String str) {
         Pattern p = Pattern.compile(regular);
         Matcher m = p.matcher(str);
         boolean isMatch = m.matches();
         return isMatch;
     }
+
+    /**
+     * @param regular 正则 str匹配字符串 min 最小长度 max最大长度
+     * @desc: 校验(限制长度范围)
+     * @author: czh
+     * @date: 2023/7/25
+     */
+    public static boolean matchWithRange(String regular, String str, Integer min, Integer max) {
+        StringBuilder stringBuilder = new StringBuilder();
+        stringBuilder.append(regular).append("{").append(min).append(",").append(max).append("}$");
+        Pattern p = Pattern.compile(stringBuilder.toString());
+        Matcher m = p.matcher(str);
+        return m.matches();
+    }
+
+    /**
+     * @param regular 正则 str匹配字符串 fixLength 固定长度
+     * @desc: 校验(限制固定长度)
+     * @author: czh
+     * @date: 2023/7/25
+     */
+    public static boolean matchWithFix(String regular, String str, Integer fixLength) {
+        StringBuilder stringBuilder = new StringBuilder();
+        stringBuilder.append(regular).append("{").append(fixLength).append("}$");
+        Pattern p = Pattern.compile(stringBuilder.toString());
+        Matcher m = p.matcher(str);
+        return m.matches();
+    }
+
+    /**
+     * @param str 数值 numLength 整数长度  fractionLenth小数长度
+     * @desc: 校验(限制固定长度)
+     * @author: czh
+     * @date: 2023/7/25
+     */
+    public static boolean matchNumberWithFix(String str, Integer numLength, Integer fractionLenth) {
+        StringBuilder stringBuilder = new StringBuilder();
+        stringBuilder.append("\\d{1,").append(numLength).append("}([\\.]\\d{0,").append(fractionLenth).append("})?");
+        Pattern p = Pattern.compile(stringBuilder.toString());
+        Matcher m = p.matcher(str);
+        return m.matches();
+    }
+
+
+    public static void main(String[] args) {
+        System.out.println(matchs("\\d{1,8}([\\.]\\d{0,2})?", new BigDecimal("99999999.00").toString()));
+    }
 }

+ 63 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/StringTimeUtil.java

@@ -0,0 +1,63 @@
+package com.sckw.core.utils;
+
+import com.sckw.core.exception.BusinessException;
+import lombok.extern.slf4j.Slf4j;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+
+/**
+ * @author xucaiqin
+ * @date 2023-07-26 11:42:43
+ */
+@Slf4j
+public class StringTimeUtil {
+    private final static DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+    private final static DateTimeFormatter dateTimeYMD = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+
+    @SuppressWarnings("all")
+    private static void formatCheck(String time) {
+        try {
+            LocalDate.parse(time, dateTimeYMD);
+        } catch (Exception e) {
+            log.error("时间格式化错误", e);
+            throw new BusinessException("时间格式化错误!");
+        }
+    }
+
+    /**
+     * @param time yyyy-MM-dd
+     * @return String yyyy-MM-dd HH:mm:ss
+     * @throws RuntimeException
+     */
+    public static String fillStart(String time) {
+        formatCheck(time);
+        return time + " 00:00:00";
+    }
+
+    /**
+     * @param time yyyy-MM-dd
+     * @return String yyyy-MM-dd HH:mm:ss
+     * @throws RuntimeException
+     */
+    public static String fillEnd(String time) {
+        formatCheck(time);
+        return time + " 23:59:59";
+    }
+
+    /**
+     * @param time yyyy-MM-dd
+     * @return LocalDateTime yyyy-MM-dd HH:mm:ss
+     */
+    public static LocalDateTime startDateTime(String time) {
+        return LocalDateTime.parse(fillStart(time), dateTimeFormatter);
+    }
+
+    /**
+     * @param time yyyy-MM-dd
+     * @return LocalDateTime yyyy-MM-dd HH:mm:ss
+     */
+    public static LocalDateTime endDateTime(String time) {
+        return LocalDateTime.parse(fillEnd(time), dateTimeFormatter);
+    }
+}

+ 235 - 135
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/StringUtils.java

@@ -1,11 +1,13 @@
 package com.sckw.core.utils;
 
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
+import com.sckw.core.exception.BusinessException;
+import com.sckw.core.model.constant.Global;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
+import java.util.stream.Collectors;
 
 /**
  * @Description 自测公共处理类
@@ -14,26 +16,37 @@ import java.util.regex.Pattern;
  */
 public class StringUtils {
 
-    /** 空字符串 */
+    /**
+     * 空字符串
+     */
     private static final String NULLSTR = "";
-    /** 下划线 */
+    /**
+     * 下划线
+     */
     private static final char SEPARATOR_CHAR = '_';
-    /** 下划线 */
+    /**
+     * 下划线
+     */
     private static final String SEPARATOR_STRING = "_";
-    /** 加密字符 */
+    /**
+     * 加密字符
+     */
     public static final String HASH_ALGORITHM = "SHA-1";
-    /**${xxx}**/
+    /**
+     * ${xxx}
+     **/
     public static final Pattern pattern = Pattern.compile("(\\$\\{)([\\w]+)(\\})");
 
     /**
      * 判断字符串是否为空
+     *
      * @param str 源字符串
+     * @return
      * @author dengyinghui
      * @date 2018/11/12
-     * @return
      */
-    public static boolean validatorEmpty(String str){
-        if(str != null && !"".equals(str)){
+    public static boolean validatorEmpty(String str) {
+        if (str != null && !"".equals(str)) {
             return false;
         }
 
@@ -42,6 +55,7 @@ public class StringUtils {
 
     /**
      * 判空操作(空)
+     *
      * @param str
      * @return
      */
@@ -52,6 +66,7 @@ public class StringUtils {
 
     /**
      * 判空操作(空)
+     *
      * @param value
      * @return
      */
@@ -61,6 +76,7 @@ public class StringUtils {
 
     /**
      * 判空操作(非空)
+     *
      * @param str
      * @return
      */
@@ -71,6 +87,7 @@ public class StringUtils {
 
     /**
      * 判空操作(非空)
+     *
      * @param value
      * @return
      */
@@ -80,6 +97,7 @@ public class StringUtils {
 
     /**
      * 获取uuid
+     *
      * @return
      */
     public static String uuid() {
@@ -92,8 +110,7 @@ public class StringUtils {
      * @param value defaultValue 要判断的value
      * @return value 返回值
      */
-    public static <T> T nvl(T value, T defaultValue)
-    {
+    public static <T> T nvl(T value, T defaultValue) {
         return value != null ? value : defaultValue;
     }
 
@@ -103,8 +120,7 @@ public class StringUtils {
      * @param coll 要判断的Collection
      * @return true:为空 false:非空
      */
-    public static boolean isEmpty(Collection<?> coll)
-    {
+    public static boolean isEmpty(Collection<?> coll) {
         return isNull(coll) || coll.isEmpty();
     }
 
@@ -114,8 +130,7 @@ public class StringUtils {
      * @param coll 要判断的Collection
      * @return true:非空 false:空
      */
-    public static boolean isNotEmpty(Collection<?> coll)
-    {
+    public static boolean isNotEmpty(Collection<?> coll) {
         return !isEmpty(coll);
     }
 
@@ -123,10 +138,9 @@ public class StringUtils {
      * * 判断一个对象数组是否为空
      *
      * @param objects 要判断的对象数组
-     ** @return true:为空 false:非空
+     *                * @return true:为空 false:非空
      */
-    public static boolean isEmpty(Object[] objects)
-    {
+    public static boolean isEmpty(Object[] objects) {
         return isNull(objects) || (objects.length == 0);
     }
 
@@ -136,8 +150,7 @@ public class StringUtils {
      * @param objects 要判断的对象数组
      * @return true:非空 false:空
      */
-    public static boolean isNotEmpty(Object[] objects)
-    {
+    public static boolean isNotEmpty(Object[] objects) {
         return !isEmpty(objects);
     }
 
@@ -147,8 +160,7 @@ public class StringUtils {
      * @param map 要判断的Map
      * @return true:为空 false:非空
      */
-    public static boolean isEmpty(Map<?, ?> map)
-    {
+    public static boolean isEmpty(Map<?, ?> map) {
         return isNull(map) || map.isEmpty();
     }
 
@@ -158,8 +170,7 @@ public class StringUtils {
      * @param map 要判断的Map
      * @return true:非空 false:空
      */
-    public static boolean isNotEmpty(Map<?, ?> map)
-    {
+    public static boolean isNotEmpty(Map<?, ?> map) {
         return !isEmpty(map);
     }
 
@@ -169,8 +180,7 @@ public class StringUtils {
      * @param str String
      * @return true:为空 false:非空
      */
-    public static boolean isEmpty(String str)
-    {
+    public static boolean isEmpty(String str) {
         return isNull(str) || NULLSTR.equals(str.trim());
     }
 
@@ -180,8 +190,7 @@ public class StringUtils {
      * @param str String
      * @return true:非空串 false:空串
      */
-    public static boolean isNotEmpty(String str)
-    {
+    public static boolean isNotEmpty(String str) {
         return !isEmpty(str);
     }
 
@@ -191,8 +200,7 @@ public class StringUtils {
      * @param object Object
      * @return true:为空 false:非空
      */
-    public static boolean isNull(Object object)
-    {
+    public static boolean isNull(Object object) {
         return object == null;
     }
 
@@ -202,8 +210,7 @@ public class StringUtils {
      * @param object Object
      * @return true:非空 false:空
      */
-    public static boolean isNotNull(Object object)
-    {
+    public static boolean isNotNull(Object object) {
         return !isNull(object);
     }
 
@@ -213,44 +220,37 @@ public class StringUtils {
      * @param object 对象
      * @return true:是数组 false:不是数组
      */
-    public static boolean isArray(Object object)
-    {
+    public static boolean isArray(Object object) {
         return isNotNull(object) && object.getClass().isArray();
     }
 
     /**
      * 去空格
      */
-    public static String trim(String str)
-    {
+    public static String trim(String str) {
         return (str == null ? "" : str.trim());
     }
 
     /**
      * 截取字符串
      *
-     * @param str 字符串
+     * @param str   字符串
      * @param start 开始
      * @return 结果
      */
-    public static String substring(final String str, int start)
-    {
-        if (str == null)
-        {
+    public static String substring(final String str, int start) {
+        if (str == null) {
             return NULLSTR;
         }
 
-        if (start < 0)
-        {
+        if (start < 0) {
             start = str.length() + start;
         }
 
-        if (start < 0)
-        {
+        if (start < 0) {
             start = 0;
         }
-        if (start > str.length())
-        {
+        if (start > str.length()) {
             return NULLSTR;
         }
 
@@ -260,43 +260,35 @@ public class StringUtils {
     /**
      * 截取字符串
      *
-     * @param str 字符串
+     * @param str   字符串
      * @param start 开始
-     * @param end 结束
+     * @param end   结束
      * @return 结果
      */
-    public static String substring(final String str, int start, int end)
-    {
-        if (str == null)
-        {
+    public static String substring(final String str, int start, int end) {
+        if (str == null) {
             return NULLSTR;
         }
 
-        if (end < 0)
-        {
+        if (end < 0) {
             end = str.length() + end;
         }
-        if (start < 0)
-        {
+        if (start < 0) {
             start = str.length() + start;
         }
 
-        if (end > str.length())
-        {
+        if (end > str.length()) {
             end = str.length();
         }
 
-        if (start > end)
-        {
+        if (start > end) {
             return NULLSTR;
         }
 
-        if (start < 0)
-        {
+        if (start < 0) {
             start = 0;
         }
-        if (end < 0)
-        {
+        if (end < 0) {
             end = 0;
         }
 
@@ -318,45 +310,37 @@ public class StringUtils {
 
     public static String format(String template, Object... params)
     {
-        if (isEmpty(params) || isEmpty(template))
-        {
-            return template;
-        }
-        return StrFormatter.format(template, params);
+    if (isEmpty(params) || isEmpty(template))
+    {
+    return template;
+    }
+    return StrFormatter.format(template, params);
     }*/
 
     /**
      * 下划线转驼峰命名
      */
-    public static String toUnderScoreCase(String s)
-    {
-        if (s == null)
-        {
+    public static String toUnderScoreCase(String s) {
+        if (s == null) {
             return null;
         }
         StringBuilder sb = new StringBuilder();
         boolean upperCase = false;
-        for (int i = 0; i < s.length(); i++)
-        {
+        for (int i = 0; i < s.length(); i++) {
             char c = s.charAt(i);
 
             boolean nextUpperCase = true;
 
-            if (i < (s.length() - 1))
-            {
+            if (i < (s.length() - 1)) {
                 nextUpperCase = Character.isUpperCase(s.charAt(i + 1));
             }
 
-            if ((i > 0) && Character.isUpperCase(c))
-            {
-                if (!upperCase || !nextUpperCase)
-                {
+            if ((i > 0) && Character.isUpperCase(c)) {
+                if (!upperCase || !nextUpperCase) {
                     sb.append(SEPARATOR_CHAR);
                 }
                 upperCase = true;
-            }
-            else
-            {
+            } else {
                 upperCase = false;
             }
 
@@ -369,18 +353,14 @@ public class StringUtils {
     /**
      * 是否包含字符串
      *
-     * @param str 验证字符串
+     * @param str  验证字符串
      * @param strs 字符串组
      * @return 包含返回true
      */
-    public static boolean inStringIgnoreCase(String str, String... strs)
-    {
-        if (str != null && strs != null)
-        {
-            for (String s : strs)
-            {
-                if (str.equalsIgnoreCase(trim(s)))
-                {
+    public static boolean inStringIgnoreCase(String str, String... strs) {
+        if (str != null && strs != null) {
+            for (String s : strs) {
+                if (str.equalsIgnoreCase(trim(s))) {
                     return true;
                 }
             }
@@ -388,23 +368,82 @@ public class StringUtils {
         return false;
     }
 
+    /**
+     * 截取字符串从index到最后
+     *
+     * @param str
+     * @param index
+     * @return
+     */
+    public static String subStrFromIndexToEnd(String str, Integer index) {
+        if (StringUtils.isBlank(str) || str.length() <= index) {
+            return str;
+        }
+        return str.substring(str.length() - index);
+    }
+
     /**
      * 字符串转数组
+     *
      * @param params 字符串
-     * @param regex 截取字符
+     * @param regex  截取字符
      * @return
      */
-    public static String [] splitStr(String params, String regex){
+    public static String[] splitStr(String params, String regex) {
         regex = StringUtils.isNotBlank(regex) ? regex : ",";
         return StringUtils.isNotBlank(params) ? params.split(regex) : new String[]{};
     }
 
+    /**
+     * 字符串分割转list
+     *
+     * @param str 字符串
+     * @param cls 转换类型class
+     * @return
+     */
+    public static <T> List<T> splitStrToList(String str, Class<T> cls) {
+        return splitStrToList(str, ",", cls);
+    }
+
+    /**
+     * 字符串分割转list
+     *
+     * @param str   字符串
+     * @param regex 截取字符
+     * @param cls   转换类型class
+     * @return
+     */
+    public static <T> List<T> splitStrToList(String str, String regex, Class<T> cls) {
+        regex = StringUtils.isNotBlank(regex) ? regex : ",";
+        if (StringUtils.isBlank(str)) {
+            return Collections.emptyList();
+        }
+        List<T> result;
+        if (cls == String.class) {
+            result = Arrays.stream(str.split(regex))
+                    .map(strValue -> (T) strValue)
+                    .collect(Collectors.toList());
+        } else {
+            result = Arrays.stream(str.split(regex))
+                    .map(strValue -> {
+                        try {
+                            return cls.getConstructor(String.class).newInstance(strValue);
+                        } catch (InstantiationException | IllegalAccessException | InvocationTargetException |
+                                 NoSuchMethodException e) {
+                            throw new BusinessException("字符串转集合异常!");
+                        }
+                    }).collect(Collectors.toList());
+        }
+        return result;
+    }
+
     /**
      * Object对象转字符串
+     *
      * @param obj
      * @return
      */
-    public static String objectStr(Object obj){
+    public static String objectStr(Object obj) {
         if (obj != null) {
             return obj.toString();
         }
@@ -415,12 +454,13 @@ public class StringUtils {
         if (str == null) {
             return "";
         } else {
-            return str instanceof String ? ((String)str).trim() : str.toString();
+            return str instanceof String ? ((String) str).trim() : str.toString();
         }
     }
 
     /**
      * 解析出url请求的路径,包括页面
+     *
      * @param strURL url地址
      * @return url路径
      */
@@ -468,7 +508,7 @@ public class StringUtils {
      * @return url请求参数部分
      */
     public static Map<String, String> urlRequest(String url) {
-        Map<String, String> mapRequest = new HashMap<String, String>();
+        Map<String, String> mapRequest = new HashMap<>(Global.NUMERICAL_SIXTEEN);
         String[] arrSplit = null;
         String strUrlParam = truncateUrlPage(url);
         if (strUrlParam == null) {
@@ -501,7 +541,7 @@ public class StringUtils {
      * @return url请求参数部分
      */
     public static Map<String, String> urlParams(String strUrlParam) {
-        Map<String, String> mapRequest = new HashMap<String, String>();
+        Map<String, String> mapRequest = new HashMap<>(Global.NUMERICAL_SIXTEEN);
         String[] arrSplit = null;
         if (strUrlParam == null) {
             return mapRequest;
@@ -555,8 +595,8 @@ public class StringUtils {
     /**
      * 转换为Double类型
      */
-    public static Double toDouble(Object val){
-        if (val == null){
+    public static Double toDouble(Object val) {
+        if (val == null) {
             return 0D;
         }
         try {
@@ -573,31 +613,32 @@ public class StringUtils {
         return toDouble(val).floatValue();
     }
 
-        /**
-         * 转换为Long类型
-         */
-    public static Long toLong(Object val){
+    /**
+     * 转换为Long类型
+     */
+    public static Long toLong(Object val) {
         return toDouble(val).longValue();
     }
 
     /**
      * 转换为Integer类型
      */
-    public static Integer toInteger(Object val){
+    public static Integer toInteger(Object val) {
         return toLong(val).intValue();
     }
 
     /**
      * Object转String
+     *
      * @param val 源字符串
+     * @return
      * @author dengyinghui
      * @date 2018/2/27
-     * @return
      */
-    public static String valueOf(Object val){
-        if(val == null){
+    public static String valueOf(Object val) {
+        if (val == null) {
             return "";
-        } else{
+        } else {
             return String.valueOf(val);
         }
     }
@@ -605,7 +646,7 @@ public class StringUtils {
     private static String toHex(byte[] bytes) {
         final char[] hexDigits = "0123456789ABCDEF".toCharArray();
         StringBuilder ret = new StringBuilder(bytes.length * 2);
-        for (int i=0; i<bytes.length; i++) {
+        for (int i = 0; i < bytes.length; i++) {
             ret.append(hexDigits[(bytes[i] >> 4) & 0x0f]);
             ret.append(hexDigits[bytes[i] & 0x0f]);
         }
@@ -614,20 +655,21 @@ public class StringUtils {
 
     /**
      * 替换字符串${xxxx}
-     * @param content 账号创建成功,欢迎使用危品汇!登录账号:${account},默认密码:${pwd}!
-     * @param regex 需要替换的字符(account)
+     *
+     * @param content     账号创建成功,欢迎使用危品汇!登录账号:${account},默认密码:${pwd}!
+     * @param regex       需要替换的字符(account)
      * @param replacement 替换值(173xxxxxxxx)
      * @return
      */
-    public static String replace(String content, String regex, String replacement){
-        if (content == null || regex == null || replacement == null){
+    public static String replace(String content, String regex, String replacement) {
+        if (content == null || regex == null || replacement == null) {
             return null;
         }
         Matcher matcher = pattern.matcher(content);
         StringBuffer strBuf = new StringBuffer();
         while (matcher.find()) {
             String group = matcher.group().replace("${", "").replace("}", "");
-            if (group.equals(regex)){
+            if (group.equals(regex)) {
                 matcher.appendReplacement(strBuf, replacement);
                 return matcher.appendTail(strBuf).toString();
             }
@@ -637,20 +679,21 @@ public class StringUtils {
 
     /**
      * 替换字符串${xxxx}
-     * @param content  账号创建成功,欢迎使用危品汇!登录账号:${account},默认密码:${pwd}!
-     * @param params {"account":"xxxxx", "pwd":"xxxx"}
+     *
+     * @param content 账号创建成功,欢迎使用危品汇!登录账号:${account},默认密码:${pwd}!
+     * @param params  {"account":"xxxxx", "pwd":"xxxx"}
      * @return
      */
-    public static String replace1(String content, Map<String, Object> params){
-        if (content == null || params == null){
+    public static String replace1(String content, Map<String, Object> params) {
+        if (content == null || params == null) {
             return null;
         }
 
         Matcher matcher = pattern.matcher(content);
         StringBuffer strBuf = new StringBuffer();
-        while(matcher.find()){
+        while (matcher.find()) {
             String group = matcher.group().replace("${", "").replace("}", "");
-            if (params.get(group) != null){
+            if (params.get(group) != null) {
                 String replacement = StringUtils.objectStr(params.get(group));
                 matcher.appendReplacement(strBuf, replacement);
             }
@@ -671,31 +714,88 @@ public class StringUtils {
             // already capitalized
             return str;
         }
-
-        final int newCodePoints[] = new int[strLen]; // cannot be longer than the char array
+        // cannot be longer than the char array
+        final int newCodePoints[] = new int[strLen];
         int outOffset = 0;
-        newCodePoints[outOffset++] = newCodePoint; // copy the first codepoint
+        // copy the first codepoint
+        newCodePoints[outOffset++] = newCodePoint;
         for (int inOffset = Character.charCount(firstCodepoint); inOffset < strLen; ) {
             final int codepoint = str.codePointAt(inOffset);
-            newCodePoints[outOffset++] = codepoint; // copy the remaining ones
+            // copy the remaining ones
+            newCodePoints[outOffset++] = codepoint;
             inOffset += Character.charCount(codepoint);
         }
         return new String(newCodePoints, 0, outOffset);
     }
 
-    public static void main(String[] args){
-        Map<String, Object> param = new HashMap();
+
+    /**
+     * 字符串格式化长度不足补0
+     */
+    public static String addZeroForNum(String str, int strLength) {
+        int strLen = str.length();
+        if (strLen < strLength) {
+            StringBuffer sb = new StringBuffer(str);
+            while (strLen < strLength) {
+                // 左补0
+                sb.insert(0, "0");
+                strLen = sb.length();
+            }
+            str = sb.toString();
+        }
+        return str;
+    }
+
+    /**
+     * 值替换
+     *
+     * @param prefix
+     * @param args
+     * @return
+     */
+    public static String format(String prefix, Object... args) {
+        return String.format(prefix, args);
+    }
+
+    /**
+     * @desc: 替换文本变量,变量格式为:${}
+     * @author: yzc
+     * @date: 2023-09-01 9:03
+     * @Param text: 文本
+     * @Param varNames:  变量名map
+     * @return: java.util.List<java.lang.String>  替换后的文本
+     */
+    public static String replaceTextVar(String text, Map<String, Object> varNames) {
+        if (StringUtils.isBlank(text) || CollectionUtils.isEmpty(varNames)) {
+            return text;
+        }
+        Pattern pattern = Pattern.compile("\\$\\{([^}]+)\\}");
+        Matcher matcher = pattern.matcher(text);
+        StringBuilder result = new StringBuilder();
+        while (matcher.find()) {
+            String varName = matcher.group(1);
+            Object varValue = varNames.get(varName);
+            if (Objects.nonNull(varValue)) {
+                matcher.appendReplacement(result, varValue.toString());
+            }
+        }
+        matcher.appendTail(result);
+        return result.toString();
+    }
+
+    public static void main(String[] args) {
+        Map<String, Object> param = new HashMap<>(Global.NUMERICAL_SIXTEEN);
         param.put("account", "17358629955");
         param.put("pwd", "123456");
         String template = "账号创建成功,欢迎使用危品汇!登录账号:${account},默认密码:${pwd}!";
-        for(String key : param.keySet()){
+        for (String key : param.keySet()) {
             template = StringUtils.replace(template, key, StringUtils.objectStr(param.get(key)));
         }
         System.out.println(template);
 
-        Map<String, Object> m = new HashMap<>();
+        Map<String, Object> m = new HashMap<>(Global.NUMERICAL_SIXTEEN);
         m.put("account", "han");
         m.put("pwd", "zhong");
-        System.out.println( replace1(template, m));
+        System.out.println(replace1(template, m));
     }
 }

+ 3 - 3
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/workerUtils.java

@@ -121,9 +121,9 @@ public class workerUtils {
         // 上次生成ID的时间截
         lastTimestamp = timestamp;
         // 移位并通过或运算拼到一起组成64位的ID
-        return ((timestamp - twepoch) << timestampLeftShift) //
-                | (datacenterId << datacenterIdShift) //
-                | (workerId << workerIdShift) //
+        return ((timestamp - twepoch) << timestampLeftShift)
+                | (datacenterId << datacenterIdShift)
+                | (workerId << workerIdShift)
                 | sequence;
     }
 

+ 50 - 2
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/constant/HttpStatus.java

@@ -23,6 +23,14 @@ public class HttpStatus {
 
     /**全局异常状态码*/
     public static final int GLOBAL_EXCEPTION_CODE = 60500;
+    /**
+     * 完结贸易订单失败异常码
+     */
+    public static final int COMPLETE_TORDER_FAIL_CODE = 60666;
+    /**
+     * 商品上架失败异常码
+     */
+    public static final int GOODS_PUT_ON_SHELVES_FAIL_CODE = 60667;
     /**全局异常提示信息*/
     public static final String GLOBAL_EXCEPTION_MESSAGE = "攻城狮正在拼命优化,请您稍候再试!";
 
@@ -30,6 +38,8 @@ public class HttpStatus {
     public static final int PARAMETERS_MISSING_CODE = 60600;
     public static final String ID_MISSING = "id不能为空!";
     public static final String ACCOUNT_MISSING = "用户账号必填!";
+    public static final String ACCOUNT_FREEZE = "用户账号不能重复冻结!";
+    public static final String ACCOUNT_UNFREEZE = "用户账号不能重复解冻!";
     public static final String ACCOUNT_EXISTS = "用户账号已存在!";
     public static final String PWD_MISSING = "密码不能为空!";
     public static final String TOKEN_MISSING = "token不能为空!";
@@ -39,8 +49,7 @@ public class HttpStatus {
     public static final String ENT_EXISTS = "企业已存在,不可重复!";
     public static final String DICTTYPE_EXISTS = "字典类型已存在,不可重复!";
     public static final String DICT_EXISTS = "字典键值已存在,不可重复!";
-
-
+    public static final String ADDRESS_EXISTS = "地点已存在,不可重复!";
 
     /**其他自定义状态码*/
     public static final int CODE_60603 = 60603;
@@ -75,6 +84,12 @@ public class HttpStatus {
     public static final int PARAMETERS_PATTERN_ERROR_CODE = 60800;
     /**参数格式不正确提示信息*/
     public static final String PARAMETERS_PATTERN_ERROR_MESSAGE = "参数格式不正确";
+    public static final String CONTACTS_ERROR = "联系人格式不正确";
+    public static final String CONTACTS_PHONE_ERROR = "联系人手机号格式不正确";
+    public static final String LEGAL_NAME_ERROR = "法人格式不正确";
+    public static final String LEGAL_PHONE_ERROR = "法人手机号格式不正确";
+    public static final String LEGAL_ID_CARD_ERROR = "法人身份证号格式不正确";
+    public static final String ENT_CODE_ERROR = "企业编号格式不正确";
 
     /**账号在别处登录状态码*/
     public static final int ACCOUNT_OTHER_LOGIN_CODE = 60900;
@@ -118,12 +133,20 @@ public class HttpStatus {
     public static final int QUERY_FAIL_CODE = 60602;
     public static final String ACCOUNT_NOT_EXISTS = "用户信息不存在或已失效";
     public static final String ENT_NOT_EXISTS = "企业信息不存在或已失效";
+    public static final String DEPT_NOT_EXISTS = "机构信息不存在或已失效";
     public static final String ENTCERTIFICATES_NOT_EXISTS = "未查询到企业资质信息";
     public static final String ENTCERTIFICATES_INVAILD = "企业资质已失效";
     public static final String ROLE_NOT_EXISTS = "未查询到关联的角色";
     public static final String USER_DEPT_NOT_EXISTS = "未查询到用户-机构关联信息";
     public static final String MENU_NOT_EXISTS = "未查询到菜单信息";
     public static final String PARENT_MENU_NOT_EXISTS = "未查询到父菜单信息";
+    public static final String PARENT_UNIT_NOT_EXISTS = "未查询到父级单位信息";
+    public static final String COOPERATE_ATTRIBUTE_NOT_EXISTS = "未查询到已有的合作属性";
+    public static final String COOPERATE_NOT_EXISTS = "未查询到合作记录或已失效";
+    public static final String COOPERATE_CANCEL_EXISTS = "未查询到可撤销的记录";
+    public static final String ADDRESS_NOT_EXISTS = "未查询到地址记录或已失效";
+    public static final String CONTRACT_NOT_EXISTS = "未查询到合同或已失效";
+    public static final String BANNER_NOT_EXISTS = "未查询到banner数据或已失效";
 
     /**自定义提示消息*/
     public static final String PASSWD_ERROR = "密码不正确";
@@ -140,4 +163,29 @@ public class HttpStatus {
     public static final String MSG_009 = "认证提交成功!";
     public static final String MSG_010 = "绑定成功!";
     public static final String MSG_011 = "当前企业还存在员工数据,不能删除!";
+    public static final String MSG_012 = "只能解除状态为合作中的记录!";
+    public static final String MSG_013 = "只能删除状态为已解除的记录!";
+    public static final String MSG_014 = "导出失败";
+    public static final String MSG_015 = "与对方企业存在待审核的合作关系,请撤销或者完成审核再申请!";
+    public static final String MSG_016 = "与对方企业已存在相同属性的合作关系!";
+    public static final String MSG_017 = "发起申请成功!";
+    public static final String MSG_018 = "撤销成功!";
+    public static final String MSG_019 = "只能操作正在审核中的记录!";
+    public static final String MSG_020 = "当前机构还存在员工数据,不能删除!";
+    public static final String MSG_021 = "不能重复设置默认地址!";
+    public static final String MSG_022 = "只能对草稿进行删除!";
+    public static final String MSG_023 = "解除成功!";
+    public static final String MSG_024 = "名称不能重复!";
+    public static final String MSG_025 = "禁止删除本人信息!";
+    public static final String MSG_026 = "资质认证审核中,请等待审核后再提交!";
+    public static final String MSG_027 = "一级机构不能删除!";
+    public static final String MSG_028 = "合同未签约,不能手动完结!";
+    public static final String MSG_029 = "合同编号超长!";
+    public static final String MSG_030 = "合同名称超长!";
+    public static final String MSG_031 = "您与所选企业存在未完结销售订单,当前无法删除!";
+    public static final String MSG_032 = "您与所选企业存在未完结托运承运订单,当前无法删除!";
+    public static final String MSG_033 = "当前企业资质在审核中,无法删除!";
+    public static final String MSG_034 = "您与所选企业存在未完结对账单,当前无法删除!";
+    public static final String MSG_035 = "地址信息已存在";
+
 }

+ 28 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/context/LoginUserHolder.java

@@ -1,7 +1,12 @@
 package com.sckw.core.web.context;
 
+import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.web.model.LoginUserInfo;
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
 /**
  * 当前登录用户的临时保存容器
  * @Author zk
@@ -110,6 +115,15 @@ public class LoginUserHolder {
         return LONGIN_USER_HOLDER.get() == null ? null : LONGIN_USER_HOLDER.get().getEntId();
     }
 
+    /**
+     * 用户所属企业
+     * @author zhaokang
+     * @Date 2020/04/13 0021
+     */
+    public static String getEntName(){
+        return LONGIN_USER_HOLDER.get() == null ? null : LONGIN_USER_HOLDER.get().getEntName();
+    }
+
     /**
      * 用户登录终端
      * @author zhaokang
@@ -128,5 +142,19 @@ public class LoginUserHolder {
         return LONGIN_USER_HOLDER.get() == null ? null : LONGIN_USER_HOLDER.get().getDeptIds();
     }
 
+    /**
+     * 用户权限
+     */
+    public static List<Long> getAuthUserIdList() {
+        if (LONGIN_USER_HOLDER.get() == null) {
+            return new ArrayList<>();
+        }
+        List<Long> authUserIdList = LONGIN_USER_HOLDER.get().getAuthUserIdList();
+        if (CollectionUtils.isEmpty(authUserIdList)) {
+            return new ArrayList<>();
+        }
+
+        return authUserIdList;
+    }
 
 }

+ 1 - 1
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/model/EntCertificateInfo.java

@@ -30,7 +30,7 @@ public class EntCertificateInfo implements Serializable {
     /**
      * 证书正面
      */
-    private String certificateMian;
+    private String certificateMain;
 
     /**
      * 证书反面

+ 72 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/model/LoginEntInfo.java

@@ -46,6 +46,26 @@ public class LoginEntInfo {
      */
     private int jtaqDelFlag;
 
+    /**
+     * 企业联系人
+     */
+    private String contacts;
+
+    /**
+     * 联系电话
+     */
+    private String phone;
+
+    /**
+     * 法人姓名
+     */
+    private String legalName;
+
+    /**
+     * 法人联系电话
+     */
+    private String legalPhone;
+
     /**
      * 企业注册时间
      */
@@ -56,8 +76,60 @@ public class LoginEntInfo {
      */
     private Boolean valid;
 
+    /**
+     * 企业属性
+     */
+    private String entTypes;
+
     /**
      * 资质
      */
     private List<EntCertificateInfo> certificateInfo;
+
+
+//    /**
+//     * 企业编号
+//     */
+//    private Long id;
+//
+//    /**
+//     * 企业名称
+//     */
+//    private String firmName;
+//
+//    /**
+//     * 注册时间
+//     */
+//    private Date regTime;
+//
+//    /**
+//     * 资料审批状态(0未审批、1通过、2未通过、3审批中)
+//     */
+//    private Integer approval;
+//
+//    /**
+//     * 企业类型(值)
+//     */
+//    private String entTypes;
+
+    /**
+     * 企业类型(名称)
+     */
+    private String entTypeNames;
+
+    /**
+     * 企业联系人(企业管理员)
+     */
+    private Long mainId;
+
+    /**
+     * 企业联系人(企业管理员)
+     */
+    private String mainName;
+
+    /**
+     * 联系电话(企业管理员)
+     */
+    private String mainPhone;
+
 }

+ 11 - 2
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/model/LoginUserInfo.java

@@ -2,6 +2,8 @@ package com.sckw.core.web.model;
 
 import lombok.Data;
 
+import java.util.List;
+
 /**
  * 登录中的用户信息
  * @Author zhaokang
@@ -36,7 +38,7 @@ public class LoginUserInfo {
     /**
      *用户账号状态(0正常/1锁定)
      */
-    private int status;
+    private Integer status;
     /**
      * 用户所属企业id
      */
@@ -50,12 +52,18 @@ public class LoginUserInfo {
      */
     private String deptIds;
 
+    /**
+     * 企业名
+     */
+    private String entName;
+
+    private List<Long> authUserIdList;
 
     public LoginUserInfo() {
     }
 
     public LoginUserInfo(Long id, Integer systemType, String account, String userName, String phone,
-                         int isMain, int status, Long entId, String clientType, String deptIds) {
+                         int isMain, int status, Long entId, String clientType, String deptIds, List<Long> authUserIdList) {
         this.id = id;
         this.systemType = systemType;
         this.account = account;
@@ -66,5 +74,6 @@ public class LoginUserInfo {
         this.entId = entId;
         this.clientType = clientType;
         this.deptIds = deptIds;
+        this.authUserIdList = authUserIdList;
     }
 }

+ 4 - 4
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/utils/ValidateList.java → sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/model/ValiList.java

@@ -1,4 +1,4 @@
-package com.sckw.excel.utils;
+package com.sckw.core.web.model;
 
 import jakarta.validation.Valid;
 import lombok.Data;
@@ -6,14 +6,14 @@ import lombok.Data;
 import java.util.*;
 
 /**
- * @author JiangPan
+ * @author lfdc
  * @version 1.0.0
- * @ClassName ValidateList.java
+ * @ClassName ValiList.java
  * @Description List集合验证工具类
  * @createTime 2021年10月20日 15:29:00
  */
 @Data
-public class ValidateList<E> implements List<E> {
+public class ValiList<E> implements List<E> {
 
     @Valid
     private List<E> list = new ArrayList<>();

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.