Browse Source

解决项目集成问题,各种引包问题

1811872455@163.com 1 week ago
parent
commit
f89fe54400
78 changed files with 410 additions and 4538 deletions
  1. 11 0
      java/storlead-api/src/main/resources/application-dev.yml
  2. 10 0
      java/storlead-api/src/main/resources/application-prod.yml
  3. 2 0
      java/storlead-api/src/main/resources/application-test.yml
  4. 12 1
      java/storlead-api/src/main/resources/application.yml
  5. 2 3
      java/storlead-es/pom.xml
  6. 11 3
      java/storlead-es/storlead-es-api/pom.xml
  7. 0 17
      java/storlead-es/storlead-es-api/src/main/java/com/storlead/es/server/EsSearchCustomerService.java
  8. 14 3
      java/storlead-es/storlead-es-biz/pom.xml
  9. 16 25
      java/storlead-es/storlead-es-biz/src/main/java/com/storlead/es/config/ElasticSearchConfig.java
  10. 19 0
      java/storlead-es/storlead-es-biz/src/main/java/com/storlead/es/config/EsAutoConfiguration.java
  11. 27 0
      java/storlead-es/storlead-es-biz/src/main/java/com/storlead/es/config/EsProperties.java
  12. 1 1
      java/storlead-es/storlead-es-biz/src/main/java/com/storlead/es/internal/BaseSearchService.java
  13. 3 1
      java/storlead-es/storlead-es-biz/src/main/java/com/storlead/es/server/impl/BaseSearchServiceImpl.java
  14. 3 1
      java/storlead-es/storlead-es-biz/src/main/java/com/storlead/es/server/impl/EsSearchCustomerServiceImpl.java
  15. 23 0
      java/storlead-es/storlead-es-biz/src/main/java/com/storlead/es/service/impl/NoopEsSearchCustomerServiceImpl.java
  16. 2 0
      java/storlead-es/storlead-es-biz/src/main/resources/META-INF/spring.factories
  17. 1 6
      java/storlead-es/storlead-es-core/pom.xml
  18. 0 0
      java/storlead-es/storlead-es-core/src/main/java/com/storlead/es/pojo/vo/EsGenericVO.java
  19. 0 3
      java/storlead-es/storlead-es-core/src/main/java/com/storlead/es/pojo/vo/EsQuerySimilarityVO.java
  20. 0 0
      java/storlead-es/storlead-es-core/src/main/java/com/storlead/es/pojo/vo/EsQueryVO.java
  21. 0 0
      java/storlead-es/storlead-es-core/src/main/java/com/storlead/es/pojo/vo/FieldConfig.java
  22. 0 0
      java/storlead-es/storlead-es-core/src/main/java/com/storlead/es/pojo/vo/IndexFieldConfig.java
  23. 25 0
      java/storlead-es/storlead-es-spi/pom.xml
  24. 8 0
      java/storlead-es/storlead-es-spi/src/main/java/com/storlead/es/server/EsSearchCustomerService.java
  25. 18 0
      java/storlead-es/storlead-es-spi/src/main/java/com/storlead/es/service/EsSearchCustomerService.java
  26. 7 0
      java/storlead-framework/storlead-common/pom.xml
  27. 33 0
      java/storlead-framework/storlead-common/src/main/java/com/storlead/framework/common/config/AutowiringSpringBeanJobFactory.java
  28. 50 0
      java/storlead-framework/storlead-common/src/main/java/com/storlead/framework/common/config/QuartzConfig.java
  29. 20 11
      java/storlead-framework/storlead-common/src/main/java/com/storlead/framework/common/util/DateUtil.java
  30. 8 1
      java/storlead-framework/storlead-mybatis/pom.xml
  31. 10 2
      java/storlead-sasa/storlead-sales/pom.xml
  32. 1 0
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/ChenkqGeneratorCodeConfig.java
  33. 3 1
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/config/aspect/OperationLogAspect.java
  34. 0 87
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/CompanyApiController.java
  35. 0 65
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/CompanyCustomSettingsController.java
  36. 0 249
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/CorpWeChatController.java
  37. 0 235
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/DepartmentApiController.java
  38. 0 656
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/DeptApiController.java
  39. 0 169
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/DeptController.java
  40. 0 19
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/DeptRoleController.java
  41. 0 109
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/JobApiController.java
  42. 0 53
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/JobController.java
  43. 0 517
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/LoginApiController.java
  44. 0 308
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/OrganizDataSyncApiController.java
  45. 0 165
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/PermissionResApiController.java
  46. 0 163
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/QuickMenuApiController.java
  47. 0 294
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/RoleApiController.java
  48. 0 160
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/SubCompanyApiController.java
  49. 0 81
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/SubCompanyController.java
  50. 0 175
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/SysDictApiController.java
  51. 0 19
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/SysOperationLogController.java
  52. 0 60
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/SystemConfigItemController.java
  53. 0 49
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/SystemOssConfigApiController.java
  54. 0 50
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/SystemPersonalizeSettingApiController.java
  55. 0 49
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/SystemSettingApiController.java
  56. 0 40
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/SystemWechatConfigApiController.java
  57. 0 536
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/UserApiController.java
  58. 0 125
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/UserController.java
  59. 2 2
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/task/TaskApiController.java
  60. 0 3
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/pojo/dto/customer/BusinessSearchDTO.java
  61. 15 0
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/pojo/dto/customer/CompanyDTO.java
  62. 1 1
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/service/impl/customer/CustomerServiceImpl.java
  63. 0 1
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/service/impl/systemrule/SystemRuleModuleConfigServiceImpl.java
  64. 0 3
      java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/service/target/TargetQuotaService.java
  65. 1 1
      java/storlead-sasa/storlead-sales/src/main/resources/mapper/DashboardSketchMapper.xml
  66. 1 1
      java/storlead-sasa/storlead-sales/src/main/resources/mapper/OrderInvoiceRecordMapper.xml
  67. 1 1
      java/storlead-sasa/storlead-sales/src/main/resources/mapper/OrderRefundRecordMapper.xml
  68. 2 2
      java/storlead-sasa/storlead-sales/src/main/resources/mapper/ReimburseBillRecordMapper.xml
  69. 2 2
      java/storlead-sasa/storlead-sales/src/main/resources/mapper/ReimburseCostBillRecordMapper.xml
  70. 2 2
      java/storlead-sasa/storlead-sales/src/main/resources/mapper/TaskMapper.xml
  71. 1 1
      java/storlead-sasa/storlead-sales/src/main/resources/mapper/customer/CustomerCompanyMapper.xml
  72. 1 1
      java/storlead-sasa/storlead-sales/src/main/resources/mapper/customer/CustomerMapper.xml
  73. 1 1
      java/storlead-sasa/storlead-sales/src/main/resources/mapper/customer/LiaisonMapper.xml
  74. 2 2
      java/storlead-sasa/storlead-sales/src/main/resources/mapper/systemrule/SystemRuleModuleConfigMapper.xml
  75. 10 0
      java/storlead-sasa/storlead-sales/src/main/resources/ssd-sku-dev.properties
  76. 10 0
      java/storlead-sasa/storlead-sales/src/main/resources/ssd-sku-prod.properties
  77. 10 0
      java/storlead-sasa/storlead-sales/src/main/resources/ssd-sku-test.properties
  78. 8 2
      pom.xml

+ 11 - 0
java/storlead-api/src/main/resources/application-dev.yml

@@ -180,3 +180,14 @@ logging:
 
 environment: test
 
+# 站内消息、邮件模板中的前端站点根地址(覆盖 application.yml 默认值)
+domainname: https://test1.storlead.com
+
+storlead:
+  es:
+    enabled: false
+    host: 39.108.252.62
+    port: 9200
+    scheme: http
+    username: elastic
+    password: storlead123456

+ 10 - 0
java/storlead-api/src/main/resources/application-prod.yml

@@ -152,7 +152,16 @@ sp:
     bucketName: sp-tems
 
 
+domainname: https://project.storlead.com
+
 storlead:
+  es:
+    enabled: true
+    host: 39.108.252.62
+    port: 9200
+    scheme: http
+    username: elastic
+    password: storlead123456
   project:
     baseUrl: project.storlead.com
 
@@ -222,3 +231,4 @@ file:
   dify:
     base-url: http://192.168.1.77/v1/
     dataset-api-key: dataset-qfhXMNcjsRSwN5CK6aoWx3hl
+

+ 2 - 0
java/storlead-api/src/main/resources/application-test.yml

@@ -152,3 +152,5 @@ logging:
               Jackson2ObjectMapperBuilder: off # 禁止okhttp4 打印警告日志 For Jackson Kotlin classes support please add "com.fasterxml.jackson.module:jackson-module-kotlin" to the classpath
     com:
       storlead: debug
+
+domainname: https://test1.storlead.com

+ 12 - 1
java/storlead-api/src/main/resources/application.yml

@@ -11,7 +11,7 @@ spring:
   #      secretKey: VzMzUUNCY0g2cnRVQkR6OU5kTnVUY2tkZWlodFdkc0dpdVRwTmk4dnRWc2lKYmllRnEyekVLV29NWEJIM2IzSm1wRllacWdndFZmZFY0UTk0RmhxQm4zR1R4
   #      expiryInHours: 2400
   application:
-    name: sp-smarttrade
+    name: storlead-saas
   main:
     allow-circular-references: true
     allow-bean-definition-overriding: true
@@ -49,11 +49,22 @@ spring:
         max-size: 100
         queue-capacity: 50
 
+# 站内消息 / 邮件模板跳转链接前缀(含协议,末尾不要 /)
+domainname: http://localhost:10010/router/rest
+
 # 多租户:无 tenant_id 列的表须列入忽略,否则 SQL 会拼 tenant_id 导致 Unknown column
 storlead:
+  es:
+    enabled: false
+    host: 127.0.0.1
+    port: 9200
+    scheme: http
+    username: elastic
+    password: ""
   tenant:
     ignore-tables:
       - system_wechat_config
+      - system_oss_config
   datasource:
     # 子模块默认数据源(未标注 @DS 时生效;标注 @DS 则以注解为准)
     module-default-enabled: true

+ 2 - 3
java/storlead-es/pom.xml

@@ -14,13 +14,12 @@
     <packaging>pom</packaging>
     <name>storlead-es</name>
     <version>1.0</version>
-    <description>es aggregate module</description>
+    <description>Elasticsearch 域聚合模块</description>
 
     <modules>
         <module>storlead-es-core</module>
+        <module>storlead-es-spi</module>
         <module>storlead-es-biz</module>
         <module>storlead-es-api</module>
     </modules>
-
 </project>
-

+ 11 - 3
java/storlead-es/storlead-es-api/pom.xml

@@ -14,16 +14,24 @@
     <artifactId>storlead-es-api</artifactId>
     <packaging>jar</packaging>
     <name>storlead-es-api</name>
+    <description>ES 域 Web:Controller 等。</description>
 
     <dependencies>
         <dependency>
             <groupId>com.storlead.boot</groupId>
-            <artifactId>storlead-common</artifactId>
+            <artifactId>storlead-es-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.storlead.boot</groupId>
+            <artifactId>storlead-es-spi</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.storlead.boot</groupId>
+            <artifactId>storlead-es-biz</artifactId>
         </dependency>
-
         <dependency>
             <groupId>com.storlead.boot</groupId>
-            <artifactId>storlead-mybatis</artifactId>
+            <artifactId>storlead-web</artifactId>
         </dependency>
     </dependencies>
 </project>

+ 0 - 17
java/storlead-es/storlead-es-api/src/main/java/com/storlead/es/server/EsSearchCustomerService.java

@@ -1,17 +0,0 @@
-package com.storlead.es.server;
-
-import com.storlead.es.pojo.vo.EsGenericVO;
-import com.storlead.es.pojo.vo.EsQuerySimilarityVO;
-
-import java.util.List;
-
-/**
- * @program: sp-sales-platform
- * @description:
- * @author: chenkq
- * @create: 2025-04-16 09:56
- */
-public interface EsSearchCustomerService {
-
-    List<EsQuerySimilarityVO> listComparisonSimilarity(EsGenericVO dto);
-}

+ 14 - 3
java/storlead-es/storlead-es-biz/pom.xml

@@ -14,21 +14,32 @@
     <artifactId>storlead-es-biz</artifactId>
     <packaging>jar</packaging>
     <name>storlead-es-biz</name>
+    <description>ES 域实现:检索 Service、ES 客户端配置与可选装配。</description>
 
     <dependencies>
         <dependency>
             <groupId>com.storlead.boot</groupId>
-            <artifactId>storlead-es-api</artifactId>
+            <artifactId>storlead-es-spi</artifactId>
         </dependency>
-
         <dependency>
             <groupId>com.storlead.boot</groupId>
             <artifactId>storlead-es-core</artifactId>
         </dependency>
-
+        <dependency>
+            <groupId>com.storlead.boot</groupId>
+            <artifactId>storlead-common</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.storlead.boot</groupId>
+            <artifactId>storlead-mybatis</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-autoconfigure</artifactId>
+        </dependency>
     </dependencies>
 </project>

+ 16 - 25
java/storlead-es/storlead-es-biz/src/main/java/com/storlead/es/config/ElasticSearchConfig.java

@@ -6,39 +6,30 @@ import org.apache.http.auth.UsernamePasswordCredentials;
 import org.apache.http.impl.client.BasicCredentialsProvider;
 import org.elasticsearch.client.RestClient;
 import org.elasticsearch.client.RestHighLevelClient;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 
 /**
- * @program: sp-tems-gotr
- * @description:
- * @author: chenkq
- * @create: 2023-06-16 17:03
+ * Elasticsearch 客户端,仅在 {@code storlead.es.enabled=true} 时创建。
  */
 @Configuration
+@ConditionalOnProperty(prefix = "storlead.es", name = "enabled", havingValue = "true")
+@EnableConfigurationProperties(EsProperties.class)
 public class ElasticSearchConfig {
 
-    @Bean
-    public RestHighLevelClient restHighLevelClient() {
-
-        String hostname = "39.108.252.62";
-        int port = 9200;
-        // 定义 Elasticsearch 集群的用户名和密码
-        String username = "elastic";
-        String password = "storlead123456";
-        // 配置 RestClient
-        RestHighLevelClient client = new RestHighLevelClient(
-                RestClient.builder(
-                                new HttpHost(hostname, port, "http"))
+    @Bean(destroyMethod = "close")
+    public RestHighLevelClient restHighLevelClient(EsProperties properties) {
+        BasicCredentialsProvider credentialsProvider = new BasicCredentialsProvider();
+        if (properties.getUsername() != null && !properties.getUsername().isEmpty()) {
+            credentialsProvider.setCredentials(
+                    AuthScope.ANY,
+                    new UsernamePasswordCredentials(properties.getUsername(), properties.getPassword()));
+        }
+        return new RestHighLevelClient(
+                RestClient.builder(new HttpHost(properties.getHost(), properties.getPort(), properties.getScheme()))
                         .setHttpClientConfigCallback(httpClientBuilder ->
-                                httpClientBuilder.setDefaultCredentialsProvider(
-                                        new BasicCredentialsProvider() {{
-                                            setCredentials(AuthScope.ANY,
-                                                    new UsernamePasswordCredentials(username, password));
-                                        }}
-                                )
-                        )
-        );
-        return client;
+                                httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider)));
     }
 }

+ 19 - 0
java/storlead-es/storlead-es-biz/src/main/java/com/storlead/es/config/EsAutoConfiguration.java

@@ -0,0 +1,19 @@
+package com.storlead.es.config;
+
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Import;
+
+/**
+ * ES 域自动配置:始终注册 {@link com.storlead.es.service.EsSearchCustomerService}(Noop 或真实实现)。
+ */
+@Configuration
+@EnableConfigurationProperties(EsProperties.class)
+@Import(ElasticSearchConfig.class)
+@ComponentScan(basePackages = {
+        "com.storlead.es.service.impl",
+        "com.storlead.es.server.impl"
+})
+public class EsAutoConfiguration {
+}

+ 27 - 0
java/storlead-es/storlead-es-biz/src/main/java/com/storlead/es/config/EsProperties.java

@@ -0,0 +1,27 @@
+package com.storlead.es.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+/**
+ * Elasticsearch 连接与开关配置。
+ */
+@Data
+@ConfigurationProperties(prefix = "storlead.es")
+public class EsProperties {
+
+    /**
+     * 是否启用 ES 检索(false 时使用 Noop 实现,不创建 ES 客户端)。
+     */
+    private boolean enabled = false;
+
+    private String host = "127.0.0.1";
+
+    private int port = 9200;
+
+    private String scheme = "http";
+
+    private String username = "elastic";
+
+    private String password = "";
+}

+ 1 - 1
java/storlead-es/storlead-es-core/src/main/java/com/storlead/es/server/BaseSearchService.java → java/storlead-es/storlead-es-biz/src/main/java/com/storlead/es/internal/BaseSearchService.java

@@ -1,4 +1,4 @@
-package com.storlead.es.server;
+package com.storlead.es.internal;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.storlead.framework.common.dto.page.PageDTO;

+ 3 - 1
java/storlead-es/storlead-es-biz/src/main/java/com/storlead/es/server/impl/BaseSearchServiceImpl.java

@@ -1,7 +1,8 @@
 package com.storlead.es.server.impl;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.storlead.es.server.BaseSearchService;
+import com.storlead.es.internal.BaseSearchService;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import com.storlead.framework.common.dto.page.PageDTO;
 import org.elasticsearch.action.search.SearchRequest;
 import org.elasticsearch.common.unit.Fuzziness;
@@ -37,6 +38,7 @@ import java.util.stream.Collectors;
  * @create: 2023-06-16 16:42
  */
 @Service
+@ConditionalOnProperty(prefix = "storlead.es", name = "enabled", havingValue = "true")
 public class BaseSearchServiceImpl<T> implements BaseSearchService<T> {
 
     private Logger logger = LoggerFactory.getLogger(getClass());

+ 3 - 1
java/storlead-es/storlead-es-biz/src/main/java/com/storlead/es/server/impl/EsSearchCustomerServiceImpl.java

@@ -5,7 +5,8 @@ import com.storlead.es.pojo.vo.EsGenericVO;
 import com.storlead.es.pojo.vo.EsQuerySimilarityVO;
 import com.storlead.es.pojo.vo.FieldConfig;
 import com.storlead.es.pojo.vo.IndexFieldConfig;
-import com.storlead.es.server.EsSearchCustomerService;
+import com.storlead.es.service.EsSearchCustomerService;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.apache.commons.lang3.tuple.Pair;
 import org.elasticsearch.index.query.BoolQueryBuilder;
 import org.elasticsearch.index.query.QueryBuilders;
@@ -28,6 +29,7 @@ import java.util.*;
 import java.util.stream.Collectors;
 
 @Service
+@ConditionalOnProperty(prefix = "storlead.es", name = "enabled", havingValue = "true")
 public class EsSearchCustomerServiceImpl implements EsSearchCustomerService {
 
     @Resource

+ 23 - 0
java/storlead-es/storlead-es-biz/src/main/java/com/storlead/es/service/impl/NoopEsSearchCustomerServiceImpl.java

@@ -0,0 +1,23 @@
+package com.storlead.es.service.impl;
+
+import com.storlead.es.pojo.vo.EsGenericVO;
+import com.storlead.es.pojo.vo.EsQuerySimilarityVO;
+import com.storlead.es.service.EsSearchCustomerService;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.stereotype.Service;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * ES 未启用时的空实现,避免业务模块强依赖 Elasticsearch 运行时。
+ */
+@Service
+@ConditionalOnProperty(prefix = "storlead.es", name = "enabled", havingValue = "false", matchIfMissing = true)
+public class NoopEsSearchCustomerServiceImpl implements EsSearchCustomerService {
+
+    @Override
+    public List<EsQuerySimilarityVO> listComparisonSimilarity(EsGenericVO dto) {
+        return Collections.emptyList();
+    }
+}

+ 2 - 0
java/storlead-es/storlead-es-biz/src/main/resources/META-INF/spring.factories

@@ -0,0 +1,2 @@
+org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
+com.storlead.es.config.EsAutoConfiguration

+ 1 - 6
java/storlead-es/storlead-es-core/pom.xml

@@ -14,17 +14,12 @@
     <artifactId>storlead-es-core</artifactId>
     <packaging>jar</packaging>
     <name>storlead-es-core</name>
+    <description>ES 域模型:dto、vo 等。</description>
 
     <dependencies>
         <dependency>
             <groupId>com.storlead.boot</groupId>
             <artifactId>storlead-common</artifactId>
         </dependency>
-
-        <dependency>
-            <groupId>com.storlead.boot</groupId>
-            <artifactId>storlead-mybatis</artifactId>
-        </dependency>
-
     </dependencies>
 </project>

+ 0 - 0
java/storlead-es/storlead-es-api/src/main/java/com/storlead/es/pojo/vo/EsGenericVO.java → java/storlead-es/storlead-es-core/src/main/java/com/storlead/es/pojo/vo/EsGenericVO.java


+ 0 - 3
java/storlead-es/storlead-es-api/src/main/java/com/storlead/es/pojo/vo/EsQuerySimilarityVO.java → java/storlead-es/storlead-es-core/src/main/java/com/storlead/es/pojo/vo/EsQuerySimilarityVO.java

@@ -1,8 +1,6 @@
 package com.storlead.es.pojo.vo;
 
 import com.alibaba.fastjson.annotation.JSONField;
-import com.baomidou.mybatisplus.annotation.FieldFill;
-import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -62,6 +60,5 @@ public class EsQuerySimilarityVO {
     @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @JSONField(format ="yyyy-MM-dd HH:mm:ss")
-    @TableField(fill = FieldFill.INSERT)
     private Date createTime;
 }

+ 0 - 0
java/storlead-es/storlead-es-api/src/main/java/com/storlead/es/pojo/vo/EsQueryVO.java → java/storlead-es/storlead-es-core/src/main/java/com/storlead/es/pojo/vo/EsQueryVO.java


+ 0 - 0
java/storlead-es/storlead-es-api/src/main/java/com/storlead/es/pojo/vo/FieldConfig.java → java/storlead-es/storlead-es-core/src/main/java/com/storlead/es/pojo/vo/FieldConfig.java


+ 0 - 0
java/storlead-es/storlead-es-api/src/main/java/com/storlead/es/pojo/vo/IndexFieldConfig.java → java/storlead-es/storlead-es-core/src/main/java/com/storlead/es/pojo/vo/IndexFieldConfig.java


+ 25 - 0
java/storlead-es/storlead-es-spi/pom.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>com.storlead.boot</groupId>
+        <artifactId>storlead-es</artifactId>
+        <version>1.0</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>storlead-es-spi</artifactId>
+    <packaging>jar</packaging>
+    <name>storlead-es-spi</name>
+    <description>ES 域对外契约:跨模块调用的 Service 接口。</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.storlead.boot</groupId>
+            <artifactId>storlead-es-core</artifactId>
+        </dependency>
+    </dependencies>
+</project>

+ 8 - 0
java/storlead-es/storlead-es-spi/src/main/java/com/storlead/es/server/EsSearchCustomerService.java

@@ -0,0 +1,8 @@
+package com.storlead.es.server;
+
+/**
+ * @deprecated 请使用 {@link com.storlead.es.service.EsSearchCustomerService}
+ */
+@Deprecated
+public interface EsSearchCustomerService extends com.storlead.es.service.EsSearchCustomerService {
+}

+ 18 - 0
java/storlead-es/storlead-es-spi/src/main/java/com/storlead/es/service/EsSearchCustomerService.java

@@ -0,0 +1,18 @@
+package com.storlead.es.service;
+
+import com.storlead.es.pojo.vo.EsGenericVO;
+import com.storlead.es.pojo.vo.EsQuerySimilarityVO;
+
+import java.util.List;
+
+/**
+ * 客户 ES 相似度检索对外契约。
+ * <p>
+ * 业务模块编译期依赖 {@code storlead-es-spi};运行时引入 {@code storlead-es-biz} 提供实现。
+ * {@code storlead.es.enabled=false} 时使用空实现,不连接 Elasticsearch。
+ * </p>
+ */
+public interface EsSearchCustomerService {
+
+    List<EsQuerySimilarityVO> listComparisonSimilarity(EsGenericVO dto);
+}

+ 7 - 0
java/storlead-framework/storlead-common/pom.xml

@@ -196,6 +196,13 @@
             <version>2.3.32</version>
         </dependency>
 
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-quartz</artifactId>
+            <version>2.7.0</version>
+        </dependency>
+
+
         <dependency>
             <groupId>com.google.code.gson</groupId>
             <artifactId>gson</artifactId>

+ 33 - 0
java/storlead-framework/storlead-common/src/main/java/com/storlead/framework/common/config/AutowiringSpringBeanJobFactory.java

@@ -0,0 +1,33 @@
+package com.storlead.framework.common.config;
+
+
+import org.quartz.spi.TriggerFiredBundle;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
+import org.springframework.scheduling.quartz.SpringBeanJobFactory;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+
+/**
+ * @program: sp-salary-system
+ * @description:
+ * @author: chenkq
+ * @create: 2024-10-17 09:32
+ */
+@Component
+public class AutowiringSpringBeanJobFactory extends SpringBeanJobFactory {
+
+    @Resource
+    private AutowireCapableBeanFactory beanFactory;
+
+    @Override
+    protected Object createJobInstance(TriggerFiredBundle bundle) throws Exception {
+        // 使用父类方法创建 Job 实例
+        Object jobInstance = super.createJobInstance(bundle);
+        // 将 Spring 管理的 Bean 注入到 Job 实例中
+        beanFactory.autowireBean(jobInstance);
+        return jobInstance;
+    }
+}
+

+ 50 - 0
java/storlead-framework/storlead-common/src/main/java/com/storlead/framework/common/config/QuartzConfig.java

@@ -0,0 +1,50 @@
+package com.storlead.framework.common.config;
+
+import lombok.extern.log4j.Log4j2;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.quartz.SchedulerFactoryBean;
+
+import javax.annotation.Resource;
+import javax.sql.DataSource;
+import java.util.Properties;
+
+/**
+ * @program: sp-salary-system
+ * @description:
+ * @author: chenkq
+ * @create: 2024-01-03 18:06
+ */
+@Log4j2
+@Configuration
+public class QuartzConfig {
+
+    @Resource
+    private DataSource dataSource;  // Spring Boot 自动配置的数据源
+
+    @Resource
+    private AutowiringSpringBeanJobFactory jobFactory;
+
+    @Bean
+    public SchedulerFactoryBean schedulerFactoryBean() {
+        SchedulerFactoryBean factory = new SchedulerFactoryBean();
+        factory.setDataSource(dataSource);  // 显式地设置 Quartz 使用的数据源
+        factory.setJobFactory(jobFactory);
+
+        Properties quartzProperties = new Properties();
+        quartzProperties.put("org.quartz.scheduler.instanceId", "AUTO");
+        quartzProperties.put("org.quartz.scheduler.instanceName", "clusteredScheduler");
+        quartzProperties.put("org.quartz.jobStore.isClustered", "true");
+        quartzProperties.put("org.quartz.jobStore.useProperties", "true");
+        quartzProperties.put("org.quartz.jobStore.clusterCheckinInterval", "60000");
+        quartzProperties.put("org.quartz.jobStore.driverDelegateClass", "org.quartz.impl.jdbcjobstore.StdJDBCDelegate");
+        quartzProperties.put("org.quartz.jobStore.tablePrefix", "qrtz_");
+        quartzProperties.put("org.quartz.threadPool.threadCount", "10");
+        quartzProperties.put("org.quartz.threadPool.threadPriority", "5");
+        quartzProperties.put("org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread", "false");
+        factory.setQuartzProperties(quartzProperties);
+
+        return factory;
+    }
+}

+ 20 - 11
java/storlead-framework/storlead-common/src/main/java/com/storlead/framework/common/util/DateUtil.java

@@ -3,6 +3,7 @@ package com.storlead.framework.common.util;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.util.Assert;
 
+import java.sql.Timestamp;
 import java.text.DateFormat;
 import java.text.ParseException;
 import java.text.ParsePosition;
@@ -113,6 +114,13 @@ public class DateUtil {
         return c.getTime();
     }
 
+    public static Date getDateByOffset(LocalDateTime localDateTime, int calendarField, int offset) {
+        Date date = Timestamp.valueOf(localDateTime);
+        return getDateByOffset(date, calendarField, offset);
+    }
+
+
+
     /**
      * 描述:获取指定日期时间的字符串(可偏移).
      *
@@ -862,17 +870,18 @@ public class DateUtil {
         return strtodate;
     }
     public static void main(String[] args) {
-        LocalDateTime dateTime1 = LocalDateTime.of(2023,  10, 1, 12, 0);
-        LocalDateTime dateTime2 = LocalDateTime.of(2023,  10, 5, 14, 0);
-
-        // 计算两个 LocalDateTime 之间的天数差
-        long daysDifference = ChronoUnit.DAYS.between(dateTime1,  dateTime2);
-
-        // 将结果转换为 Integer 类型
-        Integer daysDifferenceInteger = (int) daysDifference;
-
-        // 输出结果
-        System.out.println("Days  difference: " + daysDifferenceInteger);
+//        LocalDateTime dateTime1 = LocalDateTime.of(2023,  10, 1, 12, 0);
+//        LocalDateTime dateTime2 = LocalDateTime.of(2023,  10, 5, 14, 0);
+//
+//        // 计算两个 LocalDateTime 之间的天数差
+//        long daysDifference = ChronoUnit.DAYS.between(dateTime1,  dateTime2);
+//
+//        // 将结果转换为 Integer 类型
+//        Integer daysDifferenceInteger = (int) daysDifference;
+//
+//        // 输出结果
+//        System.out.println("Days  difference: " + daysDifferenceInteger);
+        System.out.println("Days  difference: " + getDateByOffset(LocalDateTime.now(), Calendar.DATE, 2));
 //        System.out.println("date : "+DateUtil.getStringByOffset(new Date(),"yyyy-MM-dd HH:mm:ss", Calendar.DATE,-5));
 //        // 本周一
 //        Date nowDate = DateUtil.getDateByFormat("2018-07-02",DateUtil.dateFormatYMD);

+ 8 - 1
java/storlead-framework/storlead-mybatis/pom.xml

@@ -42,12 +42,19 @@
         <dependency>
             <groupId>com.baomidou</groupId>
             <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
+            <version>2.5.4</version>
+        </dependency>
+        <!-- https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-generator -->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-generator</artifactId>
+            <version>${mybatis-plus.version}</version>
         </dependency>
-
         <!-- https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-generator -->
         <dependency>
             <groupId>com.baomidou</groupId>
             <artifactId>mybatis-plus-generator</artifactId>
+            <version>${mybatis-plus.version}</version>
         </dependency>
 
         <!--mysql-->

+ 10 - 2
java/storlead-sasa/storlead-sales/pom.xml

@@ -50,10 +50,18 @@
             <groupId>com.storlead.boot</groupId>
             <artifactId>storlead-message-biz</artifactId>
         </dependency>
-        <!-- ElasticSearchApiController -->
+        <!-- ES 客户相似度:编译期 spi+core;运行时 biz 提供实现(未启用 ES 时为 Noop) -->
         <dependency>
             <groupId>com.storlead.boot</groupId>
-            <artifactId>storlead-es-api</artifactId>
+            <artifactId>storlead-es-spi</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.storlead.boot</groupId>
+            <artifactId>storlead-es-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.storlead.boot</groupId>
+            <artifactId>storlead-es-biz</artifactId>
         </dependency>
         <!-- 邮件域:api 含 biz/spi/core;CRM 邮件 Controller 仍在本模块 -->
         <dependency>

+ 1 - 0
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/ChenkqGeneratorCodeConfig.java

@@ -1,6 +1,7 @@
 package com.storlead.sales;
 
 import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException;
+import com.baomidou.mybatisplus.core.toolkit.StringPool;
 import com.baomidou.mybatisplus.generator.*;
 import com.baomidou.mybatisplus.generator.AutoGenerator;
 import com.baomidou.mybatisplus.generator.config.*;

+ 3 - 1
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/config/aspect/OperationLogAspect.java

@@ -24,6 +24,8 @@ import org.aspectj.lang.annotation.Before;
 import org.aspectj.lang.annotation.Pointcut;
 import org.aspectj.lang.reflect.MethodSignature;
 import javax.annotation.Resource;
+
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.ApplicationContext;
 import org.springframework.core.annotation.AnnotationUtils;
 import org.springframework.stereotype.Component;
@@ -53,7 +55,7 @@ public class OperationLogAspect {
     @Resource
     private SysDictDetailService dictDetailService;
 
-    @Resource
+    @Autowired
     public OperationLogAspect(ApplicationContext applicationContext) {
         Map<String, MyBaseService> services = applicationContext.getBeansOfType(MyBaseService.class);
         for (MyBaseService service : services.values()) {

+ 0 - 87
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/CompanyApiController.java

@@ -1,87 +0,0 @@
-package com.storlead.sales.controller.system;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.storlead.framework.common.result.Result;
-import com.storlead.system.util.SystemSettingCacheCheckUtil;
-import com.storlead.user.pojo.dto.CompanyDTO;
-import com.storlead.user.pojo.entity.CompanyEntity;
-import com.storlead.user.pojo.entity.SubCompanyEntity;
-import com.storlead.user.service.ICompanyService;
-import com.storlead.user.service.ISubCompanyService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import javax.annotation.Resource;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.Arrays;
-import java.util.Objects;
-
-/**
- * @program: sp-sales
- * @description:
- * @author: chenkq
- * @create: 2022-06-29 17:33
- */
-
-@Api(tags = "系统: 公司数据维护")
-@RestController
-@RequestMapping("/sys/company")
-public class CompanyApiController {
-
-    @Resource
-    private ICompanyService companyService;
-
-    @Resource
-    private ISubCompanyService subCompanyService;
-
-    @ApiOperation("新增公司")
-    @PostMapping("save")
-    public Result save(CompanyEntity company) {
-        Result r = SystemSettingCacheCheckUtil.checkAddDataMode();
-        if (!r.isSuccess()) {
-            return r;
-        }
-        if(Objects.isNull(company.getId())) {
-            company.setDataSource(1);
-            LambdaQueryWrapper<CompanyEntity> lm = new LambdaQueryWrapper();
-            lm.eq(CompanyEntity::getDataSource,1);
-            lm.orderByDesc(CompanyEntity::getRouteCode);
-            lm.last("limit 1");
-            CompanyEntity top = companyService.getOne(lm);
-            if (Objects.nonNull(top)) {
-                Integer code = Integer.valueOf(top.getRouteCode());
-                company.setRouteCode(String.valueOf(code+1));
-            }else {
-                company.setRouteCode("150");
-            }
-        }
-        companyService.saveOrUpdate(company);
-        return Result.ok();
-    }
-
-    @ApiOperation("分页查询公司")
-    @PostMapping("pagelist")
-    public Result save(CompanyDTO param) {
-        IPage<CompanyEntity> page = new Page<>(param.getPageIndex(),param.getPageSize());
-        IPage<CompanyEntity> companys = companyService.page(page);
-        return Result.ok(companys);
-    }
-
-    @ApiOperation("删除总公司信息")
-    @PostMapping("delete")
-    public Result delete(Long [] ids) {
-        if (ids == null || ids.length == 0) {
-            return Result.error("参数错误");
-        }
-        Integer exist = subCompanyService.count(new LambdaQueryWrapper<SubCompanyEntity>().in(SubCompanyEntity::getCompanyId, Arrays.asList(ids)));
-        if (!Objects.equals(exist,Integer.valueOf(0))) {
-            return Result.error("公司下有关联子公司,无法删除!");
-        }
-        companyService.removeByIds(Arrays.asList(ids));
-        return Result.ok();
-    }
-}

+ 0 - 65
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/CompanyCustomSettingsController.java

@@ -1,65 +0,0 @@
-package com.storlead.sales.controller.system;
-
-import com.storlead.framework.common.result.Result;
-import com.storlead.framework.redis.RedisService;
-import com.storlead.system.constant.ReidsCacheConstant;
-import com.storlead.system.pojo.dto.CompanyCustomSettingsEntityDTO;
-import com.storlead.system.pojo.entity.CompanyCustomSettingsEntity;
-import com.storlead.system.pojo.entity.SystemPersonalizeSettingEntity;
-import com.storlead.system.service.CompanyCustomSettingsService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import javax.annotation.Resource;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.Objects;
-
-/**
- * <p>
- * 公司配置信息 前端控制器
- * </p>
- *
- * @author chenkq
- * @since 2022-08-23
- */
-@RestController
-@RequestMapping("/sys/custom/settings")
-@Api(tags = "设置: 企业个性化设置")
-public class CompanyCustomSettingsController {
-
-
-    @Resource
-    private CompanyCustomSettingsService customSettingsService;
-
-    @Resource
-    private RedisService redisService;
-
-    @PostMapping(value = "/save")
-    @ApiOperation(value = "配置系统个性设置", notes = "配置系统个性设置")
-    @ApiResponses({
-            @ApiResponse(code = 200, message = "", response = SystemPersonalizeSettingEntity.class)
-    })
-    public Result saveSetting(CompanyCustomSettingsEntityDTO entity) {
-        CompanyCustomSettingsEntity setting = customSettingsService.getOne(null);
-        if (Objects.nonNull(setting)) {
-            entity.setSettingsId(setting.getSettingsId());
-        }
-        redisService.setCacheObject(ReidsCacheConstant.SYS_CACHE_ORG_SYNC_MODE,setting.getSyncMode());
-        customSettingsService.saveOrUpdate((CompanyCustomSettingsEntity) entity);
-        return Result.ok();
-    }
-
-    @PostMapping(value = "/get")
-    @ApiOperation(value = "获取系统个性设置", notes = "获取系统个性设置")
-    @ApiResponses({
-            @ApiResponse(code = 200, message = "", response = CompanyCustomSettingsEntityDTO.class)
-    })
-    public Result<?> getSetting() {
-        CompanyCustomSettingsEntity setting = customSettingsService.getOne(null);
-        return Result.ok(setting);
-    }
-}

+ 0 - 249
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/CorpWeChatController.java

@@ -1,249 +0,0 @@
-package com.storlead.sales.controller.system;
-
-import cn.hutool.core.util.StrUtil;
-import cn.hutool.crypto.SecureUtil;
-import cn.hutool.json.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.storlead.framework.auth.jwt.JwtUtil;
-import com.storlead.framework.auth.vo.LoginUser;
-import com.storlead.framework.common.result.Result;
-import com.storlead.framework.redis.RedisService;
-import com.storlead.system.service.IMenuService;
-import com.storlead.system.service.IUserRoleService;
-import com.storlead.user.pojo.entity.DeptEntity;
-import com.storlead.user.pojo.entity.JobEntity;
-import com.storlead.user.pojo.entity.UserEntity;
-import com.storlead.wx.pojo.vo.CorpWeChatUserVO;
-import com.storlead.wx.pojo.vo.WechatToken;
-import com.storlead.wx.properties.CorpWeChatConstants;
-import com.storlead.wx.properties.CorpWeChatProperties;
-import com.storlead.wx.service.CorpWeChatService;
-import com.storlead.wx.service.WxDataSyncService;
-import com.storlead.wx.util.CorpWechatUtil;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.log4j.Log4j2;
-import org.springframework.beans.BeanUtils;
-import javax.annotation.Resource;
-import org.springframework.core.env.Environment;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.Objects;
-import java.util.concurrent.TimeUnit;
-
-/**
- * 企业微信管理
- *
- * @author blank
- * @date 2021-3-8 下午 12:06
- */
-@Api(tags = "系统: 企业微信管理")
-@RestController
-@RequestMapping("/xwork")
-@Log4j2
-public class CorpWeChatController {
-
-    @Resource
-    private CorpWeChatService corpWeChatService;
-
-    @Resource
-    private IUserService sysUserService;
-
-    @Resource
-    private IJobService jobService;
-
-    @Resource
-    private IDepartService departService;
-
-    @Resource
-    private RedisService redisService;
-
-    @Resource
-    private IUserRoleService userRoleService;
-
-    @Resource
-    private WxDataSyncService wxDataSyncService;
-
-    @Resource
-    private Environment environment;
-
-    @Resource
-    private IMenuService menuService;
-
-    @ApiOperation("获取AccessToken")
-    @GetMapping("/get_access_token")
-    public String getAccessToken() {
-        return corpWeChatService.getAccessToken().getToken();
-    }
-
-    @ApiOperation("获取JS Ticket")
-    @GetMapping("/get_js_api_ticket")
-    public String getJsApiTicket() {
-        return corpWeChatService.getJSApiTicket().getToken();
-    }
-
-    @ApiOperation("返回用于企业微信登陆所需要的参数")
-    @GetMapping("/get_x_work_login_param")
-    public Result<JSONObject> getCorpWechatLoginParam() {
-        Result<JSONObject> result = new Result<>();
-
-        result.setResult(corpWeChatService.getCorpWechatLoginParam());
-        return result;
-    }
-
-    @ApiOperation("根据code登录")
-    @GetMapping("/login")
-    public Result login(String code) {
-        String wxCode = corpWeChatService.login(code);
-        String corpId = CorpWeChatProperties.getCorpId();
-        String corpAddressSecret = CorpWeChatProperties.getCorpAddressSecret();
-        WechatToken t = CorpWechatUtil.getAccessToken(CorpWeChatConstants.GET_ACCESS_TOKEN_URL, corpId, corpAddressSecret);
-        CorpWeChatUserVO vo =  wxDataSyncService.getWxLoginInfo(t,code);
-
-        if (StrUtil.isBlank(wxCode)) {
-            return Result.error("微信登录错误,未获取到用户信息");
-        }
-        UserEntity userInfo = sysUserService.getOne(new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getXworkUserId,wxCode));
-        if (Objects.isNull(userInfo)) {
-            return Result.error("微信登录错误,未获取到用户信息");
-        }
-
-//        Integer possessMenuCount = menuService.checkUserMenuAccess(userInfo.getId());
-//        if (possessMenuCount == 0) {
-//            return Result.error("暂未获取到菜单权限,请联系管理员分配权限!");
-//        }
-
-        com.alibaba.fastjson.JSONObject obj = new com.alibaba.fastjson.JSONObject();
-        LoginUser loginUser = new LoginUser();
-        BeanUtils.copyProperties(userInfo,loginUser);
-
-        if (Objects.nonNull(userInfo.getJobId())) {
-            JobEntity job = jobService.getById(userInfo.getJobId());
-            if (Objects.nonNull(job)) {
-                loginUser.setJobName(job.getName());
-            }
-        }
-
-        if (Objects.nonNull(userInfo.getDeptId())) {
-            DeptEntity dept = departService.getById(userInfo.getDeptId());
-            if (Objects.nonNull(dept)) {
-                loginUser.setDeptJobDes(dept.getDeptJobDes());
-            }
-        }
-
-        //用户登录信息
-        String jwtToken = JwtUtil.createJWT(com.alibaba.fastjson.JSONObject.toJSONString(loginUser),loginUser.getMobile());
-        String token = SecureUtil.md5(jwtToken);
-
-        String json = com.alibaba.fastjson.JSONObject.toJSONString(loginUser);
-        redisService.setCacheObject(token, json, 60 * 60 * 24L, TimeUnit.SECONDS);
-//        Map<String, String> apiMap = new HashMap();
-//        redisService.setCacheObject(RedisKeySaltConstant.API_CODE_REDIS + loginUser.getMobile(), apiMap);
-        obj.put("token", token);
-        return Result.ok(obj);
-    }
-
-
-//    https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww5323bd8ab4394132&redirect_uri=https%3A%2F%2Fsales.test.storlead.com%2Findex&response_type=code&scope=snsapi_base&agentid=1000033&state=/fromQYwx#wechat_redirect
-
-    @ApiOperation("根据code登录")
-    @GetMapping("/code-login")
-    public Result apilogin(@RequestParam String code,
-                           HttpServletResponse response, HttpServletRequest request)  throws IOException {
-        log.error("code-login-------code="+code+"----state--"+"redirect_uri");
-        String redirect_uri ="";
-        log.error("requestURL----  "+request.getRequestURI());
-        String wxCode = corpWeChatService.login(code);
-        String corpId = CorpWeChatProperties.getCorpId();
-        String corpAddressSecret = CorpWeChatProperties.getCorpAddressSecret();
-        WechatToken t = CorpWechatUtil.getAccessToken(CorpWeChatConstants.GET_ACCESS_TOKEN_URL, corpId, corpAddressSecret);
-        CorpWeChatUserVO vo =  wxDataSyncService.getWxLoginInfo(t,code);
-
-        if (StrUtil.isBlank(wxCode)) {
-            return Result.error("微信登录错误,未获取到用户信息");
-        }
-        UserEntity userInfo = sysUserService.getOne(new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getXworkUserId,wxCode));
-        if (Objects.isNull(userInfo)) {
-            return Result.error("微信登录错误,未获取到用户信息");
-        }
-
-//        Integer possessMenuCount = menuService.checkUserMenuAccess(userInfo.getId());
-//        if (possessMenuCount == 0) {
-//            return Result.error("暂未获取到菜单权限,请联系管理员分配权限!");
-//        }
-
-        com.alibaba.fastjson.JSONObject obj = new com.alibaba.fastjson.JSONObject();
-        LoginUser loginUser = new LoginUser();
-        BeanUtils.copyProperties(userInfo,loginUser);
-
-        if (Objects.nonNull(userInfo.getJobId())) {
-            JobEntity job = jobService.getById(userInfo.getJobId());
-            if (Objects.nonNull(job)) {
-                loginUser.setJobName(job.getName());
-            }
-        }
-
-        if (Objects.nonNull(userInfo.getDeptId())) {
-            DeptEntity dept = departService.getById(userInfo.getDeptId());
-            if (Objects.nonNull(dept)) {
-                loginUser.setDeptJobDes(dept.getDeptJobDes());
-            }
-        }
-
-        //用户登录信息
-        String jwtToken = JwtUtil.createJWT(com.alibaba.fastjson.JSONObject.toJSONString(loginUser),loginUser.getMobile());
-        String token = SecureUtil.md5(jwtToken);
-
-        String json = com.alibaba.fastjson.JSONObject.toJSONString(loginUser);
-        redisService.setCacheObject(token, json, 60 * 60 * 24L, TimeUnit.SECONDS);
-//        Map<String, String> apiMap = new HashMap();
-//        redisService.setCacheObject(RedisKeySaltConstant.API_CODE_REDIS + loginUser.getMobile(), apiMap);
-        obj.put("token", token);
-
-        String mobileUrl = "";
-        if (isMobile(request)) {
-            mobileUrl ="/H5";
-        }
-
-        String active = "";
-        if(environment.equals("prod")) {
-            active = "";
-        } else if (environment.equals("test")){
-            active = "test.";
-        }
-
-        String redirectUrl = "https://sales."+active+"storlead.com"+mobileUrl+"/index?token=" + token;
-        log.error("===redirectUrl-----"+redirectUrl);
-        response.sendRedirect(redirectUrl);
-
-        return Result.ok(obj);
-    }
-
-    public boolean isMobile(HttpServletRequest request) {
-        String userAgent = request.getHeader("User-Agent");
-        if (userAgent == null) {
-            return false;
-        }
-        // 常见移动设备关键字
-        String[] mobileKeywords = {
-                "Mobile", "Android", "iPhone", "iPad", "iPod",
-                "BlackBerry", "Windows Phone", "Opera Mini", "IEMobile"
-        };
-
-        userAgent = userAgent.toLowerCase();
-        for (String keyword : mobileKeywords) {
-            if (userAgent.contains(keyword.toLowerCase())) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-}

+ 0 - 235
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/DepartmentApiController.java

@@ -1,235 +0,0 @@
-package com.storlead.sales.controller.system;//package com.storlead.sales.system;
-//
-//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-//import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-//import com.baomidou.mybatisplus.core.metadata.IPage;
-//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-//import com.storlead.framework.common.result.Result;
-//import com.storlead.user.pojo.dto.DepartmentParam;
-//import com.storlead.user.pojo.entity.DeptEntity;
-//import com.storlead.user.pojo.entity.UserEntity;
-//import com.storlead.user.pojo.vo.DepartmentTree;
-//import com.storlead.user.service.IDepartService;
-//import com.storlead.user.service.IUserService;
-//import io.swagger.annotations.ApiOperation;
-//import lombok.extern.log4j.Log4j2;
-//import javax.annotation.Resource;
-//import org.springframework.util.CollectionUtils;
-//import org.springframework.web.bind.annotation.PostMapping;
-//import org.springframework.web.bind.annotation.RequestBody;
-//import org.springframework.web.bind.annotation.RequestMapping;
-//import org.springframework.web.bind.annotation.RestController;
-//
-//import javax.annotation.Resource;
-//import java.util.ArrayList;
-//import java.util.Arrays;
-//import java.util.List;
-//import java.util.Objects;
-//
-///**
-// * @program: sp-cloud
-// * @description:
-// * @author: chenkq
-// * @create: 2022-05-13 12:00
-// */
-//@Log4j2
-//@RestController
-//@RequestMapping("/sys/department")
-//public class DepartmentApiController {
-//
-//    public static Integer FIRST_CODE = 100;
-//
-//    @Resource
-//    private IUserService userService;
-//
-//    @Resource
-//    private IDepartService departmentService;
-//
-//    @ApiOperation("获取组织列表")
-//    @PostMapping("listPage")
-//    public Result listPage(@RequestBody DepartmentParam param) {
-//        IPage page = new Page(param.getPageIndex(),param.getPageSize());
-//        LambdaQueryWrapper<DeptEntity> query = new LambdaQueryWrapper();
-//
-//
-////        if (param.getOrgTypes() != null) {
-////            query.in(Dept::getOrgType,param.getOrgTypes());
-////        }
-////        if (param.getParentId() != null) {
-////            Dept depart = departmentService.getById(param.getParentId());
-////            if (Objects.nonNull(depart)) {
-////                query.likeLeft(Dept::getOrgCode,depart.getOrgCode());
-////            }
-////        }
-//        IPage<DeptEntity> depts = departmentService.page(page,query);
-//        return Result.ok(depts);
-//    }
-//
-//    @ApiOperation("获取组织树")
-//    @PostMapping("listTree")
-//    public Result tree(@RequestBody DepartmentParam param) {
-//        LambdaQueryWrapper<DeptEntity> query = new LambdaQueryWrapper();
-////        if (param.getOrgTypes() != null) {
-////            query.in(Dept::getOrgType,param.getOrgTypes());
-////        }
-////        if (param.getParentId() != null) {
-////            Dept depart = departmentService.getById(param.getParentId());
-////            if (Objects.nonNull(depart)) {
-////                query.likeLeft(Dept::getOrgCode,depart.getOrgCode());
-////            }
-////        }
-//        List<DeptEntity> depts = departmentService.list(query);
-//
-////        Map<String, List<Employee>> groupByGrade = new HashMap<>();
-////        if (!CollectionUtils.isEmpty(param.getOrgTypes()) && param.getOrgTypes().contains(99) && !CollectionUtils.isEmpty(depts)) {
-////            List<Employee> employees = employeeService.list();
-////            groupByGrade = employees.stream().collect(Collectors.groupingBy(Employee::getOrgRouteCode));
-////        }
-////        List<DepartmentTree> trees = new ArrayList<>();
-////        for (Department d : depts) {
-////            DepartmentTree departmentTree = new DepartmentTree();
-////            departmentTree.setId(d.getId());
-////            departmentTree.setParentId(d.getParentId());
-////            departmentTree.setTitle(d.getOrgName());
-////            departmentTree.setCode(d.getOrgCode());
-////            departmentTree.setArg(d);
-////            departmentTree.setChildren(getEmployeeTree(groupByGrade.get(d.getOrgCode()),param.getCheckNodes()));
-////            departmentTree.setType(d.getOrgType());
-////            if (Objects.nonNull(param.getCheckNodes()) && param.getCheckNodes().contains(d.getOrgType())) {
-////                departmentTree.setDisabled(false);
-////                departmentTree.setDisableCheckbox(false);
-////
-////            }
-////            trees.add(departmentTree);
-////        }
-////
-////        List<Long> pids = new ArrayList<>();
-////        trees.forEach(t -> {
-////            pids.add(t.getId());
-////        });
-////        List<Long> pidls = trees.stream().filter(r -> !pids.contains(r.getParentId())).map(DepartmentTree::getParentId).collect(Collectors.toList());
-////        List<DepartmentTree> result = createTreels(trees,pidls);
-//        return Result.ok(depts);
-//    }
-//
-//    public List<DepartmentTree> getEmployeeTree(List<UserEntity> users, List<Integer> checkNodes){
-//        if (CollectionUtils.isEmpty(users)) {
-//            return  null;
-//        }
-//        List<DepartmentTree> trees = new ArrayList<>();
-//        for (UserEntity d : users) {
-//            DepartmentTree departmentTree = new DepartmentTree();
-//            departmentTree.setId(d.getId());
-//            departmentTree.setParentId(d.getDeptId());
-//            departmentTree.setTitle(d.getRealName());
-//            // departmentTree.setCode(d.getOrgRouteCode());
-//            departmentTree.setArg(d);
-//            departmentTree.setType(99);
-//            departmentTree.setExpand(false);
-//            if (Objects.nonNull(checkNodes) && checkNodes.contains(Integer.valueOf(99))) {
-//                departmentTree.setDisabled(false);
-//                departmentTree.setDisableCheckbox(false);
-//            }
-//            trees.add(departmentTree);
-//        }
-//        return trees;
-//    }
-//
-//    @ApiOperation("保存部门信息")
-//    @PostMapping("save")
-//    public Result save(DeptEntity info) {
-////        String routeCode ;
-////        if (StrUtil.isBlank(info.getOrgCode())) {
-////            Dept department = departmentService.getRootLastNodeInfo(info.getParentId());
-////            String lastCode;
-////            if (department == null) {
-////                lastCode = String.valueOf(FIRST_CODE);
-////                info.setParentId(Long.valueOf(0));
-////                routeCode = lastCode;
-////            } else {
-////                if (department.getId().equals(info.getParentId())) {
-////                    lastCode = String.valueOf(FIRST_CODE);
-////                    routeCode = department.getOrgCode()+","+lastCode;
-////                } else {
-////                    String [] routeCodes = department.getOrgCode().split(",");
-////                    lastCode = routeCodes[routeCodes.length-1];
-////                    lastCode = String.valueOf(Integer.valueOf(lastCode)+1);
-////                    routeCodes[routeCodes.length-1] = lastCode;
-////                    routeCode = StringUtils.join(routeCodes,",");
-////                }
-////            }
-////            info.setOrgCode(routeCode);
-////        }
-//        departmentService.saveOrUpdate(info);
-//        return Result.ok();
-//    }
-//
-//    @ApiOperation("删除部门")
-//    @PostMapping("delete")
-//    public Result delete(Long [] ids) {
-//        if (ids == null || ids.length == 0) {
-//            return Result.error("参数错误");
-//        }
-//        Integer exist = departmentService.count(new LambdaQueryWrapper<DeptEntity>().in(DeptEntity::getPid, Arrays.asList(ids)));
-//        if (!Objects.equals(exist,Integer.valueOf(0))) {
-//            return Result.error("请先删除下级部门!");
-//        }
-//        exist = userService.count(new LambdaQueryWrapper<UserEntity>().in(UserEntity::getDeptId, Arrays.asList(ids)));
-//        if (!Objects.equals(exist,Integer.valueOf(0))) {
-//            return Result.error("该部门下还有员工,不能删除!");
-//        }
-//        departmentService.removeByIds(Arrays.asList(ids));
-//        return Result.ok();
-//    }
-//
-//    @ApiOperation("设置部门领导")
-//    @PostMapping("setDepartManager")
-//    public Result delete(Long departId ,Long managerId) {
-//        if (Objects.isNull(departId)) {
-//            return Result.error("参数错误");
-//        }
-//        LambdaUpdateWrapper<DeptEntity> updateWrapper = new LambdaUpdateWrapper();
-//        updateWrapper.eq(DeptEntity::getId,departId);
-//        updateWrapper.set(DeptEntity::getManagerId,managerId);
-//        departmentService.update(updateWrapper);
-//        return Result.ok();
-//    }
-//
-//    @ApiOperation("设置部门分管领导")
-//    @PostMapping("setDepartSubManager")
-//    public Result delete(Long departId,String subManagerIds) {
-//        if (Objects.isNull(departId)) {
-//            return Result.error("参数错误");
-//        }
-//        LambdaUpdateWrapper<DeptEntity> updateWrapper = new LambdaUpdateWrapper();
-//        updateWrapper.eq(DeptEntity::getId,departId);
-//        updateWrapper.set(DeptEntity::getSubManagerIds,subManagerIds);
-//        departmentService.update(updateWrapper);
-//        return Result.ok();
-//    }
-//
-//    private List<DepartmentTree> createTreeVo(List<DepartmentTree> treels, Long pid) {
-//        List<DepartmentTree> trees = new ArrayList<>();
-//        for (DepartmentTree tree : treels) {
-//            if (pid.equals(tree.getParentId())) {
-//                trees.add(tree);
-//                List<DepartmentTree> childs =  createTreeVo(treels,tree.getId());
-//                if (childs != null && childs.size() > 0) {
-//                    if (tree.getChildren() != null) {
-//                        childs.addAll(tree.getChildren());
-//                    }
-//                    tree.setChildren(childs);
-//                }
-//            }
-//        }
-//        return trees;
-//    }
-//
-//    private List<DepartmentTree> createTreels(List<DepartmentTree> treels, List<Long> pids) {
-//        List<DepartmentTree> trees = new ArrayList<>();
-//        for (Long pid : pids) {
-//            trees.addAll(createTreeVo(treels,pid));
-//        }
-//        return trees;
-//    }
-//}

+ 0 - 656
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/DeptApiController.java

@@ -1,656 +0,0 @@
-package com.storlead.sales.controller.system;
-
-import cn.hutool.core.util.StrUtil;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.storlead.framework.common.constant.CommonConstant;
-import com.storlead.framework.common.result.Result;
-import com.storlead.system.util.SystemSettingCacheCheckUtil;
-import com.storlead.user.pojo.dto.CompanyDTO;
-import com.storlead.user.pojo.dto.DepartmentParam;
-import com.storlead.user.pojo.entity.CompanyEntity;
-import com.storlead.user.pojo.entity.DeptEntity;
-import com.storlead.user.pojo.entity.SubCompanyEntity;
-import com.storlead.user.pojo.entity.UserEntity;
-import com.storlead.user.pojo.vo.DepartmentTree;
-import com.storlead.user.service.ICompanyService;
-import com.storlead.user.service.IDepartService;
-import com.storlead.user.service.ISubCompanyService;
-import com.storlead.user.service.IUserService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.log4j.Log4j2;
-import org.apache.commons.lang3.StringUtils;
-import javax.annotation.Resource;
-import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.*;
-import java.util.stream.Collectors;
-
-/**
- * @program: sp-sales
- * @description:
- * @author: chenkq
- * @create: 2022-06-29 17:46
- */
-@Api(tags = "系统: 公司部门数据维护")
-@RestController
-@RequestMapping("/sys/dept")
-@Log4j2
-public class DeptApiController {
-
-    @Resource
-    private IDepartService departService;
-
-    @Resource
-    private IUserService userService;
-
-    @Resource
-    private ICompanyService companyService;
-
-    @Resource
-    private ISubCompanyService subCompanyService;
-//    @ApiOperation("获取部门组织列")
-//    @PostMapping("listPage")
-//    public Result listPage(@RequestBody DepartmentParam p
-//    aram) {
-//        IPage page = new Page(param.getPageIndex(),param.getPageSize());
-//        LambdaQueryWrapper<Dept> query = new LambdaQueryWrapper();
-//        if (param.getOrgTypes() != null) {
-//            query.in(Department::getOrgType,param.getOrgTypes());
-//        }
-//        if (param.getParentId() != null) {
-//            Department depart = departmentService.getById(param.getParentId());
-//            if (Objects.nonNull(depart)) {
-//                query.likeLeft(Department::getOrgCode,depart.getOrgCode());
-//            }
-//        }
-//        IPage<Department> depts = departmentService.page(page,query);
-//        return Result.success(depts);
-//    }
-    @ApiOperation("通过公司id返回部门List")
-    @PostMapping("getListBySub")
-    public Result getListBySub(Long subCompanyId) {
-        LambdaQueryWrapper<DeptEntity> deptQquery = new LambdaQueryWrapper<>();
-        deptQquery.eq(DeptEntity::getIsDelete,0);
-        deptQquery.eq(DeptEntity::getSubCompanyId,subCompanyId);
-        List<DeptEntity> deptList = departService.list(deptQquery);
-        return Result.ok(deptList);
-    }
-
-    @ApiOperation("获取组织树")
-    @PostMapping("scopelistTree")
-    public Result scopelistTree(@RequestBody DepartmentParam param) {
-        List<CompanyEntity> companys = new ArrayList<>();
-        List<SubCompanyEntity> subCompanies = new ArrayList<>();
-        List<DeptEntity> depts = new ArrayList<>();
-        if (Objects.isNull(param.getOrgTypes())) {
-            return Result.error("参数错误");
-        }
-
-        LambdaQueryWrapper<UserEntity> userQquery = new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getIsDelete,0);
-        userQquery.eq(Objects.nonNull(param.getEnabled()),UserEntity::getEnabled,param.getEnabled());
-
-        List<UserEntity> users = userService.listWithScope(userQquery);
-        Set<Long> deptIds = new HashSet<>();
-        Set<Long> subCompanyIds = new HashSet<>();
-        Set<Long> companyIds = new HashSet<>();
-        if (!CollectionUtils.isEmpty(users)) {
-
-             deptIds = users.stream().map(UserEntity::getDeptId).collect(Collectors.toSet());
-             subCompanyIds = users.stream().map(UserEntity::getSubCompanyId).collect(Collectors.toSet());
-             companyIds = users.stream().map(UserEntity::getCompanyId).collect(Collectors.toSet());
-        }
-
-        Map<Long,String> usMap = userService.list().stream().collect(Collectors.toMap(UserEntity::getId,UserEntity::getRealName));
-        List<DepartmentTree> pidls = Collections.EMPTY_LIST;
-        List<DepartmentTree> trees = new ArrayList<>();
-        //类型:10 集团,20:公司(分公司),30:部门,40:小组,50:雇员
-        if (param.getOrgTypes().contains(Integer.valueOf(10)) && !CollectionUtils.isEmpty(companyIds)) {
-            LambdaQueryWrapper<CompanyEntity> cuwp = new LambdaQueryWrapper<CompanyEntity>();
-            cuwp.in(CompanyEntity::getId,companyIds);
-            companys = companyService.list(cuwp);
-            List<DepartmentTree> ls =  DepartmentTree.companyListToDepartmentTreeVoList(companys);
-            if (!CollectionUtils.isEmpty(ls)) {
-                pidls = ls;
-                trees.addAll(ls);
-            }
-        }
-        if (param.getOrgTypes().contains(Integer.valueOf(20)) && !CollectionUtils.isEmpty(subCompanyIds)) {
-            LambdaQueryWrapper<SubCompanyEntity> subCompanyQquery = new LambdaQueryWrapper<SubCompanyEntity>().eq(SubCompanyEntity::getIsDelete,0);
-            subCompanyQquery.eq(Objects.nonNull(param.getEnabled()),SubCompanyEntity::getEnabled,param.getEnabled());
-            if (!CollectionUtils.isEmpty(subCompanyIds)) {
-                subCompanyQquery.in(SubCompanyEntity::getId,subCompanyIds);
-            }
-            subCompanies = subCompanyService.list(subCompanyQquery);
-            if (CollectionUtils.isEmpty(subCompanies)) {
-                subCompanies.forEach(sc -> {
-                    String realName = usMap.get(sc.getLeaderId());
-                    sc.setLeaderName(StrUtil.isEmpty(realName) ? "" : realName);
-                });
-            }
-            List<DepartmentTree> ls =  DepartmentTree.subCompanyListToDepartmentTreeVoList(subCompanies);
-            if (!CollectionUtils.isEmpty(ls)) {
-                if (CollectionUtils.isEmpty(pidls)) {
-                    pidls = ls;
-                }
-                trees.addAll(ls);
-            }
-        }
-
-        if (param.getOrgTypes().contains(Integer.valueOf(30)) && !CollectionUtils.isEmpty(deptIds)) {
-            LambdaQueryWrapper<DeptEntity> dmap1= new LambdaQueryWrapper<>();
-            dmap1.eq(Objects.nonNull(param.getEnabled()),DeptEntity::getEnabled,param.getEnabled());
-
-            List<DeptEntity> allDepts = departService.list(dmap1);
-            if (!CollectionUtils.isEmpty(allDepts)) {
-                Map<Long, DeptEntity> allDeptMaps =  allDepts.stream().collect(Collectors.toMap(DeptEntity::getId, a -> a,(existing, replacement) -> existing));
-                Set<Long> allParentIds = getParentDeptsForMultiple(deptIds, allDeptMaps);
-                if (!CollectionUtils.isEmpty(allParentIds)) {
-                    deptIds.addAll(allParentIds);
-                }
-            }
-            LambdaQueryWrapper<DeptEntity> dmap= new LambdaQueryWrapper<>();
-            dmap.in(DeptEntity::getId,deptIds);
-            dmap1.eq(Objects.nonNull(param.getEnabled()),DeptEntity::getEnabled,param.getEnabled());
-
-            depts = departService.list(dmap);
-            if (CollectionUtils.isEmpty(depts)) {
-                depts.forEach(d -> {
-                    String realName = usMap.get(d.getManagerId());
-                    d.setLeaderName(StrUtil.isEmpty(realName) ? "" : realName);
-                });
-            }
-            List<DepartmentTree> ls =  DepartmentTree.deptListToDepartmentTreeVoList(depts);
-            if (!CollectionUtils.isEmpty(ls)) {
-                if (CollectionUtils.isEmpty(pidls)) {
-                    pidls = ls;
-                }
-                trees.addAll(ls);
-            }
-        }
-
-        Map<Long, List<UserEntity>> groupByGrade = new HashMap<>();
-        if (!CollectionUtils.isEmpty(param.getOrgTypes()) && param.getOrgTypes().contains(99) && !CollectionUtils.isEmpty(depts)) {
-            if (!CollectionUtils.isEmpty(users)) {
-                groupByGrade = users.stream().collect(Collectors.groupingBy(UserEntity::getDeptId));
-            }
-        }
-        List<DepartmentTree> newTrees = new ArrayList<>();
-        for (DepartmentTree d : trees) {
-            if (Integer.valueOf(30).equals(d.getType())) {
-                d.setChildren(getEmployeeTree(groupByGrade.get(d.getId()),param.getCheckNodes()));
-            }
-            if (Objects.nonNull(param.getCheckNodes()) && param.getCheckNodes().contains(d.getType())) {
-                d.setDisabled(false);
-                d.setDisableCheckbox(false);
-            }
-            newTrees.add(d);
-        }
-        List<DepartmentTree> result =  createTreels(newTrees,pidls);;
-        return Result.ok(result);
-    }
-
-
-    @ApiOperation("获取组织树")
-    @PostMapping("orgTree")
-    public Result orgTree(@RequestBody DepartmentParam param) {
-        param.setEnabled(null);
-        return listTree(param);
-    }
-
-    @ApiOperation("获取组织树")
-    @PostMapping("listTree")
-    public Result listTree(@RequestBody DepartmentParam param) {
-        if (StrUtil.isNotBlank(param.getScopeMenuId()) && !Integer.valueOf(1).equals(param.getReviewTag())) {
-            return scopelistTree(param);
-        }
-        List<CompanyEntity> companys = Collections.EMPTY_LIST;
-        List<SubCompanyEntity> subCompanies = Collections.EMPTY_LIST;
-        List<DeptEntity> depts = Collections.EMPTY_LIST;
-        if (Objects.isNull(param.getOrgTypes())) {
-            return Result.error("参数错误");
-        }
-        Map<Long,String> usMap = userService.list().stream().collect(Collectors.toMap(UserEntity::getId,UserEntity::getRealName));
-        List<DepartmentTree> pidls = Collections.EMPTY_LIST;
-        List<DepartmentTree> trees = new ArrayList<>();
-        //类型:10 集团,20:公司(分公司),30:部门,40:小组,50:雇员
-        if (param.getOrgTypes().contains(Integer.valueOf(10))) {
-            companys = companyService.list();
-            List<DepartmentTree> ls =  DepartmentTree.companyListToDepartmentTreeVoList(companys);
-            if (!CollectionUtils.isEmpty(ls)) {
-                pidls = ls;
-                trees.addAll(ls);
-            }
-        }
-        if (param.getOrgTypes().contains(Integer.valueOf(20))) {
-            LambdaQueryWrapper<SubCompanyEntity> subCompanyQquery = new LambdaQueryWrapper<SubCompanyEntity>().eq(SubCompanyEntity::getIsDelete,0);
-            subCompanyQquery.eq(Objects.nonNull(param.getEnabled()),SubCompanyEntity::getEnabled,param.getEnabled());
-            if (Objects.nonNull(param.getSubCompanyId())) {
-                subCompanyQquery.eq(SubCompanyEntity::getId,param.getSubCompanyId());
-            }
-            subCompanies = subCompanyService.list(subCompanyQquery);
-            if (CollectionUtils.isEmpty(subCompanies)) {
-                subCompanies.forEach(sc -> {
-                    String realName = usMap.get(sc.getLeaderId());
-                    sc.setLeaderName(StrUtil.isEmpty(realName) ? "" : realName);
-                });
-            }
-            List<DepartmentTree> ls =  DepartmentTree.subCompanyListToDepartmentTreeVoList(subCompanies);
-            if (!CollectionUtils.isEmpty(ls)) {
-                if (CollectionUtils.isEmpty(pidls)) {
-                    pidls = ls;
-                }
-                trees.addAll(ls);
-            }
-        }
-
-        if (param.getOrgTypes().contains(Integer.valueOf(30))) {
-            LambdaQueryWrapper<DeptEntity> deptQquery = new LambdaQueryWrapper<DeptEntity>().eq(DeptEntity::getIsDelete,0);
-            deptQquery.eq(Objects.nonNull(param.getEnabled()),DeptEntity::getEnabled,param.getEnabled());
-            if (Objects.nonNull(param.getDeptId())) {
-                DeptEntity d = departService.getById(param.getDeptId());
-                if (Objects.nonNull(d)) {
-                    deptQquery.apply(" LOCATE(route_code,'"+d.getRouteCode()+"') = 1 ");
-                }
-            }
-            depts = departService.list(deptQquery);
-            if (CollectionUtils.isEmpty(depts)) {
-                depts.forEach(d -> {
-                    String realName = usMap.get(d.getManagerId());
-                    d.setLeaderName(StrUtil.isEmpty(realName) ? "" : realName);
-                });
-            }
-            List<DepartmentTree> ls =  DepartmentTree.deptListToDepartmentTreeVoList(depts);
-            if (!CollectionUtils.isEmpty(ls)) {
-                if (CollectionUtils.isEmpty(pidls)) {
-                    pidls = ls;
-                }
-                trees.addAll(ls);
-            }
-        }
-
-        Map<Long, List<UserEntity>> groupByGrade = new HashMap<>();
-        if (!CollectionUtils.isEmpty(param.getOrgTypes()) && param.getOrgTypes().contains(99) && !CollectionUtils.isEmpty(depts)) {
-            LambdaQueryWrapper<UserEntity> userQquery = new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getIsDelete,0);
-            userQquery.eq(Objects.nonNull(param.getEnabled()),UserEntity::getEnabled,param.getEnabled());
-
-            List<UserEntity> users = userService.list(userQquery);
-            if (!CollectionUtils.isEmpty(users)) {
-                groupByGrade = users.stream().collect(Collectors.groupingBy(UserEntity::getDeptId));
-            }
-        }
-        List<DepartmentTree> newTrees = new ArrayList<>();
-        for (DepartmentTree d : trees) {
-            if (Integer.valueOf(30).equals(d.getType())) {
-                d.setChildren(getEmployeeTree(groupByGrade.get(d.getId()),param.getCheckNodes()));
-            }
-            if (Objects.nonNull(param.getCheckNodes()) && param.getCheckNodes().contains(d.getType())) {
-                d.setDisabled(false);
-                d.setDisableCheckbox(false);
-            }
-            newTrees.add(d);
-        }
-        List<DepartmentTree> result =  createTreels(newTrees,pidls);;
-        return Result.ok(result);
-    }
-
-    public Set<Long> getParentDeptsForMultiple(Set<Long> deptIds, Map<Long, DeptEntity> allDepts) {
-        Set<Long> allParentIds = new HashSet<>();
-        Set<Long> currentLevel = new HashSet<>(deptIds);
-
-        while (!currentLevel.isEmpty()) {
-            Set<Long> nextLevel = new HashSet<>();
-            for (Long deptId : currentLevel) {
-                DeptEntity dept = allDepts.get(deptId);
-                if (dept != null && dept.getPid() != null && dept.getPid() != 0) {
-                    if (!allParentIds.contains(dept.getPid())) {
-                        allParentIds.add(dept.getPid());
-                        nextLevel.add(dept.getPid());
-                    }
-                }
-            }
-            currentLevel = nextLevel;
-        }
-        return allParentIds;
-    }
-
-    private List<DepartmentTree> createTreeVo(List<DepartmentTree> treels, DepartmentTree treeVo,Long topId) {
-        List<DepartmentTree> trees = new ArrayList<>();
-        for (DepartmentTree tree : treels) {
-
-            /**
-             * 处理公司,部门,用户id冲突无法满足组装通用树结构得问题 begin
-             */
-            if (Objects.nonNull(treeVo)
-                    && (Integer.valueOf(10).equals(treeVo.getType())
-                    && (!Integer.valueOf(20).equals(tree.getType()) && !Integer.valueOf(10).equals(tree.getType())))) {
-                continue;
-            }
-            if (Objects.nonNull(treeVo)
-                    && (Integer.valueOf(20).equals(treeVo.getType())
-                    && !Integer.valueOf(30).equals(tree.getType()))) {
-                continue;
-            }
-            if (Objects.nonNull(treeVo)
-                    && (Integer.valueOf(30).equals(treeVo.getType())
-                    && (!Integer.valueOf(30).equals(tree.getType())))) {
-                continue;
-            }
-
-            Long pid = Objects.nonNull(topId) ? treeVo.getId() : Long.valueOf(0);
-            Long parentId = tree.getParentId();
-
-            if (Objects.nonNull(treeVo) && Integer.valueOf(20).equals(treeVo.getType()) && Integer.valueOf(30).equals(tree.getType()) ) {
-                DeptEntity dept = (DeptEntity)tree.getArg();
-                if (!Long.valueOf(0).equals(dept.getPid())) {
-                    continue;
-                }
-            }
-            else if (Objects.nonNull(treeVo) && Integer.valueOf(30).equals(treeVo.getType()) && Integer.valueOf(30).equals(tree.getType()) ) {
-                DeptEntity deptp = (DeptEntity)treeVo.getArg();
-                DeptEntity dept = (DeptEntity)tree.getArg();
-
-                if (Long.valueOf(0).equals(dept.getPid())) {
-                    continue;
-                }
-//                if (Long.valueOf(0).equals(deptp.getPid()) && Long.valueOf(0).equals(dept.getPid())) {
-//                    continue;
-//                }
-            }
-            if (pid.equals(parentId)) {
-                trees.add(tree);
-                List<DepartmentTree> childs =  createTreeVo(treels,tree,tree.getParentId());
-                if (!CollectionUtils.isEmpty(childs)) {
-                    if (tree.getChildren() != null) {
-                        childs.addAll(tree.getChildren());
-                    }
-                    tree.setChildren(childs);
-                }
-            }
-        }
-        return trees;
-    }
-
-    private List<DepartmentTree> createTreels(List<DepartmentTree> treels, List<DepartmentTree>  pTrees) {
-        List<DepartmentTree> trees = new ArrayList<>();
-        trees.addAll(createTreeVo(treels,null,null));
-        return trees;
-    }
-
-
-    public List<DepartmentTree> getEmployeeTree(List<UserEntity> users, List<Integer> checkNodes){
-        if (CollectionUtils.isEmpty(users)) {
-            return  null;
-        }
-        List<DepartmentTree> trees = new ArrayList<>();
-        for (UserEntity d : users) {
-            DepartmentTree departmentTree = new DepartmentTree();
-            departmentTree.setId(d.getId());
-            departmentTree.setParentId(d.getDeptId());
-            departmentTree.setTitle(d.getRealName());
-            departmentTree.setArg(d);
-            departmentTree.setPhoto(d.getAvatar());
-            departmentTree.setAvatar(d.getAvatar());
-            departmentTree.setType(99);
-            departmentTree.setExpand(false);
-            if (Objects.nonNull(checkNodes) && checkNodes.contains(Integer.valueOf(99))) {
-                departmentTree.setDisabled(false);
-                departmentTree.setDisableCheckbox(false);
-            }
-            trees.add(departmentTree);
-        }
-        return trees;
-    }
-
-
-    @ApiOperation("新增部门")
-    @PostMapping("save")
-    public Result save(DeptEntity dept) {
-        Result r = SystemSettingCacheCheckUtil.checkAddDataMode();
-        if (!r.isSuccess()) {
-            return r;
-        }
-        if (Objects.isNull(dept.getPid())) {
-            dept.setPid(Long.valueOf(0));
-        }
-        if(Objects.isNull(dept.getId())) {
-            dept.setDataSource(1);
-            String topCode = "";
-            LambdaQueryWrapper<DeptEntity> subQWrapper = new LambdaQueryWrapper();
-            if (Long.valueOf(0).equals(dept.getPid())) {
-                LambdaQueryWrapper<SubCompanyEntity> lm = new LambdaQueryWrapper();
-                lm.eq(SubCompanyEntity::getId,dept.getSubCompanyId());
-                lm.last("limit 1");
-                SubCompanyEntity subCompany = subCompanyService.getOne(lm);
-                if (Objects.isNull(subCompany)) {
-                    return Result.error("部门需要挂载在在公司下面,请绑定部门公司");
-                }
-                dept.setCompanyId(subCompany.getCompanyId());
-                subQWrapper.eq(DeptEntity::getSubCompanyId,subCompany.getId());
-                topCode = subCompany.getRouteCode();
-            } else {
-                LambdaQueryWrapper<DeptEntity> lm = new LambdaQueryWrapper();
-                lm.eq(DeptEntity::getId,dept.getPid());
-                lm.last("limit 1");
-                DeptEntity dept1 = departService.getOne(lm);
-                if (Objects.isNull(dept1)) {
-                    return Result.error("参数错误,未查到上级部门");
-                }
-                dept.setSubCompanyId(dept1.getSubCompanyId());
-                dept.setCompanyId(dept1.getCompanyId());
-                subQWrapper.eq(DeptEntity::getId,dept1.getId());
-                topCode = dept1.getRouteCode();
-            }
-            subQWrapper.orderByDesc(DeptEntity::getRouteCode);
-            subQWrapper.last("limit 1");
-            DeptEntity dept1 = departService.getOne(subQWrapper);
-            if (Objects.isNull(dept1)) {
-                dept.setRouteCode(topCode+",100");
-            }else {
-                String [] routeCodes = dept1.getRouteCode().split(",");
-                String lastCode = routeCodes[routeCodes.length-1];
-                lastCode = String.valueOf(Integer.valueOf(lastCode)+1);
-                routeCodes[routeCodes.length-1] = lastCode;
-                String routeCode = StringUtils.join(routeCodes,",");
-                dept.setRouteCode(routeCode);
-            }
-        }
-
-        departService.saveOrUpdate(dept);
-        return Result.ok();
-    }
-
-    @ApiOperation("分页查询部门")
-    @PostMapping("pagelist")
-    public Result save(CompanyDTO param) {
-        IPage<DeptEntity> page = new Page<>(param.getPageIndex(),param.getPageSize());
-        IPage<DeptEntity> depts = departService.page(page);
-        return Result.ok(depts);
-    }
-
-    @ApiOperation("删除部门数据")
-    @PostMapping("delete")
-    public Result delete(Long [] ids) {
-        if (ids == null || ids.length == 0) {
-            return Result.error("参数错误");
-        }
-        Integer exist = userService.count(new LambdaQueryWrapper<UserEntity>().in(UserEntity::getDeptId, Arrays.asList(ids)));
-        if (!Objects.equals(exist,Integer.valueOf(0))) {
-            return Result.error("部门下有关联的员工,无法删除!");
-        }
-        departService.removeByIds(Arrays.asList(ids));
-        return Result.ok();
-    }
-
-
-    @ApiOperation("设置部门领导")
-    @PostMapping("setDepartManager")
-    public Result delete(Long deptId ,Long managerId) {
-        if (Objects.isNull(deptId)) {
-            return Result.error("参数错误");
-        }
-        LambdaUpdateWrapper<DeptEntity> updateWrapper = new LambdaUpdateWrapper();
-        updateWrapper.eq(DeptEntity::getId,deptId);
-        UserEntity user = userService.getById(managerId);
-        if (Objects.nonNull(user)) {
-            updateWrapper.set(DeptEntity::getManagerId,managerId);
-            updateWrapper.set(DeptEntity::getLeaderName,user.getRealName());
-        } else {
-            updateWrapper.set(DeptEntity::getManagerId,null);
-            updateWrapper.set(DeptEntity::getLeaderName,"");
-        }
-        DeptEntity deptMar = departService.getById(deptId);
-        Boolean b =  departService.update(updateWrapper);
-        if (b) {
-            if (Objects.nonNull(deptMar)) {
-                if (!managerId.equals(deptMar.getManagerId())) {
-                    UserEntity oldUser = userService.getById(deptMar.getManagerId());
-                    if (Objects.nonNull(oldUser) && !Integer.valueOf(1).equals(oldUser.getIsLeader()))  {
-                        LambdaQueryWrapper userDeptLq =  new LambdaQueryWrapper<DeptEntity>().eq(DeptEntity::getManagerId,deptMar.getManagerId()).ne(DeptEntity::getId,deptId);
-                        Integer c = departService.count(userDeptLq);
-                        LambdaUpdateWrapper<UserEntity> rmLeaderUpdate = new LambdaUpdateWrapper();
-                        if (c > 0) {
-                            rmLeaderUpdate.set(UserEntity::getIsLeader,Integer.valueOf(2));
-                        } else {
-                            rmLeaderUpdate.set(UserEntity::getIsLeader,Integer.valueOf(0));
-                        }
-                        rmLeaderUpdate.eq(UserEntity::getId,deptMar.getManagerId());
-                        userService.update(rmLeaderUpdate);
-                    }
-                }
-            }
-            if (Integer.valueOf(1).equals(user.getIsLeader()) || Integer.valueOf(2).equals(user.getIsLeader())) {
-                return Result.ok();
-            }
-            LambdaUpdateWrapper<UserEntity> userUpdate = new LambdaUpdateWrapper();
-            userUpdate.set(UserEntity::getIsLeader,Integer.valueOf(2));
-            userUpdate.eq(UserEntity::getId,managerId);
-            userService.update(userUpdate);
-        }
-        return Result.ok();
-    }
-
-    @ApiOperation("设置部门分管领导")
-    @PostMapping("setDepartSubManager")
-    public Result delete(Long deptId,String subManagerIds) {
-        if (Objects.isNull(deptId)) {
-            return Result.error("参数错误");
-        }
-        LambdaUpdateWrapper<DeptEntity> updateWrapper = new LambdaUpdateWrapper();
-        updateWrapper.eq(DeptEntity::getId,deptId);
-        updateWrapper.set(DeptEntity::getSubManagerIds,subManagerIds);
-        departService.update(updateWrapper);
-        return Result.ok();
-    }
-
-    @ApiOperation("矫正路由")
-    @PostMapping("correctDeptRoute")
-    public Result correctDeptRoute() {
-        List<DeptEntity> depts = departService.list();
-        List<DeptEntity> topDepts = depts.stream().filter(e -> Long.valueOf(0).equals(e.getPid())).collect(Collectors.toList());
-        int code = 100;
-        List<DeptEntity> deptEntities = new ArrayList<>();
-        for (DeptEntity d:topDepts) {
-            SubCompanyEntity subCompany = subCompanyService.getById(d.getSubCompanyId());
-            String topRoute = subCompany.getRouteCode();
-            String topRoute1 = topRoute+","+String.valueOf(code);
-            d.setRouteCode(topRoute1);
-            deptEntities.add(d);
-            List<DeptEntity> ns = markRoute(d,depts);
-            if (!CollectionUtils.isEmpty(ns)) {
-                deptEntities.addAll(ns);
-            }
-            code ++;
-        }
-        departService.updateBatchById(deptEntities);
-        Map<Long, String> map3 = deptEntities.stream().collect(Collectors.toMap(DeptEntity::getId, DeptEntity::getRouteCode, (u1, u2) -> u1));
-        List<UserEntity> users = userService.list();
-        for (UserEntity u:users) {
-            u.setOrgRouteCode(map3.get(u.getDeptId()));
-        }
-        userService.updateBatchById(users);
-        return Result.ok();
-    }
-
-    @ApiOperation("启用禁用部门")
-    @PostMapping("enable")
-    public Result setEnable(Long id,Boolean enable,Integer type) {
-        if (id == null) {
-            return Result.error("参数错误");
-        }
-        if (type == null) {
-            return Result.error("参数错误");
-        }
-        if (type == 10) {
-            return Result.error("无法禁用总公司");
-        }
-        if (type == 20) {
-
-            LambdaUpdateWrapper<SubCompanyEntity> update = new LambdaUpdateWrapper();
-            update.eq(SubCompanyEntity::getId,id);
-            update.set(SubCompanyEntity::getEnabled,enable);
-            Boolean re = subCompanyService.update(update);
-            if (re) {
-                // 下级部门同步禁用启用,用户同步
-                LambdaUpdateWrapper<DeptEntity> update1 = new LambdaUpdateWrapper();
-                update1.eq(DeptEntity::getSubCompanyId,id);
-                update1.set(DeptEntity::getEnabled,enable);
-                departService.update(update1);
-                return Result.ok();
-            } else {
-                return Result.error("操作失败");
-            }
-
-        } else if (type == 30) {
-            DeptEntity dept = departService.getById(id);
-            if (Objects.isNull(dept)) {
-                return Result.error("参数错误");
-            }
-            LambdaQueryWrapper<DeptEntity> query = new LambdaQueryWrapper();
-            query.likeRight(DeptEntity::getRouteCode,dept.getRouteCode());
-            query.eq(DeptEntity::getIsDelete, CommonConstant.DEL_FLAG_0);
-            List<DeptEntity> deptls = departService.list(query);
-            if (CollectionUtils.isEmpty(deptls)) {
-                return Result.error("参数错误");
-            }
-            List<Long>  deptIds = deptls.stream().map(DeptEntity::getId).collect(Collectors.toList());
-            // 下级部门同步禁用启用,用户同步
-            LambdaUpdateWrapper<DeptEntity> update = new LambdaUpdateWrapper();
-            update.in(DeptEntity::getId,deptIds);
-            update.set(DeptEntity::getEnabled,enable);
-            Boolean re =  departService.update(update);
-            if (re) {
-                return Result.ok();
-            } else {
-                return Result.error("操作失败");
-            }
-        } else {
-            return Result.error("操作失败,参数错误");
-        }
-    }
-
-    public List<DeptEntity> markRoute(DeptEntity d,List<DeptEntity> depts){
-        List<DeptEntity> deptEntities = new ArrayList<>();
-        int code = 100;
-        List<DeptEntity> topDepts = depts.stream().filter(e -> e.getPid().equals(d.getId()) && e.getSubCompanyId().equals(d.getSubCompanyId())).collect(Collectors.toList());
-        for (DeptEntity d1:topDepts) {
-            String topRoute = d.getRouteCode();
-            String topRoute1 = topRoute+","+String.valueOf(code);
-            d1.setRouteCode(topRoute1);
-            deptEntities.add(d1);
-            List<DeptEntity> ns = markRoute(d1,depts);
-            if (!CollectionUtils.isEmpty(ns)) {
-                deptEntities.addAll(ns);
-            }
-            code++;
-        }
-        return deptEntities;
-    }
-}

+ 0 - 169
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/DeptController.java

@@ -1,169 +0,0 @@
-package com.storlead.sales.controller.system;
-
-import com.storlead.framework.common.result.Result;
-import com.storlead.user.model.DepartIdModel;
-import com.storlead.user.model.DeptTreeModel;
-import com.storlead.user.service.IDepartService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import lombok.extern.slf4j.Slf4j;
-import javax.annotation.Resource;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-
-@RestController
-@RequestMapping("/lingcun/dept")
-@Slf4j
-@Api(tags="5.公共接口")
-public class DeptController {
-
-	@Resource
-	private IDepartService departService;
-
-	/**
-	 * 查询数据 查出所有部门,并以树结构数据格式响应给前端
-	 *
-	 * @return
-	 */
-	@RequestMapping(value = "/queryTreeList", method = RequestMethod.GET)
-	@ApiOperation(value = "公共接口-部门-tree数据", notes = "公共接口-部门-tree数据")
-	@ApiResponses({
-			@ApiResponse(code = 200, message = "", response = DeptTreeModel.class)
-	})
-	public Result<List<DeptTreeModel>> queryTreeList() {
-		Result<List<DeptTreeModel>> result = new Result<>();
-		try {
-			// 从内存中读取
-//			List<SysDepartTreeModel> list =FindsDepartsChildrenUtil.getSysDepartTreeList();
-//			if (CollectionUtils.isEmpty(list)) {
-//				list = sysDepartService.queryTreeList();
-//			}
-			List<DeptTreeModel> list = departService.queryTreeList();
-			result.setResult(list);
-			result.setSuccess(true);
-		} catch (Exception e) {
-			log.error(e.getMessage(),e);
-		}
-		return result;
-	}
-
-	/**
-	 * 查询数据 查出分公司下所有部门
-	 *
-	 * @return
-	 */
-	@RequestMapping(value = "/queryDeptBySub", method = RequestMethod.GET)
-	@ApiOperation(value = "公共接口-公司部门-根据分公司ID查询部门tree数据", notes = "根据分公司ID查询部门tree数据")
-	@ApiResponses({
-			@ApiResponse(code = 200, message = "", response = DeptTreeModel.class)
-	})
-	public Result<List<DeptTreeModel>> queryDeptBySub(Integer subCompanyId) {
-		Result<List<DeptTreeModel>> result = new Result<>();
-		try {
-			List<DeptTreeModel> list = departService.queryDeptBySubList(subCompanyId);
-			result.setResult(list);
-			result.setSuccess(true);
-		} catch (Exception e) {
-			log.error(e.getMessage(),e);
-		}
-		return result;
-	}
-
-	/**
-	 * 查询数据 查出所有部门,并以树结构数据格式响应给前端
-	 *
-	 * @return
-	 */
-	@RequestMapping(value = "/queryTreeListWithSubCompanyId", method = RequestMethod.GET)
-	@ApiOperation(value = "公共接口-公司部门-tree数据", notes = "根据分公司ID查询部门tree数据")
-	@ApiResponses({
-			@ApiResponse(code = 200, message = "", response = DeptTreeModel.class)
-	})
-	public Result<List<DeptTreeModel>> queryTreeListWithSubCompanyId(Integer subCompanyId) {
-		Result<List<DeptTreeModel>> result = new Result<>();
-		try {
-			// 从内存中读取
-//			List<SysDepartTreeModel> list =FindsDepartsChildrenUtil.getSysDepartTreeList();
-//			if (CollectionUtils.isEmpty(list)) {
-//				list = sysDepartService.queryTreeList();
-//			}
-			List<DeptTreeModel> list = departService.queryTreeListWithSubCompanyId(subCompanyId);
-			result.setResult(list);
-			result.setSuccess(true);
-		} catch (Exception e) {
-			log.error(e.getMessage(),e);
-		}
-		return result;
-	}
-
-	/**
-	 * 查询数据 添加或编辑页面对该方法发起请求,以树结构形式加载所有部门的名称,方便用户的操作
-	 *
-	 * @return
-	 */
-	@RequestMapping(value = "/queryIdTree", method = RequestMethod.GET)
-	public Result<List<DepartIdModel>> queryIdTree() {
-//		Result<List<DepartIdModel>> result = new Result<List<DepartIdModel>>();
-//		List<DepartIdModel> idList;
-//		try {
-//			idList = FindsDepartsChildrenUtil.wrapDepartIdModel();
-//			if (idList != null && idList.size() > 0) {
-//				result.setResult(idList);
-//				result.setSuccess(true);
-//			} else {
-//				sysDepartService.queryTreeList();
-//				idList = FindsDepartsChildrenUtil.wrapDepartIdModel();
-//				result.setResult(idList);
-//				result.setSuccess(true);
-//			}
-//			return result;
-//		} catch (Exception e) {
-//			log.error(e.getMessage(),e);
-//			result.setSuccess(false);
-//			return result;
-//		}
-		Result<List<DepartIdModel>> result = new Result<>();
-		try {
-			List<DepartIdModel> list = departService.queryDepartIdTreeList();
-			result.setResult(list);
-			result.setSuccess(true);
-		} catch (Exception e) {
-			log.error(e.getMessage(),e);
-		}
-		return result;
-	}
-
-	/**
-	 * <p>
-	 * 部门搜索功能方法,根据关键字模糊搜索相关部门
-	 * </p>
-	 *
-	 * @param keyWord
-	 * @return
-	 */
-	@RequestMapping(value = "/searchBy", method = RequestMethod.GET)
-	public Result<List<DeptTreeModel>> searchBy(@RequestParam(name = "keyWord") String keyWord) {
-		Result<List<DeptTreeModel>> result = new Result<List<DeptTreeModel>>();
-		try {
-			List<DeptTreeModel> treeList = this.departService.searhBy(keyWord);
-			if (treeList.size() == 0 || treeList == null) {
-				throw new Exception();
-			}
-			result.setSuccess(true);
-			result.setResult(treeList);
-			return result;
-		} catch (Exception e) {
-			e.fillInStackTrace();
-			result.setSuccess(false);
-			result.setMessage("查询失败或没有您想要的任何数据!");
-			return result;
-		}
-	}
-
-}

+ 0 - 19
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/DeptRoleController.java

@@ -1,19 +0,0 @@
-package com.storlead.sales.controller.system;
-
-
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- * 部门角色权限 前端控制器
- * </p>
- *
- * @author chenkq
- * @since 2024-04-02
- */
-@RestController
-@RequestMapping("/sys/dept/role")
-public class DeptRoleController {
-
-}

+ 0 - 109
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/JobApiController.java

@@ -1,109 +0,0 @@
-package com.storlead.sales.controller.system;
-
-import cn.hutool.core.util.StrUtil;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.storlead.framework.common.result.Result;
-import com.storlead.system.util.SystemSettingCacheCheckUtil;
-import com.storlead.user.pojo.dto.JobDTO;
-import com.storlead.user.pojo.entity.JobEntity;
-import com.storlead.user.service.IJobService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import javax.annotation.Resource;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * @program: sp-cloud
- * @description:
- * @author: chenkq
- * @create: 2022-05-24 11:03
- */
-@Api(tags = "系统: 角色管理")
-@RestController
-@RequestMapping("/sys/job/manage")
-public class JobApiController {
-
-    @Resource
-    private IJobService jobService;
-
-    @ApiOperation("岗位分页查询")
-    @PostMapping("/listpage")
-    public Result<?> listpage(@RequestBody JobDTO param) {
-        IPage<JobEntity> page = new Page<>(param.getPageIndex(),param.getPageSize());
-        LambdaQueryWrapper<JobEntity> queryWrapper = new LambdaQueryWrapper();
-        if (StrUtil.isNotBlank(param.getJobName())) {
-            queryWrapper.like(JobEntity::getName,param.getJobName());
-        }
-        if (Objects.nonNull(param.getId())) {
-            queryWrapper.eq(JobEntity::getId,param.getId());
-        }
-        queryWrapper.eq(JobEntity::getIsDelete,0);
-        queryWrapper.eq(JobEntity::getEnabled,1);
-        queryWrapper.orderByAsc(JobEntity::getSort);
-        IPage<JobEntity> jobs = jobService.page(page,queryWrapper);
-        return Result.ok(jobs);
-    }
-
-    @ApiOperation("岗位查询")
-    @PostMapping("/listquery")
-    public Result<?> listquery(@RequestBody JobDTO param) {
-        LambdaQueryWrapper<JobEntity> queryWrapper = new LambdaQueryWrapper();
-        if (StrUtil.isNotBlank(param.getJobName())) {
-            queryWrapper.like(JobEntity::getName,param.getJobName());
-        }
-        queryWrapper.eq(JobEntity::getIsDelete,0);
-        queryWrapper.eq(JobEntity::getEnabled,1);
-        queryWrapper.orderByAsc(JobEntity::getSort);
-        List<JobEntity> jobs = jobService.list(queryWrapper);
-        return Result.ok(jobs);
-    }
-
-    @ApiOperation("保存岗位")
-    @PostMapping("/save")
-    public Result create(@RequestBody JobEntity info) {
-        Result r = SystemSettingCacheCheckUtil.checkAddDataMode();
-        if (!r.isSuccess()) {
-            return r;
-        }
-        if (Objects.isNull(info) || StrUtil.isBlank(info.getName())) {
-            return Result.error("参数错误");
-        }
-        if(Objects.isNull(info.getId())) {
-            info.setDataSource(1);
-        }
-        if (Objects.isNull(info.getId())) {
-            Integer exit = jobService.count(new LambdaQueryWrapper<JobEntity>().eq(JobEntity::getName,info.getName()));
-            if (exit > 0) {
-                return Result.error("岗位'"+ info.getName() +"'已存在!");
-            }
-        } else {
-            JobEntity oldAccount = jobService.getOne(new LambdaQueryWrapper<JobEntity>().eq(JobEntity::getName,info.getName()));
-            if (Objects.nonNull(oldAccount)) {
-                if (!oldAccount.getId().equals(info.getId())) {
-                    return Result.error("岗位'"+ info.getName() +"'已存在,无法修改!");
-                }
-            }
-        }
-        jobService.saveOrUpdate(info);
-        return Result.ok();
-    }
-
-    @ApiOperation("删除岗位")
-    @PostMapping("/delete")
-    public Result<?> remove(Long [] ids) {
-        if (Objects.isNull(ids) || ids.length == 0) {
-            return Result.error("参数错误");
-        }
-        jobService.removeByIds(Arrays.asList(ids));
-        return Result.ok();
-    }
-}

+ 0 - 53
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/JobController.java

@@ -1,53 +0,0 @@
-package com.storlead.sales.controller.system;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.storlead.framework.common.result.Result;
-import com.storlead.user.pojo.entity.JobEntity;
-import com.storlead.user.service.IJobService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import lombok.extern.slf4j.Slf4j;
-import javax.annotation.Resource;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-
-@RestController
-@RequestMapping("/lingcun/job")
-@Slf4j
-@Api(tags="5.公共接口")
-public class JobController {
-
-	@Resource
-	private IJobService jobService;
-
-	/**
-	 * 查询数据 查出所有部门,并以树结构数据格式响应给前端
-	 *
-	 * @return
-	 */
-	@RequestMapping(value = "/list", method = RequestMethod.GET)
-	@ApiOperation(value = "公共接口-职位-列表", notes = "公共接口-职位-列表")
-	@ApiResponses({
-			@ApiResponse(code = 200, message = "", response = JobEntity.class)
-	})
-	public Result<List<JobEntity>> queryTreeList() {
-		Result<List<JobEntity>> result = new Result<>();
-		try {
-			LambdaQueryWrapper<JobEntity> queryWrapper = new LambdaQueryWrapper();
-			queryWrapper.select(JobEntity::getDeptId, JobEntity::getName,JobEntity::getSort,JobEntity::getId);
-			List<JobEntity> list = jobService.list(queryWrapper);
-			result.setResult(list);
-			result.setSuccess(true);
-		} catch (Exception e) {
-			log.error(e.getMessage(),e);
-		}
-		return result;
-	}
-
-
-}

+ 0 - 517
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/LoginApiController.java

@@ -1,517 +0,0 @@
-package com.storlead.sales.controller.system;
-
-import cn.hutool.core.util.StrUtil;
-import cn.hutool.crypto.SecureUtil;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.storlead.framework.common.constant.CommonConstant;
-import com.storlead.common.sso.CryptoZipUtil;
-import com.storlead.common.sso.HttpSecurityCheckUtil;
-import com.storlead.framework.common.util.MD5Util;
-import com.storlead.framework.common.util.RsaUtils;
-import com.storlead.framework.auth.ecode.BCryptPasswordEncoder;
-import com.storlead.framework.auth.jwt.JwtUtil;
-import com.storlead.framework.util.LoginUserUtil;
-import com.storlead.framework.auth.vo.LoginUser;
-import com.storlead.framework.auth.vo.MenuPermis;
-import com.storlead.framework.constants.RedisKeySaltConstant;
-import com.storlead.framework.common.result.Result;
-import com.storlead.framework.enums.ErrorMsgCode;
-import com.storlead.framework.redis.RedisService;
-import com.storlead.sms.pojo.entity.SmsLogEntity;
-import com.storlead.sms.service.SmsLogService;
-import com.storlead.system.pojo.entity.MenuEntity;
-import com.storlead.system.service.IMenuService;
-import com.storlead.system.service.IUserRoleService;
-import com.storlead.system.util.SystemConfigItemCacheUtil;
-import com.storlead.user.pojo.dto.UserLoginDTO;
-import com.storlead.user.pojo.entity.DeptEntity;
-import com.storlead.user.pojo.entity.JobEntity;
-import com.storlead.user.pojo.entity.UserEntity;
-import com.storlead.wx.service.CorpWeChatService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.BeanUtils;
-import javax.annotation.Resource;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.*;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.*;
-import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
-
-/**
- * @program: sp-sales
- * @description:
- * @author: chenkq
- * @create: 2022-07-15 10:11
- */
-@RestController
-@RequestMapping("/sys/auth")
-@Api(tags="5.认证接口")
-@Slf4j
-public class LoginApiController {
-
-    @Resource
-    private IUserService sysUserService;
-
-    @Resource
-    private RedisService redisService;
-
-    @Resource
-    private SmsLogService smsLogService;
-
-    @Resource
-    private IDepartService departService;
-
-    @Resource
-    private IMenuService menuService;
-
-    @Value("${environment}")
-    private  String environment;
-
-    @Resource
-    private IUserRoleService userRoleService;
-
-    @Resource
-    private IJobService jobService;
-
-    @Resource
-    private CorpWeChatService corpWeChatService;
-
-    @RequestMapping(value = "/redirect")
-    @ResponseBody
-    public Object redirect(HttpServletRequest request, HttpServletResponse response)  throws IOException {
-        response.sendRedirect("http://www.baidu.com");
-        return Result.ok("");
-    }
-
-    @RequestMapping(value = "/login", method = RequestMethod.POST)
-    @ApiOperation(value = "用户登录接口", notes = "用户登录接口")
-    public Result login(@RequestBody UserLoginDTO loginDTO) {
-
-        if (Objects.isNull(loginDTO)) {
-            return Result.error("参数错误");
-        }
-        UserEntity userInfo;
-        JSONObject obj = new JSONObject();
-        if (StrUtil.isNotBlank(loginDTO.getWxCode())) {
-            String code = corpWeChatService.login(loginDTO.getWxCode());
-            userInfo = sysUserService.getOne(new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getXworkUserId,code));
-        } else if (StrUtil.isNotBlank(loginDTO.getSmsCode())) {
-            if (StrUtil.isBlank(loginDTO.getAccount())) {
-                return Result.error("参数错误");
-            }
-            Object var1 = redisService.getCacheObject(RedisKeySaltConstant.REDIS_LOGIN_VALID_CODE_KEY+loginDTO.getAccount());
-            if (Objects.isNull(var1)) {
-                return Result.error(ErrorMsgCode.D_400005);
-            } else {
-                SmsLogEntity smsLog = (SmsLogEntity)var1;
-                if (!loginDTO.getSmsCode().equals(smsLog.getVerifyCode())){
-                    return Result.error(ErrorMsgCode.D_400008);
-                }
-                Long currentTime = System.currentTimeMillis();
-                Long sendTime = smsLog.getSendTime().getTime();
-                if ((currentTime - sendTime) / 1000 > smsLog.getValidTime()) {
-                    return Result.error(ErrorMsgCode.D_400007);
-                }
-            }
-            userInfo = sysUserService.getOne(new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getMobile,loginDTO.getAccount()));
-            redisService.deleteObject(RedisKeySaltConstant.REDIS_LOGIN_VALID_CODE_KEY+loginDTO.getAccount());
-        } else {
-            if (StrUtil.isBlank(loginDTO.getAccount()) || StrUtil.isBlank(loginDTO.getPassword())) {
-                return Result.error("用户名或密码为空");
-            }
-            userInfo = sysUserService.getOne(new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getMobile,loginDTO.getAccount()).eq(UserEntity::getIsDelete, CommonConstant.DEL_FLAG_0));
-            if (Objects.isNull(userInfo)) {
-                return Result.error("账号不存在");
-            }
-
-            BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
-            String password = "";
-            if((!environment.equals("prod") && !loginDTO.getPassword().equals("qq123456")) || environment.equals("prod")){
-                try {
-                    password = RsaUtils.decryptByPrivateKey(RsaUtils.PRIVATE_KEY, loginDTO.getPassword());
-                }catch (Exception e) {
-                    return Result.error("用户名或密码错误");
-                }
-            }
-            if(environment.equals("prod") || (environment.equals("test")
-                    && !loginDTO.getPassword().equals("qq123456") &&
-                    !password.equals("qq123456"))) {
-                if (!bCryptPasswordEncoder.matches(password, userInfo.getPassword())) {
-                    return Result.error("用户名或密码错误");
-                }
-            }
-            String regex = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z\\W]{8,}$";
-            String defaultPassWord = SystemConfigItemCacheUtil.getDefaultPassWord();
-
-            if(password !=null && (!password.matches(regex) || password.equals(defaultPassWord))){
-                obj.put("status",1);
-            }else {
-                obj.put("status",2);
-            }
-
-        }
-        if (Objects.isNull(userInfo)) {
-            return Result.error("登录失败,未获取到用户信息");
-        }
-        if (!userInfo.getEnabled()) {
-            return Result.error("该账号用户暂无登录权限");
-        }
-
-        Integer possessMenuCount = menuService.checkUserMenuAccess(userInfo.getId());
-        if (possessMenuCount == 0) {
-            return Result.error("暂未获取到菜单权限,请联系管理员分配权限!");
-        }
-
-        LoginUser loginUser = new LoginUser();
-        BeanUtils.copyProperties(userInfo,loginUser);
-
-        if (Objects.nonNull(userInfo.getJobId())) {
-            JobEntity job = jobService.getById(userInfo.getJobId());
-            if (Objects.nonNull(job)) {
-                loginUser.setJobName(job.getName());
-            }
-        }
-
-        loginUser.setRoleIds(userRoleService.selectUserRoleByUserId(userInfo.getId()));
-        if (Objects.nonNull(userInfo.getDeptId())) {
-            DeptEntity dept = departService.getById(userInfo.getDeptId());
-            if (Objects.nonNull(dept)) {
-                loginUser.setDeptName(dept.getName());
-                loginUser.setDeptJobDes(dept.getDeptJobDes());
-            }
-        }
-
-        //用户登录信息
-        String jwtToken = JwtUtil.createJWT(JSONObject.toJSONString(loginUser),loginUser.getMobile());
-        String token = SecureUtil.md5(jwtToken);
-
-        String json = JSONObject.toJSONString(loginUser);
-        redisService.setCacheObject(token, json, 60 * 60 * 24L * 7, TimeUnit.SECONDS);
-
-        Map<String, String> apiMap = new HashMap();
-        redisService.setCacheObject(RedisKeySaltConstant.API_CODE_REDIS + loginUser.getMobile(), apiMap);
-
-        obj.put("token", token);
-        return Result.ok(obj);
-    }
-
-    @RequestMapping(value = "/ticket_login", method = RequestMethod.POST)
-    @ApiOperation(value = "授权登录", notes = "授权登录")
-    public Result ticketLogin(String ticket) {
-
-        //解析加密
-        if (StrUtil.isBlank(ticket)) {
-            return Result.error("非法进入!");
-        }
-        JSONObject obj = new JSONObject();
-        // 解密
-        Map<String, String> argMap = CryptoZipUtil.decryptParams(ticket, CryptoZipUtil.SALT_KEY);
-        argMap.put("appSecret","K7C2R5WJYfN6V9XbZqH4A8eLTMsPDmU3");
-
-        // 解析参数
-        String checkSign = MD5Util.MD5Encode(HttpSecurityCheckUtil.makeSign(argMap),"UTF-8").toLowerCase();
-        String sign = argMap.get("sign").toString();
-        if (!checkSign.equals(sign) || StrUtil.isBlank(checkSign)) {
-            return Result.error("非法进入!");
-        }
-        long dt = Long.parseLong(argMap.get("dt"));
-        long currentTime = (System.currentTimeMillis() /1000) % HttpSecurityCheckUtil.divisor;
-        long difference = Math.abs(currentTime - dt);
-        if (difference > 30) {
-            return Result.error("连接已失效,请重新进入!");
-        }
-        String redirect = argMap.get("redirect").toString();
-        if (StrUtil.isBlank(redirect)) {
-            return Result.error("参数错误!");
-        }
-        obj.put("redirect",redirect);
-        String token = argMap.get("token").toString();
-        if (StrUtil.isNotBlank(token)) {
-            Object info = redisService.getCacheObject(token);
-            if (Objects.nonNull(info)) {
-                obj.put("token",token);
-                return Result.result(obj);
-            }
-        }
-        String account = argMap.get("account").toString();
-        if (StrUtil.isBlank(account)) {
-            return Result.error("参数错误!");
-        }
-        UserEntity userInfo = sysUserService.getOne(new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getMobile,account));
-        if (Objects.isNull(userInfo)) {
-            return Result.error("授权失败,未找到用户信息!");
-        }
-
-        if (!userInfo.getEnabled()) {
-            return Result.error("授权失败,无权限访问!");
-        }
-
-        LoginUser loginUser = new LoginUser();
-        BeanUtils.copyProperties(userInfo,loginUser);
-
-        if (Objects.nonNull(userInfo.getJobId())) {
-            JobEntity job = jobService.getById(userInfo.getJobId());
-            if (Objects.nonNull(job)) {
-                loginUser.setJobName(job.getName());
-            }
-        }
-
-        loginUser.setRoleIds(userRoleService.selectUserRoleByUserId(userInfo.getId()));
-        if (Objects.nonNull(userInfo.getDeptId())) {
-            DeptEntity dept = departService.getById(userInfo.getDeptId());
-            if (Objects.nonNull(dept)) {
-                loginUser.setDeptName(dept.getName());
-                loginUser.setDeptJobDes(dept.getDeptJobDes());
-            }
-        }
-
-        //用户登录信息
-        String jwtToken = JwtUtil.createJWT(JSONObject.toJSONString(loginUser),loginUser.getMobile());
-        token = SecureUtil.md5(jwtToken);
-
-        String json = JSONObject.toJSONString(loginUser);
-        redisService.setCacheObject(token, json, 60 * 60 * 24L * 7, TimeUnit.SECONDS);
-
-        Map<String, String> apiMap = new HashMap();
-        redisService.setCacheObject(RedisKeySaltConstant.API_CODE_REDIS + loginUser.getMobile(), apiMap);
-
-        obj.put("token", token);
-        return Result.ok(obj);
-    }
-
-    @RequestMapping(value = "/external_login", method = RequestMethod.POST)
-    @ApiOperation(value = "用户登录接口", notes = "用户登录接口")
-    public Result externalLogin(@RequestBody UserLoginDTO loginDTO) {
-
-        if (Objects.isNull(loginDTO)) {
-            return Result.error("参数错误");
-        }
-        UserEntity userInfo;
-        JSONObject obj = new JSONObject();
-
-        if (StrUtil.isBlank(loginDTO.getAccount()) || StrUtil.isBlank(loginDTO.getPassword())) {
-            return Result.error("用户名或密码为空");
-        }
-        userInfo = sysUserService.getOne(new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getMobile,loginDTO.getAccount()));
-        if (Objects.isNull(userInfo)) {
-            return Result.error("账号不存在");
-        }
-
-        BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
-        String password = "";
-        if((!environment.equals("prod") && !loginDTO.getPassword().equals("qq123456")) || environment.equals("prod")){
-            try {
-                password = RsaUtils.decryptByPrivateKey(RsaUtils.PRIVATE_KEY, loginDTO.getPassword());
-            }catch (Exception e) {
-                return Result.error("用户名或密码错误");
-            }
-        }
-        if(environment.equals("prod") || (environment.equals("test")
-                && !loginDTO.getPassword().equals("qq123456") &&
-                !password.equals("qq123456"))) {
-            if (!bCryptPasswordEncoder.matches(password, userInfo.getPassword())) {
-                return Result.error("用户名或密码错误");
-            }
-        }
-        String regex = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z\\W]{8,}$";
-        String defaultPassWord = SystemConfigItemCacheUtil.getDefaultPassWord();
-
-        if(password !=null && (!password.matches(regex) || password.equals(defaultPassWord))){
-            obj.put("status",1);
-        }else {
-            obj.put("status",2);
-        }
-
-        if (Objects.isNull(userInfo)) {
-            return Result.error("登录失败,未获取到用户信息");
-        }
-        if (!Integer.valueOf(9).equals(userInfo.getExternalUserType())) {
-            return Result.error("该账号暂无登录该系统的权限");
-        }
-
-        LoginUser loginUser = new LoginUser();
-        BeanUtils.copyProperties(userInfo,loginUser);
-
-        //用户登录信息
-        String jwtToken = JwtUtil.createJWT(JSONObject.toJSONString(loginUser),loginUser.getMobile());
-        String token = SecureUtil.md5(jwtToken);
-
-        String json = JSONObject.toJSONString(loginUser);
-        redisService.setCacheObject(token, json, 60 * 60 * 24L * 7, TimeUnit.SECONDS);
-
-        Map<String, String> apiMap = new HashMap();
-        redisService.setCacheObject(RedisKeySaltConstant.API_CODE_REDIS + loginUser.getMobile(), apiMap);
-
-        obj.put("token", token);
-        return Result.ok(obj);
-    }
-
-    @ApiOperation("获取当前用户信息")
-    @PostMapping("/getCurrentUserInfo")
-    public Object getCurrentUserInfo() {
-        LoginUser loginUser = LoginUserUtil.getLoginUser();
-        if (Objects.isNull(loginUser)) {
-            return Result.error("获取失败,请重新登录");
-        }
-        DeptEntity dept = departService.getById(loginUser.getDeptId());
-        UserEntity sysUser = sysUserService.getById(loginUser.getId());
-        loginUser.setJobDes(sysUser.getJobDes())
-                 .setBirthday(sysUser.getBirthday())
-                 .setEmail(sysUser.getEmail())
-                 .setMobile(sysUser.getMobile())
-                 .setSex(sysUser.getSex())
-                 .setUserName(sysUser.getUserName())
-                 .setNickName(sysUser.getNickName());
-        if (Objects.nonNull(dept)) {
-            loginUser.setDeptJobDes(dept.getDeptJobDes());
-        }
-        if (Objects.nonNull(dept)) {
-            if (StrUtil.isNotBlank(dept.getRouteCode())) {
-                List<String> codes = Arrays.asList(dept.getRouteCode().split(","));
-                loginUser.setSubCompanyCode(codes.get(1));
-                loginUser.setCompanyCode(codes.get(0));
-            }
-            loginUser.setDeptCode(dept.getRouteCode());
-            loginUser.setDeptName(dept.getName());
-        }
-
-        List<MenuEntity> userMenuList = menuService.getUserMenuList(loginUser.getId(),Arrays.asList(0),Arrays.asList(3));
-        if (!CollectionUtils.isEmpty(userMenuList)) {
-            loginUser.setBtnRes(userMenuList.stream().map(MenuEntity::getPerms).collect(Collectors.toSet()));
-        }
-        return Result.ok(loginUser);
-    }
-
-    @ApiOperation("获取当前用户信息")
-    @PostMapping("/getH5CurrentUserInfo")
-    public Object getH5CurrentUserInfo() {
-        LoginUser loginUser = LoginUserUtil.getLoginUser();
-        if (Objects.isNull(loginUser)) {
-            return Result.error("获取失败,请重新登录");
-        }
-        DeptEntity dept = departService.getById(loginUser.getDeptId());
-        UserEntity sysUser = sysUserService.getById(loginUser.getId());
-        loginUser.setJobDes(sysUser.getJobDes())
-                .setBirthday(sysUser.getBirthday())
-                .setEmail(sysUser.getEmail())
-                .setMobile(sysUser.getMobile())
-                .setSex(sysUser.getSex())
-                .setUserName(sysUser.getUserName())
-                .setNickName(sysUser.getNickName());
-        if (Objects.nonNull(dept)) {
-            loginUser.setDeptJobDes(dept.getDeptJobDes());
-        }
-        if (Objects.nonNull(dept)) {
-            if (StrUtil.isNotBlank(dept.getRouteCode())) {
-                List<String> codes = Arrays.asList(dept.getRouteCode().split(","));
-                loginUser.setSubCompanyCode(codes.get(1));
-                loginUser.setCompanyCode(codes.get(0));
-            }
-            loginUser.setDeptCode(dept.getRouteCode());
-            loginUser.setDeptName(dept.getName());
-        }
-
-        List<MenuEntity> userMenuList = menuService.getUserMenuList(loginUser.getId(),Arrays.asList(1),Arrays.asList(1,2,3));
-        if (!CollectionUtils.isEmpty(userMenuList)) {
-            List<MenuPermis> permis = userMenuList.stream()
-                    .map(menu -> {
-                        MenuPermis mp = new MenuPermis();
-                        mp.setId(menu.getId());
-                        mp.setPerm(menu.getPerms());
-                        mp.setType(menu.getMenuType());
-                        return mp;
-                    })
-                    .collect(Collectors.toList());
-            loginUser.setPermis(permis);
-        }
-        return Result.ok(loginUser);
-    }
-
-    @ApiOperation("获取当前用户信息")
-    @RequestMapping("/getCurrentUser")
-    public Object getCurrentUser() {
-        LoginUser loginUser = LoginUserUtil.getLoginUser();
-        if (Objects.isNull(loginUser)) {
-            return Result.error("获取失败,请重新登录");
-        }
-//        DeptEntity dept = departService.getById(loginUser.getDeptId());
-        UserEntity sysUser = sysUserService.getById(loginUser.getId());
-        loginUser.setJobDes(sysUser.getJobDes())
-                .setBirthday(sysUser.getBirthday())
-                .setEmail(sysUser.getEmail())
-                .setMobile(sysUser.getMobile())
-                .setSex(sysUser.getSex())
-                .setUserName(sysUser.getUserName())
-                .setNickName(sysUser.getNickName());
-//        if (Objects.nonNull(dept)) {
-//            loginUser.setDeptJobDes(dept.getDeptJobDes());
-//        }
-//        if (Objects.nonNull(dept)) {
-//            if (StrUtil.isNotBlank(dept.getRouteCode())) {
-//                List<String> codes = Arrays.asList(dept.getRouteCode().split(","));
-//                loginUser.setSubCompanyCode(codes.get(1));
-//                loginUser.setCompanyCode(codes.get(0));
-//            }
-//            loginUser.setDeptCode(dept.getRouteCode());
-//            loginUser.setDeptName(dept.getName());
-//        }
-        return Result.ok(loginUser);
-    }
-
-    @ApiOperation("获取AccessToken")
-    @PostMapping("/sendVerifyCode")
-    public Result sendLoginVerifyCode(String mobile) {
-        if (StrUtil.isBlank(mobile)) {
-            return Result.error("参数错误");
-        }
-        UserEntity userAccount = sysUserService.getOne(new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getMobile,mobile));
-        if (userAccount == null) {
-            return Result.error("手机号错误,该手机号用户不存在");
-        }
-        try {
-            return  smsLogService.sendLoginSmsCode(mobile);
-        }catch (Exception e) {
-            return  Result.error(e.getMessage());
-        }
-    }
-
-
-
-//    public static void main(String[] args) {
-//
-//        String baseUrl = "https://openapi.liblibai.cloud";
-//
-//        String secretKey = "MyJwnqGd1h_W__ENlx_ywK-RpkHTeJd7";
-//        // 请求API接口的uri地址
-//        String uri = "/api/generate/webui/status";
-//        // 当前毫秒时间戳
-//        Long timestamp = System.currentTimeMillis();
-//        // 随机字符串
-//        String signatureNonce = RandomStringUtils.randomAlphanumeric(10);
-//        // 拼接请求数据
-//        String content = uri + "&" + timestamp + "&" + signatureNonce;
-//
-//        try {
-//            // 生成签名
-//            SecretKeySpec secret = new SecretKeySpec(secretKey.getBytes(), "HmacSHA1");
-//            Mac mac = Mac.getInstance("HmacSHA1");
-//            mac.init(secret);
-//            String signature =  Base64.encodeBase64URLSafeString(mac.doFinal(content.getBytes()));
-//            String url = baseUrl+uri+"?AccessKey=kaB5IBReZKiU9LiIJPbl6g&Signature="+signature+"&Timestamp="+timestamp+"&SignatureNonce="+signatureNonce;
-//            System.out.println("url :"+url);
-//        } catch (NoSuchAlgorithmException e) {
-//           log.error("NoSuchAlgorithmException -- error--",e);
-//        } catch (InvalidKeyException e) {
-//            log.error("InvalidKeyException -- error--",e);
-//        }
-//    }
-}

+ 0 - 308
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/OrganizDataSyncApiController.java

@@ -1,308 +0,0 @@
-package com.storlead.sales.controller.system;
-
-import cn.hutool.core.util.StrUtil;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.storlead.framework.auth.ecode.PasswordEncoder;
-import com.storlead.framework.common.result.Result;
-import com.storlead.system.service.IUserRoleService;
-import com.storlead.system.util.SystemConfigItemCacheUtil;
-import com.storlead.user.pojo.vo.WxExcelOrgVo;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import javax.annotation.Resource;
-import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestPart;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.multipart.MultipartFile;
-import org.springframework.web.multipart.MultipartHttpServletRequest;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import java.io.InputStream;
-import java.util.*;
-import java.util.stream.Collectors;
-
-/**
- * @program: sp-sales
- * @description:
- * @author: chenkq
- * @create: 2022-07-15 15:55
- */
-
-@Api(tags = "系统: 角色管理")
-@RestController
-@RequestMapping("/sys/data/sync")
-public class OrganizDataSyncApiController {
-
-    @Resource
-    private ICompanyService companyService;
-
-    @Resource
-    private ISubCompanyService subCompanyService;
-
-    @Resource
-    private IDepartService departService;
-
-    @Resource
-    private IUserService userService;
-
-    @Resource
-    private PasswordEncoder passwordEncoder;
-
-    @Resource
-    private IUserRoleService userRoleService;
-
-    @Resource
-    private IJobService jobService;
-
-    @ApiOperation("导入企业微信数据")
-    @RequestMapping(value = "/importWxData",method = {RequestMethod.POST},headers = "content-type=multipart/form-data")
-    public Result importWxData(HttpServletRequest request, @ApiParam(value="文件",required=true)@RequestPart("file") MultipartFile file) throws Exception {
-        if (file == null ) {
-            return Result.error("请上传附件!");
-        }
-        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
-        // MultipartFile files = multipartRequest.getFile("filename");
-        InputStream inputStream = file.getInputStream();
-        List<WxExcelOrgVo> vols = excelWxExcelOrg(inputStream, file.getOriginalFilename());
-        Result result = markData(vols);
-        return result;
-    }
-
-    public List<WxExcelOrgVo> excelWxExcelOrg(InputStream in, String fileName) {
-        List list = new ArrayList<>();
-        try{
-            //创建Excel工作薄
-            Workbook work = this.getWorkbook(in, fileName);
-            if (null == work) {
-                return null;
-            }
-            //获得第一个shell
-            Sheet sheet=work.getSheetAt(0);
-            //获得Excel的行数
-            int totalRows=sheet.getPhysicalNumberOfRows();
-            // 获取总列数
-            // int totalCells=sheet.getRow(0).getPhysicalNumberOfCells();
-            // Cell cell = null;
-            List<WxExcelOrgVo> orgVos = new ArrayList<>();
-            for (int j = 10; j < totalRows; j++) {
-                Row row = sheet.getRow(j);
-                WxExcelOrgVo orgVo = new WxExcelOrgVo();
-                if(row.getCell(0) != null) {
-                    orgVo.setRealName(row.getCell(0).toString());
-                }
-                if(row.getCell(1) != null) {
-                    orgVo.setXworkUserId(row.getCell(1).toString());
-                }
-                if(row.getCell(2) != null) {
-                    orgVo.setNickName(row.getCell(2).toString());
-                }
-                if(row.getCell(3) != null) {
-                    orgVo.setJobName(row.getCell(3).toString());
-                }
-                if(row.getCell(4) != null) {
-                    orgVo.setDeptName(row.getCell(4).toString());
-                }
-                if(row.getCell(5) != null) {
-                    orgVo.setSex(row.getCell(5).toString());
-                }
-
-                if(row.getCell(6) != null) {
-                    orgVo.setMobile(row.getCell(6).toString());
-                }
-                if(row.getCell(10) != null) {
-                    orgVo.setEmail(row.getCell(10).toString());
-                }
-                if(row.getCell(12) != null) {
-                    String  enabledStr = row.getCell(12).toString();
-                    orgVo.setEnabled("已激活".equals(enabledStr) ? true:false);
-                }
-                orgVos.add(orgVo);
-            }
-            work.close();
-            return orgVos;
-        }catch (Exception e){
-            return null;
-        }
-    }
-
-    /**
-     * 判断文件格式
-     *
-     * @param inStr
-     * @param fileName
-     * @return
-     * @throws Exception
-     */
-    public Workbook getWorkbook(InputStream inStr, String fileName) throws Exception {
-        Workbook workbook = null;
-        String fileType = fileName.substring(fileName.lastIndexOf("."));
-        if (".xls".equals(fileType)) {
-            workbook = new HSSFWorkbook(inStr);
-        } else if (".xlsx".equals(fileType)) {
-            workbook = new XSSFWorkbook(inStr);
-        } else {
-            return null;
-        }
-        return workbook;
-    }
-
-    public Result markData(List<WxExcelOrgVo> vos) {
-
-        /**
-         * 岗位处理
-         */
-        Map<String, Long> jobMap = new HashMap<>();
-        List<JobEntity> oldJob = jobService.list(new LambdaUpdateWrapper<JobEntity>().eq(JobEntity::getIsDelete,0));
-        if (!CollectionUtils.isEmpty(oldJob)) {
-            jobMap = oldJob.stream().collect(Collectors.toMap(JobEntity::getName, JobEntity::getId));
-        }
-
-        List<JobEntity> jobs = new ArrayList<>();
-        for (WxExcelOrgVo vo : vos) {
-            JobEntity job = oldJob.stream().filter(e ->vo.getJobName().equals(e.getName())).findFirst().orElse(null);
-            if (Objects.isNull(job)) {
-                job = new JobEntity();
-                job.setName(vo.getJobName());
-                jobs.add(job);
-                if (StrUtil.isNotBlank(vo.getJobName())) {
-                    jobService.saveOrUpdate(job);
-                    oldJob.add(job);
-                    jobMap.put(job.getName(),job.getId());
-                }
-            }
-        }
-
-
-        /**
-         * 人员处理
-         */
-        List<DeptEntity> oldDeptls = departService.list(new LambdaUpdateWrapper<DeptEntity>().eq(DeptEntity::getIsDelete,0));
-
-        Map<String,DeptEntity> deptMap = new HashMap();
-        if (!CollectionUtils.isEmpty(oldDeptls)) {
-            deptMap = oldDeptls.stream().collect(Collectors.toMap(DeptEntity::getDeptNameRoute, a -> a));
-        }
-        CompanyEntity company = new CompanyEntity();
-        SubCompanyEntity subCompany = new SubCompanyEntity();
-
-        /**
-         * 处理组织数据
-         */
-        int i = 1;
-        for (WxExcelOrgVo vo : vos) {
-            String[] ds = vo.getDeptName().split(";");
-            String[] deptstr = ds[0].split("/");
-            if (i == 1) {
-                company.setName(deptstr[0]);
-                company.setRouteCode("100");
-                company.setId(Long.valueOf(1));
-                subCompany.setName(deptstr[0]);
-                subCompany.setCompanyId(company.getId());
-                subCompany.setRouteCode("100,100");
-                subCompany.setId(Long.valueOf(1));
-                companyService.truncateTable();
-                companyService.save(company);
-
-                subCompanyService.truncateTable();
-                subCompanyService.save(subCompany);
-                i++;
-            }
-
-            String routeStr = deptstr[0];
-            for (int j = 1; j < deptstr.length; j++) {
-                routeStr = routeStr + "/" + deptstr[j];
-                String finalRouteStr = routeStr;
-                DeptEntity dept = oldDeptls.stream().filter(e -> e.getDeptNameRoute().equals(finalRouteStr)).findFirst().orElse(null);
-                if (Objects.isNull(dept)) {
-                    String topRoute = finalRouteStr.substring(0, StrUtil.ordinalIndexOf(finalRouteStr, "/", j));
-                    // 上一级
-                    DeptEntity topDept = oldDeptls.stream().filter(e -> e.getDeptNameRoute().equals(topRoute)).findFirst().orElse(null);
-                    DeptEntity newDept = new DeptEntity();
-                    if (Objects.nonNull(topDept)) {
-                        DeptEntity nextD = oldDeptls.stream().filter(e -> e.getDeptNameRoute().contains(topRoute) && !e.getDeptNameRoute().equals(topRoute)).collect(Collectors.toList()).stream().max(Comparator.comparing(s -> s.getRouteCode())).orElse(null);
-                        if (Objects.isNull(nextD)) {
-                            newDept.setRouteCode(topDept.getRouteCode() + ",100");
-                        } else {
-                            String[] routeCodes = nextD.getRouteCode().split(",");
-                            String lastCode = routeCodes[routeCodes.length - 1];
-                            lastCode = String.valueOf(Integer.valueOf(lastCode) + 1);
-                            routeCodes[routeCodes.length - 1] = lastCode;
-                            String routeCode = StringUtils.join(routeCodes, ",");
-                            newDept.setRouteCode(routeCode);
-                        }
-                        newDept.setCompanyId(topDept.getCompanyId());
-                        newDept.setSubCompanyId(topDept.getSubCompanyId());
-                        newDept.setDeptNameRoute(routeStr);
-                        newDept.setPid(topDept.getId());
-                        newDept.setName(deptstr[j]);
-                        departService.saveOrUpdate(newDept);
-                        deptMap.put(newDept.getDeptNameRoute(), newDept);
-                        oldDeptls.add(newDept);
-                    } else {
-                        newDept.setPid(Long.valueOf(0));
-                        newDept.setRouteCode(subCompany.getRouteCode() + ",100");
-                        newDept.setDeptNameRoute(subCompany.getName() + "/"+deptstr[j]);
-                        newDept.setCompanyId(company.getId());
-                        newDept.setSubCompanyId(subCompany.getId());
-                        newDept.setName(deptstr[j]);
-                        departService.saveOrUpdate(newDept);
-                        deptMap.put(newDept.getDeptNameRoute(), newDept);
-                        oldDeptls.add(newDept);
-
-                    }
-
-                }
-            }
-        }
-
-
-
-        List<UserEntity> oldUsers = userService.list(new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getIsDelete,0));
-        List<UserEntity> users = new ArrayList<>();
-        String defaultPassWord = SystemConfigItemCacheUtil.getDefaultPassWord();
-        for (WxExcelOrgVo vo : vos) {
-            UserEntity oldInfo = oldUsers.stream().filter(e ->e.getMobile().equals(vo.getMobile())).findFirst().orElse(null);
-            if (Objects.nonNull(oldInfo)) {
-                continue;
-            }
-            UserEntity user = new UserEntity();
-            user.setUserName(vo.getRealName());
-            user.setSex(vo.getSex());
-            user.setNickName(vo.getNickName());
-            user.setRealName(vo.getRealName());
-            user.setXworkUserId(vo.getXworkUserId());
-            user.setEmail(vo.getEmail());
-            user.setPassword(passwordEncoder.encode(defaultPassWord));
-            user.setJobId(jobMap.get(vo.getJobName()));
-            user.setId(Long.valueOf(i));
-            user.setStatus("1");
-            String[] ds = vo.getDeptName().split(";");
-            String deptRouteName = ds[0];
-            DeptEntity wxVo = deptMap.get(deptRouteName);
-            if (Objects.nonNull(wxVo)) {
-                DeptEntity d = wxVo;
-                user.setSubCompanyId(d.getSubCompanyId());
-                user.setCompanyId(d.getCompanyId());
-                user.setDeptId(d.getId());
-                user.setOrgRouteCode(d.getRouteCode());
-            }
-            user.setMobile(vo.getMobile());
-            users.add(user);
-        }
-        userService.saveBatch(users);
-        userRoleService.initUserRole();
-
-        return Result.ok();
-    }
-}

+ 0 - 165
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/PermissionResApiController.java

@@ -1,165 +0,0 @@
-package com.storlead.sales.controller.system;
-
-import cn.hutool.core.util.StrUtil;
-import com.storlead.framework.util.LoginUserUtil;
-import com.storlead.framework.common.result.Result;
-import com.storlead.system.pojo.entity.MenuEntity;
-import com.storlead.system.pojo.vo.MetaVo;
-import com.storlead.system.pojo.vo.RouterVo;
-import com.storlead.system.pojo.vo.UserMenuVO;
-import com.storlead.system.service.IMenuService;
-import com.storlead.user.util.PingyinUtil;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.log4j.Log4j2;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.BeanUtils;
-import javax.annotation.Resource;
-import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.*;
-
-/**
- * @program: sp-sales-platform
- * @description:
- * @author: chenkq
- * @create: 2024-04-09 10:02
- */
-
-@Api(tags = "系统: 权限菜单")
-@Log4j2
-@RestController
-@RequestMapping("/sys/permission")
-public class PermissionResApiController {
-
-    @Resource
-    private IMenuService menuService;
-    private static final String PARENT_VIEW = "ParentView";
-    private static final String LAYOUT = "Layout";
-
-    @ApiOperation("获取用户拥有的全部菜单,权限")
-    @PostMapping("getUserAccessResource")
-    public Result getUserMenuList() {
-        try {
-            Map<String,Object> map = new HashMap();
-            Long currentUserId = LoginUserUtil.getCurrentUserId();
-            List<MenuEntity> userMenuList = menuService.getUserMenuList(currentUserId,Arrays.asList(0),Arrays.asList(1,2));
-            List<UserMenuVO> menuls = new ArrayList();
-//            List<MenuEntity> menuBtnls = new ArrayList();
-//            List<MenuEntity> quickMenuls = new ArrayList();
-//            List<Long> qmIds = quickMenuService.listByMap(Map.of("user_id",currentUserId)).stream().map(QuickMenuEntity::getMenuId).collect(Collectors.toList());
-
-            userMenuList.forEach(menu -> {
-                UserMenuVO menuVo = new UserMenuVO();
-                BeanUtils.copyProperties(menu,menuVo);
-                menuls.add(menuVo);
-            });
-            if (!CollectionUtils.isEmpty(menuls)) {
-                menuls.forEach(e -> {
-                    if (StrUtil.isNotBlank(e.getMenuName())) {
-                        String pyIcon = PingyinUtil.getLowFullSpell(e.getMenuName());
-                        e.setIcon(pyIcon);
-                    }
-                });
-            }
-            List<UserMenuVO>  menuRes = createTreeMenus(Long.valueOf(0),menuls);
-            List<RouterVo> treeRouter = new ArrayList<>();
-            menuToRouter(menuRes, null, treeRouter);
-            map.put("routerVo",treeRouter);
-            return Result.ok(map);
-        }catch (Exception e) {
-            e.printStackTrace();
-            return Result.error("获取菜单信息错误:"+e.getMessage());
-        }
-    }
-
-
-    @ApiOperation("获取用户拥有的全部菜单,权限")
-    @PostMapping("getUserAccessResourceTest")
-    public Result getUserMenuListTest() {
-        try {
-            Map<String,Object> map = new HashMap();
-
-            List<MenuEntity> userMenuList = menuService.getAllMenuCreateTree();
-            List<UserMenuVO> menuls = new ArrayList();
-//            List<MenuEntity> menuBtnls = new ArrayList();
-//            List<MenuEntity> quickMenuls = new ArrayList();
-//            List<Long> qmIds = quickMenuService.listByMap(Map.of("user_id",currentUserId)).stream().map(QuickMenuEntity::getMenuId).collect(Collectors.toList());
-
-            userMenuList.forEach(menu -> {
-                UserMenuVO menuVo = new UserMenuVO();
-                BeanUtils.copyProperties(menu,menuVo);
-                menuls.add(menuVo);
-            });
-            if (!CollectionUtils.isEmpty(menuls)) {
-                menuls.forEach(e -> {
-                    if (StrUtil.isNotBlank(e.getMenuName())) {
-                        String pyIcon = PingyinUtil.getLowFullSpell(e.getMenuName());
-                        e.setIcon(pyIcon);
-                    }
-                });
-            }
-            List<UserMenuVO>  menuRes = createTreeMenus(Long.valueOf(0),menuls);
-            return Result.ok(menuRes);
-        }catch (Exception e) {
-            e.printStackTrace();
-            return Result.error("获取菜单信息错误:"+e.getMessage());
-        }
-    }
-    /**
-     * 是否为parent_view组件
-     */
-
-    private void menuToRouter(List<UserMenuVO> menus, RouterVo parent,  List<RouterVo> treeRouter){
-
-        for (UserMenuVO menu : menus) {
-            RouterVo routerVo = new RouterVo() ;
-            MetaVo metaVo = new MetaVo(menu.getMenuName(), menu.getIcon(), menu.getIsCache() == 0 ? true : false, menu.getId());
-            if(menu.getPid() != 0L && menu.getMenuType() == 1 && StringUtils.isBlank(menu.getComponent()) ) {
-                routerVo.setComponent(PARENT_VIEW);
-                routerVo.setAlwaysShow(true);
-            } else if((menu.getPid() == null || menu.getPid() == 0L) && menu.getMenuType() == 1 && StringUtils.isBlank(menu.getComponent()) ){
-                routerVo.setComponent(LAYOUT);
-                routerVo.setAlwaysShow(true);
-            } else {
-                routerVo.setComponent(menu.getComponent());
-            }
-
-            routerVo.setHidden(menu.getVisible());
-            routerVo.setMeta(metaVo);
-            routerVo.setTitle(menu.getMenuName());
-            routerVo.setName(menu.getRouterName());
-            routerVo.setPath(menu.getPath());
-            if(parent != null) {
-                parent.getChildren().add(routerVo);
-            } else {
-                routerVo.setAlwaysShow(true);
-                treeRouter.add(routerVo);
-            }
-            if(menu.getChildren()!=null && menu.getChildren().size() > 0) {
-                List<RouterVo> treeRouterChild = new ArrayList<>();
-                routerVo.setChildren(treeRouterChild);
-                menuToRouter(menu.getChildren(), routerVo, treeRouterChild);
-            }
-        }
-    }
-    /**
-     * 递归生成菜单树
-     */
-    private List<UserMenuVO> createTreeMenus(Long pid, List<UserMenuVO> menus) {
-        List<UserMenuVO> treeMenu = new ArrayList<>();
-        for (UserMenuVO menu : menus) {
-            if (pid.equals(menu.getPid())) {
-                treeMenu.add(menu);
-                List<UserMenuVO> childs =  createTreeMenus(menu.getId(), menus);
-                if (childs != null && childs.size() > 0) {
-                    menu.setChildren(childs);
-                }
-            }
-        }
-        return treeMenu;
-    }
-}

+ 0 - 163
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/QuickMenuApiController.java

@@ -1,163 +0,0 @@
-package com.storlead.sales.controller.system;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.storlead.framework.util.LoginUserUtil;
-import com.storlead.framework.common.result.Result;
-import com.storlead.system.pojo.dto.QuickMenuDTO;
-import com.storlead.system.pojo.entity.MenuEntity;
-import com.storlead.system.pojo.entity.QuickMenuEntity;
-import com.storlead.system.pojo.vo.UserMenuVO;
-import com.storlead.system.service.IMenuService;
-import com.storlead.system.service.IUserRoleService;
-import com.storlead.system.service.QuickMenuService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.BeanUtils;
-import javax.annotation.Resource;
-import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.annotation.Resource;
-import java.util.*;
-import java.util.stream.Collectors;
-
-/**
- * @program: sp-sales-platform
- * @description:
- * @author: chenkq
- * @create: 2024-04-08 17:14
- */
-@Api(tags = "系统-快捷菜单: 快捷菜单设置")
-@RestController
-@RequestMapping("/sys/quick/menu")
-public class QuickMenuApiController {
-
-    @Resource
-    private QuickMenuService quickMenuService;
-
-    @Resource
-    private IMenuService menuService;
-
-    @Resource
-    private IUserRoleService userRoleService;
-
-    @ApiOperation("保存角色")
-    @PostMapping("/save")
-    public Result create(@RequestBody QuickMenuDTO dto) {
-
-        if (CollectionUtils.isEmpty(dto.getMenuIdls())) {
-            return Result.error("参数错误");
-        }
-        Long currentUserId = LoginUserUtil.getCurrentUserId();
-        quickMenuService.removeByMap(Map.of("user_id",currentUserId));
-        List<QuickMenuEntity> quickMenuls = new ArrayList<>();
-        dto.getMenuIdls().forEach(mId -> {
-            QuickMenuEntity quickMenu = new QuickMenuEntity();
-            quickMenu.setMenuId(mId);
-            quickMenu.setUserId(currentUserId);
-            quickMenu.setRangeType(dto.getRangeType());
-            quickMenuls.add(quickMenu);
-        });
-        quickMenuService.saveBatch(quickMenuls);
-        return Result.ok();
-    }
-
-    @ApiOperation("获取权限资源")
-    @PostMapping("/listMenus")
-    public Result listMenus() {
-        Long currentUserId = LoginUserUtil.getCurrentUserId();
-        List<MenuEntity> userMenuList = menuService.getUserMenuList(currentUserId,Arrays.asList(0,1), Arrays.asList(1,2));
-
-        LambdaQueryWrapper<MenuEntity> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.likeRight(MenuEntity::getMenuCode,"KJCD");
-        List<MenuEntity> args = menuService.list(queryWrapper);
-        if (!CollectionUtils.isEmpty(args)) {
-            userMenuList.addAll(args);
-        }
-        List<UserMenuVO> menuls = new ArrayList();
-        userMenuList.forEach(menu -> {
-            UserMenuVO menuVo = new UserMenuVO();
-            BeanUtils.copyProperties(menu,menuVo);
-            menuls.add(menuVo);
-        });
-        List<UserMenuVO>  menuRes = createTreeMenus(Long.valueOf(0),menuls);
-        return Result.ok(menuRes);
-    }
-
-    private List<UserMenuVO> createTreeMenus(Long pid, List<UserMenuVO> menus) {
-        List<UserMenuVO> treeMenu = new ArrayList<>();
-        for (UserMenuVO menu : menus) {
-            if (pid.equals(menu.getPid())) {
-                treeMenu.add(menu);
-                List<UserMenuVO> childs =  createTreeMenus(menu.getId(), menus);
-                if (childs != null && childs.size() > 0) {
-                    menu.setChildren(childs);
-                }
-            }
-        }
-        return treeMenu;
-    }
-
-    @ApiOperation("查询快捷方式")
-    @PostMapping("/quickMenus")
-    public Result quickMenus() {
-
-        Long currentUserId = LoginUserUtil.getCurrentUserId();
-        /**
-         * 根据用户id查询出当前用户的快捷菜单,并且转换成List对象集合
-         */
-        List<Long> alertMenuList;
-        LambdaQueryWrapper<MenuEntity> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.likeRight(MenuEntity::getMenuCode,"KJCD");
-        List<MenuEntity> args = menuService.list(queryWrapper);
-        if (!CollectionUtils.isEmpty(args)) {
-            alertMenuList = args.stream().map(MenuEntity::getId).collect(Collectors.toList());
-        } else {
-            alertMenuList = new ArrayList<>();
-        }
-
-        List<MenuEntity> allMenuList = menuService.list();
-        Map<Long, String> menuPathMap = allMenuList.stream()
-                .collect(Collectors.toMap(MenuEntity::getId, MenuEntity::getPath));
-
-        Map<Long, Long> menuPidMap = allMenuList.stream()
-                .collect(Collectors.toMap(MenuEntity::getId, MenuEntity::getPid));
-
-        List<QuickMenuEntity> quickMenuls = quickMenuService.list(new LambdaQueryWrapper<QuickMenuEntity>().eq(QuickMenuEntity::getUserId,currentUserId));
-        if(!CollectionUtils.isEmpty(quickMenuls)) {
-            List<Long> menuIds = quickMenuls.stream().map(QuickMenuEntity::getMenuId).collect(Collectors.toList());
-            List<MenuEntity> userMenuList = menuService.list(new LambdaQueryWrapper<MenuEntity>().in(MenuEntity::getId,menuIds));
-            if (!CollectionUtils.isEmpty(userMenuList)) {
-                List<UserMenuVO> menuls = new ArrayList();
-                List<Long> finalAlertMenuList = alertMenuList;
-                userMenuList.forEach(menu -> {
-                    UserMenuVO menuVo = new UserMenuVO();
-                    if (finalAlertMenuList.contains(menu.getId())) {
-                        menuVo.setOpenType(1);
-                    } else {
-                        menuVo.setOpenType(0);
-                    }
-                    BeanUtils.copyProperties(menu,menuVo);
-                    appendMenuPath(menuVo,menuPathMap,menu.getPid(),menuPidMap);
-                    menuls.add(menuVo);
-                });
-                return Result.result(menuls);
-            }
-        }
-        return Result.result(null);
-    }
-
-    public void appendMenuPath(UserMenuVO menuVO,Map<Long,String> menuPathMap,Long pid,Map<Long,Long> menuPidMap) {
-        if (Objects.nonNull(menuPidMap.get(pid))) {
-            String appendPath = menuPathMap.get(pid);
-            pid = menuPidMap.get(pid);
-            String path = appendPath+"/"+menuVO.getPath();
-            path = path.replaceAll("//", "/");
-            menuVO.setPath(path);
-            appendMenuPath(menuVO,menuPathMap,pid,menuPidMap);
-        }
-    }
-}

+ 0 - 294
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/RoleApiController.java

@@ -1,294 +0,0 @@
-package com.storlead.sales.controller.system;
-
-import cn.hutool.core.util.StrUtil;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.storlead.framework.common.result.Result;
-import com.storlead.system.pojo.entity.RoleEntity;
-import com.storlead.system.pojo.entity.RoleMenuEntity;
-import com.storlead.system.pojo.entity.UserRoleEntity;
-import com.storlead.system.pojo.vo.RoleMenuDTO;
-import com.storlead.system.service.DeptRoleService;
-import com.storlead.system.service.IRoleMenuService;
-import com.storlead.system.service.IRoleService;
-import com.storlead.system.service.IUserRoleService;
-import com.storlead.user.pojo.dto.RoleParam;
-import com.storlead.user.pojo.entity.UserEntity;
-import com.storlead.user.service.IUserService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.BeanUtils;
-import javax.annotation.Resource;
-import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.annotation.Resource;
-import java.util.*;
-import java.util.stream.Collectors;
-
-/**
- * @program: sp-cloud
- * @description:
- * @author: chenkq
- * @create: 2022-05-20 10:11
- */
-@Api(tags = "系统: 角色管理")
-@RestController
-@RequestMapping("/sys/role/manage")
-public class RoleApiController {
-    @Resource
-    private IRoleService roleService;
-
-    @Resource
-    private IUserService userService;
-
-    @Resource
-    private IUserRoleService userRoleService;
-
-    @Resource
-    private IRoleMenuService roleMenuService;
-
-    @Resource
-    private DeptRoleService deptRoleService;
-//    @Resource
-//    private SysRoleResourceEngineService roleResourceEngineService;
-
-
-    @ApiOperation("角色分页")
-    @PostMapping("/pagelist")
-    public Result<?> list(@RequestBody RoleParam param) {
-        IPage<RoleEntity> page = new Page<>(param.getPageIndex(),param.getPageSize());
-        LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper();
-        if (StrUtil.isNotBlank(param.getName())) {
-            queryWrapper.likeRight("name",param.getName());
-        }
-        IPage<RoleEntity> roles = roleService.page(page,queryWrapper);
-        if (!CollectionUtils.isEmpty(roles.getRecords())) {
-            setRoleUserNname(roles.getRecords());
-        }
-        return Result.ok(roles);
-    }
-
-    @ApiOperation("保存角色")
-    @PostMapping("/save")
-    public Result create(@RequestBody RoleParam param) {
-
-        RoleEntity info = new RoleEntity();
-        BeanUtils.copyProperties(param, info);
-
-        if (Objects.isNull(info) || StrUtil.isBlank(info.getName())) {
-            return Result.error("参数错误");
-        }
-        if (Objects.isNull(info.getId())) {
-            Integer exit = roleService.count(new LambdaQueryWrapper<RoleEntity>().eq(RoleEntity::getName,info.getName()));
-            if (exit > 0) {
-                return Result.error("角色'"+ info.getName() +"'已存在!");
-            }
-        } else {
-            RoleEntity oldAccount = roleService.getOne(new LambdaQueryWrapper<RoleEntity>().eq(RoleEntity::getName,info.getName()));
-            if (Objects.nonNull(oldAccount)) {
-                if (!oldAccount.getId().equals(info.getId())) {
-                    return Result.error("角色'"+ info.getName() +"'已存在,无法修改!");
-                }
-            }
-        }
-
-        Boolean b = roleService.saveOrUpdate(info);
-        if (b) {
-            roleMenuService.updateRoleMenu(info.getId(),param.getMenus(),param.getIsApp());
-            deptRoleService.updateDeptRole(info.getId(),param.getDepts());
-        }
-        return Result.ok();
-    }
-    @ApiOperation("启用禁用员工")
-    @PostMapping("enable")
-    public Result setEnable(Long id,Boolean enable) {
-        LambdaUpdateWrapper<RoleEntity> updateWrapper = new LambdaUpdateWrapper<>();
-        updateWrapper.set(RoleEntity::getEnabled,enable);
-        updateWrapper.eq(RoleEntity::getId,id);
-        roleService.update(updateWrapper);
-        return Result.ok();
-    }
-
-    @ApiOperation("删除角色")
-    @PostMapping("/delete")
-    public Result<?> remove(Long [] ids) {
-        if (Objects.isNull(ids) || ids.length == 0) {
-            return Result.error("参数错误");
-        }
-        Boolean result = roleService.removeByIds(Arrays.asList(ids));
-        if(result) {
-            userRoleService.remove(new LambdaQueryWrapper<UserRoleEntity>().in(UserRoleEntity::getRoleId, Arrays.asList(ids)));
-        }
-        return Result.ok();
-    }
-
-    @ApiOperation("关联角色用户")
-    @PostMapping("/bindRoleUser")
-    public Result<?> bindRoleUser(Long rid,Long [] uids) {
-        if (Objects.isNull(rid)) {
-            return Result.error("参数错误");
-        }
-        LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<UserRoleEntity>().eq(UserRoleEntity::getRoleId,rid);
-        userRoleService.remove(lambdaQueryWrapper);
-        if (Objects.nonNull(uids)) {
-            List<UserRoleEntity> urs = new ArrayList<>();
-            for (Long uid : Arrays.asList(uids)) {
-                UserRoleEntity userRole = new UserRoleEntity();
-                userRole.setUserId(uid);
-                userRole.setRoleId(rid);
-                urs.add(userRole);
-                if (Long.valueOf(1).equals(rid)) {
-                    UserRoleEntity adminRole = new UserRoleEntity();
-                    adminRole.setUserId(1L);
-                    adminRole.setRoleId(rid);
-                    urs.add(adminRole);
-                }
-            }
-            if (!CollectionUtils.isEmpty(urs)) {
-                userRoleService.saveBatch(urs);
-            }
-        }
-        return Result.ok();
-    }
-
-
-    @ApiOperation("关联角色菜单")
-    @PostMapping("/bind_role_menu")
-    public Result<?> bindRoleMenu(RoleMenuDTO dto) {
-        if (Objects.isNull(dto.getRoleId())) {
-            return Result.error("参数错误");
-        }
-        if (Objects.isNull(dto.getIsApp())) {
-            dto.setIsApp(0);
-        }
-        LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<RoleMenuEntity>().eq(RoleMenuEntity::getRoleId,dto.getRoleId()).eq(RoleMenuEntity::getIsApp,dto.getIsApp());
-        roleMenuService.remove(lambdaQueryWrapper);
-        if (!CollectionUtils.isEmpty(dto.getMenuls())) {
-            List<RoleMenuEntity> urs = new ArrayList<>();
-            for (Long menuId : dto.getMenuls()) {
-                RoleMenuEntity roleMenu = new RoleMenuEntity();
-                roleMenu.setRoleId(dto.getRoleId());
-                roleMenu.setMenuId(menuId);
-                roleMenu.setIsApp(dto.getIsApp());
-                urs.add(roleMenu);
-            }
-            if (!CollectionUtils.isEmpty(urs)) {
-                roleMenuService.saveBatch(urs);
-            }
-        }
-        return Result.ok();
-    }
-
-    @ApiOperation("设置用户角色")
-    @PostMapping("/setUserRole")
-    public Result<?> bindUserRole(Long uid,Long [] rids) {
-        if (Objects.isNull(rids) || Objects.isNull(uid)) {
-            return Result.error("参数错误");
-        }
-        LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<UserRoleEntity>().eq(UserRoleEntity::getUserId,uid);
-        userRoleService.remove(lambdaQueryWrapper);
-
-        List<UserRoleEntity> urs = new ArrayList<>();
-        Arrays.asList(rids).forEach(rid -> {
-            UserRoleEntity userRole = new UserRoleEntity();
-            userRole.setUserId(uid);
-            userRole.setRoleId(rid);
-            urs.add(userRole);
-        });
-
-        if (!CollectionUtils.isEmpty(urs)) {
-            userRoleService.saveBatch(urs);
-        }
-        return Result.ok();
-    }
-
-
-    @ApiOperation("绑定部门")
-    @PostMapping("/bindDeptRole")
-    public Result<?> bindDeptRole(@RequestBody RoleParam param) {
-        deptRoleService.updateDeptRole(param.getId(),param.getDepts());
-        return Result.ok();
-    }
-
-
-    @ApiOperation("关联角色菜单")
-    @PostMapping("/bindMenuRole")
-    public Result<?> bindMenuRole(Long [] rids,Long [] menus) {
-        if (Objects.isNull(rids)) {
-            return Result.error("参数错误");
-        }
-        LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<RoleMenuEntity>().in(RoleMenuEntity::getRoleId,Arrays.asList(rids));
-        roleMenuService.remove(lambdaQueryWrapper);
-        if (Objects.nonNull(rids) && rids.length > 0) {
-            List<RoleMenuEntity> rms = new ArrayList<>();
-            for (Long rid : Arrays.asList(rids)) {
-                Arrays.asList(menus).forEach(m -> {
-                    RoleMenuEntity roleMenu = new RoleMenuEntity();
-                    roleMenu.setRoleId(rid);
-                    roleMenu.setMenuId(m);
-                    rms.add(roleMenu);
-                });
-            }
-            if (!CollectionUtils.isEmpty(rms)) {
-               roleMenuService.saveBatch(rms);
-            }
-        }
-        return Result.ok();
-    }
-
-    @ApiOperation("根据角色查询菜单id")
-    @PostMapping("/getRoleMenuId")
-    public Result<?> getRoleMenuId(Long roleId) {
-        return Result.ok(roleService.getMenuIdsByRoleId(roleId,0));
-    }
-
-    @ApiOperation("根据角色查询菜单id")
-    @PostMapping("/getH5RoleMenuId")
-    public Result<?> getH5RoleMenuId(Long roleId) {
-        return Result.ok(roleService.getMenuIdsByRoleId(roleId,1));
-    }
-
-    /**
-     * 根据角色id查询部门id*
-     * @param roleId
-     */
-    @ApiOperation("根据角色查询组织id")
-    @PostMapping("/getRoleDeptId")
-    public Result<?> getRoleDeptId(Long roleId) {
-        return Result.ok(roleService.getdeptIdsByRoleId(roleId));
-    }
-
-    private void setRoleUserNname(List<RoleEntity> roles){
-        if (!CollectionUtils.isEmpty(roles)) {
-            List<Long> roleIds = new ArrayList<>();
-            roles.forEach(user -> {
-                roleIds.add(user.getId());
-            });
-            Map<Long,List<UserRoleEntity>> userRoles = userRoleService.list(new LambdaQueryWrapper<UserRoleEntity>().in(UserRoleEntity::getRoleId,roleIds)).stream().collect(Collectors.groupingBy(UserRoleEntity::getRoleId));
-            Map<Long,List<Long>> usMap = new HashMap<>();
-            for (Map.Entry<Long,List<UserRoleEntity>> entry : userRoles.entrySet()) {
-                usMap.put(entry.getKey(),entry.getValue().stream().map(UserRoleEntity::getUserId).collect(Collectors.toList()));
-            }
-            List<UserEntity> users = userService.list();
-            if (!CollectionUtils.isEmpty(roles) && Objects.nonNull(usMap)) {
-                roles.forEach(user -> {
-                    List<Long> userIds = usMap.get(user.getId());
-                    if (!CollectionUtils.isEmpty(userIds)) {
-                        List<String> unames = users.stream().filter(s -> userIds.contains(s.getId())).map(UserEntity::getRealName).collect(Collectors.toList());
-                        user.setUserNames(StringUtils.join(unames,","));
-                        user.setUserIds(userIds);
-                    }
-                });
-            }
-
-        }
-    }
-
-}

+ 0 - 160
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/SubCompanyApiController.java

@@ -1,160 +0,0 @@
-package com.storlead.sales.controller.system;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.storlead.framework.common.result.Result;
-import com.storlead.system.util.SystemSettingCacheCheckUtil;
-import com.storlead.user.pojo.dto.CompanyDTO;
-import com.storlead.user.pojo.entity.CompanyEntity;
-import com.storlead.user.pojo.entity.DeptEntity;
-import com.storlead.user.pojo.entity.SubCompanyEntity;
-import com.storlead.user.pojo.entity.UserEntity;
-import com.storlead.user.service.ICompanyService;
-import com.storlead.user.service.IDepartService;
-import com.storlead.user.service.ISubCompanyService;
-import com.storlead.user.service.IUserService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
-import javax.annotation.Resource;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.Arrays;
-import java.util.Objects;
-
-/**
- * @program: sp-sales
- * @description:
- * @author: chenkq
- * @create: 2022-06-29 17:42
- */
-
-
-@Api(tags = "系统: 子公司数据维护")
-@RestController
-@RequestMapping("/sys/subcompany")
-public class SubCompanyApiController {
-
-    @Resource
-    private ISubCompanyService subCompanyService;
-
-    @Resource
-    private IDepartService departService;
-
-    @Resource
-    private ICompanyService companyService;
-
-    @Resource
-    private IUserService userService;
-
-
-    @ApiOperation("新增子公司")
-    @PostMapping("save")
-    public Result save(SubCompanyEntity subCompany) {
-        Result r = SystemSettingCacheCheckUtil.checkAddDataMode();
-        if (!r.isSuccess()) {
-            return r;
-        }
-        if(Objects.isNull(subCompany.getId())) {
-            subCompany.setDataSource(1);
-
-            LambdaQueryWrapper<CompanyEntity> lm = new LambdaQueryWrapper();
-            lm.eq(CompanyEntity::getId,subCompany.getCompanyId());
-            lm.last("limit 1");
-            CompanyEntity company = companyService.getOne(lm);
-            if (Objects.isNull(company)) {
-                return Result.error("公司需要绑定在总公司下面,请绑定总公司");
-            }
-            LambdaQueryWrapper<SubCompanyEntity> subQWrapper = new LambdaQueryWrapper();
-            subQWrapper.eq(SubCompanyEntity::getCompanyId,subCompany.getCompanyId());
-            subQWrapper.orderByDesc(SubCompanyEntity::getRouteCode);
-            subQWrapper.last("limit 1");
-            SubCompanyEntity subCompany1 = subCompanyService.getOne(subQWrapper);
-            if (Objects.isNull(subCompany1)) {
-                subCompany.setRouteCode(company.getRouteCode()+",100");
-            }else {
-                String [] routeCodes = subCompany1.getRouteCode().split(",");
-                String lastCode = routeCodes[routeCodes.length-1];
-                lastCode = String.valueOf(Integer.valueOf(lastCode)+1);
-                routeCodes[routeCodes.length-1] = lastCode;
-                String routeCode = StringUtils.join(routeCodes,",");
-                subCompany.setRouteCode(routeCode);
-            }
-        }
-        subCompanyService.saveOrUpdate(subCompany);
-        return Result.ok();
-    }
-
-    @ApiOperation("分页查询子公司")
-    @PostMapping("pagelist")
-    public Result save(CompanyDTO param) {
-        IPage<SubCompanyEntity> page = new Page<>(param.getPageIndex(),param.getPageSize());
-        IPage<SubCompanyEntity> companys = subCompanyService.page(page);
-        return Result.ok(companys);
-    }
-
-    @ApiOperation("删除子公司信息")
-    @PostMapping("delete")
-    public Result delete(Long [] ids) {
-        if (ids == null || ids.length == 0) {
-            return Result.error("参数错误");
-        }
-        Integer exist = departService.count(new LambdaQueryWrapper<DeptEntity>().in(DeptEntity::getSubCompanyId, Arrays.asList(ids)));
-        if (!Objects.equals(exist,Integer.valueOf(0))) {
-            return Result.error("公司有关联的部门,无法删除!");
-        }
-        subCompanyService.removeByIds(Arrays.asList(ids));
-        return Result.ok();
-    }
-
-    @ApiOperation("设置子公司负责人")
-    @PostMapping("setLeaderId")
-    public Result setLeaderId(Integer subCompanyId,Long leaderId) {
-        if (Objects.isNull(subCompanyId)) {
-            return Result.error("参数错误");
-        }
-        LambdaUpdateWrapper<SubCompanyEntity> updateWrapper = new LambdaUpdateWrapper();
-        updateWrapper.eq(SubCompanyEntity::getId,subCompanyId);
-        UserEntity user = userService.getById(leaderId);
-        if (Objects.nonNull(user)) {
-            updateWrapper.set(SubCompanyEntity::getLeaderId,leaderId);
-            updateWrapper.set(SubCompanyEntity::getLeaderName,user.getRealName());
-        } else {
-            updateWrapper.set(SubCompanyEntity::getLeaderId,null);
-            updateWrapper.set(SubCompanyEntity::getLeaderName,"");
-        }
-        SubCompanyEntity subCompany = subCompanyService.getById(subCompanyId);
-        Boolean b =  subCompanyService.update(updateWrapper);
-        if (b) {
-            if (Objects.nonNull(subCompany)) {
-                if (!leaderId.equals(subCompany.getLeaderId())) {
-                    LambdaQueryWrapper subCompanyLq =  new LambdaQueryWrapper<SubCompanyEntity>().eq(SubCompanyEntity::getLeaderId,subCompany.getLeaderId()).ne(SubCompanyEntity::getId,subCompanyId);
-                    Integer scCount = subCompanyService.count(subCompanyLq);
-                    if (scCount == 0) {
-                        LambdaUpdateWrapper<UserEntity> rmLeaderUpdate = new LambdaUpdateWrapper();
-                        LambdaQueryWrapper userDeptLq =  new LambdaQueryWrapper<DeptEntity>().eq(DeptEntity::getManagerId,subCompany.getLeaderId());
-                        Integer c = departService.count(userDeptLq);
-                        if (c > 0) {
-                            rmLeaderUpdate.set(UserEntity::getIsLeader,Integer.valueOf(2));
-                        } else {
-                            rmLeaderUpdate.set(UserEntity::getIsLeader,Integer.valueOf(0));
-                        }
-                        rmLeaderUpdate.eq(UserEntity::getId,subCompany.getLeaderId());
-                        userService.update(rmLeaderUpdate);
-                    }
-                }
-            }
-            LambdaUpdateWrapper<UserEntity> userUpdate = new LambdaUpdateWrapper();
-            userUpdate.set(UserEntity::getIsLeader,Integer.valueOf(1));
-            userUpdate.eq(UserEntity::getId,leaderId);
-            userService.update(userUpdate);
-        }
-        return Result.ok();
-    }
-
-}
-

+ 0 - 81
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/SubCompanyController.java

@@ -1,81 +0,0 @@
-package com.storlead.sales.controller.system;
-
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.storlead.framework.common.result.Result;
-import com.storlead.user.pojo.entity.SubCompanyEntity;
-import com.storlead.user.service.ISubCompanyService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import javax.annotation.Resource;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-@RestController
-@RequestMapping("/lingcun")
-@Api(tags="5.公共接口")
-public class SubCompanyController {
-
-    @Resource
-    private ISubCompanyService subCompanyService;
-
-    @GetMapping(value = "/subCompany/list")
-    @ApiOperation(value = "公共接口-分公司-列表", notes = "公共接口-分公司-列表")
-    @ApiResponses({
-            @ApiResponse(code = 200, message = "", response = SubCompanyEntity.class)
-    })
-    public Result<?> list() {
-        // Step.1 组装查询条件
-        QueryWrapper<SubCompanyEntity> queryWrapper = new QueryWrapper<SubCompanyEntity>();
-        queryWrapper.select("id,company_id,`desc`,name,sort,enabled");
-        queryWrapper.eq("enabled", 1);
-        queryWrapper.orderByAsc("sort");
-        List<SubCompanyEntity> list = subCompanyService.list(queryWrapper);
-        return Result.ok(list);
-    }
-
-    @GetMapping(value = "/subCompany/listHasAllCompany")
-    @ApiOperation(value = "公共接口-分公司-包含所有公司列表", notes = "公共接口-分公司-包含所有公司列表")
-    @ApiResponses({
-            @ApiResponse(code = 200, message = "", response = SubCompanyEntity.class)
-    })
-    public Result<?> listHasAllCompany() {
-        List<SubCompanyEntity> list = new ArrayList<>();
-        SubCompanyEntity subCompany = new SubCompanyEntity();
-        subCompany.setId(0L);
-        subCompany.setName("所有公司");
-        subCompany.setDesc("所有公司");
-        list.add(subCompany);
-        // Step.1 组装查询条件
-        QueryWrapper<SubCompanyEntity> queryWrapper = new QueryWrapper<SubCompanyEntity>();
-        queryWrapper.select("id,company_id,`desc`,name,sort,enabled");
-        queryWrapper.eq("enabled", 1);
-        queryWrapper.orderByAsc("sort");
-        List<SubCompanyEntity> subCompanyEntityList = subCompanyService.list(queryWrapper);
-        list.addAll(subCompanyEntityList);
-        return Result.ok(list);
-    }
-    @ApiOperation("启用禁用部门")
-    @PostMapping("/su_company/enable")
-    public Result setEnable(Long id,Boolean enable) {
-        LambdaUpdateWrapper<SubCompanyEntity> update = new LambdaUpdateWrapper();
-        update.in(SubCompanyEntity::getId, Arrays.asList(id));
-        update.set(SubCompanyEntity::getEnabled,enable);
-        Boolean re = subCompanyService.update(update);
-        if (re) {
-            return Result.ok();
-        } else {
-            return Result.error("操作失败");
-        }
-    }
-
-}

+ 0 - 175
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/SysDictApiController.java

@@ -1,175 +0,0 @@
-package com.storlead.sales.controller.system;
-
-
-import cn.hutool.core.util.StrUtil;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.storlead.framework.common.result.Result;
-import com.storlead.system.pojo.dto.SysDictDTO;
-import com.storlead.system.pojo.entity.SysDictDetailEntity;
-import com.storlead.system.pojo.entity.SysDictEntity;
-import com.storlead.system.pojo.entity.SystemPersonalizeSettingEntity;
-import com.storlead.system.service.SysDictDetailService;
-import com.storlead.system.service.SysDictService;
-import io.swagger.annotations.*;
-import javax.annotation.Resource;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.Objects;
-
-/**
- * <p>
- * 字典组 前端控制器
- * </p>
- *
- * @author chenkq
- * @since 2022-09-09
- */
-@RestController
-@RequestMapping("/sys/dict")
-@Api(tags="101:系统数据字典")
-public class SysDictApiController {
-
-    @Resource
-    private SysDictService sysDictService;
-
-    @Resource
-    private SysDictDetailService sysDictDetailService;
-
-    @PostMapping(value = "/saveDict")
-    @ApiOperation(value = "保存字典组", notes = "保存字典组")
-    @ApiResponses({
-            @ApiResponse(code = 200, message = "", response = SystemPersonalizeSettingEntity.class)
-    })
-    public Result saveDict(SysDictEntity sysDict) {
-        if (StrUtil.isBlank(sysDict.getCode())) {
-            return Result.error("参数错误,字典编码不能为空");
-        }
-        SysDictEntity entity = sysDictService.getOne(new LambdaQueryWrapper<SysDictEntity>().eq(SysDictEntity::getCode,sysDict.getCode()));
-        if (Objects.nonNull(entity)) {
-            if (Objects.isNull(sysDict.getDictId())) {
-                return Result.error("字典"+sysDict.getCode()+"已被占用,请修改编码!");
-            }else {
-                if (!entity.getDictId().equals(sysDict.getDictId())) {
-                    return Result.error("字典"+sysDict.getCode()+"已被占用编码!");
-                }
-            }
-        }
-        sysDictService.saveOrUpdate(sysDict);
-        return Result.ok();
-    }
-
-    @PostMapping(value = "/saveDictDetail")
-    @ApiOperation(value = "保存字典详情", notes = "保存字典详情")
-    @ApiResponses({
-            @ApiResponse(code = 200, message = "")
-    })
-    public Result saveDictDetail(SysDictDetailEntity Detail) {
-        sysDictDetailService.saveOrUpdate(Detail);
-        return Result.ok();
-    }
-
-    @PostMapping(value = "/pageDict")
-    @ApiOperation(value = "查询字典配置数据", notes = "查询字典配置数据")
-    @ApiResponses({
-            @ApiResponse(code = 200, message = "")
-    })
-    public Result pageDict(SysDictDTO dto) {
-        Page<SysDictEntity> page = new Page<>(dto.getPageIndex(),dto.getPageSize());
-        LambdaQueryWrapper<SysDictEntity> queryWrapper = new LambdaQueryWrapper();
-        if (StrUtil.isNotBlank(dto.getCode()) && StrUtil.isNotBlank(dto.getName())) {
-            queryWrapper.eq(SysDictEntity::getCode, dto.getCode()).or().like(SysDictEntity::getName, dto.getName());
-        } else {
-            if (StrUtil.isNotBlank(dto.getCode())) {
-                queryWrapper.eq(SysDictEntity::getCode, dto.getCode());
-            } else if (StrUtil.isNotBlank(dto.getName())) {
-                queryWrapper.like(SysDictEntity::getName, dto.getName());
-            }
-        }
-        if (Objects.nonNull(dto.getDictType())) {
-            queryWrapper.eq(SysDictEntity::getDictType, dto.getDictType());
-        }
-        queryWrapper.like(SysDictEntity::getIsDelete, Integer.valueOf(0));
-        IPage<SysDictEntity> vos = sysDictService.page(page,queryWrapper);
-        return Result.ok(vos);
-    }
-
-    @PostMapping(value = "/listDetialByDictId")
-    @ApiOperation(value = "获取字典详情", notes = "获取指定字典详情")
-    @ApiResponses({
-            @ApiResponse(code = 200, message = "")
-    })
-    public Result lisDetialByDictId(SysDictDTO dto) {
-        if (Objects.isNull(dto.getDictId())) {
-            return Result.error("查询参数错误!");
-        }
-        Page<SysDictDetailEntity> page = new Page<>(dto.getPageIndex(),dto.getPageSize());
-        LambdaQueryWrapper<SysDictDetailEntity> queryWrapper = new LambdaQueryWrapper();
-        queryWrapper.eq(SysDictDetailEntity::getDictId,dto.getDictId());
-        queryWrapper.eq(SysDictDetailEntity::getIsDelete,Integer.valueOf(0));
-//      queryWrapper.eq(SysDictDetailEntity::getEnabled,1);
-        IPage<SysDictDetailEntity> vos = sysDictDetailService.page(page,queryWrapper);
-        return Result.ok(vos);
-    }
-
-    @PostMapping(value = "/listDetialByCodes")
-    @ApiOperation(value = "获取字典组", notes = "获取字典组")
-    @ApiResponses({
-            @ApiResponse(code = 200, message = "", response = SysDictDetailEntity.class)
-    })
-    public Result lisDetialByCodes(SysDictDTO dto) {
-
-        return sysDictService.lisDetialByCodes(dto);
-
-    }
-
-    @PostMapping(value = "/deleteDict")
-    @ApiOperation(value = "删除字典组", notes = "删除字典组")
-    @ApiResponses({
-            @ApiResponse(code = 200, message = "", response = SysDictDetailEntity.class)
-    })
-    public Result deleteDict(@RequestParam(value = "ids") @ApiParam(value = "主键id") Long [] ids) {
-
-        LambdaUpdateWrapper<SysDictEntity>  updateDictWrapper = new LambdaUpdateWrapper();
-        updateDictWrapper.set(SysDictEntity::getIsDelete,Integer.valueOf(1));
-        updateDictWrapper.in(SysDictEntity::getDictId,ids);
-        sysDictService.update(updateDictWrapper);
-
-        LambdaUpdateWrapper<SysDictDetailEntity> updateDictDetailWrapper = new LambdaUpdateWrapper();
-        updateDictDetailWrapper.set(SysDictDetailEntity::getIsDelete,Integer.valueOf(1));
-        updateDictDetailWrapper.in(SysDictDetailEntity::getDictId,ids);
-
-        sysDictDetailService.update(updateDictDetailWrapper);
-        return Result.ok();
-    }
-
-    @PostMapping(value = "/deleteDictDetail")
-    @ApiOperation(value = "删除字典详情", notes = "删除字典详情")
-    @ApiResponses({
-            @ApiResponse(code = 200, message = "", response = SysDictDetailEntity.class)
-    })
-    public Result deleteDictDetail(@RequestParam(value = "ids") @ApiParam(value = "主键id") Long [] ids) {
-
-        LambdaUpdateWrapper<SysDictDetailEntity> updateDictDetailWrapper = new LambdaUpdateWrapper();
-        updateDictDetailWrapper.set(SysDictDetailEntity::getIsDelete,Integer.valueOf(1));
-        updateDictDetailWrapper.in(SysDictDetailEntity::getDictDetailId,ids);
-
-        sysDictDetailService.update(updateDictDetailWrapper);
-        return Result.ok();
-    }
-
-    @ApiOperation("禁用或启用字典")
-    @PostMapping("enabledDetail")
-    public Result enabledTemplateDetail(Long id,Boolean enable) {
-        LambdaUpdateWrapper<SysDictDetailEntity> updateWrapper = new LambdaUpdateWrapper<>();
-        updateWrapper.set(SysDictDetailEntity::getEnabled,enable);
-        updateWrapper.eq(SysDictDetailEntity::getDictDetailId,id);
-        sysDictDetailService.update(updateWrapper);
-        return Result.ok();
-    }
-}

+ 0 - 19
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/SysOperationLogController.java

@@ -1,19 +0,0 @@
-package com.storlead.sales.controller.system;
-
-
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- * 系统日志 前端控制器
- * </p>
- *
- * @author chenkq
- * @since 2022-07-29
- */
-@RestController
-@RequestMapping("/sys-operation-log-entity")
-public class SysOperationLogController {
-
-}

+ 0 - 60
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/SystemConfigItemController.java

@@ -1,60 +0,0 @@
-package com.storlead.sales.controller.system;
-
-
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.storlead.framework.common.result.Result;
-import com.storlead.system.pojo.dto.SystemConfigItemDTO;
-import com.storlead.system.pojo.entity.SystemConfigItemEntity;
-import com.storlead.system.pojo.entity.SystemPersonalizeSettingEntity;
-import com.storlead.system.service.SystemConfigItemService;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.annotation.Resource;
-
-/**
- * <p>
- * 系统配置项 前端控制器
- * </p>
- *
- * @author chenkq
- * @since 2023-07-26
- */
-@RestController
-@RequestMapping("/system/config")
-public class SystemConfigItemController {
-
-    @Resource
-    private SystemConfigItemService configItemService;
-
-    @PostMapping(value = "/update")
-    @ApiOperation(value = "修改配置项信息", notes = "配置系统基础设置")
-    @ApiResponses({
-            @ApiResponse(code = 200, message = "", response = SystemPersonalizeSettingEntity.class)
-    })
-    public Result update(SystemConfigItemDTO dto) {
-        SystemConfigItemEntity configItem = SystemConfigItemDTO.convertConfigItemEntity(dto);
-        if (null == configItem) {
-            return Result.error("参数错误");
-        }
-        configItemService.saveOrUpdate(configItem);
-        return Result.ok();
-    }
-
-    @PostMapping(value = "/enabled")
-    @ApiOperation(value = "修改配置项信息", notes = "配置系统基础设置")
-    @ApiResponses({
-            @ApiResponse(code = 200, message = "", response = SystemPersonalizeSettingEntity.class)
-    })
-    public Result enabled(Long itemId,Boolean enable) {
-        LambdaUpdateWrapper<SystemConfigItemEntity> updateWrapper = new LambdaUpdateWrapper<>();
-        updateWrapper.set(SystemConfigItemEntity::getEnabled,enable);
-        updateWrapper.eq(SystemConfigItemEntity::getItemId,itemId);
-        configItemService.update(updateWrapper);
-        return Result.ok();
-    }
-}

+ 0 - 49
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/SystemOssConfigApiController.java

@@ -1,49 +0,0 @@
-package com.storlead.sales.controller.system;
-
-import com.storlead.framework.common.result.Result;
-import com.storlead.system.pojo.entity.SystemOssConfigEntity;
-import com.storlead.system.pojo.entity.SystemPersonalizeSettingEntity;
-import com.storlead.system.service.SystemOssConfigService;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import javax.annotation.Resource;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- * OSS  secret 配置 前端控制器
- * </p>
- *
- * @author chenkq
- * @since 2022-07-20
- */
-@RestController
-@RequestMapping("/sys/alioss/config")
-public class SystemOssConfigApiController {
-
-    @Resource
-    private SystemOssConfigService systemOssConfigService;
-
-    @PostMapping(value = "/saveAlioss")
-    @ApiOperation(value = "配置系统基础设置", notes = "配置系统基础设置")
-    @ApiResponses({
-            @ApiResponse(code = 200, message = "", response = SystemPersonalizeSettingEntity.class)
-    })
-    public Result saveSetting(SystemOssConfigEntity entity) {
-        systemOssConfigService.saveOrUpdate(entity);
-        return Result.ok();
-    }
-
-    @PostMapping(value = "/getAlioss")
-    @ApiOperation(value = "获取系统基础设置", notes = "获取系统基础设置")
-    @ApiResponses({
-            @ApiResponse(code = 200, message = "", response = SystemPersonalizeSettingEntity.class)
-    })
-    public Result<?> getSetting() {
-        SystemOssConfigEntity alioss = systemOssConfigService.getOne(null);
-        return Result.ok(alioss);
-    }
-}

+ 0 - 50
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/SystemPersonalizeSettingApiController.java

@@ -1,50 +0,0 @@
-package com.storlead.sales.controller.system;
-
-
-import com.storlead.framework.common.result.Result;
-import com.storlead.system.pojo.entity.SystemPersonalizeSettingEntity;
-import com.storlead.system.service.SystemPersonalizeSettingService;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import javax.annotation.Resource;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- * 系统个性化设置 前端控制器
- * </p>
- *
- * @author chenkq
- * @since 2022-07-20
- */
-@RestController
-@RequestMapping("/sys/personalize/setting")
-public class SystemPersonalizeSettingApiController {
-
-    @Resource
-    private SystemPersonalizeSettingService personalizeSettingService;
-
-
-    @PostMapping(value = "/save")
-    @ApiOperation(value = "配置系统基础设置", notes = "配置系统基础设置")
-    @ApiResponses({
-            @ApiResponse(code = 200, message = "", response = SystemPersonalizeSettingEntity.class)
-    })
-    public Result saveSetting(SystemPersonalizeSettingEntity entity) {
-         personalizeSettingService.saveOrUpdate(entity);
-         return Result.ok();
-    }
-
-    @PostMapping(value = "/get")
-    @ApiOperation(value = "获取系统基础设置", notes = "获取系统基础设置")
-    @ApiResponses({
-            @ApiResponse(code = 200, message = "", response = SystemPersonalizeSettingEntity.class)
-    })
-    public Result<?> getSetting() {
-        SystemPersonalizeSettingEntity setting = personalizeSettingService.getOne(null);
-        return Result.ok(setting);
-    }
-}

+ 0 - 49
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/SystemSettingApiController.java

@@ -1,49 +0,0 @@
-package com.storlead.sales.controller.system;
-
-import com.storlead.framework.common.result.Result;
-import com.storlead.framework.redis.RedisService;
-import com.storlead.system.constant.ReidsCacheConstant;
-import com.storlead.system.pojo.entity.SystemPersonalizeSettingEntity;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import javax.annotation.Resource;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.Objects;
-
-@RestController
-@RequestMapping("/sys/set")
-public class SystemSettingApiController {
-
-    @Resource
-    private RedisService redisService;
-
-    @PostMapping(value = "/orgSyncMode")
-    @ApiOperation(value = "组织结构数据同步模式", notes = "组织结构数据同步模式")
-    @ApiResponses({
-            @ApiResponse(code = 200, message = "", response = SystemPersonalizeSettingEntity.class)
-    })
-    public Result orgSyncMode(Integer mode) {
-        if (mode == null) {
-            mode = 0;
-        }
-        redisService.setCacheObject(ReidsCacheConstant.SYS_CACHE_ORG_SYNC_MODE,mode);
-        return Result.ok();
-    }
-
-    @PostMapping(value = "/getOrgSyncMode")
-    @ApiOperation(value = "获取组织结构数据同步模式", notes = "获取组织结构数据同步模式")
-    @ApiResponses({
-            @ApiResponse(code = 200, message = "", response = SystemPersonalizeSettingEntity.class)
-    })
-    public Result getOrgSyncMode() {
-        Object mode = redisService.getCacheObject(ReidsCacheConstant.SYS_CACHE_ORG_SYNC_MODE);
-        if (Objects.isNull(mode)) {
-            mode = 0;
-        }
-        return Result.ok(mode);
-    }
-}

+ 0 - 40
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/SystemWechatConfigApiController.java

@@ -1,40 +0,0 @@
-package com.storlead.sales.controller.system;
-
-import com.storlead.framework.common.result.Result;
-import com.storlead.wx.pojo.vo.SystemWechatConfigEntity;
-import com.storlead.wx.service.SystemWechatConfigService;
-import io.swagger.annotations.ApiOperation;
-import javax.annotation.Resource;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- * 企业微信secret配置 前端控制器
- * </p>
- *
- * @author chenkq
- * @since 2022-07-20
- */
-@RestController
-@RequestMapping("/sys/wechat/config")
-public class SystemWechatConfigApiController {
-
-    @Resource
-    private SystemWechatConfigService systemWechatConfigService;
-
-    @PostMapping(value = "/save")
-    @ApiOperation(value = "保存企业微信参数配置", notes = "配置系统基础设置")
-    public Result saveSetting(SystemWechatConfigEntity entity) {
-        systemWechatConfigService.saveOrUpdate(entity);
-        return Result.ok();
-    }
-
-    @PostMapping(value = "/get")
-    @ApiOperation(value = "保存企业微信参数配置")
-    public Result<?> getSetting() {
-        SystemWechatConfigEntity setting = systemWechatConfigService.getOne(null);
-        return Result.ok(setting);
-    }
-}

+ 0 - 536
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/UserApiController.java

@@ -1,536 +0,0 @@
-package com.storlead.sales.controller.system;
-
-import cn.hutool.core.collection.CollectionUtil;
-import cn.hutool.core.util.StrUtil;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.storlead.framework.common.constant.CommonConstant;
-import com.storlead.framework.auth.ecode.PasswordEncoder;
-import com.storlead.framework.util.LoginUserUtil;
-import com.storlead.framework.common.result.Result;
-import com.storlead.system.pojo.entity.RoleEntity;
-import com.storlead.system.pojo.entity.UserRoleEntity;
-import com.storlead.system.service.IRoleService;
-import com.storlead.system.service.IUserRoleService;
-import com.storlead.system.util.SystemConfigItemCacheUtil;
-import com.storlead.system.util.SystemSettingCacheCheckUtil;
-import com.storlead.user.pojo.dto.SetUserDetailDTO;
-import com.storlead.user.pojo.dto.UserParam;
-import com.storlead.user.pojo.entity.DeptEntity;
-import com.storlead.user.pojo.entity.UserEntity;
-import com.storlead.user.pojo.vo.SetUserDetailVo;
-import com.storlead.user.pojo.vo.UserVo;
-import com.storlead.user.service.IDepartService;
-import com.storlead.user.service.IUserService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import lombok.extern.slf4j.Slf4j;
-import javax.annotation.Resource;
-import org.springframework.util.StringUtils;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Objects;
-import java.util.stream.Collectors;
-
-
-/**
- * @program: sp-cloud
- * @description:
- * @author: chenkq
- * @create: 2022-05-20 12:08
- */
-@Slf4j
-@Api(tags = "用户: 用户管理")
-@RestController
-@RequestMapping("/sys/user")
-public class UserApiController {
-
-    @Resource
-    private IUserService userService;
-
-    @Resource
-    private IUserRoleService userRoleService;
-
-    @Resource
-    private IRoleService roleService;
-
-    @Resource
-    private IDepartService departService;
-
-    @Resource
-    private PasswordEncoder passwordEncoder;
-
-    @ApiOperation("保存员工")
-    @PostMapping("save")
-    public Result save(@RequestBody UserEntity user) {
-        Result r = SystemSettingCacheCheckUtil.checkAddDataMode();
-        if (!r.isSuccess()) {
-            return r;
-        }
-        if (StrUtil.isBlank(user.getMobile())) {
-            return Result.error("手机号不能为空!");
-        }
-        if(Objects.isNull(user.getId())) {
-            String defaultPassWord = SystemConfigItemCacheUtil.getDefaultPassWord();
-            user.setDataSource(1);
-            user.setPassword(passwordEncoder.encode(defaultPassWord));
-        }
-        UserEntity oUser = userService.getOne(new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getMobile,user.getMobile()).eq(UserEntity::getIsDelete,0).last("limit 1"));
-        if (Objects.nonNull(oUser)) {
-            if (!oUser.getId().equals(user.getId())) {
-                return Result.error("手机'"+user.getMobile()+"'号已被占用!");
-            }
-        }
-
-        if (Objects.nonNull(user.getDeptId())) {
-            DeptEntity dept = departService.getById(user.getDeptId());
-            if (Objects.nonNull(dept)) {
-                user.setOrgRouteCode(dept.getRouteCode());
-                user.setSubCompanyId(dept.getSubCompanyId());
-                user.setCompanyId(dept.getCompanyId());
-                user.setSubCompanyId(dept.getSubCompanyId());
-            }
-        }
-        if (Objects.nonNull(user.getManagerId())) {
-            UserEntity u = userService.getById(user.getManagerId());
-            if (Objects.nonNull(u)) {
-                user.setManagers(u.getManagers()+","+user.getManagerId().toString());
-            } else {
-                user.setManagers(user.getManagerId().toString());
-            }
-        }
-        userService.saveOrUpdate(user);
-        return Result.ok();
-    }
-
-    @ApiOperation("根据部门id查询用户")
-    @PostMapping("listByDeptId")
-    public Result listByDeptId(Long deptId) {
-
-        List<UserEntity> list = userService.list(
-                new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getDeptId,deptId)
-                        .ne(UserEntity::getStatus,Integer.valueOf(5))
-                        .eq(UserEntity::getIsDelete,0));
-        return Result.ok(list);
-    }
-
-    @ApiOperation("分页查询用户")
-    @PostMapping("pageUserlist")
-    public Result pageUserlist(@RequestBody UserParam param) {
-        IPage<UserVo> page = new Page<>(param.getPageIndex(),param.getPageSize());
-        LambdaQueryWrapper<UserEntity> queryWrapper = new LambdaQueryWrapper<UserEntity>(new UserEntity());
-        queryWrapper.eq(UserEntity::getIsDelete, CommonConstant.DEL_FLAG_0);
-        if (StrUtil.isNotBlank(param.getBlurry())) {
-            queryWrapper.like(UserEntity::getUserName,param.getBlurry()).or().like(UserEntity::getRealName,param.getBlurry());
-        }
-        if (StrUtil.isNotBlank(param.getOrgRouteCode())) {
-            queryWrapper.likeRight(UserEntity::getOrgRouteCode,param.getOrgRouteCode());
-        }
-//        if (Objects.isNull(param.getStatus())) {
-//            queryWrapper.ne(UserEntity::getStatus,Integer.valueOf(5));
-//        } else {
-//            queryWrapper.ne(UserEntity::getStatus,param.getStatus());
-//        }
-        if (!param.getIsIncludeResign()) {
-            queryWrapper.ne(UserEntity::getStatus,Integer.valueOf(5));
-        }
-        queryWrapper.orderByDesc(UserEntity::getEmail);
-        List<UserVo> us  = userService.listWithScopeVo(page,queryWrapper,param);
-        if (CollectionUtil.isNotEmpty(us)) {
-            List<Long> userIds = us.stream().map(UserVo::getId).collect(Collectors.toList());
-            List<UserRoleEntity> userRolels = userRoleService.selectUserRole(new LambdaQueryWrapper<UserRoleEntity>().in(UserRoleEntity::getUserId,userIds));
-            if (CollectionUtil.isNotEmpty(userRolels)) {
-                List<RoleEntity> rs = roleService.list(new LambdaQueryWrapper<RoleEntity>().in(RoleEntity::getId,userRolels.stream().map(UserRoleEntity::getRoleId).collect(Collectors.toList())));
-                us.forEach(u -> {
-                    List<RoleEntity> roles = rs.stream().filter(r -> userRolels.stream().anyMatch(ur -> ur.getRoleId().equals(r.getId()) && ur.getUserId().equals(u.getId()))).collect(Collectors.toList());
-                    if(CollectionUtil.isNotEmpty(roles)) {
-                        u.setRoleNames(roles.stream().map(RoleEntity::getName).collect(Collectors.toList()));
-                        u.setRoleIds(roles.stream().map(RoleEntity::getId).collect(Collectors.toList()));
-                    }
-                });
-            }
-
-            us.forEach(e -> {
-                e.setIdNum("");
-                e.setPassword("");
-                e.setBankCardNum("");
-                e.setBankName("");
-                e.setEducation("");
-                e.setAddress("");
-                e.setBirthday(null);
-                e.setEmail("");
-            });
-        }
-        page.setRecords(us);
-        return Result.ok(page);
-    }
-
-
-    @ApiOperation("分页查询用户")
-    @PostMapping("pagelist")
-    public Result pagelist(@RequestBody UserParam param) {
-
-//        param.setCommonQueryOrderBy("UserEntity");
-
-        IPage<UserVo> page = new Page<>(param.getPageIndex(),param.getPageSize());
-        LambdaQueryWrapper<UserEntity> queryWrapper = new LambdaQueryWrapper<UserEntity>(new UserEntity());
-        queryWrapper.eq(UserEntity::getIsDelete, CommonConstant.DEL_FLAG_0);
-        if (StrUtil.isNotBlank(param.getBlurry())) {
-            queryWrapper.like(UserEntity::getUserName,param.getBlurry()).or().like(UserEntity::getRealName,param.getBlurry());
-        }
-
-
-        LambdaQueryWrapper<DeptEntity> dlp = new LambdaQueryWrapper<>();
-        dlp.eq(DeptEntity::getEnabled,1);
-        dlp.eq(DeptEntity::getIsDelete,CommonConstant.DEL_FLAG_0);
-        List<DeptEntity> deptEntities = departService.list(dlp);
-        if (CollectionUtil.isNotEmpty(deptEntities)) {
-            List<Long> deptIds = deptEntities.stream().map(DeptEntity::getId).collect(Collectors.toList());
-            queryWrapper.in(UserEntity::getDeptId,deptIds);
-        }
-        if (StrUtil.isNotBlank(param.getOrgRouteCode())) {
-            queryWrapper.likeRight(UserEntity::getOrgRouteCode,param.getOrgRouteCode());
-        }
-//        if (Objects.isNull(param.getStatus())) {
-//            queryWrapper.ne(UserEntity::getStatus,Integer.valueOf(5));
-//        } else {
-//            queryWrapper.ne(UserEntity::getStatus,param.getStatus());
-//        }
-        if (!param.getIsIncludeResign()) {
-            // 在职
-            queryWrapper.ne(UserEntity::getStatus,Integer.valueOf(5));
-            queryWrapper.eq(UserEntity::getEnabled,1);
-        } else {
-            queryWrapper.and(wrapper ->
-                    wrapper.eq(UserEntity::getStatus, 5) // 离职
-                            .or(w -> w.ne(UserEntity::getStatus, 5) // 在职
-                                    .eq(UserEntity::getEnabled, 1)) // 并且启用
-            );
-        }
-        queryWrapper.orderByDesc(UserEntity::getEmail);
-        List<UserVo> us  = userService.listWithScopeVo(page,queryWrapper,param);
-        if (CollectionUtil.isNotEmpty(us)) {
-            List<Long> userIds = us.stream().map(UserVo::getId).collect(Collectors.toList());
-            List<UserRoleEntity> userRolels = userRoleService.selectUserRole(new LambdaQueryWrapper<UserRoleEntity>().in(UserRoleEntity::getUserId,userIds));
-            if (CollectionUtil.isNotEmpty(userRolels)) {
-                List<RoleEntity> rs = roleService.list(new LambdaQueryWrapper<RoleEntity>().in(RoleEntity::getId,userRolels.stream().map(UserRoleEntity::getRoleId).collect(Collectors.toList())));
-                us.forEach(u -> {
-                    List<RoleEntity> roles = rs.stream().filter(r -> userRolels.stream().anyMatch(ur -> ur.getRoleId().equals(r.getId()) && ur.getUserId().equals(u.getId()))).collect(Collectors.toList());
-                    if(CollectionUtil.isNotEmpty(roles)) {
-                        u.setRoleNames(roles.stream().map(RoleEntity::getName).collect(Collectors.toList()));
-                        u.setRoleIds(roles.stream().map(RoleEntity::getId).collect(Collectors.toList()));
-                    }
-                });
-            }
-
-            us.forEach(e -> {
-                e.setIdNum("");
-                e.setPassword("");
-                e.setBankCardNum("");
-                e.setBankName("");
-                e.setEducation("");
-                e.setAddress("");
-                e.setBirthday(null);
-                e.setEmail("");
-            });
-        }
-        page.setRecords(us);
-        return Result.ok(page);
-    }
-
-    @ApiOperation("分页查询用户")
-    @PostMapping("pageScopelist")
-    public Result pageScopelist(@RequestBody UserParam param) {
-
-        IPage<UserVo> page = new Page<>(param.getPageIndex(),param.getPageSize());
-        LambdaQueryWrapper<UserEntity> queryWrapper = new LambdaQueryWrapper<UserEntity>(new UserEntity());
-        queryWrapper.eq(UserEntity::getIsDelete, CommonConstant.DEL_FLAG_0);
-        if (StrUtil.isNotBlank(param.getBlurry())) {
-            queryWrapper.like(UserEntity::getUserName,param.getBlurry()).or().like(UserEntity::getRealName,param.getBlurry());
-        }
-        if (StrUtil.isNotBlank(param.getOrgRouteCode())) {
-            queryWrapper.likeRight(UserEntity::getOrgRouteCode,param.getOrgRouteCode());
-        }
-        if (!param.getIsIncludeResign()) {
-            queryWrapper.ne(UserEntity::getStatus,Integer.valueOf(5));
-        }
-        queryWrapper.orderByDesc(UserEntity::getEmail);
-        List<UserVo> us  = userService.listWithScopeVo(page,queryWrapper,param);
-        if (CollectionUtil.isNotEmpty(us)) {
-            List<Long> userIds = us.stream().map(UserVo::getId).collect(Collectors.toList());
-            List<UserRoleEntity> userRolels = userRoleService.selectUserRole(new LambdaQueryWrapper<UserRoleEntity>().in(UserRoleEntity::getUserId,userIds));
-            if (CollectionUtil.isNotEmpty(userRolels)) {
-                List<RoleEntity> rs = roleService.list(new LambdaQueryWrapper<RoleEntity>().in(RoleEntity::getId,userRolels.stream().map(UserRoleEntity::getRoleId).collect(Collectors.toList())));
-                us.forEach(u -> {
-                    List<RoleEntity> roles = rs.stream().filter(r -> userRolels.stream().anyMatch(ur -> ur.getRoleId().equals(r.getId()) && ur.getUserId().equals(u.getId()))).collect(Collectors.toList());
-                    if(CollectionUtil.isNotEmpty(roles)) {
-                        u.setRoleNames(roles.stream().map(RoleEntity::getName).collect(Collectors.toList()));
-                        u.setRoleIds(roles.stream().map(RoleEntity::getId).collect(Collectors.toList()));
-                    }
-                });
-            }
-
-            us.forEach(e -> {
-                e.setIdNum("");
-                e.setPassword("");
-                e.setBankCardNum("");
-                e.setBankName("");
-                e.setEducation("");
-                e.setAddress("");
-                e.setBirthday(null);
-                e.setEmail("");
-            });
-        }
-        page.setRecords(us);
-        return Result.ok(page);
-    }
-
-    @ApiOperation("删除人员数据")
-    @PostMapping("delete")
-    public Result delete(Long [] ids) {
-        if (ids == null || ids.length == 0) {
-            return Result.error("参数错误");
-        }
-        LambdaUpdateWrapper<UserEntity> update = new LambdaUpdateWrapper();
-        update.in(UserEntity::getId,Arrays.asList(ids));
-        update.set(UserEntity::getIsDelete,1);
-        userService.update(update);
-        return Result.ok();
-    }
-
-
-    @ApiOperation("标记冻结")
-    @PostMapping("markFreeze")
-    public Result markFreeze(Long [] ids,Integer isFreeze) {
-        if (ids == null || ids.length == 0) {
-            return Result.error("参数错误");
-        }
-        LambdaUpdateWrapper<UserEntity> update = new LambdaUpdateWrapper();
-        update.in(UserEntity::getId,Arrays.asList(ids));
-        update.set(UserEntity::getIsFreeze,isFreeze);
-        userService.update(update);
-        if(Integer.valueOf(0).equals(isFreeze)) {
-            userService.updateLastFollowUpTime(Arrays.asList(ids));
-        }
-        return Result.ok();
-    }
-
-
-    @ApiOperation("删除人员数据")
-    @PostMapping("deleteById")
-    public Result deleteById(Long id) {
-        if (id == null) {
-            return Result.error("参数错误");
-        }
-        LambdaUpdateWrapper<UserEntity> update = new LambdaUpdateWrapper();
-        update.eq(UserEntity::getId,id);
-        update.set(UserEntity::getIsDelete,1);
-        userService.update(update);
-        return Result.ok();
-    }
-
-    @ApiOperation("删除人员数据")
-    @PostMapping("updateRealName")
-    public Result deleteById(Long id,String realName) {
-        if (id == null) {
-            return Result.error("参数错误");
-        }
-        LambdaUpdateWrapper<UserEntity> update = new LambdaUpdateWrapper();
-        update.eq(UserEntity::getId,id);
-        update.set(UserEntity::getRealName,realName);
-        userService.update(update);
-        return Result.ok();
-    }
-
-
-    @ApiOperation("启用禁用员工")
-    @PostMapping("enable")
-    public Result setEnable(Long [] ids,Boolean enable) {
-        if (ids == null || ids.length == 0) {
-            return Result.error("参数错误");
-        }
-        LambdaUpdateWrapper<UserEntity> update = new LambdaUpdateWrapper();
-        update.in(UserEntity::getId,Arrays.asList(ids));
-        update.set(UserEntity::getEnabled,enable);
-        Boolean re =  userService.update(update);
-        if (re) {
-            return Result.ok();
-        } else {
-            return Result.error("操作失败");
-        }
-    }
-
-
-    @ApiOperation("根据ids查询用户")
-    @PostMapping("queryByIds")
-    public Result queryByIds(Long [] ids) {
-        if (ids == null || ids.length == 0) {
-            return Result.error("参数错误");
-        }
-        LambdaUpdateWrapper<UserEntity> query = new LambdaUpdateWrapper();
-        query.in(UserEntity::getId,Arrays.asList(ids));
-        List<UserEntity> list  =  userService.list(query);
-        return Result.ok(list);
-    }
-
-
-    @ApiOperation("同步OA数据")
-    @PostMapping("syncOa")
-    public Result syncOa() {
-        Result r = SystemSettingCacheCheckUtil.checkSyncOaDataMode();
-        if (!r.isSuccess()) {
-            return r;
-        }
-       userService.syncOa();
-       return Result.ok();
-    }
-
-    @ApiOperation("重置密码")
-    @PostMapping("resetPassword")
-    public Result resetPassword(Long userId) {
-        if  (Objects.isNull(userId)) {
-            return Result.error("参数错误");
-        }
-        String defaultPassWord = SystemConfigItemCacheUtil.getDefaultPassWord();
-        LambdaUpdateWrapper<UserEntity> update = new LambdaUpdateWrapper<UserEntity>();
-        update.eq(UserEntity::getId,userId);
-        update.set(UserEntity::getPassword,passwordEncoder.encode(defaultPassWord));
-        userService.update(update);
-        return Result.ok();
-    }
-
-    @ApiOperation("修改用户信息")
-    @PostMapping("updateUserInfo")
-    public Result setPhone(SetUserDetailDTO dto) {
-        Long userId = LoginUserUtil.getCurrentUserId();
-        if  (Objects.isNull(userId)) {
-            return Result.error("您未登录");
-        }
-        if  (StrUtil.isBlank(dto.getAvatar())) {
-            return Result.error("参数错误,头像url不能为空");
-        }
-        if  (StrUtil.isBlank(dto.getMobile())) {
-            return Result.error("参数错误,手机号不能为空");
-        }
-        UserEntity entity = userService.getById(userId);
-        if (Objects.isNull(entity)) {
-            return Result.error("未找到当前用户,请重新登录");
-        }
-        UserEntity oUser = userService.getOne(new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getMobile,dto.getMobile()).eq(UserEntity::getIsDelete,0).last("limit 1"));
-        if (Objects.nonNull(oUser)) {
-            if (!oUser.getId().equals(userId)) {
-                return Result.error("该手机'"+dto.getMobile()+"'号已被占用!");
-            }
-        }
-        if  (StrUtil.isNotBlank(dto.getEmail())) {
-            oUser = userService.getOne(new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getMobile,dto.getEmail()).eq(UserEntity::getIsDelete,0).last("limit 1"));
-            if (Objects.nonNull(oUser)) {
-                if (!oUser.getId().equals(userId)) {
-                    return Result.error("该邮箱'"+dto.getEmail()+"'已被占用!");
-                }
-            }
-        }
-        LambdaUpdateWrapper<UserEntity> update = new LambdaUpdateWrapper<>();
-        update.eq(UserEntity::getId, userId);
-
-        update.set(UserEntity::getAvatar, dto.getAvatar())
-              .set(UserEntity::getEmail, dto.getEmail())
-              .set(UserEntity::getNickName, dto.getNickName())
-              .set(UserEntity::getRealName, dto.getRealName())
-              .set(UserEntity::getMobile, dto.getMobile())
-              .set(UserEntity::getSex, dto.getSex())
-              .set(UserEntity::getBirthday, dto.getBirthday());
-
-        if (StrUtil.isNotBlank(dto.getJobDes())) {
-            update.set(UserEntity::getJobDes, dto.getJobDes());
-        }
-
-        try {
-            boolean result = userService.update(update);
-            if (!result) {
-                return Result.error("更新用户信息失败,请重试。");
-            }
-        } catch (Exception e) {
-            log.error("更新用户信息发生错误: {}", e.getMessage());
-            return Result.error("系统错误,更新用户信息失败。");
-        }
-
-        if (StrUtil.isNotBlank(dto.getDeptJobDes()) && Objects.nonNull(entity.getDeptId())) {
-            DeptEntity dept = departService.getById(entity.getDeptId());
-            if (!dto.getDeptJobDes().equals(dept.getDeptJobDes())) {
-                if (Integer.valueOf(0).equals(entity.getIsLeader())) {
-                    return Result.error("只有领导才能设置部门职责");
-                }
-                LambdaUpdateWrapper<DeptEntity> dUpdate = new LambdaUpdateWrapper<DeptEntity>();
-                dUpdate.eq(DeptEntity::getId,entity.getDeptId());
-                dUpdate.set(DeptEntity::getDeptJobDes,dto.getDeptJobDes());
-                departService.update(dUpdate);
-            }
-        }
-        return Result.ok();
-    }
-
-    @ApiOperation("获取用户基础信息")
-    @PostMapping("getSimpleUserInfo")
-    @ApiResponses({
-            @ApiResponse(code = 200, message = "", response = SetUserDetailVo.class)
-    })
-    public Result getSimpleUserInfo() {
-        Long userId = LoginUserUtil.getCurrentUserId();
-        if  (Objects.isNull(userId)) {
-            return Result.error("您未登录");
-        }
-        UserVo entity = userService.getUserInfoById(userId);
-
-        SetUserDetailVo detailVo = new SetUserDetailVo();
-        detailVo.setDeptId(entity.getDeptId());
-        detailVo.setId(entity.getId());
-        detailVo.setDeptName(entity.getDeptName());
-        detailVo.setAvatar(entity.getAvatar());
-        detailVo.setJobId(entity.getJobId());
-        detailVo.setJobName(entity.getJobName());
-        detailVo.setEmail(entity.getEmail());
-        detailVo.setMobile(entity.getMobile());
-        detailVo.setUserName(entity.getRealName());
-        detailVo.setJobDes(entity.getJobDes());
-        detailVo.setIsLeader(entity.getIsLeader());
-        DeptEntity dept = departService.getById(entity.getDeptId());
-        if (Objects.nonNull(dept)) {
-            detailVo.setDeptJobDes(dept.getDeptJobDes());
-        }
-        return Result.ok(detailVo);
-    }
-
-    public void updateManagerId(UserEntity user,Long oldManagerId){
-        if (Objects.isNull(user)) {
-            return;
-        }
-        if (Objects.isNull(user.getManagerId())) {
-            return;
-        }
-        List<UserEntity> userEntities = userService.list(new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getManagerId,user.getId()));
-        for (UserEntity userEntity : userEntities) {
-            if (StrUtil.isNotBlank(userEntity.getManagers())) {
-                String routeCodeStr = ","+userEntity.getManagers()+",";
-                routeCodeStr = routeCodeStr.replace(","+oldManagerId+",",","+userEntity.getManagerId()+",");
-                StringUtils.startsWithIgnoreCase(routeCodeStr,",");
-                StringUtils.endsWithIgnoreCase(routeCodeStr,",");
-
-                LambdaUpdateWrapper<UserEntity> updateWrapper = new LambdaUpdateWrapper();
-                updateWrapper.eq(UserEntity::getId,userEntity.getId());
-                updateWrapper.set(UserEntity::getManagers,routeCodeStr);
-                userService.update(updateWrapper);
-            }
-        }
-
-    }
-}

+ 0 - 125
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/system/UserController.java

@@ -1,125 +0,0 @@
-package com.storlead.sales.controller.system;
-
-
-import com.storlead.framework.util.LoginUserUtil;
-import com.storlead.framework.auth.vo.LoginUser;
-import com.storlead.framework.common.result.Result;
-import com.storlead.user.model.UserInfo;
-import com.storlead.user.model.UserQueryModel;
-import com.storlead.user.pojo.entity.UserEntity;
-import com.storlead.user.pojo.vo.WxUserVO;
-import com.storlead.user.service.IUserService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import lombok.extern.slf4j.Slf4j;
-import javax.annotation.Resource;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-/**
- * <p>
- * 用户表 前端控制器
- * </p>
- *
- * @Author scott
- * @since 2018-12-20
- */
-@Slf4j
-@RestController
-@RequestMapping("/lingcun/user")
-@Api(tags="5.公共接口")
-public class UserController {
-
-	@Resource
-	private IUserService sysUserService;
-
-	/**
-	 * 查询数据 查出所有部门,并以树结构数据格式响应给前端
-	 *
-	 * @return
-	 */
-	@RequestMapping(value = "/list", method = RequestMethod.GET)
-	@ApiOperation(value = "公共接口-用户信息-列表", notes = "公共接口-用户信息-列表")
-	@ApiResponses({
-			@ApiResponse(code = 200, message = "", response = UserInfo.class)
-	})
-	public Result<List<UserInfo>> queryTreeList(UserQueryModel userQueryModel) {
-		Result<List<UserInfo>> result = new Result<>();
-		try {
-			List<UserInfo> list = sysUserService.getUserListBySearch(userQueryModel);
-			result.setResult(list);
-			result.setSuccess(true);
-		} catch (Exception e) {
-			log.error(e.getMessage(),e);
-		}
-		return result;
-	}
-
-	 /***
-	  * @Description: 用户列表,按拼音首字母排序
-	  * @Param:
-	  * @return:
-	  * @Author: YPZ
-	  * @Date: 2023/3/16 11:54
-	  */
-	@RequestMapping(value = "/user-list-pinyin", method = RequestMethod.GET)
-	@ApiOperation(value = "公共接口-用户信息-列表(按拼音首字母排序)", notes = "公共接口-用户信息-列表(按拼音首字母排序)")
-	@ApiResponses({
-			@ApiResponse(code = 200, message = "", response = UserInfo.class)
-	})
-	public Result<List<WxUserVO>> userListPinyin(UserQueryModel userQueryModel) {
-		Result<List<WxUserVO>> result = new Result<>();
-		try {
-			List<WxUserVO> wxUserInfoList =sysUserService.getPingyinUserList(userQueryModel);
-			result.setResult(wxUserInfoList);
-			result.setSuccess(true);
-		} catch (Exception e) {
-			log.error(e.getMessage(),e);
-		}
-		return result;
-	}
-
-	@RequestMapping(value = "/list-subordinate", method = RequestMethod.GET)
-	@ApiOperation(value = "公共接口-下级用户信息-列表", notes = "公共接口-下级用户信息-列表")
-	@ApiResponses({
-			@ApiResponse(code = 200, message = "", response = UserInfo.class)
-	})
-	public Result<List<UserInfo>> listSubordinate(UserQueryModel userQueryModel) {
-		Result<List<UserInfo>> result = new Result<>();
-		try {
-			LoginUser loginUser = LoginUserUtil.getLoginUser();
-			List<UserInfo> list = sysUserService.getUserListBySearch(userQueryModel);
-			List<Long> allSubordinate = sysUserService.getAllSubordinate(loginUser.getId());
-			Set<Long> allSubordinateSet =new HashSet<>(allSubordinate);
-			list = list.stream().filter((u)->allSubordinateSet.contains(u.getId())).collect(Collectors.toList());
-			result.setResult(list);
-			result.setSuccess(true);
-		} catch (Exception e) {
-			log.error(e.getMessage(),e);
-		}
-		return result;
-	}
-
-	/**
-	 * 查询数据 查出所有部门,并以树结构数据格式响应给前端
-	 *
-	 * @return
-	 */
-	@GetMapping(value = "/findManager")
-	@ApiOperation(value = "公共接口-用户信息-查看当前用户领导", notes = "公共接口-用户信息-查看当前用户领导")
-	public Result findManager() {
-		LoginUser loginUser = LoginUserUtil.getLoginUser();
-		UserEntity user = sysUserService.getById(loginUser.getManagerId());
-		return Result.ok(user);
-	}
-
-}

+ 2 - 2
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/controller/task/TaskApiController.java

@@ -7,13 +7,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.gson.Gson;
 import com.storlead.framework.common.constant.CommonConstant;
+import com.storlead.framework.common.util.SpringCompareUtil;
 import com.storlead.framework.common.util.StringUtil;
 import com.storlead.framework.util.LoginUserUtil;
 import com.storlead.framework.common.result.Result;
-import com.storlead.framework.enums.QueryRangeTypeEnum;
 import com.storlead.framework.mybatis.entity.SysBaseField;
-import com.storlead.framework.utils.SpringCompareUtil;
 import com.storlead.message.enums.MessageTypeEnum;
+import com.storlead.sales.enums.QueryRangeTypeEnum;
 import com.storlead.sales.pojo.entity.customer.*;
 import com.storlead.sales.enums.ResourceTypeEnum;
 import com.storlead.sales.enums.TaskStatusEnum;

+ 0 - 3
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/pojo/dto/customer/BusinessSearchDTO.java

@@ -100,7 +100,4 @@ public class BusinessSearchDTO extends QueryBaseEntity {
 
     @ApiModelProperty(value = "搜索结束时间")
     private String endDate;
-
-    @ApiModelProperty(value = "归属分类(QueryRangeTypeEnum)(0全部客户、10:我的客户、20:我发起的、30:下属客户、40我协作的、50:下属协作的,70:重点)")
-    private Integer queryRangeType;
 }

+ 15 - 0
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/pojo/dto/customer/CompanyDTO.java

@@ -0,0 +1,15 @@
+package com.storlead.sales.pojo.dto.customer;
+
+import com.storlead.framework.common.dto.page.PageDTO;
+import lombok.Data;
+
+/**
+ * @program: storlead-saas-platform
+ * @description:
+ * @author: chenkq
+ * @create: 2026-05-19 11:37
+ */
+@Data
+public class CompanyDTO extends PageDTO {
+
+}

+ 1 - 1
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/service/impl/customer/CustomerServiceImpl.java

@@ -18,7 +18,7 @@ import com.storlead.framework.common.util.StringUtil;
 import com.storlead.framework.common.util.generate.CodeGenerate;
 import com.storlead.es.pojo.vo.EsGenericVO;
 import com.storlead.es.pojo.vo.EsQuerySimilarityVO;
-import com.storlead.es.server.EsSearchCustomerService;
+import com.storlead.es.service.EsSearchCustomerService;
 import com.storlead.framework.util.LoginUserUtil;
 import com.storlead.framework.auth.vo.LoginUser;
 import com.storlead.framework.common.result.Result;

+ 0 - 1
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/service/impl/systemrule/SystemRuleModuleConfigServiceImpl.java

@@ -13,7 +13,6 @@ import com.storlead.framework.common.constant.CommonConstant;
 import com.storlead.framework.common.result.Result;
 import com.storlead.framework.mybatis.entity.SysBaseField;
 import com.storlead.framework.mybatis.service.impl.MyBaseServiceImpl;
-import com.storlead.framework.thread.ThreadPoolUtil;
 import com.storlead.sales.pojo.entity.customer.*;
 import com.storlead.sales.pojo.vo.customer.CustomerAllVO;
 import com.storlead.sales.enums.ResourceTypeEnum;

+ 0 - 3
java/storlead-sasa/storlead-sales/src/main/java/com/storlead/sales/service/target/TargetQuotaService.java

@@ -4,10 +4,7 @@ import com.storlead.framework.common.result.Result;
 import com.storlead.sales.pojo.dto.target.TargetQuotaSearchDTO;
 import com.storlead.sales.pojo.dto.target.TargetRankingDTO;
 import com.storlead.sales.pojo.entity.target.TargetQuotaEntity;
-import com.storlead.framework.common.result.Result;
 import com.storlead.framework.mybatis.service.MyBaseService;
-import feign.Param;
-import org.apache.ibatis.annotations.Select;
 
 import java.util.List;
 

+ 1 - 1
java/storlead-sasa/storlead-sales/src/main/resources/mapper/DashboardSketchMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="com.storlead.sales.mapper.DashboardSketchMapper">
 
         <!-- 通用查询映射结果 -->
-        <resultMap id="BaseResultMap" type="com.storlead.sales.pojo.entity.report.DashboardSketchEntity" extends="com.storlead.frame.mapper.SysBaseFieldMapper.BaseResultMap">
+        <resultMap id="BaseResultMap" type="com.storlead.sales.pojo.entity.report.DashboardSketchEntity" extends="com.storlead.framework.mybatis.mapper.SysBaseFieldMapper.BaseResultMap">
                 <id column="id" property="id" />
                 <result column="organization_id" property="organizationId" />
                 <result column="organization_name" property="organizationName" />

+ 1 - 1
java/storlead-sasa/storlead-sales/src/main/resources/mapper/OrderInvoiceRecordMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="com.storlead.sales.mapper.finance.OrderInvoiceRecordMapper">
 
         <!-- 通用查询映射结果 -->
-        <resultMap id="BaseResultMap" type="com.storlead.sales.pojo.entity.finance.OrderInvoiceRecordEntity" extends="com.storlead.frame.mapper.SysBaseFieldMapper.BaseResultMap">
+        <resultMap id="BaseResultMap" type="com.storlead.sales.pojo.entity.finance.OrderInvoiceRecordEntity" extends="com.storlead.framework.mybatis.mapper.SysBaseFieldMapper.BaseResultMap">
             <id column="id" property="id" />
             <result column="invoicing_date" property="invoicingDate" />
             <result column="invoice_amount" property="invoiceAmount" />

+ 1 - 1
java/storlead-sasa/storlead-sales/src/main/resources/mapper/OrderRefundRecordMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="com.storlead.sales.mapper.finance.OrderRefundRecordMapper">
 
         <!-- 通用查询映射结果 -->
-        <resultMap id="BaseResultMap" type="com.storlead.sales.pojo.entity.finance.OrderRefundRecordEntity" extends="com.storlead.frame.mapper.SysBaseFieldMapper.BaseResultMap">
+        <resultMap id="BaseResultMap" type="com.storlead.sales.pojo.entity.finance.OrderRefundRecordEntity" extends="com.storlead.framework.mybatis.mapper.SysBaseFieldMapper.BaseResultMap">
             <id column="id" property="id" />
             <result column="refund_code" property="refundCode" />
             <result column="refund_amount" property="refundAmount" />

+ 2 - 2
java/storlead-sasa/storlead-sales/src/main/resources/mapper/ReimburseBillRecordMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="com.storlead.sales.mapper.finance.ReimburseBillRecordMapper">
 
         <!-- 通用查询映射结果 -->
-        <resultMap id="BaseResultMap" type="com.storlead.sales.pojo.entity.finance.ReimburseBillRecordEntity" extends="com.storlead.frame.mapper.SysBaseFieldMapper.BaseResultMap">
+        <resultMap id="BaseResultMap" type="com.storlead.sales.pojo.entity.finance.ReimburseBillRecordEntity" extends="com.storlead.framework.mybatis.mapper.SysBaseFieldMapper.BaseResultMap">
                     <id column="id" property="id" />
                     <result column="data_code" property="dataCode" />
                     <result column="reimburse_amount" property="reimburseAmount" />
@@ -15,7 +15,7 @@
 
         <!-- 通用查询结果列 -->
         <sql id="Base_Column_List">
-            id, data_code, reimburse_amount, reimburse_user_id, reimburse_dept_id, approve_status, remark,<include refid="com.storlead.frame.mapper.SysBaseFieldMapper.Base_Column_List"></include>
+            id, data_code, reimburse_amount, reimburse_user_id, reimburse_dept_id, approve_status, remark,<include refid="com.storlead.framework.mybatis.mapper.SysBaseFieldMapper.Base_Column_List"></include>
         </sql>
 
 </mapper>

+ 2 - 2
java/storlead-sasa/storlead-sales/src/main/resources/mapper/ReimburseCostBillRecordMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="com.storlead.sales.mapper.finance.ReimburseCostBillRecordMapper">
 
         <!-- 通用查询映射结果 -->
-        <resultMap id="BaseResultMap" type="com.storlead.sales.pojo.entity.finance.ReimburseCostBillRecordEntity" extends="com.storlead.frame.mapper.SysBaseFieldMapper.BaseResultMap">
+        <resultMap id="BaseResultMap" type="com.storlead.sales.pojo.entity.finance.ReimburseCostBillRecordEntity" extends="com.storlead.framework.mybatis.mapper.SysBaseFieldMapper.BaseResultMap">
                     <id column="id" property="id" />
 
                     <result column="reimburse_id" property="reimburseId" />
@@ -12,7 +12,7 @@
 
         <!-- 通用查询结果列 -->
         <sql id="Base_Column_List">
-            id, reimburse_id, cost_id,<include refid="com.storlead.frame.mapper.SysBaseFieldMapper.Base_Column_List"></include>
+            id, reimburse_id, cost_id,<include refid="com.storlead.framework.mybatis.mapper.SysBaseFieldMapper.Base_Column_List"></include>
         </sql>
 
 </mapper>

+ 2 - 2
java/storlead-sasa/storlead-sales/src/main/resources/mapper/TaskMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="com.storlead.sales.mapper.task.TaskMapper">
 
         <!-- 通用查询映射结果 -->
-        <resultMap id="BaseResultMap" extends="com.storlead.frame.mapper.SysBaseFieldMapper.BaseResultMap"  type="com.storlead.sales.pojo.entity.task.TaskEntity">
+        <resultMap id="BaseResultMap" extends="com.storlead.framework.mybatis.mapper.SysBaseFieldMapper.BaseResultMap"  type="com.storlead.sales.pojo.entity.task.TaskEntity">
             <id column="id" property="id" />
             <result column="task_begin_time" property="taskBeginTime" />
             <result column="task_content" property="taskContent" />
@@ -25,7 +25,7 @@
 
         <!-- 通用查询结果列 -->
         <sql id="Base_Column_List">
-            id, task_begin_time,out_time_remind,task_content, customer_id, resource_type, resource_type_id, cooperate_by, priority_grade, mark_tag, task_status, operator_by, operator_time, remark, remind_type,remind_time, remind_mode, <include refid="com.storlead.frame.mapper.SysBaseFieldMapper.Base_Column_List"></include>
+            id, task_begin_time,out_time_remind,task_content, customer_id, resource_type, resource_type_id, cooperate_by, priority_grade, mark_tag, task_status, operator_by, operator_time, remark, remind_type,remind_time, remind_mode, <include refid="com.storlead.framework.mybatis.mapper.SysBaseFieldMapper.Base_Column_List"></include>
         </sql>
 
     <select id="selectNameById" resultType="string">

+ 1 - 1
java/storlead-sasa/storlead-sales/src/main/resources/mapper/customer/CustomerCompanyMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="com.storlead.sales.mapper.customer.CustomerCompanyMapper">
 
         <!-- 通用查询映射结果 -->
-        <resultMap id="BaseResultMap" type="com.storlead.sales.pojo.entity.customer.CustomerCompanyEntity" extends="com.storlead.frame.mapper.SysBaseFieldMapper.BaseResultMap">
+        <resultMap id="BaseResultMap" type="com.storlead.sales.pojo.entity.customer.CustomerCompanyEntity" extends="com.storlead.framework.mybatis.mapper.SysBaseFieldMapper.BaseResultMap">
             <id column="id" property="id" />
             <result column="customer_id" property="customerId" />
             <result column="name" property="name" />

+ 1 - 1
java/storlead-sasa/storlead-sales/src/main/resources/mapper/customer/CustomerMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="com.storlead.sales.mapper.customer.CustomerMapper">
 
         <!-- 通用查询映射结果 -->
-        <resultMap id="BaseResultMap" type="com.storlead.sales.pojo.entity.customer.CustomerEntity" extends="com.storlead.frame.mapper.SysBaseFieldMapper.BaseResultMap">
+        <resultMap id="BaseResultMap" type="com.storlead.sales.pojo.entity.customer.CustomerEntity" extends="com.storlead.framework.mybatis.mapper.SysBaseFieldMapper.BaseResultMap">
             <result column="id" property="id" />
             <result column="customer_form" property="customerForm" />
             <result column="has_from_clue" property="hasFromClue" />

+ 1 - 1
java/storlead-sasa/storlead-sales/src/main/resources/mapper/customer/LiaisonMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="com.storlead.sales.mapper.customer.LiaisonMapper">
 
         <!-- 通用查询映射结果 -->
-        <resultMap id="BaseResultMap" type="com.storlead.sales.pojo.entity.customer.LiaisonEntity" extends="com.storlead.frame.mapper.SysBaseFieldMapper.BaseResultMap">
+        <resultMap id="BaseResultMap" type="com.storlead.sales.pojo.entity.customer.LiaisonEntity" extends="com.storlead.framework.mybatis.mapper.SysBaseFieldMapper.BaseResultMap">
             <id column="id" property="id" />
             <result column="customer_id" property="customerId" />
             <result column="has_primary_lialison" property="hasPrimaryLialison" />

+ 2 - 2
java/storlead-sasa/storlead-sales/src/main/resources/mapper/systemrule/SystemRuleModuleConfigMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="com.storlead.sales.mapper.systemrule.SystemRuleModuleConfigMapper">
 
         <!-- 通用查询映射结果 -->
-        <resultMap id="BaseResultMap" extends="com.storlead.frame.mapper.SysBaseFieldMapper.BaseResultMap"  type="com.storlead.sales.pojo.entity.systemrule.SystemRuleModuleConfigEntity">
+        <resultMap id="BaseResultMap" extends="com.storlead.framework.mybatis.mapper.SysBaseFieldMapper.BaseResultMap"  type="com.storlead.sales.pojo.entity.systemrule.SystemRuleModuleConfigEntity">
             <id column="id" property="id" />
             <result column="update_explain" property="updateExplain" />
             <result column="service_code" property="serviceCode" />
@@ -24,7 +24,7 @@
 
         <!-- 通用查询结果列 -->
         <sql id="Base_Column_List">
-            id,service_code, update_explain, has_max_member, max_member_num, has_public_clues, has_distinguish_key_regular, regular_follow_date, key_follow_date, regular_transaction_date, key_transaction_date, max_public_clues_num, has_clear_clues, max_clear_clues_num, has_plagiarism_rules, plagiarism_rules,<include refid="com.storlead.frame.mapper.SysBaseFieldMapper.Base_Column_List"></include>
+            id,service_code, update_explain, has_max_member, max_member_num, has_public_clues, has_distinguish_key_regular, regular_follow_date, key_follow_date, regular_transaction_date, key_transaction_date, max_public_clues_num, has_clear_clues, max_clear_clues_num, has_plagiarism_rules, plagiarism_rules,<include refid="com.storlead.framework.mybatis.mapper.SysBaseFieldMapper.Base_Column_List"></include>
         </sql>
 
 </mapper>

+ 10 - 0
java/storlead-sasa/storlead-sales/src/main/resources/ssd-sku-dev.properties

@@ -0,0 +1,10 @@
+#\u4E2D\u56FD\u542B\u7A0E\u5229\u7387
+zhCNTaxPriceRate=0.13
+#\u7269\u7406\u9500\u6BC1\u9700\u8981\u7684\u5929\u6570
+physicalDestroyDays=1
+#\u903B\u8F91\u9500\u6BC1\u9700\u8981\u7684\u5929\u6570
+logicDestroyDays=1
+#aes \u52A0\u5BC6\u9700\u8981\u5929\u6570
+aesEncryptDays=1
+#rapidBackup\u9700\u8981\u5929\u6570
+rapidBackupDays=1

+ 10 - 0
java/storlead-sasa/storlead-sales/src/main/resources/ssd-sku-prod.properties

@@ -0,0 +1,10 @@
+#\u4E2D\u56FD\u542B\u7A0E\u5229\u7387
+zhCNTaxPriceRate=0.13
+#\u7269\u7406\u9500\u6BC1\u9700\u8981\u7684\u5929\u6570
+physicalDestroyDays=1
+#\u903B\u8F91\u9500\u6BC1\u9700\u8981\u7684\u5929\u6570
+logicDestroyDays=1
+#aes \u52A0\u5BC6\u9700\u8981\u5929\u6570
+aesEncryptDays=1
+#rapidBackup\u9700\u8981\u5929\u6570
+rapidBackupDays=1

+ 10 - 0
java/storlead-sasa/storlead-sales/src/main/resources/ssd-sku-test.properties

@@ -0,0 +1,10 @@
+#\u4E2D\u56FD\u542B\u7A0E\u5229\u7387
+zhCNTaxPriceRate=0.13
+#\u7269\u7406\u9500\u6BC1\u9700\u8981\u7684\u5929\u6570
+physicalDestroyDays=1
+#\u903B\u8F91\u9500\u6BC1\u9700\u8981\u7684\u5929\u6570
+logicDestroyDays=1
+#aes \u52A0\u5BC6\u9700\u8981\u5929\u6570
+aesEncryptDays=1
+#rapidBackup\u9700\u8981\u5929\u6570
+rapidBackupDays=1

+ 8 - 2
pom.xml

@@ -193,13 +193,13 @@
 
         <dependency>
             <groupId>com.storlead.boot</groupId>
-            <artifactId>storlead-es-api</artifactId>
+            <artifactId>storlead-es-core</artifactId>
             <version>${revision}</version>
         </dependency>
 
         <dependency>
             <groupId>com.storlead.boot</groupId>
-            <artifactId>storlead-es-core</artifactId>
+            <artifactId>storlead-es-spi</artifactId>
             <version>${revision}</version>
         </dependency>
 
@@ -209,6 +209,12 @@
             <version>${revision}</version>
         </dependency>
 
+        <dependency>
+            <groupId>com.storlead.boot</groupId>
+            <artifactId>storlead-es-api</artifactId>
+            <version>${revision}</version>
+        </dependency>
+
         <dependency>
             <groupId>com.storlead.boot</groupId>
             <artifactId>storlead-sms</artifactId>