Bladeren bron

Merge branch 'dev' into test

# Conflicts:
#	sckw-modules/sckw-contract/src/main/resources/bootstrap.yml
zk 2 jaren geleden
bovenliggende
commit
1cee7972a4
100 gewijzigde bestanden met toevoegingen van 2163 en 1350 verwijderingen
  1. 54 3
      pom.xml
  2. 9 1
      sckw-auth/pom.xml
  3. 13 82
      sckw-auth/src/main/java/com/sckw/auth/controller/AuthController.java
  4. 5 0
      sckw-auth/src/main/java/com/sckw/auth/model/vo/req/LoginBase.java
  5. 10 24
      sckw-auth/src/main/java/com/sckw/auth/service/IAuthService.java
  6. 235 295
      sckw-auth/src/main/java/com/sckw/auth/service/impl/AuthServiceImpl.java
  7. 2 2
      sckw-auth/src/main/resources/bootstrap-dev.yml
  8. 2 2
      sckw-auth/src/main/resources/bootstrap-test.yml
  9. 12 11
      sckw-common/sckw-common-bom/pom.xml
  10. 1 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/enums/DictEnum.java
  11. 2 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/enums/DictTypeEnum.java
  12. 68 15
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/filter/RequestCheckFilter.java
  13. 0 47
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/auth/LoginBase.java
  14. 0 52
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/auth/LoginEnterpriseInfo.java
  15. 0 74
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/auth/LoginUserInfo.java
  16. 0 95
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/auth/context/LoginEnterpriseHolder.java
  17. 0 140
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/auth/context/LoginUserHolder.java
  18. 1 1
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/base/BaseModel.java
  19. 15 2
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/constant/Global.java
  20. 3 2
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/constant/NumberConstant.java
  21. 18 2
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/ApprovalEnum.java
  22. 11 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/EntTypeEnum.java
  23. 1 1
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/LogisticsOrderEnum.java
  24. 3 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/EncryUtil.java
  25. 1 1
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/FileUtils.java
  26. 298 57
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/PasswordUtils.java
  27. 3 2
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/StringUtils.java
  28. 6 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/config/CustomConfig.java
  29. 7 6
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/constant/HttpStatus.java
  30. 3 1
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/constant/RequestConstant.java
  31. 16 15
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/context/LoginEntHolder.java
  32. 16 1
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/context/LoginUserHolder.java
  33. 7 7
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/model/LoginBase.java
  34. 9 34
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/model/LoginEntInfo.java
  35. 19 2
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/model/LoginUserInfo.java
  36. 1 1
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/config/easyexcel/CustomCellWeightWeightConfig.java
  37. 1 1
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/config/easyexcel/ExcelConverter.java
  38. 1 1
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/Translator.java
  39. 1 2
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/context/Enums.java
  40. 1 1
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/context/Organization.java
  41. 1 1
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/wrapper/AbstractTranslator.java
  42. 1 0
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/utils/DateUtil.java
  43. 1 1
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/utils/ExcelUtil.java
  44. 30 0
      sckw-common/sckw-common-redis/src/main/java/com/sckw/redis/utils/RedissonUtils.java
  45. 15 0
      sckw-common/sckw-common-stream/src/main/java/com/sckw/stream/enums/MessageEnum.java
  46. 10 1
      sckw-modules-api/sckw-contract-api/src/main/java/com/sckw/contract/api/RemoteContractService.java
  47. 74 0
      sckw-modules-api/sckw-contract-api/src/main/java/com/sckw/contract/api/model/dto/res/ContractLogisticsOrderResDto.java
  48. 5 0
      sckw-modules-api/sckw-manage-api/src/main/java/com/sckw/manage/api/RemoteManageService.java
  49. 10 0
      sckw-modules-api/sckw-manage-api/src/main/java/com/sckw/manage/api/model/dto/res/EntAddressResDto.java
  50. 36 0
      sckw-modules-api/sckw-manage-api/src/main/java/com/sckw/manage/api/model/dto/res/FindCooperateByEntReqVo.java
  51. 95 0
      sckw-modules-api/sckw-manage-api/src/main/java/com/sckw/manage/api/model/dto/res/FindCooperateByEntResVo.java
  52. 1 0
      sckw-modules-api/sckw-modules-bom/pom.xml
  53. 23 0
      sckw-modules-api/sckw-order-api/src/main/java/com/sckw/order/api/dubbo/TradeOrderInfoService.java
  54. 1 3
      sckw-modules-api/sckw-order-api/src/main/java/com/sckw/order/api/dubbo/TradeOrderStatisticsService.java
  55. 0 5
      sckw-modules-api/sckw-order-api/src/main/java/com/sckw/order/api/model/CompleteLogisticsOrderParam.java
  56. 39 0
      sckw-modules-api/sckw-order-api/src/main/java/com/sckw/order/api/model/GoodsLoadingParam.java
  57. 39 0
      sckw-modules-api/sckw-order-api/src/main/java/com/sckw/order/api/model/GoodsLoadingV1Param.java
  58. 5 0
      sckw-modules-api/sckw-order-api/src/main/java/com/sckw/order/api/model/OrderDetailRes.java
  59. 1 1
      sckw-modules-api/sckw-payment-api/src/main/java/com/sckw/payment/api/dubbo/PaymentDubboService.java
  60. 2 0
      sckw-modules-api/sckw-product-api/src/main/java/com/sckw/product/api/dubbo/GoodsInfoService.java
  61. 5 0
      sckw-modules-api/sckw-product-api/src/main/java/com/sckw/product/api/model/GoodsDetail.java
  62. 42 0
      sckw-modules-api/sckw-product-api/src/main/java/com/sckw/product/api/model/GoodsUnitDetail.java
  63. 51 1
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteSystemService.java
  64. 42 2
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteUserService.java
  65. 5 0
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/req/RegisterReqDto.java
  66. 13 1
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/EntCacheResDto.java
  67. 27 0
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/KwsEntDeptDto.java
  68. 5 2
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/KwsUserResDto.java
  69. 55 0
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/SpecialResVo.java
  70. 5 1
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/SysDictResDto.java
  71. 4 2
      sckw-modules-api/sckw-transport-api/src/main/java/com/sckw/transport/api/dubbo/TransportStatisticsService.java
  72. 13 0
      sckw-modules/pom.xml
  73. 19 4
      sckw-modules/sckw-contract/pom.xml
  74. 13 1
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/dao/KwcContractLogisticsMapper.java
  75. 1 1
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/dao/KwcContractTradeMapper.java
  76. 74 14
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/dubbo/RemoteContractServiceImpl.java
  77. 43 15
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/KwcContractLogisticsService.java
  78. 40 20
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/KwcContractTradeService.java
  79. 0 1
      sckw-modules/sckw-contract/src/main/resources/bootstrap.yml
  80. 53 19
      sckw-modules/sckw-contract/src/main/resources/mapper/KwcContractLogisticsMapper.xml
  81. 25 19
      sckw-modules/sckw-contract/src/main/resources/mapper/KwcContractTradeMapper.xml
  82. 20 1
      sckw-modules/sckw-example/pom.xml
  83. 1 1
      sckw-modules/sckw-example/src/main/java/com/sckw/example/controller/ExcelExportController.java
  84. 86 118
      sckw-modules/sckw-example/src/main/java/com/sckw/example/controller/SysUserController.java
  85. 25 0
      sckw-modules/sckw-example/src/main/java/com/sckw/example/controller/TransportController.java
  86. 1 1
      sckw-modules/sckw-example/src/main/java/com/sckw/example/model/vo/ProjectPageVo.java
  87. 3 1
      sckw-modules/sckw-example/src/main/java/com/sckw/example/service/TransportService.java
  88. 15 3
      sckw-modules/sckw-file/pom.xml
  89. 1 1
      sckw-modules/sckw-file/src/main/java/com/sckw/file/dubbo/FileDubboApiServiceImpl.java
  90. 1 1
      sckw-modules/sckw-file/src/main/java/com/sckw/file/service/FileService.java
  91. 1 1
      sckw-modules/sckw-file/src/main/resources/bootstrap.yml
  92. 19 2
      sckw-modules/sckw-fleet/pom.xml
  93. 0 9
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckController.java
  94. 4 2
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dao/KwfDriverMapper.java
  95. 6 4
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dao/KwfTruckMapper.java
  96. 0 2
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/dto/KwfTruckReportExcelImportDto.java
  97. 38 9
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfDriverService.java
  98. 2 1
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfTruckReportService.java
  99. 111 57
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfTruckService.java
  100. 50 38
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfDriverMapper.xml

+ 54 - 3
pom.xml

@@ -22,6 +22,15 @@
     <packaging>pom</packaging>
 
     <properties>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
+        <project.api.version>1.1.0</project.api.version>
+        <!--更新模块-->
+        <upgrade.version>1.1.0</upgrade.version>
+        <!--基础模块-->
+        <basic.version>1.0.0</basic.version>
+        <project.basic.version>1.0.0</project.basic.version>
+        <flatten-maven-plugin.version>1.5.0</flatten-maven-plugin.version>
         <maven.compiler.source>17</maven.compiler.source>
         <maven.compiler.target>17</maven.compiler.target>
         <maven.compiler.compilerVersion>17</maven.compiler.compilerVersion>
@@ -101,7 +110,7 @@
             <dependency>
                 <groupId>com.sckw</groupId>
                 <artifactId>sckw-common-bom</artifactId>
-                <version>${project.version}</version>
+                <version>${project.basic.version}</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
@@ -110,7 +119,7 @@
             <dependency>
                 <groupId>com.sckw</groupId>
                 <artifactId>sckw-modules-bom</artifactId>
-                <version>${project.version}</version>
+                <version>${project.basic.version}</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
@@ -333,10 +342,26 @@
                 <artifactId>bcprov-jdk18on</artifactId>
                 <version>1.74</version>
             </dependency>
+
+            <!--热部署-->
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-devtools</artifactId>
+                <optional>true</optional>
+            </dependency>
+
         </dependencies>
     </dependencyManagement>
 
     <profiles>
+        <profile>
+            <id>lfdc</id>
+            <properties>
+                <profiles.active>lfdc</profiles.active>
+                <nacos.server>10.10.10.230:8848</nacos.server>
+                <nacos.namespace>sckw_lfdc</nacos.namespace>
+            </properties>
+        </profile>
         <profile>
             <id>dev</id>
             <properties>
@@ -359,7 +384,7 @@
             <id>prod</id>
             <properties>
                 <profiles.active>prod</profiles.active>
-                <nacos.server>172.16.156.151:8848</nacos.server>
+                <nacos.server>172.17.0.4:8848</nacos.server>
                 <nacos.namespace>sckw-service-platform</nacos.namespace>
             </properties>
         </profile>
@@ -412,6 +437,32 @@
             </plugins>
         </pluginManagement>
         <plugins>
+            <!-- 统一 revision 版本 -->
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>flatten-maven-plugin</artifactId>
+                <version>${flatten-maven-plugin.version}</version>
+                <configuration>
+                    <flattenMode>resolveCiFriendliesOnly</flattenMode>
+                    <updatePomFile>true</updatePomFile>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>flatten</goal>
+                        </goals>
+                        <id>flatten</id>
+                        <phase>process-resources</phase>
+                    </execution>
+                    <execution>
+                        <goals>
+                            <goal>clean</goal>
+                        </goals>
+                        <id>flatten.clean</id>
+                        <phase>clean</phase>
+                    </execution>
+                </executions>
+            </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-clean-plugin</artifactId>

+ 9 - 1
sckw-auth/pom.xml

@@ -10,7 +10,7 @@
     </parent>
 
     <artifactId>sckw-auth</artifactId>
-    <version>1.0.0</version>
+    <version>1.1.0</version>
     <description>登录认证中心</description>
 
     <properties>
@@ -18,6 +18,7 @@
         <maven.compiler.target>17</maven.compiler.target>
         <maven.compiler.compilerVersion>17</maven.compiler.compilerVersion>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <basic.version>1.0.0</basic.version>
     </properties>
 
 
@@ -26,36 +27,43 @@
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-startup</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-core</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-remote</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-redis</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-system-api</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-message-api</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-fleet-api</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
     </dependencies>

+ 13 - 82
sckw-auth/src/main/java/com/sckw/auth/controller/AuthController.java

@@ -2,15 +2,10 @@ package com.sckw.auth.controller;
 
 import com.sckw.auth.model.vo.req.*;
 import com.sckw.auth.service.IAuthService;
-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.servlet.http.HttpServletRequest;
 import jakarta.validation.Valid;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -27,51 +22,6 @@ 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
@@ -80,44 +30,25 @@ public class AuthController {
      * @date: 2023/6/16
      */
     @PostMapping("/login")
-    public HttpResult login(@Valid @RequestBody LoginReqVo reqVo,
-                            @RequestHeader(name = "Client-Type", required = true) String clientType,
-                            @RequestHeader(name = "System-Type", required = true) int systemType) {
+    public HttpResult login(@Valid @RequestBody LoginReqVo reqVo, HttpServletRequest request) {
+        int systemType = request.getIntHeader("System-Type");
+        String clientType = request.getHeader("Client-Type");
+        String accessSpecial = request.getHeader("Access-Special");
+
         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);
-
+        loginBase.setAccessSpecial(accessSpecial);
         loginBase.setLoginMethod(LoginMethodEnum.ORDINARY.getValue());
-        if (StringUtils.isNotBlank(loginBase.getCaptcha())) {
-            loginBase.setLoginMethod(LoginMethodEnum.SMS.getValue());
-        }
-
-        /**参数校验**/
-        HttpResult result = checkParams(loginBase);
-        if (result.getCode() != HttpStatus.SUCCESS_CODE) {
-            return result;
-        }
-
-        /**运营端/企业端登录(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);
+        return authService.login(loginBase);
     }
 
-
     /**
      * @return HttpResult
      * @desc: 根据token获取登录信息
@@ -125,15 +56,15 @@ public class AuthController {
      * @date: 2023/9/27
      */
     @PostMapping("getLoginResByToken")
-    public HttpResult getLoginResByToken(@RequestHeader(name = "Client-Type", required = true) String clientType,
-                                         @RequestHeader(name = "Access-Token", required = true) String token) {
+    public HttpResult getLoginResByToken(HttpServletRequest request) {
+        String clientType = request.getHeader("Client-Type");
+        String token = request.getHeader("Access-Token");
         return HttpResult.ok(authService.getLoginResByToken(clientType, token));
     }
 
-
     /**
      * @param id 主键ID
-     * @description 重置密码
+     * @desc 重置密码
      * @author zk
      * @date 2023/06/02
      **/

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

@@ -35,6 +35,11 @@ public class LoginBase {
      */
     private String clientType;
 
+    /**
+     * 专场标识
+     */
+    private String accessSpecial;
+
     /**
      * 登录方式1 账号密码登录/2账号短信登录/3单账号登录
      */

+ 10 - 24
sckw-auth/src/main/java/com/sckw/auth/service/IAuthService.java

@@ -1,22 +1,24 @@
 package com.sckw.auth.service;
 
 import com.sckw.auth.model.vo.req.*;
-import com.sckw.auth.model.vo.res.LoginResVo;
 import com.sckw.auth.model.vo.res.LoginResVo1;
-import com.sckw.core.exception.SystemException;
 import com.sckw.core.web.response.HttpResult;
 
 /**
- *
+ * @desc: 登录
+ * @author: czh
+ * @date: 2023/6/19
  */
 public interface IAuthService {
 
     /**
-     * 登录
-     * @param reqVo
-     * @return
-     */
-    LoginResVo login(LoginReqVo reqVo) throws SystemException;
+     * @param loginBase {}
+     * @desc 登陆
+     * @author zk
+     * @date 2023/7/26
+     **/
+    HttpResult login(LoginBase loginBase);
+
 
     /**
      * @param reqVo 注册入参
@@ -42,22 +44,6 @@ public interface IAuthService {
      */
     void resetPassword(Long id);
 
-    /**
-     * 司机端登录
-     * @param loginBase
-     * @return
-     */
-    HttpResult driverAuth(LoginBase loginBase);
-
-    /**
-     * @param loginBase {}
-     * @desc 运营/企业账号登陆
-     * @author zk
-     * @date 2023/7/26
-     **/
-    HttpResult commonAuth(LoginBase loginBase);
-
-
     /**
      * @return LoginResVo1
      * @desc: 根据token获取登录信息

+ 235 - 295
sckw-auth/src/main/java/com/sckw/auth/service/impl/AuthServiceImpl.java

@@ -1,42 +1,43 @@
 package com.sckw.auth.service.impl;
 
-import cn.hutool.core.date.DateUtil;
 import com.alibaba.fastjson.JSON;
-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.req.ForgetPasswordReqVo;
+import com.sckw.auth.model.vo.req.LoginBase;
+import com.sckw.auth.model.vo.req.RegisterReqVo;
 import com.sckw.auth.model.vo.res.LoginResVo;
 import com.sckw.auth.model.vo.res.LoginResVo1;
+import com.sckw.auth.service.IAuthService;
 import com.sckw.auth.util.AsyncFactory;
 import com.sckw.core.common.enums.enums.DictEnum;
+import com.sckw.core.exception.SystemException;
+import com.sckw.core.model.constant.Global;
+import com.sckw.core.model.constant.NumberConstant;
 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.*;
+import com.sckw.core.web.constant.HttpStatus;
 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.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.web.constant.HttpStatus;
 import com.sckw.redis.utils.RedissonUtils;
-import com.sckw.system.api.model.dto.res.*;
-import com.sckw.auth.service.IAuthService;
+import com.sckw.system.api.RemoteSystemService;
 import com.sckw.system.api.RemoteUserService;
+import com.sckw.system.api.model.dto.req.ForgetPasswordReqDto;
+import com.sckw.system.api.model.dto.req.RegisterReqDto;
+import com.sckw.system.api.model.dto.req.UserLoginReqDto;
+import com.sckw.system.api.model.dto.res.*;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.config.annotation.DubboReference;
+import org.redisson.api.RSet;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * @desc: 用户权限实现类
@@ -57,119 +58,29 @@ public class AuthServiceImpl implements IAuthService {
     private RemoteFleetService fleetService;
 
     @Override
-    public LoginResVo login(LoginReqVo reqDto) {
-//        /*1、根据账号密码或者手机号校验码登录, 手机号后面处理*/
-//        KwsUserResDto kwsUser = checkLogin(reqDto);
-//        LoginResVo loginResVo = new LoginResVo();
-//        loginResVo.setClientType(reqDto.getClientType());
-//        BeanUtils.copyProperties(kwsUser, loginResVo);
-//
-//        //平台管理员直接过了
-//        if (kwsUser.getIsMain() == Global.YES && kwsUser.getSystemType().equals(SystemTypeEnum.MANAGE.getCode())) {
-//            afterProcessor(loginResVo);
-//            return loginResVo;
-//        }
-//        /*2、登录成功,查询角色信息*/
-//        Long userId = kwsUser.getId();
-//        List<KwsRoleResDto> kwsRoleResDtos = remoteUserService.queryRoleInfoByUserId(userId);
-//        loginResVo.setRoleInfo(kwsRoleResDtos);
-//
-//
-//        /*3、查询用户机构*/
-//        List<KwsUserDeptResDto> kwsUserDeptResDtos = remoteUserService.queryUserDeptByUserId(userId);
-//        if (CollectionUtils.isEmpty(kwsUserDeptResDtos)) {
-//            throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.USER_DEPT_NOT_EXISTS);
-//        }
-//
-//        List<Long> deptIds = kwsUserDeptResDtos.stream().map(KwsUserDeptResDto::getDeptId).toList();
-//        List<KwsDeptResDto> kwsDepts = remoteUserService.queryDeptByIds(deptIds);
-//        if (CollectionUtils.isEmpty(kwsDepts)) {
-//            //数据不全,直接返回
-//            afterProcessor(loginResVo);
-//            return loginResVo;
-//        }
-//
-//        /*3、查企业*/
-//        //目前一个人只能归属于一个企业,所以这里取第一个就行
-//        Long entId = kwsDepts.get(0).getEntId();
-//        KwsEnterpriseResDto kwsEnterpriseResDto = remoteUserService.queryEnterpriseById(entId);
-//        if (Objects.isNull(kwsEnterpriseResDto)) {
-//            //只要查出了机构,这个if其实不会进的,做保险起见还是加上判空
-//            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、查资质*/
-//        List<EntCertificateResDto> entCertificateResDtoList = remoteUserService.queryCertificateByEntId(entId);
-//        entInfoResVo.setCertificateInfo(entCertificateResDtoList);
-//
-//        //企业资质有效性判断  1、当前资质没过期,且状态是已认证  2、只要有认证过一次就算有效  参数判断
-//        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);
-//            }
-//        } else {
-//            List<EntCheckTrackResDto> entCheckTrackResDtoList = remoteUserService.checkTrackByEntId(entId);
-//            if (CollectionUtils.isEmpty(entCheckTrackResDtoList)) {
-//                entInfoResVo.setValid(false);
-//                afterProcessor(loginResVo);
-//                return loginResVo;
-//            }
-//            entInfoResVo.setValid(entCheckTrackResDtoList.stream().anyMatch(item -> item.getStatus() == Global.NO));
-//        }
-//
-//        /*5、生成token,一些信息存redis*/
-//        afterProcessor(loginResVo);
-//        return loginResVo;
-        return null;
-    }
+    public HttpResult login(LoginBase loginBase) {
+        if (StringUtils.isNotBlank(loginBase.getCaptcha())) {
+            loginBase.setLoginMethod(LoginMethodEnum.SMS.getValue());
+        }
 
-    private KwsUserResDto checkLogin(LoginReqVo reqDto) {
-        List<KwsUserResDto> kwsUsers = remoteUserService.checkUserBase(reqDto.getAccount(), reqDto.getSystemType());
-        KwsUserResDto kwsUser = kwsUsers.get(0);
-        //密码校验、验证码
-        if (StringUtils.isNotBlank(reqDto.getPassword())) {
-            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);
-        }
-        return kwsUser;
-    }
+        /*参数校验*/
+        HttpResult result = checkParams(loginBase);
+        if (result.getCode() != HttpStatus.SUCCESS_CODE) {
+            return result;
+        }
 
-    /**
-     * @param loginResVo 登录的返参
-     * @desc: 生成token,存redis
-     * @author: czh
-     * @date: 2023/6/12
-     */
-    private void afterProcessor(LoginResVo loginResVo) {
-        try {
-            //设置token
-            loginResVo.setToken(EncryUtil.encry(Global.PRI_KEY, String.valueOf(loginResVo.getId())));
+        /*运营端/企业端登录(PC/APP)*/
+        if (loginBase.getSystemType() == SystemTypeEnum.MANAGE.getCode()
+                || loginBase.getSystemType() == SystemTypeEnum.COMPANY.getCode()) {
+            return this.commonAuth(loginBase);
+        }
 
-            //异步存redis
-            AsyncFactory.execute(new AsyncProcess(loginResVo, remoteUserService));
-        } catch (Exception e) {
-            throw new SystemException(HttpStatus.GLOBAL_EXCEPTION_CODE, HttpStatus.GLOBAL_EXCEPTION_MESSAGE);
+        /*司机端*/
+        if (loginBase.getSystemType() == SystemTypeEnum.DRIVER.getCode()) {
+            return this.driverAuth(loginBase);
         }
+
+        return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, HttpStatus.GLOBAL_EXCEPTION_MESSAGE);
     }
 
     @Override
@@ -187,7 +98,6 @@ public class AuthServiceImpl implements IAuthService {
         RedissonUtils.delete(key);
     }
 
-
     @Override
     public void forgetPassword(ForgetPasswordReqVo reqDto) {
         ForgetPasswordReqDto forgetPasswordReqDto = new ForgetPasswordReqDto();
@@ -200,179 +110,40 @@ public class AuthServiceImpl implements IAuthService {
         remoteUserService.resetPassword(id);
     }
 
-    static class AsyncProcess implements Runnable {
-
-        private final LoginResVo loginResVo;
-
-        private final RemoteUserService remoteUserService;
-
-        public AsyncProcess(LoginResVo loginResVo, RemoteUserService remoteUserService) {
-            this.loginResVo = loginResVo;
-            this.remoteUserService = remoteUserService;
-        }
-
-        @Override
-        public void run() {
-            //存基础信息
-            saveBaseToCache(loginResVo);
-
-            //存菜单权限
-            saveToCache(loginResVo);
-
-            //存登录记录信息
-            saveLoginInfo(loginResVo);
-        }
-
-
-        /**
-         * @param loginResVo 返参
-         * @desc: 存基础信息
-         * @author: czh
-         * @date: 2023/6/28
-         */
-        private void saveBaseToCache(LoginResVo loginResVo) {
-            //存用户登录信息
-            saveUserLoginInfo();
-
-            EntInfoResVo entInfo = loginResVo.getEntInfo();
-            if (Objects.isNull(entInfo)) {
-                return;
-            }
-            //单独存用户企业
-//            RedissonUtils.putString(Global.getFullUserEntKey(loginResVo.getSystemType(), loginResVo.getId()), JSON.toJSONString(entInfo), Global.PC_TOKEN_EXPIRE);
-
-            //存企业信息
-            saveEntLoginInfo(entInfo);
-        }
-
-        /**
-         * @param entInfo 企业信息
-         * @desc: 存企业信息
-         * @author: czh
-         * @date: 2023/7/3
-         */
-        private void saveEntLoginInfo(EntInfoResVo entInfo) {
-            LoginEntInfo loginEntInfo = new LoginEntInfo();
-            BeanUtils.copyProperties(entInfo, loginEntInfo);
-            loginEntInfo.setCertificateInfo(BeanUtils.copyToList(entInfo.getCertificateInfo(), EntCertificateInfo.class));
-            RedissonUtils.putString(Global.REDIS_ENTERPRISE_PREFIX + entInfo.getId(), JSON.toJSONString(loginEntInfo), Global.PC_TOKEN_EXPIRE);
-        }
-
-        /**
-         * @desc: 存用户登录信息
-         * @author: czh
-         * @date: 2023/6/29
-         */
-        private void saveUserLoginInfo() {
-            //存用户登录信息
-            LoginUserInfo loginUserInfo = new LoginUserInfo();
-            loginUserInfo.setId(loginResVo.getId());
-            loginUserInfo.setSystemType(loginResVo.getSystemType());
-            loginUserInfo.setAccount(loginResVo.getAccount());
-            loginUserInfo.setUserName(loginResVo.getName());
-            loginUserInfo.setPhone(loginResVo.getPhone());
-            loginUserInfo.setIsMain(loginResVo.getIsMain());
-            loginUserInfo.setStatus(loginResVo.getStatus());
-            loginUserInfo.setClientType(loginResVo.getClientType());
-            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()));
-                }
-            }
-            RedissonUtils.putString(Global.getFullUserLoginKey(loginResVo.getSystemType(), loginResVo.getId(), loginResVo.getClientType()), JSON.toJSONString(loginUserInfo), Global.PC_TOKEN_EXPIRE);
-
-        }
-
-        /**
-         * @param loginResVo 登录返参
-         * @desc: 存缓存
-         * @author: czh
-         * @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())) {
+        boolean bool = PasswordUtils.validatePassword(loginBase.getAccount() + loginBase.getPassword(), driver.getPassword(), driver.getSalt());
+        if (loginBase.getLoginMethod() == LoginMethodEnum.ORDINARY.getValue() && !bool) {
             return HttpResult.error(HttpStatus.CODE_10301, "密码不正确,请检查并重新输入!");
         }
         if (driver.getStatus() == Global.YES) {
             return HttpResult.error(HttpStatus.CODE_10301, "您的账号已冻结,如需帮助,请致电平台客服!");
         }
+
         //企业信息
         EntCacheResDto enterprise = systemService.queryEntDetails(driver.getEntId());
 
-        /**生成token**/
+        /*生成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));
+        /*缓存信息**/
+        AsyncFactory.execute(new AsyncProcess(loginBase, null, driver, enterprise, remoteUserService));
 
-        /**数据组装**/
+        /*数据组装**/
         LoginResVo1 loginRes = new LoginResVo1();
         loginRes.setId(driver.getId());
         loginRes.setName(driver.getName());
@@ -395,17 +166,16 @@ public class AuthServiceImpl implements IAuthService {
      * @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())) {
+        boolean bool = PasswordUtils.validatePassword(loginBase.getAccount() + loginBase.getPassword(), user.getPassword(), user.getSalt());
+        if (loginBase.getLoginMethod() == LoginMethodEnum.ORDINARY.getValue() && !bool) {
             return HttpResult.error(HttpStatus.CODE_10301, "密码不正确,请检查并重新输入!");
         }
 
@@ -423,23 +193,32 @@ public class AuthServiceImpl implements IAuthService {
 
         //企业信息
         EntCacheResDto enterprise = systemService.queryEntDetails(user.getEntId());
-        if (loginBase.getSystemType() == SystemTypeEnum.COMPANY.getCode() && enterprise == null) {
-            return HttpResult.error(HttpStatus.QUERY_FAIL_CODE, "账号没有归属企业,请检查并重新输入!");
+        if (loginBase.getSystemType() == SystemTypeEnum.COMPANY.getCode()) {
+            if (enterprise == null) {
+                return HttpResult.error(HttpStatus.QUERY_FAIL_CODE, "账号没有归属企业,请检查并重新输入!");
+            }
+
+            //校验平台标识码(专场)
+            HttpResult result = checkSpecial(loginBase, enterprise);
+            if (result.getCode() != HttpStatus.SUCCESS_CODE) {
+                return result;
+            }
         }
         if (enterprise != null && enterprise.getStatus() == Global.YES) {
             return HttpResult.error(HttpStatus.QUERY_FAIL_CODE, "企业已冻结,如需帮助,请致电平台客服!");
         }
 
-        /**生成token**/
+
+        /*生成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));
+        /*缓存信息**/
+        AsyncFactory.execute(new AsyncProcess(loginBase, user, null, enterprise, remoteUserService));
 
-        /**数据组装**/
+        /*数据组装**/
         LoginResVo1 loginRes = new LoginResVo1();
         loginRes.setId(user.getId());
         loginRes.setName(user.getName());
@@ -470,6 +249,124 @@ public class AuthServiceImpl implements IAuthService {
         return HttpResult.ok(loginRes);
     }
 
+    /**
+     * @param params 登录参数
+     * @return 返回结构
+     * @desc 登录参数校验
+     * @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.getAccessSpecial()) && params.getSystemType() != SystemTypeEnum.MANAGE.getCode()) {
+            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 loginBase 登录参数
+     * @param enterprise 企业信息
+     * @return 返回校验结果
+     * @desc 专场标识码校验
+     * @author zk
+     * @date 2023/12/14
+     **/
+    public HttpResult checkSpecial(LoginBase loginBase, EntCacheResDto enterprise) {
+        /*校验*/
+        //运营端不做校验
+        if (loginBase.getSystemType() == SystemTypeEnum.MANAGE.getCode()) {
+            return HttpResult.ok();
+        }
+        //平台专场集
+        List<SpecialResVo> specialResVos = systemService.querySpecial();
+        //企业所属专场
+        String special = enterprise != null ? enterprise.getSpecial() : null;
+        //用户当前使用平台
+        String accessSpecial = loginBase.getAccessSpecial();
+        //校验是否存在专场数据
+        if (CollectionUtils.isEmpty(specialResVos)) {
+            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "系统平台标识码缺失,请联系平台系统管理员确认!");
+        }
+
+        //校验Hearder中标识码是否属于系统平台标识码
+        boolean bool = false;
+        SpecialResVo currentSpecialRes = null;
+        SpecialResVo mainSpecialRes = null;
+        for (SpecialResVo specialResVo:specialResVos) {
+            bool = specialResVo.getCode().equals(accessSpecial) || bool;
+            currentSpecialRes = specialResVo.getCode().equals(accessSpecial) ? specialResVo : currentSpecialRes;
+            mainSpecialRes = specialResVo.getIsMain() == NumberConstant.ONE ? specialResVo : mainSpecialRes;
+        }
+        if (!bool) {
+            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "系统平台标识码不正确,请联系平台系统管理员确认!");
+        }
+
+        //校验专场状态
+        if (currentSpecialRes != null && currentSpecialRes.getStatus() == Global.YES) {
+            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "您当前使用的平台暂停使用,如有疑问请联系平台系统管理员确认!");
+        }
+
+        //司机端可以登陆所有平台,只对任务数据做隔离
+        if (loginBase.getSystemType() == SystemTypeEnum.DRIVER.getCode()) {
+            return HttpResult.ok();
+        }
+
+        //校验企业非专场时,Hearder中标识码是否为主平台标识码
+        if (StringUtils.isBlank(special) ) {
+            if (currentSpecialRes != null && currentSpecialRes.getIsMain() != NumberConstant.ONE) {
+                String msg = "请进入"+ mainSpecialRes.getName() +",平台网站为"+ mainSpecialRes.getWebsite() +",如有疑问请联系平台系统管理员确认!";
+                return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, msg);
+            }
+        } else {
+            List<String> specials = Arrays.asList(special.split(Global.COMMA));
+            if (!specials.contains(accessSpecial)) {
+                StringBuilder msg = new StringBuilder();
+//                msg.append("请进入");
+                for (String e : specials) {
+                    specialResVos.stream().filter(ee -> {
+                        return e.equals(ee.getCode());
+                    }).map(ee -> "请进入" + ee.getName() + ",平台网站为" + ee.getWebsite() + ",").forEach(msg::append);
+                }
+                msg.append("如有疑问请联系平台系统管理员确认!");
+                return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, msg.toString());
+            }
+
+        }
+        return HttpResult.ok();
+    }
 
     /**
      * @return LoginResVo1
@@ -515,26 +412,32 @@ public class AuthServiceImpl implements IAuthService {
 
     /**
      * @param loginBase {}
-     * @param userId 用户ID
+     * @param userId    用户ID
      * @desc 生成token
      * @author zk
      * @date 2023/8/18
      **/
     private String generateToken(LoginBase loginBase, Long userId) {
+        String account = loginBase.getAccount();
+        String clientType = loginBase.getClientType();
+        Integer systemType = loginBase.getSystemType();
+        String special = loginBase.getAccessSpecial();
+        Long timestamp = System.currentTimeMillis();
         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);
+        info.put("account", account);
+        info.put("clientType", clientType);
+        info.put("systemType", systemType);
+        info.put("special", special);
+        //info.put("timestamp", timestamp);
+        String key = Global.getFullUserTokenKey(clientType, !systemType.equals(SystemTypeEnum.MANAGE.getCode()) ? special : null, 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 {
+    static class AsyncProcess implements Runnable {
         private final LoginBase loginBase;
 
         private final KwsUserResDto user;
@@ -545,7 +448,7 @@ public class AuthServiceImpl implements IAuthService {
 
         private final RemoteUserService remoteUserService;
 
-        public AsyncProcess1(LoginBase loginBase, KwsUserResDto user, RDriverDetailVo driver, EntCacheResDto enterprise ,
+        public AsyncProcess(LoginBase loginBase, KwsUserResDto user, RDriverDetailVo driver, EntCacheResDto enterprise,
                              RemoteUserService remoteUserService) {
             this.loginBase = loginBase;
             this.user = user;
@@ -582,7 +485,7 @@ public class AuthServiceImpl implements IAuthService {
 
         /**
          * @param loginBase 登录信息
-         * @param driver 司机信息
+         * @param driver    司机信息
          * @desc: 缓存司机信息
          * @author: czh
          * @date: 2023/7/3
@@ -609,7 +512,7 @@ public class AuthServiceImpl implements IAuthService {
 
         /**
          * @param loginBase 登录信息
-         * @param user 用户信息
+         * @param user      用户信息
          * @desc: 缓存用户信息
          * @author: czh
          * @date: 2023/7/3
@@ -640,7 +543,8 @@ public class AuthServiceImpl implements IAuthService {
                     loginUserInfo.setAuthUserIdList(entUser.stream().map(FindEntUserResDto::getUserId).distinct().toList());
                 }
             }
-
+            //客户经理  存储相关联企业id
+            customerManager(loginUserInfo, user, loginBase);
             int expireTime = ClientTypeEnum.expireTime(loginBase.getClientType());
             String key = Global.getFullUserLoginKey(loginUserInfo.getSystemType(), loginUserInfo.getId());
             RedissonUtils.putString(key, JSON.toJSONString(loginUserInfo), Global.APP_TOKEN_EXPIRE);
@@ -649,6 +553,43 @@ public class AuthServiceImpl implements IAuthService {
             saveMenusToCache(user);
         }
 
+        private void customerManager(LoginUserInfo loginUserInfo, KwsUserResDto user, LoginBase loginBase) {
+            if (SystemTypeEnum.MANAGE.getCode().equals(loginBase.getSystemType())) {
+                List<Long> enterpriseIds = new ArrayList<>();
+                if (user.getIsMain().equals(Global.YES)) {
+                    //获取所有企业id
+                    List<Long> enterpriseIdList = remoteUserService.findAllEnterprise();
+                    if (Objects.nonNull(enterpriseIdList) && enterpriseIdList.size() > 0) {
+                        enterpriseIds.addAll(enterpriseIdList);
+                    }
+                    //获取所有运营端账号关联的企业(客户经理关联的企业)
+                    List<Long> userIds = remoteUserService.selectUserBySystemType(SystemTypeEnum.MANAGE.getCode());
+                    /**带有数据权限*/
+                    List<Long> enterpriseListByIds = remoteUserService.findEnterpriseListByIds(userIds);
+                    if (Objects.nonNull(enterpriseListByIds) && enterpriseListByIds.size() > 0) {
+                        enterpriseIds.addAll(enterpriseListByIds);
+                    }
+                    //无数据权限,运营账号(客户经理关联)关联的企业即可
+//                    enterpriseIds = remoteUserService.findEnterpriseListByUserIds(userIds);
+                } else {
+                    List<Long> serviceEnterpriseIds = remoteUserService.findEnterpriseIds(user.getId());
+                    if (Objects.nonNull(serviceEnterpriseIds) && serviceEnterpriseIds.size() > 0) {
+                        enterpriseIds.addAll(serviceEnterpriseIds);
+                    }
+                }
+                if (enterpriseIds.size() > 0) {
+                    enterpriseIds = enterpriseIds.stream().distinct().collect(Collectors.toList());
+                    String key = Global.getCustomerManagerUserLoginKey(loginUserInfo.getSystemType(), loginUserInfo.getId());
+                    RSet<Object> set = RedissonUtils.getSet(key);
+                    if (CollectionUtils.isNotEmpty(set)){
+                        RedissonUtils.delete(key);
+                    }
+                    RedissonUtils.putSet(key, enterpriseIds);
+                    loginUserInfo.setAuthEntIdList(enterpriseIds);
+                }
+            }
+        }
+
         /**
          * @param loginResVo 登录返参
          * @desc: 存缓存请求地址
@@ -697,6 +638,5 @@ public class AuthServiceImpl implements IAuthService {
             userLoginReqDto.setSource(loginResVo.getClientType());
             remoteUserService.saveUserLogin(userLoginReqDto);
         }
-
     }
 }

+ 2 - 2
sckw-auth/src/main/resources/bootstrap-dev.yml

@@ -5,7 +5,7 @@ spring:
         # 服务注册地址
         server-addr: 10.10.10.230:8848
         # 命名空间
-        namespace: sckw_zk
+        namespace: sckw-service-platform-dev
         # 共享配置
         group: sckw-service-platform
       config:
@@ -14,7 +14,7 @@ spring:
         # 配置文件格式
         file-extension: yaml
         # 命名空间
-        namespace: sckw_zk
+        namespace: sckw-service-platform-dev
         # 共享配置
         group: sckw-service-platform
         #可以读多个配置文件  需要在同一个命名空间下面可以是不同的组

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

@@ -2,14 +2,14 @@ spring:
   cloud:
     nacos:
       discovery:
-      # 服务注册地址
+        # 服务注册地址
         server-addr: @nacos.server@
         # 命名空间
         namespace: @nacos.namespace@
         # 共享配置
         group: sckw-service-platform
       config:
-      # 配置中心地址
+        # 配置中心地址
         server-addr: @nacos.server@
         # 命名空间
         namespace: @nacos.namespace@

+ 12 - 11
sckw-common/sckw-common-bom/pom.xml

@@ -12,6 +12,7 @@
     <properties>
         <maven.compiler.source>17</maven.compiler.source>
         <maven.compiler.target>17</maven.compiler.target>
+        <project.basic.version>1.0.0</project.basic.version>
     </properties>
     <dependencyManagement>
         <dependencies>
@@ -19,67 +20,67 @@
             <dependency>
                 <groupId>com.sckw</groupId>
                 <artifactId>sckw-common-startup</artifactId>
-                <version>${project.version}</version>
+                <version>${project.basic.version}</version>
             </dependency>
 
             <dependency>
                 <groupId>com.sckw</groupId>
                 <artifactId>sckw-common-core</artifactId>
-                <version>${project.version}</version>
+                <version>${project.basic.version}</version>
             </dependency>
 
             <dependency>
                 <groupId>com.sckw</groupId>
                 <artifactId>sckw-common-mongo</artifactId>
-                <version>${project.version}</version>
+                <version>${project.basic.version}</version>
             </dependency>
 
             <dependency>
                 <groupId>com.sckw</groupId>
                 <artifactId>sckw-common-xxljob</artifactId>
-                <version>${project.version}</version>
+                <version>${project.basic.version}</version>
             </dependency>
 
             <dependency>
                 <groupId>com.sckw</groupId>
                 <artifactId>sckw-common-stream</artifactId>
-                <version>${project.version}</version>
+                <version>${project.basic.version}</version>
             </dependency>
 
             <dependency>
                 <groupId>com.sckw</groupId>
                 <artifactId>sckw-common-remote</artifactId>
-                <version>${project.version}</version>
+                <version>${project.basic.version}</version>
             </dependency>
 
             <dependency>
                 <groupId>com.sckw</groupId>
                 <artifactId>sckw-common-redis</artifactId>
-                <version>${project.version}</version>
+                <version>${project.basic.version}</version>
             </dependency>
 
             <dependency>
                 <groupId>com.sckw</groupId>
                 <artifactId>sckw-common-excel</artifactId>
-                <version>${project.version}</version>
+                <version>${project.basic.version}</version>
             </dependency>
 
             <dependency>
                 <groupId>com.sckw</groupId>
                 <artifactId>sckw-common-datasource</artifactId>
-                <version>${project.version}</version>
+                <version>${project.basic.version}</version>
             </dependency>
 
             <dependency>
                 <groupId>com.sckw</groupId>
                 <artifactId>sckw-common-sentinel</artifactId>
-                <version>${project.version}</version>
+                <version>${project.basic.version}</version>
             </dependency>
 
             <dependency>
                 <groupId>com.sckw</groupId>
                 <artifactId>sckw-common-seata</artifactId>
-                <version>${project.version}</version>
+                <version>${project.basic.version}</version>
             </dependency>
         </dependencies>
     </dependencyManagement>

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

@@ -62,6 +62,7 @@ public enum DictEnum {
     SETTLEMENT_CYCLE_0("settlement_cycle", "0", "周结"),
     SETTLEMENT_CYCLE_1("settlement_cycle", "1", "月结"),
     SETTLEMENT_CYCLE_2("settlement_cycle", "2", "季结"),
+    SETTLEMENT_CYCLE_3("settlement_cycle", "3", "日结"),
     SIGNING_TYPE_1("signing_type", "1", "线上签约"),
     SIGNING_TYPE_2("signing_type", "2", "线下签约"),
     TORDER_ADDRESS_TYPE_1("tOrder_address_type", "1", "装货地址"),

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

@@ -16,8 +16,10 @@ public enum DictTypeEnum {
     SEND_SMS_TYPE("send_sms_type", "发送短信类型"),
     INTEGRAL_TYPE("integral_type", "积分类型"),
     UNIT_TYPE("unit_type", "商品单位类型"),
+    UNIT_LOSS_TYPE("unit_loss_type", "货物单位与合理损耗单位"),
     TAX_RATE("tax_rate", "商品税率"),
     PRICE_TYPE("price_type", "运价方式"),
+    MONETARY_UNIT("monetary_unit", "货币单位"),
     TRADE_TYPE("trade_type", "支付方式"),
     PICKUP_TYPE("pickup_type", "提货方式"),
     DELIVERY_TYPE("delivery_type", "交付类型"),

+ 68 - 15
sckw-common/sckw-common-core/src/main/java/com/sckw/core/filter/RequestCheckFilter.java

@@ -1,9 +1,11 @@
 package com.sckw.core.filter;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson2.JSONObject;
 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.CollectionUtils;
 import com.sckw.core.utils.EncryUtil;
 import com.sckw.core.utils.NumberUtils;
 import com.sckw.core.utils.StringUtils;
@@ -21,6 +23,7 @@ import jakarta.annotation.PostConstruct;
 import jakarta.servlet.*;
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
+import org.redisson.api.RSet;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import java.io.IOException;
@@ -41,6 +44,11 @@ public class RequestCheckFilter implements Filter {
      */
     private static final List<String> EXCLUDEPATH = new ArrayList<>();
 
+    /**
+     * 直接放行不需要校验token的请求
+     */
+    private static final List<String> IMPORT_PASS_PATH = new ArrayList<>();
+
     /**
      * 需要校验token但不用接口权限校验的请求
      */
@@ -58,6 +66,11 @@ public class RequestCheckFilter implements Filter {
         if (StringUtils.isNotBlank(links)) {
             EXCLUDEPATH.addAll(Arrays.asList(links.split(Global.COMMA)));
         }
+
+        String importLinks = customConfig.getSpecialLinks();
+        if (StringUtils.isNotBlank(importLinks)) {
+            IMPORT_PASS_PATH.addAll(Arrays.asList(links.split(Global.COMMA)));
+        }
 //        String withoutLinks = customConfig.getWithoutLinks();
 //        if (StringUtils.isNotBlank(withoutLinks)) {
 //            WITHOUTPATH.addAll(Arrays.asList(withoutLinks.split(Global.COMMA)));
@@ -71,7 +84,8 @@ public class RequestCheckFilter implements Filter {
         HttpServletResponse response = (HttpServletResponse) servletResponse;
         String token = request.getHeader(RequestConstant.TOKEN);
         String clientType = request.getHeader(RequestConstant.CLIENT_TYPE);
-        String systemType = request.getHeader(RequestConstant.SYSTEM_TYPE);
+        Integer systemType = request.getIntHeader(RequestConstant.SYSTEM_TYPE);
+        String accessSpecial = request.getHeader(RequestConstant.ACCESS_SPECIAL);
         String requestUri = request.getRequestURI();
 
         /*1、非token校验接口放行*/
@@ -82,8 +96,9 @@ public class RequestCheckFilter implements Filter {
 
         /*2、校验token**/
         /*2.1、校验token非空*/
-        if (StringUtils.isBlank(token)) {
-            ResponseUtil.writer(response, HttpResult.error(HttpStatus.TOKEN_INVALID_CODE, HttpStatus.UN_LOGIN_MESSAGE));
+        HttpResult result = checkBlank(token, clientType, systemType, accessSpecial, requestUri);
+        if (result.getCode() != HttpStatus.SUCCESS_CODE) {
+            ResponseUtil.writer(response, result);
             return;
         }
 
@@ -96,7 +111,8 @@ public class RequestCheckFilter implements Filter {
 
         /*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));
+        String key = Global.getFullUserTokenKey(clientType, accessSpecial, userId);
+        String redisUserToken = RedissonUtils.getString(key);
         if (StringUtils.isBlank(redisUserToken)) {
             ResponseUtil.writer(response, HttpResult.error(HttpStatus.TOKEN_INVALID_CODE, HttpStatus.TOKEN_INVALID_MESSAGE));
             return;
@@ -109,7 +125,7 @@ public class RequestCheckFilter implements Filter {
         }
 
         /*3、校验登录用户信息*/
-        String key = Global.getFullUserLoginKey(NumberUtils.parseInt(systemType), userId);
+        key = Global.getFullUserLoginKey(systemType, userId);
         String userInfoStr = RedissonUtils.getString(key);
         LoginUserInfo loginUserInfo = StringUtils.isNotBlank(userInfoStr) ? JSON.parseObject(userInfoStr, LoginUserInfo.class) : null;
         if (Objects.isNull(loginUserInfo)) {
@@ -127,19 +143,27 @@ public class RequestCheckFilter implements Filter {
         /*4、登录中的企业信息*/
         String loginEntStr = RedissonUtils.getString(Global.getFullUserEntKey(loginUserInfo.getEntId()));
         LoginEntInfo loginEntInfo = StringUtils.isNotBlank(loginEntStr) ? JSON.parseObject(loginEntStr, LoginEntInfo.class) : null;
-
-        if (SystemTypeEnum.MANAGE.getCode().equals(Integer.parseInt(systemType))) {
+        if (SystemTypeEnum.MANAGE.getCode().equals(systemType)) {
+            //redis 获取客户经理绑定企业ID
+            String managerKey = Global.getCustomerManagerUserLoginKey(SystemTypeEnum.MANAGE.getCode(), loginUserInfo.getId());
+            RSet<Object> set = RedissonUtils.getSet(managerKey);
+            if (Objects.nonNull(set)) {
+                List authUserIdList = JSONObject.parseObject(set.toString(), List.class);
+                if (CollectionUtils.isNotEmpty(authUserIdList)) {
+                    loginUserInfo.setAuthEntIdList(authUserIdList);
+                }
+            }
             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.getFullUserTokenKey(clientType, accessSpecial, userId), token, ClientTypeEnum.expireTime(clientType));
+            RedissonUtils.putString(Global.getFullUserLoginKey(systemType, loginUserInfo.getId()), JSON.toJSONString(loginUserInfo), Global.APP_TOKEN_EXPIRE);
             RedissonUtils.putString(Global.getFullUserEntKey(loginEntInfo.getId()), JSON.toJSONString(loginEntInfo), Global.APP_TOKEN_EXPIRE);
             filterChain.doFilter(servletRequest, servletResponse);
             LoginUserHolder.remove();
             return;
         }
 
-        if ((StringUtils.isBlank(loginEntStr) || loginEntInfo == null) && NumberUtils.parseInt(systemType) != SystemTypeEnum.MANAGE.getCode()) {
+        if ((StringUtils.isBlank(loginEntStr) || loginEntInfo == null) && !Objects.equals(systemType, SystemTypeEnum.MANAGE.getCode())) {
             ResponseUtil.writer(response, HttpResult.error(HttpStatus.TOKEN_INVALID_CODE, HttpStatus.UN_LOGIN_MESSAGE));
             return;
         } else {
@@ -151,12 +175,12 @@ public class RequestCheckFilter implements Filter {
 
             //校验用户企业审批状态
             if (!loginEntInfo.getValid() && !REGISTER.equals(requestUri)) {
-                if(loginEntInfo.getApproval() == Global.NO){
+                if (loginEntInfo.getApproval() == Global.NO) {
                     ResponseUtil.writer(response, HttpResult.error(HttpStatus.CODE_60603, HttpStatus.ENTCERTIFICATES_NOT_REGISTER));
                     return;
                 }
 
-                if(loginEntInfo.getApproval() == Global.NUMERICAL_THREE){
+                if (loginEntInfo.getApproval() == Global.NUMERICAL_THREE) {
                     ResponseUtil.writer(response, HttpResult.error(HttpStatus.CODE_60603, HttpStatus.ENTCERTIFICATES_NOT_PASS));
                     return;
                 }
@@ -174,12 +198,11 @@ public class RequestCheckFilter implements Filter {
 //            ResponseUtil.writer(response, HttpResult.error(HttpStatus.AUTHORITY_NO_CODE, HttpStatus.ACCESS_FIAL));
 //            return;
 //        }
-
         LoginUserHolder.set(loginUserInfo);
         LoginEntHolder.set(loginEntInfo);
-        RedissonUtils.putString(Global.getFullUserLoginKey(NumberUtils.parseInt(systemType), loginUserInfo.getId()), JSON.toJSONString(loginUserInfo), Global.APP_TOKEN_EXPIRE);
+        RedissonUtils.putString(Global.getFullUserLoginKey(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));
+        RedissonUtils.putString(Global.getFullUserTokenKey(clientType, accessSpecial, userId), token, ClientTypeEnum.expireTime(clientType));
         filterChain.doFilter(servletRequest, servletResponse);
         LoginUserHolder.remove();
         LoginEntHolder.remove();
@@ -197,6 +220,36 @@ public class RequestCheckFilter implements Filter {
         return RedissonUtils.contains(Global.REDIS_SYS_MENU_PREFIX + clientType + Global.COLON + userId, url);
     }
 
+    /**
+     * @param token         token
+     * @param clientType    客户端类型
+     * @param systemType    系统类型
+     * @param accessSpecial 专场标识
+     * @param requestUri    请求地址
+     * @return 校验结果
+     * @desc Hearder内容校验
+     * @author zk
+     * @date 2023/12/14
+     **/
+    private HttpResult checkBlank(String token, String clientType, Integer systemType, String accessSpecial, String requestUri) {
+        if (StringUtils.isBlank(token)) {
+            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, HttpStatus.UN_LOGIN_MESSAGE);
+        }
+        if (StringUtils.isBlank(clientType)) {
+            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, HttpStatus.INVALID_REQUEST);
+        }
+        if (StringUtils.isBlank(systemType)) {
+            return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, HttpStatus.INVALID_REQUEST);
+        }
+        if (!IMPORT_PASS_PATH.contains(requestUri)) {
+            if (StringUtils.isBlank(accessSpecial) && !Objects.equals(systemType, SystemTypeEnum.MANAGE.getCode())) {
+                return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, HttpStatus.INVALID_REQUEST);
+            }
+        }
+        accessSpecial = !Objects.equals(systemType, SystemTypeEnum.MANAGE.getCode()) ? accessSpecial : null;
+        return HttpResult.ok();
+    }
+
     public static void main(String[] args) {
         Map<String, Object> tokenMap = EncryUtil.descryV2(Global.PRI_KEY, "afc3fc350d5c17e52beba3bcd631eaca9f5f440509f72b182880a429b1b9b22b53154436ec72865566320514f3a6e39389c2ed412180c90b07f6ff66c12a5e139ed05793cf37d580ae9a2a166ddd79d6b7cd10e209d78c6eee9381d878df29f7");
         System.out.println(tokenMap);

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

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

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

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

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

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

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

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

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

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

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

@@ -61,6 +61,6 @@ public class BaseModel implements Serializable {
 	/**
 	 * 删除标识(0正常/-1删除)
 	 */
-	private Integer delFlag = 0;
+	private Integer delFlag;
 
 }

+ 15 - 2
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/constant/Global.java

@@ -1,5 +1,8 @@
 package com.sckw.core.model.constant;
 
+import com.sckw.core.common.enums.StringConstant;
+import com.sckw.core.utils.StringUtils;
+
 /**
  * All rights Reserved, Designed By www.51wph.com
  *
@@ -95,6 +98,8 @@ public class Global {
     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:";
+    //客户经理redisKey
+    public static final String REDIS_CUSTOMER_MANAGER_USER_LOGIN_PREFIX = "customerManagerUserLoginInfo:";
 
     /**redis企业信息前缀*/
     public static final String REDIS_ENTERPRISE_PREFIX = "enterpriseInfo:";
@@ -283,8 +288,12 @@ public class Global {
     }
 
     /**完整的用户登录tokenkey*/
-    public static String getFullUserTokenKey(String clientType, Long userId) {
-        return REDIS_USER_TOKEN_PREFIX + clientType + COLON + userId;
+    public static String getFullUserTokenKey(String clientType, String accessSpecial, Long userId) {
+        String builder = REDIS_USER_TOKEN_PREFIX +
+                (StringUtils.isNotNull(clientType) ? clientType + COLON: null) +
+                (StringUtils.isNotNull(accessSpecial) ? accessSpecial + COLON: null) +
+                (StringUtils.isNotNull(userId) ? userId : null);
+        return builder;
     }
 
     /**完整的用户企业信息key*/
@@ -306,4 +315,8 @@ public class Global {
     public static String getRepeatSubmitKey(Long userId, String url) {
         return REPEAT_SUBMIT + userId + COLON + url;
     }
+
+    public static String getCustomerManagerUserLoginKey(Integer systemType, Long userId) {
+        return REDIS_CUSTOMER_MANAGER_USER_LOGIN_PREFIX + systemType + COLON + userId;
+    }
 }

+ 3 - 2
sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/NumberConstant.java → sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/constant/NumberConstant.java

@@ -1,6 +1,7 @@
-package com.sckw.core.common.enums;
+package com.sckw.core.model.constant;
 
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 
 /**
  * @description:    定义常量
@@ -66,7 +67,7 @@ public final class NumberConstant {
 
     public static final BigDecimal ONE_HUNDRED = new BigDecimal("100.00");
     public static final BigDecimal TEN_THOUSAND = new BigDecimal("10000.00");
-
+    public static final BigDecimal ZERO_TWO = BigDecimal.ZERO.setScale(NumberConstant.TWO, RoundingMode.DOWN);
     public NumberConstant() {
     }
 }

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

@@ -2,6 +2,11 @@ package com.sckw.core.model.enums;
 
 import lombok.Getter;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 /**
  * @author czh
  * @desc 审批状态枚举
@@ -25,12 +30,12 @@ public enum ApprovalEnum {
 
     private final String name;
 
-    ApprovalEnum(int code, String name){
+    ApprovalEnum(int code, String name) {
         this.code = code;
         this.name = name;
     }
 
-    public static String getName(int code){
+    public static String getName(int code) {
         for (ApprovalEnum approvalEnum : values()) {
             if (approvalEnum.getCode() == code) {
                 return approvalEnum.getName();
@@ -39,4 +44,15 @@ public enum ApprovalEnum {
         return null;
     }
 
+    public static List<Map<String, String>> getDefaultApprovalEnum() {
+        List<Map<String, String>> list = new ArrayList<>();
+        for (ApprovalEnum approvalEnum : ApprovalEnum.values()) {
+            Map<String, String> map = new HashMap<>();
+            map.put("code", String.valueOf(approvalEnum.getCode()));
+            map.put("name", approvalEnum.getName());
+            list.add(map);
+        }
+        return list;
+    }
+
 }

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

@@ -81,4 +81,15 @@ public enum EntTypeEnum {
         return entTypes.contains(String.valueOf(EntTypeEnum.LOGISTICS3.getCode()))
                 || entTypes.contains(String.valueOf(EntTypeEnum.LOGISTICS4.getCode()));
     }
+
+    /**
+     * @desc 获取企业是承运单位类型值(4P物流、3P物流)
+     * @author zk
+     * @date 2023/10/7
+     **/
+    public static String carrier() {
+        return EntTypeEnum.LOGISTICS3.getCode() + Global.COMMA + EntTypeEnum.LOGISTICS4.getCode();
+    }
+
+
 }

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

@@ -1,6 +1,6 @@
 package com.sckw.core.model.enums;
 
-import com.sckw.core.common.enums.NumberConstant;
+import com.sckw.core.model.constant.NumberConstant;
 import lombok.Getter;
 
 import java.util.ArrayList;

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

@@ -318,5 +318,8 @@ public class EncryUtil {
         String singStr = createSign(params, "xinyuan20200819");
         System.out.println("sign:" +singStr);
         System.out.println("timeStamp:" +timeStamp);
+        String token = "dade5058e78847ca5672263c5b821fc09d06083611ab0f6d076af88f082f05384838b3714729e48088c6fc1d1c09763e85e35675a20ac9df50e443b92e1c18e06f9951c7d6a2905a79b889f8617ab143fc97350b5c68f0512f7c18dbf2e49eaf";
+        Map<String, Object> tokenMap = EncryUtil.descryV2(Global.PRI_KEY, token);
+        System.out.println(tokenMap);
     }
 }

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

@@ -3,7 +3,7 @@ package com.sckw.core.utils;
 import cn.hutool.core.date.DateTime;
 import com.aliyun.oss.*;
 import com.aliyun.oss.model.*;
-import com.sckw.core.common.enums.NumberConstant;
+import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.core.common.enums.StringConstant;
 import com.sckw.core.common.enums.enums.AliyunOssFileTypeEnum;
 import com.sckw.core.common.enums.enums.FileEnum;

+ 298 - 57
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/PasswordUtils.java

@@ -1,13 +1,9 @@
 package com.sckw.core.utils;
 
-import com.alibaba.fastjson2.JSON;
-
 import java.security.MessageDigest;
-import java.util.UUID;
 
 /**
  * 密码工具类
- *
  * @author Louis
  * @date Sep 1, 2018
  */
@@ -16,41 +12,8 @@ public class PasswordUtils {
     public static final int SALT_SIZE = 8;
     public static final int SUB_LENGTH = 16;
 
-    /**
-     * 匹配密码
-     *
-     * @param salt    盐
-     * @param rawPass 明文
-     * @param encPass 密文
-     * @return
-     */
-    public static boolean matches(String salt, String rawPass, String encPass) {
-        return new EncryptionUtil(salt).matches(encPass, rawPass);
-    }
-
-    /**
-     * 明文密码加密
-     *
-     * @param rawPass 明文
-     * @param salt
-     * @return
-     */
-    public static String encode(String rawPass, String salt) {
-        return new EncryptionUtil(salt).encode(rawPass);
-    }
-
-    /**
-     * 获取加密盐
-     *
-     * @return
-     */
-    public static String getSalt() {
-        return UUID.randomUUID().toString().replaceAll("-", "").substring(0, 20);
-    }
-
     /**
      * MD5加密
-     *
      * @param inStr 明文
      * @return 32位密文
      */
@@ -78,9 +41,8 @@ public class PasswordUtils {
 
     /**
      * md5密码校验
-     *
-     * @param rawPass
-     * @param encPass
+     * @param rawPass 明文密码
+     * @param encPass 密文密码
      * @return
      */
     public static boolean matchesMD5(String rawPass, String encPass) {
@@ -91,6 +53,14 @@ public class PasswordUtils {
         }
     }
 
+    /**
+     * 截取密文密码生成盐
+     */
+    public static String generateSalt() {
+        byte[] salt = Digests.generateSalt(SALT_SIZE);
+        return Encodes.encodeHex(salt);
+    }
+
     /**
      * 生成安全的密码,生成随机的16位salt并经过1024次 sha-1 hash
      */
@@ -101,15 +71,19 @@ public class PasswordUtils {
     }
 
     /**
-     * 截取密文密码生成盐
+     * 生成安全的密码,生成随机的16位salt并经过1024次 sha-1 hash
+     * @param plainPassword 明文密码
+     * @param salt          盐
+     * @return 验证成功返回true
      */
-    public static String getSaltSubPwd(String password) {
-        return password.substring(0, SUB_LENGTH);
+    public static String entryptPassword(String plainPassword, String salt) {
+        byte[] saltByte = salt.getBytes();
+        byte[] hashPassword = Digests.sha1(plainPassword.getBytes(), saltByte, HASH_INTERATIONS);
+        return Encodes.encodeHex(saltByte) + Encodes.encodeHex(hashPassword);
     }
 
     /**
      * 验证密码
-     *
      * @param plainPassword 明文密码
      * @param password      密文密码
      * @return 验证成功返回true
@@ -120,21 +94,288 @@ public class PasswordUtils {
         return password.equals(Encodes.encodeHex(salt) + Encodes.encodeHex(hashPassword));
     }
 
-    public static void main(String[] args) {
+    /**
+     * 验证密码
+     * @param plainPassword 明文密码
+     * @param password      密文密码
+     * @param salt          盐
+     * @return 验证成功返回true
+     */
+    public static boolean validatePassword(String plainPassword, String password, String salt) {
+        byte[] saltByte = salt.getBytes();
+        byte[] hashPassword = Digests.sha1(plainPassword.getBytes(), saltByte, HASH_INTERATIONS);
+        return password.equals(Encodes.encodeHex(saltByte) + Encodes.encodeHex(hashPassword));
+    }
+
+    //SELECT CONCAT(id, ',', phone, ',', password, ';,') str from sckw_fleet.kwf_driver ;
+    public static void checkDriver(){
+        String str = "162528614993104896,13868885042,fa4d73f8a688b56bc1810a55d6ddfc32fc7b9a01fad3d9750b5b1521;,\n" +
+                "162528642843283456,18372742349,f9553b1bfa6d9a93a17980bc839541f55c58c52d0c28fb03c5975ac9;,\n" +
+                "162528661445021696,13682474577,f55d95489b74c0f1f0b695f37567e7497e701f223071808a19c9261c;,\n" +
+                "162528680059342848,13445521643,1687d32e8effd59b03ea7b5c443815c19ffd71f4a6cc5fd88ac35585;,\n" +
+                "162528705808175104,18900110011,abbdc7ffa788707ddb73cd71087ecf8bb6171a10a7f7d3d7ed66eff2;,\n" +
+                "162528792894509056,18726962456,e8d913a0d5a50e67d0c77da4c602cfefb830c1ca4dc00cc7feae7a9e;,\n" +
+                "162532384737071104,13723972320,47bdadd33eaf853fecc7e4bd75804b85ade5a203250ed4a5bc464c25;,\n" +
+                "162532402399285248,15791782346,bbecc4516cf0b5572354e4eaca9a615cf724ea9991163adc23319df7;,\n" +
+                "162532423651823616,17533106183,f64fbd7cf95d04e3f7dd9bf70c7d0fbf9c03188cf1022a83388ac464;,\n" +
+                "162532442350030848,16665388156,bb3faf4ace4b37d39939ccca1ed655714870798016788db084c04b0a;,\n" +
+                "162532462239420416,13322117405,94e3ab6d453aea3a4daaf01d18f899b8b7813ddf46419e8ee6004fa0;,\n" +
+                "162532478853058560,15884485779,cf87a95124d50cec64383da7bee1416c2bffff725f67f14937963618;,\n" +
+                "162532496150368256,13606526627,f4de5eecf7d05d0162f509d3398984c416516f1865314c0b4147bd7e;,\n" +
+                "162532512227135488,13152075814,b730ef2e6c132d52aaad78f08ec5f490a8c5c654f2c53ad69f739bc6;,\n" +
+                "162879320946118656,13778787324,0c53e079d76015688a80f5275cd84b0c869b2bbc5f31f3bf42e28b42;,\n" +
+                "162885056979800064,13556563372,2a334bd23460376ab205f72bea8db42939d8885ea6487e0655039303;,\n" +
+                "162894153947025408,16680445687,456a93edc6181221901578faf50e59af6f9322e6453ade1706c5287d;,\n" +
+                "162899666269114368,15884485773,b5dd5489ea9c62bde7c4b96f89dccc08613a6dcdd9a5041f6bad9d33;,\n" +
+                "162899741896609792,13447413233,d121c7e7be962f9e385dacfb89cb8a6d34b109e02313ecc0eb0be93a;,\n" +
+                "163454586206556160,18583328871,4c2d3b238396180e3c4ae5a353e8579ff860eb3feb2178b8c157d886;,\n" +
+                "163965635959721984,18583328873,c900ba7b6a0a5270d51a612d6b3b3d7c1182035a31e16db6fcd509b4;,\n" +
+                "166974007806005248,19500000099,5dcaf43a00b3ed7c1c51fd32bce313d60d06d561dca033aa75cdd06b;,\n" +
+                "166979180402053120,19500000069,b84a34ecab63b787809e1df9d87e4d2fc9363b79f1608203331a65c7;,\n" +
+                "166979180473356288,19500000070,a9a997a9f97d04da8bccd6f2fd63c2e46933c4f484e60e5ee0e53287;,\n" +
+                "166979180548853760,19500000071,4c1721423a226e2d339a8ca817a173e75ebfbf7feda3c5482bd2545a;,\n" +
+                "166979180620156928,19500000072,8c8ee4d0c16bb9cc2574b99b34295cd215fa19166270ac77036774ad;,\n" +
+                "166979180695654400,19500000073,89e971ddb05ddf753d0b4c8dc8f8ae467fdc48ba7616befb9eee43b3;,\n" +
+                "166979180762763264,19500000074,c8c035a374d62d7ec760db261fa7348519d111161cc5de923d90e54a;,\n" +
+                "166979180838260736,19500000075,381073889a0e6d16cbb958fe6db49d8b56f71b9ae79640776ec46aaa;,\n" +
+                "166979180896980992,19500000076,ce83efb5b22d3ebf999baf08077ad0e30597824baf70533e1149954a;,\n" +
+                "166979180989255680,19500000077,3020906e4e9c0a2fac6fc9b299326ef97e307d2e6df53a4dcd0330e7;,\n" +
+                "166979181056364544,19500000078,9a7d43c3c506d6be42b68ccaee512bcebfa6ad9bde5840bc84bc59db;,\n" +
+                "166979181110890496,19500000079,bc618cba847d2c023930c41707d0409470f81b78ae0236873462e3a8;,\n" +
+                "166979181169610752,19500000080,19dc91f8b87ee075b9df6eb589176e59dae7ceb6623770a85b54038e;,\n" +
+                "166979181236719616,19500000081,abd3d8506775b5fb0dd3e3595d9e31bf250fa23d82b7a6b289c7ba61;,\n" +
+                "166979181295439872,19500000082,e5fb3886bfa37342b4f3792e183c6cf5a276601ea2fe11fdee89af1a;,\n" +
+                "166979181404491776,19500000083,6dbc2a8c788d1e6bea6a8cfa2585eb4d907d92f153f3d94697b64109;,\n" +
+                "166979181475794944,19500000084,5029b1475afa8ce6d7c1a60b80475d9b5dee180c70de1c74029a7726;,\n" +
+                "166979181538709504,19500000085,215f5d15fd7951f0351e570150467ebf8ca89639491f61745c22cc7d;,\n" +
+                "166979181589041152,19500000086,9f4b4456afabb0f147361fb9631104ac1ab955396a59f2fab89f5015;,\n" +
+                "166979181643567104,19500000087,5c007ab468137c636097a72efa0dbb731db44bef5ff87425dc23d5d8;,\n" +
+                "166979181698093056,19500000088,94c9d496b91681870c36a6c69e0e595f7cd2caa7608f45342a0b1a4f;,\n" +
+                "166979181752619008,19500000089,3f37860a1435c494ebe9e2e9e3c8ae3ace669a36058cac2ef4c126f0;,\n" +
+                "166979181807144960,19500000090,7e507b6a549f8e7de9759b91cf13784d3f9192eedc57543194eb1bc6;,\n" +
+                "166979182029443072,19500000091,8012fc3b3310d763b2e431b2cb728842b189fa2694a36c39b34803ad;,\n" +
+                "166979182092357632,19500000092,57a41f35b66543f6b2744d7ab8bb4d6874dc786ad53830a3080b9c2d;,\n" +
+                "166979182184632320,19500000093,289285ea9961fa8262f2700885c26e9487b8ae3b89ba6ea72a63a130;,\n" +
+                "166979182243352576,19500000094,1f4226de4d2df148e9dd5a17bf67c433ce8d7f5cec43465bae96e9c2;,\n" +
+                "166979182293684224,19500000095,0490dc000e6dd21530bffcce3f2e02f4de6406e65eccb0b9157c4d8d;,\n" +
+                "166979182352404480,19500000096,97d7d20af5a9c6becc697a0d667b6275ca21cdfc3de6f290c513b160;,\n" +
+                "166979182406930432,19500000097,017ffd866343fb28f3e315b72b6e13d098a6168f2de22379f5993949;,\n" +
+                "166979182465650688,19500000098,51ad2c225b6940f98d62e0945f7479db3b464e0266d0877e0e21cfb7;,\n" +
+                "167213991624445952,19500000055,b47056210b158ca57b35907206bda7afaf1d4b6eb70922563feb3b34;,\n" +
+                "167213991754469376,19500000056,4cf5663948054ab50f0b4eb8d66e82c9b14777e06a48b4ac56f342ef;,\n" +
+                "167213991813189632,19500000057,6a364842ed98d03fc78ae61111794171791e7c2017de54d67c374297;,\n" +
+                "167213991909658624,19500000058,81c6cdefd625468af303339db329190ad46996fe0ff6686de6c86e7a;,\n" +
+                "167213991964184576,19500000059,21a0f70bf87e6a3c8d6e4e49b84d1a7819957207682933654056b72c;,\n" +
+                "167213992027099136,19500000060,88404bed55005f80e1a61d22969a2effe7955606fe7289d64b3ade5f;,\n" +
+                "167213992090013696,19500000061,c674846dcd0d3bacc69e488d8ba477af75a76f533932c0a3e95491b6;,\n" +
+                "167213992144539648,19500000062,66b84316146a56c56f8b5706a4601278f235490c8fc2e6fd1dc27cc7;,\n" +
+                "167213992207454208,19500000063,e28acaa45401be9162305d3b1e83fb372b8f0da139ffc054585c920c;,\n" +
+                "167213992274563072,19500000064,86a679de0ab614cc0afdc3d22688ff832f05c6fbc1057d4630d2b52c;,\n" +
+                "167213992329089024,19500000065,61bb806f0a125f0fc3e21ee73db9e53caa7dd51e3d63064eb1966e34;,\n" +
+                "167213992400392192,19500000066,07fc1f3f7354d9335d8c0937a4839c16a7a672ec11787131979bfc62;,\n" +
+                "167213992459112448,19500000067,b8e9a1aa729fa4ab9aa771d1a844b1e06cf023adec4185ab17f7b79e;,\n" +
+                "167213992551387136,19500000068,68b1afac745118d6a67bbea775acc5e1756856cd450897f9097706f1;,\n" +
+                "170549931663167488,17358629955,8364df818959f2c4a27607bced79945e09973a32121d96bd5c4710a9;,\n" +
+                "172375269049372672,18581845668,3f57140083d2558bdfcb8a319b52b3c86f992af5dde4b21007ea5733;,\n" +
+                "172442643224072192,19500000001,3e742de4560ce2ed6658119124f26b097a5c0d19b577b95c6aaca509;,\n" +
+                "172442643400232960,19500000002,3d6020290d2d8f05e34884e1cff29e99be8a299c4dc4af4008f7d39f;,\n" +
+                "172442643479924736,19500000003,077fe8b72511e26077e2c7bcc2bc9ad98e905dd10dfaf4b50c1d72fb;,\n" +
+                "173041758513401856,19988888888,7080f75c426af4a958092ea7d40fc3c8d4c7ddb4fa9d847153788368;,\n" +
+                "173043956366446592,15902849627,be354600d28ea42df3df93aeb6cb08a33674effe54f46e5394bf491c;,\n" +
+                "177401688267689984,15515950395,0bdbc09d1c08e53286dfe3d2dcd3c014341055d65744331d81a1e3b8;,\n" +
+                "184341399146074112,19600000090,aebcacc7e710a97fa381aaf8426de9826d6a0985f555ccf4669d4960;,\n" +
+                "184341699865088000,19600000091,af779edd56faf31dd9a92c24e82a834045a3126cc0b09b52d3409827;,\n" +
+                "184342227026186240,19600000092,bedd46ac733d0b64fe599541b463b16ac3cf68a79cfb6e04ee31e962;,\n" +
+                "185002976673271808,15515955555,d5ce819e1cf9988686cb8665368ead4a08841f0a90e40ecf9eb683d6;,\n" +
+                "185003553801113600,18283808586,50e1e1389468deb93322ea3c091878b2586dc486fe917cf9097ab3c4;,\n" +
+                "192321823566729216,16612341231,d13779d353a8c3db5656bb395a27303b4aefda8ec135a4f8265e0616;,\n" +
+                "192321823675781120,16612341232,eaf94160cb3ccdebe9bbe98df17751fbcf3d1e7f07d71a1b19b2626e;,\n" +
+                "192321823822581760,16612341233,739b5b9fa279879a5a5e17917960164cd2a573721fe7ffdb188852d1;,\n" +
+                "192321823906467840,16612341234,175b2cba6cd4d713a6ab08b1c32f8e76c87027a6812469689540da5c;,\n" +
+                "192321823981965312,16612341235,5d745fda9bf8d5f86863d658751ef8a7c86cbc8184733cbfa1e8dc4f;,\n" +
+                "192321824061657088,16612341236,b25748c67ab38eabf06c9d6f2c2c3f867ecac3c1a26cf4332d68d42a;,\n" +
+                "192321824149737472,16612341237,d142b7439d2e75e7d2c5b9aac2255b4de80bf71374b2181b7b50f9aa;,\n" +
+                "192321824246206464,16612341238,2f06cc01f3185ae6237d82f310c0d7952c67b2395660f7be3d9b1ac6;,\n" +
+                "192321824317509632,16612341239,2d8d693e43d2460fae648f361bfd66d0ee2735af3bced6b2b9b1bd5d;,\n" +
+                "192321824397201408,16612341240,95791a4a26edb107cb0f3f7801136e07f7075b8be8d0be2da88549eb";
+        String [] strArray = str.split(";,");
 
-        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"));
+        for (int i=0; i<strArray.length; i++) {
+            String str1 = strArray[i];
+            if (StringUtils.isBlank(str1.trim())) {
+                continue;
+            }
+            String [] strArray1 = str1.split(",");
+            String id = strArray1[0];
+            String account = strArray1[1];
+            String password = strArray1[2];
+            System.out.print("-- " + account + "==>");
 
+            String md5 = PasswordUtils.md5(account);
+            boolean bool = PasswordUtils.validatePassword(md5, password);
 
-        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));
+            if (!bool) {
+                md5 = PasswordUtils.md5("123456");
+                bool = PasswordUtils.validatePassword(md5, password);
+                if (bool) {
+                    System.out.println(bool);
+                    String salt = PasswordUtils.generateSalt();
+                    md5 = PasswordUtils.md5("123456");
+                    password = PasswordUtils.entryptPassword(account + md5, salt);
+                    String sql = "UPDATE sckw_fleet.kwf_driver set password = '"+password+"', salt = '"+salt+"' where id = "+id+";";
+                    System.out.println(sql);
+                } else {
+                    System.out.println(bool);
+                    String salt = PasswordUtils.generateSalt();
+                    md5 = PasswordUtils.md5(account);
+                    password = PasswordUtils.entryptPassword(account + md5, salt);
+                    String sql = "UPDATE sckw_fleet.kwf_driver set password = '"+password+"', salt = '"+salt+"' where id = "+id+";";
+                    System.out.println(sql);
+                }
+            } else {
+                System.out.println(bool);
+                String salt = PasswordUtils.generateSalt();
+                md5 = PasswordUtils.md5(account);
+                password = PasswordUtils.entryptPassword(account + md5, salt);
+                String sql = "UPDATE sckw_fleet.kwf_driver set password = '"+password+"', salt = '"+salt+"' where id = "+id+";";
+                System.out.println(sql);
+            }
+        }
+    }
+
+    //SELECT CONCAT(id, ',', account, ',', password, ';,')  str from sckw_system.kws_user ;
+    public static void checkUser(){
+        String str = "156382319433748480,18000000000,be8d1ae3fac3067ee98068cce2895ad305febbe31a644fe42954de0c;,\n" +
+                "156383116720607232,admin,04323ed6811d048e0406ec39293394aabcf9b132a0cb1b87dc78279f;,\n" +
+                "162301006506364928,182838089858,cf2f6d38f0b8a150d90d9194b97875c004413880cf7aba8abf3b3dc7;,\n" +
+                "162604062133456896,13000000000,cf2f6d38f0b8a150d90d9194b97875c004413880cf7aba8abf3b3dc7;,\n" +
+                "163980531141185536,18283808586,debc2bab5eaf7b629049666051ad504bc60bea9eeab95932f64054a9;,\n" +
+                "163987895701475328,15902849627,ecc16d89238b2cd77637b41096e322a3f89c345ac10297a5fc7b61e3;,\n" +
+                "163994695842664448,18283808587,0a842bee1f75c4939d408eae02f575fad005cec391b7cc1eec6f5882;,\n" +
+                "163995870587523072,18283808581,1b7383f4d6e458fb610bcc7a80cc959ed13c83a30063401b82fa1245;,\n" +
+                "163995977299005440,18283808582,cebab3009b34e77708385c2af5595de5e739aadf435542d22d1b66ec;,\n" +
+                "163996113957818368,18827222222,3182b6bba4c90445e2d16a8901653866a707d9a1a2dc499f8af37546;,\n" +
+                "163996259454029824,18827766520,4b32a9a0b4dabe5b920a78d5115febf3b87d45ceebe5715d11b53dad;,\n" +
+                "163996369839722496,17722337872,c676f2924969a10ce4f059b1894bded8061a01d0252f3a789ce8b9ad;,\n" +
+                "163998264054517760,13911111111,65ffa259c8ba2660438f28a09851182b615dc16b7188006d67d2d661;,\n" +
+                "164072870236917760,18591918877,9ca66c47aad850e4b22b7df5acbe58a33b3a1be4fa70315e9eff8bf2;,\n" +
+                "164357889975128064,18283808584,1fd478d1d3f61d341c6cc1065b9e02833e314102be2528fbf292ed87;,\n" +
+                "164480042405990400,18283765365,ce181135763e284d6748012dbe53bcac767ea60d0306b0f04e1b3ffd;,\n" +
+                "164697036837359616,18583328873,cf2f6d38f0b8a150d90d9194b97875c004413880cf7aba8abf3b3dc7;,\n" +
+                "164697518171492352,333,9bb4f1afbdf520c28a8a9f9e4a568a4743ad62f319a17ed9437414b5;,\n" +
+                "169411694739591168,18725603264,5ea1c34a749cfd9c84b9aad577c5bae2cf12444a1f4b6c2bbac6cf67;,\n" +
+                "169832563756503040,18989898989,796c6a422bce78cced07918f759fe9ed5ee300ea3953e00fc71c24cc;,\n" +
+                "169832563794250001,17358629900,15896f181b1311a52fea135b46d95dceb14a9be0a9f70e5471fdbed8;,\n" +
+                "169832563794250002,18581845600,1b26b8eeba0c5dfc6ec66bea3d5a744e1f254db639114e290f328a36;,\n" +
+                "172804004273721344,17358629955,1b26b8eeba0c5dfc6ec66bea3d5a744e1f254db639114e290f328a36;,\n" +
+                "172804804509175808,18581845668,5c14b84bf8b4ff37289367942d176ae99353d4554cd68504d480099f;,\n" +
+                "172805173922500608,19940686355,f90c137bf2dafdbd0f44c737f3308dd3b6eccc9ca901f8561655235f;,\n" +
+                "174848836286550016,18728803519,ffe135b89706c8118e183f6e2724605be2e57eaef88a83fa161988b7;,\n" +
+                "174849409274613760,18728803520,5a70e23e8f39c898151c2f220c0b4b8cc5ec325754871e05cc97ad6f;,\n" +
+                "174921932133634048,18508243826,154e6e02db2c56eb30e012053ad6f1e3aa1c3124057f6fd1ff08c1b1;,\n" +
+                "175194057557938176,18583328875,c1048c9ae5cbb7c3479611eb279780ee2f4bf4e14e518fb416e04889;,\n" +
+                "177044507026526208,17780832879,2ce6f28d73a8741b4f9621bb533fc7a041341438afcf9240fa06e694;,\n" +
+                "177154391646670848,18728803521,fb776988fb19dd63086ae88f37de4a01fdce26038bbba073b33e5533;,\n" +
+                "177493080700620800,17358629911,ffcc7ac864f6d951318db5643078bacf95499c2c9f0b376e30d31134;,\n" +
+                "177493191988088832,17358629922,5ee3b6ee0049014f63ae1288b9f731c8ae05e674169245539ef9d8cf;,\n" +
+                "177493399400615936,17358629901,e8a9cdf5659204ce9b16cade7073764c0a3b2136bd1750b563132190;,\n" +
+                "177493603818409984,17358629933,d6bd668a876e4dcdc9eefb6059a4e9c2969d8ce54b3d42f5b9a49573;,\n" +
+                "177495184064385024,18581845611,53f2cb77f34992dc1785d662792df69d1f7e52e50450a87446b31445;,\n" +
+                "177495269858873344,18581845622,9e397e5e54145865a9a3c55d75ea4c5105847daf6937eb0b9d66ee9e;,\n" +
+                "177495384933797888,18581845633,bc425341f50b1f2b26f1f4092d212147022912e96c022c6b8e85e2b0;,\n" +
+                "177496454816862208,19940686311,31c8cc61c09d079e26ed7dbaf7b650a36addbacab8e094c7744b4f4f;,\n" +
+                "177496522529705984,19940686322,7ff53f4b835ca96d36a0683d7d3ea6e597d47e11005948b113962b22;,\n" +
+                "177496618457632768,19940686333,cf7fce7ad2d0912cc8b655c71b7984a4f679184ab6f0121b34b2cddf;,\n" +
+                "177755619585953792,18581845644,492a18b9c21963e38bd5c5be7aea349f9fbba6256bc5409e882ed165;,\n" +
+                "177756009534590976,19940686344,8f53c645f492e0856baf623bdd1d9ba94715397de929223e17f3b311;,\n" +
+                "177756500125552640,17358629944,b046904d8cff8812692a078307d233bf18a6ed12751dc6e540f1d17c;,\n" +
+                "179251265040027648,18900001111,17b95c44a4be220ec241ea66fac83941afbd438fe97b9aba4e587f19;,\n" +
+                "179251480232988672,18900002222,7a98d8432666fbae4f976be6aee0725d83fc85e9a4140400ac3fc08b;,\n" +
+                "179287301304619008,15770000850,457b71ac5eb35cd72f54f260dc2e720f435ad18e3fec50c5f308f16e;,\n" +
+                "179567500780900352,18215677925,1212403ea6c37724ce3deccf3a3e84c82cd5503cac054782329e0b38;,\n" +
+                "179908046275743744,17310362742,e68281cfa1b49d333e51e9773fb955e10908795987892282e004791e;,\n" +
+                "180714251143352320,5464,4e834fbf535588ab64752d3609e3606eae0387cbfdc1a011626f0af1;,\n" +
+                "180716172793090048,1534543545,2df806f9dad1fe9aa1afb3592ff309e3c6821fe9f593ffcc7c765d4f;,\n" +
+                "180717765986881536,34234,514134b6e51a189d5e02d1e439d6616aedbe5e73395970efe01fffc5;,\n" +
+                "180741718713307136,16500000000,61d1ece89fac8414762ab7faa173cf8707c7e7137cd22e93652ccb4a;,\n" +
+                "180742245102653440,16600000000,2e7a7e603c4883cc5bd859af38482d4fab1eec756a7653cad697becd;,\n" +
+                "182077378799865856,15515955555,5957560d39adc6269948ae1a2eda73c1a451164557a831e025fdc0d9;,\n" +
+                "182445986600194048,14000000000,475211e9bdb02f694c17a468ba33f395c87cdcda6ef343a2c7dc86a2;,\n" +
+                "182446432941248512,17000000000,ca0feeb8ca30dae8ab38d2ff07840f731777d6514c92cd5dfdc1902d;,\n" +
+                "184622287863943168,17358621111,f4e4bab7497534fdf1487ce2951fbaf0d8b9463f6ad7166275dc9a84;,\n" +
+                "184622549060030464,17358622222,424df61b9291ada971db0005c29be190602165aeb2c9295c107ce8b9;,\n" +
+                "187262271745953792,18777777777,27005458fed283da910fcbcfea4cc877454ab47164525074fc6792a1;,\n" +
+                "187263867661848576,18900000000,b41bc19f522840bcf88da64d8fc93d9938252856c95d174d24796796;,\n" +
+                "187266156040556544,18666666666,b83ca58b0f533a98bbb9a72857725aca1ceb8476ac6a6118fb5ea7cf;,\n" +
+                "187266875430801408,18555555555,256f34d839db85a12eb46c21135a9d0b9a058ba26e83099b3951275f;,\n" +
+                "187674506012135424,14777777777,dd4a6928d63b57f85a5dad13b5f6581ddaef2f47ce613f6d8cebed15;,\n" +
+                "187932221632417792,18922111111,915d03daa67403dace1077063afff2f99bc78f27cf1eff476267637d;,\n" +
+                "187933261320687616,18922111112,d10029a3a9f3176ee2ea6516add9f94e0273cd5e1e507eca5e9c8754;,\n" +
+                "191139325050621952,18912349988,b36e322666a0b260d5b5bbcba6622f30ce59653892044830f9988554;,\n" +
+                "191958030668009472,18922993333,bbf608392522d9c2faf7015c376e1a762ac7108ac9cb089d9ca4baf8;,\n" +
+                "191973351617466368,16666666666,94e66bf955c8ec094bf202350438ffffcc2c203141d9b98f4c47f671;,\n" +
+                "192247281867558912,16600060066,9aec2a414a09c87257ac8d0b5d53b6828c255a51a57a271c54266e56;,\n" +
+                "192337955283537920,17777777777,028515cdef747a5eea5a268c30906af1661e08a8807bf2f702b8ca66;,\n" +
+                "193055960644718592,14444444444,0fbacd064a22b0e35152991552a11cb793ded61438d713912667c5ec";
+        String [] strArray = str.split(";,");
+
+        for (int i=0; i<strArray.length; i++) {
+            String str1 = strArray[i];
+            if (StringUtils.isBlank(str1.trim())) {
+                continue;
+            }
+            String [] strArray1 = str1.split(",");
+            String id = strArray1[0];
+            String account = strArray1[1];
+            String password = strArray1[2];
+            System.out.print("-- " + account + "==>");
+
+            String md5 = PasswordUtils.md5(account);
+            boolean bool = PasswordUtils.validatePassword(md5, password);
+
+            if (!bool) {
+                md5 = PasswordUtils.md5("123456");
+                bool = PasswordUtils.validatePassword(md5, password);
+                if (bool) {
+                    System.out.println(bool);
+                    String salt = PasswordUtils.generateSalt();
+                    md5 = PasswordUtils.md5("123456");
+                    password = PasswordUtils.entryptPassword(account + md5, salt);
+                    String sql = "UPDATE sckw_system.kws_user set password = '"+password+"', salt = '"+salt+"' where id = "+id+";";
+                    System.out.println(sql);
+                } else {
+                    System.out.println(bool);
+                    String salt = PasswordUtils.generateSalt();
+                    md5 = PasswordUtils.md5(account);
+                    password = PasswordUtils.entryptPassword(account + md5, salt);
+                    String sql = "UPDATE sckw_system.kws_user set password = '"+password+"', salt = '"+salt+"' where id = "+id+";";
+                    System.out.println(sql);
+                }
+            } else {
+                System.out.println(bool);
+                String salt = PasswordUtils.generateSalt();
+                md5 = PasswordUtils.md5(account);
+                password = PasswordUtils.entryptPassword(account + md5, salt);
+                String sql = "UPDATE sckw_system.kws_user set password = '"+password+"', salt = '"+salt+"' where id = "+id+";";
+                System.out.println(sql);
+            }
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        String account = "17358629955";
+        String password = "123456";
+        String salt = generateSalt();
+        System.out.println(salt);
+
+        String md5 = PasswordUtils.md5(password);
+        System.out.println(md5);
+        String password1 = PasswordUtils.entryptPassword(account + md5, salt);
+        System.out.println(password1);
+
+        boolean bool = PasswordUtils.validatePassword(account + md5, password1, salt);
+        System.out.println(bool);
+        //checkDriver();
+        //checkUser();
     }
 }

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

@@ -2,6 +2,7 @@ package com.sckw.core.utils;
 
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.model.constant.Global;
+import com.sckw.core.model.constant.NumberConstant;
 
 import java.lang.reflect.InvocationTargetException;
 import java.math.BigDecimal;
@@ -795,7 +796,7 @@ public class StringUtils {
      */
     private BigDecimal setScale(Double d) {
         if (Objects.isNull(d) || BigDecimal.ZERO.compareTo(BigDecimal.valueOf(d)) == 0) {
-            return new BigDecimal("0.00");
+            return NumberConstant.ZERO_TWO;
         }
         return BigDecimal.valueOf(d).setScale(2, RoundingMode.HALF_UP);
     }
@@ -809,7 +810,7 @@ public class StringUtils {
      */
     private BigDecimal setScale(BigDecimal d) {
         if (Objects.isNull(d) || BigDecimal.ZERO.compareTo(d) == 0) {
-            return new BigDecimal("0.00");
+            return NumberConstant.ZERO_TWO;
         }
         return d.setScale(2, RoundingMode.HALF_UP);
     }

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

@@ -19,6 +19,12 @@ public class CustomConfig {
     @Value("${links}")
     private String links;
 
+    /**
+     * 直接放行的请求链接
+     */
+    @Value("${specialLinks}")
+    private String specialLinks;
+
 //    /**
 //     * 是否允许一个账号绑定多个角色
 //     */

+ 7 - 6
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/constant/HttpStatus.java

@@ -9,6 +9,7 @@ public class HttpStatus {
 
     /**成功状态码*/
     public static final int SUCCESS_CODE = 60200;
+
     /**成功提示信息*/
     public static final String SUCCESS_MESSAGE = "success";
 
@@ -23,14 +24,13 @@ 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 = "攻城狮正在拼命优化,请您稍候再试!";
 
@@ -45,6 +45,7 @@ public class HttpStatus {
     public static final String TOKEN_ERROR = "非法token!";
     public static final String CAPCHA_ERROR = "验证码无效!";
     public static final String ADDRESS_EXISTS = "地点已存在,不可重复!";
+    public static final String INVALID_REQUEST = "无效的接口请求!";
 
     /**其他自定义状态码*/
     public static final int CODE_60603 = 60603;

+ 3 - 1
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/constant/RequestConstant.java

@@ -1,7 +1,7 @@
 package com.sckw.core.web.constant;
 
 /**
- * @Description web请求常量
+ * @Desc web请求常量
  * @Author zk
  * @Date 2022/6/16
  */
@@ -13,5 +13,7 @@ public class RequestConstant {
     public static final String CLIENT_TYPE = "Client-Type";
     /**系统类型*/
     public static final String SYSTEM_TYPE = "System-Type";
+    /**专场标识*/
+    public static final String ACCESS_SPECIAL = "Access-Special";
 
 }

+ 16 - 15
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/context/LoginEntHolder.java

@@ -1,5 +1,6 @@
 package com.sckw.core.web.context;
 
+import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.model.LoginEntInfo;
 
 /**
@@ -55,15 +56,6 @@ public class LoginEntHolder {
         return LONGIN_ENT_HOLDER.get() == null ? null : LONGIN_ENT_HOLDER.get().getFirmName();
     }
 
-    /**
-     * 用户类型
-     * @author zhaokang
-     * @Date 2020/04/13 0021
-     */
-    public static Integer getUserType(){
-        return LONGIN_ENT_HOLDER.get() == null ? null : LONGIN_ENT_HOLDER.get().getUserType();
-    }
-
     /**
      * 资料审批状态(1通过、0未审批、2未通过、3审批中)
      * @author zhaokang
@@ -83,13 +75,22 @@ public class LoginEntHolder {
     }
 
     /**
-     * 用户分支类型
-     * @author zk
-     * @date 2021/3/16 11:24
-     **/
-    public static Integer getBranchType(){
-        return LONGIN_ENT_HOLDER.get() == null ? null : LONGIN_ENT_HOLDER.get().getBranchType();
+     * 专场标识
+     * @author zhaokang
+     * @Date 2020/04/13 0021
+     */
+    public static String getSpecial(){
+        return LONGIN_ENT_HOLDER.get() == null ? null : LONGIN_ENT_HOLDER.get().getSpecial();
     }
 
+    /**
+     * 是否主平台(不属于专场)
+     * @author zk
+     * @Date 2023/12/17 0021
+     */
+    public static boolean getMainPlatform(){
+        String pecial = getSpecial();
+        return StringUtils.isNotBlank(pecial);
+    }
 
 }

+ 16 - 1
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/context/LoginUserHolder.java

@@ -4,7 +4,6 @@ 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;
 
 /**
@@ -157,4 +156,20 @@ public class LoginUserHolder {
         return authUserIdList;
     }
 
+    /**
+     * 运营端客户经理(用户)关联企业
+     * @return 企业ID集合
+     */
+    public static List<Long> getAuthEntIdList(){
+        if (LONGIN_USER_HOLDER.get() == null) {
+            return new ArrayList<>();
+        }
+        List<Long> authUserIdList = LONGIN_USER_HOLDER.get().getAuthEntIdList();
+        if (CollectionUtils.isEmpty(authUserIdList)) {
+            return new ArrayList<>();
+        }
+
+        return authUserIdList;
+    }
+
 }

+ 7 - 7
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/model/LoginBase.java

@@ -25,6 +25,11 @@ public class LoginBase {
      */
     private String captcha;
 
+    /**
+     * 登录方式1 账号密码登录/2账号短信登录/3单账号登录
+     */
+    private int loginMethod;
+
     /**
      * 系统类型(1 运营管理中心/2 运营管理中心/3 官网/4 司机应用)
      */
@@ -36,12 +41,7 @@ public class LoginBase {
     private String clientType;
 
     /**
-     * 登录方式1 账号密码登录/2账号短信登录/3单账号登录
-     */
-    private int loginMethod;
-
-    /**
-     * 用户类型(1 表示官网 )
+     * 专场标识
      */
-    private String userType;
+    private String accessSpecial;
 }

+ 9 - 34
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/model/LoginEntInfo.java

@@ -11,26 +11,22 @@ import java.util.List;
  */
 @Data
 public class LoginEntInfo {
+
     /**
      * 用户所属企业id
      */
     private Long id;
+
     /**
      * 用户所属企业名称
      */
     private String firmName;
-    /**
-     * 用户类型
-     */
-    private int userType;
-    /**
-     * 用户分支类型(1承运商企业、2车主)
-     */
-    private int branchType;
+
     /**
      * 资料审批状态(0未审批、1通过、2未通过、3审批中)
      */
     private int approval;
+
     /**
      * 用户状态(-1删除、0正常、1已锁)
      */
@@ -81,37 +77,16 @@ public class LoginEntInfo {
      */
     private String entTypes;
 
+    /**
+     * 专场标识
+     */
+    private String special;
+
     /**
      * 资质
      */
     private List<EntCertificateInfo> certificateInfo;
 
-
-//    /**
-//     * 企业编号
-//     */
-//    private Long id;
-//
-//    /**
-//     * 企业名称
-//     */
-//    private String firmName;
-//
-//    /**
-//     * 注册时间
-//     */
-//    private Date regTime;
-//
-//    /**
-//     * 资料审批状态(0未审批、1通过、2未通过、3审批中)
-//     */
-//    private Integer approval;
-//
-//    /**
-//     * 企业类型(值)
-//     */
-//    private String entTypes;
-
     /**
      * 企业类型(名称)
      */

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

@@ -1,7 +1,6 @@
 package com.sckw.core.web.model;
 
 import lombok.Data;
-
 import java.util.List;
 
 /**
@@ -15,38 +14,47 @@ public class LoginUserInfo {
      * 用户id
      */
     private Long id;
+
     /**
      * 用户所属系统
      */
     private Integer systemType;
+
     /**
      * 用户账号
      */
     private String account;
+
     /**
      * 用户姓名
      */
     private String userName;
+
     /**
      * 用户电话
      */
     private String phone;
+
     /**
      * 是否主账号(0是/1否)
      */
     private int isMain;
+
     /**
      *用户账号状态(0正常/1锁定)
      */
     private Integer status;
+
     /**
      * 用户所属企业id
      */
     private Long entId;
+
     /**
      * 用户登录终端
      */
     private String clientType;
+
     /**
      * 用户所属机构id
      */
@@ -57,13 +65,21 @@ public class LoginUserInfo {
      */
     private String entName;
 
+    /**
+     * 用户权限
+     */
     private List<Long> authUserIdList;
 
+    /**
+     * 用户(客户经理)企业权限
+     */
+    private List<Long> authEntIdList;
+
     public LoginUserInfo() {
     }
 
     public LoginUserInfo(Long id, Integer systemType, String account, String userName, String phone,
-                         int isMain, int status, Long entId, String clientType, String deptIds, List<Long> authUserIdList) {
+                         int isMain, int status, Long entId, String clientType, String deptIds, List<Long> authUserIdList, List<Long> authEntIdList) {
         this.id = id;
         this.systemType = systemType;
         this.account = account;
@@ -75,5 +91,6 @@ public class LoginUserInfo {
         this.clientType = clientType;
         this.deptIds = deptIds;
         this.authUserIdList = authUserIdList;
+        this.authEntIdList = authEntIdList;
     }
 }

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

@@ -6,7 +6,7 @@ import com.alibaba.excel.metadata.data.CellData;
 import com.alibaba.excel.metadata.data.WriteCellData;
 import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
 import com.alibaba.excel.write.style.column.AbstractColumnWidthStyleStrategy;
-import com.sckw.core.common.enums.NumberConstant;
+import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.core.model.constant.Global;
 import com.sckw.core.utils.CollectionUtils;
 import org.apache.poi.ss.usermodel.Cell;

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

@@ -5,7 +5,7 @@ import com.alibaba.excel.enums.CellDataTypeEnum;
 import com.alibaba.excel.metadata.GlobalConfiguration;
 import com.alibaba.excel.metadata.data.WriteCellData;
 import com.alibaba.excel.metadata.property.ExcelContentProperty;
-import com.sckw.core.common.enums.NumberConstant;
+import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.excel.annotation.EasyExcel;
 import lombok.extern.slf4j.Slf4j;
 

+ 1 - 1
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/Translator.java

@@ -1,7 +1,7 @@
 package com.sckw.excel.translate;
 
 
-import com.sckw.core.common.enums.NumberConstant;
+import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.core.exception.SourceInitializeException;
 import com.sckw.core.exception.TranslateException;
 import com.sckw.excel.translate.annotation.Translate;

+ 1 - 2
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/context/Enums.java

@@ -1,10 +1,9 @@
 package com.sckw.excel.translate.context;
 
-import com.sckw.core.common.enums.NumberConstant;
+import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.core.exception.SourceInitializeException;
 import com.sckw.core.model.enums.LogisticsOrderEnum;
 import com.sckw.excel.translate.Sources;
-import jakarta.annotation.PostConstruct;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.Ordered;
 import org.springframework.data.redis.core.RedisTemplate;

+ 1 - 1
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/context/Organization.java

@@ -1,7 +1,7 @@
 package com.sckw.excel.translate.context;
 
 import com.alibaba.fastjson.JSON;
-import com.sckw.core.common.enums.NumberConstant;
+import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.excel.translate.Sources;
 import com.sckw.core.exception.SourceInitializeException;
 import com.sckw.excel.translate.properties.TranslateProperties;

+ 1 - 1
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/wrapper/AbstractTranslator.java

@@ -1,7 +1,7 @@
 package com.sckw.excel.translate.wrapper;
 
 
-import com.sckw.core.common.enums.NumberConstant;
+import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.core.exception.TranslateException;
 import com.sckw.excel.translate.annotation.Translate;
 import com.sckw.excel.translate.annotation.Translates;

+ 1 - 0
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/utils/DateUtil.java

@@ -584,6 +584,7 @@ public class DateUtil {
 //        //结束时间
 //        String beforeMonthDateAndDaysEndToString1 = getBeforeMonthDateAndDaysEndToString(1, 0);
 //        System.out.println(beforeMonthDateAndDaysEndToString1);
+       String SS= cn.hutool.core.date.DateUtil.format(LocalDateTime.now(), "yyyy-MM-dd")+" 00:00:00";
         //月
         //开始时间
         String monthDateStart = DateUtil.getBeforeMonthDateAndDaysStartToString(LocalDateTime.now(), 1, -1);

+ 1 - 1
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/utils/ExcelUtil.java

@@ -6,7 +6,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
 import com.alibaba.excel.write.metadata.WriteSheet;
 import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
 import com.alibaba.fastjson.JSONObject;
-import com.sckw.core.common.enums.NumberConstant;
+import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.core.model.constant.Global;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.annotation.ExcelContext;

+ 30 - 0
sckw-common/sckw-common-redis/src/main/java/com/sckw/redis/utils/RedissonUtils.java

@@ -242,6 +242,36 @@ public class RedissonUtils {
         return set.addAll(list);
     }
 
+    /**
+     * 携带过期时间
+     * @param key
+     * @param list
+     * @param expired
+     * @return
+     * @param <T>
+     */
+    public static <T> boolean putSetSeconds(String key, List<T> list,long expired) {
+        log.debug("如果不存在则写入缓存【{}】 【{}】 【{}】开始", key, list, expired);
+        RSet<Object> set = redissonUtils.redissonClient.getSet(key);
+        set.expire(expired,TimeUnit.SECONDS);
+        return set.addAll(list);
+    }
+
+    /**
+     * 携带过期时间
+     * @param key
+     * @param list
+     * @param expired
+     * @return
+     * @param <T>
+     */
+    public static <T> boolean putSetHours(String key, List<T> list,long expired) {
+        log.debug("如果不存在则写入缓存【{}】 【{}】 【{}】开始", key, list, expired);
+        RSet<Object> set = redissonUtils.redissonClient.getSet(key);
+        set.expire(Duration.ofHours(expired));
+        return set.addAll(list);
+    }
+
     public static <T> boolean contains(String key, T value) {
         RSet<Object> set = redissonUtils.redissonClient.getSet(key);
         return set.isEmpty() ? Boolean.FALSE : set.contains(value);

+ 15 - 0
sckw-common/sckw-common-stream/src/main/java/com/sckw/stream/enums/MessageEnum.java

@@ -160,6 +160,13 @@ public enum MessageEnum {
     NEW_LOGISTICS_ORDER("BUSINESS", "BUSINESS_NEW_LOGISTICS_ORDER", "自建物流订单",
             "贵司通过自建物流订单,发起了对【${companyName}】的物流分配计划,请留意后续消息;订单号:${orderNo}", "terminal,ios,android", "托运订单-自建物流订单"),
 
+    /**
+     * 托运订单-承运商批量导入订单
+     */
+    ACCEPT_CARRIAGE_IMPORT_EXCEL("BUSINESS", "ACCEPT_CARRIAGE_IMPORT_EXCEL", "承运商批量导入订单",
+            "【${companyName}】通过批量操作生成了【${number}】条物流订单,请及时确认", "terminal,ios,android", "托运订单-承运商批量导入"),
+
+
     /**
      * 托运订单-撤回物流分配计划
      */
@@ -171,6 +178,14 @@ public enum MessageEnum {
      */
     REJECT_ORDER("BUSINESS", "BUSINESS_REJECT_ORDER", "承运方拒绝订单",
             "你的物流托运任务被【【${companyName}】拒绝接单,请及时查看;订单号:${orderNo}", "terminal,ios,android", "托运订单-承运方拒绝订单"),
+
+    /**
+     * 承运订单-批量导入承运订单
+     */
+    CONSIGN_IMPORT_EXCEL("BUSINESS", "CONSIGN_IMPORT_EXCEL", "批量导入承运订单",
+            "贵司通过批量操作导入了【${number}】条物流订单,请及时确认", "terminal,ios,android", "承运订单-批量导入承运订单"),
+
+
     /**
      * 承运订单-有新分配的承运任务
      */

+ 10 - 1
sckw-modules-api/sckw-contract-api/src/main/java/com/sckw/contract/api/RemoteContractService.java

@@ -1,6 +1,7 @@
 package com.sckw.contract.api;
 
 import com.sckw.contract.api.model.dto.res.ContractCommonInfoResDto;
+import com.sckw.contract.api.model.dto.res.ContractLogisticsOrderResDto;
 
 import java.math.BigDecimal;
 import java.util.List;
@@ -37,7 +38,15 @@ public interface RemoteContractService {
      * @author: czh
      * @date: 2023/9/8
      */
-    Map<Integer, Integer> queryContractValidCount(Long entId);
+    Map<Integer, Integer> queryContractValidCount(Long entId,List<Long> enterpriseIds);
 
 
+    /**
+     *
+     * @param contractNo
+     * @param acceptId 承运企业id
+     * @param consignId 托运企业id
+     * @return
+     */
+    ContractLogisticsOrderResDto getContractByContractNo(String contractNo, Long acceptId, Long consignId);
 }

+ 74 - 0
sckw-modules-api/sckw-contract-api/src/main/java/com/sckw/contract/api/model/dto/res/ContractLogisticsOrderResDto.java

@@ -0,0 +1,74 @@
+package com.sckw.contract.api.model.dto.res;
+
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @author czh
+ * @desc 合同公共信息
+ * @date 2023/7/19
+ */
+@Data
+public class ContractLogisticsOrderResDto implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 2656035411576510101L;
+
+    /**
+     * 合同id
+     */
+    private Long id;
+
+    /**
+     * 合同名
+     */
+    private String contactName;
+
+    /**
+     * 合同号
+     */
+    private String contractNo;
+
+    /**
+     * 签约方式  1线上  2线下
+     */
+    private Integer signingWay;
+
+    /**
+     * 签约方式名
+     */
+    private String signingWayName;
+
+    /**
+     * 合同状态 0 已签约 1待签约 2已完结 3已保存
+     */
+    private Integer status;
+
+    /**
+     * 合同状态名称
+     */
+    private String statusName;
+
+    /**
+     * 托运企业id
+     */
+    private Long consignEntId;
+
+    /**
+     * 托运企业名称
+     */
+    private String consignEntName;
+
+    /**
+     * 承运企业id
+     */
+    private Long acceptCarriageEntId;
+
+    /**
+     * 承运企业名称
+     */
+    private String acceptCarriageEntName;
+
+}

+ 5 - 0
sckw-modules-api/sckw-manage-api/src/main/java/com/sckw/manage/api/RemoteManageService.java

@@ -1,6 +1,8 @@
 package com.sckw.manage.api;
 
 import com.sckw.manage.api.model.dto.res.EntAddressResDto;
+import com.sckw.manage.api.model.dto.res.FindCooperateByEntReqVo;
+import com.sckw.manage.api.model.dto.res.FindCooperateByEntResVo;
 import com.sckw.manage.api.model.dto.res.FindEntCooperateResVo;
 
 import java.util.List;
@@ -40,4 +42,7 @@ public interface RemoteManageService {
      */
     List<FindEntCooperateResVo> findAllCooperateEnt(Long entId);
 
+
+    List<FindCooperateByEntResVo> findCooperateByEnt(FindCooperateByEntReqVo reqVo);
+
 }

+ 10 - 0
sckw-modules-api/sckw-manage-api/src/main/java/com/sckw/manage/api/model/dto/res/EntAddressResDto.java

@@ -51,6 +51,16 @@ public class EntAddressResDto implements Serializable {
      */
     private String cityName;
 
+    /**
+     * 联系人姓名
+     */
+    private String contacts;
+
+    /**
+     * 联系电话
+     */
+    private String phone;
+
     /**
      * 详细地址
      */

+ 36 - 0
sckw-modules-api/sckw-manage-api/src/main/java/com/sckw/manage/api/model/dto/res/FindCooperateByEntReqVo.java

@@ -0,0 +1,36 @@
+package com.sckw.manage.api.model.dto.res;
+
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @author czh
+ * @desc 通过企业查合作信息
+ * @date 2023/8/1
+ */
+@Data
+public class FindCooperateByEntReqVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -8336489430768187668L;
+
+    /**
+     * 当前企业
+     */
+    @NotNull(message = "当前企业不能为空")
+    private Long entId;
+
+    /**
+     * 对方企业
+     */
+    private Long targetEntId;
+
+    /**
+     * 合作属性 1供应商,2采购商,3托运商,4承运商
+     */
+    private Integer cooperateType;
+
+}

+ 95 - 0
sckw-modules-api/sckw-manage-api/src/main/java/com/sckw/manage/api/model/dto/res/FindCooperateByEntResVo.java

@@ -0,0 +1,95 @@
+package com.sckw.manage.api.model.dto.res;
+
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @author czh
+ * @desc 通过企业查合作信息
+ * @date 2023/8/1
+ */
+@Data
+public class FindCooperateByEntResVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 6831940531630253367L;
+
+    /**
+     * 合作id
+     */
+    private Long id;
+
+    /**
+     * 合作类型
+     */
+    private String cooperateTypes;
+
+    /**
+     * 我方企业id
+     */
+    private Long entId;
+
+    /**
+     * 我方企业名
+     */
+    private String entName;
+
+    /**
+     * 对方企业id
+     */
+    private Long targetEntId;
+
+    /**
+     * 对方企业名
+     */
+    private String targetEntName;
+
+    /**
+     * 发起方企业id
+     */
+    private Long initiateEntId;
+
+    /**
+     * 发起方企业名
+     */
+    private String initiateEntName;
+
+    /**
+     * 我方联系人id
+     */
+    private Long contactsId;
+
+    /**
+     * 我方联系人姓名
+     */
+    private String contacts;
+
+    /**
+     * 我方联系电话
+     */
+    private String phone;
+
+    /**
+     * 对方联系人id
+     */
+    private Long targetContactsId;
+
+    /**
+     * 对方联系人姓名
+     */
+    private String targetContacts;
+
+    /**
+     * 对方联系电话
+     */
+    private String targetPhone;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}
+

+ 1 - 0
sckw-modules-api/sckw-modules-bom/pom.xml

@@ -13,6 +13,7 @@
     <properties>
         <maven.compiler.source>17</maven.compiler.source>
         <maven.compiler.target>17</maven.compiler.target>
+        <project.api.version>1.1.0</project.api.version>
     </properties>
     <dependencyManagement>
         <dependencies>

+ 23 - 0
sckw-modules-api/sckw-order-api/src/main/java/com/sckw/order/api/dubbo/TradeOrderInfoService.java

@@ -3,6 +3,8 @@ package com.sckw.order.api.dubbo;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.order.api.model.*;
 
+import java.util.List;
+
 /**
  * @desc: 贸易订单信息相关dubbo
  * @author: yzc
@@ -37,6 +39,18 @@ public interface TradeOrderInfoService {
      */
     HttpResult createOrCancelLogisticsOrder(CreateOrCancelLogisticsOrderParam param);
 
+    /**
+     * @desc: 生成或撤销物流订单
+     * @author: yzc
+     * @date: 2023-08-03 10:57
+     * @Param tOrderId: 贸易订单ID
+     * @Param unit: 单位
+     * @Param entrustAmount: 委托量
+     * @Param loading: 辅助单位信息
+     * @return: com.sckw.core.web.response.HttpResult
+     */
+    HttpResult createOrCancelLogisticsOrderV1(Long updateBy,String updateByName ,Long tOrderId, List<GoodsLoadingParam> loading);
+
     /**
      * @desc: 完结物流订单
      * @author: yzc
@@ -46,6 +60,15 @@ public interface TradeOrderInfoService {
      */
     HttpResult completeLogisticsOrder(CompleteLogisticsOrderParam param);
 
+    /**
+     * @desc: 完结物流订单
+     * @author: yzc
+     * @date: 2023-08-03 11:11
+     * @Param param:
+     * @return: com.sckw.core.web.response.HttpResult
+     */
+    HttpResult completeLogisticsOrderV1(Long updateBy,String updateByName ,Long tOrderId, List<GoodsLoadingV1Param> loading);
+
     /**
      * @desc: 更新订单实际交付量
      * @author: yzc

+ 1 - 3
sckw-modules-api/sckw-order-api/src/main/java/com/sckw/order/api/dubbo/TradeOrderStatisticsService.java

@@ -1,7 +1,5 @@
 package com.sckw.order.api.dubbo;
 
-import com.sckw.order.api.model.TradeOrderCountStatisticsDTO;
-
 import java.util.List;
 import java.util.Map;
 
@@ -19,5 +17,5 @@ public interface TradeOrderStatisticsService {
      * @Param topEntId:
      * @return: java.util.List<com.sckw.order.api.model.TradeOrderCountStatisticsDTO>
      */
-    Map<Integer, Integer> getOrderNumByTopEntId(Long topEntId);
+    Map<Integer, Integer> getOrderNumByTopEntId(Long topEntId,List<Long> enterpriseIds);
 }

+ 0 - 5
sckw-modules-api/sckw-order-api/src/main/java/com/sckw/order/api/model/CompleteLogisticsOrderParam.java

@@ -39,11 +39,6 @@ public class CompleteLogisticsOrderParam implements Serializable {
      */
     private BigDecimal actualUnloadAmount;
 
-    /**
-     * 物流订单是否已全部完结(废弃)
-     */
-    private Boolean isAllComplete;
-
     /**
      * 更新用户id 需传,订单状态变化记录需要
      */

+ 39 - 0
sckw-modules-api/sckw-order-api/src/main/java/com/sckw/order/api/model/GoodsLoadingParam.java

@@ -0,0 +1,39 @@
+package com.sckw.order.api.model;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @desc 运单装载信息
+ * @author zk
+ * @date 2023/12/7 0007
+ */
+@Data
+public class GoodsLoadingParam implements Serializable {
+
+    /**
+     * 装卸货单位
+     */
+    private String unit;
+
+    /**
+     * 委托量
+     */
+    private BigDecimal amount;
+
+    /**
+     * 装卸货数量
+     */
+    private BigDecimal loadAmount;
+
+    public GoodsLoadingParam() {
+    }
+
+    public GoodsLoadingParam(String unit, BigDecimal amount, BigDecimal loadAmount) {
+        this.unit = unit;
+        this.amount = amount;
+        this.loadAmount = loadAmount;
+    }
+}

+ 39 - 0
sckw-modules-api/sckw-order-api/src/main/java/com/sckw/order/api/model/GoodsLoadingV1Param.java

@@ -0,0 +1,39 @@
+package com.sckw.order.api.model;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @desc 运单装载信息
+ * @author zk
+ * @date 2023/12/7 0007
+ */
+@Data
+public class GoodsLoadingV1Param implements Serializable {
+
+    /**
+     * 装卸货单位
+     */
+    private String unit;
+
+    /**
+     * 装货数量
+     */
+    private BigDecimal actualLoadAmount;
+
+    /**
+     * 卸货数量
+     */
+    private BigDecimal actualUnloadAmount;
+
+    public GoodsLoadingV1Param() {
+    }
+
+    public GoodsLoadingV1Param(String unit, BigDecimal actualLoadAmount, BigDecimal actualUnloadAmount) {
+        this.unit = unit;
+        this.actualLoadAmount = actualLoadAmount;
+        this.actualUnloadAmount = actualUnloadAmount;
+    }
+}

+ 5 - 0
sckw-modules-api/sckw-order-api/src/main/java/com/sckw/order/api/model/OrderDetailRes.java

@@ -48,6 +48,11 @@ public class OrderDetailRes implements Serializable {
     @JsonProperty("tOrderNo")
     private String tOrderNo;
 
+    /**
+     * 单位(吨、方、件、箱、其他)
+     */
+    private String unit;
+
     /**
      * 订单总量
      */

+ 1 - 1
sckw-modules-api/sckw-payment-api/src/main/java/com/sckw/payment/api/dubbo/PaymentDubboService.java

@@ -49,7 +49,7 @@ public interface PaymentDubboService {
      * @param entId 集团id
      * @return
      */
-    LedgerCount countLedger(Long entId);
+    LedgerCount countLedger(Long entId,List<Long> enterpriseIds);
 
     //工作台金额统计数据四个接口
 

+ 2 - 0
sckw-modules-api/sckw-product-api/src/main/java/com/sckw/product/api/dubbo/GoodsInfoService.java

@@ -69,4 +69,6 @@ public interface GoodsInfoService {
      * @return: java.lang.Boolean
      */
     Boolean associateSupplyEnt(Long entId);
+
+    KwpGoods getGoodsByGoodsName(String goodsName);
 }

+ 5 - 0
sckw-modules-api/sckw-product-api/src/main/java/com/sckw/product/api/model/GoodsDetail.java

@@ -202,4 +202,9 @@ public class GoodsDetail implements Serializable {
      */
     private List<GoodsAttributesDetail> attributes;
 
+    /**
+     * 辅助单位
+     */
+    private List<GoodsUnitDetail> assistUnit;
+
 }

+ 42 - 0
sckw-modules-api/sckw-product-api/src/main/java/com/sckw/product/api/model/GoodsUnitDetail.java

@@ -0,0 +1,42 @@
+package com.sckw.product.api.model;
+
+import lombok.Data;
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * desc 商品-单位换算
+ * author zk
+ * date 2023/12/4 0004
+ */
+@Data
+public class GoodsUnitDetail implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 43704905372870133L;
+
+    /**
+     * 被转换单位
+     */
+    private String fromUnit;
+
+    /**
+     * 被转换单位
+     */
+    private String fromUnitName;
+
+    /**
+     * 转换目标单位
+     */
+    private String toUnit;
+
+    /**
+     * 转换目标单位
+     */
+    private String toUnitName;
+
+    /**
+     * 换算值
+     */
+    private Double conversionValue;
+}

+ 51 - 1
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteSystemService.java

@@ -1,6 +1,5 @@
 package com.sckw.system.api;
 
-import com.sckw.system.api.model.dto.res.REnterpriseVo;
 import com.sckw.system.api.model.dto.res.*;
 
 import java.util.List;
@@ -148,6 +147,15 @@ public interface RemoteSystemService {
      */
     Map<Long, EntCacheResDto> queryEntTreeByIds(List<Long> entIdList);
 
+    /**
+     * @param entPid 父级企业id
+     * @return List<KwsEntDeptDto>
+     * @desc: 查下级企业
+     * @author: czh
+     * @date: 2023/7/17
+     */
+    List<KwsEntDeptDto> queryEntDeptByPid(Long entPid);
+
     /**
      * @param entId 企业id
      * @return EntCacheResDto
@@ -157,6 +165,15 @@ public interface RemoteSystemService {
      */
     EntCacheResDto queryEntTreeById(Long entId);
 
+    /**
+     * @param entName 企业名称
+     * @return EntCacheResDto
+     * @desc: 查企业
+     * @author: czh
+     * @date: 2023/7/17
+     */
+    EntCacheResDto queryEntByName(String entName);
+
     /**
      * @param userId 用户id
      * @return UserCacheResDto
@@ -226,4 +243,37 @@ public interface RemoteSystemService {
      * @date 2023/8/10
      **/
     KwsUserResDto queryUserDetails(String account, Integer systemType);
+
+    /**
+     * @desc 查询专场集
+     * @author zk
+     * @date 2023/12/14
+     **/
+    List<SpecialResVo> querySpecial();
+
+    /**
+     * @param code 专场编号
+     * @param type 企业类型
+     * @desc 专场编号查询关联企业ID
+     * @author zk
+     * @date 2023/12/16
+     **/
+    List<Long> queryEntIdsByCode(String code, String type);
+
+    /**
+     * @param code 专场编号
+     * @desc 专场编号查询是否为主平台
+     * @author zk
+     * @date 2023/12/16
+     **/
+    boolean queryMainPlatform(String code);
+
+    /**
+     * 企业主键id查询数据库企业信息
+     * @param entIds 企业id查询数据库企业信息
+     * @return
+     */
+    Map<Long, KwsEnterpriseResDto> queryEnterpriseByEntIds(List<Long> entIds);
+
+    KwsEnterpriseResDto findEnterpriseByName(String consignCompany);
 }

+ 42 - 2
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteUserService.java

@@ -1,10 +1,10 @@
 package com.sckw.system.api;
 
 import com.sckw.core.exception.SystemException;
-import com.sckw.core.model.page.PageRes;
 import com.sckw.core.model.page.PageResult;
 import com.sckw.system.api.model.dto.req.*;
 import com.sckw.system.api.model.dto.res.*;
+
 import java.util.List;
 import java.util.Map;
 
@@ -53,10 +53,12 @@ public interface RemoteUserService {
 
     /**
      * 校验密码
+     * @param account 入参传的账号
      * @param password 入参传的密码
      * @param currentPwd 当前用户的密码
+     * @param salt 当前用户的盐
      */
-    void checkPassword(String password, String currentPwd) throws SystemException;
+    void checkPassword(String account, String password, String currentPwd, String salt) throws SystemException;
 
     /**
      * 检验用户信息
@@ -237,4 +239,42 @@ public interface RemoteUserService {
      * @date 2023/10/11
      **/
     List<Long> findUserIds(List<Long> entIds, String userName);
+
+
+    /**
+     * 通过用户id查询所有的企业信息(传递的是客户经理用户的id)
+     * @param userId 客户经理id
+     * @return list 企业id数组
+     */
+    List<Long> findEnterpriseIds(Long userId);
+
+    /**
+     * 通过用户id查询所有的企业信息(传递的是客户经理用户的id)-判断是不是管理员账户
+     * @param userId 客户经理id
+     * @return list 企业id数组
+     */
+    List<Long> findEnterpriseIdsByUserIdIsMain(Long userId);
+
+    /**
+     * 通过用户id查询所有的企业信息(传递的是客户经理用户的id)
+     * @param userIds 客户经理id
+     * @return list 企业id数组
+     */
+    List<Long> findEnterpriseListByUserIds(List<Long> userIds);
+
+    /**
+     * 通过用户id查询所有的企业信息(传递的是客户经理用户的id)
+     * @param userIds 客户经理id
+     * @return list 企业id数组
+     */
+    List<Long> findEnterpriseListByIds(List<Long> userIds);
+
+    /**
+     * 通过账号类型查出相关所有的企业账户
+     * @param systemType
+     * @return
+     */
+    List<Long> selectUserBySystemType(Integer systemType);
+
+    List<Long> findAllEnterprise();
 }

+ 5 - 0
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/req/RegisterReqDto.java

@@ -51,5 +51,10 @@ public class RegisterReqDto implements Serializable {
      */
     private String password;
 
+    /**
+     * 当前使用系统专场标识
+     */
+    private String special;
+
 
 }

+ 13 - 1
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/EntCacheResDto.java

@@ -2,7 +2,6 @@ package com.sckw.system.api.model.dto.res;
 
 import com.sckw.system.api.model.pojo.DeptInfoPojo;
 import lombok.Data;
-
 import java.io.Serial;
 import java.io.Serializable;
 import java.util.Date;
@@ -115,6 +114,9 @@ public class EntCacheResDto implements Serializable {
      */
     private String head;
 
+    /**
+     * 状态
+     */
     private Integer status;
 
     /**
@@ -127,4 +129,14 @@ public class EntCacheResDto implements Serializable {
      */
     private String legalPhone;
 
+    /**
+     * 专场标识
+     */
+    private String special;
+
+    /**
+     * 专属客户经理(用户ID)
+     */
+    private Long manager;
+
 }

+ 27 - 0
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/KwsEntDeptDto.java

@@ -0,0 +1,27 @@
+package com.sckw.system.api.model.dto.res;
+
+import lombok.Data;
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @desc 企业下级企业
+ * @author zk
+ * @date 2023/12/11 0011
+ */
+@Data
+public class KwsEntDeptDto implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 514335442672847826L;
+
+    /**
+     * 企业id
+     */
+    private Long entId;
+
+    /**
+     * 机构名称
+     */
+    private Long entPid;
+}

+ 5 - 2
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/KwsUserResDto.java

@@ -16,8 +16,6 @@ import java.util.Date;
 @Data
 public class KwsUserResDto implements Serializable {
 
-
-
     /**
      * 系统类型(1运营端、2企业开户)
      */
@@ -33,6 +31,11 @@ public class KwsUserResDto implements Serializable {
      */
     private String password;
 
+    /**
+     * 密码
+     */
+    private String salt;
+
     /**
      * 用户名
      */

+ 55 - 0
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/SpecialResVo.java

@@ -0,0 +1,55 @@
+package com.sckw.system.api.model.dto.res;
+
+import lombok.Data;
+import java.io.Serializable;
+
+/**
+ * @desc 专场信息
+ * @author zk
+ * @date 2023/12/13 0013
+ */
+@Data
+public class SpecialResVo implements Serializable {
+
+    /**
+     * 主键ID
+     */
+    private Long id;
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 网址
+     */
+    private String website;
+
+    /**
+     * 开户经理
+     */
+    private Long manager;
+
+    /**
+     * 专场编号
+     */
+    private String code;
+
+    /**
+     * 专场主企业ID
+     */
+    private Long entId;
+
+    /**
+     * 是否主平台(0否、1是)
+     */
+    private Integer isMain;
+
+    /**
+     * 状态:0正常/1锁定
+     */
+    private Integer status;
+
+
+}

+ 5 - 1
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/SysDictResDto.java

@@ -1,7 +1,6 @@
 package com.sckw.system.api.model.dto.res;
 
 import lombok.Data;
-
 import java.io.Serial;
 import java.io.Serializable;
 
@@ -36,4 +35,9 @@ public class SysDictResDto implements Serializable {
      */
     private String type;
 
+    /**
+     * 父级字典ID
+     */
+    private Long parentId;
+
 }

+ 4 - 2
sckw-modules-api/sckw-transport-api/src/main/java/com/sckw/transport/api/dubbo/TransportStatisticsService.java

@@ -1,5 +1,7 @@
 package com.sckw.transport.api.dubbo;
 
+import java.util.List;
+
 /**
  * @author lfdc
  * @version 1.0
@@ -15,7 +17,7 @@ public interface TransportStatisticsService {
      * @param topEntId
      * @return
      */
-    Integer statisticsLogistics(Long topEntId);
+    Integer statisticsLogistics(Long topEntId, List<Long> enterpriseIds);
 
     /**
      * 统计托运订单
@@ -23,7 +25,7 @@ public interface TransportStatisticsService {
      * @param topEntId
      * @return
      */
-    Integer statisticsLogisticsByConsign(Long topEntId);
+    Integer statisticsLogisticsByConsign(Long topEntId,List<Long> enterpriseIds);
 
     /**
      * 统计调度派车

+ 13 - 0
sckw-modules/pom.xml

@@ -29,6 +29,19 @@
     </modules>
 
     <properties>
+        <!--模块版本-->
+        <contract.revision>1.1.0</contract.revision>
+        <file.revision>1.1.0</file.revision>
+        <fleet.revision>1.1.0</fleet.revision>
+        <manage.revision>1.1.0</manage.revision>
+        <message.revision>1.1.0</message.revision>
+        <operation.revision>1.1.0</operation.revision>
+        <order.revision>1.1.0</order.revision>
+        <payment.revision>1.1.0</payment.revision>
+        <product.revision>1.1.0</product.revision>
+        <report.revision>1.1.0</report.revision>
+        <system.revision>1.1.0</system.revision>
+        <transport.revision>1.1.0</transport.revision>
         <maven.compiler.source>17</maven.compiler.source>
         <maven.compiler.target>17</maven.compiler.target>
     </properties>

+ 19 - 4
sckw-modules/sckw-contract/pom.xml

@@ -8,13 +8,14 @@
         <version>1.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
-
+    <version>${contract.revision}</version>
     <artifactId>sckw-contract</artifactId>
     <description>合同服务</description>
 
     <properties>
         <maven.compiler.source>17</maven.compiler.source>
         <maven.compiler.target>17</maven.compiler.target>
+        <basic.version>1.0.0</basic.version>
     </properties>
 
     <dependencies>
@@ -22,55 +23,66 @@
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-startup</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-core</artifactId>
+            <version>${basic.version}</version>
         </dependency>
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-datasource</artifactId>
+            <version>${basic.version}</version>
         </dependency>
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-remote</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-redis</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-seata</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-system-api</artifactId>
+            <version>${basic.version}</version>
         </dependency>
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-excel</artifactId>
+            <version>${basic.version}</version>
         </dependency>
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-product-api</artifactId>
-            <version>1.0.0</version>
+<!--            <version>1.0.0</version>-->
+            <version>${basic.version}</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-contract-api</artifactId>
-            <version>1.0.0</version>
+<!--            <version>1.0.0</version>-->
+            <version>${basic.version}</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-order-api</artifactId>
+            <version>${basic.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
@@ -79,15 +91,18 @@
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-log</artifactId>
-            <version>1.0.0</version>
+<!--            <version>1.0.0</version>-->
+            <version>${basic.version}</version>
         </dependency>
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-transport-api</artifactId>
+            <version>${basic.version}</version>
         </dependency>
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-stream</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
     </dependencies>

+ 13 - 1
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/dao/KwcContractLogisticsMapper.java

@@ -6,6 +6,7 @@ import com.sckw.contract.model.dto.res.QueryListResDto;
 import com.sckw.contract.model.entity.KwcContractLogistics;
 import com.sckw.contract.model.vo.req.QueryListReqVo;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -34,8 +35,19 @@ public interface KwcContractLogisticsMapper extends BaseMapper<KwcContractLogist
      * @author: czh
      * @date: 2023/9/13
      */
-    List<QueryListResDto> queryLogisticsList(QueryListReqVo reqVo);
+    List<QueryListResDto> queryLogisticsList(@Param("reqVo") QueryListReqVo reqVo, @Param("authEntIdList") List<Long> authEntIdList);
 
+    /**
+     * 判断合同是否唯一
+     *
+     * @param contractCode 合同编号
+     * @param carrierEntId 承运企业id
+     * @param checkedEntId 托运企业id
+     * @return
+     */
+    List<String> checkContractIsSole(@Param("contractCode") String contractCode, @Param("carrierEntId") Long carrierEntId, @Param("checkedEntId") Long checkedEntId);
+
+    List<KwcContractLogistics> selectIsSole(@Param("contractNo") String contractNo, @Param("acceptId") Long acceptId, @Param("consignId") Long consignId);
 }
 
 

+ 1 - 1
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/dao/KwcContractTradeMapper.java

@@ -46,7 +46,7 @@ public interface KwcContractTradeMapper extends BaseMapper<KwcContractTrade> {
      * @author: czh
      * @date: 2023/9/13
      */
-    List<QueryListResDto> queryTradeList(QueryListReqVo reqVo);
+    List<QueryListResDto> queryTradeList(@Param("reqVo") QueryListReqVo reqVo, @Param("authEntIdList") List<Long> authEntIdList);
 }
 
 

+ 74 - 14
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/dubbo/RemoteContractServiceImpl.java

@@ -2,8 +2,10 @@ package com.sckw.contract.dubbo;
 
 import com.sckw.contract.api.RemoteContractService;
 import com.sckw.contract.api.model.dto.res.ContractCommonInfoResDto;
+import com.sckw.contract.api.model.dto.res.ContractLogisticsOrderResDto;
 import com.sckw.contract.api.model.dto.res.EntInfo;
 import com.sckw.contract.dao.KwcContractLogisticsMapper;
+import com.sckw.contract.dao.KwcContractLogisticsUnitMapper;
 import com.sckw.contract.dao.KwcContractTradeMapper;
 import com.sckw.contract.model.dto.res.QueryContractValidCountResDto;
 import com.sckw.contract.model.entity.KwcContractLogistics;
@@ -12,10 +14,10 @@ import com.sckw.contract.model.entity.KwcContractTrade;
 import com.sckw.contract.service.KwcContractLogisticsUnitService;
 import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.enums.ContractStatusEnum;
+import com.sckw.core.model.enums.CooperateTypeEnum;
 import com.sckw.core.model.enums.SigningWayEnum;
 import com.sckw.core.utils.CollectionUtils;
 import com.sckw.system.api.RemoteSystemService;
-import com.sckw.system.api.model.dto.res.EntCacheResDto;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.apache.dubbo.config.annotation.DubboService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -35,13 +37,16 @@ public class RemoteContractServiceImpl implements RemoteContractService {
     @Autowired
     private KwcContractLogisticsMapper kwcContractLogisticsMapper;
 
+    @Autowired
+    private KwcContractLogisticsUnitMapper kwcContractLogisticsUnitMapper;
+
     @Autowired
     private KwcContractLogisticsUnitService kwcContractLogisticsUnitService;
 
     @Autowired
     private KwcContractTradeMapper kwcContractTradeMapper;
 
-    @DubboReference(version = "1.0.0", group = "design", check = false)
+    @DubboReference(version = "1.0.0", group = "design", check = false, timeout = 8000)
     private RemoteSystemService remoteSystemService;
 
     @Override
@@ -110,19 +115,38 @@ public class RemoteContractServiceImpl implements RemoteContractService {
      * @date: 2023/9/8
      */
     @Override
-    public Map<Integer, Integer> queryContractValidCount(Long entId) {
+    public Map<Integer, Integer> queryContractValidCount(Long entId, List<Long> enterpriseIds) {
         List<Long> entIdList = new ArrayList<>();
-        if (Objects.nonNull(entId)) {
-            EntCacheResDto entCacheResDto = remoteSystemService.queryEntTreeById(entId);
-            if (Objects.isNull(entCacheResDto)) {
-                return Collections.emptyMap();
-            }
-            entIdList.add(entId);
-            List<EntCacheResDto> child = entCacheResDto.getChild();
-            if (CollectionUtils.isNotEmpty(child)) {
-                entIdList.addAll(child.stream().map(EntCacheResDto::getId).toList());
-            }
-        }
+        //原来的
+//        if (Objects.nonNull(entId)) {
+//            EntCacheResDto entCacheResDto = remoteSystemService.queryEntTreeById(entId);
+//            if (Objects.isNull(entCacheResDto)) {
+//                return Collections.emptyMap();
+//            }
+//            entIdList.add(entId);
+//            List<EntCacheResDto> child = entCacheResDto.getChild();
+//            if (CollectionUtils.isNotEmpty(child)) {
+//                entIdList.addAll(child.stream().map(EntCacheResDto::getId).toList());
+//            }
+//        }
+
+        //加客户经理数据过滤
+        enterpriseIds.add(entId);
+        enterpriseIds = enterpriseIds.stream().distinct().collect(Collectors.toList());
+        entIdList.addAll(enterpriseIds);
+//        if (Objects.nonNull(enterpriseIds) && enterpriseIds.size() > 0) {
+//            for (Long aLong : entIdList) {
+//                EntCacheResDto entCacheResDto = remoteSystemService.queryEntTreeById(aLong);
+//                if (Objects.isNull(entCacheResDto)) {
+//                    return Collections.emptyMap();
+//                }
+//                entIdList.add(aLong);
+//                List<EntCacheResDto> child = entCacheResDto.getChild();
+//                if (CollectionUtils.isNotEmpty(child)) {
+//                    entIdList.addAll(child.stream().map(EntCacheResDto::getId).toList());
+//                }
+//            }
+//        }
 
         List<QueryContractValidCountResDto> queryContractValidCountResDtos = kwcContractTradeMapper.queryContractValidCount(entIdList);
         if (CollectionUtils.isEmpty(queryContractValidCountResDtos)) {
@@ -132,6 +156,42 @@ public class RemoteContractServiceImpl implements RemoteContractService {
         return queryContractValidCountResDtos.stream().collect(Collectors.toMap(QueryContractValidCountResDto::getUnitType, QueryContractValidCountResDto::getCnt, (o, n) -> n));
     }
 
+    /**
+     * @param contractNo 合同编号
+     * @param acceptId   承运企业id
+     * @param consignId  托运企业id
+     * @return
+     */
+    @Override
+    public ContractLogisticsOrderResDto getContractByContractNo(String contractNo, Long acceptId, Long consignId) {
+        ContractLogisticsOrderResDto logisticsOrderResDto = new ContractLogisticsOrderResDto();
+        List<KwcContractLogistics> list = kwcContractLogisticsMapper.selectIsSole(contractNo, acceptId, consignId);
+        if (list.size() > 0) {
+            KwcContractLogistics contractLogistics = list.get(0);
+            logisticsOrderResDto.setId(contractLogistics.getId());
+            logisticsOrderResDto.setContactName(contractLogistics.getName());
+            logisticsOrderResDto.setContractNo(contractLogistics.getContractNo());
+            logisticsOrderResDto.setSigningWay(contractLogistics.getSigningWay());
+            logisticsOrderResDto.setSigningWayName(Objects.requireNonNull(SigningWayEnum.getName(contractLogistics.getSigningWay())).getName());
+            logisticsOrderResDto.setStatus(contractLogistics.getStatus());
+            logisticsOrderResDto.setStatusName((Objects.requireNonNull(ContractStatusEnum.getName(contractLogistics.getStatus())).getName()));
+            List<KwcContractLogisticsUnit> kwcContractLogisticsUnits = kwcContractLogisticsUnitService.queryByContractId(contractLogistics.getId());
+            if (CollectionUtils.isNotEmpty(kwcContractLogisticsUnits)) {
+                for (KwcContractLogisticsUnit kwcContractLogisticsUnit : kwcContractLogisticsUnits) {
+                    if (kwcContractLogisticsUnit.getUnitType().equals(CooperateTypeEnum.CONSIGN.getCode())) {
+                        logisticsOrderResDto.setConsignEntId(kwcContractLogisticsUnit.getEntId());
+                        logisticsOrderResDto.setConsignEntName(kwcContractLogisticsUnit.getFirmName());
+                    }
+                    if (kwcContractLogisticsUnit.getUnitType().equals(CooperateTypeEnum.CARRIAGE.getCode())) {
+                        logisticsOrderResDto.setAcceptCarriageEntId(kwcContractLogisticsUnit.getEntId());
+                        logisticsOrderResDto.setAcceptCarriageEntName(kwcContractLogisticsUnit.getFirmName());
+                    }
+                }
+            }
+        }
+        return logisticsOrderResDto;
+    }
+
     private ContractCommonInfoResDto fillContractLogistics(KwcContractLogistics kwcContractLogistics) {
         ContractCommonInfoResDto contractCommonInfoResDto = new ContractCommonInfoResDto();
         List<EntInfo> entList = new ArrayList<>();

+ 43 - 15
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/KwcContractLogisticsService.java

@@ -1,9 +1,5 @@
 package com.sckw.contract.service;
 
-import java.io.File;
-import java.util.Date;
-
-import cn.hutool.core.date.DateUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -21,6 +17,7 @@ import com.sckw.contract.model.vo.req.*;
 import com.sckw.contract.model.vo.res.*;
 import com.sckw.core.common.enums.enums.DictEnum;
 import com.sckw.core.common.enums.enums.DictTypeEnum;
+import com.sckw.core.exception.BusinessException;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.enums.ContractStatusEnum;
@@ -120,10 +117,6 @@ public class KwcContractLogisticsService {
     @Value(value = "${jumpUrl.appAcceptanceSendContract}")
     private String appAcceptanceSendContract;
 
-
-    @Value(value = "${filePathPrefix}")
-    private String filePathPrefix;
-
     /**
      * @param reqVo 新增入参
      * @desc: 新增托运合同
@@ -142,7 +135,15 @@ public class KwcContractLogisticsService {
             update(reqVo);
             return id;
         }
-
+        //合同编号+企业双方判定唯一
+        String contractCode = baseInfo.getContractCode();
+        String key = contractCode + baseInfo.getCarrierEntId() + baseInfo.getCheckedEntId();
+        List<String> isSoleKey = kwcContractLogisticsMapper.checkContractIsSole(contractCode, baseInfo.getCarrierEntId(), baseInfo.getCheckedEntId());
+        if (isSoleKey.size() > 0) {
+            if (isSoleKey.contains(key)) {
+                throw new BusinessException("新增合同时,合同编号一致时,双方已存在合同,不可重复创建!");
+            }
+        }
         //创建合同
         KwcContractLogistics kwcContractLogistics = getKwcContractLogistics(baseInfo, goodsInfo, reqVo.getRemark(), reqVo.getPid());
         long contactId = new IdWorker(1L).nextId();
@@ -465,7 +466,6 @@ public class KwcContractLogisticsService {
     }
 
 
-
     private void sendLogisticsMessage(KwcContractLogistics kwcContractLogistics) {
         try {
             List<KwcContractLogisticsUnit> kwcContractLogisticsUnits = kwcContractLogisticsUnitService.queryByContractId(kwcContractLogistics.getId());
@@ -661,7 +661,7 @@ public class KwcContractLogisticsService {
                     acceptanceSendContract,
                     appAcceptanceSendContract);
         } catch (Exception e) {
-           log.error("完结合同消息出错:", e);
+            log.error("完结合同消息出错:", e);
         }
     }
 
@@ -908,7 +908,18 @@ public class KwcContractLogisticsService {
      */
     public PageResult queryLogisticsByPage(QueryListReqVo reqVo) {
         PageHelper.startPage(reqVo.getPage(), reqVo.getPageSize());
-        List<QueryListResDto> queryListResDtos = kwcContractLogisticsMapper.queryLogisticsList(reqVo);
+
+        //新增客户经理权限过滤
+        List<Long> authEntIdList = LoginUserHolder.getAuthEntIdList();
+        if (CollectionUtils.isEmpty(authEntIdList)) {
+            List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+            if (CollectionUtils.isEmpty(ids)) {
+                return PageHelperUtil.getPageResult(new PageInfo<>());
+            }
+            authEntIdList.addAll(ids);
+        }
+
+        List<QueryListResDto> queryListResDtos = kwcContractLogisticsMapper.queryLogisticsList(reqVo, authEntIdList);
         if (CollectionUtils.isEmpty(queryListResDtos)) {
             return PageHelperUtil.getPageResult(new PageInfo<>());
         }
@@ -966,8 +977,16 @@ public class KwcContractLogisticsService {
             findListGroupResVo.setCount(0);
             list.add(findListGroupResVo);
         }
-
-        List<QueryListResDto> queryListResDtoList = kwcContractLogisticsMapper.queryLogisticsList(reqVo);
+        //新增客户经理权限过滤
+        List<Long> authEntIdList = LoginUserHolder.getAuthEntIdList();
+        if (CollectionUtils.isEmpty(authEntIdList)) {
+            List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+            if (CollectionUtils.isEmpty(ids)) {
+                return list;
+            }
+            authEntIdList.addAll(ids);
+        }
+        List<QueryListResDto> queryListResDtoList = kwcContractLogisticsMapper.queryLogisticsList(reqVo, authEntIdList);
         if (CollectionUtils.isNotEmpty(queryListResDtoList)) {
             Map<Integer, List<QueryListResDto>> collect = queryListResDtoList.stream().collect(Collectors.groupingBy(QueryListResDto::getStatus));
             for (FindListGroupResVo findListGroupResVo : list) {
@@ -989,7 +1008,16 @@ public class KwcContractLogisticsService {
      */
     public void exportLogisticsList(QueryListReqVo reqVo, HttpServletResponse response) {
         reqVo.setIdList(StringUtils.splitStrToList(reqVo.getIds(), Global.COMMA, Long.class));
-        List<QueryListResDto> queryListResDtos = kwcContractLogisticsMapper.queryLogisticsList(reqVo);
+        //新增客户经理权限过滤
+        List<Long> authEntIdList = LoginUserHolder.getAuthEntIdList();
+        if (CollectionUtils.isEmpty(authEntIdList)) {
+            List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+            if (CollectionUtils.isEmpty(ids)) {
+                throw new SystemException(HttpStatus.SUCCESS_CODE, "暂无数据,请确认!");
+            }
+            authEntIdList.addAll(ids);
+        }
+        List<QueryListResDto> queryListResDtos = kwcContractLogisticsMapper.queryLogisticsList(reqVo, authEntIdList);
         if (CollectionUtils.isEmpty(queryListResDtos)) {
             throw new SystemException(HttpStatus.SUCCESS_CODE, "暂无数据,请确认!");
         }

+ 40 - 20
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/KwcContractTradeService.java

@@ -1,24 +1,19 @@
 package com.sckw.contract.service;
 
-import java.io.IOException;
-import java.util.Date;
-
-import cn.hutool.core.date.DatePattern;
-import cn.hutool.core.date.DateTime;
-import cn.hutool.core.date.DateUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.sckw.contract.dao.KwcContractTradeMapper;
 import com.sckw.contract.model.dto.req.QueryListReqDto;
 import com.sckw.contract.model.dto.res.QueryListResDto;
-import com.sckw.contract.model.entity.*;
-import com.sckw.contract.model.report.LogisticsListExport;
+import com.sckw.contract.model.entity.KwcContractTrade;
+import com.sckw.contract.model.entity.KwcContractTradeGoods;
+import com.sckw.contract.model.entity.KwcContractTradeUnit;
 import com.sckw.contract.model.report.TradeListExport;
 import com.sckw.contract.model.vo.req.*;
-
 import com.sckw.contract.model.vo.res.*;
 import com.sckw.core.common.enums.enums.DictEnum;
 import com.sckw.core.common.enums.enums.DictTypeEnum;
@@ -33,7 +28,6 @@ import com.sckw.core.model.page.PageResult;
 import com.sckw.core.utils.*;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
-import com.sckw.excel.utils.EasyExcelUtil;
 import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.order.api.dubbo.TradeOrderInfoService;
 import com.sckw.order.api.model.ContractSignCompletedParam;
@@ -41,6 +35,7 @@ import com.sckw.product.api.dubbo.GoodsInfoService;
 import com.sckw.product.api.model.KwpGoods;
 import com.sckw.stream.enums.MessageEnum;
 import com.sckw.stream.model.UserInfo;
+import com.sckw.system.api.RemoteSystemService;
 import com.sckw.system.api.RemoteUserService;
 import com.sckw.system.api.model.dto.res.EntCacheResDto;
 import com.sckw.system.api.model.dto.res.KwsUserResDto;
@@ -53,15 +48,12 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-import com.sckw.system.api.RemoteSystemService;
 
 import java.math.BigDecimal;
 import java.util.*;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
-import com.sckw.contract.dao.KwcContractTradeMapper;
-
 /**
  * @author PC
  * @description 针对表【kwc_contract_trade(交易合同(采购合同/销售合同))】的数据库操作Service实现
@@ -131,10 +123,6 @@ public class KwcContractTradeService {
     @Value(value = "${jumpUrl.appAcceptanceSendContract}")
     private String appAcceptanceSendContract;
 
-
-    @Value(value = "${filePathPrefix}")
-    private String filePathPrefix;
-
     /**
      * @return PageResult
      * @desc: 分页查询
@@ -923,7 +911,18 @@ public class KwcContractTradeService {
      */
     public PageResult queryTradeByPage(QueryListReqVo reqVo) {
         PageHelper.startPage(reqVo.getPage(), reqVo.getPageSize());
-        List<QueryListResDto> queryListResDtos = kwcContractTradeMapper.queryTradeList(reqVo);
+
+        //新增客户经理权限过滤
+        List<Long> authEntIdList = LoginUserHolder.getAuthEntIdList();
+        if (CollectionUtils.isEmpty(authEntIdList)) {
+            List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+            if (CollectionUtils.isEmpty(ids)) {
+                return PageHelperUtil.getPageResult(new PageInfo<>());
+            }
+            authEntIdList.addAll(ids);
+        }
+
+        List<QueryListResDto> queryListResDtos = kwcContractTradeMapper.queryTradeList(reqVo,authEntIdList);
         if (CollectionUtils.isEmpty(queryListResDtos)) {
             return PageHelperUtil.getPageResult(new PageInfo<>());
         }
@@ -980,7 +979,17 @@ public class KwcContractTradeService {
             list.add(findListGroupResVo);
         }
 
-        List<QueryListResDto> queryListResDtoList = kwcContractTradeMapper.queryTradeList(reqVo);
+        //新增客户经理权限过滤
+        List<Long> authEntIdList = LoginUserHolder.getAuthEntIdList();
+        if (CollectionUtils.isEmpty(authEntIdList)) {
+            List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+            if (CollectionUtils.isEmpty(ids)) {
+                return list;
+            }
+            authEntIdList.addAll(ids);
+        }
+
+        List<QueryListResDto> queryListResDtoList = kwcContractTradeMapper.queryTradeList(reqVo,authEntIdList);
         if (CollectionUtils.isNotEmpty(queryListResDtoList)) {
             Map<Integer, List<QueryListResDto>> collect = queryListResDtoList.stream().collect(Collectors.groupingBy(QueryListResDto::getStatus));
             for (FindListGroupResVo findListGroupResVo : list) {
@@ -1002,7 +1011,18 @@ public class KwcContractTradeService {
      */
     public void exportTradeList(QueryListReqVo reqVo, HttpServletResponse response) {
         reqVo.setIdList(StringUtils.splitStrToList(reqVo.getIds(), Global.COMMA, Long.class));
-        List<QueryListResDto> queryListResDtos = kwcContractTradeMapper.queryTradeList(reqVo);
+
+        //新增客户经理权限过滤
+        List<Long> authEntIdList = LoginUserHolder.getAuthEntIdList();
+        if (CollectionUtils.isEmpty(authEntIdList)) {
+            List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+            if (CollectionUtils.isEmpty(ids)) {
+                throw new SystemException(HttpStatus.SUCCESS_CODE, "暂无数据,请确认!");
+            }
+            authEntIdList.addAll(ids);
+        }
+
+        List<QueryListResDto> queryListResDtos = kwcContractTradeMapper.queryTradeList(reqVo,authEntIdList);
         if (CollectionUtils.isEmpty(queryListResDtos)) {
             throw new SystemException(HttpStatus.SUCCESS_CODE, "暂无数据,请确认!");
         }

+ 0 - 1
sckw-modules/sckw-contract/src/main/resources/bootstrap.yml

@@ -6,7 +6,6 @@ spring:
     name: sckw-contract
   profiles:
     active:  @profiles.active@
-#    active:  lfdc
   main:
     allow-bean-definition-overriding: true
     allow-circular-references: true

+ 53 - 19
sckw-modules/sckw-contract/src/main/resources/mapper/KwcContractLogisticsMapper.xml

@@ -122,36 +122,70 @@
           left join kwc_contract_logistics f on f.id = a.contract_pid
          where a.del_flag = 0
            and a.status != 3
-        <if test="startTime != null">
-            and a.create_time >= #{startTime}
+        <if test="authEntIdList != null and authEntIdList.size() != 0">
+            and a.ent_id in
+            <foreach collection="authEntIdList" separator="," close=")" open="(" item="item">
+                #{item}
+            </foreach>
         </if>
-        <if test="endTime != null">
-            and a.create_time &lt;= #{endTime}
+        <if test="reqVo.startTime != null">
+            and a.create_time >= #{reqVo.startTime}
         </if>
-        <if test="status != null">
-            and a.status = #{status}
+        <if test="reqVo.endTime != null">
+            and a.create_time &lt;= #{reqVo.endTime}
         </if>
-        <if test="signingWay != null">
-            and a.signing_way = #{signingWay}
+        <if test="reqVo.status != null">
+            and a.status = #{reqVo.status}
         </if>
-        <if test="charging != null">
-            and a.charging = #{charging}
+        <if test="reqVo.signingWay != null">
+            and a.signing_way = #{reqVo.signingWay}
         </if>
-        <if test="keywords != null and keywords != ''">
-            and (b.firm_name like concat('%', #{keywords}, '%') or
-                 e.firm_name like concat('%', #{keywords}, '%') or
-                 b.contacts like concat('%', #{keywords}, '%') or
-                 e.contacts like concat('%', #{keywords}, '%') or
-                 a.contract_no like concat('%', #{keywords}, '%') or
-                 a.name like concat('%', #{keywords}, '%'))
+        <if test="reqVo.charging != null">
+            and a.charging = #{reqVo.charging}
         </if>
-        <if test="idList != null and idList.size() > 0">
+        <if test="reqVo.keywords != null and reqVo.keywords != ''">
+            and (b.firm_name like concat('%', #{reqVo.keywords}, '%') or
+                 e.firm_name like concat('%', #{reqVo.keywords}, '%') or
+                 b.contacts like concat('%', #{reqVo.keywords}, '%') or
+                 e.contacts like concat('%', #{reqVo.keywords}, '%') or
+                 a.contract_no like concat('%', #{reqVo.keywords}, '%') or
+                 a.name like concat('%', #{reqVo.keywords}, '%'))
+        </if>
+        <if test="reqVo.idList != null and reqVo.idList.size() > 0">
             and a.id in
-            <foreach collection="idList" open="(" close=")" separator="," item="item">
+            <foreach collection="reqVo.idList" open="(" close=")" separator="," item="item">
                 #{item}
             </foreach>
         </if>
         order by a.create_time desc
     </select>
 
+    <select id="checkContractIsSole" resultType="java.lang.String">
+        SELECT
+            DISTINCT CONCAT(a.contract_no,b.ent_id,c.ent_id)  as isSole
+        FROM
+            kwc_contract_logistics a
+                LEFT JOIN kwc_contract_logistics_unit b ON a.id = b.contract_id
+                LEFT JOIN kwc_contract_logistics_unit c ON a.id = c.contract_id
+        WHERE
+            a.del_flag = 0
+          AND b.unit_type = 4
+          AND c.unit_type = 3
+    </select>
+
+    <select id="selectIsSole" resultType="com.sckw.contract.model.entity.KwcContractLogistics">
+        SELECT
+            a.*
+        FROM
+            kwc_contract_logistics a
+                LEFT JOIN kwc_contract_logistics_unit b ON a.id = b.contract_id
+                LEFT JOIN kwc_contract_logistics_unit c ON a.id = c.contract_id
+        WHERE
+            a.del_flag = 0
+          AND b.unit_type = 4
+          AND c.unit_type = 3
+        and b.ent_id =#{acceptId}
+        and c.ent_id =#{consignId}
+        and a.contract_no=#{contractNo}
+    </select>
 </mapper>

+ 25 - 19
sckw-modules/sckw-contract/src/main/resources/mapper/KwcContractTradeMapper.xml

@@ -149,34 +149,40 @@
         left join kwc_contract_trade f on a.contract_pid = f.id
         where a.del_flag = 0
           and a.status != 3
-        <if test="startTime != null">
-            and a.create_time >= #{startTime}
+        <if test="authEntIdList != null and authEntIdList.size() != 0">
+            and a.ent_id in
+            <foreach collection="authEntIdList" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
         </if>
-        <if test="endTime != null">
-            and a.create_time &lt;= #{endTime}
+        <if test="reqVo.startTime != null">
+            and a.create_time >= #{reqVo.startTime}
         </if>
-        <if test="status != null">
-            and a.status = #{status}
+        <if test="reqVo.endTime != null">
+            and a.create_time &lt;= #{reqVo.endTime}
         </if>
-        <if test="keywords != null and keywords != ''">
-            and (b.firm_name like concat('%', #{keywords}, '%') or
-                 e.firm_name like concat('%', #{keywords}, '%') or
-                 b.contacts like concat('%', #{keywords}, '%') or
-                 e.contacts like concat('%', #{keywords}, '%') or
-                 a.contract_no like concat('%', #{keywords}, '%') or
-                 a.name like concat('%', #{keywords}, '%'))
+        <if test="reqVo.status != null">
+            and a.status = #{reqVo.status}
         </if>
-        <if test="idList != null and idList.size() > 0">
+        <if test="reqVo.keywords != null and reqVo.keywords != ''">
+            and (b.firm_name like concat('%', #{reqVo.keywords}, '%') or
+                 e.firm_name like concat('%', #{reqVo.keywords}, '%') or
+                 b.contacts like concat('%', #{reqVo.keywords}, '%') or
+                 e.contacts like concat('%', #{reqVo.keywords}, '%') or
+                 a.contract_no like concat('%', #{reqVo.keywords}, '%') or
+                 a.name like concat('%', #{reqVo.keywords}, '%'))
+        </if>
+        <if test="reqVo.idList != null and reqVo.idList.size() > 0">
             and a.id in
-            <foreach collection="idList" open="(" close=")" separator="," item="item">
+            <foreach collection="reqVo.idList" open="(" close=")" separator="," item="item">
                 #{item}
             </foreach>
         </if>
-        <if test="trading != null">
-            and a.trading = #{trading}
+        <if test="reqVo.trading != null">
+            and a.trading = #{reqVo.trading}
         </if>
-        <if test="signingWay != null">
-            and a.signing_way = #{signingWay}
+        <if test="reqVo.signingWay != null">
+            and a.signing_way = #{reqVo.signingWay}
         </if>
         order by a.create_time desc
     </select>

+ 20 - 1
sckw-modules/sckw-example/pom.xml

@@ -8,12 +8,14 @@
         <version>1.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
-
+    <version>${example.revision}</version>
     <artifactId>sckw-example</artifactId>
 
     <properties>
         <maven.compiler.source>17</maven.compiler.source>
         <maven.compiler.target>17</maven.compiler.target>
+        <upgrade.version>1.1.0</upgrade.version>
+        <basic.version>1.0.0</basic.version>
     </properties>
 
     <dependencies>
@@ -21,84 +23,101 @@
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-startup</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-core</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-mongo</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-xxljob</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-stream</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-remote</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-redis</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-excel</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-datasource</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-seata</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-sentinel</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-system-api</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-file-api</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-message-api</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-order-api</artifactId>
+            <version>${basic.version}</version>
         </dependency>
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-payment-api</artifactId>
+            <version>${basic.version}</version>
         </dependency>
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-transport-api</artifactId>
+            <version>${basic.version}</version>
         </dependency>
         <!--junit-->
         <dependency>

+ 1 - 1
sckw-modules/sckw-example/src/main/java/com/sckw/example/controller/ExcelExportController.java

@@ -1,7 +1,7 @@
 package com.sckw.example.controller;
 
 import com.alibaba.fastjson.JSONObject;
-import com.sckw.core.common.enums.NumberConstant;
+import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.core.model.file.FileInfo;
 import com.sckw.core.utils.IdWorker;
 import com.sckw.core.utils.StringUtils;

+ 86 - 118
sckw-modules/sckw-example/src/main/java/com/sckw/example/controller/SysUserController.java

@@ -1,117 +1,87 @@
-//package com.sckw.example.controller;
-//
-//import cn.hutool.core.lang.UUID;
-//import com.alibaba.csp.sentinel.annotation.SentinelResource;
-//import com.alibaba.fastjson2.JSON;
-//import com.sckw.core.model.page.PageResult;
-//import com.sckw.core.web.exceptionHandler.CustomBlockExceptionHandler;
-//import com.sckw.core.web.response.HttpResult;
-//import com.sckw.example.model.SysUser;
-//import com.sckw.example.model.TestSensitive;
-//import com.sckw.example.service.SysUserService;
-//import com.sckw.stream.enums.SmsCodeEnum;
-//import com.sckw.stream.model.SckwMessage;
-//import com.sckw.stream.model.SckwSms;
-//import lombok.AllArgsConstructor;
-//import lombok.extern.slf4j.Slf4j;
-//import org.redisson.api.RBucket;
-//import org.redisson.api.RedissonClient;
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.cloud.stream.function.StreamBridge;
-//import org.springframework.web.bind.annotation.*;
-//
-//import javax.annotation.Resource;
-//import java.util.Date;
-//import java.util.HashMap;
-//import java.util.List;
-//import java.util.Map;
-//
-//@Slf4j
-//@AllArgsConstructor
-//@RestController
-//@RequestMapping("/")
-//public class SysUserController {
-//
-//    @Autowired
-//    SysUserService sysUserService;
-//
-//    @Autowired
-//    RedissonClient redissonClient;
-//
-//    /*@Autowired
-//    RedisService redisService;*/
-//
-//    @GetMapping("index")
-//    public Object test(){
-//        Map result = new HashMap();
-//        result.put("user", System.currentTimeMillis());
-//        result.put("datatime", System.currentTimeMillis());
-//        result.put("database", "redis");
-//
-//        RBucket<Object> mytest = redissonClient.getBucket("mytest");
-//        mytest.set("value");
-//        System.out.println(mytest.get());//value
-//        mytest.set("value2");
-//        System.out.println(mytest.get());//value2
-//        boolean b = mytest.compareAndSet("value2", result); //true
-//        System.out.println(mytest.get());//value3
-//        Object resultObj = mytest.get();
-//
-//        /*result.put("type", "spring boot");
-//        redisService.setCacheMap("value2", result);
-//        resultObj = redisService.getCacheMap("value2");*/
-//
-//        return String.valueOf(resultObj);
-//    }
-//
-//    //@Override
-//    public String getUserInfo(String account) {
-//        return account + String.valueOf(new Date());
-//    }
-//
-//    @PostMapping("findByAccount")
-//    public HttpResult findByAccount(HashMap params) {
-//        List<SysUser> data = sysUserService.findByAccount(params);
-//        return HttpResult.ok(data);
-//    }
-//
-//    @PostMapping("findPage")
-//    public HttpResult findPage(Map<String, Object> params) {
-//        PageResult pageResult = sysUserService.findPage(params);
-//        return HttpResult.ok(pageResult);
-//    }
-//
-//
-//    /**
-//     * 限流测试示例
-//     * @return
-//     */
-//    //value将该方法定义为sentinel的资源,blockHandlerClass指明流控处理的类,blockHandler是流控时调用的方法。
-//    //这里需要注意处理异常的方法必须是静态方法添加static, 并需要添加sentinel的异常参数BlockException。
-//    @RequestMapping(value = "sentinelFlowDemo", method = RequestMethod.GET)
-//    @SentinelResource(value = "sentinelFlowDemo", blockHandlerClass = CustomBlockExceptionHandler.class, blockHandler = "sentinelFlowBlock")
-//    public HttpResult sentinelFlowDemo() {
-//        return HttpResult.ok("sentinelFlowDemo正常返回");
-//    }
-//
-//    /**
-//     * 熔断测试示例
-//     * @param id
-//     * @return
-//     */
-//    @RequestMapping(value = "sentinelDegradeDemo", method = RequestMethod.GET)
-//    @SentinelResource(value = "sentinelDegradeDemo", blockHandlerClass = SysUserController.class, blockHandler = "sentinelDegradeBlock")
-//    public HttpResult sentinelDegradeDemo(@RequestParam("id") String id) {
-//        if ("2".equals(id)){
-//            try {
-//                Thread.sleep(5000);
-//            } catch (InterruptedException e) {
-//                throw new RuntimeException(e);
-//            }
-//        }
-//        return HttpResult.ok("sentinelDegradeDemo正常返回");
-//    }
-//
+////package com.sckw.example.controller;
+////
+////import cn.hutool.core.lang.UUID;
+////import com.alibaba.csp.sentinel.annotation.SentinelResource;
+////import com.alibaba.fastjson2.JSON;
+////import com.sckw.core.model.page.PageResult;
+////import com.sckw.core.web.exceptionHandler.CustomBlockExceptionHandler;
+////import com.sckw.core.web.response.HttpResult;
+////import com.sckw.example.model.SysUser;
+////import com.sckw.example.model.TestSensitive;
+////import com.sckw.example.service.SysUserService;
+////import com.sckw.stream.enums.SmsCodeEnum;
+////import com.sckw.stream.model.SckwMessage;
+////import com.sckw.stream.model.SckwSms;
+////import lombok.AllArgsConstructor;
+////import lombok.extern.slf4j.Slf4j;
+////import org.redisson.api.RBucket;
+////import org.redisson.api.RedissonClient;
+////import org.springframework.beans.factory.annotation.Autowired;
+////import org.springframework.cloud.stream.function.StreamBridge;
+////import org.springframework.web.bind.annotation.*;
+////
+////import javax.annotation.Resource;
+////import java.util.Date;
+////import java.util.HashMap;
+////import java.util.List;
+////import java.util.Map;
+////
+////@Slf4j
+////@AllArgsConstructor
+////@RestController
+////@RequestMapping("/")
+////public class SysUserController {
+////
+////    @Autowired
+////    SysUserService sysUserService;
+////
+////    @Autowired
+////    RedissonClient redissonClient;
+////
+////    /*@Autowired
+////    RedisService redisService;*/
+////
+////    @GetMapping("index")
+////    public Object test(){
+////        Map result = new HashMap();
+////        result.put("user", System.currentTimeMillis());
+////        result.put("datatime", System.currentTimeMillis());
+////        result.put("database", "redis");
+////
+////        RBucket<Object> mytest = redissonClient.getBucket("mytest");
+////        mytest.set("value");
+////        System.out.println(mytest.get());//value
+////        mytest.set("value2");
+////        System.out.println(mytest.get());//value2
+////        boolean b = mytest.compareAndSet("value2", result); //true
+////        System.out.println(mytest.get());//value3
+////        Object resultObj = mytest.get();
+////
+////        /*result.put("type", "spring boot");
+////        redisService.setCacheMap("value2", result);
+////        resultObj = redisService.getCacheMap("value2");*/
+////
+////        return String.valueOf(resultObj);
+////    }
+////
+////    //@Override
+////    public String getUserInfo(String account) {
+////        return account + String.valueOf(new Date());
+////    }
+////
+////    @PostMapping("findByAccount")
+////    public HttpResult findByAccount(HashMap params) {
+////        List<SysUser> data = sysUserService.findByAccount(params);
+////        return HttpResult.ok(data);
+////    }
+////
+////    @PostMapping("findPage")
+////    public HttpResult findPage(Map<String, Object> params) {
+////        PageResult pageResult = sysUserService.findPage(params);
+////        return HttpResult.ok(pageResult);
+////    }
+////
+////
 ////    /**
 ////     * 分布式事务示例
 ////     * @return
@@ -123,11 +93,9 @@
 ////    }
 //
 //
+//import org.springframework.web.bind.annotation.GetMapping;
 //
-//
-//
-//
-//    @GetMapping("/testSensitive")
+//@GetMapping("/testSensitive")
 //    public HttpResult testSensitive() {
 //        TestSensitive testSensitive = new TestSensitive();
 //        testSensitive.setIdCard("210397198608215431");

+ 25 - 0
sckw-modules/sckw-example/src/main/java/com/sckw/example/controller/TransportController.java

@@ -1,18 +1,23 @@
 package com.sckw.example.controller;
 
+import com.sckw.core.model.constant.Global;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.example.service.TransportService;
 import com.sckw.redis.config.RedisLockUtil;
+import com.sckw.redis.utils.RedissonUtils;
 import com.sckw.system.api.RemoteSystemService;
 import com.sckw.system.api.model.dto.res.EntCacheResDto;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.config.annotation.DubboReference;
+import org.redisson.api.RSet;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.ArrayList;
+
 /**
  * @desc: 测试
  * @author: lfdc
@@ -82,6 +87,26 @@ public class TransportController {
 
     @RequestMapping(value = "/getRedissionDemo", method = RequestMethod.GET)
     public void getRedissionDemo() {
+        long l = System.currentTimeMillis();
+        RedissonUtils.putSet(String.valueOf(l),new ArrayList<Long>(){{add(789456L);add(456789L);add(123456789L);}});
+        RSet<Object> set = RedissonUtils.getSet(String.valueOf(l));
+        long l1 = System.currentTimeMillis();
+        RedissonUtils.put(String.valueOf(l1),new ArrayList<Long>(){{add(789456L);add(456789L);add(123456789L);}}, Global.APP_TOKEN_EXPIRE);
+        RSet<Object> set1 = RedissonUtils.getSet(String.valueOf(l1));
+
+        //redis  set方式
+        long l2 = System.currentTimeMillis();
+        RedissonUtils.putSet(String.valueOf(l2),new ArrayList<Long>(){{add(789456L);add(456789L);add(123456789L);}});
+        RSet<Object> set2 = RedissonUtils.getSet(String.valueOf(l2));
+
+        //redis  set方式 -带有时间
+        long l24 = System.currentTimeMillis();
+        long l241 = System.currentTimeMillis();
+        RedissonUtils.putSet(String.valueOf(l24),new ArrayList<Long>(){{add(789456L);add(456789L);add(123456789L);}});
+
+        RSet<Object> set24 = RedissonUtils.getSet(String.valueOf(l24));
+        RedissonUtils.putSetSeconds(String.valueOf(l241),new ArrayList<Long>(){{add(789456L);add(456789L);add(123456789L);}},Global.PC_BACKGROUND_TOKEN_EXPIRE);
+        RSet<Object> set241 = RedissonUtils.getSet(String.valueOf(l241));
         boolean b = redisLockUtil.tryLock("20231019A", 1);
         if (b) {
             System.out.println("获取到锁");

+ 1 - 1
sckw-modules/sckw-example/src/main/java/com/sckw/example/model/vo/ProjectPageVo.java

@@ -1,7 +1,7 @@
 package com.sckw.example.model.vo;
 
 import com.alibaba.excel.annotation.ExcelProperty;
-import com.sckw.core.common.enums.NumberConstant;
+import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.core.model.enums.ProjectStatusEnum;
 import com.sckw.excel.annotation.EasyExcel;
 import com.sckw.excel.annotation.ExcelContext;

+ 3 - 1
sckw-modules/sckw-example/src/main/java/com/sckw/example/service/TransportService.java

@@ -7,6 +7,8 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.cloud.context.config.annotation.RefreshScope;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+
 /**
  * @author lfdc
  * @description 运输服务service
@@ -25,7 +27,7 @@ public class TransportService {
     private TransportStatisticsService statisticsService;
 
     public Integer statisticsLogistics(Long topEntId) {
-        return statisticsService.statisticsLogistics(topEntId);
+        return statisticsService.statisticsLogistics(topEntId,new ArrayList<>());
     }
 
     public Integer statisticsWaybillSendCar(Long topEntId) {

+ 15 - 3
sckw-modules/sckw-file/pom.xml

@@ -8,12 +8,13 @@
         <version>1.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
-
+    <version>${file.revision}</version>
     <artifactId>sckw-file</artifactId>
 
     <properties>
         <maven.compiler.source>17</maven.compiler.source>
         <maven.compiler.target>17</maven.compiler.target>
+        <basic.version>1.0.0</basic.version>
     </properties>
 
     <dependencies>
@@ -21,52 +22,62 @@
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-startup</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-core</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-remote</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-datasource</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-redis</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-excel</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-system-api</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-file-api</artifactId>
-            <version>1.0.0</version>
+            <version>${basic.version}</version>
+<!--            <version>1.0.0</version>-->
         </dependency>
         <!--alibaba oss-->
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-seata</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-sentinel</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <!--alibaba oss-->
@@ -88,7 +99,8 @@
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-log</artifactId>
-            <version>1.0.0</version>
+<!--            <version>1.0.0</version>-->
+            <version>${basic.version}</version>
         </dependency>
 
     </dependencies>

+ 1 - 1
sckw-modules/sckw-file/src/main/java/com/sckw/file/dubbo/FileDubboApiServiceImpl.java

@@ -1,6 +1,6 @@
 package com.sckw.file.dubbo;
 
-import com.sckw.core.common.enums.NumberConstant;
+import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.core.common.enums.enums.FileEnum;
 import com.sckw.core.model.file.FileInfo;
 import com.sckw.core.utils.FileUtils;

+ 1 - 1
sckw-modules/sckw-file/src/main/java/com/sckw/file/service/FileService.java

@@ -3,7 +3,7 @@ package com.sckw.file.service;
 
 import com.aliyun.oss.model.OSSObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.sckw.core.common.enums.NumberConstant;
+import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.core.common.enums.StringConstant;
 import com.sckw.core.common.enums.enums.FileDisposeLayoutEnum;
 import com.sckw.core.common.enums.enums.FileEnum;

+ 1 - 1
sckw-modules/sckw-file/src/main/resources/bootstrap.yml

@@ -5,7 +5,7 @@ spring:
   application:
     name: sckw-file
   profiles:
-    active: ${DEPLOY_MODE:dev}
+    active: @profiles.active@
 #    active: @profiles.active@
   main:
     allow-bean-definition-overriding: true

+ 19 - 2
sckw-modules/sckw-fleet/pom.xml

@@ -11,10 +11,11 @@
 
     <artifactId>sckw-fleet</artifactId>
     <description>车队服务</description>
-
+    <version>${fleet.revision}</version>
     <properties>
         <maven.compiler.source>17</maven.compiler.source>
         <maven.compiler.target>17</maven.compiler.target>
+        <basic.version>1.0.0</basic.version>
     </properties>
 
     <dependencies>
@@ -22,66 +23,79 @@
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-startup</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-core</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-remote</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-datasource</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-redis</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-seata</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-sentinel</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-excel</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-system-api</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-fleet-api</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-transport-api</artifactId>
+            <version>${basic.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-file-api</artifactId>
+            <version>${basic.version}</version>
         </dependency>
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-log</artifactId>
-            <version>1.0.0</version>
+<!--            <version>1.0.0</version>-->
+            <version>${basic.version}</version>
         </dependency>
 
     </dependencies>
@@ -98,6 +112,9 @@
                         </goals>
                     </execution>
                 </executions>
+                <configuration>
+                    <mainClass>com.sckw.fleet.FleetApplication</mainClass>
+                </configuration>
             </plugin>
         </plugins>
     </build>

+ 0 - 9
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckController.java

@@ -1,11 +1,7 @@
 package com.sckw.fleet.controller;
 
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
-import com.sckw.core.exception.BusinessException;
 import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.constant.Global;
@@ -32,11 +28,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
 import java.util.*;
 
 /**

+ 4 - 2
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dao/KwfDriverMapper.java

@@ -20,10 +20,11 @@ public interface KwfDriverMapper extends BaseMapper<KwfDriver> {
 
     /**
      * 统计
+     *
      * @param params
      * @return
      */
-    List<KwfTableTopCount> statisticsAll(Map<String, Object> params);
+    List<KwfTableTopCount> statisticsAll(@Param("params") Map<String, Object> params, @Param("authEntIdList") List<Long> authEntIdList);
 
     /**
      * 统计
@@ -34,10 +35,11 @@ public interface KwfDriverMapper extends BaseMapper<KwfDriver> {
 
     /**
      * 分页查询
+     *
      * @param params
      * @return
      */
-    List<KwfDriverVo> findPageAll(Map<String, Object> params);
+    List<KwfDriverVo> findPageAll(@Param("params") Map<String, Object> params, @Param("authEntIdList") List<Long> authEntIdList);
 
     /**
      * 分页查询

+ 6 - 4
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dao/KwfTruckMapper.java

@@ -2,7 +2,6 @@ package com.sckw.fleet.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.sckw.fleet.model.KwfTruck;
-import com.sckw.fleet.model.vo.KwfDriverVo;
 import com.sckw.fleet.model.vo.KwfTableTopCount;
 import com.sckw.fleet.model.vo.KwfTruckMonitorVo;
 import com.sckw.fleet.model.vo.KwfTruckVo;
@@ -22,10 +21,11 @@ public interface KwfTruckMapper extends BaseMapper<KwfTruck> {
 
     /**
      * 统计
+     *
      * @param params
      * @return
      */
-    List<KwfTableTopCount> statisticsAll(Map<String, Object> params);
+    List<KwfTableTopCount> statisticsAll(@Param("params") Map<String, Object> params, @Param("authEntIdList") List<Long> authEntIdList);
 
     /**
      * 统计
@@ -36,10 +36,11 @@ public interface KwfTruckMapper extends BaseMapper<KwfTruck> {
 
     /**
      * 分页查询
+     *
      * @param params
      * @return
      */
-    List<KwfTruckVo> findPageAll(Map<String, Object> params);
+    List<KwfTruckVo> findPageAll(@Param("params") Map<String, Object> params, @Param("authEntIdList") List<Long> authEntIdList);
 
     /**
      * 分页查询
@@ -82,10 +83,11 @@ public interface KwfTruckMapper extends BaseMapper<KwfTruck> {
 
     /**
      * 查询全部车辆
+     *
      * @param params {truckNo 车牌号}
      * @return
      */
-    List<KwfTruckMonitorVo> findTruckByAll(Map<String, Object> params);
+    List<KwfTruckMonitorVo> findTruckByAll(@Param("params") Map<String, Object> params, @Param("authEntIdList") List<Long> authEntIdList);
 
 
     /**

+ 0 - 2
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/dto/KwfTruckReportExcelImportDto.java

@@ -6,8 +6,6 @@ import jakarta.validation.constraints.NotNull;
 import jakarta.validation.constraints.Pattern;
 import jakarta.validation.constraints.Size;
 import lombok.Data;
-import org.hibernate.validator.constraints.Length;
-
 import java.io.Serializable;
 
 /**

+ 38 - 9
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfDriverService.java

@@ -25,6 +25,7 @@ import com.sckw.fleet.model.vo.*;
 import com.sckw.redis.constant.RedisConstant;
 import com.sckw.redis.utils.RedissonUtils;
 import com.sckw.system.api.RemoteSystemService;
+import com.sckw.system.api.RemoteUserService;
 import com.sckw.system.api.model.dto.res.EntCacheResDto;
 import com.sckw.system.api.model.dto.res.SysDictResDto;
 import com.sckw.system.api.model.dto.res.UserCacheResDto;
@@ -68,7 +69,8 @@ public class KwfDriverService {
     private RemoteSystemService remoteSystemService;
     @DubboReference(version = "1.0.0", group = "design", check = false)
     private FileApiDubboService remoteFileService;
-
+    @DubboReference(version = "1.0.0", group = "design", check = false, timeout = 8000)
+    private RemoteUserService remoteUserService;
     /**
      * @param key 逐渐id
      * @desc 根据主键查询
@@ -194,7 +196,16 @@ public class KwfDriverService {
         int systemType = LoginUserHolder.getSystemType();
         /**统计数据**/
         if (systemType == SystemTypeEnum.MANAGE.getCode()) {
-            List<KwfTableTopCount> counts = driverDao.statisticsAll(params);
+            //新增客户经理权限过滤
+            List<Long> authEntIdList = LoginUserHolder.getAuthEntIdList();
+            if (CollectionUtils.isEmpty(authEntIdList)) {
+                List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+                if (CollectionUtils.isEmpty(ids)) {
+                    return new ArrayList<>();
+                }
+                authEntIdList.addAll(ids);
+            }
+            List<KwfTableTopCount> counts = driverDao.statisticsAll(params,authEntIdList);
             return counts;
         } else {
             params.put("entId", LoginUserHolder.getEntId());
@@ -258,7 +269,16 @@ public class KwfDriverService {
         int systemType = LoginUserHolder.getSystemType();
         /**统计数据**/
         if (systemType == SystemTypeEnum.MANAGE.getCode()) {
-            List<KwfDriverVo> drivers = driverDao.findPageAll(params);
+            //新增客户经理权限过滤
+            List<Long> authEntIdList = LoginUserHolder.getAuthEntIdList();
+            if (CollectionUtils.isEmpty(authEntIdList)) {
+                List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+                if (CollectionUtils.isEmpty(ids)) {
+                    return new ArrayList<>();
+                }
+                authEntIdList.addAll(ids);
+            }
+            List<KwfDriverVo> drivers = driverDao.findPageAll(params,authEntIdList);
             return drivers;
         } else {
             params.put("entId", LoginUserHolder.getEntId());
@@ -460,9 +480,10 @@ public class KwfDriverService {
             List<KwfDriver> drivers = driverDao.findDriver(new HashMap(){{ put("phone", params.getPhone()); }});
             if (CollectionUtils.isEmpty(drivers)) {
                 /**新增**/
+                String salt = PasswordUtils.generateSalt();
                 String md5 = PasswordUtils.md5(params.getPhone());
-                String password = PasswordUtils.entryptPassword(md5);
-                params.setSalt(PasswordUtils.getSaltSubPwd(password));
+                String password = PasswordUtils.entryptPassword(params.getPhone() + md5, salt);
+                params.setSalt(salt);
                 params.setPassword(password);
                 params.setEntId(LoginUserHolder.getEntId());
                 params.setBusinessStatus(Global.NO);
@@ -758,8 +779,10 @@ public class KwfDriverService {
         }
 
         /**更新数据**/
-        driver.setPassword(PasswordUtils.entryptPassword(params.getPassword()));
-        driver.setSalt(PasswordUtils.getSaltSubPwd(driver.getPassword()));
+        String salt = PasswordUtils.generateSalt();
+        String password = PasswordUtils.entryptPassword(driver.getPhone() + params.getPassword(), salt);
+        driver.setPassword(password);
+        driver.setSalt(salt);
         int count = driverDao.updateById(driver);
         return count > 0 ? HttpResult.ok("密码修改成功!") : HttpResult.error("密码修改失败!");
     }
@@ -796,6 +819,10 @@ public class KwfDriverService {
         }
 
         /**更新数据**/
+        String salt = PasswordUtils.generateSalt();
+        String password = PasswordUtils.entryptPassword(params.getPhone() + PasswordUtils.md5(params.getPhone()), salt);
+        driver.setPassword(password);
+        driver.setSalt(salt);
         driver.setPhone(params.getPhone());
         int count = driverDao.updateById(driver);
         return count > 0 ? HttpResult.ok("手机号更换成功!") : HttpResult.error("手机号更换失败!");
@@ -830,8 +857,10 @@ public class KwfDriverService {
         KwfDriver driver = drivers.get(Global.NUMERICAL_ZERO);
 
         /**更新数据**/
-        driver.setPassword(PasswordUtils.entryptPassword(params.getPassword()));
-        driver.setSalt(PasswordUtils.getSaltSubPwd(driver.getPassword()));
+        String salt = PasswordUtils.generateSalt();
+        String password = PasswordUtils.entryptPassword(driver.getPhone() + params.getPassword(), salt);
+        driver.setPassword(password);
+        driver.setSalt(salt);
         int count = driverDao.updateById(driver);
         return count > 0 ? HttpResult.ok("密码修改成功!") : HttpResult.error("密码修改失败!");
     }

+ 2 - 1
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfTruckReportService.java

@@ -239,7 +239,8 @@ public class KwfTruckReportService {
      * @author zk
      * @date 2023/07/11
      **/
-    public HttpResult importExcel(MultipartFile file) {/**文件存储**/
+    public HttpResult importExcel(MultipartFile file) {
+        /**文件存储**/
         importFileSave(file);
 
         /**参数校验**/

+ 111 - 57
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfTruckService.java

@@ -41,6 +41,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
+
 import java.io.InputStream;
 import java.math.BigDecimal;
 import java.util.*;
@@ -69,9 +70,9 @@ public class KwfTruckService {
     KwfTruckImportMapper kwfTruckImportDao;
     @Autowired
     KwfFleetTruckMapper fleetTruckDao;
-    @DubboReference(version = "1.0.0", group = "design", check = false,timeout = 8000)
+    @DubboReference(version = "1.0.0", group = "design", check = false, timeout = 8000)
     private RemoteSystemService remoteSystemService;
-    @DubboReference(version = "1.0.0", group = "design", check = false,timeout = 8000)
+    @DubboReference(version = "1.0.0", group = "design", check = false, timeout = 8000)
     private RemoteUserService remoteUserService;
     @DubboReference(version = "1.0.0", group = "design", check = false)
     private TransportService transportDubboService;
@@ -92,7 +93,7 @@ public class KwfTruckService {
      * @author zk
      * @date 2023/7/11
      **/
-    public KwfTruckDetailVo detail(Long truckId){
+    public KwfTruckDetailVo detail(Long truckId) {
         //车辆信息
         KwfTruck truck = this.selectByKey(truckId);
         KwfTruckDetailVo truckDetailVo = new KwfTruckDetailVo();
@@ -135,7 +136,7 @@ public class KwfTruckService {
         /**统计数据**/
         List<KwfTableTopCount> counts = statisticsHandle(params);
         long tatol = 0;
-        for (KwfTableTopCount topCount:counts) {
+        for (KwfTableTopCount topCount : counts) {
             tatol += topCount.getTotal();
         }
 
@@ -148,10 +149,14 @@ public class KwfTruckService {
         countList.add(allCount);
 
         /**数据处理**/
-        Map<String, Integer> authStatusMap = new HashMap(){{put("正常", 1); put("临时", 2); put("异常", 3);}};
-        for(Map.Entry<String, Integer> entry:authStatusMap.entrySet()){
+        Map<String, Integer> authStatusMap = new HashMap() {{
+            put("正常", 1);
+            put("临时", 2);
+            put("异常", 3);
+        }};
+        for (Map.Entry<String, Integer> entry : authStatusMap.entrySet()) {
             KwfTableTopCount count = new KwfTableTopCount();
-            for (KwfTableTopCount topCount:counts) {
+            for (KwfTableTopCount topCount : counts) {
                 if (Integer.parseInt(topCount.getValue()) == entry.getValue()) {
                     BeanUtils.copyProperties(topCount, count);
                 }
@@ -178,17 +183,31 @@ public class KwfTruckService {
         int systemType = LoginUserHolder.getSystemType();
         /**统计数据**/
         if (systemType == SystemTypeEnum.MANAGE.getCode()) {
-            List<KwfTableTopCount> counts = truckDao.statisticsAll(params);
+            //新增客户经理权限过滤
+            List<Long> authEntIdList = LoginUserHolder.getAuthEntIdList();
+            if (CollectionUtils.isEmpty(authEntIdList)) {
+                List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+                if (CollectionUtils.isEmpty(ids)) {
+                    return new ArrayList<>();
+                }
+                authEntIdList.addAll(ids);
+            }
+            List<KwfTableTopCount> counts = truckDao.statisticsAll(params,authEntIdList);
             return counts;
         } else {
             Object keywords = params.get("keywords");
             if (StringUtils.isNotBlank(keywords)) {
                 //查询企业
-                List<Integer> entTypes = new ArrayList<>(){{add(EntTypeEnum.LOGISTICS3.getCode()); add(EntTypeEnum.LOGISTICS4.getCode());}};
+                List<Integer> entTypes = new ArrayList<>() {{
+                    add(EntTypeEnum.LOGISTICS3.getCode());
+                    add(EntTypeEnum.LOGISTICS4.getCode());
+                }};
                 List<Long> entIds = remoteUserService.findEntIds(entTypes, StringUtils.objectStr(keywords));
                 params.put("entIds", entIds);
                 //查询用户
-                List<Long> userIds = remoteUserService.findUserIds(new ArrayList<>(){{add(LoginUserHolder.getEntId());}}, StringUtils.objectStr(keywords));
+                List<Long> userIds = remoteUserService.findUserIds(new ArrayList<>() {{
+                    add(LoginUserHolder.getEntId());
+                }}, StringUtils.objectStr(keywords));
                 params.put("createBys", userIds);
             }
             params.put("entId", LoginUserHolder.getEntId());
@@ -216,7 +235,7 @@ public class KwfTruckService {
         List<Long> entIds = new ArrayList<>();
         List<String> dictKey = new ArrayList<>();
 
-        for (KwfTruckVo truck:trucks) {
+        for (KwfTruckVo truck : trucks) {
             createBys.add(Long.parseLong(truck.getCreateBy()));
             entIds.add(Long.parseLong(truck.getEntId()));
             dictKey.add(truck.getColor() != null ? DictTypeEnum.COLOR_TYPE.getType() + pound + truck.getColor() : null);
@@ -234,7 +253,7 @@ public class KwfTruckService {
         Map<String, SysDictResDto> dicts = this.dict(dictKey);
 
         /**数据组装**/
-        for (KwfTruckVo truck:trucks) {
+        for (KwfTruckVo truck : trucks) {
             UserCacheResDto user = users == null ? null : users.get(Long.parseLong(truck.getCreateBy()));
             EntCacheResDto ent = ents == null ? null : ents.get(Long.parseLong(truck.getEntId()));
             SysDictResDto color = dicts.get(DictTypeEnum.COLOR_TYPE.getType() + pound + truck.getColor());
@@ -261,17 +280,31 @@ public class KwfTruckService {
         int systemType = LoginUserHolder.getSystemType();
         /**统计数据**/
         if (systemType == SystemTypeEnum.MANAGE.getCode()) {
-            List<KwfTruckVo> counts = truckDao.findPageAll(params);
+            //新增客户经理权限过滤
+            List<Long> authEntIdList = LoginUserHolder.getAuthEntIdList();
+            if (CollectionUtils.isEmpty(authEntIdList)) {
+                List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+                if (CollectionUtils.isEmpty(ids)) {
+                    return new ArrayList<>();
+                }
+                authEntIdList.addAll(ids);
+            }
+            List<KwfTruckVo> counts = truckDao.findPageAll(params,authEntIdList);
             return counts;
         } else {
             Object keywords = params.get("keywords");
             if (StringUtils.isNotBlank(keywords)) {
                 //查询企业
-                List<Integer> entTypes = new ArrayList<>(){{add(EntTypeEnum.LOGISTICS3.getCode()); add(EntTypeEnum.LOGISTICS4.getCode());}};
+                List<Integer> entTypes = new ArrayList<>() {{
+                    add(EntTypeEnum.LOGISTICS3.getCode());
+                    add(EntTypeEnum.LOGISTICS4.getCode());
+                }};
                 List<Long> entIds = remoteUserService.findEntIds(entTypes, StringUtils.objectStr(keywords));
                 params.put("entIds", entIds);
                 //查询用户
-                List<Long> userIds = remoteUserService.findUserIds(new ArrayList<>(){{add(LoginUserHolder.getEntId());}}, StringUtils.objectStr(keywords));
+                List<Long> userIds = remoteUserService.findUserIds(new ArrayList<>() {{
+                    add(LoginUserHolder.getEntId());
+                }}, StringUtils.objectStr(keywords));
                 params.put("createBys", userIds);
             }
             params.put("entId", LoginUserHolder.getEntId());
@@ -307,8 +340,8 @@ public class KwfTruckService {
 
         /**数据处理**/
         int count = 0;
-        List<KwfTruckExcelImportDto> truckExcels = (List)result.getData();
-        for (KwfTruckExcelImportDto kwfTruckExcel:truckExcels) {
+        List<KwfTruckExcelImportDto> truckExcels = (List) result.getData();
+        for (KwfTruckExcelImportDto kwfTruckExcel : truckExcels) {
             //车辆信息
             KwfTruck truck = new KwfTruck();
             truck.setTruckNo(kwfTruckExcel.getTruckNo());
@@ -316,11 +349,11 @@ public class KwfTruckService {
             truck.setAuthStatus(Global.NUMERICAL_TWO);
             result = truckEdit(truck);
             if (result.getCode() == HttpStatus.SUCCESS_CODE) {
-                count ++;
+                count++;
             }
         }
 
-        return HttpResult.ok("成功导入"+count+"行数据!");
+        return HttpResult.ok("成功导入" + count + "行数据!");
     }
 
     /**
@@ -344,7 +377,7 @@ public class KwfTruckService {
         if (result.getCode() != HttpStatus.SUCCESS_CODE) {
             return result;
         }
-        truck = (KwfTruck)result.getData();
+        truck = (KwfTruck) result.getData();
 
         /**车辆行驶证信息**/
         KwfTruckLicenseDto truckLicenseDto = params.getTruckLicense();
@@ -375,7 +408,7 @@ public class KwfTruckService {
     public HttpResult update(KwfTruckDto params) {
         /**数据校验**/
         if (StringUtils.isBlank(params.getId())) {
-            return HttpResult.error(HttpStatus.PARAMETERS_PATTERN_ERROR_CODE,"车辆信息ID不能为空!");
+            return HttpResult.error(HttpStatus.PARAMETERS_PATTERN_ERROR_CODE, "车辆信息ID不能为空!");
         }
         KwfTruck truck = truckDao.selectById(params.getId());
         if (truck == null) {
@@ -453,7 +486,9 @@ public class KwfTruckService {
     public HttpResult truckEdit(KwfTruck params) {
         if (StringUtils.isBlank(params.getId())) {
             /**唯一性交易**/
-            List<KwfTruck> trucks = truckDao.findTruck(new HashMap(){{ put("truckNo", params.getTruckNo()); }});
+            List<KwfTruck> trucks = truckDao.findTruck(new HashMap() {{
+                put("truckNo", params.getTruckNo());
+            }});
             if (CollectionUtils.isEmpty(trucks)) {
                 /**新增**/
                 params.setEntId(LoginUserHolder.getEntId());
@@ -479,7 +514,9 @@ public class KwfTruckService {
             }
         } else {
             /**唯一性交易**/
-            List<KwfTruck> trucks = truckDao.findTruck(new HashMap(){{ put("truckNo", params.getTruckNo()); }});
+            List<KwfTruck> trucks = truckDao.findTruck(new HashMap() {{
+                put("truckNo", params.getTruckNo());
+            }});
             //校验list中对象key值是否存在与value不一致的情况
             boolean bool = listByKeyValue(trucks, params.getId());
             if (bool) {
@@ -637,12 +674,12 @@ public class KwfTruckService {
 
     /**
      * @param truckId 车辆id
-     * @param entId 企业id
+     * @param entId   企业id
      * @desc 查询车队班组
      * @author zk
      * @date 2023/7/20
      **/
-    public KwfFleet findByFleetTruck(Long truckId, Long entId){
+    public KwfFleet findByFleetTruck(Long truckId, Long entId) {
         return fleetTruckDao.findByFleetTruck(truckId, entId);
     }
 
@@ -681,14 +718,16 @@ public class KwfTruckService {
 
     /**
      * @param params {truckNo 車牌號}
-     * @desc 车辆查询(业务关联+归属车辆)
+     * @desc 车辆查询(业务关联 + 归属车辆)
      * @author zk
      * @date 2023/9/5
      **/
-    public List<KwfTruckMonitorVo> findTruck(Map params){
+    public List<KwfTruckMonitorVo> findTruck(Map params) {
         long begTime = System.currentTimeMillis();
         /**车辆查询**/
-        Map queryParams = new HashMap<>(Global.NUMERICAL_SIXTEEN){{ put("truckNo", params.get("truckNo"));}};
+        Map queryParams = new HashMap<>(Global.NUMERICAL_SIXTEEN) {{
+            put("truckNo", params.get("truckNo"));
+        }};
         List<KwfTruckMonitorVo> truckList = findTruckMonitor(queryParams);
         if (truckList == null || truckList.size() == 0) {
             return truckList;
@@ -697,29 +736,29 @@ public class KwfTruckService {
         /**数据配置**/
         List<Long> entIds = new ArrayList<>();
         List<String> truckNos = new ArrayList<>();
-        for (KwfTruckMonitorVo truck:truckList) {
+        for (KwfTruckMonitorVo truck : truckList) {
             entIds.add(truck.getEntId());
             truckNos.add(truck.getTruckNo());
         }
         long begTime1 = System.currentTimeMillis();
-        log.info("获取数据="+(begTime1 - begTime));
+        log.info("获取数据=" + (begTime1 - begTime));
         //企业数据集
         entIds = entIds.stream().distinct().collect(Collectors.toList());
         Map<Long, EntCacheResDto> ents = remoteSystemService.queryEntCacheMapByIds(entIds);
         //车辆定位数据集
         Map<String, KwfTruckGpsVo> truckGpsMap = findTruckLocateHandle(truckNos);
         long begTime2 = System.currentTimeMillis();
-        log.info("获取GPS="+(begTime2 - begTime1));
+        log.info("获取GPS=" + (begTime2 - begTime1));
 
         /**数据组装**/
-        for (KwfTruckMonitorVo truck:truckList) {
+        for (KwfTruckMonitorVo truck : truckList) {
             EntCacheResDto ent = ents == null ? null : ents.get(truck.getEntId());
             KwfTruckGpsVo truckGps = truckGpsMap != null ? truckGpsMap.get(truck.getTruckNo()) : null;
             truck.setFirmName(ent != null ? ent.getFirmName() : null);
             truck.setRunStatus(truckGps != null ? truckGps.getRunStatus() : null);
         }
         long begTime3 = System.currentTimeMillis();
-        log.info("数据组装="+(begTime3 - begTime2));
+        log.info("数据组装=" + (begTime3 - begTime2));
         return truckList;
     }
 
@@ -732,7 +771,9 @@ public class KwfTruckService {
     public List<KwfTruckGpsVo> findTruckGps(List<String> truckNos) {
         /**车辆查询**/
         List<KwfTruckGpsVo> truckGpsList = new ArrayList<>();
-        Map<String, Object> queryParams = new HashMap<>(Global.NUMERICAL_SIXTEEN){{ put("truckNos", truckNos);}};
+        Map<String, Object> queryParams = new HashMap<>(Global.NUMERICAL_SIXTEEN) {{
+            put("truckNos", truckNos);
+        }};
         List<KwfTruckMonitorVo> truckList = findTruckMonitor(queryParams);
         if (truckList == null || truckList.size() == 0) {
             return truckGpsList;
@@ -742,7 +783,7 @@ public class KwfTruckService {
         Map<String, KwfTruckGpsVo> truckGpsMap = findTruckLocateHandle(truckNos);
 
         /**数据组装**/
-        for (KwfTruckMonitorVo truck:truckList) {
+        for (KwfTruckMonitorVo truck : truckList) {
             KwfTruckGpsVo truckGps = truckGpsMap != null ? truckGpsMap.get(truck.getTruckNo()) : null;
             if (truckGps == null) {
                 continue;
@@ -785,9 +826,17 @@ public class KwfTruckService {
             return trucks;
         }
 
-        //运营端
+        //运营端+加客户经理数据过滤
         if (LoginUserHolder.getSystemType() == SystemTypeEnum.MANAGE.getCode()) {
-            return truckDao.findTruckByAll(params);
+            List<Long> authEntIdList = LoginUserHolder.getAuthEntIdList();
+            if (CollectionUtils.isEmpty(authEntIdList)) {
+                List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+                if (CollectionUtils.isEmpty(ids)) {
+                    return new ArrayList<>();
+                }
+                authEntIdList.addAll(ids);
+            }
+            return truckDao.findTruckByAll(params, authEntIdList);
         }
         return new ArrayList<>();
     }
@@ -805,7 +854,9 @@ public class KwfTruckService {
         RWaybillOrderVo waybillOrder = getWaybillOrder(truckNo, Global.NUMERICAL_THREE);
         String firmName = LoginEntHolder.getFirmName();
         if (LoginUserHolder.getSystemType() == SystemTypeEnum.MANAGE.getCode()) {
-            List<KwfTruck> trucks = truckDao.findTruck(new HashMap<>(Global.NUMERICAL_SIXTEEN){{put("truckNo", truckNo);}});
+            List<KwfTruck> trucks = truckDao.findTruck(new HashMap<>(Global.NUMERICAL_SIXTEEN) {{
+                put("truckNo", truckNo);
+            }});
             KwfTruck truck = CollectionUtils.isEmpty(trucks) ? null : trucks.get(Global.NUMERICAL_ZERO);
             if (truck != null) {
                 //企业数据集
@@ -838,7 +889,7 @@ public class KwfTruckService {
     }
 
     /**
-     * @param type 字典类型
+     * @param type  字典类型
      * @param value 字典值
      * @desc 获取数据字典值
      * @author zk
@@ -848,7 +899,7 @@ public class KwfTruckService {
         if (StringUtils.isBlank(type) || StringUtils.isBlank(value)) {
             return null;
         }
-        List<String> dictKey = new ArrayList<>(){{
+        List<String> dictKey = new ArrayList<>() {{
             add(type + Global.POUND + value);
         }};
         Map<String, SysDictResDto> dicts = remoteSystemService.queryDictMapByTypeValues(String.join(Global.COMMA, dictKey));
@@ -936,7 +987,7 @@ public class KwfTruckService {
             InputStream inputStream = file.getInputStream();
             excelReader = EasyExcel.read(inputStream, importListener).build();
 
-            ReadSheet readSheet = EasyExcel.readSheet( 0) .headRowNumber(2).head(KwfTruckExcelImportDto .class).build();
+            ReadSheet readSheet = EasyExcel.readSheet(0).headRowNumber(2).head(KwfTruckExcelImportDto.class).build();
             excelReader.read(readSheet);
             if (importListener.getErrorList().size() > 0) {
                 return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, "数据格式不正确,请确认!", importListener.getErrorList());
@@ -958,7 +1009,8 @@ public class KwfTruckService {
 
     /**
      * 校验list中对象key值是否存在与value不一致的情况
-     * @param list 数据集
+     *
+     * @param list  数据集
      * @param value 匹配值
      * @return
      */
@@ -966,7 +1018,7 @@ public class KwfTruckService {
         if (CollectionUtils.isEmpty(list)) {
             return false;
         }
-        for (KwfTruck truck:list) {
+        for (KwfTruck truck : list) {
             if (value != null && !truck.getId().equals(value)) {
                 return true;
             }
@@ -980,7 +1032,7 @@ public class KwfTruckService {
      * @author zk
      * @date 2023/9/5
      **/
-    public Map<String, KwfTruckGpsVo> findTruckLocateHandle(List<String> truckNos){
+    public Map<String, KwfTruckGpsVo> findTruckLocateHandle(List<String> truckNos) {
         /**车牌号超过100则分批次请求数据**/
         int maxLimit = 500;
         List<List<String>> truckNoList = new ArrayList<List<String>>();
@@ -995,7 +1047,7 @@ public class KwfTruckService {
 
         /**获取数据**/
         Map<String, KwfTruckGpsVo> truckGpsMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
-        for (List<String> turckNo:truckNoList) {
+        for (List<String> turckNo : truckNoList) {
             Map<String, KwfTruckGpsVo> truckGps = findTruckLocate(turckNo);
             truckGpsMap.putAll(truckGps);
         }
@@ -1033,7 +1085,7 @@ public class KwfTruckService {
      * @author zk
      * @date 2023/9/5
      **/
-    public Map<String, KwfTruckGpsVo> findTruckLocate(List<String> truckNos){
+    public Map<String, KwfTruckGpsVo> findTruckLocate(List<String> truckNos) {
         Map<String, KwfTruckGpsVo> truckGpsMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
         if (truckNos == null || truckNos.size() == 0) {
             return truckGpsMap;
@@ -1054,7 +1106,7 @@ public class KwfTruckService {
                 }
                 JSONArray trucks = result.getJSONArray("data");
                 //log.info("车牌号数量="+ truckNos.size() + " GPS数量=" + (trucks != null ? trucks.size() : 0) + " 响应时间="+(entTime - begTime));
-                for (int i=0; trucks != null && i < trucks.size(); i++) {
+                for (int i = 0; trucks != null && i < trucks.size(); i++) {
                     JSONObject truck = trucks.getJSONObject(i);
                     JSONObject locateInfo = truck.getJSONObject("locateInfo");
                     KwfTruckGpsVo truckGps = new KwfTruckGpsVo();
@@ -1080,9 +1132,9 @@ public class KwfTruckService {
      * @date 2023/9/27
      **/
     public List<KwfTruckGpsVo> queryLocateTrack(GpsByTruckNoDto params) {
-        List<KwfTruckGpsVo>  truckGpsList = new ArrayList<>();
+        List<KwfTruckGpsVo> truckGpsList = new ArrayList<>();
         long page = 1, pageSize = 1000, size = 0, pages = 0;
-        Map queryParams = new HashMap<>(Global.NUMERICAL_SIXTEEN){{
+        Map queryParams = new HashMap<>(Global.NUMERICAL_SIXTEEN) {{
             put("vehicleNo", params.getTruckNo());
             put("startTime", params.getStartTime());
             put("endTime", params.getEndTime());
@@ -1101,9 +1153,9 @@ public class KwfTruckService {
                 return truckGpsList;
             }
             size = data.getLong("size");
-            pages = size/pageSize + (size%pageSize > 0 ? 1 : 0);
+            pages = size / pageSize + (size % pageSize > 0 ? 1 : 0);
             JSONArray trucks = data.getJSONArray("list");
-            for (int i=0; trucks != null && i < trucks.size(); i++) {
+            for (int i = 0; trucks != null && i < trucks.size(); i++) {
                 JSONObject truck = trucks.getJSONObject(i);
                 KwfTruckGpsVo truckGps = new KwfTruckGpsVo();
                 truckGps.setLat(truck.getString("lat"));
@@ -1118,7 +1170,7 @@ public class KwfTruckService {
                 return truckGpsList;
             }
 
-            for (long i=2; i <= pages; i++) {
+            for (long i = 2; i <= pages; i++) {
                 queryParams.put("page", i);
                 httpResult = HttpClientUtil.post(queryLocate, JSON.toJSONString(queryParams));
                 if (StringUtils.isNotBlank(httpResult)) {
@@ -1131,7 +1183,7 @@ public class KwfTruckService {
                         continue;
                     }
                     trucks = data.getJSONArray("list");
-                    for (int j=0; trucks != null && j < trucks.size(); j++) {
+                    for (int j = 0; trucks != null && j < trucks.size(); j++) {
                         JSONObject truck = trucks.getJSONObject(j);
                         KwfTruckGpsVo truckGps = new KwfTruckGpsVo();
                         truckGps.setTruckNo(truck.getString("vehicleNo"));
@@ -1156,14 +1208,16 @@ public class KwfTruckService {
      * @author zk
      * @date 2023/9/5
      **/
-    public KwfTruckGpsVo findTruckLocate(String truckNo){
+    public KwfTruckGpsVo findTruckLocate(String truckNo) {
         if (StringUtils.isBlank(truckNo)) {
             return null;
         }
 
         try {
             Map<String, Object> params = new HashMap<>(Global.NUMERICAL_SIXTEEN) {{
-                put("vehicleNoList", new ArrayList<>(){{add(truckNo);}});
+                put("vehicleNoList", new ArrayList<>() {{
+                    add(truckNo);
+                }});
             }};
             String httpResult = HttpClientUtil.post(queryLocate, JSON.toJSONString(params));
             if (StringUtils.isNotBlank(httpResult)) {
@@ -1193,12 +1247,12 @@ public class KwfTruckService {
 
     /**
      * @param gpsTimeStr 地位时间
-     * @param speed 速度
+     * @param speed      速度
      * @desc 校验当前车辆运行状态
      * @author zk
      * @date 2023/9/5
      **/
-    public int runStatus(String gpsTimeStr, Double speed){
+    public int runStatus(String gpsTimeStr, Double speed) {
         if (StringUtils.isBlank(gpsTimeStr)) {
             return Global.NUMERICAL_TWO;
         }

+ 50 - 38
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfDriverMapper.xml

@@ -10,31 +10,37 @@
         left join kwf_driver_license drl on drl.driver_id = dr.id and drl.del_flag = 0
         left join kwf_driver_qualification drq on drq.driver_id = dr.id and drq.del_flag = 0
         where dr.del_flag = 0
-        <if test="entId != null and entId != ''">
-            and dr.ent_id = #{entId, jdbcType=VARCHAR}
+        <if test="authEntIdList != null and authEntIdList.size() != 0">
+            and dr.ent_id in
+            <foreach collection="authEntIdList" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
         </if>
-        <if test="name != null and name != ''">
-            and dr.name = #{name, jdbcType=VARCHAR}
+        <if test="params.entId != null and params.entId != ''">
+            and dr.ent_id = #{params.entId, jdbcType=VARCHAR}
         </if>
-        <if test="idcard != null and idcard != ''">
-            and dr.idcard = #{idcard, jdbcType=VARCHAR}
+        <if test="params.name != null and params.name != ''">
+            and dr.name = #{params.name, jdbcType=VARCHAR}
         </if>
-        <if test="phone != null and phone != ''">
-            and dr.phone = #{phone, jdbcType=VARCHAR}
+        <if test="params.idcard != null and params.idcard != ''">
+            and dr.idcard = #{params.idcard, jdbcType=VARCHAR}
         </if>
-        <if test="licenseType != null and licenseType != ''">
-            and drl.type = #{licenseType, jdbcType=VARCHAR}
+        <if test="params.phone != null and params.phone != ''">
+            and dr.phone = #{params.phone, jdbcType=VARCHAR}
         </if>
-        <if test="startTime != null and startTime != '' " >
-            and DATE( dr.create_time) <![CDATA[ >= ]]> #{startTime,jdbcType=TIMESTAMP}
+        <if test="params.licenseType != null and params.licenseType != ''">
+            and drl.type = #{params.licenseType, jdbcType=VARCHAR}
         </if>
-        <if test="endTime != null and endTime != '' " >
-            and DATE( dr.create_time ) <![CDATA[ <= ]]> #{endTime,jdbcType=TIMESTAMP}
+        <if test="params.startTime != null and params.startTime != '' " >
+            and DATE( dr.create_time) <![CDATA[ >= ]]> #{params.startTime,jdbcType=TIMESTAMP}
         </if>
-        <if test="keywords != null and keywords != ''">
+        <if test="params.endTime != null and params.endTime != '' " >
+            and DATE( dr.create_time ) <![CDATA[ <= ]]> #{params.endTime,jdbcType=TIMESTAMP}
+        </if>
+        <if test="params.keywords != null and params.keywords != ''">
             and (
-            dr.name like concat('%',#{keywords},'%')
-            or dr.phone like concat('%',#{keywords},'%')
+            dr.name like concat('%',#{params.keywords},'%')
+            or dr.phone like concat('%',#{params.keywords},'%')
             )
         </if>
         GROUP BY dr.`auth_status`
@@ -103,45 +109,51 @@
         left join kwf_driver_license drl on drl.driver_id = dr.id and drl.del_flag = 0
         left join kwf_driver_qualification drq on drq.driver_id = dr.id and drq.del_flag = 0
         where dr.del_flag = 0
-        <if test="entId != null and entId != ''">
-            and dr.ent_id = #{entId, jdbcType=VARCHAR}
+        <if test="authEntIdList != null and authEntIdList.size() != 0">
+            and dr.ent_id in
+            <foreach collection="authEntIdList" separator="," close=")" open="(" item="item">
+                #{item}
+            </foreach>
         </if>
-        <if test="name != null and name != ''">
-            and dr.name = #{name, jdbcType=VARCHAR}
+        <if test="params.entId != null and params.entId != ''">
+            and dr.ent_id = #{params.entId, jdbcType=VARCHAR}
         </if>
-        <if test="idcard != null and idcard != ''">
-            and dr.idcard = #{idcard, jdbcType=VARCHAR}
+        <if test="params.name != null and params.name != ''">
+            and dr.name = #{params.name, jdbcType=VARCHAR}
         </if>
-        <if test="phone != null and phone != ''">
-            and dr.phone = #{phone, jdbcType=VARCHAR}
+        <if test="params.idcard != null and params.idcard != ''">
+            and dr.idcard = #{params.idcard, jdbcType=VARCHAR}
         </if>
-        <if test="licenseType != null and licenseType != ''">
+        <if test="params.phone != null and params.phone != ''">
+            and dr.phone = #{params.phone, jdbcType=VARCHAR}
+        </if>
+        <if test="params.licenseType != null and params.licenseType != ''">
             and drl.type = #{licenseType, jdbcType=VARCHAR}
         </if>
-        <if test="status != null and status != ''">
+        <if test="sparams.tatus != null and params.status != ''">
             and dr.status = #{status, jdbcType=VARCHAR}
         </if>
-        <if test="authStatus != null and authStatus != '' and authStatus != 0">
-            and dr.auth_status = #{authStatus, jdbcType=VARCHAR}
+        <if test="params.authStatus != null and params.authStatus != '' and params.authStatus != 0">
+            and dr.auth_status = #{params.authStatus, jdbcType=VARCHAR}
         </if>
-        <if test="startTime != null and startTime != '' " >
-            and DATE( dr.create_time) <![CDATA[ >= ]]> #{startTime,jdbcType=TIMESTAMP}
+        <if test="params.startTime != null and params.startTime != '' " >
+            and DATE( dr.create_time) <![CDATA[ >= ]]> #{params.startTime,jdbcType=TIMESTAMP}
         </if>
-        <if test="endTime != null and endTime != '' " >
-            and DATE( dr.create_time ) <![CDATA[ <= ]]> #{endTime,jdbcType=TIMESTAMP}
+        <if test="params.endTime != null and params.endTime != '' " >
+            and DATE( dr.create_time ) <![CDATA[ <= ]]> #{params.endTime,jdbcType=TIMESTAMP}
         </if>
         <choose>
-            <when test="ids != null and ids != '' and ids.size() > 0">
+            <when test="params.ids != null and params.ids != '' and params.ids.size() > 0">
                 and dr.id in
-                <foreach collection="ids" item="id" open="(" close=")" separator=",">
+                <foreach collection="params.ids" item="id" open="(" close=")" separator=",">
                     #{id,jdbcType=BIGINT}
                 </foreach>
             </when>
         </choose>
-        <if test="keywords != null and keywords != ''">
+        <if test="params.keywords != null and params.keywords != ''">
             and (
-            dr.name like concat('%',#{keywords},'%')
-            or dr.phone like concat('%',#{keywords},'%')
+            dr.name like concat('%',#{params.keywords},'%')
+            or dr.phone like concat('%',#{params.keywords},'%')
             )
         </if>
         ORDER BY dr.create_time desc

Some files were not shown because too many files changed in this diff