liangpeile 1 年之前
當前提交
fd0ecba366
共有 100 個文件被更改,包括 8464 次插入0 次删除
  1. 43 0
      .gitignore
  2. 136 0
      crmeb-admin/pom.xml
  3. 30 0
      crmeb-admin/src/main/java/com/zbkj/admin/CrmebAdminApplication.java
  4. 45 0
      crmeb-admin/src/main/java/com/zbkj/admin/aspect/ControllerAspect.java
  5. 139 0
      crmeb-admin/src/main/java/com/zbkj/admin/aspect/SensitiveLogAspect.java
  6. 29 0
      crmeb-admin/src/main/java/com/zbkj/admin/config/CorsConfig.java
  7. 47 0
      crmeb-admin/src/main/java/com/zbkj/admin/config/DruidConfig.java
  8. 28 0
      crmeb-admin/src/main/java/com/zbkj/admin/config/JacksonConfig.java
  9. 47 0
      crmeb-admin/src/main/java/com/zbkj/admin/config/RestTemplateConfig.java
  10. 28 0
      crmeb-admin/src/main/java/com/zbkj/admin/config/SchedulerConfig.java
  11. 148 0
      crmeb-admin/src/main/java/com/zbkj/admin/config/SwaggerConfig.java
  12. 97 0
      crmeb-admin/src/main/java/com/zbkj/admin/config/TaskExecutorConfig.java
  13. 33 0
      crmeb-admin/src/main/java/com/zbkj/admin/config/TaskSchedulerConfig.java
  14. 90 0
      crmeb-admin/src/main/java/com/zbkj/admin/config/WebConfig.java
  15. 147 0
      crmeb-admin/src/main/java/com/zbkj/admin/config/WebSecurityConfig.java
  16. 85 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/QuickStart.java
  17. 100 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantAdminController.java
  18. 75 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantAttachmentController.java
  19. 125 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantBaseCategoryController.java
  20. 47 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantCityRegionController.java
  21. 49 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantConfigController.java
  22. 35 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantCopyrightController.java
  23. 107 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantCouponController.java
  24. 44 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantCouponUserController.java
  25. 52 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantExpressController.java
  26. 96 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantFinanceController.java
  27. 40 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantFormTempController.java
  28. 63 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantHomeController.java
  29. 92 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantInfoController.java
  30. 38 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantLogController.java
  31. 84 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantLoginController.java
  32. 43 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantMenuController.java
  33. 129 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantOrderController.java
  34. 95 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantProductCategoryController.java
  35. 226 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantProductController.java
  36. 73 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantProductGuaranteeGroupController.java
  37. 73 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantProductReplyController.java
  38. 88 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantProductRuleController.java
  39. 97 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantRoleController.java
  40. 125 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantSeckillController.java
  41. 66 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantUploadController.java
  42. 50 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantUserController.java
  43. 447 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/NewMerchantApi.java
  44. 54 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/PayComponentCatMerchantController.java
  45. 54 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/PayComponentDeliveryCompanyMerchantController.java
  46. 108 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/PayComponentDraftMerchantProductController.java
  47. 100 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/PayComponentProductMerchantController.java
  48. 72 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/PayComponentShopMerchantController.java
  49. 51 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/PlatProductBrandController.java
  50. 40 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/PlatProductCategoryController.java
  51. 43 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/PlatProductGuaranteeController.java
  52. 93 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/RefundOrderController.java
  53. 85 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/ShippingTemplatesController.java
  54. 28 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/newapi/request/AuthenticationRequest.java
  55. 28 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/newapi/request/AuthenticationSearchRequest.java
  56. 26 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/newapi/request/BoundShopRequest.java
  57. 26 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/newapi/request/ProductAttrValueIntegralRequest.java
  58. 118 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/newapi/request/ProductIntegralAddRequest.java
  59. 44 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/newapi/request/ProductIntegralSearchRequest.java
  60. 23 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/newapi/request/SetLineOfCreditRequest.java
  61. 27 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/newapi/request/UserEnterpriseSearchRequest.java
  62. 138 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/ActivityStyleController.java
  63. 190 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/AgreementController.java
  64. 89 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/ArticleCategoryController.java
  65. 103 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/ArticleController.java
  66. 79 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/CityRegionController.java
  67. 48 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/CopyrightController.java
  68. 88 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/ExpressController.java
  69. 162 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/FinanceController.java
  70. 64 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/HomeController.java
  71. 55 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/IntegralController.java
  72. 66 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/MerchantApplyController.java
  73. 82 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/MerchantCategoryController.java
  74. 152 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/MerchantController.java
  75. 82 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/MerchantTypeController.java
  76. 472 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/NewPlatformApi.java
  77. 139 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/OnePassController.java
  78. 57 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/OnePassSmsController.java
  79. 115 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PageLayoutController.java
  80. 41 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PayComponentBrandController.java
  81. 72 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PayComponentCatController.java
  82. 54 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PayComponentDeliveryCompanyController.java
  83. 109 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PayComponentDraftProductController.java
  84. 26 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PayComponentProductAuditInfoController.java
  85. 112 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PayComponentProductController.java
  86. 26 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PayComponentProductInfoController.java
  87. 27 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PayComponentProductSkuAttrController.java
  88. 27 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PayComponentProductSkuController.java
  89. 80 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PayComponentRegisterController.java
  90. 103 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PayComponentShopController.java
  91. 100 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PlatformAdminController.java
  92. 71 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PlatformAttachmentController.java
  93. 124 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PlatformBaseCategoryController.java
  94. 41 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PlatformLogController.java
  95. 84 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PlatformLoginController.java
  96. 102 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PlatformMenuController.java
  97. 93 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PlatformMerchantMenuController.java
  98. 73 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PlatformOrderController.java
  99. 70 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PlatformRefundOrderController.java
  100. 97 0
      crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PlatformRoleController.java

+ 43 - 0
.gitignore

@@ -0,0 +1,43 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**
+!**/src/test/**
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+
+### VS Code ###
+.vscode/
+/crmeb_log/log_debug.log
+/crmeb_log/log_error.log
+/crmeb_log/log_info.log
+/crmeb_log/log_warn.log
+/crmeb_log/
+/.idea/
+src/main/java/com/zbkj/.DS_Store
+src/main/java/com/.DS_Store
+src/main/java/.DS_Store
+src/main/.DS_Store
+.DS_Store
+/crmebimage/

+ 136 - 0
crmeb-admin/pom.xml

@@ -0,0 +1,136 @@
+<?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">
+    <parent>
+        <artifactId>crmeb</artifactId>
+        <groupId>com.zbkj</groupId>
+        <version>0.0.1-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>crmeb-admin</artifactId>
+    <packaging>jar</packaging>
+
+    <properties>
+        <crmeb-service>0.0.1-SNAPSHOT</crmeb-service>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.github.wechatpay-apiv3</groupId>
+            <artifactId>wechatpay-java</artifactId>
+            <version>0.2.8</version>
+        </dependency>
+
+        <!-- https://mvnrepository.com/artifact/com.github.binarywang/weixin-java-pay -->
+        <!--        <dependency>-->
+        <!--            <groupId>com.github.binarywang</groupId>-->
+        <!--            <artifactId>weixin-java-pay</artifactId>-->
+        <!--            <version>4.1.0</version>-->
+        <!--        </dependency>-->
+
+        <!--        <dependency>-->
+        <!--            <groupId>com.github.wxpay</groupId>-->
+        <!--            <artifactId>wxpay-sdk</artifactId>-->
+        <!--            <version>0.0.3</version>-->
+        <!--        </dependency>-->
+
+        <dependency>
+            <groupId>com.google.zxing</groupId>
+            <artifactId>core</artifactId>
+            <version>3.4.1</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.zxing</groupId>
+            <artifactId>javase</artifactId>
+            <version>3.4.1</version>
+        </dependency>
+        <dependency>
+            <groupId>com.zbkj</groupId>
+            <artifactId>crmeb-service</artifactId>
+            <version>${crmeb-service}</version>
+        </dependency>
+        <!--quartz定时调度依赖-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-quartz</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <!--添加本地加密jar包 不可删除-->
+        <dependency>
+            <groupId>crmeb-encrypt</groupId>
+            <artifactId>crmeb.encrypt</artifactId>
+            <version>1.0</version>
+            <scope>system</scope>
+            <systemPath>${basedir}/src/main/resources/libs/CRMEB-encrypt-1.0-SNAPSHOT-encrypted.jar</systemPath>
+        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>com.zbkj</groupId>-->
+<!--            <artifactId>crmeb-front</artifactId>-->
+<!--            <version>0.0.1-SNAPSHOT</version>-->
+<!--            <scope>compile</scope>-->
+<!--        </dependency>-->
+    </dependencies>
+
+    <build>
+        <!--打包配置-->
+        <finalName>Crmeb-admin</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>2.3.0.RELEASE</version>
+<!--                正确打包本地加密jar包,不可删除-->
+                <configuration>
+                    <jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
+                    <fork>true</fork>
+                    <includeSystemScope>true</includeSystemScope>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal><!--可以把依赖的包都打包到生成的Jar包中-->
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+
+        <resources>
+            <!--            <resource>-->
+            <!--                <directory>src/main/resources</directory>-->
+            <!--                &lt;!&ndash; 处理文件时替换文件中的变量 &ndash;&gt;-->
+            <!--                <filtering>true</filtering>-->
+            <!--                <excludes>-->
+            <!--                    &lt;!&ndash; 打包时排除文件 &ndash;&gt;-->
+            <!--&lt;!&ndash;                    <exclude>application.yml</exclude>&ndash;&gt;-->
+            <!--                    <exclude>application-{profile}.yml</exclude>-->
+            <!--&lt;!&ndash;                    <exclude>application-beta.yml</exclude>&ndash;&gt;-->
+            <!--&lt;!&ndash;                    <exclude>application-prod.yml</exclude>&ndash;&gt;-->
+            <!--                </excludes>-->
+            <!--            </resource>-->
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+            </resource>
+            <!--            <resource>-->
+            <!--                <directory>src/main/resources.${spring.profiles.active}</directory>-->
+            <!--                <filtering>false</filtering>-->
+            <!--            </resource>-->
+            <!--这个元素描述了项目相关的所有资源路径列表,例如和项目相关的属性文件,这些资源被包含在最终的打包文件里。-->
+            <resource>
+                <!--   描述存放资源的目录,该路径相对POM路径-->
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**/*.xml</include>
+                </includes>
+            </resource>
+        </resources>
+    </build>
+
+</project>

+ 30 - 0
crmeb-admin/src/main/java/com/zbkj/admin/CrmebAdminApplication.java

@@ -0,0 +1,30 @@
+package com.zbkj.admin;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+/**
+ * 程序主入口
+
+ */
+@EnableAsync //开启异步调用
+@EnableSwagger2
+@Configuration
+@EnableTransactionManagement
+@SpringBootApplication(exclude = DataSourceAutoConfiguration.class) //去掉数据源
+@ComponentScan(basePackages = {"com.zbkj"})
+@MapperScan(basePackages = {"com.zbkj.**.dao"})
+public class CrmebAdminApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(CrmebAdminApplication.class, args);
+    }
+
+}

+ 45 - 0
crmeb-admin/src/main/java/com/zbkj/admin/aspect/ControllerAspect.java

@@ -0,0 +1,45 @@
+package com.zbkj.admin.aspect;
+
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+import java.util.Arrays;
+
+
+/**
+
+ * 所有的前端controller层的拦截业务,方法的执行时间长度,
+ */
+@Aspect
+@Component
+public class ControllerAspect {
+
+    Logger logger = LoggerFactory.getLogger(ControllerAspect.class);
+
+    @Pointcut("execution(* com.zbkj.admin.controller.*.*(..))")
+    private void pointCutMethodController() {
+
+    }
+
+    @Around("pointCutMethodController()")
+    public Object doAroundService(ProceedingJoinPoint pjp) throws Throwable {
+
+        long begin = System.nanoTime();
+
+        Object obj = pjp.proceed();
+
+        long end = System.nanoTime();
+
+        logger.info("Controller method:{},prams:{},cost time:{} ns,cost:{} ms",
+
+                pjp.getSignature().toString(), Arrays.toString(pjp.getArgs()), (end - begin), (end - begin) / 1000000);
+
+        return obj;
+    }
+
+}

+ 139 - 0
crmeb-admin/src/main/java/com/zbkj/admin/aspect/SensitiveLogAspect.java

@@ -0,0 +1,139 @@
+package com.zbkj.admin.aspect;
+
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.extra.servlet.ServletUtil;
+import com.alibaba.fastjson.JSON;
+import com.zbkj.admin.filter.TokenComponent;
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.admin.service.ActionService;
+import com.zbkj.common.model.record.SensitiveMethodLog;
+import com.zbkj.common.utils.SpringUtil;
+import com.zbkj.common.vo.LoginUserVo;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.Signature;
+import org.aspectj.lang.annotation.AfterReturning;
+import org.aspectj.lang.annotation.AfterThrowing;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.servlet.HandlerMapping;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * 敏感操作日志记录Aop
+
+ */
+@Aspect
+@Component
+public class SensitiveLogAspect {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(SensitiveLogAspect.class);
+
+    @Resource
+    private ActionService actionService;
+
+    @Pointcut("@annotation(com.zbkj.common.annotation.LogControllerAnnotation)")
+    public void controllerAspect() {
+    }
+
+    /**
+     * 处理完请求后执行
+     *
+     * @param joinPoint            切点
+     * @param logServiceAnnotation 注解
+     */
+    @AfterReturning(pointcut = "controllerAspect() && @annotation(logServiceAnnotation)", returning = "jsonResult")
+    public void doAfterReturning(JoinPoint joinPoint, LogControllerAnnotation logServiceAnnotation, Object jsonResult) {
+        addLog(joinPoint, logServiceAnnotation, jsonResult, null);
+    }
+
+    /**
+     * 拦截异常操作
+     *
+     * @param joinPoint            切点
+     * @param logServiceAnnotation 注解
+     * @param e                    异常
+     */
+    @AfterThrowing(pointcut = "controllerAspect() && @annotation(logServiceAnnotation)", throwing = "e")
+    public void doAfterThrowing(JoinPoint joinPoint, LogControllerAnnotation logServiceAnnotation, Exception e) {
+        addLog(joinPoint, logServiceAnnotation, null, e);
+    }
+
+    private void addLog(JoinPoint joinPoint, LogControllerAnnotation logServiceAnnotation, Object jsonResult, Exception e) {
+        if (!logServiceAnnotation.intoDB()) {
+            return;
+        }
+
+        HttpServletRequest request = ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest();
+        // 获取当前用户
+        LoginUserVo loginUser = SpringUtil.getBean(TokenComponent.class).getLoginUser(request);
+        Signature signature = joinPoint.getSignature();
+
+        SensitiveMethodLog methodLog = new SensitiveMethodLog();
+        methodLog.setAdminId(loginUser.getUser().getId());
+        methodLog.setMerId(loginUser.getUser().getMerId());
+        methodLog.setAdminAccount(loginUser.getUser().getAccount());
+        methodLog.setDescription(logServiceAnnotation.description());
+        methodLog.setMethodType(logServiceAnnotation.methodType().getName());
+        methodLog.setMethod(signature.getDeclaringTypeName() + "." + signature.getName() + "()");
+        methodLog.setRequestMethod(request.getMethod());
+        methodLog.setUrl(request.getRequestURI());
+        methodLog.setIp(ServletUtil.getClientIP(request));
+        String requestValue = getRequestValue(joinPoint, request.getMethod(), request);
+        methodLog.setRequestParam(requestValue);
+        if (jsonResult != null) {
+            methodLog.setResult(StrUtil.sub(JSON.toJSONString(jsonResult), 0, 2000));
+        }
+        methodLog.setStatus(0);
+        if (e != null) {
+            methodLog.setStatus(1);
+            methodLog.setErrorMsg(StrUtil.sub(e.getMessage(), 0, 2000));
+        }
+        actionService.addSensitiveLog(methodLog);
+    }
+
+    private String getRequestValue(JoinPoint joinPoint, String requestMethod, HttpServletRequest request) {
+        if (requestMethod.equals("PUT") || requestMethod.equals("POST")) {
+            return StrUtil.sub(argsArrayToString(joinPoint.getArgs()), 0, 2000);
+        } else {
+            Map<?, ?> paramsMap = (Map<?, ?>) request.getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE);
+            return StrUtil.sub(paramsMap.toString(), 0, 2000);
+        }
+    }
+
+    /**
+     * 参数拼装
+     */
+    private String argsArrayToString(Object[] paramsArray) {
+        StringBuilder params = new StringBuilder();
+        if (paramsArray != null && paramsArray.length > 0) {
+            for (Object o : paramsArray) {
+                if (!isFilterObject(o)) {
+                    Object jsonObj = JSON.toJSON(o);
+                    params.append(jsonObj.toString()).append(" ");
+                }
+            }
+        }
+        return params.toString().trim();
+    }
+
+    /**
+     * 判断是否需要过滤的对象。
+     *
+     * @param o 对象信息。
+     * @return 如果是需要过滤的对象,则返回true;否则返回false。
+     */
+    public boolean isFilterObject(final Object o) {
+        return o instanceof MultipartFile || o instanceof HttpServletRequest || o instanceof HttpServletResponse;
+    }
+}

+ 29 - 0
crmeb-admin/src/main/java/com/zbkj/admin/config/CorsConfig.java

@@ -0,0 +1,29 @@
+package com.zbkj.admin.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.cors.CorsConfiguration;
+import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
+import org.springframework.web.filter.CorsFilter;
+
+/**
+ * 跨域配置
+
+ */
+@Configuration
+public class CorsConfig {
+    private CorsConfiguration buildConfig() {
+        CorsConfiguration corsConfiguration = new CorsConfiguration();
+        corsConfiguration.addAllowedOrigin("*"); //允许任何域名
+        corsConfiguration.addAllowedHeader("*"); //允许任何头
+        corsConfiguration.addAllowedMethod("*"); //允许任何方法
+        return corsConfiguration;
+    }
+
+    @Bean
+    public CorsFilter corsFilter() {
+        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
+        source.registerCorsConfiguration("/**", buildConfig()); //注册
+        return new CorsFilter(source);
+    }
+}

+ 47 - 0
crmeb-admin/src/main/java/com/zbkj/admin/config/DruidConfig.java

@@ -0,0 +1,47 @@
+package com.zbkj.admin.config;
+
+import com.alibaba.druid.pool.DruidDataSource;
+import com.alibaba.druid.support.http.StatViewServlet;
+import com.alibaba.druid.support.http.WebStatFilter;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.boot.web.servlet.FilterRegistrationBean;
+import org.springframework.boot.web.servlet.ServletRegistrationBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import javax.sql.DataSource;
+
+/**
+ * Druid配置组件
+
+ */
+@Configuration
+public class DruidConfig {
+
+    @Bean
+    public ServletRegistrationBean druidServlet() { // 主要实现WEB监控的配置处理
+        ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(new StatViewServlet(), "/druid/*"); // 进行druid监控的配置处理操作
+        servletRegistrationBean.addInitParameter("loginUsername", "kf"); // 用户名
+        servletRegistrationBean.addInitParameter("loginPassword", "654321"); // 密码
+        servletRegistrationBean.addInitParameter("resetEnable", "true"); // 是否可以重置数据源
+        return servletRegistrationBean;
+    }
+
+    @Bean
+    public FilterRegistrationBean filterRegistrationBean() {
+        FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
+        filterRegistrationBean.setFilter(new WebStatFilter());
+
+        filterRegistrationBean.addUrlPatterns("/*"); // 所有请求进行监控处理
+        //不必监控的请求
+        filterRegistrationBean.addInitParameter("exclusions", "*.html,*.png,*.ico,*.js,*.gif,*.jpg,*.css,/druid/*");
+        return filterRegistrationBean;
+    }
+
+    @Bean("dataSource")
+    @ConfigurationProperties(prefix = "spring.datasource")
+    public DataSource druidDataSource() {
+        return new DruidDataSource();
+    }
+}
+

+ 28 - 0
crmeb-admin/src/main/java/com/zbkj/admin/config/JacksonConfig.java

@@ -0,0 +1,28 @@
+package com.zbkj.admin.config;
+
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import java.math.BigDecimal;
+
+/**
+ * Jackjson配置组件
+
+ */
+@Configuration
+public class JacksonConfig {
+
+    /**
+     * Jackson全局转化BigDecimal类型为String,解决jackson序列化时BigDecimal类型缺失精度问题
+     *
+     * @return Jackson2ObjectMapperBuilderCustomizer 注入的对象
+     */
+    @Bean
+    public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilderCustomizer() {
+
+        return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.serializerByType(BigDecimal.class, ToStringSerializer.instance);
+    }
+
+}

+ 47 - 0
crmeb-admin/src/main/java/com/zbkj/admin/config/RestTemplateConfig.java

@@ -0,0 +1,47 @@
+package com.zbkj.admin.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.MediaType;
+import org.springframework.http.client.ClientHttpRequestFactory;
+import org.springframework.http.client.SimpleClientHttpRequestFactory;
+import org.springframework.http.converter.StringHttpMessageConverter;
+import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
+import org.springframework.web.client.RestTemplate;
+
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * RestTemplate配置组件
+
+ */
+@Configuration
+public class RestTemplateConfig {
+    @Bean
+    public RestTemplate restTemplate(ClientHttpRequestFactory factory) {
+        RestTemplate restTemplate = new RestTemplate(factory);
+        restTemplate.getMessageConverters().set(1, new StringHttpMessageConverter(StandardCharsets.UTF_8));
+        restTemplate.getMessageConverters().add(new WxMappingJackson2HttpMessageConverter());
+        return restTemplate;
+    }
+
+    @Bean
+    public ClientHttpRequestFactory httpRequestFactory() {
+        SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
+        factory.setReadTimeout(10000);//ms
+        factory.setConnectTimeout(15000);//ms
+        return factory;
+    }
+
+    //解决微信返回json Content-Type 值却是 text/plain 的问题
+    public class WxMappingJackson2HttpMessageConverter extends MappingJackson2HttpMessageConverter {
+        public WxMappingJackson2HttpMessageConverter() {
+            List<MediaType> mediaTypes = new ArrayList<>();
+            mediaTypes.add(MediaType.TEXT_PLAIN);
+            mediaTypes.add(MediaType.TEXT_HTML);
+            setSupportedMediaTypes(mediaTypes);
+        }
+    }
+}

+ 28 - 0
crmeb-admin/src/main/java/com/zbkj/admin/config/SchedulerConfig.java

@@ -0,0 +1,28 @@
+package com.zbkj.admin.config;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+
+/**
+ * Spring 定时任务配置
+
+ */
+
+@Configuration
+public class SchedulerConfig implements SchedulingConfigurer {
+
+    private final int poolSize = 30;
+
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) {
+        ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler();
+
+        threadPoolTaskScheduler.setPoolSize(poolSize);
+        threadPoolTaskScheduler.setThreadNamePrefix("crmeb-scheduled-task-pool-");
+        threadPoolTaskScheduler.initialize();
+
+        scheduledTaskRegistrar.setTaskScheduler(threadPoolTaskScheduler);
+    }
+}

+ 148 - 0
crmeb-admin/src/main/java/com/zbkj/admin/config/SwaggerConfig.java

@@ -0,0 +1,148 @@
+package com.zbkj.admin.config;
+
+import com.google.common.base.Predicate;
+import com.zbkj.common.constants.Constants;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.service.ApiKey;
+import springfox.documentation.service.AuthorizationScope;
+import springfox.documentation.service.SecurityReference;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spi.service.contexts.SecurityContext;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static com.google.common.collect.Lists.newArrayList;
+
+/**
+ * Swagger配置组件
+
+ */
+@Configuration
+@EnableSwagger2
+@ConfigurationProperties(prefix = "api.doc")
+public class SwaggerConfig {
+
+    //是否开启swagger,正式环境一般是需要关闭的,可根据springboot的多环境配置进行设置
+    Boolean swaggerEnabled = true;
+
+    @Value("${server.port}")
+    private String port;
+
+    @Value("${crmeb.domain}")
+    private String domain;
+
+    @Bean("merchant")
+    public Docket createRestApis() {
+        return new Docket(DocumentationType.SWAGGER_2)
+                .groupName("merchant")
+                .host(domain)
+                .apiInfo(apiInfo())
+                // 是否开启
+                .enable(swaggerEnabled)
+                .select()
+                // 扫描的路径包
+                .apis(RequestHandlerSelectors.basePackage("com.zbkj.admin.controller.merchant"))
+                // 指定路径处理PathSelectors.any()代表所有的路径
+                .paths(merchantPathsAnt())
+                .build()
+                .securitySchemes(security())
+                .securityContexts(securityContexts())
+//                .globalOperationParameters(pars) // 针对单个url的验证 如果需要的话
+                .pathMapping("/");
+    }
+
+    @Bean("platform")
+    public Docket create2RestApis() {
+        return new Docket(DocumentationType.SWAGGER_2)
+                .groupName("platform")
+                .host(domain)
+                .apiInfo(apiInfo())
+                // 是否开启
+                .enable(swaggerEnabled)
+                .select()
+                // 扫描的路径包
+                .apis(RequestHandlerSelectors.basePackage("com.zbkj.admin.controller.platform"))
+                // 指定路径处理PathSelectors.any()代表所有的路径
+                .paths(platformPathsAnt()) //只监听
+                .build()
+                .securitySchemes(security())
+                .securityContexts(securityContexts())
+//                .globalOperationParameters(pars) // 针对单个url的验证 如果需要的话
+                .pathMapping("/");
+    }
+
+    @Bean("publicly")
+    public Docket create3RestApis() {
+        return new Docket(DocumentationType.SWAGGER_2)
+                .groupName("publicly")
+                .host(domain)
+                .apiInfo(apiInfo())
+                // 是否开启
+                .enable(swaggerEnabled)
+                .select()
+                // 扫描的路径包
+                .apis(RequestHandlerSelectors.basePackage("com.zbkj.admin.controller.publicly"))
+                // 指定路径处理PathSelectors.any()代表所有的路径
+                .paths(publicPathsAnt())
+                .build()
+                .securitySchemes(security())
+                .securityContexts(securityContexts())
+//                .globalOperationParameters(pars) // 针对单个url的验证 如果需要的话
+                .pathMapping("/");
+    }
+
+    private Predicate<String> merchantPathsAnt() {
+        return PathSelectors.ant("/api/admin/merchant/**");
+    }
+
+    private Predicate<String> platformPathsAnt() {
+        return PathSelectors.ant("/api/admin/platform/**");
+    }
+
+    private Predicate<String> publicPathsAnt() {
+        return PathSelectors.ant("/api/publicly/**");
+    }
+
+    private List<ApiKey> security() {
+        return newArrayList(
+                new ApiKey(Constants.HEADER_AUTHORIZATION_KEY, Constants.HEADER_AUTHORIZATION_KEY, "header")
+        );
+    }
+
+    private ApiInfo apiInfo() {
+        return new ApiInfoBuilder()
+                .title("Java Merchant")
+                .description("")
+                .termsOfServiceUrl("http://host:port")
+                .version("1.0.0").build();
+    }
+
+
+    private List<SecurityContext> securityContexts() {
+        List<SecurityContext> res = new ArrayList<>();
+        res.add(SecurityContext.builder()
+                .securityReferences(defaultAuth())
+                .forPaths(PathSelectors.regex("/.*"))
+                .build());
+        return res;
+    }
+
+    private List<SecurityReference> defaultAuth() {
+        List<SecurityReference> res = new ArrayList<>();
+        AuthorizationScope authorizationScope = new AuthorizationScope("global", Constants.HEADER_AUTHORIZATION_KEY);
+        AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
+        authorizationScopes[0] = authorizationScope;
+        res.add(new SecurityReference(Constants.HEADER_AUTHORIZATION_KEY, authorizationScopes));
+        return res;
+    }
+}

+ 97 - 0
crmeb-admin/src/main/java/com/zbkj/admin/config/TaskExecutorConfig.java

@@ -0,0 +1,97 @@
+package com.zbkj.admin.config;
+
+import lombok.Data;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+
+import java.util.concurrent.RejectedExecutionHandler;
+import java.util.concurrent.ThreadPoolExecutor;
+
+/**
+ * Task类的线程配置
+
+ */
+@Data
+@Configuration
+public class TaskExecutorConfig {
+
+    //普通模式
+    private final int taskCorePoolSize = 20; //核心线程池数量
+    private final int taskMaxPoolSize = 100; //最大线程
+    private final int taskQueueCapacity = 200; //缓存队列条数
+    private final int taskKeepAliveSecond = 10; //允许的空闲时间
+    private final String taskNamePrefix = "task-executor-"; //线程名称前缀
+
+    //发布订阅模式
+//    private final int listenerCorePoolSize = 3;
+//    private final int listenerMaxPoolSize = 20;
+//    private final int listenerQueueCapacity = 200;
+//    private final int listenerKeepAliveSecond = 10;
+//    private final String listenerNamePrefix = "listener-executor-";
+
+    //普通模式
+    @Bean("taskExecutor")
+    public ThreadPoolTaskExecutor taskExecutor() {
+        return initTaskExecutor(
+                getTaskCorePoolSize(),
+                getTaskMaxPoolSize(),
+                getTaskQueueCapacity(),
+                getTaskKeepAliveSecond(),
+                getTaskNamePrefix()
+        );
+    }
+
+//    //针对发布订阅(pub listener) 的线程池
+//    @Bean("listenerTaskExecutor")
+//    public ThreadPoolTaskExecutor listenerTaskExecutor(){
+//        return initTaskExecutor(getListenerCorePoolSize(), getListenerMaxPoolSize(),
+//                getListenerQueueCapacity(), getListenerKeepAliveSecond(), getListenerNamePrefix());
+//    }
+
+    /**
+     * 初始化TaskExecutor
+     *
+     * @param corePoolSize    int 默认线程数
+     * @param maxPoolSize     int 最大线程数
+     * @param queueCapacity   int 缓冲队列长度
+     * @param keepAliveSecond int 允许空闲时间
+     * @param namePrefix      String  名称的前缀
+     * @return ThreadPoolTaskExecutor
+     */
+    private ThreadPoolTaskExecutor initTaskExecutor(int corePoolSize, int maxPoolSize,
+                                                    int queueCapacity, int keepAliveSecond, String namePrefix) {
+        //callrunspolicy:由调度线程(提交任务的线程)处理该任务CallerRunsPolicy
+        return initTaskExecutor(corePoolSize, maxPoolSize, queueCapacity, keepAliveSecond, namePrefix,
+                new ThreadPoolExecutor.CallerRunsPolicy());
+    }
+
+    /**
+     * 初始化TaskExecutor
+     *
+     * @param corePoolSize             int 默认线程数
+     * @param maxPoolSize              int 最大线程数
+     * @param queueCapacity            int 缓冲队列长度
+     * @param keepAliveSecond          int 允许空闲时间
+     * @param namePrefix               String  名称的前缀
+     * @param rejectedExecutionHandler 线程池满的时候如何处理
+     * @return ThreadPoolTaskExecutor
+     */
+    private ThreadPoolTaskExecutor initTaskExecutor(int corePoolSize, int maxPoolSize,
+                                                    int queueCapacity, int keepAliveSecond, String namePrefix,
+                                                    RejectedExecutionHandler rejectedExecutionHandler) {
+        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
+        executor.setCorePoolSize(corePoolSize);//核心线程数(默认线程数)
+        executor.setMaxPoolSize(maxPoolSize);//最大线程数
+        executor.setQueueCapacity(queueCapacity);//缓冲队列数
+        executor.setKeepAliveSeconds(keepAliveSecond);//允许线程空闲时间(单位默认为秒)
+        executor.setThreadNamePrefix(namePrefix);//线程名前缀
+
+        //线程池对拒绝任务的处理策略,
+        executor.setRejectedExecutionHandler(rejectedExecutionHandler);
+
+        //初始化
+        executor.initialize();
+        return executor;
+    }
+}

+ 33 - 0
crmeb-admin/src/main/java/com/zbkj/admin/config/TaskSchedulerConfig.java

@@ -0,0 +1,33 @@
+package com.zbkj.admin.config;
+
+/**
+ * @Created by:   zhulei
+ * 2023/6/7 13:31
+ * code is far away from bug with the animal protecting
+ * <p>
+ * <p>
+ * █████▒█    ██  ▄████▄   ██ ▄█▀       ██████╗ ██╗   ██╗ ██████╗
+ * ▓██   ▒ ██  ▓██▒▒██▀ ▀█   ██▄█▒        ██╔══██╗██║   ██║██╔════╝
+ * ▒████ ░▓██  ▒██░▒▓█    ▄ ▓███▄░        ██████╔╝██║   ██║██║  ███╗
+ * ░▓█▒  ░▓▓█  ░██░▒▓▓▄ ▄██▒▓██ █▄        ██╔══██╗██║   ██║██║   ██║
+ * ░▒█░   ▒▒█████▓ ▒ ▓███▀ ░▒██▒ █▄       ██████╔╝╚██████╔╝╚██████╔╝
+ * ▒ ░   ░▒▓▒ ▒ ▒ ░ ░▒ ▒  ░▒ ▒▒ ▓▒       ╚═════╝  ╚═════╝  ╚═════╝
+ * ░     ░░▒░ ░ ░   ░  ▒   ░ ░▒ ▒░
+ * ░ ░    ░░░ ░ ░ ░        ░ ░░ ░
+ * ░     ░ ░      ░  ░
+ * ░
+ */
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
+
+@Configuration
+public class TaskSchedulerConfig {
+
+    @Bean
+    public ThreadPoolTaskScheduler taskScheduler(){
+        ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
+        taskScheduler.setPoolSize(10); // 配置线程池大小,根据需要进行调整
+        return taskScheduler;
+    }
+}

+ 90 - 0
crmeb-admin/src/main/java/com/zbkj/admin/config/WebConfig.java

@@ -0,0 +1,90 @@
+package com.zbkj.admin.config;
+
+import com.zbkj.admin.filter.ResponseFilter;
+import com.zbkj.common.config.CrmebConfig;
+import com.zbkj.common.constants.Constants;
+import com.zbkj.common.constants.UploadConstants;
+import com.zbkj.common.interceptor.SwaggerInterceptor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.web.servlet.FilterRegistrationBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.HandlerInterceptor;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+import org.springframework.web.servlet.handler.MappedInterceptor;
+
+/**
+ * token验证拦截器
+
+ */
+@Configuration
+public class WebConfig implements WebMvcConfigurer {
+
+    // 这里使用一个Bean为的是可以在拦截器中自由注入,也可以在拦截器中使用SpringUtil.getBean 获取
+    // 但是觉得这样更优雅
+
+    @Autowired
+    CrmebConfig crmebConfig;
+
+    @Bean
+    public ResponseFilter responseFilter() {
+        return new ResponseFilter();
+    }
+
+
+    @Value("${swagger.basic.username}")
+    private String username;
+    @Value("${swagger.basic.password}")
+    private String password;
+    @Value("${swagger.basic.check}")
+    private Boolean check;
+
+
+    @Override
+    public void addInterceptors(InterceptorRegistry registry) {
+        //添加token拦截器
+        //addPathPatterns添加需要拦截的命名空间;
+        //excludePathPatterns添加排除拦截命名空间
+//        registry.addInterceptor(frontTokenInterceptor() ).
+//                excludePathPatterns("/api/admin/merchant/erkai/wechat");
+
+    }
+
+    @Override
+    public void addResourceHandlers(ResourceHandlerRegistry registry) {
+        registry.addResourceHandler("/**")
+                .addResourceLocations("classpath:/static/");
+        registry.addResourceHandler("doc.html")
+                .addResourceLocations("classpath:/META-INF/resources/");
+        registry.addResourceHandler("/webjars/**")
+                .addResourceLocations("classpath:/META-INF/resources/webjars/");
+
+        /** 本地文件上传路径 */
+        registry.addResourceHandler(UploadConstants.UPLOAD_FILE_KEYWORD + "/**")
+                .addResourceLocations("file:" + crmebConfig.getImagePath() + "/" + UploadConstants.UPLOAD_FILE_KEYWORD + "/");
+
+        registry.addResourceHandler(UploadConstants.UPLOAD_AFTER_FILE_KEYWORD + "/**")
+                .addResourceLocations("file:" + crmebConfig.getImagePath() + "/" + UploadConstants.UPLOAD_AFTER_FILE_KEYWORD + "/");
+
+    }
+
+    @Bean
+    public FilterRegistrationBean filterRegister() {
+        //注册过滤器
+        FilterRegistrationBean registration = new FilterRegistrationBean(responseFilter());
+        // 仅仅api前缀的请求才会拦截
+        registration.addUrlPatterns("/api/*");
+        return registration;
+    }
+
+    /* 必须在此处配置拦截器,要不然拦不到swagger的静态资源 */
+    @Bean
+    @ConditionalOnProperty(name = "swagger.basic.enable", havingValue = "true")
+    public MappedInterceptor getMappedInterceptor() {
+        return new MappedInterceptor(new String[]{"/doc.html", "/webjars/**"}, new SwaggerInterceptor(username, password, check));
+    }
+}

+ 147 - 0
crmeb-admin/src/main/java/com/zbkj/admin/config/WebSecurityConfig.java

@@ -0,0 +1,147 @@
+package com.zbkj.admin.config;
+
+import com.zbkj.admin.filter.JwtAuthenticationTokenFilter;
+import com.zbkj.admin.manager.AuthenticationEntryPointImpl;
+import com.zbkj.admin.manager.CustomAccessDeniedHandler;
+import com.zbkj.admin.manager.CustomAuthenticationProvider;
+import com.zbkj.common.constants.UploadConstants;
+import com.zbkj.service.service.impl.UserDetailServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.HttpMethod;
+import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
+import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+import org.springframework.security.config.http.SessionCreationPolicy;
+import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
+import org.springframework.security.web.authentication.logout.LogoutFilter;
+import org.springframework.web.filter.CorsFilter;
+
+/**
+ * Security配置
+
+ */
+@Configuration
+@EnableWebSecurity
+@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
+public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
+
+    /**
+     * 跨域过滤器
+     */
+    @Autowired
+    private CorsFilter corsFilter;
+
+    /**
+     * token认证过滤器
+     */
+    @Bean
+    public JwtAuthenticationTokenFilter jwtAuthenticationTokenFilter() {
+        return new JwtAuthenticationTokenFilter();
+    }
+
+    /**
+     * 认证失败处理类
+     */
+    @Bean
+    public AuthenticationEntryPointImpl unauthorizedHandler() {
+        return new AuthenticationEntryPointImpl();
+    }
+
+    /**
+     * 鉴权失败处理类
+     */
+    @Bean
+    public CustomAccessDeniedHandler accessDeniedHandler() {
+        return new CustomAccessDeniedHandler();
+    }
+
+    /**
+     * 这里将Spring Security自带的authenticationManager声明成Bean,声明它的作用是用它帮我们进行认证操作,
+     * 调用这个Bean的authenticate方法会由Spring Security自动帮我们做认证。
+     */
+//    @Bean
+//    public AuthenticationManager authenticationManager() throws Exception {
+//        return new CusAuthenticationManager(customAuthenticationProvider);
+//    }
+    @Override
+    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
+        auth.authenticationProvider(new CustomAuthenticationProvider(new UserDetailServiceImpl()));
+    }
+
+    /**
+     * anyRequest          |   匹配所有请求路径
+     * access              |   SpringEl表达式结果为true时可以访问
+     * anonymous           |   匿名可以访问
+     * denyAll             |   用户不能访问
+     * fullyAuthenticated  |   用户完全认证可以访问(非remember-me下自动登录)
+     * hasAnyAuthority     |   如果有参数,参数表示权限,则其中任何一个权限可以访问
+     * hasAnyRole          |   如果有参数,参数表示角色,则其中任何一个角色可以访问
+     * hasAuthority        |   如果有参数,参数表示权限,则其权限可以访问
+     * hasIpAddress        |   如果有参数,参数表示IP地址,如果用户IP和参数匹配,则可以访问
+     * hasRole             |   如果有参数,参数表示角色,则其角色可以访问
+     * permitAll           |   用户可以任意访问
+     * rememberMe          |   允许通过remember-me登录的用户访问
+     * authenticated       |   用户登录后可访问
+     */
+    @Override
+    protected void configure(HttpSecurity http) throws Exception {
+
+        // CRSF禁用,因为不使用session
+        http.cors().and().csrf().disable()
+                // 认证失败处理类
+                .exceptionHandling().authenticationEntryPoint(unauthorizedHandler())
+                .accessDeniedHandler(accessDeniedHandler()).and()
+                // 基于token,所以不需要session
+                .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
+                // 过滤请求
+                .authorizeRequests()
+                // 跨域预检请求
+//            .antMatchers(HttpMethod.OPTIONS, "/**").permitAll()
+                // 对于登录login 验证码captchaImage 和其他放行的目录 允许匿名访问"/citylife/front/**"
+                .antMatchers("/api/publicly/**").permitAll()
+                .antMatchers("/api/admin/platform/getLoginPic").permitAll()
+                .antMatchers("/api/admin/platform/login").permitAll()
+                .antMatchers("/api/admin/merchant/getLoginPic").permitAll()
+                .antMatchers("/api/admin/merchant/login").permitAll()
+                // 放行资源路径
+                .antMatchers("/" + UploadConstants.UPLOAD_FILE_KEYWORD + "/**").permitAll()
+                .antMatchers("/" + UploadConstants.DOWNLOAD_FILE_KEYWORD + "/**").permitAll()
+                .antMatchers("/" + UploadConstants.UPLOAD_AFTER_FILE_KEYWORD + "/**").permitAll()
+                .antMatchers(
+                        HttpMethod.GET,
+                        "/*.html",
+                        "/**/*.html",
+                        "/**/*.css",
+                        "/**/*.js"
+                ).permitAll()
+                .antMatchers("/profile/**").anonymous()
+                .antMatchers("/common/download**").anonymous()
+                .antMatchers("/common/download/resource**").anonymous()
+                .antMatchers("/doc.html").permitAll()
+                .antMatchers("/swagger-resources/**").permitAll()
+                .antMatchers("/webjars/**").permitAll()
+                .antMatchers("/v2/**").permitAll()
+                .antMatchers("/swagger-ui.html/**").permitAll()
+                .antMatchers("/*/api-docs").anonymous()
+                .antMatchers("/druid/**").anonymous()
+                .antMatchers("/captcha/get", "/captcha/check").anonymous()
+                .antMatchers("/api/admin/payment/callback/**").anonymous()
+                .antMatchers("/api/public/**").anonymous()
+                // 除上面外的所有请求全部需要鉴权认证
+                .anyRequest().authenticated()
+                .and()
+                .headers().frameOptions().disable();// 防止iframe 造成跨域
+//        http.logout().logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler);
+        // 添加JWT filter
+        // 开启登录认证流程过滤器
+        http.addFilterBefore(jwtAuthenticationTokenFilter(), UsernamePasswordAuthenticationFilter.class);
+        // 添加CORS filter
+        http.addFilterBefore(corsFilter, JwtAuthenticationTokenFilter.class);
+        http.addFilterBefore(corsFilter, LogoutFilter.class);
+    }
+
+}

+ 85 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/QuickStart.java

@@ -0,0 +1,85 @@
+package com.zbkj.admin.controller;
+
+import com.google.zxing.BarcodeFormat;
+import com.google.zxing.EncodeHintType;
+import com.google.zxing.WriterException;
+import com.google.zxing.client.j2se.MatrixToImageWriter;
+import com.google.zxing.common.BitMatrix;
+import com.google.zxing.qrcode.QRCodeWriter;
+import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
+import com.wechat.pay.java.core.Config;
+import com.wechat.pay.java.core.RSAAutoCertificateConfig;
+import com.wechat.pay.java.service.payments.nativepay.NativePayService;
+import com.wechat.pay.java.service.payments.nativepay.model.Amount;
+import com.wechat.pay.java.service.payments.nativepay.model.PrepayRequest;
+import com.wechat.pay.java.service.payments.nativepay.model.PrepayResponse;
+
+import javax.imageio.ImageIO;
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.Base64;
+import java.util.Hashtable;
+
+/** Native 支付下单为例 */
+public class QuickStart {
+
+    /** 商户号 */
+    public static String merchantId = "1558043371";
+    /** 商户API私钥路径 */
+    public static String privateKeyPath = "C:\\Users\\ASUS\\Desktop\\apiclient_key.pem";
+    /** 商户证书序列号 */
+    public static String merchantSerialNumber = "71B54FB2C362633000AEB9C540D928D6BED7D40F";
+    /** 商户APIV3密钥 */
+    public static String apiV3key = "1tOXUE8y2vqO6NFxHBoK2F1gtn4Ls6dO";
+
+    public static void main(String[] args) {
+        // 使用自动更新平台证书的RSA配置
+        // 一个商户号只能初始化一个配置,否则会因为重复的下载任务报错
+        Config config =
+                new RSAAutoCertificateConfig.Builder()
+                        .merchantId(merchantId)
+                        .privateKeyFromPath(privateKeyPath)
+                        .merchantSerialNumber(merchantSerialNumber)
+                        .apiV3Key(apiV3key)
+                        .build();
+        // 构建service
+        NativePayService service = new NativePayService.Builder().config(config).build();
+        // request.setXxx(val)设置所需参数,具体参数可见Request定义
+        PrepayRequest request = new PrepayRequest();
+        Amount amount = new Amount();
+        amount.setTotal(1);
+        request.setAmount(amount);
+        request.setAppid("wx2198b51c8406aed0");
+        request.setMchid(merchantId);
+        request.setDescription("测试商品标题");
+        request.setNotifyUrl("http://d06u7pg536nk.ngrok.xiaomiqiu123.top/api/front/erkai/wechat");
+        request.setOutTradeNo("out_trade_no_008");
+        // 调用下单方法,得到应答
+        PrepayResponse response = service.prepay(request);
+        // 使用微信扫描 code_url 对应的二维码,即可体验Native支付
+        String codeUrl = response.getCodeUrl();
+        System.out.println(codeUrl);
+        int width = 200; // 二维码图片宽度
+        int height = 200; // 二维码图片高度
+
+        QRCodeWriter qrCodeWriter = new QRCodeWriter();
+        Hashtable<EncodeHintType, ErrorCorrectionLevel> hintMap = new Hashtable<>();
+        hintMap.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.L);
+
+        try {
+            BitMatrix byteMatrix = qrCodeWriter.encode(codeUrl, BarcodeFormat.QR_CODE, width, height, hintMap);
+            BufferedImage image = MatrixToImageWriter.toBufferedImage(byteMatrix); // 创建二维码图片
+
+            ByteArrayOutputStream os = new ByteArrayOutputStream();
+            ImageIO.write(image, "png", os); // 将图片数据写入到字节数组输出流
+            byte[] imageBytes = os.toByteArray(); // 获取图片数据的字节数组
+
+            // 将字节数组编码为 Base64
+            String imageBase64 = Base64.getEncoder().encodeToString(imageBytes);
+            System.out.println("Image Base64: " + "data:image/png;base64,"+imageBase64);
+        } catch (WriterException | IOException e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 100 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantAdminController.java

@@ -0,0 +1,100 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.model.admin.SystemAdmin;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.request.SystemAdminAddRequest;
+import com.zbkj.common.request.SystemAdminRequest;
+import com.zbkj.common.request.SystemAdminUpdateRequest;
+import com.zbkj.common.response.SystemAdminResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.SystemAdminService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+
+
+/**
+ * 后台管理员表 前端控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/admin")
+@Api(tags = "商户端管理员服务")
+public class MerchantAdminController {
+
+    @Autowired
+    private SystemAdminService systemAdminService;
+
+    @PreAuthorize("hasAuthority('merchant:admin:list')")
+    @ApiOperation(value = "管理员分页列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    @ResponseBody
+    public CommonResult<CommonPage<SystemAdminResponse>> getList(@Validated SystemAdminRequest systemAdminRequest, PageParamRequest pageParamRequest) {
+        CommonPage<SystemAdminResponse> systemAdminCommonPage = CommonPage.restPage(systemAdminService.getList(systemAdminRequest, pageParamRequest));
+        return CommonResult.success(systemAdminCommonPage);
+    }
+
+    @PreAuthorize("hasAuthority('merchant:admin:save')")
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.ADD, description = "新增后台管理员")
+    @ApiOperation(value = "新增后台管理员")
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    public CommonResult<String> save(@RequestBody SystemAdminAddRequest systemAdminAddRequest) {
+        if (systemAdminService.saveAdmin(systemAdminAddRequest)) {
+            return CommonResult.success("添加管理员成功");
+        }
+        return CommonResult.failed("添加管理员失败");
+    }
+
+    @PreAuthorize("hasAuthority('merchant:admin:delete')")
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.DELETE, description = "删除管理员")
+    @ApiOperation(value = "删除管理员")
+    @RequestMapping(value = "/delete", method = RequestMethod.GET)
+    public CommonResult<String> delete(@RequestParam(value = "id") Integer id) {
+        if (systemAdminService.removeAdmin(id)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('merchant:admin:update')")
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "修改管理员")
+    @ApiOperation(value = "修改管理员")
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    public CommonResult<String> update(@RequestBody SystemAdminUpdateRequest systemAdminRequest) {
+        if (systemAdminService.updateAdmin(systemAdminRequest)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('merchant:admin:info')")
+    @ApiOperation(value = "后台管理员详情")
+    @RequestMapping(value = "/info", method = RequestMethod.GET)
+    public CommonResult<SystemAdmin> info(@RequestParam(value = "id") @Valid Integer id) {
+        return CommonResult.success(systemAdminService.getDetail(id));
+    }
+
+    @PreAuthorize("hasAuthority('merchant:admin:update:status')")
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "修改后台管理员状态")
+    @ApiOperation(value = "修改后台管理员状态")
+    @RequestMapping(value = "/updateStatus", method = RequestMethod.GET)
+    public CommonResult<String> updateStatus(@RequestParam(value = "id") @Valid Integer id, @RequestParam(value = "status") @Valid Boolean status) {
+        if (systemAdminService.updateStatus(id, status)) {
+            return CommonResult.success("修改成功");
+        }
+        return CommonResult.failed("修改失败");
+    }
+}
+
+
+

+ 75 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantAttachmentController.java

@@ -0,0 +1,75 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.model.system.SystemAttachment;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.request.SystemAttachmentMoveRequest;
+import com.zbkj.common.request.SystemAttachmentRemoveRequest;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.utils.CrmebUtil;
+import com.zbkj.service.service.SystemAttachmentService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 附件管理表 前端控制器 - 商户端
+
+ *
+ * @author
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/attachment")
+@Api(tags = "商户端附件管理") //配合swagger使用
+public class MerchantAttachmentController {
+
+    @Autowired
+    private SystemAttachmentService systemAttachmentService;
+
+    @PreAuthorize("hasAuthority('merchant:attachment:list')")
+    @ApiOperation(value = "附件分页列表") //配合swagger使用
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<SystemAttachment>> getList(@RequestParam(value = "pid", required = false) Integer pid,
+                                                              @RequestParam(value = "attType",
+                                                                      defaultValue = "png,jpeg,jpg,audio/mpeg,text/plain,video/mp4,gif",
+                                                                      required = false) String attType,
+                                                              @Validated PageParamRequest pageParamRequest) {
+        // 资源归属方:-1=平台(查看全部),商户或者用户id(仅查看自己上传的素材)
+        CommonPage<SystemAttachment> systemAttachmentCommonPage =
+                CommonPage.restPage(systemAttachmentService.getList(pid, attType, pageParamRequest));
+        return CommonResult.success(systemAttachmentCommonPage);
+    }
+
+
+    @PreAuthorize("hasAuthority('merchant:attachment:delete')")
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.DELETE, description = "删除附件")
+    @ApiOperation(value = "删除附件")
+    @RequestMapping(value = "/delete", method = RequestMethod.POST)
+    public CommonResult<String> delete(@RequestBody @Validated SystemAttachmentRemoveRequest removeRequest) {
+        if (systemAttachmentService.removeByIds(CrmebUtil.stringToArray(removeRequest.getIds()))) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+
+    @PreAuthorize("hasAuthority('merchant:attachment:move')")
+    @ApiOperation(value = "更改图片目录")
+    @RequestMapping(value = "/move", method = RequestMethod.POST)
+    public CommonResult<String> updateAttrId(@RequestBody @Validated SystemAttachmentMoveRequest move) {
+        if (systemAttachmentService.updateAttrId(move)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+}
+
+
+

+ 125 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantBaseCategoryController.java

@@ -0,0 +1,125 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.model.category.Category;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.CategoryRequest;
+import com.zbkj.common.request.CategorySearchRequest;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.utils.CrmebUtil;
+import com.zbkj.common.vo.CategoryTreeVo;
+import com.zbkj.service.service.CategoryService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+
+/**
+ * 分类表 前端控制器 暂时用于素材,设置,文章
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/category")
+@Api(tags = "商户端分类服务")
+public class MerchantBaseCategoryController {
+
+    @Autowired
+    private CategoryService categoryService;
+
+    @PreAuthorize("hasAuthority('merchant:category:list')")
+    @ApiOperation(value = "基础分类分页列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<Category>> getList(@ModelAttribute CategorySearchRequest request, @ModelAttribute PageParamRequest pageParamRequest) {
+        CommonPage<Category> categoryCommonPage = CommonPage.restPage(categoryService.getList(request, pageParamRequest));
+        return CommonResult.success(categoryCommonPage);
+    }
+
+    @PreAuthorize("hasAuthority('merchant:category:save')")
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.ADD, description = "新增基础分类")
+    @ApiOperation(value = "新增基础分类")
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    public CommonResult<String> save(@RequestBody @Validated CategoryRequest categoryRequest) {
+        if (categoryService.create(categoryRequest)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('merchant:category:delete')")
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.DELETE, description = "删除基础分类")
+    @ApiOperation(value = "删除基础分类")
+    @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
+    public CommonResult<String> delete(@PathVariable(value = "id") Integer id) {
+        if (categoryService.delete(id) > 0) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('merchant:category:update')")
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "修改基础分类")
+    @ApiOperation(value = "修改基础分类")
+    @RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
+    public CommonResult<String> update(@PathVariable(value = "id") Integer id, @ModelAttribute CategoryRequest categoryRequest) {
+        if (categoryService.update(categoryRequest, id)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('merchant:category:info')")
+    @ApiOperation(value = "基础分类详情")
+    @RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
+    public CommonResult<Category> info(@PathVariable(value = "id") Integer id) {
+        return CommonResult.success(categoryService.getByIdException(id));
+    }
+
+
+    @PreAuthorize("hasAuthority('merchant:category:list:tree')")
+    @ApiOperation(value = "获取基础分类tree结构的列表")
+    @RequestMapping(value = "/list/tree", method = RequestMethod.GET)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "type", value = "类型ID | 类型,1 产品分类,2 附件分类,3 文章分类, 4 设置分类, 5 菜单分类, 6 配置分类, 7 秒杀配置", example = "1"),
+            @ApiImplicitParam(name = "status", value = "-1=全部,0=未生效,1=已生效", example = "1"),
+            @ApiImplicitParam(name = "name", value = "模糊搜索", example = "电视"),
+            @ApiImplicitParam(name = "owner", value = "商户id")
+    })
+    public CommonResult<List<CategoryTreeVo>> getListTree(@RequestParam(name = "type") Integer type,
+                                                          @RequestParam(name = "status") Integer status,
+                                                          @RequestParam(name = "name", required = false) String name) {
+        List<CategoryTreeVo> listTree = categoryService.getListTree(type, status, name);
+        return CommonResult.success(listTree);
+    }
+
+    @PreAuthorize("hasAuthority('merchant:category:list:ids')")
+    @ApiOperation(value = "根据id集合获取基础分类列表")
+    @RequestMapping(value = "/list/ids", method = RequestMethod.GET)
+    @ApiImplicitParam(name = "ids", value = "分类id集合")
+    public CommonResult<List<Category>> getByIds(@Validated @RequestParam(name = "ids") String ids) {
+        return CommonResult.success(categoryService.getByIds(CrmebUtil.stringToArray(ids)));
+    }
+
+    @PreAuthorize("hasAuthority('merchant:category:update:status')")
+    @ApiOperation(value = "更改基础分类状态")
+    @RequestMapping(value = "/updateStatus/{id}", method = RequestMethod.POST)
+    public CommonResult<Object> getByIds(@PathVariable(name = "id") Integer id) {
+        if (categoryService.updateStatus(id)) {
+            return CommonResult.success("修改成功");
+        }
+        return CommonResult.failed("修改失败");
+    }
+}
+
+
+

+ 47 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantCityRegionController.java

@@ -0,0 +1,47 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.vo.CityVo;
+import com.zbkj.service.service.CityRegionService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+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;
+
+
+/**
+ * 城市表 前端控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/city/region")
+@Api(tags = "商户端城市区域管理")
+public class MerchantCityRegionController {
+
+    @Autowired
+    private CityRegionService cityRegionService;
+
+    @PreAuthorize("hasAuthority('merchant:city:list:tree')")
+    @ApiOperation(value = "获取城市tree结构的列表")
+    @RequestMapping(value = "/city/tree", method = RequestMethod.GET)
+    public CommonResult<List<CityVo>> getCityListTree() {
+        return CommonResult.success(cityRegionService.getCityListTree());
+    }
+
+    @PreAuthorize("hasAuthority('merchant:city:region:list:tree')")
+    @ApiOperation(value = "获取城市区域tree结构的列表")
+    @RequestMapping(value = "/list/tree", method = RequestMethod.GET)
+    public CommonResult<List<CityVo>> getRegionListTree() {
+        return CommonResult.success(cityRegionService.getRegionListTree());
+    }
+}
+
+
+

+ 49 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantConfigController.java

@@ -0,0 +1,49 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.model.system.SystemConfig;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.SystemConfigService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+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;
+
+
+/**
+ * 配置表 前端控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/config")
+@Api(tags = "商户端设置")
+public class MerchantConfigController {
+
+    @Autowired
+    private SystemConfigService systemConfigService;
+
+    @PreAuthorize("hasAuthority('merchant:config:getuniq')")
+    @ApiOperation(value = "表单配置根据key获取")
+    @RequestMapping(value = "/getuniq", method = RequestMethod.GET)
+    public CommonResult<Object> justGetUniq(@RequestParam String key) {
+        return CommonResult.success(systemConfigService.getValueByKey(key),"success");
+    }
+
+    @PreAuthorize("hasAuthority('merchant:config:get')")
+    @ApiOperation(value = "根据key获取配置")
+    @RequestMapping(value = "/get", method = RequestMethod.GET)
+    public CommonResult<List<SystemConfig>> getByKey(@RequestParam String key) {
+        return CommonResult.success(systemConfigService.getListByKey(key));
+    }
+
+}
+
+
+

+ 35 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantCopyrightController.java

@@ -0,0 +1,35 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.admin.service.CopyrightService;
+import com.zbkj.common.result.CommonResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ * 版权控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/copyright")
+@Api(tags = "商户端版权控制器")
+public class MerchantCopyrightController {
+
+    @Autowired
+    private CopyrightService copyrightService;
+
+    @PreAuthorize("hasAuthority('merchant:copyright:get:company:info')")
+    @ApiOperation(value = "获取商户版权信息")
+    @RequestMapping(value = "/get/company/info", method = RequestMethod.GET)
+    public CommonResult<Object> getCompanyInfo() {
+        return CommonResult.success(copyrightService.getCompanyInfo(), "");
+    }
+
+}

+ 107 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantCouponController.java

@@ -0,0 +1,107 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.model.coupon.Coupon;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.CouponProductJoinRequest;
+import com.zbkj.common.request.CouponRequest;
+import com.zbkj.common.request.CouponSearchRequest;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.response.CouponInfoResponse;
+import com.zbkj.common.response.ProductCouponUseResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.CouponService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+
+/**
+ * 优惠券表 前端控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/coupon")
+@Api(tags = "商户端优惠券管理器")
+public class MerchantCouponController {
+
+    @Autowired
+    private CouponService couponService;
+
+    @PreAuthorize("hasAuthority('merchant:coupon:page:list')")
+    @ApiOperation(value = "优惠券分页列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<Coupon>> getList(@Validated CouponSearchRequest request,
+                                                    @Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(couponService.getMerchantPageList(request, pageParamRequest)));
+    }
+
+    @PreAuthorize("hasAuthority('merchant:coupon:save')")
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.ADD, description = "新增优惠券")
+    @ApiOperation(value = "新增优惠券")
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    public CommonResult<String> save(@RequestBody @Validated CouponRequest request) {
+        if (couponService.create(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('merchant:coupon:update:status')")
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "修改优惠券状态")
+    @ApiOperation(value = "修改优惠券状态")
+    @RequestMapping(value = "/update/status/{id}", method = RequestMethod.POST)
+    public CommonResult<String> updateStatus(@PathVariable Integer id) {
+        if (couponService.updateStatus(id)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('merchant:coupon:info')")
+    @ApiOperation(value = "优惠券详情")
+    @RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
+    public CommonResult<CouponInfoResponse> info(@PathVariable Integer id) {
+        return CommonResult.success(couponService.info(id));
+    }
+
+    @PreAuthorize("hasAuthority('merchant:coupon:product:usable:list')")
+    @ApiOperation(value = "商品可用优惠券列表")
+    @RequestMapping(value = "/product/usable/list", method = RequestMethod.GET)
+    public CommonResult<List<ProductCouponUseResponse>> getProductUsableList() {
+        return CommonResult.success(couponService.getProductUsableList());
+    }
+
+    @PreAuthorize("hasAuthority('merchant:coupon:delete')")
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.DELETE, description = "删除优惠券")
+    @ApiOperation(value = "删除优惠券")
+    @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
+    public CommonResult<String> delete(@PathVariable Integer id) {
+        if (couponService.delete(id)) {
+            return CommonResult.success("删除成功");
+        }
+        return CommonResult.failed("删除失败");
+    }
+
+    @PreAuthorize("hasAuthority('merchant:coupon:product:join:edit')")
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "商品券关联商品编辑")
+    @ApiOperation(value = "商品券关联商品编辑")
+    @RequestMapping(value = "/product/join/edit", method = RequestMethod.POST)
+    public CommonResult<String> couponProductJoinEdit(@RequestBody @Validated CouponProductJoinRequest request) {
+        if (couponService.couponProductJoinEdit(request)) {
+            return CommonResult.success("编辑成功");
+        }
+        return CommonResult.failed("编辑失败");
+    }
+}
+
+
+

+ 44 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantCouponUserController.java

@@ -0,0 +1,44 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.CouponUserSearchRequest;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.response.CouponUserResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.CouponUserService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ * 优惠券发放记录表 前端控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/coupon/user")
+@Api(tags = "商户端用户优惠券控制器")
+public class MerchantCouponUserController {
+
+    @Autowired
+    private CouponUserService couponUserService;
+
+    @PreAuthorize("hasAuthority('merchant:coupon:user:page:list')")
+    @ApiOperation(value = "优惠券领取记录分页列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<CouponUserResponse>> getList(@Validated CouponUserSearchRequest request,
+                                                                @Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(couponUserService.getPageList(request, pageParamRequest)));
+    }
+
+}
+
+
+

+ 52 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantExpressController.java

@@ -0,0 +1,52 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.alibaba.fastjson.JSONObject;
+import com.zbkj.common.model.express.Express;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.ExpressService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+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;
+
+
+/**
+ * 商户端物流公司控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/express")
+@Api(tags = "商户端物流公司控制器")
+public class MerchantExpressController {
+
+    @Autowired
+    private ExpressService expressService;
+
+    @PreAuthorize("hasAuthority('merchant:express:all')")
+    @ApiOperation(value = "查询全部物流公司")
+    @RequestMapping(value = "/all", method = RequestMethod.GET)
+    @ApiImplicitParam(name = "type", value = "类型:normal-普通,elec-电子面单", required = true)
+    public CommonResult<List<Express>> all(@RequestParam(value = "type") String type) {
+        return CommonResult.success(expressService.findAll(type));
+    }
+
+    @PreAuthorize("hasAuthority('merchant:express:template')")
+    @ApiOperation(value = "查询物流公司面单模板")
+    @RequestMapping(value = "/template", method = RequestMethod.GET)
+    @ApiImplicitParam(name = "com", value = "快递公司编号", required = true)
+    public CommonResult<JSONObject> template(@RequestParam(value = "com") String com) {
+        return CommonResult.success(expressService.template(com));
+    }
+}
+
+
+

+ 96 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantFinanceController.java

@@ -0,0 +1,96 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.admin.service.FinanceService;
+import com.zbkj.common.model.bill.MerchantDailyStatement;
+import com.zbkj.common.model.bill.MerchantMonthStatement;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.FundsFlowRequest;
+import com.zbkj.common.request.MerchantClosingApplyRequest;
+import com.zbkj.common.request.MerchantClosingSearchRequest;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.response.FundsFlowResponse;
+import com.zbkj.common.response.MerchantClosingBaseInfoResponse;
+import com.zbkj.common.response.MerchantClosingDetailResponse;
+import com.zbkj.common.response.MerchantClosingPageResponse;
+import com.zbkj.common.result.CommonResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+
+/**
+ * 商户端财务控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/finance")
+@Api(tags = "商户端财务控制器")
+public class MerchantFinanceController {
+
+    @Autowired
+    private FinanceService financeService;
+
+    @PreAuthorize("hasAuthority('merchant:finance:funds:flow')")
+    @ApiOperation(value = "资金流水分页列表")
+    @RequestMapping(value = "/funds/flow", method = RequestMethod.GET)
+    public CommonResult<CommonPage<FundsFlowResponse>> getFundsFlow(@Validated FundsFlowRequest request,
+                                                                      @Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(financeService.getMerchantFundsFlow(request, pageParamRequest)));
+    }
+
+    @PreAuthorize("hasAuthority('merchant:finance:closing:base:info')")
+    @ApiOperation(value = "获取结算申请基础信息")
+    @RequestMapping(value = "/closing/base/info", method = RequestMethod.GET)
+    public CommonResult<MerchantClosingBaseInfoResponse> getClosingBaseInfo() {
+        return CommonResult.success(financeService.getClosingBaseInfo());
+    }
+
+    @PreAuthorize("hasAuthority('merchant:finance:closing:apply')")
+    @ApiOperation(value = "结算申请")
+    @RequestMapping(value = "/closing/apply", method = RequestMethod.POST)
+    public CommonResult<String> closingApply(@RequestBody @Validated MerchantClosingApplyRequest request) {
+        if (financeService.merchantClosingApply(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('merchant:finance:closing:page:list')")
+    @ApiOperation(value = "结算记录分页列表")
+    @RequestMapping(value = "/closing/record/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<MerchantClosingPageResponse>> getMerchantClosingPageList(@Validated MerchantClosingSearchRequest request,
+                                                                                            @Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(financeService.getMerchantClosingRecordPageList(request, pageParamRequest)));
+    }
+
+    @PreAuthorize("hasAuthority('merchant:finance:closing:detail')")
+    @ApiOperation(value = "结算记录详情")
+    @RequestMapping(value = "/closing/record/detail/{closingNo}", method = RequestMethod.GET)
+    public CommonResult<MerchantClosingDetailResponse> getMerchantClosingDetail(@PathVariable(value = "closingNo") String closingNo) {
+        return CommonResult.success(financeService.getMerchantClosingDetailByMerchant(closingNo));
+    }
+
+    @PreAuthorize("hasAuthority('merchant:finance:daily:statement:page:list')")
+    @ApiOperation(value = "日帐单管理分页列表")
+    @RequestMapping(value = "/daily/statement/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<MerchantDailyStatement>> getDailyStatementList(@RequestParam(value = "dateLimit", required = false, defaultValue = "") String dateLimit,
+                                                                                  @ModelAttribute PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(financeService.getMerchantDailyStatementList(dateLimit, pageParamRequest)));
+    }
+
+    @PreAuthorize("hasAuthority('merchant:finance:month:statement:page:list')")
+    @ApiOperation(value = "月帐单管理分页列表")
+    @RequestMapping(value = "/month/statement/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<MerchantMonthStatement>> getMonthStatementList(@RequestParam(value = "dateLimit", required = false, defaultValue = "") String dateLimit,
+                                                                                  @ModelAttribute PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(financeService.getMerchantMonthStatementList(dateLimit, pageParamRequest)));
+    }
+}
+
+
+

+ 40 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantFormTempController.java

@@ -0,0 +1,40 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.model.system.SystemFormTemp;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.SystemFormTempService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+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;
+
+
+/**
+ * 表单模板 前端控制器 商户端
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/form/temp")
+@Api(tags = "商户端设置表单模板")
+public class MerchantFormTempController {
+
+    @Autowired
+    private SystemFormTempService systemFormTempService;
+
+    @PreAuthorize("hasAuthority('merchant:config:form:info')")
+    @ApiOperation(value = "表单组件详情")
+    @RequestMapping(value = "/info", method = RequestMethod.GET)
+    public CommonResult<SystemFormTemp> info(@RequestParam(value = "id") Integer id) {
+        SystemFormTemp systemFormTemp = systemFormTempService.getById(id);
+        return CommonResult.success(systemFormTemp);
+   }
+}
+
+
+

+ 63 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantHomeController.java

@@ -0,0 +1,63 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.admin.service.HomeService;
+import com.zbkj.common.response.HomeOperatingMerDataResponse;
+import com.zbkj.common.response.HomeRateResponse;
+import com.zbkj.common.response.ProductRankingResponse;
+import com.zbkj.common.result.CommonResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+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;
+
+
+/**
+ * 商户端主页控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/statistics/home")
+@Api(tags = "商户端主页控制器")
+public class MerchantHomeController {
+
+    @Autowired
+    private HomeService homeService;
+
+    @PreAuthorize("hasAuthority('merchant:statistics:home:index')")
+    @ApiOperation(value = "首页数据")
+    @RequestMapping(value = "/index", method = RequestMethod.GET)
+    public CommonResult<HomeRateResponse> indexDate() {
+        return CommonResult.success(homeService.indexMerchantDate());
+    }
+
+    @PreAuthorize("hasAuthority('merchant:statistics:home:operating:data')")
+    @ApiOperation(value = "经营数据")
+    @RequestMapping(value = "/operating/data", method = RequestMethod.GET)
+    public CommonResult<HomeOperatingMerDataResponse> operatingData() {
+        return CommonResult.success(homeService.operatingMerchantData());
+    }
+
+    @PreAuthorize("hasAuthority('merchant:statistics:home:product:pay:ranking')")
+    @ApiOperation(value = "商品支付排行榜")
+    @RequestMapping(value = "/product/pay/ranking", method = RequestMethod.GET)
+    public CommonResult<List<ProductRankingResponse>> productPayRanking() {
+        return CommonResult.success(homeService.merchantProductPayRanking());
+    }
+
+    @PreAuthorize("hasAuthority('merchant:statistics:home:product:pageview:ranking')")
+    @ApiOperation(value = "商品浏览量排行榜")
+    @RequestMapping(value = "/product/pageview/ranking", method = RequestMethod.GET)
+    public CommonResult<List<ProductRankingResponse>> productPageviewRanking() {
+        return CommonResult.success(homeService.merchantProductPageviewRanking());
+    }
+}
+
+
+

+ 92 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantInfoController.java

@@ -0,0 +1,92 @@
+package com.zbkj.admin.controller.merchant;
+
+
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.response.MerchantBaseInfoResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.vo.MerchantConfigInfoVo;
+import com.zbkj.common.vo.MerchantSettlementInfoVo;
+import com.zbkj.service.service.MerchantService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 商户端商户信息控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant")
+@Api(tags = "商户端商户信息控制器")
+@Validated
+public class MerchantInfoController {
+
+    @Autowired
+    private MerchantService merchantService;
+
+    @PreAuthorize("hasAuthority('merchant:base:info')")
+    @ApiOperation(value = "商户端商户基础信息")
+    @RequestMapping(value = "/base/info", method = RequestMethod.GET)
+    public CommonResult<MerchantBaseInfoResponse> getBaseInfo() {
+        return CommonResult.success(merchantService.getBaseInfo());
+    }
+
+    @PreAuthorize("hasAuthority('merchant:config:info')")
+    @ApiOperation(value = "商户端商户配置信息")
+    @RequestMapping(value = "/config/info", method = RequestMethod.GET)
+    public CommonResult<MerchantConfigInfoVo> getConfigInfo() {
+        return CommonResult.success(merchantService.getConfigInfo());
+    }
+
+    @PreAuthorize("hasAuthority('merchant:settlement:info')")
+    @ApiOperation(value = "商户端商户结算信息")
+    @RequestMapping(value = "/settlement/info", method = RequestMethod.GET)
+    public CommonResult<MerchantSettlementInfoVo> getSettlementInfo() {
+        return CommonResult.success(merchantService.getSettlementInfo());
+    }
+
+    @PreAuthorize("hasAuthority('merchant:config:info:edit')")
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "商户端商户配置信息编辑")
+    @ApiOperation(value = "商户端商户配置信息编辑")
+    @RequestMapping(value = "/config/info/edit", method = RequestMethod.POST)
+    public CommonResult<String> configInfoEdit(@RequestBody @Validated MerchantConfigInfoVo request) {
+        if (merchantService.configInfoEdit(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('merchant:settlement:info:edit')")
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "商户端商户结算信息编辑")
+    @ApiOperation(value = "商户端商户结算信息编辑")
+    @RequestMapping(value = "/settlement/info/edit", method = RequestMethod.POST)
+    public CommonResult<String> settlementInfoEdit(@RequestBody @Validated MerchantSettlementInfoVo request) {
+        if (merchantService.settlementInfoEdit(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('merchant:switch:update')")
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "商户端商户开关")
+    @ApiOperation(value = "商户端商户开关")
+    @RequestMapping(value = "/switch/update", method = RequestMethod.POST)
+    public CommonResult<String> updateSwitch() {
+        if (merchantService.updateSwitch()) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+}
+
+
+

+ 38 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantLogController.java

@@ -0,0 +1,38 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.model.record.SensitiveMethodLog;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.SensitiveMethodLogService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 商户端敏感日志控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/log")
+@Api(tags = "商户端敏感日志控制器")
+public class MerchantLogController {
+
+    @Autowired
+    private SensitiveMethodLogService sensitiveMethodLogService;
+
+    @PreAuthorize("hasAuthority('merchant:log:sensitive:list')")
+    @ApiOperation(value = "敏感操作日志分页列表")
+    @RequestMapping(value = "/sensitive/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<SensitiveMethodLog>> getList(@Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(sensitiveMethodLogService.getMerchantPageList(pageParamRequest)));
+    }
+
+}

+ 84 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantLoginController.java

@@ -0,0 +1,84 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.admin.service.AdminLoginService;
+import com.zbkj.common.request.LoginAdminUpdateRequest;
+import com.zbkj.common.request.SystemAdminLoginRequest;
+import com.zbkj.common.response.AdminLoginPicResponse;
+import com.zbkj.common.response.LoginAdminResponse;
+import com.zbkj.common.response.MenusResponse;
+import com.zbkj.common.response.SystemLoginResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.utils.CrmebUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+
+/**
+ * 商户端登录控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant")
+@Api(tags = "商户端登录控制器")
+public class MerchantLoginController {
+
+    @Autowired
+    private AdminLoginService loginService;
+
+    @ApiOperation(value="登录")
+    @RequestMapping(value = "/login", method = RequestMethod.POST)
+    public CommonResult<SystemLoginResponse> SystemAdminLogin(@RequestBody @Validated SystemAdminLoginRequest systemAdminLoginRequest, HttpServletRequest request) {
+        String ip = CrmebUtil.getClientIp(request);
+        SystemLoginResponse systemAdminResponse = loginService.merchantLogin(systemAdminLoginRequest, ip);
+        return CommonResult.success(systemAdminResponse, "login success");
+    }
+
+    @PreAuthorize("hasAuthority('merchant:logout')")
+    @ApiOperation(value="登出")
+    @RequestMapping(value = "/logout", method = RequestMethod.GET)
+    public CommonResult<LoginAdminResponse> SystemAdminLogout() {
+        loginService.logout();
+        return CommonResult.success("logout success");
+    }
+
+    @PreAuthorize("hasAuthority('merchant:login:user:info')")
+    @ApiOperation(value="获取登录用户详情")
+    @RequestMapping(value = "/getAdminInfoByToken", method = RequestMethod.GET)
+    public CommonResult<LoginAdminResponse> getAdminInfo() {
+        return CommonResult.success(loginService.getInfoByToken());
+    }
+
+    @ApiOperation(value = "获取登录页图片")
+    @RequestMapping(value = "/getLoginPic", method = RequestMethod.GET)
+    public CommonResult<AdminLoginPicResponse> getLoginPic() {
+        return CommonResult.success(loginService.getMerchantLoginPic());
+    }
+
+    @PreAuthorize("hasAuthority('merchant:login:menus')")
+    @ApiOperation(value = "获取管理员可访问目录")
+    @RequestMapping(value = "/getMenus", method = RequestMethod.GET)
+    public CommonResult<List<MenusResponse>> getMenus() {
+        return CommonResult.success(loginService.getMenus());
+    }
+
+    @PreAuthorize("hasAuthority('merchant:login:admin:update')")
+    @ApiOperation(value="修改登录用户信息")
+    @RequestMapping(value = "/login/admin/update", method = RequestMethod.POST)
+    public CommonResult<SystemLoginResponse> loginAdminUpdate(@RequestBody @Validated LoginAdminUpdateRequest request) {
+        if (loginService.loginAdminUpdate(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+}

+ 43 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantMenuController.java

@@ -0,0 +1,43 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.vo.MenuCheckVo;
+import com.zbkj.service.service.SystemMenuService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+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;
+
+
+/**
+ * 商户端菜单控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/menu")
+@Api(tags = "商户端菜单控制器")
+public class MerchantMenuController {
+
+    @Autowired
+    private SystemMenuService systemMenuService;
+
+    /**
+     * 菜单缓存树
+     */
+    @PreAuthorize("hasAuthority('merchant:menu:cache:tree')")
+    @ApiOperation(value = "菜单缓存树")
+    @RequestMapping(value = "/cache/tree", method = RequestMethod.GET)
+    public CommonResult<List<MenuCheckVo>> getMerchantMenuCacheTree() {
+        return CommonResult.success(systemMenuService.getMenuCacheList());
+    }
+}
+
+
+

+ 129 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantOrderController.java

@@ -0,0 +1,129 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.model.order.OrderDetail;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.*;
+import com.zbkj.common.response.*;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.vo.LogisticsResultVo;
+import com.zbkj.service.service.OrderService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 商户侧订单控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/order")
+@Api(tags = "商户侧订单控制器") //配合swagger使用
+public class MerchantOrderController {
+
+    @Autowired
+    private OrderService orderService;
+
+    @PreAuthorize("hasAuthority('merchant:order:page:list')")
+    @ApiOperation(value = "商户端订单分页列表") //配合swagger使用
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<MerchantOrderPageResponse>> getList(@Validated OrderSearchRequest request, @Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(orderService.getMerchantAdminPage(request, pageParamRequest)));
+    }
+
+//    @PreAuthorize("hasAuthority('merchant:order:page:list2')")
+//    @ApiOperation(value = "商户端积分订单分页列表")
+//    @RequestMapping(value = "/list2", method = RequestMethod.GET)
+//    public CommonResult<CommonPage<MerchantOrder2PageResponse>> getList2(@Validated OrderSearchRequest request,
+//                                                                         @Validated PageParamRequest pageParamRequest) {
+//        return CommonResult.success(CommonPage.restPage(orderService.getMerchantAdminPage2(request, pageParamRequest)));
+//    }
+
+    @PreAuthorize("hasAuthority('merchant:order:status:num')")
+    @ApiOperation(value = "获取订单各状态数量")
+    @RequestMapping(value = "/status/num", method = RequestMethod.GET)
+    public CommonResult<OrderCountItemResponse> getOrderStatusNum(@RequestParam(value = "dateLimit", defaultValue = "") String dateLimit) {
+        return CommonResult.success(orderService.getMerchantOrderStatusNum(dateLimit));
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.DELETE, description = "商户删除订单")
+    @PreAuthorize("hasAuthority('merchant:order:delete')")
+    @ApiOperation(value = "订单删除")
+    @RequestMapping(value = "/delete/{orderNo}", method = RequestMethod.POST)
+    public CommonResult<String> delete(@PathVariable(name = "orderNo") String orderNo) {
+        if (orderService.merchantDeleteByOrderNo(orderNo)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "商户备注订单")
+    @PreAuthorize("hasAuthority('merchant:order:mark')")
+    @ApiOperation(value = "商户备注订单")
+    @RequestMapping(value = "/mark", method = RequestMethod.POST)
+    public CommonResult<String> mark(@RequestBody @Validated OrderRemarkRequest request) {
+        if (orderService.merchantMark(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('merchant:order:info')")
+    @ApiOperation(value = "订单详情")
+    @RequestMapping(value = "/info/{orderNo}", method = RequestMethod.GET)
+    public CommonResult<OrderAdminDetailResponse> info(@PathVariable(value = "orderNo") String orderNo) {
+        return CommonResult.success(orderService.adminDetail(orderNo));
+    }
+
+    @PreAuthorize("hasAuthority('merchant:order:detail:list')")
+    @ApiOperation(value = "订单细节详情列表(发货使用)")
+    @RequestMapping(value = "/{orderNo}/detail/list", method = RequestMethod.GET)
+    public CommonResult<List<OrderDetail>> getDetailList(@PathVariable(value = "orderNo") String orderNo) {
+        return CommonResult.success(orderService.getDetailList(orderNo));
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "订单发货")
+    @PreAuthorize("hasAuthority('merchant:order:send')")
+    @ApiOperation(value = "订单发货")
+    @RequestMapping(value = "/send", method = RequestMethod.POST)
+    public CommonResult<Boolean> send(@RequestBody @Validated OrderSendRequest request) {
+        if (orderService.send(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('merchant:order:invoice:list')")
+    @ApiOperation(value = "获取订单发货单列表")
+    @RequestMapping(value = "/{orderNo}/invoice/list", method = RequestMethod.GET)
+    public CommonResult<List<OrderInvoiceResponse>> getInvoiceList(@PathVariable(value = "orderNo") String orderNo) {
+        return CommonResult.success(orderService.getInvoiceList(orderNo));
+    }
+
+    @PreAuthorize("hasAuthority('merchant:order:logistics:info')")
+    @ApiOperation(value = "订单物流详情")
+    @RequestMapping(value = "/get/{invoiceId}/logistics/info", method = RequestMethod.GET)
+    public CommonResult<LogisticsResultVo> getLogisticsInfo(@PathVariable(value = "invoiceId") Integer invoiceId) {
+        return CommonResult.success(orderService.getLogisticsInfo(invoiceId));
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "核销码核销订单")
+    @PreAuthorize("hasAuthority('merchant:order:verification')")
+    @ApiOperation(value = "核销码核销订单")
+    @RequestMapping(value = "/verification", method = RequestMethod.POST)
+    public CommonResult<Object> verificationOrder(@RequestBody @Validated OrderVerificationRequest request) {
+        return CommonResult.success(orderService.verificationOrderByCode(request.getVerifyCode()));
+    }
+
+}
+
+
+

+ 95 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantProductCategoryController.java

@@ -0,0 +1,95 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.model.merchant.MerchantProductCategory;
+import com.zbkj.common.request.MerchantProductCategoryRequest;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.vo.ProCategoryCacheVo;
+import com.zbkj.service.service.MerchantProductCategoryService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+
+/**
+ * 商户端商户商品分类控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/store/product/category")
+@Api(tags = "商户端商户商品分类控制器")
+public class MerchantProductCategoryController {
+
+    @Autowired
+    private MerchantProductCategoryService categoryService;
+
+
+    @PreAuthorize("hasAuthority('merchant:product:category:list')")
+    @ApiOperation(value = "商户商品分类列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<List<MerchantProductCategory>> getList() {
+        return CommonResult.success(categoryService.getAdminList());
+    }
+
+    @PreAuthorize("hasAuthority('merchant:product:category:add')")
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.ADD, description = "新增商户商品分类")
+    @ApiOperation(value = "新增商户商品分类")
+    @RequestMapping(value = "/add", method = RequestMethod.POST)
+    public CommonResult<String> add(@RequestBody @Validated MerchantProductCategoryRequest request) {
+        if (categoryService.add(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('merchant:product:category:delete')")
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.DELETE, description = "删除商户商品分类")
+    @ApiOperation(value = "删除商户商品分类")
+    @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
+    public CommonResult<String> delete(@PathVariable(value = "id") Integer id) {
+        if (categoryService.delete(id)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('merchant:product:category:update')")
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "修改商户商品分类")
+    @ApiOperation(value = "修改商户商品分类")
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    public CommonResult<String> update(@RequestBody @Validated MerchantProductCategoryRequest request) {
+        if (categoryService.edit(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('merchant:product:category:show:status')")
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "修改商户商品分类显示状态")
+    @ApiOperation(value = "修改商户商品分类显示状态")
+    @RequestMapping(value = "/update/show/{id}", method = RequestMethod.POST)
+    public CommonResult<String> updateShowStatus(@PathVariable(value = "id") Integer id) {
+        if (categoryService.updateShowStatus(id)) {
+            return CommonResult.success("修改成功");
+        }
+        return CommonResult.failed("修改失败");
+    }
+
+    @PreAuthorize("hasAuthority('merchant:product:category:cache:tree')")
+    @ApiOperation(value = "商户商品分类缓存树")
+    @RequestMapping(value = "/cache/tree", method = RequestMethod.GET)
+    public CommonResult<List<ProCategoryCacheVo>> getCacheTree() {
+        return CommonResult.success(categoryService.getCacheTree());
+    }
+}
+
+
+

+ 226 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantProductController.java

@@ -0,0 +1,226 @@
+package com.zbkj.admin.controller.merchant;
+
+import cn.hutool.json.JSONException;
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.*;
+import com.zbkj.common.response.AdminProductListResponse;
+import com.zbkj.common.response.ProductActivityResponse;
+import com.zbkj.common.response.ProductInfoResponse;
+import com.zbkj.common.response.ProductTabsHeaderResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.ProductService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 商户端商品控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/product")
+@Api(tags = "商户端商品控制器") //配合swagger使用
+public class MerchantProductController {
+
+    @Autowired
+    private ProductService productService;
+
+    @PreAuthorize("hasAuthority('merchant:product:page:list')")
+    @ApiOperation(value = "商品分页列表") //配合swagger使用
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<AdminProductListResponse>> getList(@Validated ProductSearchRequest request,
+                                                                      @Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(productService.getAdminList(request, pageParamRequest)));
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.ADD, description = "新增商品")
+    @PreAuthorize("hasAuthority('merchant:product:save')")
+    @ApiOperation(value = "新增商品")
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    public CommonResult<String> save(@RequestBody @Validated ProductAddRequest request) {
+        if (productService.save(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+//    @PreAuthorize("hasAuthority('merchant:product:page:list2')")
+//    @ApiOperation(value = "积分商品分页列表") //配合swagger使用
+//    @RequestMapping(value = "/list2", method = RequestMethod.GET)
+//    public CommonResult<CommonPage<AdminProductListResponse>> getList2(@Validated ProductSearchRequest request,
+//                                                                       @Validated PageParamRequest pageParamRequest) {
+//        return CommonResult.success(CommonPage.restPage(productService.getAdminList2(request, pageParamRequest)));
+//    }
+//
+//    @LogControllerAnnotation(intoDB = true, methodType = MethodType.ADD, description = "新增积分商品")
+//    @PreAuthorize("hasAuthority('merchant:product:save2')")
+//    @ApiOperation(value = "新增积分商品")
+//    @RequestMapping(value = "/save2", method = RequestMethod.POST)
+//    public CommonResult<String> save2(@RequestBody @Validated ProductAddRequest request) {
+//        if (productService.save2(request)) {
+//            return CommonResult.success();
+//        }
+//        return CommonResult.failed();
+//    }
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.DELETE, description = "删除商品")
+    @PreAuthorize("hasAuthority('merchant:product:delete')")
+    @ApiOperation(value = "删除商品")
+    @RequestMapping(value = "/delete", method = RequestMethod.POST)
+    public CommonResult<String> delete(@RequestBody @Validated ProductDeleteRequest request) {
+        if (productService.deleteProduct(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "恢复回收站商品")
+    @PreAuthorize("hasAuthority('merchant:product:restore')")
+    @ApiOperation(value = "恢复回收站商品")
+    @RequestMapping(value = "/restore/{id}", method = RequestMethod.POST)
+    public CommonResult<String> restore(@PathVariable Integer id) {
+        if (productService.restoreProduct(id)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "修改商品")
+    @PreAuthorize("hasAuthority('merchant:product:update')")
+    @ApiOperation(value = "商品修改")
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    public CommonResult<String> update(@RequestBody @Validated ProductAddRequest ProductRequest) {
+        if (productService.update(ProductRequest)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('merchant:product:info')")
+    @ApiOperation(value = "商品详情")
+    @RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
+    public CommonResult<ProductInfoResponse> info(@PathVariable Integer id) {
+        return CommonResult.success(productService.getInfo(id));
+   }
+
+   @PreAuthorize("hasAuthority('merchant:product:tabs:headers')")
+   @ApiOperation(value = "商品表头数量")
+   @RequestMapping(value = "/tabs/headers", method = RequestMethod.GET)
+   public CommonResult<List<ProductTabsHeaderResponse>> getTabsHeader() {
+        return CommonResult.success(productService.getTabsHeader());
+   }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "商品提审")
+    @PreAuthorize("hasAuthority('merchant:product:submit:audit')")
+    @ApiOperation(value = "商品提审")
+    @RequestMapping(value = "/submit/audit/{id}", method = RequestMethod.POST)
+    public CommonResult<String> submitAudit(@PathVariable Integer id) {
+        if (productService.submitAudit(id)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "上架商品")
+    @PreAuthorize("hasAuthority('merchant:product:up')")
+    @ApiOperation(value = "商品上架")
+    @RequestMapping(value = "/up/{id}", method = RequestMethod.POST)
+    public CommonResult<String> up(@PathVariable Integer id) {
+        if (productService.putOnShelf(id)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "下架商品")
+    @PreAuthorize("hasAuthority('merchant:product:down')")
+    @ApiOperation(value = "商品下架")
+    @RequestMapping(value = "/down/{id}", method = RequestMethod.POST)
+    public CommonResult<String> down(@PathVariable Integer id) {
+        if (productService.offShelf(id)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "快捷添加库存")
+    @PreAuthorize("hasAuthority('merchant:product:quick:stock:add')")
+    @ApiOperation(value = "快捷添加库存")
+    @RequestMapping(value = "/quick/stock/add", method = RequestMethod.POST)
+    public CommonResult<String> quickAddStock(@RequestBody @Validated ProductAddStockRequest request) {
+        if (productService.quickAddStock(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "商品免审编辑")
+    @PreAuthorize("hasAuthority('merchant:product:review:free:edit')")
+    @ApiOperation(value = "商品免审编辑")
+    @RequestMapping(value = "/review/free/edit", method = RequestMethod.POST)
+    public CommonResult<String> reviewFreeEdit(@RequestBody @Validated ProductReviewFreeEditRequest request) {
+        if (productService.reviewFreeEdit(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+
+
+    @PreAuthorize("hasAuthority('merchant:product:import:product')")
+    @ApiOperation(value = "导入99Api商品")
+    @RequestMapping(value = "/importProduct", method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "form", value = "导入平台1=淘宝,2=京东,3=苏宁,4=拼多多, 5=天猫", dataType = "int",  required = true),
+            @ApiImplicitParam(name = "url", value = "URL", dataType = "String", required = true),
+    })
+    public CommonResult<ProductRequest> importProduct(
+            @RequestParam @Valid int form,
+            @RequestParam @Valid String url) throws IOException, JSONException {
+        ProductRequest productRequest = productService.importProductFromUrl(url, form);
+        return CommonResult.success(productRequest);
+    }
+
+    /**
+     * 获取复制商品配置
+     */
+    @PreAuthorize("hasAuthority('admin:product:copy:config')")
+    @ApiOperation(value = "获取复制商品配置")
+    @RequestMapping(value = "/copy/config", method = RequestMethod.POST)
+    public CommonResult<Map<String, Object>> copyConfig() {
+        return CommonResult.success(productService.copyConfig());
+    }
+
+
+    @PreAuthorize("hasAuthority('merchant:product:copy:product')")
+    @ApiOperation(value = "复制商品")
+    @RequestMapping(value = "/copy/product", method = RequestMethod.POST)
+    public CommonResult<Map<String, Object>> copyProduct(@RequestBody @Valid CopyProductRequest request) {
+        return CommonResult.success(productService.copyProduct(request.getUrl()));
+    }
+
+    @PreAuthorize("hasAuthority('merchant:product:activity:search:page')")
+    @ApiOperation(value = "商品搜索分页列表(活动)")
+    @RequestMapping(value = "/activity/search/page", method = RequestMethod.GET)
+    public CommonResult<CommonPage<ProductActivityResponse>> getActivitySearchPage(
+            @Validated ProductActivitySearchRequest request, @Validated PageParamRequest pageRequest) {
+        return CommonResult.success(CommonPage.restPage(productService.getActivitySearchPageByMerchant(request, pageRequest)));
+    }
+}
+
+
+

+ 73 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantProductGuaranteeGroupController.java

@@ -0,0 +1,73 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.request.ProductGuaranteeGroupAddRequest;
+import com.zbkj.common.response.ProductGuaranteeGroupListResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.ProductGuaranteeGroupService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 商户端商品保障服务组合控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/product/guarantee/group")
+@Api(tags = "商户端商品保障服务组合控制器") //配合swagger使用
+public class MerchantProductGuaranteeGroupController {
+
+    @Autowired
+    private ProductGuaranteeGroupService productGuaranteeGroupService;
+
+    @ApiOperation(value = "保障服务组合列表")
+    @PreAuthorize("hasAuthority('merchant:product:guarantee:group:list')")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<List<ProductGuaranteeGroupListResponse>> list() {
+        List<ProductGuaranteeGroupListResponse> list = productGuaranteeGroupService.findList();
+        return CommonResult.success(list);
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.ADD, description = "新增保障服务组合")
+    @ApiOperation(value = "新增保障服务组合")
+    @PreAuthorize("hasAuthority('merchant:product:guarantee:group:add')")
+    @RequestMapping(value = "/add", method = RequestMethod.POST)
+    public CommonResult<String> add(@RequestBody @Validated ProductGuaranteeGroupAddRequest request) {
+        if (productGuaranteeGroupService.add(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "编辑保障服务组合")
+    @ApiOperation(value = "编辑保障服务组合")
+    @PreAuthorize("hasAuthority('merchant:product:guarantee:group:edit')")
+    @RequestMapping(value = "/edit", method = RequestMethod.POST)
+    public CommonResult<String> edit(@RequestBody @Validated ProductGuaranteeGroupAddRequest request) {
+        if (productGuaranteeGroupService.edit(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.DELETE, description = "删除保障服务组合")
+    @ApiOperation(value = "删除保障服务组合")
+    @PreAuthorize("hasAuthority('merchant:product:guarantee:group:delete')")
+    @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
+    public CommonResult<String> delete(@PathVariable(value = "id") Integer id) {
+        if (productGuaranteeGroupService.delete(id)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+}

+ 73 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantProductReplyController.java

@@ -0,0 +1,73 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.request.ProductReplyCommentRequest;
+import com.zbkj.common.request.ProductReplySearchRequest;
+import com.zbkj.common.request.ProductReplyVirtualRequest;
+import com.zbkj.common.response.ProductReplyResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.ProductReplyService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+
+/**
+ * 商户端商品评论控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/product/reply")
+@Api(tags = "商户端商品评论控制器") //配合swagger使用
+public class MerchantProductReplyController {
+
+    @Autowired
+    private ProductReplyService storeProductReplyService;
+
+    @PreAuthorize("hasAuthority('merchant:product:reply:page:list')")
+    @ApiOperation(value = "商户端商品评论分页列表") //配合swagger使用
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<ProductReplyResponse>> getList(@Validated ProductReplySearchRequest request,
+                                                                  @Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(storeProductReplyService.getMerchantAdminPage(request, pageParamRequest)));
+    }
+
+    @PreAuthorize("hasAuthority('merchant:product:reply:virtual')")
+    @ApiOperation(value = "虚拟评论")
+    @RequestMapping(value = "/virtual", method = RequestMethod.POST)
+    public CommonResult<String> virtual(@RequestBody @Validated ProductReplyVirtualRequest request) {
+        if (storeProductReplyService.virtualCreate(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('merchant:product:reply:delete')")
+    @ApiOperation(value = "删除评论")
+    @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
+    public CommonResult<String> delete(@PathVariable Integer id) {
+        if (storeProductReplyService.delete(id)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('merchant:product:reply:comment')")
+   @ApiOperation(value = "回复评论")
+   @RequestMapping(value = "/comment", method = RequestMethod.POST)
+   public CommonResult<String> comment(@RequestBody ProductReplyCommentRequest request) {
+       if (storeProductReplyService.comment(request)) {
+           return CommonResult.success();
+       }
+       return CommonResult.failed();
+   }
+}
+
+
+

+ 88 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantProductRuleController.java

@@ -0,0 +1,88 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.model.product.ProductRule;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.request.ProductRuleRequest;
+import com.zbkj.common.request.ProductRuleSearchRequest;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.ProductRuleService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+
+/**
+ * 商品规则值(规格)控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/product/rule")
+@Api(tags = "商户端商品规则值(规格)控制器") //配合swagger使用
+public class MerchantProductRuleController {
+
+    @Autowired
+    private ProductRuleService productRuleService;
+
+    @PreAuthorize("hasAuthority('merchant:product:rule:page:list')")
+    @ApiOperation(value = "商户端商品规则值(规格)分页列表") //配合swagger使用
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<ProductRule>> getList(@Validated ProductRuleSearchRequest request,
+                                                         @Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(productRuleService.getList(request, pageParamRequest)));
+    }
+
+    @PreAuthorize("hasAuthority('merchant:product:rule:save')")
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.ADD, description = "新增商品规格")
+    @ApiOperation(value = "新增商品规格")
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    public CommonResult<String> save(@RequestBody @Validated ProductRuleRequest ProductRuleRequest) {
+        if (productRuleService.save(ProductRuleRequest)) {
+            return CommonResult.success();
+        } else {
+            return CommonResult.failed();
+        }
+    }
+
+    @PreAuthorize("hasAuthority('merchant:product:rule:delete')")
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.DELETE, description = "删除商品规格")
+    @ApiOperation(value = "删除商品规格")
+    @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
+    public CommonResult<String> delete(@PathVariable Integer id) {
+        if (productRuleService.removeById(id)) {
+            return CommonResult.success();
+        } else {
+            return CommonResult.failed();
+        }
+    }
+
+    @PreAuthorize("hasAuthority('merchant:product:rule:update')")
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "修改商品规格")
+    @ApiOperation(value = "修改商品规格")
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    public CommonResult<String> update(@RequestBody @Validated ProductRuleRequest ProductRuleRequest) {
+        if (productRuleService.updateRule(ProductRuleRequest)) {
+            return CommonResult.success();
+        } else {
+            return CommonResult.failed();
+        }
+    }
+
+    @PreAuthorize("hasAuthority('merchant:product:rule:info')")
+    @ApiOperation(value = "商品规格详情")
+    @RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
+    public CommonResult<ProductRule> info(@PathVariable Integer id) {
+        ProductRule ProductRule = productRuleService.getById(id);
+        return CommonResult.success(ProductRule);
+   }
+}
+
+
+

+ 97 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantRoleController.java

@@ -0,0 +1,97 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.model.admin.SystemRole;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.request.SystemRoleRequest;
+import com.zbkj.common.request.SystemRoleSearchRequest;
+import com.zbkj.common.request.SystemRoleStatusRequest;
+import com.zbkj.common.response.RoleInfoResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.SystemRoleService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+
+/**
+ * 商户端 管理员角色控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/role")
+@Api(tags = "商户端 管理员角色控制器")
+public class MerchantRoleController {
+
+    @Autowired
+    private SystemRoleService systemRoleService;
+
+    @PreAuthorize("hasAuthority('merchant:admin:role:list')")
+    @ApiOperation(value = "角色分页列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<SystemRole>> getList(@Validated SystemRoleSearchRequest request, @Validated PageParamRequest pageParamRequest) {
+        CommonPage<SystemRole> systemRoleCommonPage = CommonPage.restPage(systemRoleService.getList(request, pageParamRequest));
+        return CommonResult.success(systemRoleCommonPage);
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.ADD, description = "新增角色")
+    @PreAuthorize("hasAuthority('merchant:admin:role:save')")
+    @ApiOperation(value = "新增角色")
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    public CommonResult<String> save(@RequestBody @Validated SystemRoleRequest systemRoleRequest) {
+        if (systemRoleService.add(systemRoleRequest)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.DELETE, description = "删除角色")
+    @PreAuthorize("hasAuthority('merchant:admin:role:delete')")
+    @ApiOperation(value = "删除角色")
+    @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
+    public CommonResult<String> delete(@PathVariable(value = "id") Integer id) {
+        if (systemRoleService.delete(id)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "修改角色")
+    @PreAuthorize("hasAuthority('merchant:admin:role:update')")
+    @ApiOperation(value = "修改角色")
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    public CommonResult<String> update(@RequestBody @Validated SystemRoleRequest systemRoleRequest) {
+        if (systemRoleService.edit(systemRoleRequest)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('merchant:admin:role:info')")
+    @ApiOperation(value = "角色详情")
+    @RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
+    public CommonResult<RoleInfoResponse> info(@PathVariable Integer id) {
+        return CommonResult.success(systemRoleService.getInfo(id));
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "修改角色状态")
+    @PreAuthorize("hasAuthority('merchant:admin:role:update:status')")
+    @ApiOperation(value = "修改角色状态")
+    @RequestMapping(value = "/updateStatus", method = RequestMethod.POST)
+    public CommonResult<Object> updateStatus(@Validated @RequestBody SystemRoleStatusRequest request) {
+        if (systemRoleService.updateStatus(request)) {
+            return CommonResult.success("修改成功");
+        }
+        return CommonResult.failed("修改失败");
+    }
+}
+
+
+

+ 125 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantSeckillController.java

@@ -0,0 +1,125 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.admin.service.SeckillService;
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.*;
+import com.zbkj.common.response.SeckillActivityDetailResponse;
+import com.zbkj.common.response.SeckillActivityPageResponse;
+import com.zbkj.common.response.SeckillProductPageResponse;
+import com.zbkj.common.result.CommonResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+
+/**
+ * 商户端秒杀控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/seckill")
+@Api(tags = "商户端 - 秒杀管理")
+public class MerchantSeckillController {
+
+    @Autowired
+    private SeckillService seckillService;
+
+    @PreAuthorize("hasAuthority('merchant:seckill:activity:page')")
+    @ApiOperation(value = "秒杀活动分页列表")
+    @RequestMapping(value = "/activity/page", method = RequestMethod.GET)
+    public CommonResult<CommonPage<SeckillActivityPageResponse>> activityPage(@Validated SeckillActivitySearchRequest request,
+                                                                              @Validated PageParamRequest pageRequest) {
+        return CommonResult.success(CommonPage.restPage(seckillService.activityPage(request, pageRequest)));
+    }
+
+    @PreAuthorize("hasAuthority('merchant:seckill:activity:detail')")
+    @ApiOperation(value = "秒杀活动详情")
+    @RequestMapping(value = "/activity/detail/{id}", method = RequestMethod.GET)
+    public CommonResult<SeckillActivityDetailResponse> activityDetail(@PathVariable("id") Integer id) {
+        return CommonResult.success(seckillService.activityDetail(id));
+    }
+
+    @PreAuthorize("hasAuthority('merchant:seckill:product:list')")
+    @ApiOperation(value = "秒杀商品列表")
+    @RequestMapping(value = "/product/page", method = RequestMethod.GET)
+    public CommonResult<CommonPage<SeckillProductPageResponse>> getSeckillProductPage(@Validated SeckillProductSearchRequest request,
+                                                                                      @Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(seckillService.getSeckillProductPage(request, pageParamRequest)));
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "秒杀商品撤回审核")
+    @PreAuthorize("hasAuthority('merchant:seckill:product:withdraw')")
+    @ApiOperation(value = "秒杀商品撤回审核")
+    @RequestMapping(value = "/product/withdraw/{id}", method = RequestMethod.POST)
+    public CommonResult<String> withdrawProductAudit(@PathVariable("id") Integer id) {
+        if (seckillService.withdrawProductAudit(id)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "秒杀商品设置活动价")
+    @PreAuthorize("hasAuthority('merchant:seckill:product:price')")
+    @ApiOperation(value = "秒杀商品设置活动价")
+    @RequestMapping(value = "/product/set/price", method = RequestMethod.POST)
+    public CommonResult<String> setProductPrice(@RequestBody @Validated SeckillProductPriceRequest request) {
+        if (seckillService.setProductPrice(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "秒杀商品上架")
+    @PreAuthorize("hasAuthority('merchant:seckill:product:up')")
+    @ApiOperation(value = "秒杀商品上架")
+    @RequestMapping(value = "/product/up", method = RequestMethod.POST)
+    public CommonResult<String> upProduct(@RequestBody @Validated SeckillProductBatchRequest request) {
+        if (seckillService.upProduct(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "秒杀商品下架")
+    @PreAuthorize("hasAuthority('merchant:seckill:product:down')")
+    @ApiOperation(value = "秒杀商品下架")
+    @RequestMapping(value = "/product/down", method = RequestMethod.POST)
+    public CommonResult<String> downProduct(@RequestBody @Validated SeckillProductBatchRequest request) {
+        if (seckillService.downProduct(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.DELETE, description = "秒杀商品删除")
+    @PreAuthorize("hasAuthority('merchant:seckill:product:delete')")
+    @ApiOperation(value = "秒杀商品删除")
+    @RequestMapping(value = "/product/delete", method = RequestMethod.POST)
+    public CommonResult<String> deleteProduct(@RequestBody @Validated SeckillProductBatchRequest request) {
+        if (seckillService.merchantDeleteProduct(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.ADD, description = "商户秒杀商品添加")
+    @PreAuthorize("hasAuthority('merchant:seckill:product:add')")
+    @ApiOperation(value = "秒杀商品添加")
+    @RequestMapping(value = "/product/add", method = RequestMethod.POST)
+    public CommonResult<String> addProduct(@RequestBody @Validated SeckillProductAddRequest request) {
+        if (seckillService.merchantAddProduct(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+}
+
+
+

+ 66 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantUploadController.java

@@ -0,0 +1,66 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.vo.FileResultVo;
+import com.zbkj.service.service.UploadService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+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 org.springframework.web.multipart.MultipartFile;
+
+
+/**
+ * 上传文件 前端控制器 -- 商户端
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/upload")
+@Api(tags = "商户端上传文件")
+public class MerchantUploadController {
+
+    @Autowired
+    private UploadService uploadService;
+
+    /**
+     * 图片上传
+     */
+    @PreAuthorize("hasAuthority('merchant:upload:image')")
+    @ApiOperation(value = "图片上传")
+    @RequestMapping(value = "/image", method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "model", value = "模块 用户user,商品product,微信wechat,文章article,系统system"),
+            @ApiImplicitParam(name = "pid", value = "分类ID 0编辑器,1商品图片,2拼团图片,3砍价图片,4秒杀图片,5文章图片,6组合数据图,7前台用户,8微信系列 ", allowableValues = "range[0,1,2,3,4,5,6,7,8]")
+    })
+    public CommonResult<FileResultVo> image(MultipartFile multipart, @RequestParam(value = "model") String model,
+                                            @RequestParam(value = "pid") Integer pid) {
+        return CommonResult.success(uploadService.imageUpload(multipart, model, pid));
+    }
+
+    /**
+     * 文件上传
+     */
+    @PreAuthorize("hasAuthority('merchant:upload:file')")
+    @ApiOperation(value = "文件上传")
+    @RequestMapping(value = "/file", method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "model", value = "模块 用户user,商品product,微信wechat,文章article,系统system"),
+            @ApiImplicitParam(name = "pid", value = "分类ID 0编辑器,1商品图片,2拼团图片,3砍价图片,4秒杀图片,5文章图片,6组合数据图,7前台用户,8微信系列 ", allowableValues = "range[0,1,2,3,4,5,6,7,8]")
+    })
+    public CommonResult<FileResultVo> file(MultipartFile multipart, @RequestParam(value = "model") String model,
+                                           @RequestParam(value = "pid") Integer pid) {
+        return CommonResult.success(uploadService.fileUpload(multipart, model, pid));
+    }
+
+}
+
+
+

+ 50 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/MerchantUserController.java

@@ -0,0 +1,50 @@
+package com.zbkj.admin.controller.merchant;
+
+
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.MerchantUserSearchRequest;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.response.UserAdminDetailResponse;
+import com.zbkj.common.response.UserResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.UserService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 商户端用户控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/user")
+@Api(tags = "商户端用户控制器")
+@Validated
+public class MerchantUserController {
+    @Autowired
+    private UserService userService;
+
+    @PreAuthorize("hasAuthority('merchant:user:page:list')")
+    @ApiOperation(value = "商户端用户分页列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<UserResponse>> getList(@ModelAttribute @Validated MerchantUserSearchRequest request,
+                                                          @ModelAttribute PageParamRequest pageParamRequest) {
+        CommonPage<UserResponse> userCommonPage = CommonPage.restPage(userService.getMerchantPage(request, pageParamRequest));
+        return CommonResult.success(userCommonPage);
+    }
+
+    @PreAuthorize("hasAuthority('merchant:user:detail')")
+    @ApiOperation(value = "用户详情")
+    @RequestMapping(value = "/detail/{id}", method = RequestMethod.GET)
+    public CommonResult<UserAdminDetailResponse> detail(@PathVariable(value = "id") Integer id) {
+        return CommonResult.success(userService.getAdminDetail(id));
+    }
+}
+
+
+

+ 447 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/NewMerchantApi.java

@@ -0,0 +1,447 @@
+package com.zbkj.admin.controller.merchant;
+
+
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.zbkj.admin.controller.newapi.request.ProductAttrValueIntegralRequest;
+import com.zbkj.admin.service.AAAService;
+import com.zbkj.admin.service.FinanceService;
+import com.zbkj.admin.task.sms.DynamicScheduledTask;
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.model.admin.SystemAdmin;
+import com.zbkj.common.model.bill.MerchantDailyXYED;
+import com.zbkj.common.model.merchant.MerchantSms;
+import com.zbkj.common.model.merchant.MerchantSmsPay;
+import com.zbkj.common.model.merchant.MerchantSmsTemplate;
+import com.zbkj.common.model.merchant.MerchantSmsTiming;
+import com.zbkj.common.model.order.Order;
+import com.zbkj.common.model.product.Product;
+import com.zbkj.common.model.product.ProductAttrValue;
+
+import com.zbkj.common.model.user.User;
+import com.zbkj.common.model.user.UserBypassAccount;
+import com.zbkj.common.model.user.UserEnterprise;
+import com.zbkj.common.model.user.UserEnterpriseRecord;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.*;
+import com.zbkj.common.response.AdminProductListResponse;
+import com.zbkj.common.response.MerchantOrder2PageResponse;
+import com.zbkj.common.response.ProductInfoResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.utils.SecurityUtil;
+import com.zbkj.service.service.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Random;
+
+/**
+ * @Created by:   zhulei
+ * 2023/5/29 14:29
+ * code is far away from bug with the animal protecting
+ * <p>
+ * <p>
+ * █████▒█    ██  ▄████▄   ██ ▄█▀       ██████╗ ██╗   ██╗ ██████╗
+ * ▓██   ▒ ██  ▓██▒▒██▀ ▀█   ██▄█▒        ██╔══██╗██║   ██║██╔════╝
+ * ▒████ ░▓██  ▒██░▒▓█    ▄ ▓███▄░        ██████╔╝██║   ██║██║  ███╗
+ * ░▓█▒  ░▓▓█  ░██░▒▓▓▄ ▄██▒▓██ █▄        ██╔══██╗██║   ██║██║   ██║
+ * ░▒█░   ▒▒█████▓ ▒ ▓███▀ ░▒██▒ █▄       ██████╔╝╚██████╔╝╚██████╔╝
+ * ▒ ░   ░▒▓▒ ▒ ▒ ░ ░▒ ▒  ░▒ ▒▒ ▓▒       ╚═════╝  ╚═════╝  ╚═════╝
+ * ░     ░░▒░ ░ ░   ░  ▒   ░ ░▒ ▒░
+ * ░ ░    ░░░ ░ ░ ░        ░ ░░ ░
+ * ░     ░ ░      ░  ░
+ * ░
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/erkai")
+@Api(tags = "商家端二开控制器")
+@Validated
+public class NewMerchantApi {
+    @Autowired
+    private ProductAttrValueService productAttrValueService;
+    @Autowired
+    private OrderService orderService;
+    @Autowired
+    private ProductService productService;
+    @Autowired
+    private UserEnterpriseRecordService userEnterpriseRecordService;
+    @Autowired
+    private UserEnterpriseService userEnterpriseService;
+    @Autowired
+    private UserBypassAccountService userBypassAccountService;
+    @Autowired
+    private OnePassSmsService onePassSmsService;
+    @Autowired
+    private MerchantSmsTemplateService merchantSmsTemplateService;
+    @Autowired
+    private MerchantSmsTimingService merchantSmsTimingService;
+    @Autowired
+    private MerchantSmsService merchantSmsService;
+    @Autowired
+    private AAAService aaaService;
+    @Autowired
+    private SystemConfigService systemConfigService;
+    @Autowired
+    private RefundOrderService refundOrderService;
+    @Autowired
+    private UserService userService;
+    @Autowired
+    private FinanceService financeService;
+    @Autowired
+    private DynamicScheduledTask dynamicScheduledTask;
+
+
+//    @PreAuthorize("hasAuthority('merchant:productAttrValueIntegral:edit')")
+    @ApiOperation(value = "修改规格积分")
+    @RequestMapping(value = "/editIntegral", method = RequestMethod.POST)
+    public CommonResult<String> editIntegral(@RequestBody @Validated ProductAttrValueIntegralRequest request) {
+        ProductAttrValue productAttrValue =new ProductAttrValue();
+        productAttrValue.setId( request.getId() );
+        productAttrValue.setPriceIntegral( request.getPriceIntegral() );
+        if (productAttrValueService.updateById(productAttrValue)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+//    @PreAuthorize("hasAuthority('merchant:order2:page:orderList2')")
+    @ApiOperation(value = "商户端积分订单分页列表")
+    @RequestMapping(value = "/orderList2", method = RequestMethod.GET)
+    public CommonResult<CommonPage<MerchantOrder2PageResponse>> getOrderList2(@Validated OrderSearchRequest request,
+                                                                         @Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(orderService.getMerchantAdminPage2(request, pageParamRequest)));
+    }
+
+//    @PreAuthorize("hasAuthority('merchant:product2:page:productList2')")
+    @ApiOperation(value = "积分商品分页列表")
+    @RequestMapping(value = "/productList2", method = RequestMethod.GET)
+    public CommonResult<CommonPage<AdminProductListResponse>> getProductList2(@Validated ProductSearchRequest request,
+                                                                       @Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(productService.getAdminList2(request, pageParamRequest)));
+    }
+
+//    @LogControllerAnnotation(intoDB = true, methodType = MethodType.ADD, description = "新增积分商品")
+//    @PreAuthorize("hasAuthority('merchant:product2:productSave2')")
+    @ApiOperation(value = "新增积分商品")
+    @RequestMapping(value = "/productSave2", method = RequestMethod.POST)
+    public CommonResult<String> productSave2(@RequestBody @Validated ProductAddRequest request) {
+        if (productService.save2(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+//    @ApiOperation(value = "商品修改")
+//    @RequestMapping(value = "/productupdate", method = RequestMethod.POST)
+//    public CommonResult<String> productupdate(@RequestBody @Validated ProductAddRequest ProductRequest) {
+//        if (productService.update(ProductRequest)) {
+//            return CommonResult.success();
+//        }
+//        return CommonResult.failed();
+//    }
+//
+//
+//    @ApiOperation(value = "商品详情")
+//    @RequestMapping(value = "/productinfo/{id}", method = RequestMethod.GET)
+//    public CommonResult<ProductInfoResponse> productinfo(@PathVariable Integer id) {
+//        return CommonResult.success(productService.getInfo(id));
+//    }
+
+    //改打款状态 恢复信用额度  只有信用额度订单有
+    //1.先给改变状态 2.恢复额度 3.增加信用额度记录
+//    @PreAuthorize("hasAuthority('merchant:order2:remit')")
+    @ApiOperation(value = "改打款状态 完成按钮必须1.支付方式为信用额度 2.判断isRemit字段为null   OrderNo订单号")
+    @RequestMapping(value = "/remit/{OrderNo}", method = RequestMethod.GET)
+    public CommonResult<String> remit(@PathVariable String OrderNo) {
+        try {
+            Order order = orderService.getByOrderNo(OrderNo);
+
+            //2-1.恢复额度(先 还得判断订单这个用户是企业用户还是企业子用户)
+            UserEnterprise userEnterprise =null;
+            LambdaQueryWrapper<UserEnterprise> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.eq( UserEnterprise::getUserId, order.getUid() );
+            queryWrapper.eq( UserEnterprise::getIsDelete, 0 );
+            userEnterprise = userEnterpriseService.getOne( queryWrapper,false );
+            if (userEnterprise == null) {
+                LambdaQueryWrapper<UserBypassAccount> queryWrapper2 = new LambdaQueryWrapper<>();
+                queryWrapper2.eq( UserBypassAccount::getUserId, order.getUid() );
+                queryWrapper2.eq( UserBypassAccount::getIsDelete, 0 );
+                UserBypassAccount one1 = userBypassAccountService.getOne( queryWrapper2,false );
+                if (one1 == null) {
+                    return CommonResult.failed( "订单用户查询不对,恢复额度错误" );
+                } else {
+                    userEnterprise = userEnterpriseService.getById( one1.getEnterpriseId() );
+                }
+            }
+            //1.先给改变状态
+            Order order1 = new Order();
+            order1.setId( order.getId() );
+            order.setIsRemit( 1 );
+            order.setRemitTime( new Date(  ) );
+            orderService.updateById( order );
+
+            //2.恢复额度
+//            BigDecimal a = userEnterprise.getLineOfCredit();//总信用额度
+            BigDecimal b = userEnterprise.getAvailableLineOfCredit();//可用信用额度
+            BigDecimal c = userEnterprise.getUsedLineOfCredit();//已用信用额度
+
+            BigDecimal sum = b.add( order.getTotalPrice() );//可用信用额度 加 订单总价
+            BigDecimal cc = c.subtract( order.getTotalPrice() );//已用信用额度 减 订单总价
+
+
+            UserEnterprise userEnterprise2 = new UserEnterprise();
+            userEnterprise2.setId( userEnterprise.getId() );
+            userEnterprise2.setAvailableLineOfCredit( sum );
+            userEnterprise2.setUsedLineOfCredit( cc );
+            userEnterpriseService.updateById( userEnterprise2 );
+            //3.增加信用额度记录
+            UserEnterpriseRecord userEnterpriseRecord = new UserEnterpriseRecord();
+            userEnterpriseRecord.setUid( order.getUid() );
+//            userEnterpriseRecord.setLinkId(order.getOrderNo());
+            userEnterpriseRecord.setLinkType( "system" );
+            userEnterpriseRecord.setType( 1 );
+            userEnterpriseRecord.setAmount( order.getTotalPrice() );
+            userEnterpriseRecord.setBalance( sum );
+            userEnterpriseRecord.setRemark( StrUtil.format( "回款成功(线下打款),增加可用信用额度{}元",order.getTotalPrice() ) );
+            userEnterpriseRecordService.save( userEnterpriseRecord );
+            return CommonResult.success( "改打款状态成功" );
+        } catch (Exception e) {
+            return CommonResult.failed( "改打款状态失败,接口错误" );
+        }
+    }
+
+
+//    @PreAuthorize("hasAuthority('merchant:user2:selectUserEnterprise')")
+    @ApiOperation(value = "查看绑定该商家的企业用户信息")
+    @RequestMapping(value = "/selectUserEnterprise", method = RequestMethod.GET)
+    public CommonResult<List<UserEnterprise>> selectUserEnterprise() {
+        SystemAdmin systemAdmin = SecurityUtil.getLoginUserVo().getUser();
+        LambdaQueryWrapper<UserEnterprise> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq( UserEnterprise::getMerchantId, systemAdmin.getMerId() );
+        queryWrapper.eq( UserEnterprise::getIsDelete, 0 );
+        List<UserEnterprise> list = userEnterpriseService.list( queryWrapper );
+//        UserEnterprise one = userEnterpriseService.getOne( queryWrapper,false );
+        return CommonResult.success(list);
+    }
+
+    //短信
+//    @PreAuthorize("hasAuthority('merchant:one:pass:sms:getSsmNum')")
+    @ApiOperation(value = "查看短信发送次数")
+    @RequestMapping(value = "/getSsmNum", method = RequestMethod.GET)
+    public CommonResult<MerchantSms> getSsmNum() {
+        SystemAdmin systemAdmin = SecurityUtil.getLoginUserVo().getUser();
+        LambdaQueryWrapper<MerchantSms> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq( MerchantSms::getMerId, systemAdmin.getMerId() );
+        MerchantSms one = merchantSmsService.getOne( queryWrapper,false );
+        if (one==null){
+            return CommonResult.failed("未查到该商户的短信开通情况");
+        }
+        return CommonResult.success(one);
+    }
+
+    //这步需要调起支付  支付回调里面加次数
+//    @ApiOperation(value = "购买短信发送次数(num是购买次数)")
+//    @RequestMapping(value = "/buySsmNum/{num}", method = RequestMethod.POST)
+//    public CommonResult<String> buySsmNum(@PathVariable Integer num) {
+//        SmsPayRequest smsPayRequest = new SmsPayRequest();
+//        smsPayRequest.setDescription( "商户端短信购买" );
+//        String s = aaaService.smsPay( smsPayRequest );
+//        //以下都是测试加次数用的  正式应该调用配置  查看发送一次多少钱乘 num 然后调起支付在支付回调里做以下这些事
+//        SystemAdmin systemAdmin = SecurityUtil.getLoginUserVo().getUser();
+//        LambdaQueryWrapper<MerchantSms> queryWrapper = new LambdaQueryWrapper<>();
+//        queryWrapper.eq( MerchantSms::getMerId, systemAdmin.getMerId() );
+//        MerchantSms one = merchantSmsService.getOne( queryWrapper,false );
+//        if (one==null){
+//           //没有开通  创建
+//            MerchantSms merchantSms =new MerchantSms();
+//            merchantSms.setMerId( systemAdmin.getMerId() );
+//            //到时候需要改变
+//            merchantSms.setTransmissionTimes( 0 );
+//            merchantSms.setTransmissionTimesThen( 0 );
+//            merchantSmsService.save( merchantSms );
+//        }
+//        one.setTransmissionTimes( one.getTransmissionTimes()+1 );
+//        merchantSmsService.updateById( one );
+//        return CommonResult.success("创建成功");
+//    }
+    @ApiOperation(value = "购买短信发送次数(num是购买次数)")
+    @RequestMapping(value = "/buySsmNum/{num}", method = RequestMethod.POST)
+    public CommonResult<MerchantSmsPay> buySsmNum(@PathVariable Integer num) {
+        SystemAdmin systemAdmin = SecurityUtil.getLoginUserVo().getUser();
+        SmsPayRequest smsPayRequest = new SmsPayRequest();
+
+        HashMap<String, String> info = systemConfigService.info( 101 );
+        String str = info.get( "sms_a_lump_sum" );
+        Integer sms_a_lump_sum = Integer.valueOf( str );
+
+        Random rnd = new Random();
+        int number = rnd.nextInt(900000) + 100000;
+        String outTradeNo = systemAdmin.getMerId()+"_"+num+"_"+number;
+        smsPayRequest.setAmount( sms_a_lump_sum*num);
+        smsPayRequest.setOutTradeNo( outTradeNo);
+        smsPayRequest.setDescription( "商户端短信购买" );
+        String s = aaaService.smsPay( smsPayRequest );
+
+        MerchantSmsPay merchantSmsPay = new MerchantSmsPay();
+        merchantSmsPay.setBase64( s );
+        merchantSmsPay.setCode( 200 );
+        merchantSmsPay.setMsg( "获取微信支付二维码成功" );
+        return CommonResult.success(merchantSmsPay);
+    }
+
+//    @ApiOperation(value = "微信支付回调")
+//    @RequestMapping(value = "/wechat", method = RequestMethod.POST)
+//    public String weChat(@RequestBody String  request) {
+//        System.out.println("微信支付回调 request ===> " + request);
+//        String response = callbackService.wechatPayCallback2(request);
+//        System.out.println("微信支付回调 response ===> " + response);
+//        return response;
+//    }
+
+    @ApiOperation(value = "获取发送手机号(查询的order)")
+    @RequestMapping(value = "/getPhone", method = RequestMethod.GET)
+    public CommonResult<CommonPage<User>> getPhone(@Validated PageParamRequest pageParamRequest) {
+        SystemAdmin systemAdmin = SecurityUtil.getLoginUserVo().getUser();
+        LambdaQueryWrapper<Order> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq( Order::getMerId, systemAdmin.getMerId() );
+
+        Page<Order> orderPage = PageHelper.startPage(pageParamRequest.getPage(), pageParamRequest.getLimit());
+        List<Integer> orderUid = orderService.getOrderUid();
+
+        LambdaQueryWrapper<User> queryWrapper2 = new LambdaQueryWrapper<>();
+        queryWrapper2.in( User::getId, orderUid );
+        List<User> list = userService.list( queryWrapper2 );
+
+        return CommonResult.success( CommonPage.restPage(CommonPage.copyPageInfo(orderPage, list)) );
+    }
+
+//    @PreAuthorize("hasAuthority('merchant:one:pass:sms:temps')")
+    @ApiOperation(value = "短信模板")
+    @RequestMapping(value = "/temps", method = RequestMethod.GET)
+    public CommonResult<CommonPage<MerchantSmsTemplate>> temps(@Validated PageParamRequest pageParamRequest) {
+        SystemAdmin systemAdmin = SecurityUtil.getLoginUserVo().getUser();
+        LambdaQueryWrapper<MerchantSmsTemplate> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq( MerchantSmsTemplate::getMerId, systemAdmin.getMerId() );
+
+        Page<MerchantSmsTemplate> productPage = PageHelper.startPage(pageParamRequest.getPage(), pageParamRequest.getLimit());
+        List<MerchantSmsTemplate> list = merchantSmsTemplateService.list( queryWrapper );
+
+        return CommonResult.success( CommonPage.restPage(CommonPage.copyPageInfo(productPage, list)) );
+//        Page<MerchantSmsTemplate> page = new Page<MerchantSmsTemplate>( pageNo, pageSize );
+//        IPage<MerchantSmsTemplate> pageList = merchantSmsTemplateService.page( page, queryWrapper );
+//        return CommonResult.success(pageList);
+    }
+
+    @ApiOperation(value = "申请短信模板")
+    @RequestMapping(value = "/temp/apply", method = RequestMethod.POST)
+    public CommonResult<String> applyTempMessage(@RequestBody @Validated SmsApplyTempRequest request) {
+        request.setType( 2 );
+        if (onePassSmsService.applyTempMessage2(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @ApiOperation(value = "删除短信模板")
+    @RequestMapping(value = "/delTemps/{id}", method = RequestMethod.POST)
+    public CommonResult<String> delTemps(@PathVariable String id) {
+        if (merchantSmsTemplateService.removeById( id )) {
+            LambdaQueryWrapper<MerchantSmsTiming> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.eq( MerchantSmsTiming::getTempbId, id );
+            List<MerchantSmsTiming> list = merchantSmsTimingService.list( queryWrapper );
+            if (list.size()!=0){
+                merchantSmsTimingService.remove( queryWrapper );
+                dynamicScheduledTask.addTask();
+            }
+            return CommonResult.success("删除短信模板成功");
+        }
+        return CommonResult.failed();
+    }
+
+    //发送短信sendSSM方法  发送要减数据库次数
+//    @PreAuthorize("hasAuthority('merchant:one:pass:sms:temp:sendSSM')")
+    @ApiOperation(value = "发送(id为模板id)")
+    @RequestMapping(value = "/sendSSM", method = RequestMethod.POST)
+    public CommonResult<String> sendSSM(@RequestBody @Validated MerchantSmsTiming merchantSmsTiming) {
+        String phone = merchantSmsTiming.getPhone();
+        String tempId = merchantSmsTiming.getTempId();
+        if (onePassSmsService.sendSSM(phone, Integer.valueOf( tempId ) )) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed("请求错误可能是发送次数不够");
+    }
+
+
+    @ApiOperation(value = "添加定时发送任务")
+    @RequestMapping(value = "/sendSSMTiming", method = RequestMethod.POST)
+    public CommonResult<String> sendSSMTiming(@RequestBody @Validated MerchantSmsTiming merchantSmsTiming) {
+        SystemAdmin systemAdmin = SecurityUtil.getLoginUserVo().getUser();
+        merchantSmsTiming.setMerId( systemAdmin.getMerId() );
+        if (merchantSmsTimingService.save( merchantSmsTiming )) {
+            dynamicScheduledTask.addTask();
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @ApiOperation(value = "查询定时发送任务(id为模板id)")
+    @RequestMapping(value = "/selectSSMTiming/{tempId}", method = RequestMethod.POST)
+    public CommonResult<MerchantSmsTiming> selectSSMTiming(@PathVariable Integer tempId) {
+        SystemAdmin systemAdmin = SecurityUtil.getLoginUserVo().getUser();
+        LambdaQueryWrapper<MerchantSmsTiming> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq( MerchantSmsTiming::getMerId, systemAdmin.getMerId() );
+        queryWrapper.eq( MerchantSmsTiming::getTempId, tempId );
+        MerchantSmsTiming one = merchantSmsTimingService.getOne( queryWrapper,false );
+        return CommonResult.success(one);
+    }
+
+    @ApiOperation(value = "修改定时发送任务")
+    @RequestMapping(value = "/updateSSMTiming", method = RequestMethod.POST)
+    public CommonResult<String> updateSSMTiming(@RequestBody @Validated MerchantSmsTiming merchantSmsTiming) {
+        if (merchantSmsTimingService.updateById(merchantSmsTiming)) {
+            dynamicScheduledTask.addTask();
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+
+    @ApiOperation(value = "信用额度日帐单管理分页列表")
+    @RequestMapping(value = "/daily/xyed/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<MerchantDailyXYED>> getDailyXyedList(@RequestParam(value = "dateLimit", required =
+            false, defaultValue = "") String dateLimit,
+                                                                             @ModelAttribute PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(financeService.getMerchantDailyXyedList(dateLimit, pageParamRequest)));
+    }
+
+
+    @ApiOperation(value = "信用额度月帐单管理分页列表")
+    @RequestMapping(value = "/month/xyed/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<MerchantDailyXYED>> getMonthXyedList(@RequestParam(value = "dateLimit", required = false, defaultValue = "") String dateLimit,
+                                                                                  @ModelAttribute PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(financeService.getMerchantMonthXyedList(dateLimit, pageParamRequest)));
+    }
+//    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "信用额度订单退款")
+//    @ApiOperation(value = "信用额度订单退款")
+//    @RequestMapping(value = "/refund2", method = RequestMethod.GET)
+//    public CommonResult<String> refund2(@ModelAttribute @Validated OrderRefundAuditRequest request) {
+//        if (refundOrderService.refund(request)) {
+//            return CommonResult.success();
+//        }
+//        return CommonResult.failed();
+//    }
+}

+ 54 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/PayComponentCatMerchantController.java

@@ -0,0 +1,54 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.vo.wxvedioshop.cat_brand.CatItem;
+import com.zbkj.service.service.PayComponentCatService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+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;
+
+
+/**
+ * 组件类目表 前端控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/pay/component/cat")
+@Api(tags = "04小程序 自定义交易组件—类目") //配合swagger使用
+public class PayComponentCatMerchantController {
+
+    @Autowired
+    private PayComponentCatService payComponentCatService;
+
+    /**
+     * 获取类目列表
+     */
+    @PreAuthorize("hasAuthority('merchant:pay:component:cat:list')")
+    @ApiOperation(value = "获取类目列表")
+    @RequestMapping(value = "/get/list", method = RequestMethod.GET)
+    public CommonResult<List<CatItem>> getList() {
+        return CommonResult.success(payComponentCatService.getTreeList());
+    }
+
+
+    /**
+     * 获取类目(测试用,前端不调用)
+     */
+    @ApiOperation(value = "获取类目(测试用,前端不调用)")
+    @RequestMapping(value = "/get", method = RequestMethod.GET)
+    public CommonResult<Object> sendUserCode() {
+        payComponentCatService.autoUpdate();
+        return CommonResult.success();
+    }
+}
+
+
+

+ 54 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/PayComponentDeliveryCompanyMerchantController.java

@@ -0,0 +1,54 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.model.wechat.video.PayComponentDeliveryCompany;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.PayComponentDeliveryCompanyService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+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;
+
+
+/**
+ * 组件快递公司表 前端控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/pay/component/delivery/company")
+@Api(tags = "05小程序 自定义交易组件—快递公司")
+public class PayComponentDeliveryCompanyMerchantController {
+
+    @Autowired
+    private PayComponentDeliveryCompanyService payComponentDeliveryCompanyService;
+
+    /**
+     * 获取组件快递
+     */
+    @PreAuthorize("hasAuthority('merchant:pay:component:delivery:company:get')")
+    @ApiOperation(value = "获取组件快递(测试用,前端不调用)")
+    @RequestMapping(value = "/get", method = RequestMethod.GET)
+    public CommonResult<Object> get(){
+        payComponentDeliveryCompanyService.updateData();
+        return CommonResult.success();
+    }
+
+    /**
+     * 获取组件快递列表
+     */
+    @PreAuthorize("hasAuthority('merchant:pay:component:delivery:company:get:list')")
+    @ApiOperation(value = "获取组件快递")
+    @RequestMapping(value = "/get/list", method = RequestMethod.GET)
+    public CommonResult<List<PayComponentDeliveryCompany>> getList(){
+        return CommonResult.success(payComponentDeliveryCompanyService.getList());
+    }
+}
+
+
+

+ 108 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/PayComponentDraftMerchantProductController.java

@@ -0,0 +1,108 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.model.wechat.video.PayComponentDraftProduct;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.request.wxvedio.product.ComponentProductSearchRequest;
+import com.zbkj.common.request.wxvedio.product.PayComponentDraftProductMerchantOperationReviewStatus;
+import com.zbkj.common.request.wxvedio.product.PayComponentProductAddRequest;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.PayComponentDraftProductService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @Auther: 大粽子
+ * @Date: 2022/10/10 19:36
+ * @Description: 微信 自定义交易组件 草稿商品 控制器
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/pay/component/draftproduct")
+@Api(tags = "08小程序 自定义交易组件—草稿商品") //配合swagger使用
+public class PayComponentDraftMerchantProductController {
+
+    @Autowired
+    private PayComponentDraftProductService payComponentDraftProductService;
+
+    /**
+     * 添加商品 添加商品到草稿 不自动提审 有专门提审的api
+     */
+    @PreAuthorize("hasAuthority('merchant:pay:component:product:draft:add')")
+    @ApiOperation(value = "添加草稿商品")
+    @RequestMapping(value = "/add", method = RequestMethod.POST)
+    public CommonResult<Object> add(@RequestBody @Validated PayComponentProductAddRequest addRequest) {
+        if (payComponentDraftProductService.add(addRequest)) {
+            return CommonResult.success("添加商品成功");
+        }
+        return CommonResult.failed("添加商品失败");
+    }
+
+
+    /**
+     * 编辑草稿商品 不自动提审 有专门提审的api
+     */
+    @PreAuthorize("hasAuthority('merchant:pay:component:product:draft:update')")
+    @ApiOperation(value = "编辑草稿商品")
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    public CommonResult<Object> update(@RequestBody @Validated PayComponentProductAddRequest addRequest) {
+        if (payComponentDraftProductService.edit(addRequest)) {
+            return CommonResult.success("编辑草稿商品成功");
+        }
+        return CommonResult.failed("编辑草稿商品失败");
+    }
+
+    /**
+     * 删除草稿商品 不自动提审 有专门提审的api
+     */
+    @PreAuthorize("hasAuthority('merchant:pay:component:product:draft:delete')")
+    @ApiOperation(value = "删除草稿商品")
+    @RequestMapping(value = "/delete/{id}", method = RequestMethod.GET)
+    public CommonResult<Object> delete(@PathVariable Integer id) {
+        if (payComponentDraftProductService.removeById(id)) {
+            return CommonResult.success("删除草稿商品成功");
+        }
+        return CommonResult.failed("删除草稿商品失败");
+    }
+
+    /**
+     * 草稿商品 商家审核操作
+     */
+    @PreAuthorize("hasAuthority('merchant:pay:component:product:draft:review')")
+    @ApiOperation(value = "商家提审草稿商品")
+    @RequestMapping(value = "/review", method = RequestMethod.POST)
+    public CommonResult<Object> review(@RequestBody @Validated PayComponentDraftProductMerchantOperationReviewStatus reviewStatus) {
+        if (payComponentDraftProductService.OperationPlatformReviewStatusByMerchant(reviewStatus)) {
+            return CommonResult.success("商家操作草稿商品成功");
+        }
+        return CommonResult.failed("商家操作草稿商品失败");
+    }
+
+    /**
+     * 当前商户获取自己的草稿商品列表(分页)
+     * @param request 搜索条件
+     * @param pageParamRequest 分页参数
+     */
+    @PreAuthorize("hasAuthority('merchant:pay:component:product:draft:list')")
+    @ApiOperation(value = "当前商户获取自己的草稿商品列表(分页))") //配合swagger使用
+    @RequestMapping(value = "/draft/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<PayComponentDraftProduct>> getDraftList(@Validated ComponentProductSearchRequest request,
+                                                                           @Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(payComponentDraftProductService.getCurrentMerchantAdminListBeforeWeChatReview(request, pageParamRequest)));
+    }
+
+    /**
+     * 草稿商品详情
+     */
+    @PreAuthorize("hasAuthority('merchant:pay:component:product:draft:info')")
+    @ApiOperation(value = "草稿商品详情") //配合swagger使用
+    @RequestMapping(value = "/draft/get/{id}", method = RequestMethod.GET)
+    public CommonResult<PayComponentDraftProduct> getDraftInfo(@PathVariable Integer id) {
+        return CommonResult.success(payComponentDraftProductService.getInfo(id));
+    }
+}

+ 100 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/PayComponentProductMerchantController.java

@@ -0,0 +1,100 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.model.wechat.video.PayComponentProduct;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.request.wxvedio.product.ComponentProductSearchRequest;
+import com.zbkj.common.response.wxvideo.PayComponentProductResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.PayComponentProductService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ *  组件商品表 前端控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/pay/component/product")
+@Api(tags = "07小程序 自定义交易组件—过审商品") //配合swagger使用
+public class PayComponentProductMerchantController {
+
+    @Autowired
+    private PayComponentProductService payComponentProductService;
+
+    /**
+     * 删除商品
+     */
+    @PreAuthorize("hasAuthority('merchant:pay:component:product:delete')")
+    @ApiOperation(value = "删除商品")
+    @RequestMapping(value = "/delete/{proId}", method = RequestMethod.GET)
+    public CommonResult<Object> delete(@PathVariable Integer proId) {
+        if (payComponentProductService.delete(proId)) {
+            return CommonResult.success("删除商品成功");
+        }
+        return CommonResult.failed("删除商品失败");
+    }
+
+    /**
+     * 商家上架商品
+     */
+    @PreAuthorize("hasAuthority('merchant:pay:component:product:puton')")
+    @ApiOperation(value = "上架商品")
+    @RequestMapping(value = "/puton/{proId}", method = RequestMethod.GET)
+    public CommonResult<Object> puton(@PathVariable Integer proId) {
+        if (payComponentProductService.putonByMerchant(proId)) {
+            return CommonResult.success("上架商品成功");
+        }
+        return CommonResult.failed("上架商品失败");
+    }
+
+    /**
+     * 商家下架商品
+     */
+    @PreAuthorize("hasAuthority('merchant:pay:component:product:putdown')")
+    @ApiOperation(value = "下架商品")
+    @RequestMapping(value = "/putdown/{proId}", method = RequestMethod.GET)
+    public CommonResult<Object> putdown(@PathVariable Integer proId) {
+        if (payComponentProductService.putdownByMerchant(proId)) {
+            return CommonResult.success("下架商品成功");
+        }
+        return CommonResult.failed("下架商品失败");
+    }
+
+    /**
+     * 当前商户的过审商品列表(分页)
+     * @param request 搜索条件
+     * @param pageParamRequest 分页参数
+     */
+    @PreAuthorize("hasAuthority('merchant:pay:component:product:list')")
+    @ApiOperation(value = "过审商品列表(分页)") //配合swagger使用
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<PayComponentProduct>> getList(@Validated ComponentProductSearchRequest request,
+                                                                 @Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(payComponentProductService.getMerchantProductListByAfterWechatReview(request, pageParamRequest)));
+    }
+
+
+    /**
+     * 过审商品详情
+     */
+    @PreAuthorize("hasAuthority('merchant:pay:component:product:info')")
+    @ApiOperation(value = "过审商品详情") //配合swagger使用
+    @RequestMapping(value = "/get/{id}", method = RequestMethod.GET)
+    public CommonResult<PayComponentProductResponse> getInfo(@PathVariable Integer id) {
+        return CommonResult.success(payComponentProductService.getInfo(id));
+    }
+}
+
+
+

+ 72 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/PayComponentShopMerchantController.java

@@ -0,0 +1,72 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.model.wechat.video.PayComponentShopBrand;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.request.wxvedio.image.ShopUploadImgRequest;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.vo.wxvedioshop.WechatVideoUploadImageResponseVo;
+import com.zbkj.common.vo.wxvedioshop.cat_brand.ShopCatDetailVo;
+import com.zbkj.service.service.PayComponentShopService;
+import com.zbkj.service.service.WechatVideoBeforeService;
+import com.zbkj.service.service.WechatVideoSpuService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ *  自定义交易组件—商家及接入前
+
+ */
+@RestController
+@RequestMapping("api/admin/merchant/pay/component/shop")
+@Api(tags = "02微信小程序 自定义交易组件—接入商品前必须接口") //配合swagger使用
+public class PayComponentShopMerchantController {
+
+    @Autowired
+    private PayComponentShopService shopService;
+
+    @Autowired
+    private WechatVideoBeforeService wechatVideoBeforeService;
+
+    @Autowired
+    private WechatVideoSpuService wechatVideoSpuService;
+
+    /***************************************** 接入之前必须调用 START ************************************************/
+
+    @PreAuthorize("hasAuthority('merchant:pay:component:shop:cat:get')")
+    @ApiOperation(value = "获取类目详情")
+    @RequestMapping(value = "/cat/get", method = RequestMethod.POST)
+    public CommonResult<List<ShopCatDetailVo>> shopCatGet() {
+        return CommonResult.success(wechatVideoSpuService.getShopCat());
+    }
+
+    @PreAuthorize("hasAuthority('merchant:pay:component:shop:img:upload')")
+    @ApiOperation(value = "上传图片 到微信自定义组件换链接")
+    @RequestMapping(value = "/img/upload", method = RequestMethod.POST)
+    public CommonResult<WechatVideoUploadImageResponseVo> shopImgUpload(@RequestBody ShopUploadImgRequest request) {
+        return CommonResult.success(wechatVideoBeforeService.shopImgUpload(request));
+    }
+
+    /***************************************** 接入之前必须调用 END ************************************************/
+
+
+    @PreAuthorize("hasAuthority('merchant:pay:component:shop:brand:list')")
+    @ApiOperation(value = "品牌列表 分页")
+    @RequestMapping(value = "/brand/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<PayComponentShopBrand>> shopBrandList(@Validated PageParamRequest pageParamRequest, @RequestParam(value = "status", required = false) Integer status) {
+        return CommonResult.success(CommonPage.restPage(shopService.brandList(pageParamRequest, status)));
+    }
+
+    @PreAuthorize("hasAuthority('merchant:pay:component:shop:brand:usable:list')")
+    @ApiOperation(value = "品牌列表 不分页")
+    @RequestMapping(value = "/brand/usable/list", method = RequestMethod.GET)
+    public CommonResult<List<PayComponentShopBrand>> shopUsableBrandList() {
+        return CommonResult.success(shopService.usableBrandList());
+    }
+}

+ 51 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/PlatProductBrandController.java

@@ -0,0 +1,51 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.BrandCategorySearchRequest;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.response.ProductBrandResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.ProductBrandService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+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;
+
+
+/**
+ * 平台端商品品牌控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/plat/product/brand")
+@Api(tags = "商户端商品品牌控制器")
+public class PlatProductBrandController {
+
+    @Autowired
+    private ProductBrandService productBrandService;
+
+    @PreAuthorize("hasAuthority('merchant:plat:product:brand:list')")
+    @ApiOperation(value = "品牌分页列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<ProductBrandResponse>> getList(@Validated BrandCategorySearchRequest request, @Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(productBrandService.getPageListByCategory(request, pageParamRequest)));
+    }
+
+    @PreAuthorize("hasAuthority('merchant:plat:product:brand:cache:list')")
+    @ApiOperation(value = "品牌缓存列表(全部)")
+    @RequestMapping(value = "/cache/list", method = RequestMethod.GET)
+    public CommonResult<List<ProductBrandResponse>> getCacheAllList() {
+        return CommonResult.success(productBrandService.getCacheAllList());
+    }
+}
+
+
+

+ 40 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/PlatProductCategoryController.java

@@ -0,0 +1,40 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.vo.ProCategoryCacheVo;
+import com.zbkj.service.service.ProductCategoryService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+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;
+
+
+/**
+ * 商户端商品分类控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/plat/product/category")
+@Api(tags = "商户端商品分类控制器")
+public class PlatProductCategoryController {
+
+    @Autowired
+    private ProductCategoryService productCategoryService;
+
+    @PreAuthorize("hasAuthority('merchant:plat:product:category:cache:tree')")
+    @ApiOperation(value = "分类缓存树")
+    @RequestMapping(value = "/cache/tree", method = RequestMethod.GET)
+    public CommonResult<List<ProCategoryCacheVo>> getMerchantCacheTree() {
+        return CommonResult.success(productCategoryService.getMerchantCacheTree());
+    }
+}
+
+
+

+ 43 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/PlatProductGuaranteeController.java

@@ -0,0 +1,43 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.model.product.ProductGuarantee;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.ProductGuaranteeService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+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;
+
+
+/**
+ * 平台端商品保障服务控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/plat/product/guarantee")
+@Api(tags = "商户端商品保障服务控制器")
+public class PlatProductGuaranteeController {
+
+    @Autowired
+    private ProductGuaranteeService guaranteeService;
+
+    @PreAuthorize("hasAuthority('merchant:plat:product:guarantee:list')")
+    @ApiOperation(value = "保障服务列表")
+    @ApiImplicitParam(name="type", value="类型,0-全部,1-有效", required = true)
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<List<ProductGuarantee>> getList(@RequestParam(name = "type", defaultValue = "0") Integer type) {
+        return CommonResult.success(guaranteeService.getList(type));
+    }
+}
+
+
+

+ 93 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/RefundOrderController.java

@@ -0,0 +1,93 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.OrderRefundAuditRequest;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.request.RefundOrderRemarkRequest;
+import com.zbkj.common.request.RefundOrderSearchRequest;
+import com.zbkj.common.response.MerchantRefundOrderPageResponse;
+import com.zbkj.common.response.RefundOrderAdminDetailResponse;
+import com.zbkj.common.response.RefundOrderCountItemResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.RefundOrderService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 商户侧退款订单控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/refund/order")
+@Api(tags = "商户侧退款订单控制器") //配合swagger使用
+public class RefundOrderController {
+
+    @Autowired
+    private RefundOrderService refundOrderService;
+
+    @PreAuthorize("hasAuthority('merchant:refund:order:page:list')")
+    @ApiOperation(value = "商户端退款订单分页列表") //配合swagger使用
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<MerchantRefundOrderPageResponse>> getList(@Validated RefundOrderSearchRequest request, @Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(refundOrderService.getMerchantAdminPage(request, pageParamRequest)));
+    }
+
+    @PreAuthorize("hasAuthority('merchant:refund:order:detail')")
+    @ApiOperation(value = "商户端退款订单详情") //配合swagger使用
+    @RequestMapping(value = "/detail/{refundOrderNo}", method = RequestMethod.GET)
+    public CommonResult<RefundOrderAdminDetailResponse> getDetail(@PathVariable(value = "refundOrderNo") String refundOrderNo) {
+        return CommonResult.success(refundOrderService.getMerchantDetail(refundOrderNo));
+    }
+
+    @PreAuthorize("hasAuthority('merchant:refund:order:status:num')")
+    @ApiOperation(value = "商户端获取退款订单各状态数量")
+    @RequestMapping(value = "/status/num", method = RequestMethod.GET)
+    public CommonResult<RefundOrderCountItemResponse> getOrderStatusNum(@RequestParam(value = "dateLimit", defaultValue = "") String dateLimit) {
+        return CommonResult.success(refundOrderService.getMerchantOrderStatusNum(dateLimit));
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "商户备注退款订单")
+    @PreAuthorize("hasAuthority('merchant:refund:order:mark')")
+    @ApiOperation(value = "商户备注退款订单")
+    @RequestMapping(value = "/mark", method = RequestMethod.POST)
+    public CommonResult<String> mark(@RequestBody @Validated RefundOrderRemarkRequest request) {
+        if (refundOrderService.mark(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "订单退款")
+    @PreAuthorize("hasAuthority('merchant:refund:order:refund')")
+    @ApiOperation(value = "订单退款")
+    @RequestMapping(value = "/refund", method = RequestMethod.GET)
+    public CommonResult<String> refund(@ModelAttribute @Validated OrderRefundAuditRequest request) {
+        if (refundOrderService.refund(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "订单拒绝退款")
+    @PreAuthorize("hasAuthority('merchant:refund:order:refund:refuse')")
+    @ApiOperation(value = "拒绝退款")
+    @RequestMapping(value = "/refund/refuse", method = RequestMethod.GET)
+    public CommonResult<String> refundRefuse(@ModelAttribute @Validated OrderRefundAuditRequest request) {
+        if (refundOrderService.refundRefuse(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+}
+
+
+

+ 85 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/ShippingTemplatesController.java

@@ -0,0 +1,85 @@
+package com.zbkj.admin.controller.merchant;
+
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.model.express.ShippingTemplates;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.request.ShippingTemplatesRequest;
+import com.zbkj.common.request.ShippingTemplatesSearchRequest;
+import com.zbkj.common.response.ShippingTemplatesInfoResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.ShippingTemplatesService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 物流-模板控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/merchant/shipping/templates")
+@Api(tags = "商户端 -- 运费模板")
+public class ShippingTemplatesController {
+
+    @Autowired
+    private ShippingTemplatesService shippingTemplatesService;
+
+    @PreAuthorize("hasAuthority('merchant:shipping:templates:list')")
+    @ApiOperation(value = "运费模板分页列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<ShippingTemplates>> getList(@Validated ShippingTemplatesSearchRequest request, @Validated PageParamRequest pageParamRequest) {
+        CommonPage<ShippingTemplates> shippingTemplatesCommonPage = CommonPage.restPage(shippingTemplatesService.getList(request, pageParamRequest));
+        return CommonResult.success(shippingTemplatesCommonPage);
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.ADD, description = "新增运费模板")
+    @PreAuthorize("hasAuthority('merchant:shipping:templates:save')")
+    @ApiOperation(value = "新增运费模板")
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    public CommonResult<String> save(@RequestBody @Validated ShippingTemplatesRequest request) {
+        if (shippingTemplatesService.create(request)) {
+            return CommonResult.success("新增运费模板成功");
+        }
+        return CommonResult.failed("新增运费模板失败");
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.DELETE, description = "删除运费模板")
+    @PreAuthorize("hasAuthority('merchant:shipping:templates:delete')")
+    @ApiOperation(value = "删除运费模板")
+    @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
+    public CommonResult<String> delete(@PathVariable(value = "id") Integer id) {
+        if (shippingTemplatesService.remove(id)) {
+            return CommonResult.success();
+        } else {
+            return CommonResult.failed();
+        }
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "运费模板修改")
+    @PreAuthorize("hasAuthority('merchant:shipping:templates:update')")
+    @ApiOperation(value = "运费模板修改")
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    public CommonResult<String> update(@RequestBody @Validated ShippingTemplatesRequest request) {
+        if (shippingTemplatesService.edit(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('merchant:shipping:templates:info')")
+    @ApiOperation(value = "运费模板详情")
+    @RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
+    public CommonResult<ShippingTemplatesInfoResponse> info(@PathVariable(value = "id") Integer id) {
+        return CommonResult.success(shippingTemplatesService.getInfo(id));
+    }
+}
+
+
+

+ 28 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/newapi/request/AuthenticationRequest.java

@@ -0,0 +1,28 @@
+package com.zbkj.admin.controller.newapi.request;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "UserEnterpriseSearchRequest对象", description = "企业用户查询请求对象")
+public class AuthenticationRequest implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "真实姓名")
+    private String realName;
+
+    @ApiModelProperty(value = "手机号(全匹配)")
+    private String phone;
+
+    @ApiModelProperty(value = "企业名称")
+    private String enterpriseName;
+}

+ 28 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/newapi/request/AuthenticationSearchRequest.java

@@ -0,0 +1,28 @@
+package com.zbkj.admin.controller.newapi.request;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "UserEnterpriseSearchRequest对象", description = "企业用户查询请求对象")
+public class AuthenticationSearchRequest implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "真实姓名")
+    private String userId;
+
+    @ApiModelProperty(value = "手机号(全匹配)")
+    private String phone;
+
+    @ApiModelProperty(value = "企业名称")
+    private String enterpriseName;
+}

+ 26 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/newapi/request/BoundShopRequest.java

@@ -0,0 +1,26 @@
+package com.zbkj.admin.controller.newapi.request;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+
+@Data
+public class BoundShopRequest implements Serializable {
+
+
+    @ApiModelProperty(value = "企业用户id")
+    private Integer id;
+
+    @ApiModelProperty(value = "绑定商户id")
+    private Integer merchantId;
+
+    @ApiModelProperty(value = "绑定商户name")
+    private String merchantName;
+
+}

+ 26 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/newapi/request/ProductAttrValueIntegralRequest.java

@@ -0,0 +1,26 @@
+package com.zbkj.admin.controller.newapi.request;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ProductAttrValueIntegralRequest对象", description = "企业用户查询请求对象")
+public class ProductAttrValueIntegralRequest implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "规格id")
+    private Integer id;
+
+    @ApiModelProperty(value = "修改积分")
+    private Integer priceIntegral;
+
+}

+ 118 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/newapi/request/ProductIntegralAddRequest.java

@@ -0,0 +1,118 @@
+package com.zbkj.admin.controller.newapi.request;
+
+import com.zbkj.common.request.ProductAttrAddRequest;
+import com.zbkj.common.request.ProductAttrValueAddRequest;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.hibernate.validator.constraints.Length;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotEmpty;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 积分商品添加对象
+
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ProductIntegralAddRequest对象", description="积分商品添加对象")
+public class ProductIntegralAddRequest implements Serializable {
+
+    private static final long serialVersionUID = -452373239606480650L;
+
+    @ApiModelProperty(value = "积分商品id|添加时不填,修改时必填")
+    private Integer id;
+
+    @ApiModelProperty(value = "商品id|如果选择已有商品作为积分商品时必填")
+    private Integer productId;
+
+    @ApiModelProperty(value = "商品图片", required = true)
+    @NotBlank(message = "商品图片不能为空")
+    @Length(max = 255, message = "商品图片名称长度不能超过255个字符")
+    private String image;
+
+    @ApiModelProperty(value = "展示图")
+    @Length(max = 1000, message = "展示图名称长度不能超过1000个字符")
+    private String flatPattern;
+
+    @ApiModelProperty(value = "轮播图", required = true)
+    @NotBlank(message = "轮播图不能为空")
+    @Length(max = 2000, message = "轮播图名称长度不能超过2000个字符")
+    private String sliderImage;
+
+    @ApiModelProperty(value = "商品名称", required = true)
+    @NotBlank(message = "商品名称不能为空")
+    @Length(max = 128, message = "商品名称长度不能超过128个字符")
+    private String name;
+
+    @ApiModelProperty(value = "商品简介", required = true)
+    @NotBlank(message = "商品简介不能为空")
+    @Length(max = 256, message = "商品简介长度不能超过256个字符")
+    private String intro;
+
+    @ApiModelProperty(value = "关键字", required = true)
+    @Length(max = 255, message = "关键字长度不能超过255个字符")
+    @NotBlank(message = "关键字不能为空")
+    private String keyword;
+
+    @ApiModelProperty(value = "商户商品分类id|逗号分隔", required = true)
+    @NotBlank(message = "商户商品分类不能为空")
+    @Length(max = 64, message = "商品分类组合长度不能超过64个字符")
+    private String cateId;
+
+    @ApiModelProperty(value = "品牌id", required = true)
+    @NotNull(message = "品牌id不能为空")
+    private Integer brandId;
+
+    @ApiModelProperty(value = "平台分类id", required = true)
+    @NotNull(message = "平台分类id不能为空")
+    private Integer categoryId;
+
+    @ApiModelProperty(value = "保障服务ids(英文逗号拼接)")
+    private String guaranteeIds;
+
+    @ApiModelProperty(value = "单位名", required = true)
+    @NotBlank(message = "单位名称不能为空")
+    @Length(max = 32, message = "单位名长度不能超过32个字符")
+    private String unitName;
+
+    @ApiModelProperty(value = "运费模板ID", required = true)
+    @NotNull(message = "运费模板ID不能为空")
+    private Integer tempId;
+
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+    @ApiModelProperty(value = "规格 0单 1多", required = true)
+    @NotNull(message = "商品规格类型不能为空")
+    private Boolean specType;
+
+    @ApiModelProperty(value = "是否单独分佣", required = true)
+    @NotNull(message = "请选择是否单独分佣")
+    private Boolean isSub;
+
+    @Valid
+    @ApiModelProperty(value = "商品属性", required = true)
+    @NotEmpty(message = "商品属性不能为空")
+    private List<ProductAttrAddRequest> attr;
+
+    @Valid
+    @ApiModelProperty(value = "商品属性详情", required = true)
+    @NotEmpty(message = "商品属性详情不能为空")
+    private List<ProductAttrValueAddRequest> attrValue;
+
+    @ApiModelProperty(value = "商品描述")
+    private String content;
+
+    @ApiModelProperty(value = "优惠券id集合")
+    private List<Integer> couponIds;
+
+}

+ 44 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/newapi/request/ProductIntegralSearchRequest.java

@@ -0,0 +1,44 @@
+package com.zbkj.common.request;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.hibernate.validator.constraints.Range;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+/**
+ * 积分商品商品查询请求对象
+
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ProductIntegralSearchRequest对象", description = "积分商品商品查询请求对象")
+public class ProductIntegralSearchRequest implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+//    @ApiModelProperty(value = "类型(1:出售中(已上架),2:仓库中(未上架),3:已售罄,4:警戒库存,5:回收站,6:待审核,7:审核失败)")
+//    @NotNull(message = "商品类型不能为空")
+//    @Range(min = 1, max = 7, message = "未知的商品类型")
+//    private int type;
+
+    @ApiModelProperty(value = "平台商品分类ID")
+    private Integer categoryId;
+
+    @ApiModelProperty(value = "商户商品分类ID")
+    private String cateId;
+
+    @ApiModelProperty(value = "关键字搜索,支持(商品名称, 关键字)")
+    private String keywords;
+
+    @ApiModelProperty(value = "商户ID,平台端商品列表使用")
+    private Integer merId;
+
+//    @ApiModelProperty(value = "商户是否自营:0-非自营,1-自营,平台端商品列表使用")
+//    private Integer isSelf;
+}

+ 23 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/newapi/request/SetLineOfCreditRequest.java

@@ -0,0 +1,23 @@
+package com.zbkj.admin.controller.newapi.request;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+
+@Data
+public class SetLineOfCreditRequest implements Serializable {
+
+
+    @ApiModelProperty(value = "id")
+    private Integer id;
+
+    @ApiModelProperty(value = "信用额度")
+    private BigDecimal lineOfCredit;
+
+}

+ 27 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/newapi/request/UserEnterpriseSearchRequest.java

@@ -0,0 +1,27 @@
+package com.zbkj.admin.controller.newapi.request;
+
+import com.zbkj.common.annotation.StringContains;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+
+@Data
+public class UserEnterpriseSearchRequest implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "真实姓名")
+    private String realName;
+
+    @ApiModelProperty(value = "手机号(全匹配)")
+    private String phone;
+
+    @ApiModelProperty(value = "企业名称")
+    private String enterpriseName;
+}

+ 138 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/ActivityStyleController.java

@@ -0,0 +1,138 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.common.constants.DateConstants;
+import com.zbkj.common.model.acticitystyle.ActivityStyle;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.ActivityStyleRequest;
+import com.zbkj.common.request.ActivityStyleSearchRequest;
+import com.zbkj.common.request.ActivityStyleUpdateStatusRequest;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.response.ActivityStyleResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.utils.CrmebDateUtil;
+import com.zbkj.service.service.ActivityStyleService;
+import com.zbkj.service.service.SystemAttachmentService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+
+/**
+ * 活动样式 前端控制器
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/activitystyle")
+@Api(tags = "活动样式") //配合swagger使用
+public class ActivityStyleController {
+
+    @Autowired
+    private ActivityStyleService activityStyleService;
+    @Autowired
+    private SystemAttachmentService systemAttachmentService;
+
+    /**
+     * 分页显示
+     *
+     * @param request          搜索条件
+     * @param pageParamRequest 分页参数
+     * @author dazongzi
+     * @since 2023-01-05
+     */
+    @PreAuthorize("hasAuthority('platform:activitystyle:list')")
+    @ApiOperation(value = "分页列表") //配合swagger使用
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<ActivityStyleResponse>> getList(@Validated ActivityStyleSearchRequest request,
+                                                                   @ModelAttribute PageParamRequest pageParamRequest) {
+        CommonPage<ActivityStyleResponse> activityStyleCommonPage = CommonPage.restPage(activityStyleService.getList(request, pageParamRequest));
+        return CommonResult.success(activityStyleCommonPage);
+    }
+
+    /**
+     * 新增
+     *
+     * @param activityStyleRequest 新增参数
+     * @author dazongzi
+     * @since 2023-01-05
+     */
+    @PreAuthorize("hasAuthority('platform:activitystyle:save')")
+    @ApiOperation(value = "新增")
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    public CommonResult<String> save(@RequestBody @Validated ActivityStyleRequest activityStyleRequest) {
+        ActivityStyle activityStyle = new ActivityStyle();
+        BeanUtils.copyProperties(activityStyleRequest, activityStyle);
+        activityStyle.setStarttime(CrmebDateUtil.strToDate(activityStyleRequest.getStarttime(), DateConstants.DATE_FORMAT));
+        activityStyle.setEndtime(CrmebDateUtil.strToDate(activityStyleRequest.getEndtime(), DateConstants.DATE_FORMAT));
+        activityStyle.setStyle(systemAttachmentService.clearPrefix(activityStyle.getStyle()));
+        if (activityStyleService.save(activityStyle)) {
+            return CommonResult.success();
+        } else {
+            return CommonResult.failed();
+        }
+    }
+
+    /**
+     * 删除
+     *
+     * @param id Integer
+     * @author dazongzi
+     * @since 2023-01-05
+     */
+    @PreAuthorize("hasAuthority('platform:activitystyle:delete')")
+    @ApiOperation(value = "删除")
+    @RequestMapping(value = "/delete", method = RequestMethod.GET)
+    public CommonResult<String> delete(@RequestParam(value = "id") Integer id) {
+        if (activityStyleService.removeById(id)) {
+            return CommonResult.success();
+        } else {
+            return CommonResult.failed();
+        }
+    }
+
+    /**
+     * 修改
+     *
+     * @param activityStyleRequest 修改参数
+     * @author dazongzi
+     * @since 2023-01-05
+     */
+    @PreAuthorize("hasAuthority('platform:activitystyle:edite')")
+    @ApiOperation(value = "修改")
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    public CommonResult<String> update(@RequestBody @Validated ActivityStyleRequest activityStyleRequest) {
+        ActivityStyle activityStyle = new ActivityStyle();
+        BeanUtils.copyProperties(activityStyleRequest, activityStyle);
+        activityStyle.setId(activityStyleRequest.getId());
+        activityStyle.setStyle(systemAttachmentService.clearPrefix(activityStyle.getStyle()));
+        activityStyle.setStarttime(CrmebDateUtil.strToDate(activityStyleRequest.getStarttime(), DateConstants.DATE_FORMAT));
+        activityStyle.setEndtime(CrmebDateUtil.strToDate(activityStyleRequest.getEndtime(), DateConstants.DATE_FORMAT));
+        if (activityStyleService.updateById(activityStyle)) {
+            return CommonResult.success();
+        } else {
+            return CommonResult.failed();
+        }
+    }
+
+    /**
+     * 更新状态
+     */
+    @PreAuthorize("hasAuthority('platform:activitystyle:updatestatus')")
+    @ApiOperation(value = "更新状态")
+    @RequestMapping(value = "/status", method = RequestMethod.POST)
+    public CommonResult<String> updateStatus(@RequestBody @Validated ActivityStyleUpdateStatusRequest activityStyleUpdateStatusRequest) {
+        boolean result = activityStyleService.updateStatus(activityStyleUpdateStatusRequest.getId(), activityStyleUpdateStatusRequest.getStatus());
+        if (result) {
+            return CommonResult.success();
+        } else {
+            return CommonResult.failed();
+        }
+    }
+}
+
+
+

+ 190 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/AgreementController.java

@@ -0,0 +1,190 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.common.constants.SysConfigConstants;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.SystemConfigService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.constraints.NotEmpty;
+
+/**
+ * 文字协议 控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/agreement")
+@Api(tags = "协议管理")
+public class AgreementController {
+    @Autowired
+    private SystemConfigService systemConfigService;
+
+    /**
+     * 保存用户注册协议
+     */
+    @PreAuthorize("hasAuthority('platform:system:agreement:user:save')")
+    @ApiOperation(value = "用户注册协议 保存")
+    @RequestMapping(value = "/usersave", method = RequestMethod.POST)
+    public CommonResult<Boolean> userAgreementSave(@RequestBody @NotEmpty String agreement) {
+        return CommonResult.success(systemConfigService.updateOrSaveValueByName(SysConfigConstants.USER_REGISTER_AGREEMENT, agreement));
+    }
+
+    /**
+     * 获取用户注册协议
+     */
+    @PreAuthorize("hasAuthority('platform:system:agreement:user:info')")
+    @ApiOperation(value = "用户注册协议 详情")
+    @RequestMapping(value = "/userinfo", method = RequestMethod.GET)
+    public CommonResult<String> userAgreementInfo() {
+        return CommonResult.success(systemConfigService.getAgreementByKey(SysConfigConstants.USER_REGISTER_AGREEMENT),"获取用户注册协议成功");
+    }
+
+    /**
+     * 保存商户入住协议
+     */
+    @PreAuthorize("hasAuthority('platform:system:agreement:merincomming:save')")
+    @ApiOperation(value = "商户入驻协议 保存")
+    @RequestMapping(value = "/merincommingsave", method = RequestMethod.POST)
+    public CommonResult<Boolean> merincommingAgreementSave(@RequestBody @NotEmpty String agreement) {
+        return CommonResult.success(systemConfigService.updateOrSaveValueByName(SysConfigConstants.MERCHANT_SETTLEMENT_AGREEMENT, agreement));
+    }
+
+    /**
+     * 获取商户入住协议
+     */
+    @PreAuthorize("hasAuthority('platform:system:agreement:merincomming:info')")
+    @ApiOperation(value = "商户入驻协议 详情")
+    @RequestMapping(value = "/merincomminginfo", method = RequestMethod.GET)
+    public CommonResult<String> merincommingAgreementInfo() {
+        return CommonResult.success(systemConfigService.getAgreementByKey(SysConfigConstants.MERCHANT_SETTLEMENT_AGREEMENT),"获取商户入驻协议 成功");
+    }
+
+    /**
+     * 保存用户隐私协议
+     */
+    @PreAuthorize("hasAuthority('platform:system:agreement:userprivacy:save')")
+    @ApiOperation(value = "用户隐私协议 保存")
+    @RequestMapping(value = "/userprivacysave", method = RequestMethod.POST)
+    public CommonResult<Boolean> userPrivacyAgreementSave(@RequestBody @NotEmpty String agreement) {
+        return CommonResult.success(systemConfigService.updateOrSaveValueByName(SysConfigConstants.USER_PRIVACY_AGREEMENT, agreement));
+    }
+
+    /**
+     * 获取用户隐私协议
+     */
+    @PreAuthorize("hasAuthority('platform:system:agreement:userprivacy:info')")
+    @ApiOperation(value = "用户隐私协议 详情")
+    @RequestMapping(value = "/userprivacyinfo", method = RequestMethod.GET)
+    public CommonResult<String> userPrivacyAgreementInfo() {
+        return CommonResult.success(systemConfigService.getAgreementByKey(SysConfigConstants.USER_PRIVACY_AGREEMENT),"获取用户隐私协议 成功");
+    }
+
+    /**
+     * 保存用户注销协议
+     */
+    @PreAuthorize("hasAuthority('platform:system:agreement:useraccountcancel:save')")
+    @ApiOperation(value = "用户注销协议 保存")
+    @RequestMapping(value = "/useraccountcancelsave", method = RequestMethod.POST)
+    public CommonResult<Boolean> userAccountCancelAgreementSave(@RequestBody @NotEmpty String agreement) {
+        return CommonResult.success(systemConfigService.updateOrSaveValueByName(SysConfigConstants.USER_CANCEL_AGREEMENT, agreement));
+    }
+
+    /**
+     * 获取用户注销协议
+     */
+    @PreAuthorize("hasAuthority('platform:system:agreement:useraccountcancel:info')")
+    @ApiOperation(value = "用户注销协议 详情")
+    @RequestMapping(value = "/useraccountcancelinfo", method = RequestMethod.GET)
+    public CommonResult<String> userAccountCancelAgreementInfo() {
+        return CommonResult.success(systemConfigService.getAgreementByKey(SysConfigConstants.USER_CANCEL_AGREEMENT), "获取用户注销协议 成功");
+    }
+
+
+    /**
+     * 保存用户注销重要提示
+     */
+    @PreAuthorize("hasAuthority('platform:system:agreement:useraccountcancelnotice:save')")
+    @ApiOperation(value = "用户注销声明 保存")
+    @RequestMapping(value = "/useraccountcancelnoticesave", method = RequestMethod.POST)
+    public CommonResult<Boolean> userAccountCancelNoticeAgreementSave(@RequestBody @NotEmpty String agreement) {
+        return CommonResult.success(systemConfigService.updateOrSaveValueByName(SysConfigConstants.USER_CANCEL_NOTICE_AGREEMENT, agreement));
+    }
+
+    /**
+     * 获取用户注销声明重要提示
+     */
+    @PreAuthorize("hasAuthority('platform:system:agreement:useraccountcancelnotice:info')")
+    @ApiOperation(value = "用户注销声明 详情")
+    @RequestMapping(value = "/useraccountcancelnoticeinfo", method = RequestMethod.GET)
+    public CommonResult<String> userAccountCancelNoticeAgreementInfo() {
+        return CommonResult.success(systemConfigService.getAgreementByKey(SysConfigConstants.USER_CANCEL_NOTICE_AGREEMENT),"获取用户注销声明 成功");
+    }
+
+    /**
+     * 关于我们协议保存
+     */
+    @PreAuthorize("hasAuthority('platform:system:agreement:aboutus:save')")
+    @ApiOperation(value = "关于我们协议 保存")
+    @RequestMapping(value = "/aboutussave", method = RequestMethod.POST)
+    public CommonResult<Boolean> aboutusAgreementSave(@RequestBody @NotEmpty String agreement) {
+        return CommonResult.success(systemConfigService.updateOrSaveValueByName(SysConfigConstants.ABOUTUS_AGREEMENT, agreement));
+    }
+
+    /**
+     * 关于我们协议 详情
+     */
+    @PreAuthorize("hasAuthority('platform:system:agreement:aboutus:info')")
+    @ApiOperation(value = "关于我们协议 详情")
+    @RequestMapping(value = "/aboutusinfo", method = RequestMethod.GET)
+    public CommonResult<String> aboutusAgreementInfo() {
+        return CommonResult.success(systemConfigService.getAgreementByKey(SysConfigConstants.ABOUTUS_AGREEMENT), "获取关于我们协议 成功");
+    }
+
+    /**
+     * 平台资质证明 保存
+     */
+    @PreAuthorize("hasAuthority('platform:system:agreement:intelligent:save')")
+    @ApiOperation(value = "平台资质证明 保存")
+    @RequestMapping(value = "/intelligentsave", method = RequestMethod.POST)
+    public CommonResult<Boolean> intelligentAgreementSave(@RequestBody @NotEmpty String agreement) {
+        return CommonResult.success(systemConfigService.updateOrSaveValueByName(SysConfigConstants.PLATFROM_INTELLIGENT_AGREEMENT, agreement));
+    }
+
+    /**
+     * 平台资质证明 详情
+     */
+    @PreAuthorize("hasAuthority('platform:system:agreement:intelligent:info')")
+    @ApiOperation(value = "平台资质证明 详情")
+    @RequestMapping(value = "/intelligentinfo", method = RequestMethod.GET)
+    public CommonResult<String> intelligentAgreementInfo() {
+        return CommonResult.success(systemConfigService.getAgreementByKey(SysConfigConstants.PLATFROM_INTELLIGENT_AGREEMENT),"获取平台资质证明 成功");
+    }
+
+    /**
+     * 平台规则 保存
+     */
+    @PreAuthorize("hasAuthority('platform:system:agreement:platfromrule:save')")
+    @ApiOperation(value = "平台规则 保存")
+    @RequestMapping(value = "/platfromrulesave", method = RequestMethod.POST)
+    public CommonResult<Boolean> platfromRuleAgreementSave(@RequestBody @NotEmpty String agreement) {
+        return CommonResult.success(systemConfigService.updateOrSaveValueByName(SysConfigConstants.PLATFROM_RULE_AGREEMENT, agreement));
+    }
+
+    /**
+     * 平台规则 详情
+     */
+    @PreAuthorize("hasAuthority('platform:system:agreement:platfromrule:info')")
+    @ApiOperation(value = "平台规则 详情")
+    @RequestMapping(value = "/platfromruleinfo", method = RequestMethod.GET)
+    public CommonResult<String> platfromRuleAgreementInfo() {
+        return CommonResult.success(systemConfigService.getAgreementByKey(SysConfigConstants.PLATFROM_RULE_AGREEMENT),"获取平台规则 成功");
+    }
+}

+ 89 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/ArticleCategoryController.java

@@ -0,0 +1,89 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.request.ArticleCategoryRequest;
+import com.zbkj.common.response.ArticleCategoryResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.ArticleCategoryService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+
+/**
+ * 文章管理表 前端控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/article/category")
+@Api(tags = "文章分类管理")
+public class ArticleCategoryController {
+
+    @Autowired
+    private ArticleCategoryService articleCategoryService;
+
+    @PreAuthorize("hasAuthority('platform:article:category:list')")
+    @ApiOperation(value = "文章分类分页列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<List<ArticleCategoryResponse>> getList() {
+        return CommonResult.success(articleCategoryService.getAdminList());
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.ADD, description = "新增文章分类")
+    @PreAuthorize("hasAuthority('platform:article:category:add')")
+    @ApiOperation(value = "新增文章分类")
+    @RequestMapping(value = "/add", method = RequestMethod.POST)
+    public CommonResult<String> add(@RequestBody @Validated ArticleCategoryRequest request) {
+        if (articleCategoryService.create(request)) {
+            return CommonResult.success();
+        } else {
+            return CommonResult.failed();
+        }
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.DELETE, description = "删除文章分类")
+    @PreAuthorize("hasAuthority('platform:article:category:delete')")
+    @ApiOperation(value = "删除文章分类")
+    @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
+    public CommonResult<String> delete(@PathVariable(value = "id") Integer id) {
+        if (articleCategoryService.deleteById(id)) {
+            return CommonResult.success();
+        } else {
+            return CommonResult.failed();
+        }
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "修改文章分类")
+    @PreAuthorize("hasAuthority('platform:article:category:update')")
+    @ApiOperation(value = "修改文章分类")
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    public CommonResult<String> update(@RequestBody @Validated ArticleCategoryRequest request) {
+        if (articleCategoryService.edit(request)) {
+            return CommonResult.success();
+        } else {
+            return CommonResult.failed();
+        }
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "文章分类开关")
+    @PreAuthorize("hasAuthority('platform:article:category:switch')")
+    @ApiOperation(value="文章分类开关")
+    @RequestMapping(value = "/switch/{id}", method = RequestMethod.POST)
+    public CommonResult<String> categorySwitch(@PathVariable("id") Integer id) {
+        if (articleCategoryService.categorySwitch(id)) {
+            return CommonResult.success("切换文章分类开关成功");
+        }
+        return CommonResult.failed("切换文章分类开关失败");
+    }
+}
+
+
+

+ 103 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/ArticleController.java

@@ -0,0 +1,103 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.ArticleRequest;
+import com.zbkj.common.request.ArticleSearchRequest;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.response.ArticleInfoResponse;
+import com.zbkj.common.response.ArticleResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.ArticleService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+
+/**
+ * 文章管理表 前端控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/article")
+@Api(tags = "文章管理")
+public class ArticleController {
+
+    @Autowired
+    private ArticleService articleService;
+
+    @PreAuthorize("hasAuthority('platform:article:list')")
+    @ApiOperation(value = "文章分页列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "cid", value = "分类id", dataType = "int"),
+            @ApiImplicitParam(name = "title", value = "标题", dataType = "string"),
+            @ApiImplicitParam(name = "author", value = "作者", dataType = "string")
+    })
+    public CommonResult<CommonPage<ArticleResponse>> getList(@Validated ArticleSearchRequest request,
+                                                             @Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(articleService.getAdminList(request, pageParamRequest)));
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.ADD, description = "文章新增")
+    @PreAuthorize("hasAuthority('platform:article:save')")
+    @ApiOperation(value = "文章新增")
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    public CommonResult<String> save(@RequestBody @Validated ArticleRequest articleRequest) {
+        if (articleService.create(articleRequest)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.DELETE, description = "删除文章")
+    @PreAuthorize("hasAuthority('platform:article:delete')")
+    @ApiOperation(value = "删除文章")
+    @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
+    public CommonResult<String> delete(@PathVariable(value = "id") Integer id) {
+        if (articleService.deleteById(id)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "文章编辑")
+    @PreAuthorize("hasAuthority('platform:article:update')")
+    @ApiOperation(value = "文章编辑")
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    public CommonResult<String> update(@RequestBody @Validated ArticleRequest articleRequest) {
+        if (articleService.updateArticle(articleRequest)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:article:info')")
+    @ApiOperation(value = "文章详情")
+    @RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
+    public CommonResult<ArticleInfoResponse> info(@PathVariable(value = "id") Integer id) {
+        return CommonResult.success(articleService.getDetail(id));
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "文章开关")
+    @PreAuthorize("hasAuthority('platform:article:switch')")
+    @ApiOperation(value = "文章开关")
+    @RequestMapping(value = "/switch/{id}", method = RequestMethod.POST)
+    public CommonResult<String> articleSwitch(@PathVariable("id") Integer id) {
+        if (articleService.articleSwitch(id)) {
+            return CommonResult.success("切换文章开关成功");
+        }
+        return CommonResult.failed("切换文章开关失败");
+    }
+}
+
+
+

+ 79 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/CityRegionController.java

@@ -0,0 +1,79 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.request.CityRegionEditRequest;
+import com.zbkj.common.request.CityRegionRequest;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.vo.CityVo;
+import com.zbkj.service.service.CityRegionService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PathVariable;
+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;
+
+
+/**
+ * 城市区域控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/city/region")
+@Api(tags = "城市管理")
+public class CityRegionController {
+
+    @Autowired
+    private CityRegionService cityRegionService;
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.ADD, description = "城市区域添加")
+    @PreAuthorize("hasAuthority('platform:city:region:add')")
+    @ApiOperation(value = "城市区域添加")
+    @RequestMapping(value = "/add", method = RequestMethod.POST)
+    public CommonResult<String> add(@Validated CityRegionRequest request) {
+        if (cityRegionService.add(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "城市区域编辑")
+    @PreAuthorize("hasAuthority('platform:city:region:edit')")
+    @ApiOperation(value = "城市区域编辑")
+    @RequestMapping(value = "/edit", method = RequestMethod.POST)
+    public CommonResult<String> edit(@Validated CityRegionEditRequest request) {
+        if (cityRegionService.edit(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.DELETE, description = "城市区域删除")
+    @PreAuthorize("hasAuthority('platform:city:region:delete')")
+    @ApiOperation(value = "城市区域删除")
+    @RequestMapping(value = "/delete/{regionId}", method = RequestMethod.POST)
+    public CommonResult<String> delete(@PathVariable(value = "regionId") Integer regionId) {
+        if (cityRegionService.delete(regionId)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:city:region:list:tree')")
+    @ApiOperation(value = "获取城市区域tree结构的列表")
+    @RequestMapping(value = "/list/tree", method = RequestMethod.GET)
+    public CommonResult<List<CityVo>> getListTree() {
+        return CommonResult.success(cityRegionService.getRegionListTree());
+    }
+}
+
+
+

+ 48 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/CopyrightController.java

@@ -0,0 +1,48 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.admin.copyright.CopyrightInfoResponse;
+import com.zbkj.admin.copyright.CopyrightUpdateInfoRequest;
+import com.zbkj.admin.service.CopyrightService;
+import com.zbkj.common.result.CommonResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ * 版权控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/copyright")
+@Api(tags = "版权控制器")
+public class CopyrightController {
+
+    @Autowired
+    private CopyrightService copyrightService;
+
+    @PreAuthorize("hasAuthority('platform:copyright:get:info')")
+    @ApiOperation(value = "获取版权信息")
+    @RequestMapping(value = "/get/info", method = RequestMethod.GET)
+    public CommonResult<CopyrightInfoResponse> getInfo() {
+        return CommonResult.success(copyrightService.getInfo());
+    }
+
+    @PreAuthorize("hasAuthority('platform:copyright:update:company:info')")
+    @ApiOperation(value = "编辑公司版权信息")
+    @RequestMapping(value = "/update/company/info", method = RequestMethod.POST)
+    public CommonResult<Object> updateCompanyInfo(@RequestBody @Validated CopyrightUpdateInfoRequest request) {
+        if (copyrightService.updateCompanyInfo(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+}

+ 88 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/ExpressController.java

@@ -0,0 +1,88 @@
+package com.zbkj.admin.controller.platform;
+
+import com.alibaba.fastjson.JSONObject;
+import com.zbkj.common.model.express.Express;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.ExpressSearchRequest;
+import com.zbkj.common.request.ExpressUpdateRequest;
+import com.zbkj.common.request.ExpressUpdateShowRequest;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.ExpressService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+
+/**
+ * 平台端物流公司控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/express")
+@Api(tags = "平台端物流公司控制器")
+public class ExpressController {
+
+    @Autowired
+    private ExpressService expressService;
+
+    @PreAuthorize("hasAuthority('platform:express:list')")
+    @ApiOperation(value = "分页显示快递公司列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    @ApiImplicitParam(name="keywords", value="搜索关键字")
+    public CommonResult<CommonPage<Express>> getList(@Validated ExpressSearchRequest request,
+                                                     @ModelAttribute PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(expressService.getList(request, pageParamRequest)));
+    }
+
+    @PreAuthorize("hasAuthority('platform:express:update')")
+    @ApiOperation(value = "编辑快递公司")
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    public CommonResult<String> update(@RequestBody @Validated ExpressUpdateRequest expressRequest) {
+        if (expressService.updateExpress(expressRequest)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:express:update:show')")
+    @ApiOperation(value = "修改快递公司显示状态")
+    @RequestMapping(value = "/update/show", method = RequestMethod.POST)
+    public CommonResult<String> update(@RequestBody @Validated ExpressUpdateShowRequest expressRequest) {
+        if (expressService.updateExpressShow(expressRequest)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:express:sync')")
+    @ApiOperation(value = "同步物流公司")
+    @RequestMapping(value = "/sync/express", method = RequestMethod.POST)
+    public CommonResult<String> syncExpress() {
+        if (expressService.syncExpress()) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+
+    @PreAuthorize("hasAuthority('platform:express:info')")
+    @ApiOperation(value = "快递公司详情")
+    @RequestMapping(value = "/info", method = RequestMethod.GET)
+    @ApiImplicitParam(name="id", value="快递公司ID", required = true)
+    public CommonResult<Express> info(@RequestParam(value = "id") Integer id) {
+        return CommonResult.success(expressService.getInfo(id));
+   }
+
+}
+
+
+

+ 162 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/FinanceController.java

@@ -0,0 +1,162 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.admin.service.FinanceService;
+import com.zbkj.common.model.bill.PlatformDailyStatement;
+import com.zbkj.common.model.bill.PlatformMonthStatement;
+import com.zbkj.common.model.user.UserClosing;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.*;
+import com.zbkj.common.response.FundsFlowResponse;
+import com.zbkj.common.response.MerchantClosingInfoResponse;
+import com.zbkj.common.response.MerchantClosingPlatformPageResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.vo.MerchantClosingConfigVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+
+/**
+ * 平台端财务控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/finance")
+@Api(tags = "平台端财务控制器")
+public class FinanceController {
+
+    @Autowired
+    private FinanceService financeService;
+
+    @PreAuthorize("hasAuthority('platform:finance:user:closing:page:list')")
+    @ApiOperation(value = "用户结算分页列表")
+    @RequestMapping(value = "/user/closing/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<UserClosing>> getUserClosingPageList(@ModelAttribute UserClosingSearchRequest request,
+                                                                        @ModelAttribute PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(financeService.getUserClosingPageList(request, pageParamRequest)));
+    }
+
+    @PreAuthorize("hasAuthority('platform:finance:user:closing:audit')")
+    @ApiOperation(value = "用户结算申请审核")
+    @RequestMapping(value = "/user/closing/audit", method = RequestMethod.POST)
+    public CommonResult<String> userClosingAudit(@RequestBody @Validated ClosingAuditRequest request) {
+        if (financeService.userClosingAudit(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:finance:user:closing:proof')")
+    @ApiOperation(value = "用户结算到账凭证")
+    @RequestMapping(value = "/user/closing/proof", method = RequestMethod.POST)
+    public CommonResult<String> userClosingProof(@RequestBody @Validated ClosingProofRequest request) {
+        if (financeService.userClosingProof(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:finance:user:closing:remark')")
+    @ApiOperation(value = "用户结算备注")
+    @RequestMapping(value = "/user/closing/remark", method = RequestMethod.POST)
+    public CommonResult<String> userClosingRemark(@RequestBody @Validated ClosingRemarkRequest request) {
+        if (financeService.userClosingRemark(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:finance:merchant:closing:config')")
+    @ApiOperation(value = "获取商户结算设置")
+    @RequestMapping(value = "/merchant/closing/config", method = RequestMethod.GET)
+    public CommonResult<MerchantClosingConfigVo> getMerchantClosingConfig() {
+        return CommonResult.success(financeService.getMerchantClosingConfig());
+    }
+
+    @PreAuthorize("hasAuthority('platform:finance:merchant:closing:config:edit')")
+    @ApiOperation(value = "编辑商户结算设置")
+    @RequestMapping(value = "/merchant/closing/config/edit", method = RequestMethod.POST)
+    public CommonResult<String> merchantClosingConfigEdit(@RequestBody @Validated MerchantClosingConfigVo request) {
+        if (financeService.merchantClosingConfigEdit(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:finance:merchant:closing:page:list')")
+    @ApiOperation(value = "商户结算分页列表")
+    @RequestMapping(value = "/merchant/closing/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<MerchantClosingPlatformPageResponse>> getMerchantClosingPageList(
+            @ModelAttribute MerchantClosingSearchRequest request, @ModelAttribute PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(financeService.getMerchantClosingPageList(request, pageParamRequest)));
+    }
+
+    @PreAuthorize("hasAuthority('platform:finance:merchant:closing:detail')")
+    @ApiOperation(value = "商户结算记录详情")
+    @RequestMapping(value = "/merchant/closing/detail/{closingNo}", method = RequestMethod.GET)
+    public CommonResult<MerchantClosingInfoResponse> getMerchantClosingDetail(@PathVariable String closingNo) {
+        return CommonResult.success(financeService.getMerchantClosingDetailByPlatform(closingNo));
+    }
+
+    @PreAuthorize("hasAuthority('platform:finance:merchant:closing:audit')")
+    @ApiOperation(value = "商户结算申请审核")
+    @RequestMapping(value = "/merchant/closing/audit", method = RequestMethod.POST)
+    public CommonResult<String> merchantClosingAudit(@RequestBody @Validated ClosingAuditRequest request) {
+        if (financeService.merchantClosingAudit(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:finance:merchant:closing:proof')")
+    @ApiOperation(value = "商户结算到账凭证")
+    @RequestMapping(value = "/merchant/closing/proof", method = RequestMethod.POST)
+    public CommonResult<String> merchantClosingProof(@RequestBody @Validated ClosingProofRequest request) {
+        if (financeService.merchantClosingProof(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:finance:merchant:closing:remark')")
+    @ApiOperation(value = "商户结算备注")
+    @RequestMapping(value = "/merchant/closing/remark", method = RequestMethod.POST)
+    public CommonResult<String> merchantClosingRemark(@RequestBody @Validated ClosingRemarkRequest request) {
+        if (financeService.merchantClosingRemark(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:finance:funds:flow')")
+    @ApiOperation(value = "资金流水分页列表")
+    @RequestMapping(value = "/funds/flow", method = RequestMethod.GET)
+    public CommonResult<CommonPage<FundsFlowResponse>> getFundsFlow(@ModelAttribute FundsFlowRequest request,
+                                                                    @ModelAttribute PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(financeService.getFundsFlow(request, pageParamRequest)));
+    }
+
+    @PreAuthorize("hasAuthority('platform:finance:daily:statement:page:list')")
+    @ApiOperation(value = "日帐单管理分页列表")
+    @RequestMapping(value = "/daily/statement/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<PlatformDailyStatement>> getDailyStatementList(@RequestParam(value = "dateLimit", required = false, defaultValue = "") String dateLimit,
+                                                                                  @ModelAttribute PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(financeService.getPlatformDailyStatementList(dateLimit, pageParamRequest)));
+    }
+
+    @PreAuthorize("hasAuthority('platform:finance:month:statement:page:list')")
+    @ApiOperation(value = "月帐单管理分页列表")
+    @RequestMapping(value = "/month/statement/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<PlatformMonthStatement>> getMonthStatementList(@RequestParam(value = "dateLimit", required = false, defaultValue = "") String dateLimit,
+                                                                                  @ModelAttribute PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(financeService.getPlatformMonthStatementList(dateLimit, pageParamRequest)));
+    }
+}
+
+
+

+ 64 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/HomeController.java

@@ -0,0 +1,64 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.admin.service.HomeService;
+import com.zbkj.common.response.HomeOperatingDataResponse;
+import com.zbkj.common.response.PlatformHomeRateResponse;
+import com.zbkj.common.response.UserChannelDataResponse;
+import com.zbkj.common.result.CommonResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+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;
+
+
+/**
+ * 平台端主页控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/statistics/home")
+@Api(tags = "平台端主页控制器")
+public class HomeController {
+
+    @Autowired
+    private HomeService homeService;
+
+    @PreAuthorize("hasAuthority('platform:statistics:home:index')")
+    @ApiOperation(value = "首页数据")
+    @RequestMapping(value = "/index", method = RequestMethod.GET)
+    public CommonResult<PlatformHomeRateResponse> indexDate() {
+        return CommonResult.success(homeService.indexPlatformDate());
+    }
+
+    @PreAuthorize("hasAuthority('platform:statistics:home:operating:data')")
+    @ApiOperation(value = "经营数据")
+    @RequestMapping(value = "/operating/data", method = RequestMethod.GET)
+    public CommonResult<HomeOperatingDataResponse> operatingData() {
+        return CommonResult.success(homeService.operatingPlatformData());
+    }
+
+    @PreAuthorize("hasAuthority('platform:statistics:home:user:channel')")
+    @ApiOperation(value = "用户渠道数据")
+    @RequestMapping(value = "/channel", method = RequestMethod.GET)
+    public CommonResult<List<UserChannelDataResponse>> getChannelData() {
+        return CommonResult.success(homeService.getUserChannelData());
+    }
+
+//    @PreAuthorize("hasAuthority('admin:statistics:user:overview')")
+//    @ApiOperation(value = "用户概览")
+//    @RequestMapping(value = "/overview", method = RequestMethod.GET)
+//    public CommonResult<UserOverviewResponse> getOverview(@RequestParam(value = "dateLimit", defaultValue = "") String dateLimit) {
+//        return CommonResult.success(homeService.getUserOverview(dateLimit));
+//    }
+
+}
+
+
+

+ 55 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/IntegralController.java

@@ -0,0 +1,55 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.admin.service.IntegralService;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.IntegralPageSearchRequest;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.response.IntegralConfigResponse;
+import com.zbkj.common.response.IntegralRecordPageResponse;
+import com.zbkj.common.result.CommonResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 积分控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/integral")
+@Api(tags = "积分控制器")
+public class IntegralController {
+
+    @Autowired
+    private IntegralService integralService;
+
+    @PreAuthorize("hasAuthority('platform:integral:get:config')")
+    @ApiOperation(value = "获取积分配置")
+    @RequestMapping(value = "/get/config", method = RequestMethod.GET)
+    public CommonResult<IntegralConfigResponse> getConfig() {
+        return CommonResult.success(integralService.getConfig());
+    }
+
+    @PreAuthorize("hasAuthority('platform:integral:update:config')")
+    @ApiOperation(value = "编辑积分配置")
+    @RequestMapping(value = "/set/config", method = RequestMethod.POST)
+    public CommonResult<String> updateConfig(@RequestBody IntegralConfigResponse request) {
+        if (integralService.updateConfig(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:integral:page:list')")
+    @ApiOperation(value = "积分分页列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<IntegralRecordPageResponse>> findRecordPageList(@ModelAttribute @Validated IntegralPageSearchRequest request,
+                                                                                   @Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(integralService.findRecordPageList(request, pageParamRequest)));
+    }
+}

+ 66 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/MerchantApplyController.java

@@ -0,0 +1,66 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.model.merchant.MerchantApply;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.MerchantApplyAuditRequest;
+import com.zbkj.common.request.MerchantApplyRemarkRequest;
+import com.zbkj.common.request.MerchantApplySearchRequest;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.MerchantApplyService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 商户入驻控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/merchant/apply")
+@Api(tags = "商户入驻控制器")
+public class MerchantApplyController {
+
+    @Autowired
+    private MerchantApplyService merchantApplyService;
+
+    @PreAuthorize("hasAuthority('platform:merchant:apply:page:list')")
+    @ApiOperation(value="商户入驻分页列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<MerchantApply>> getPageList(@Validated MerchantApplySearchRequest searchRequest,
+                                                               @Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(merchantApplyService.getAdminPage(searchRequest, pageParamRequest)));
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "商户入驻审核")
+    @PreAuthorize("hasAuthority('platform:merchant:apply:audit')")
+    @ApiOperation(value="审核")
+    @RequestMapping(value = "/audit", method = RequestMethod.POST)
+    public CommonResult<Object> audit(@RequestBody @Validated MerchantApplyAuditRequest request) {
+        if (merchantApplyService.audit(request)) {
+            return CommonResult.success("申请审核成功");
+        }
+        return CommonResult.failed("申请审核失败");
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "商户入驻备注")
+    @PreAuthorize("hasAuthority('platform:merchant:apply:remark')")
+    @ApiOperation(value="备注")
+    @RequestMapping(value = "/remark", method = RequestMethod.POST)
+    public CommonResult<Object> remark(@RequestBody @Validated MerchantApplyRemarkRequest request) {
+        if (merchantApplyService.remark(request)) {
+            return CommonResult.success("备注成功");
+        }
+        return CommonResult.failed("备注失败");
+    }
+}

+ 82 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/MerchantCategoryController.java

@@ -0,0 +1,82 @@
+package com.zbkj.admin.controller.platform;
+
+import com.github.pagehelper.PageInfo;
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.model.merchant.MerchantCategory;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.MerchantCategoryRequest;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.MerchantCategoryService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 商户分类控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/merchant/category")
+@Api(tags = "平台端商户分类控制器")
+public class MerchantCategoryController {
+
+    @Autowired
+    private MerchantCategoryService categoryService;
+
+    @PreAuthorize("hasAuthority('platform:merchant:category:list')")
+    @ApiOperation(value="商户分类分页列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<MerchantCategory>> getList(@Validated PageParamRequest pageParamRequest) {
+        PageInfo<MerchantCategory> pageInfo = categoryService.getAdminPage(pageParamRequest);
+        return CommonResult.success(CommonPage.restPage(pageInfo));
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.ADD, description = "添加商户分类")
+    @PreAuthorize("hasAuthority('platform:merchant:category:add')")
+    @ApiOperation(value="添加商户分类")
+    @RequestMapping(value = "/add", method = RequestMethod.POST)
+    public CommonResult<Object> add(@RequestBody @Validated MerchantCategoryRequest request) {
+        if (categoryService.add(request)) {
+            return CommonResult.success("添加商户分类成功");
+        }
+        return CommonResult.failed("添加商户分类失败");
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "编辑商户分类")
+    @PreAuthorize("hasAuthority('platform:merchant:category:update')")
+    @ApiOperation(value="编辑商户分类")
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    public CommonResult<Object> update(@RequestBody @Validated MerchantCategoryRequest request) {
+        if (categoryService.edit(request)) {
+            return CommonResult.success("编辑商户分类成功");
+        }
+        return CommonResult.failed("编辑商户分类失败");
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.DELETE, description = "删除商户分类")
+    @PreAuthorize("hasAuthority('platform:merchant:category:delete')")
+    @ApiOperation(value="删除商户分类")
+    @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
+    public CommonResult<Object> delete(@PathVariable("id") Integer id) {
+        if (categoryService.delete(id)) {
+            return CommonResult.success("删除商户分类成功");
+        }
+        return CommonResult.failed("删除商户分类失败");
+    }
+
+    @PreAuthorize("hasAuthority('platform:merchant:category:all')")
+    @ApiOperation(value="获取全部商户分类列表")
+    @RequestMapping(value = "/all/list", method = RequestMethod.GET)
+    public CommonResult<List<MerchantCategory>> allList() {
+        return CommonResult.success(categoryService.allList());
+    }
+}

+ 152 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/MerchantController.java

@@ -0,0 +1,152 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.*;
+import com.zbkj.common.response.CategoryMerchantResponse;
+import com.zbkj.common.response.MerchantHeaderNumResponse;
+import com.zbkj.common.response.MerchantPageResponse;
+import com.zbkj.common.response.MerchantPlatformDetailResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.MerchantService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 商户控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/merchant")
+@Api(tags = "平台端商户控制器")
+public class MerchantController {
+
+    @Autowired
+    private MerchantService merchantService;
+
+    @PreAuthorize("hasAuthority('platform:merchant:page:list')")
+    @ApiOperation(value="商户分页列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<MerchantPageResponse>> getPageList(@Validated MerchantSearchRequest searchRequest,
+                                                                      @Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(merchantService.getAdminPage(searchRequest, pageParamRequest)));
+    }
+
+    @PreAuthorize("hasAuthority('platform:merchant:list:header:num')")
+    @ApiOperation(value="商户分页列表表头数量")
+    @RequestMapping(value = "/list/header/num", method = RequestMethod.GET)
+    public CommonResult<MerchantHeaderNumResponse> getListHeaderNum(@Validated MerchantSearchRequest searchRequest) {
+        return CommonResult.success(merchantService.getListHeaderNum(searchRequest));
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.ADD, description = "添加商户")
+    @PreAuthorize("hasAuthority('platform:merchant:add')")
+    @ApiOperation(value="添加商户")
+    @RequestMapping(value = "/add", method = RequestMethod.POST)
+    public CommonResult<String> add(@RequestBody @Validated MerchantAddRequest request) {
+        if (merchantService.add(request)) {
+            return CommonResult.success("添加商户成功");
+        }
+        return CommonResult.failed("添加商户失败");
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "编辑商户")
+    @PreAuthorize("hasAuthority('platform:merchant:update')")
+    @ApiOperation(value="编辑商户")
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    public CommonResult<String> update(@RequestBody @Validated MerchantUpdateRequest request) {
+        if (merchantService.edit(request)) {
+            return CommonResult.success("编辑商户成功");
+        }
+        return CommonResult.failed("编辑商户失败");
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "修改商户手机号")
+    @PreAuthorize("hasAuthority('platform:merchant:update:phone')")
+    @ApiOperation(value="修改商户手机号")
+    @RequestMapping(value = "/update/phone", method = RequestMethod.POST)
+    public CommonResult<String> updatePhone(@RequestBody @Validated MerchantUpdatePhoneRequest request) {
+        if (merchantService.updatePhone(request)) {
+            return CommonResult.success("修改商户手机号成功");
+        }
+        return CommonResult.failed("修改商户手机号失败");
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "重置商户密码")
+    @PreAuthorize("hasAuthority('platform:merchant:reset:password')")
+    @ApiOperation(value="重置商户密码")
+    @RequestMapping(value = "/reset/password/{id}", method = RequestMethod.POST)
+    public CommonResult<String> resetPassword(@PathVariable(value = "id") Integer id) {
+        if (merchantService.resetPassword(id)) {
+            return CommonResult.success("重置商户密码成功");
+        }
+        return CommonResult.failed("重置商户密码失败");
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "修改复制商品数量")
+    @PreAuthorize("hasAuthority('platform:merchant:copy:prodcut:num')")
+    @ApiOperation(value="修改复制商品数量")
+    @RequestMapping(value = "/update/copy/product/num", method = RequestMethod.POST)
+    public CommonResult<String> updateCopyProductNum(@RequestBody @Validated MerchantUpdateProductNumRequest request) {
+        if (merchantService.updateCopyProductNum(request)) {
+            return CommonResult.success("修改复制商品数量成功");
+        }
+        return CommonResult.failed("修改复制商品数量失败");
+    }
+
+    @PreAuthorize("hasAuthority('platform:merchant:detail')")
+    @ApiOperation(value="商户详情")
+    @RequestMapping(value = "/detail/{id}", method = RequestMethod.GET)
+    public CommonResult<MerchantPlatformDetailResponse> getDetail(@PathVariable("id") Integer id) {
+        return CommonResult.success(merchantService.getPlatformDetail(id));
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "推荐开关")
+    @PreAuthorize("hasAuthority('platform:merchant:recommend:switch')")
+    @ApiOperation(value="推荐开关")
+    @RequestMapping(value = "/recommend/switch/{id}", method = RequestMethod.POST)
+    public CommonResult<String> recommendSwitch(@PathVariable("id") Integer id) {
+        if (merchantService.recommendSwitch(id)) {
+            return CommonResult.success("切换商户推荐开关成功");
+        }
+        return CommonResult.failed("切换商户推荐开关失败");
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "关闭商户")
+    @PreAuthorize("hasAuthority('platform:merchant:close')")
+    @ApiOperation(value="关闭商户")
+    @RequestMapping(value = "/close/{id}", method = RequestMethod.POST)
+    public CommonResult<String> close(@PathVariable("id") Integer id) {
+        if (merchantService.close(id)) {
+            return CommonResult.success("关闭商户成功");
+        }
+        return CommonResult.failed("关闭商户失败");
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "开启商户")
+    @PreAuthorize("hasAuthority('platform:merchant:open')")
+    @ApiOperation(value="开启商户")
+    @RequestMapping(value = "/open/{id}", method = RequestMethod.POST)
+    public CommonResult<String> open(@PathVariable("id") Integer id) {
+        if (merchantService.open(id)) {
+            return CommonResult.success("开启商户成功");
+        }
+        return CommonResult.failed("开启商户失败");
+    }
+
+    @PreAuthorize("hasAuthority('platform:merchant:use:category:list')")
+    @ApiOperation(value="可用分类商户列表")
+    @RequestMapping(value = "/use/category/list", method = RequestMethod.GET)
+    public CommonResult<List<CategoryMerchantResponse>> getUseCategoryList() {
+        return CommonResult.success(merchantService.getUseCategoryList());
+    }
+}

+ 82 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/MerchantTypeController.java

@@ -0,0 +1,82 @@
+package com.zbkj.admin.controller.platform;
+
+import com.github.pagehelper.PageInfo;
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.model.merchant.MerchantType;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.MerchantTypeRequest;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.MerchantTypeService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 商户类型控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/merchant/type")
+@Api(tags = "平台端商户类型控制器")
+public class MerchantTypeController {
+
+    @Autowired
+    private MerchantTypeService typeService;
+
+    @PreAuthorize("hasAuthority('platform:merchant:type:list')")
+    @ApiOperation(value="商户类型分页列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<MerchantType>> getList(@Validated PageParamRequest pageParamRequest) {
+        PageInfo<MerchantType> pageInfo = typeService.getAdminPage(pageParamRequest);
+        return CommonResult.success(CommonPage.restPage(pageInfo));
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.ADD, description = "添加商户类型")
+    @PreAuthorize("hasAuthority('platform:merchant:type:add')")
+    @ApiOperation(value="添加商户类型")
+    @RequestMapping(value = "/add", method = RequestMethod.POST)
+    public CommonResult<Object> add(@RequestBody @Validated MerchantTypeRequest request) {
+        if (typeService.add(request)) {
+            return CommonResult.success("添加商户类型成功");
+        }
+        return CommonResult.failed("添加商户类型失败");
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "编辑类型类型")
+    @PreAuthorize("hasAuthority('platform:merchant:type:update')")
+    @ApiOperation(value="编辑类型类型")
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    public CommonResult<Object> update(@RequestBody @Validated MerchantTypeRequest request) {
+        if (typeService.edit(request)) {
+            return CommonResult.success("编辑商户类型成功");
+        }
+        return CommonResult.failed("编辑商户类型失败");
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.DELETE, description = "删除商户类型")
+    @PreAuthorize("hasAuthority('platform:merchant:type:delete')")
+    @ApiOperation(value="删除商户类型")
+    @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
+    public CommonResult<Object> delete(@PathVariable("id") Integer id) {
+        if (typeService.delete(id)) {
+            return CommonResult.success("删除商户类型成功");
+        }
+        return CommonResult.failed("删除商户类型失败");
+    }
+
+    @PreAuthorize("hasAuthority('platform:merchant:type:all')")
+    @ApiOperation(value="获取全部商户类型列表")
+    @RequestMapping(value = "/all/list", method = RequestMethod.GET)
+    public CommonResult<List<MerchantType>> allList() {
+        return CommonResult.success(typeService.allList());
+    }
+}

+ 472 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/NewPlatformApi.java

@@ -0,0 +1,472 @@
+package com.zbkj.admin.controller.platform;
+
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.zbkj.admin.controller.newapi.request.BoundShopRequest;
+import com.zbkj.admin.controller.newapi.request.SetLineOfCreditRequest;
+import com.zbkj.admin.controller.newapi.request.UserEnterpriseSearchRequest;
+import com.zbkj.common.constants.BalanceRecordConstants;
+import com.zbkj.common.model.product.Product;
+import com.zbkj.common.model.user.User;
+import com.zbkj.common.model.user.UserBypassAccount;
+import com.zbkj.common.model.user.UserEnterprise;
+import com.zbkj.common.model.user.UserEnterpriseRecord;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.request.SystemFormCheckRequest;
+import com.zbkj.common.request.UserSearchRequest;
+import com.zbkj.common.request.UserUpdateRequest;
+import com.zbkj.common.response.MerchantOrder2PageResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * @Created by:   zhulei
+ * 2023/5/29 14:29
+ * code is far away from bug with the animal protecting
+ * <p>
+ * <p>
+ * █████▒█    ██  ▄████▄   ██ ▄█▀       ██████╗ ██╗   ██╗ ██████╗
+ * ▓██   ▒ ██  ▓██▒▒██▀ ▀█   ██▄█▒        ██╔══██╗██║   ██║██╔════╝
+ * ▒████ ░▓██  ▒██░▒▓█    ▄ ▓███▄░        ██████╔╝██║   ██║██║  ███╗
+ * ░▓█▒  ░▓▓█  ░██░▒▓▓▄ ▄██▒▓██ █▄        ██╔══██╗██║   ██║██║   ██║
+ * ░▒█░   ▒▒█████▓ ▒ ▓███▀ ░▒██▒ █▄       ██████╔╝╚██████╔╝╚██████╔╝
+ * ▒ ░   ░▒▓▒ ▒ ▒ ░ ░▒ ▒  ░▒ ▒▒ ▓▒       ╚═════╝  ╚═════╝  ╚═════╝
+ * ░     ░░▒░ ░ ░   ░  ▒   ░ ░▒ ▒░
+ * ░ ░    ░░░ ░ ░ ░        ░ ░░ ░
+ * ░     ░ ░      ░  ░
+ * ░
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/userenterprise")
+@Api(tags = "平台端二开控制器")
+@Validated
+public class NewPlatformApi {
+    @Autowired
+    private UserEnterpriseService userEnterpriseService;
+    @Autowired
+    private UserBypassAccountService userBypassAccountService;
+    @Autowired
+    private UserEnterpriseRecordService userEnterpriseRecordService;
+    @Autowired
+    private SystemConfigService systemConfigService;
+    @Autowired
+    private UserService userService;
+
+
+    @ApiOperation(value = "平台端企业用户分页列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<UserEnterprise>> getList(@ModelAttribute @Validated UserEnterpriseSearchRequest request,
+                                                                        @Validated PageParamRequest pageParamRequest) {
+
+        LambdaQueryWrapper<UserEnterprise> queryWrapper = new LambdaQueryWrapper<>();
+        if (request.getRealName() != null) {
+            queryWrapper.like( UserEnterprise::getRealName, request.getRealName() );
+        }
+        if (request.getPhone() != null) {
+            queryWrapper.like( UserEnterprise::getPhone, request.getPhone() );
+        }
+        if (request.getEnterpriseName() != null) {
+            queryWrapper.like( UserEnterprise::getEnterpriseName, request.getEnterpriseName() );
+        }
+        Page<UserEnterprise> page = PageHelper.startPage(pageParamRequest.getPage(), pageParamRequest.getLimit());
+        List<UserEnterprise> list = userEnterpriseService.list( queryWrapper );
+
+        return CommonResult.success( CommonPage.restPage(CommonPage.copyPageInfo(page, list)) );
+    }
+//    @PreAuthorize("hasAuthority('platform:userEnterprise:page:list')")
+//    @ApiOperation(value = "平台端企业用户分页列表")
+////    @RequestMapping(value = "/list", method = RequestMethod.GET)
+////    public CommonResult<IPage<UserEnterprise>> getList(@ModelAttribute @Validated UserEnterpriseSearchRequest request,
+////                                                       @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+////                                                       @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
+////        System.err.println(pageNo);
+////        System.err.println(pageSize);
+////        LambdaQueryWrapper<UserEnterprise> queryWrapper = new LambdaQueryWrapper<>();
+////        if (request.getRealName() != null) {
+////            queryWrapper.like( UserEnterprise::getRealName, request.getRealName() );
+////        }
+////        if (request.getPhone() != null) {
+////            queryWrapper.like( UserEnterprise::getPhone, request.getPhone() );
+////        }
+////        if (request.getEnterpriseName() != null) {
+////            queryWrapper.like( UserEnterprise::getEnterpriseName, request.getEnterpriseName() );
+////        }
+////        Page<UserEnterprise> page = new Page<UserEnterprise>( pageNo, pageSize );
+////        IPage<UserEnterprise> pageList = userEnterpriseService.page( page, queryWrapper );
+////        return CommonResult.success( pageList );
+////    }
+
+//    @PreAuthorize("hasAuthority('platform:userEnterprise:page:getbyid')")
+    @ApiOperation(value = "平台端企业用户详情")
+    @RequestMapping(value = "/getbyid/{id}", method = RequestMethod.GET)
+    public CommonResult<UserEnterprise> getbyid(@PathVariable String id) {
+        UserEnterprise byId = userEnterpriseService.getById( id );
+        return CommonResult.success( byId );
+    }
+
+    @ApiOperation(value = "认证")
+    @RequestMapping(value = "/authentication", method = RequestMethod.POST)
+    public CommonResult<String> authentication(@RequestBody @Validated UserEnterprise userEnterprise) {
+        try {
+            User byId = userService.getById( userEnterprise.getUserId() );
+            userEnterprise.setAccount( byId.getAccount() );
+            userEnterprise.setPhone( byId.getPhone() );
+            LambdaQueryWrapper<UserBypassAccount> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.eq( UserBypassAccount::getUserId, userEnterprise.getUserId() );
+            queryWrapper.eq( UserBypassAccount::getIsDelete, 0 );
+            List<UserBypassAccount> list = userBypassAccountService.list( queryWrapper );
+            if (list.size() != 0) {
+                return CommonResult.failed( "该用户已成为企业子用户" );
+            }
+            LambdaQueryWrapper<UserEnterprise> queryWrapper2 = new LambdaQueryWrapper<>();
+            queryWrapper2.eq( UserEnterprise::getUserId, userEnterprise.getUserId() );
+            List<UserEnterprise> list2 = userEnterpriseService.list( queryWrapper2 );
+            if (list2.size() != 0) {
+                return CommonResult.failed( "该用户已认证过企业用户" );
+            }
+            //需要判断认证这个是否已经认证过了 子用户也需要做校验添加过的子用户不能添加
+            userEnterprise.setLineOfCredit( BigDecimal.valueOf( 0 ) );
+            userEnterprise.setUsedLineOfCredit( BigDecimal.valueOf( 0 ) );
+            userEnterprise.setAvailableLineOfCredit( BigDecimal.valueOf( 0 ) );
+            userEnterprise.setIsAuthentication( 1 );
+            userEnterprise.setCreateTime( new Date() );
+            userEnterpriseService.save( userEnterprise );
+
+            //修改用户表字段
+            byId.setIsEnterpriseUser( 2 );
+            userService.updateById( byId );
+            return CommonResult.success( "认证成功" );
+        } catch (Exception e) {
+            return CommonResult.failed( "认证失败,接口错误" );
+        }
+    }
+
+    @ApiOperation(value = "注销企业账户")
+    @RequestMapping(value = "/logoutAuthentication/{id}", method = RequestMethod.POST)
+    public CommonResult<String> logoutAuthentication(@PathVariable Integer id) {
+        try {
+            UserEnterprise byId = userEnterpriseService.getById( id );
+            if (byId.getUsedLineOfCredit().compareTo(BigDecimal.ZERO) != 0) {
+                return CommonResult.failed( "已用额度不为零,需还清后才能注销" );
+            }
+            userEnterpriseService.removeById(id);
+            LambdaQueryWrapper<UserBypassAccount> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.eq( UserBypassAccount::getEnterpriseId, id );
+            userBypassAccountService.remove( queryWrapper );
+            User user = new User();
+            user.setId( byId.getUserId() );
+            user.setIsEnterpriseUser( 1 );
+            userService.updateById( user );
+//            UserEnterprise userEnterprise = new UserEnterprise();
+//            userEnterprise.setId(id  );
+//            userEnterprise.setIsDelete(  1  );
+//            userEnterpriseService.updateById( userEnterprise );
+            return CommonResult.success( "注销企业账户成功" );
+        } catch (Exception e) {
+            return CommonResult.failed( "注销企业账户失败,接口错误" );
+        }
+    }
+
+//    @PreAuthorize("hasAuthority('platform:userEnterprise:edit')")
+    @ApiOperation(value = "编辑")
+    @RequestMapping(value = "/edit", method = RequestMethod.POST)
+    public CommonResult<String> edit(@RequestBody @Validated UserEnterprise userEnterprise) {
+        try {
+//            UserEnterprise userEnterprise = new UserEnterprise();
+            userEnterpriseService.updateById( userEnterprise );
+            return CommonResult.success( "编辑成功" );
+        } catch (Exception e) {
+            return CommonResult.failed( "编辑失败,接口错误" );
+        }
+    }
+
+//    @PreAuthorize("hasAuthority('platform:userEnterprise:addBypassAccountList')")
+    @ApiOperation(value = "批量添加子账号(暂时可能不需要批量添加)")
+    @RequestMapping(value = "/addBypassAccountList", method = RequestMethod.POST)
+    public CommonResult<String> addBypassAccountList(@RequestBody @Validated List<UserBypassAccount> userBypassAccountList) {
+
+        if (userBypassAccountService.saveBatch( userBypassAccountList )) {
+            return CommonResult.success( "添加子账号成功" );
+        }
+        return CommonResult.failed( "添加子账号失败,接口错误" );
+    }
+
+//    @PreAuthorize("hasAuthority('platform:userEnterprise:addBypassAccount')")
+    @ApiOperation(value = "添加子账号")
+    @RequestMapping(value = "/addBypassAccount", method = RequestMethod.POST)
+    public CommonResult<String> addBypassAccount(@RequestBody @Validated UserBypassAccount userBypassAccount) {
+        try {
+            User byId = userService.getById( userBypassAccount.getUserId() );
+            userBypassAccount.setAccount( byId.getAccount() );
+            userBypassAccount.setPhone( byId.getPhone() );
+            LambdaQueryWrapper<UserBypassAccount> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.eq( UserBypassAccount::getUserId, userBypassAccount.getUserId() );
+            queryWrapper.eq( UserBypassAccount::getIsDelete, 0 );
+            List<UserBypassAccount> list = userBypassAccountService.list( queryWrapper );
+            if (list.size() != 0) {
+                return CommonResult.failed( "该用户已存在一个企业里" );
+            }
+            LambdaQueryWrapper<UserEnterprise> queryWrapper2 = new LambdaQueryWrapper<>();
+            queryWrapper2.eq( UserEnterprise::getUserId, userBypassAccount.getUserId() );
+            List<UserEnterprise> list2 = userEnterpriseService.list( queryWrapper2 );
+            if (list2.size() != 0) {
+                return CommonResult.failed( "该用户已认证过企业用户" );
+            }
+            userBypassAccountService.save( userBypassAccount );
+
+            //修改用户表字段
+            byId.setIsEnterpriseUser( 3 );
+            userService.updateById( byId );
+            return CommonResult.success( "添加子账号成功" );
+        } catch (Exception e) {
+            return CommonResult.failed( "添加子账号失败,接口错误" );
+        }
+    }
+
+//    @PreAuthorize("hasAuthority('platform:userEnterprise:updataBypassAccount')")
+    @ApiOperation(value = "删除子账号")
+    @RequestMapping(value = "/updataBypassAccount/{id}", method = RequestMethod.POST)
+    public CommonResult<String> updataBypassAccount(@PathVariable Integer id) {
+        try {
+//            UserBypassAccount userBypassAccount = new UserBypassAccount();
+//            userBypassAccount.setId( id );
+//            userBypassAccount.setIsDelete( 1 );
+//            //需要软删除
+//            userBypassAccountService.updateById( userBypassAccount );
+            UserBypassAccount byId = userBypassAccountService.getById( id );
+            User user = new User();
+            user.setId( byId.getUserId() );
+            user.setIsEnterpriseUser( 1 );
+            userService.updateById( user );
+
+            userBypassAccountService.removeById( id );
+
+
+            return CommonResult.success( "删除子账号成功" );
+        } catch (Exception e) {
+            return CommonResult.failed( "删除子账号失败,接口错误" );
+        }
+    }
+
+    @ApiOperation(value = "修改子账号信息id必传")
+    @RequestMapping(value = "/updataBypassAccount2", method = RequestMethod.POST)
+    public CommonResult<String> updataBypassAccount2(@RequestBody @Validated UserBypassAccount userBypassAccount) {
+        try {
+            userBypassAccountService.updateById( userBypassAccount );
+            return CommonResult.success( "修改子账号信息成功" );
+        } catch (Exception e) {
+            return CommonResult.failed( "修改子账号信息失败,接口错误" );
+        }
+    }
+
+//    @PreAuthorize("hasAuthority('platform:userEnterprise:bypassAccountList')")
+    @ApiOperation(value = "查询企业账户下的子账号")
+    @RequestMapping(value = "/bypassAccountList/{id}", method = RequestMethod.GET)
+    public CommonResult<List<UserBypassAccount>> bypassAccountList(@PathVariable String id) {
+        try {
+            LambdaQueryWrapper<UserBypassAccount> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.eq( UserBypassAccount::getEnterpriseId, id );
+            queryWrapper.eq( UserBypassAccount::getIsDelete, 0 );
+            List<UserBypassAccount> list = userBypassAccountService.list( queryWrapper );
+            return CommonResult.success( list );
+        } catch (Exception e) {
+            return CommonResult.failed( "查询企业账户下的子账号失败,接口错误" );
+        }
+    }
+
+//    @PreAuthorize("hasAuthority('platform:userEnterprise:setLineOfCredit')")
+    @ApiOperation(value = "初次设置信用额度")
+    @RequestMapping(value = "/setLineOfCredit", method = RequestMethod.POST)
+    public CommonResult<String> setLineOfCredit(@RequestBody @Validated SetLineOfCreditRequest setLineOfCreditRequest) {
+        try {
+            UserEnterprise userEnterprise = new UserEnterprise();
+            userEnterprise.setId( setLineOfCreditRequest.getId() );
+            userEnterprise.setLineOfCredit( setLineOfCreditRequest.getLineOfCredit() );
+            userEnterprise.setAvailableLineOfCredit( setLineOfCreditRequest.getLineOfCredit() );
+            userEnterprise.setUsedLineOfCredit( BigDecimal.valueOf( 0 ) );
+            userEnterpriseService.updateById( userEnterprise );
+
+            UserEnterprise byId = userEnterpriseService.getById( setLineOfCreditRequest.getId() );
+            //信用额度记录
+            UserEnterpriseRecord userEnterpriseRecord = new UserEnterpriseRecord();
+            userEnterpriseRecord.setUid( byId.getUserId() );
+//            userEnterpriseRecord.setLinkId(order.getOrderNo());
+            userEnterpriseRecord.setLinkType( "system" );
+            userEnterpriseRecord.setType( 1 );
+            userEnterpriseRecord.setAmount( setLineOfCreditRequest.getLineOfCredit() );
+            userEnterpriseRecord.setBalance( setLineOfCreditRequest.getLineOfCredit() );
+            userEnterpriseRecord.setRemark( StrUtil.format( "初次设置信用额度成功,设置信用额度{}元", setLineOfCreditRequest.getLineOfCredit() ) );
+            userEnterpriseRecordService.save( userEnterpriseRecord );
+            return CommonResult.success( "初次设置信用额度成功" );
+        } catch (Exception e) {
+            return CommonResult.failed( "初次设置信用额度失败,接口错误" );
+        }
+    }
+
+//    @PreAuthorize("hasAuthority('platform:userEnterprise:setLineOfCreditS')")
+    @ApiOperation(value = "增加可用信用额度(线下打款后恢复用的)(加可用额度的 暂时不用)")
+    @RequestMapping(value = "/setLineOfCreditS", method = RequestMethod.POST)
+    public CommonResult<String> setLineOfCreditS(@RequestBody @Validated SetLineOfCreditRequest setLineOfCreditRequest) {
+        try {
+            UserEnterprise byId = userEnterpriseService.getById( setLineOfCreditRequest.getId() );
+            BigDecimal a = byId.getLineOfCredit();//总信用额度
+            BigDecimal b = byId.getAvailableLineOfCredit();//可用信用额度
+            BigDecimal c = byId.getUsedLineOfCredit();//已用信用额度
+
+            BigDecimal sum = b.add( setLineOfCreditRequest.getLineOfCredit() );//可用信用额度 加 要恢复的信用额度
+
+            // 比较
+            int result = sum.compareTo( a );
+
+            if (result > 0) {
+//                和大于总信用额度
+                return CommonResult.failed( "调整额度加上可用额度不能超过总额度" );
+            }
+            int result2 = setLineOfCreditRequest.getLineOfCredit().compareTo( c );
+            if (result2 > 0) {
+//                调整额度大于已用额度
+                return CommonResult.failed( "调整额度不能超过已用额度" );
+            }
+            //调整后的可用额度和已用额度
+//            BigDecimal bb = b.add( setLineOfCreditRequest.getLineOfCredit() );//可用信用额度 加 要恢复的信用额度
+            BigDecimal cc = c.subtract( setLineOfCreditRequest.getLineOfCredit() );//已用信用额度 减 要恢复的信用额度
+
+            UserEnterprise userEnterprise = new UserEnterprise();
+            userEnterprise.setId( setLineOfCreditRequest.getId() );
+            userEnterprise.setAvailableLineOfCredit( sum );
+            userEnterprise.setUsedLineOfCredit( cc );
+            userEnterpriseService.updateById( userEnterprise );
+            //信用额度记录
+            UserEnterpriseRecord userEnterpriseRecord = new UserEnterpriseRecord();
+            userEnterpriseRecord.setUid( byId.getUserId() );
+//            userEnterpriseRecord.setLinkId(order.getOrderNo());
+            userEnterpriseRecord.setLinkType( "system" );
+            userEnterpriseRecord.setType( 1 );
+            userEnterpriseRecord.setAmount( setLineOfCreditRequest.getLineOfCredit() );
+            userEnterpriseRecord.setBalance( sum );
+            userEnterpriseRecord.setRemark( StrUtil.format( "增加信用额度成功(可能是线下打款),增加信用额度{}元",
+                    setLineOfCreditRequest.getLineOfCredit() ) );
+            userEnterpriseRecordService.save( userEnterpriseRecord );
+            return CommonResult.success( "调整信用额度成功" );
+        } catch (Exception e) {
+            return CommonResult.failed( "调整信用额度失败,接口错误" );
+        }
+    }
+
+//    @PreAuthorize("hasAuthority('platform:userEnterprise:setLineOfCreditSS')")
+    @ApiOperation(value = "调整信用额度")
+    @RequestMapping(value = "/setLineOfCreditSS", method = RequestMethod.POST)
+    public CommonResult<String> setLineOfCreditSS(@RequestBody @Validated SetLineOfCreditRequest setLineOfCreditRequest) {
+        try {
+            UserEnterprise byId = userEnterpriseService.getById( setLineOfCreditRequest.getId() );
+            BigDecimal a = byId.getLineOfCredit();//总信用额度
+            BigDecimal b = byId.getAvailableLineOfCredit();//可用信用额度
+
+            BigDecimal bb = b.add( setLineOfCreditRequest.getLineOfCredit() );//可用信用额度 加 要恢复的信用额度
+
+            BigDecimal aa = a.add( setLineOfCreditRequest.getLineOfCredit() );
+
+
+            //调整后的可用额度和总额度
+            UserEnterprise userEnterprise = new UserEnterprise();
+            userEnterprise.setId( setLineOfCreditRequest.getId() );
+            userEnterprise.setLineOfCredit( aa );
+            userEnterprise.setAvailableLineOfCredit( bb );
+            userEnterpriseService.updateById( userEnterprise );
+            //信用额度记录
+            UserEnterpriseRecord userEnterpriseRecord = new UserEnterpriseRecord();
+            userEnterpriseRecord.setUid( byId.getUserId() );
+//            userEnterpriseRecord.setLinkId(order.getOrderNo());
+            userEnterpriseRecord.setLinkType( "system" );
+            userEnterpriseRecord.setType( 1 );
+            userEnterpriseRecord.setAmount( setLineOfCreditRequest.getLineOfCredit() );
+            userEnterpriseRecord.setBalance( bb );
+            userEnterpriseRecord.setRemark( StrUtil.format( "调整信用额度成功,调整增加信用额度{}元",
+                    setLineOfCreditRequest.getLineOfCredit() ) );
+            userEnterpriseRecordService.save( userEnterpriseRecord );
+            return CommonResult.success( "调整信用额度成功" );
+        } catch (Exception e) {
+            return CommonResult.failed( "调整信用额度失败,接口错误" );
+        }
+    }
+
+//    @PreAuthorize("hasAuthority('platform:userEnterprise:boundShop')")
+    @ApiOperation(value = "绑定/换绑商铺")
+    @RequestMapping(value = "/boundShop", method = RequestMethod.POST)
+    public CommonResult<String> boundShop(@RequestBody @Validated BoundShopRequest boundShopRequest) {
+        try {
+            UserEnterprise byId = userEnterpriseService.getById( boundShopRequest.getId() );
+            if (byId.getMerchantId() == null) {
+                //第一次绑定
+                UserEnterprise userEnterprise = new UserEnterprise();
+                userEnterprise.setId( boundShopRequest.getId() );
+                userEnterprise.setMerchantId( boundShopRequest.getMerchantId() );
+                userEnterprise.setMerchantName( boundShopRequest.getMerchantName() );
+                userEnterpriseService.updateById( userEnterprise );
+            } else {
+                //换绑 查询信用额度是否还清
+                if (byId.getUsedLineOfCredit().compareTo( BigDecimal.ZERO ) != 0) {
+                    return CommonResult.failed( "调整信用需还清之后才能换绑商铺" );
+                }
+
+                int result = byId.getLineOfCredit().compareTo( byId.getAvailableLineOfCredit() );
+                if (result != 0) {
+                    return CommonResult.failed( "调整信用需还清之后才能换绑商铺" );
+                }
+
+                //还清了  换绑
+                UserEnterprise userEnterprise = new UserEnterprise();
+                userEnterprise.setId( boundShopRequest.getId() );
+                userEnterprise.setMerchantId( boundShopRequest.getMerchantId() );
+                userEnterprise.setMerchantName( boundShopRequest.getMerchantName() );
+                userEnterpriseService.updateById( userEnterprise );
+            }
+            return CommonResult.success( "绑定/换绑商铺成功" );
+        } catch (Exception e) {
+            return CommonResult.failed( "绑定/换绑商铺失败,接口错误" );
+        }
+    }
+
+//    @PreAuthorize("hasAuthority('platform:system:config:ssmConfigInfo')")
+    @ApiOperation(value = "设置短信请求价格  详情")
+    @RequestMapping(value = "/ssmConfigInfo", method = RequestMethod.GET)
+    public CommonResult<HashMap<String, String>> ssmConfigInfo() {
+        Integer formId = 101;
+        return CommonResult.success(systemConfigService.info(formId));
+    }
+
+    //    @PreAuthorize("hasAuthority('platform:system:config:picConfigInfo')")
+    @ApiOperation(value = "设置积分商城图片")
+    @RequestMapping(value = "/picConfigInfo", method = RequestMethod.GET)
+    public CommonResult<HashMap<String, String>> picConfigInfo() {
+        Integer formId = 102;
+        return CommonResult.success(systemConfigService.info(formId));
+    }
+
+//    @PreAuthorize("hasAuthority('platform:system:config:save:form')")
+    @ApiOperation(value = "保存表单数据")
+    @RequestMapping(value = "/save/form", method = RequestMethod.POST)
+    public CommonResult<String> saveFrom(@RequestBody @Validated SystemFormCheckRequest systemFormCheckRequest) {
+        if (systemConfigService.saveForm2(systemFormCheckRequest)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+}

+ 139 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/OnePassController.java

@@ -0,0 +1,139 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.common.request.*;
+import com.zbkj.common.response.OnePassLoginResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.vo.OnePassMealCodeVo;
+import com.zbkj.common.vo.OnePassMealListVo;
+import com.zbkj.common.vo.OnePassRecordListVo;
+import com.zbkj.common.vo.OnePassUserInfoVo;
+import com.zbkj.service.service.OnePassService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 一号通控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/one/pass")
+@Api(tags = "一号通控制器")
+public class OnePassController {
+
+    @Autowired
+    private OnePassService onePassService;
+
+    @PreAuthorize("hasAuthority('platform:one:pass:send:code')")
+    @ApiOperation(value = "获取用户验证码")
+    @RequestMapping(value = "/sendUserCode", method = RequestMethod.POST)
+    public CommonResult<Object> sendUserCode(@RequestBody @Validated OnePassUserCodeRequest request) {
+        return CommonResult.success(onePassService.sendUserCode(request));
+    }
+
+    @PreAuthorize("hasAuthority('platform:one:pass:register')")
+    @ApiOperation(value = "账号注册")
+    @RequestMapping(value = "/register", method = RequestMethod.POST)
+    public CommonResult<String> register(@Validated @RequestBody OnePassRegisterRequest registerRequest) {
+        return CommonResult.success(onePassService.register(registerRequest));
+    }
+
+    @PreAuthorize("hasAuthority('platform:one:pass:login')")
+    @ApiOperation(value = "一号通用户登录")
+    @RequestMapping(value = "/login", method = RequestMethod.POST)
+    public CommonResult<OnePassLoginResponse> account(@Validated @RequestBody OnePassLoginRequest request) {
+        return CommonResult.success(onePassService.login(request));
+    }
+
+    @PreAuthorize("hasAuthority('platform:one:pass:is:login')")
+    @ApiOperation(value = "是否已经登录")
+    @RequestMapping(value = "/isLogin", method = RequestMethod.GET)
+    public CommonResult<OnePassLoginResponse> isLogin() {
+        return CommonResult.success(onePassService.isLogin());
+    }
+
+    @PreAuthorize("hasAuthority('platform:one:pass:info')")
+    @ApiOperation(value = "一号通用户信息")
+    @RequestMapping(value = "/info", method = RequestMethod.GET)
+    public CommonResult<OnePassUserInfoVo> getInfo() {
+        return CommonResult.success(onePassService.info());
+    }
+
+    @PreAuthorize("hasAuthority('platform:one:pass:logout')")
+    @ApiOperation(value = "用户注销")
+    @RequestMapping(value = "/logout", method = RequestMethod.POST)
+    public CommonResult<String> logOut() {
+        if (onePassService.logOut()) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:one:pass:update:password')")
+    @ApiOperation(value = "修改密码")
+    @RequestMapping(value = "/update/password", method = RequestMethod.POST)
+    public CommonResult<String> updatePassword(@Validated @RequestBody OnePassUpdateRequest request) {
+        if (onePassService.updatePassword(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:one:pass:update:phone:validator')")
+    @ApiOperation(value = "修改手机号——验证账号密码")
+    @RequestMapping(value = "/update/phone/validator", method = RequestMethod.POST)
+    public CommonResult<String> updatePhone(@Validated @RequestBody OnePassLoginRequest request) {
+        if (onePassService.beforeUpdatePhoneValidator(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:one:pass:update:phone')")
+    @ApiOperation(value = "修改手机号")
+    @RequestMapping(value = "/update/phone", method = RequestMethod.POST)
+    public CommonResult<String> updatePhone(@Validated @RequestBody OnePassUpdateRequest request) {
+        if (onePassService.updatePhone(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:one:pass:meal:list')")
+    @ApiOperation(value = "套餐列表")
+    @RequestMapping(value = "/meal/list", method = RequestMethod.GET)
+    @ApiImplicitParam(name="type", value="套餐类型:sms,短信;expr_query,物流查询;expr_dump,电子面单;copy,产品复制")
+    public CommonResult<OnePassMealListVo> mealList(@Validated @RequestParam String type) {
+        return CommonResult.success(onePassService.mealList(type));
+    }
+
+    @PreAuthorize("hasAuthority('platform:one:pass:meal:code')")
+    @ApiOperation(value = "套餐购买")
+    @RequestMapping(value = "/meal/code", method = RequestMethod.POST)
+    public CommonResult<OnePassMealCodeVo> mealCode(@RequestBody @Validated OnePassMealCodeRequest request) {
+        return CommonResult.success(onePassService.mealCode(request));
+    }
+
+    @PreAuthorize("hasAuthority('platform:one:pass:service:open')")
+    @ApiOperation(value = "服务开通")
+    @RequestMapping(value = "/service/open", method = RequestMethod.POST)
+    public CommonResult<String> serviceOpen(@RequestBody @Validated OnePassServiceOpenRequest request) {
+        if (onePassService.serviceOpen(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:one:pass:user:record')")
+    @ApiOperation(value = "用量记录")
+    @RequestMapping(value = "/user/record", method = RequestMethod.GET)
+    public CommonResult<OnePassRecordListVo> record(@Validated OnePassUserRecordRequest request) {
+        return CommonResult.success(onePassService.userRecord(request));
+    }
+}

+ 57 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/OnePassSmsController.java

@@ -0,0 +1,57 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.service.service.OnePassSmsService;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.request.SmsApplyTempRequest;
+import com.zbkj.common.request.SmsModifySignRequest;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.vo.OnePassSmsTempsListVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 一号通短信服务控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/one/pass/sms")
+@Api(tags = "一号通短信服务控制器")
+public class OnePassSmsController {
+
+    @Autowired
+    private OnePassSmsService onePassSmsService;
+
+    @PreAuthorize("hasAuthority('platform:one:pass:sms:modify:sign')")
+    @ApiOperation(value = "修改签名")
+    @RequestMapping(value = "/modify/sign", method = RequestMethod.POST)
+    public CommonResult<String> modifySign(@RequestBody @Validated SmsModifySignRequest request) {
+        if (onePassSmsService.modifySign(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:one:pass:sms:temps')")
+    @ApiOperation(value = "短信模板")
+    @RequestMapping(value = "/temps", method = RequestMethod.GET)
+    public CommonResult<OnePassSmsTempsListVo> temps(@ModelAttribute PageParamRequest pageParamRequest) {
+        return CommonResult.success(onePassSmsService.temps(pageParamRequest));
+    }
+
+    @PreAuthorize("hasAuthority('platform:one:pass:sms:temp:apply')")
+    @ApiOperation(value = "申请短信模板")
+    @RequestMapping(value = "/temp/apply", method = RequestMethod.POST)
+    public CommonResult<String> applyTempMessage(@RequestBody @Validated SmsApplyTempRequest request) {
+        if (onePassSmsService.applyTempMessage(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+}

+ 115 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PageLayoutController.java

@@ -0,0 +1,115 @@
+package com.zbkj.admin.controller.platform;
+
+import com.alibaba.fastjson.JSONObject;
+import com.zbkj.common.response.PageLayoutBottomNavigationResponse;
+import com.zbkj.common.response.PageLayoutIndexResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.PageLayoutService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 页面设计 前端控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/page/layout")
+@Api(tags = "页面布局管理")
+public class PageLayoutController {
+
+    @Autowired
+    private PageLayoutService pageLayoutService;
+
+    @PreAuthorize("hasAuthority('platform:page:layout:index')")
+    @ApiOperation(value = "页面首页")
+    @RequestMapping(value = "/index", method = RequestMethod.GET)
+    public CommonResult<PageLayoutIndexResponse> index() {
+        return CommonResult.success(pageLayoutService.index());
+    }
+
+    @PreAuthorize("hasAuthority('platform:page:layout:bottom:navigation')")
+    @ApiOperation(value = "页面底部导航")
+    @RequestMapping(value = "/bottom/navigation/get", method = RequestMethod.GET)
+    public CommonResult<PageLayoutBottomNavigationResponse> getBottomNavigation() {
+        return CommonResult.success(pageLayoutService.getBottomNavigation());
+    }
+
+//    @PreAuthorize("hasAuthority('platform:page:layout:save')")
+//    @ApiOperation(value = "页面首页保存(不建议调用)")
+//    @RequestMapping(value = "/save", method = RequestMethod.POST)
+//    public CommonResult<Object> save(@RequestBody JSONObject jsonObject) {
+//        if (pageLayoutService.save(jsonObject)) {
+//            return CommonResult.success();
+//        }
+//        return CommonResult.failed();
+//    }
+
+    @PreAuthorize("hasAuthority('platform:page:layout:index:banner:save')")
+    @ApiOperation(value = "页面首页banner保存")
+    @RequestMapping(value = "/index/banner/save", method = RequestMethod.POST)
+    public CommonResult<Object> indexBannerSave(@RequestBody JSONObject jsonObject) {
+        if (pageLayoutService.indexBannerSave(jsonObject)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:page:layout:index:menu:save')")
+    @ApiOperation(value = "页面首页menu保存")
+    @RequestMapping(value = "/index/menu/save", method = RequestMethod.POST)
+    public CommonResult<Object> indexMenuSave(@RequestBody JSONObject jsonObject) {
+        if (pageLayoutService.indexMenuSave(jsonObject)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+//    @PreAuthorize("hasAuthority('platform:page:layout:index:news:save')")
+//    @ApiOperation(value = "页面首页新闻保存")
+//    @RequestMapping(value = "/index/news/save", method = RequestMethod.POST)
+//    public CommonResult<Object> indexNewsSave(@RequestBody JSONObject jsonObject) {
+//        if (pageLayoutService.indexNewsSave(jsonObject)) {
+//            return CommonResult.success();
+//        }
+//        return CommonResult.failed();
+//    }
+
+    @PreAuthorize("hasAuthority('platform:page:layout:index:banner:save')")
+    @ApiOperation(value = "页面用户中心banner保存")
+    @RequestMapping(value = "/user/banner/save", method = RequestMethod.POST)
+    public CommonResult<Object> userBannerSave(@RequestBody JSONObject jsonObject) {
+        if (pageLayoutService.userBannerSave(jsonObject)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:page:layout:user:menu:save')")
+    @ApiOperation(value = "页面用户中心导航保存")
+    @RequestMapping(value = "/user/menu/save", method = RequestMethod.POST)
+    public CommonResult<Object> userMenuSave(@RequestBody JSONObject jsonObject) {
+        if (pageLayoutService.userMenuSave(jsonObject)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:page:layout:bottom:navigation:save')")
+    @ApiOperation(value = "底部导航保存")
+    @RequestMapping(value = "/bottom/navigation/save", method = RequestMethod.POST)
+    public CommonResult<Object> bottomNavigationSave(@RequestBody JSONObject jsonObject) {
+        if (pageLayoutService.bottomNavigationSave(jsonObject)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+}

+ 41 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PayComponentBrandController.java

@@ -0,0 +1,41 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.PayComponentBrandService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ * 组件品牌表 前端控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/pay/component/brand")
+@Api(tags = "03小程序 自定义交易组件—品牌") //配合swagger使用
+public class PayComponentBrandController {
+
+    @Autowired
+    private PayComponentBrandService payComponentBrandService;
+
+    /** TODO 待确认删除
+     * 获取品牌
+     * 获取到的是已申请成功的品牌列表
+     *
+     */
+    @ApiOperation(value = "获取品牌(测试用,前端不调用)")
+    @RequestMapping(value = "/get", method = RequestMethod.GET)
+    public CommonResult<Object> get(){
+        payComponentBrandService.updateData();
+        return CommonResult.success();
+    }
+}
+
+
+

+ 72 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PayComponentCatController.java

@@ -0,0 +1,72 @@
+package com.zbkj.admin.controller.platform;
+
+import com.baomidou.mybatisplus.core.metadata.PageList;
+import com.github.pagehelper.PageInfo;
+import com.zbkj.common.model.wechat.video.PayComponentCat;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.request.wxvedio.cat.PayComponentCatPageListRequest;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.vo.wxvedioshop.cat_brand.CatItem;
+import com.zbkj.service.service.PayComponentCatService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+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;
+
+
+/**
+ * 组件类目表 前端控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/pay/component/cat")
+@Api(tags = "04小程序 自定义交易组件—类目") //配合swagger使用
+public class PayComponentCatController {
+
+    @Autowired
+    private PayComponentCatService payComponentCatService;
+
+    /**
+     * 获取类目树形结构
+     */
+    @PreAuthorize("hasAuthority('platform:pay:component:cat:treelist')")
+    @ApiOperation(value = "获取类目列表 树形结构")
+    @RequestMapping(value = "/get/treelist", method = RequestMethod.GET)
+    public CommonResult<List<CatItem>> getTreeList() {
+        return CommonResult.success(payComponentCatService.getTreeList());
+    }
+
+    /**
+     * 获取类目分页数据
+     */
+    @PreAuthorize("hasAuthority('platform:pay:component:cat:list')")
+    @ApiOperation(value = "获取类目列表 分页 用于平台查看和审核类目")
+    @RequestMapping(value = "/get/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<PayComponentCat>> getList(@Validated PayComponentCatPageListRequest payComponentCat,
+                                                             @Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success( CommonPage.restPage(payComponentCatService.getList(payComponentCat, pageParamRequest)));
+    }
+
+
+    /**
+     * 获取类目(测试用,前端不调用)
+     */
+    @ApiOperation(value = "获取类目(测试用,前端不调用 系统初始化时)")
+    @RequestMapping(value = "/get", method = RequestMethod.GET)
+    public CommonResult<Object> sendUserCode() {
+        payComponentCatService.autoUpdate();
+        return CommonResult.success();
+    }
+}
+
+
+

+ 54 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PayComponentDeliveryCompanyController.java

@@ -0,0 +1,54 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.common.model.wechat.video.PayComponentDeliveryCompany;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.PayComponentDeliveryCompanyService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+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;
+
+
+/**
+ * 组件快递公司表 前端控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/pay/component/delivery/company")
+@Api(tags = "05小程序 自定义交易组件—快递公司")
+public class PayComponentDeliveryCompanyController {
+
+    @Autowired
+    private PayComponentDeliveryCompanyService payComponentDeliveryCompanyService;
+
+    /**
+     * 获取组件快递
+     */
+    @PreAuthorize("hasAuthority('platform:pay:component:delivery:company:get')")
+    @ApiOperation(value = "获取组件快递(测试用,前端不调用)")
+    @RequestMapping(value = "/get", method = RequestMethod.GET)
+    public CommonResult<Object> get(){
+        payComponentDeliveryCompanyService.updateData();
+        return CommonResult.success();
+    }
+
+    /**
+     * 获取组件快递列表
+     */
+    @PreAuthorize("hasAuthority('platform:pay:component:delivery:company:get:list')")
+    @ApiOperation(value = "获取组件快递")
+    @RequestMapping(value = "/get/list", method = RequestMethod.GET)
+    public CommonResult<List<PayComponentDeliveryCompany>> getList(){
+        return CommonResult.success(payComponentDeliveryCompanyService.getList());
+    }
+}
+
+
+

+ 109 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PayComponentDraftProductController.java

@@ -0,0 +1,109 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.common.model.wechat.video.PayComponentDraftProduct;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.request.wxvedio.product.ComponentProductSearchRequest;
+import com.zbkj.common.request.wxvedio.product.PayComponentDraftProductMerchantOperationReviewStatus;
+import com.zbkj.common.request.wxvedio.product.PayComponentDraftProductPlatformOperationReviewStatus;
+import com.zbkj.common.request.wxvedio.product.PayComponentProductAddRequest;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.PayComponentDraftProductService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @Auther: 大粽子
+ * @Date: 2022/10/10 19:36
+ * @Description: 微信 自定义交易组件 草稿商品 控制器
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/pay/component/draftproduct")
+@Api(tags = "08小程序 自定义交易组件—草稿商品") //配合swagger使用
+public class PayComponentDraftProductController {
+
+    @Autowired
+    private PayComponentDraftProductService payComponentDraftProductService;
+
+    /**
+     * 添加商品 添加商品到草稿 不自动提审 有专门提审的api
+     */
+    @PreAuthorize("hasAuthority('platform:pay:component:product:draft:add')")
+    @ApiOperation(value = "添加草稿商品")
+    @RequestMapping(value = "/add", method = RequestMethod.POST)
+    public CommonResult<String> add(@RequestBody @Validated PayComponentProductAddRequest addRequest) {
+        if (payComponentDraftProductService.add(addRequest)) {
+            return CommonResult.success("添加商品成功");
+        }
+        return CommonResult.failed("添加商品失败");
+    }
+
+
+    /**
+     * 编辑草稿商品 不自动提审 有专门提审的api
+     */
+    @PreAuthorize("hasAuthority('platform:pay:component:product:draft:update')")
+    @ApiOperation(value = "编辑草稿商品")
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    public CommonResult<String> update(@RequestBody @Validated PayComponentProductAddRequest addRequest) {
+        if (payComponentDraftProductService.edit(addRequest)) {
+            return CommonResult.success("编辑草稿商品成功");
+        }
+        return CommonResult.failed("编辑草稿商品失败");
+    }
+
+    /**
+     * 删除草稿商品 不自动提审 有专门提审的api
+     */
+    @PreAuthorize("hasAuthority('platform:pay:component:product:draft:delete')")
+    @ApiOperation(value = "删除草稿商品")
+    @RequestMapping(value = "/delete/{id}", method = RequestMethod.GET)
+    public CommonResult<String> delete(@PathVariable Integer id) {
+        if (payComponentDraftProductService.removeById(id)) {
+            return CommonResult.success("删除草稿商品成功");
+        }
+        return CommonResult.failed("删除草稿商品失败");
+    }
+
+    /**
+     * 草稿商品 商家审核操作 会用于平台创建视频号商品时
+     */
+    @PreAuthorize("hasAuthority('platform:pay:component:product:draft:review')")
+    @ApiOperation(value = "审核草稿商品-平台角色操作")
+    @RequestMapping(value = "/review", method = RequestMethod.POST)
+    public CommonResult<String> review(@RequestBody @Validated PayComponentDraftProductPlatformOperationReviewStatus reviewStatus) {
+        if (payComponentDraftProductService.OperationPlatformReviewStatusByPlatform(reviewStatus)) {
+            return CommonResult.success("平台审核草稿商品成功");
+        }
+        return CommonResult.failed("平台操作草稿商品失败");
+    }
+
+    /**
+     * 平台待审核草稿商品列表(分页)
+     * @param request 搜索条件
+     * @param pageParamRequest 分页参数
+     */
+    @PreAuthorize("hasAuthority('platform:pay:component:product:draft:list')")
+    @ApiOperation(value = "平台待审核 草稿商品列表(分页)") //配合swagger使用
+    @RequestMapping(value = "/draft/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<PayComponentDraftProduct>> getDraftList(@Validated ComponentProductSearchRequest request,
+                                                                           @Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(payComponentDraftProductService.getPlatformAdminListAfterMerchantReviewBeforeWeChatReview(request, pageParamRequest)));
+    }
+
+    /**
+     * 草稿商品详情
+     */
+    @PreAuthorize("hasAuthority('platform:pay:component:product:draft:info')")
+    @ApiOperation(value = "草稿商品详情") //配合swagger使用
+    @RequestMapping(value = "/draft/get/{id}", method = RequestMethod.GET)
+    public CommonResult<PayComponentDraftProduct> getDraftInfo(@PathVariable Integer id) {
+        return CommonResult.success(payComponentDraftProductService.getInfo(id));
+    }
+}

+ 26 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PayComponentProductAuditInfoController.java

@@ -0,0 +1,26 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.service.service.PayComponentProductAuditInfoService;
+import io.swagger.annotations.Api;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ *  组件商品审核信息表 前端控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/pay-component-product-audit-info")
+@Api(tags = "06小程序 自定义交易组件-审核信息表") //配合swagger使用
+public class PayComponentProductAuditInfoController {
+
+    @Autowired
+    private PayComponentProductAuditInfoService payComponentProductAuditInfoService;
+}
+
+
+

+ 112 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PayComponentProductController.java

@@ -0,0 +1,112 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.common.model.wechat.video.PayComponentDraftProduct;
+import com.zbkj.common.model.wechat.video.PayComponentProduct;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.request.wxvedio.product.ComponentProductSearchRequest;
+import com.zbkj.common.request.wxvedio.product.PayComponentProductAddRequest;
+import com.zbkj.common.response.wxvideo.PayComponentProductResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.PayComponentDraftProductService;
+import com.zbkj.service.service.PayComponentProductService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+
+/**
+ *  组件商品表 前端控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/pay/component/product")
+@Api(tags = "07小程序 自定义交易组件—过审商品") //配合swagger使用
+public class PayComponentProductController {
+
+    @Autowired
+    private PayComponentProductService payComponentProductService;
+
+    /**
+     * 删除商品
+     */
+    @PreAuthorize("hasAuthority('platform:pay:component:product:delete')")
+    @ApiOperation(value = "删除商品")
+    @RequestMapping(value = "/delete/{proId}", method = RequestMethod.POST)
+    public CommonResult<Object> delete(@PathVariable Integer proId) {
+        if (payComponentProductService.delete(proId)) {
+            return CommonResult.success("删除商品成功");
+        }
+        return CommonResult.failed("删除商品失败");
+    }
+
+    /** TODO 备份
+     * 更新商品 包括平台审核和微信审核
+     */
+//    @PreAuthorize("hasAuthority('platform:pay:component:product:update')")
+//    @ApiOperation(value = "更新商品-替换更新审核商品")
+//    @RequestMapping(value = "/update", method = RequestMethod.POST)
+//    public CommonResult<Object> update(@RequestBody @Validated PayComponentProductAddRequest addRequest) {
+//        if (payComponentProductService.update(addRequest)) {
+//            return CommonResult.success("更新商品成功");
+//        }
+//        return CommonResult.failed("更新商品失败");
+//    }
+
+    /**
+     * 上架商品
+     */
+//    @PreAuthorize("hasAuthority('platform:pay:component:product:listing')")
+//    @ApiOperation(value = "上架商品")
+//    @RequestMapping(value = "/puton/{proId}", method = RequestMethod.POST)
+//    public CommonResult<Object> puton(@PathVariable Integer proId) {
+//        if (payComponentProductService.puton(proId)) {
+//            return CommonResult.success("上架商品成功");
+//        }
+//        return CommonResult.failed("上架商品失败");
+//    }
+
+    /**
+     * 平台下架商品
+     */
+    @PreAuthorize("hasAuthority('platform:pay:component:product:delisting')")
+    @ApiOperation(value = "下架商品")
+    @RequestMapping(value = "/putdown/{proId}", method = RequestMethod.POST)
+    public CommonResult<Object> putdown(@PathVariable Integer proId) {
+        if (payComponentProductService.putdownByPlatForm(proId)) {
+            return CommonResult.success("下架商品成功");
+        }
+        return CommonResult.failed("下架商品失败");
+    }
+
+    /**
+     * 获取全平台下 的过审商品列表(分页)
+     * @param request 搜索条件
+     * @param pageParamRequest 分页参数
+     */
+    @PreAuthorize("hasAuthority('platform:pay:component:product:list')")
+    @ApiOperation(value = "获取全平台下的过审商品列表(分页)") //配合swagger使用
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<PayComponentProduct>> getPlatformListByAfterWechatReview(@Validated ComponentProductSearchRequest request,
+                                                                 @Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(payComponentProductService.getPlatformProductListByAfterWechatReview(request, pageParamRequest)));
+    }
+
+    /**
+     * 过审商品详情
+     */
+    @PreAuthorize("hasAuthority('platform:pay:component:product:info')")
+    @ApiOperation(value = "过审商品详情") //配合swagger使用
+    @RequestMapping(value = "/get/{id}", method = RequestMethod.GET)
+    public CommonResult<PayComponentProductResponse> getInfo(@PathVariable Integer id) {
+        return CommonResult.success(payComponentProductService.getInfo(id));
+    }
+}
+
+
+

+ 26 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PayComponentProductInfoController.java

@@ -0,0 +1,26 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.service.service.PayComponentProductInfoService;
+import io.swagger.annotations.Api;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ *  组件商品详情表 前端控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/pay-component-product-info")
+@Api(tags = "08小程序 自定义交易组件-商品详情") //配合swagger使用
+public class PayComponentProductInfoController {
+
+    @Autowired
+    private PayComponentProductInfoService payComponentProductInfoService;
+}
+
+
+

+ 27 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PayComponentProductSkuAttrController.java

@@ -0,0 +1,27 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.service.service.PayComponentProductSkuAttrService;
+import io.swagger.annotations.Api;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ *  组件商品sku属性表 前端控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/pay-component-product-sku-attr")
+@Api(tags = "09小程序 自定义交易组件-商品sku属性") //配合swagger使用
+
+public class PayComponentProductSkuAttrController {
+
+    @Autowired
+    private PayComponentProductSkuAttrService payComponentProductSkuAttrService;
+}
+
+
+

+ 27 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PayComponentProductSkuController.java

@@ -0,0 +1,27 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.service.service.PayComponentProductSkuService;
+import io.swagger.annotations.Api;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ *  组件商品sku表 前端控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/pay-component-product-sku")
+@Api(tags = "10小程序 自定义交易组件-商品sku表") //配合swagger使用
+
+public class PayComponentProductSkuController {
+
+    @Autowired
+    private PayComponentProductSkuService payComponentProductSkuService;
+}
+
+
+

+ 80 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PayComponentRegisterController.java

@@ -0,0 +1,80 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.common.request.wxvedio.forregister.ShopRegisterApplySceneRequest;
+import com.zbkj.common.request.wxvedio.forregister.ShopRegisterFinishAccessInfoRequest;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.vo.wxvedioshop.BaseResultResponseVo;
+import com.zbkj.common.vo.wxvedioshop.register.RegisterCheckResponseVo;
+import com.zbkj.service.service.PayComponentShopService;
+import com.zbkj.service.service.WechatVideoShopService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ *  自定义交易组件—商家接入
+
+ */
+@RestController
+@RequestMapping("api/admin/platform/pay/component/register")
+@Api(tags = "01微信小程序 自定义交易组件—申请接入") //配合swagger使用
+public class PayComponentRegisterController {
+
+    @Autowired
+    private PayComponentShopService shopService;
+
+    @Autowired
+    private WechatVideoShopService wechatVideoShopService;
+
+    /**
+     * 微信小程序 自定义交易组件 接入申请
+     * @return 申请结果
+     */
+    @PreAuthorize("hasAuthority('platform:pay:component:shop:register')")
+    @ApiOperation(value = "自定义交易组件 接入申请")
+    @RequestMapping(value = "/apply", method = RequestMethod.GET)
+    public CommonResult<BaseResultResponseVo> shopRegisterApply() {
+        return CommonResult.success(wechatVideoShopService.shopRegisterApply());
+    }
+
+    /**
+     * 微信小程序 自定义交易组件 接入状态
+     * 开通自定义交易组件时用此接口检查
+     * @return 接入状态
+     */
+    @PreAuthorize("hasAuthority('platform:pay:component:shop:register:check')")
+    @ApiOperation(value = "自定义交易组件 接入状态")
+    @RequestMapping(value = "/register/check", method = RequestMethod.GET)
+    public CommonResult<RegisterCheckResponseVo> shopRegisterCheck() {
+        return CommonResult.success(wechatVideoShopService.shopRegisterCheck());
+    }
+
+    /**
+     * 微信小程序 自定义交易组件 完成接入任务
+     * @param srfai 6:完成 spu 接口,7:完成订单接口 / 19:完成二级商户号订单,8:完成物流接口,9:完成售后接口 / 20:完成二级商户号售后,10:测试完成,11:发版完成
+     * @return 接入状态
+     */
+    @PreAuthorize("hasAuthority('platform:pay:component:shop:register:finish')")
+    @ApiOperation(value = "自定义交易组件 完成接入任务")
+    @RequestMapping(value = "/register/finishaccessinfo", method = RequestMethod.POST)
+    public CommonResult<BaseResultResponseVo> shopRegisterFinishAccessInfo(ShopRegisterFinishAccessInfoRequest srfai) {
+        return CommonResult.success(wechatVideoShopService.shopRegisterFinishAccessInfo(srfai));
+    }
+
+    /**
+     * 微信小程序 自定义交易组件 场景接入申请
+     * @param shopRegisterApplySceneRequest
+     * @return 申请状态
+     */
+    @PreAuthorize("hasAuthority('platform:pay:component:shop:register:scene')")
+    @ApiOperation(value = "自定义交易组件 场景接入申请")
+    @RequestMapping(value = "/register/scene", method = RequestMethod.POST)
+    public CommonResult<BaseResultResponseVo> shopRegisterFinishAccessInfo(ShopRegisterApplySceneRequest shopRegisterApplySceneRequest) {
+        return CommonResult.success(wechatVideoShopService.shopRegisterApplyScene(shopRegisterApplySceneRequest));
+    }
+
+}

+ 103 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PayComponentShopController.java

@@ -0,0 +1,103 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.common.model.wechat.video.PayComponentShopBrand;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.request.wxvedio.image.ShopUploadImgRequest;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.vo.wxvedioshop.WechatVideoUploadImageResponseVo;
+import com.zbkj.common.vo.wxvedioshop.audit.*;
+import com.zbkj.common.vo.wxvedioshop.cat_brand.ShopCatDetailVo;
+import com.zbkj.service.service.PayComponentShopService;
+import com.zbkj.service.service.WechatVideoBeforeService;
+import com.zbkj.service.service.WechatVideoSpuService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ *  自定义交易组件—商家及接入前
+
+ */
+@RestController
+@RequestMapping("api/admin/platform/pay/component/shop")
+@Api(tags = "02微信小程序 自定义交易组件—接入商品前必须接口") //配合swagger使用
+public class PayComponentShopController {
+
+    @Autowired
+    private PayComponentShopService shopService;
+
+    @Autowired
+    private WechatVideoBeforeService wechatVideoBeforeService;
+
+    @Autowired
+    private WechatVideoSpuService wechatVideoSpuService;
+
+    /***************************************** 接入之前必须调用 START ************************************************/
+
+    @PreAuthorize("hasAuthority('platform:pay:component:shop:cat:get')")
+    @ApiOperation(value = "获取类目详情")
+    @RequestMapping(value = "/cat/get", method = RequestMethod.POST)
+    public CommonResult<List<ShopCatDetailVo>> shopCatGet() {
+        return CommonResult.success(wechatVideoSpuService.getShopCat());
+    }
+
+    @PreAuthorize("hasAuthority('platform:pay:component:shop:img:upload')")
+    @ApiOperation(value = "上传图片 到微信自定义组件换链接")
+    @RequestMapping(value = "/img/upload", method = RequestMethod.POST)
+    public CommonResult<WechatVideoUploadImageResponseVo> shopImgUpload(@RequestBody ShopUploadImgRequest request) {
+        return CommonResult.success(wechatVideoBeforeService.shopImgUpload(request));
+    }
+
+    @PreAuthorize("hasAuthority('platform:pay:component:shop:brand:audit')")
+    @ApiOperation(value = "上传品牌信息")
+    @RequestMapping(value = "/brand/audit", method = RequestMethod.POST)
+    public CommonResult<String> shopAuditBrand(@RequestBody @Validated ShopAuditBrandRequestVo request) {
+        return CommonResult.success(shopService.auditBrand(request));
+    }
+
+    @PreAuthorize("hasAuthority('platform:pay:component:shop:category:audit')")
+    @ApiOperation(value = "上传类目资质")
+    @RequestMapping(value = "/category/audit", method = RequestMethod.POST)
+    public CommonResult<ShopAuditCategoryResponseVo> shopAuditCategory(@RequestBody @Validated ShopAuditCategoryRequestVo request) {
+        return CommonResult.success(wechatVideoBeforeService.shopAuditCategory(request));
+    }
+
+
+    @PreAuthorize("hasAuthority('platform:pay:component:shop:audit:result')")
+    @ApiOperation(value = "查询审核结果")
+    @RequestMapping(value = "/audit/result", method = RequestMethod.POST)
+    public CommonResult<ShopAuditResultResponseVo> shopAuditResult(@RequestBody @Validated ShopAuditResultCategoryAndBrandRequestVo request) {
+        return CommonResult.success(wechatVideoBeforeService.shopAuditResult(request));
+    }
+
+
+    @PreAuthorize("hasAuthority('platform:pay:component:certificate')")
+    @ApiOperation(value = "获取小程序提交过往的入驻资质信息")
+    @RequestMapping(value = "/audit/certificate", method = RequestMethod.POST)
+    public CommonResult<ShopAuditGetMiniAppCertificateRequestVo> shopAuditCertificate(@RequestBody @Validated ShopAuditGetMiniAppCertificateRequestVo request) {
+        return CommonResult.success(wechatVideoBeforeService.shopAuditGetMinCertificate(request));
+    }
+
+    /***************************************** 接入之前必须调用 END ************************************************/
+
+
+    @PreAuthorize("hasAuthority('platform:pay:component:shop:brand:list')")
+    @ApiOperation(value = "品牌列表 分页")
+    @RequestMapping(value = "/brand/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<PayComponentShopBrand>> shopBrandList(@Validated PageParamRequest pageParamRequest, @RequestParam(value = "status", required = false) Integer status) {
+        return CommonResult.success(CommonPage.restPage(shopService.brandList(pageParamRequest, status)));
+    }
+
+    @PreAuthorize("hasAuthority('platform:pay:component:shop:brand:usable:list')")
+    @ApiOperation(value = "品牌列表 不分页")
+    @RequestMapping(value = "/brand/usable/list", method = RequestMethod.GET)
+    public CommonResult<List<PayComponentShopBrand>> shopUsableBrandList() {
+        return CommonResult.success(shopService.usableBrandList());
+    }
+}

+ 100 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PlatformAdminController.java

@@ -0,0 +1,100 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.model.admin.SystemAdmin;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.request.SystemAdminAddRequest;
+import com.zbkj.common.request.SystemAdminRequest;
+import com.zbkj.common.request.SystemAdminUpdateRequest;
+import com.zbkj.common.response.SystemAdminResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.SystemAdminService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+
+
+/**
+ * 后台管理员表 前端控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/admin")
+@Api(tags = "平台管理员服务")
+public class PlatformAdminController {
+
+    @Autowired
+    private SystemAdminService systemAdminService;
+
+    @PreAuthorize("hasAuthority('platform:admin:list')")
+    @ApiOperation(value = "后台管理员分页列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<SystemAdminResponse>> getList(@Validated SystemAdminRequest systemAdminRequest, PageParamRequest pageParamRequest) {
+        CommonPage<SystemAdminResponse> systemAdminCommonPage = CommonPage.restPage(systemAdminService.getList(systemAdminRequest, pageParamRequest));
+        return CommonResult.success(systemAdminCommonPage);
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.ADD, description = "新增后台管理员")
+    @PreAuthorize("hasAuthority('platform:admin:save')")
+    @ApiOperation(value = "新增后台管理员")
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    public CommonResult<String> save(@RequestBody SystemAdminAddRequest systemAdminAddRequest) {
+        if (systemAdminService.saveAdmin(systemAdminAddRequest)) {
+            return CommonResult.success("添加管理员成功");
+        }
+        return CommonResult.failed("添加管理员失败");
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.DELETE, description = "删除后台管理员")
+    @PreAuthorize("hasAuthority('platform:admin:delete')")
+    @ApiOperation(value = "删除后台管理员")
+    @RequestMapping(value = "/delete", method = RequestMethod.GET)
+    public CommonResult<String> delete(@RequestParam(value = "id") Integer id) {
+        if (systemAdminService.removeAdmin(id)) {
+            return CommonResult.success();
+        } else {
+            return CommonResult.failed();
+        }
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "修改后台管理员")
+    @PreAuthorize("hasAuthority('platform:admin:update')")
+    @ApiOperation(value = "修改后台管理员")
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    public CommonResult<String> update(@RequestBody SystemAdminUpdateRequest systemAdminRequest) {
+        if (systemAdminService.updateAdmin(systemAdminRequest)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:admin:info')")
+    @ApiOperation(value = "后台管理员详情")
+    @RequestMapping(value = "/info", method = RequestMethod.GET)
+    public CommonResult<SystemAdmin> info(@RequestParam(value = "id") @Valid Integer id) {
+        return CommonResult.success(systemAdminService.getDetail(id));
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "修改后台管理员状态")
+    @PreAuthorize("hasAuthority('platform:admin:update:status')")
+    @ApiOperation(value = "修改后台管理员状态")
+    @RequestMapping(value = "/updateStatus", method = RequestMethod.GET)
+    public CommonResult<Object> updateStatus(@RequestParam(value = "id") @Valid Integer id, @RequestParam(value = "status") @Valid Boolean status) {
+        if (systemAdminService.updateStatus(id, status)) {
+            return CommonResult.success("修改成功");
+        }
+        return CommonResult.failed("修改失败");
+    }
+}
+
+
+

+ 71 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PlatformAttachmentController.java

@@ -0,0 +1,71 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.model.system.SystemAttachment;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.request.SystemAttachmentMoveRequest;
+import com.zbkj.common.request.SystemAttachmentRemoveRequest;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.utils.CrmebUtil;
+import com.zbkj.service.service.SystemAttachmentService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 附件管理表 前端控制器 - 平台端
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/attachment")
+@Api(tags = "平台端附件管理") //配合swagger使用
+public class PlatformAttachmentController {
+
+    @Autowired
+    private SystemAttachmentService systemAttachmentService;
+
+    @PreAuthorize("hasAuthority('platform:attachment:list')")
+    @ApiOperation(value = "附件分页列表") //配合swagger使用
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<SystemAttachment>> getList(@RequestParam(value = "pid", required = false) Integer pid,
+                                                              @RequestParam(value = "attType",
+                                                                      defaultValue = "png,jpeg,jpg,audio/mpeg,text/plain,video/mp4,gif",
+                                                                      required = false) String attType,
+                                                              @Validated PageParamRequest pageParamRequest) {
+        CommonPage<SystemAttachment> systemAttachmentCommonPage =
+                CommonPage.restPage(systemAttachmentService.getList(pid, attType, pageParamRequest));
+        return CommonResult.success(systemAttachmentCommonPage);
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.DELETE, description = "删除附件")
+    @PreAuthorize("hasAuthority('platform:attachment:delete')")
+    @ApiOperation(value = "删除附件")
+    @RequestMapping(value = "/delete", method = RequestMethod.POST)
+    public CommonResult<String> delete(@RequestBody @Validated SystemAttachmentRemoveRequest removeRequest) {
+        if (systemAttachmentService.removeByIds(CrmebUtil.stringToArray(removeRequest.getIds()))) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+
+    @PreAuthorize("hasAuthority('platform:attachment:move')")
+    @ApiOperation(value = "更改图片目录")
+    @RequestMapping(value = "/move", method = RequestMethod.POST)
+    public CommonResult<String> updateAttrId(@RequestBody @Validated SystemAttachmentMoveRequest move) {
+        if (systemAttachmentService.updateAttrId(move)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+}
+
+
+

+ 124 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PlatformBaseCategoryController.java

@@ -0,0 +1,124 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.model.category.Category;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.CategoryRequest;
+import com.zbkj.common.request.CategorySearchRequest;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.utils.CrmebUtil;
+import com.zbkj.common.vo.CategoryTreeVo;
+import com.zbkj.service.service.CategoryService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+
+/**
+ * 分类表 前端控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/category")
+@Api(tags = "平台端基础分类服务")
+public class PlatformBaseCategoryController {
+
+    @Autowired
+    private CategoryService categoryService;
+
+    @PreAuthorize("hasAuthority('platform:category:list')")
+    @ApiOperation(value = "基础分类分页列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<Category>> getList(@ModelAttribute CategorySearchRequest request, @ModelAttribute PageParamRequest pageParamRequest) {
+        CommonPage<Category> categoryCommonPage = CommonPage.restPage(categoryService.getList(request, pageParamRequest));
+        return CommonResult.success(categoryCommonPage);
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.ADD, description = "新增基础分类")
+    @PreAuthorize("hasAuthority('platform:category:save')")
+    @ApiOperation(value = "新增基础分类")
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    public CommonResult<String> save(@RequestBody @Validated CategoryRequest categoryRequest) {
+        if (categoryService.create(categoryRequest)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.DELETE, description = "删除基础分类")
+    @PreAuthorize("hasAuthority('platform:category:delete')")
+    @ApiOperation(value = "删除基础分类")
+    @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
+    public CommonResult<String> delete(@PathVariable(value = "id") Integer id) {
+        if (categoryService.delete(id) > 0) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "修改基础分类")
+    @PreAuthorize("hasAuthority('platform:category:update')")
+    @ApiOperation(value = "修改基础分类")
+    @RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
+    public CommonResult<String> update(@PathVariable(value = "id") Integer id, @RequestBody @Validated CategoryRequest categoryRequest) {
+        if (categoryService.update(categoryRequest, id)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:category:info')")
+    @ApiOperation(value = "基础分类详情")
+    @RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
+    public CommonResult<Category> info(@PathVariable(value = "id") Integer id) {
+        return CommonResult.success(categoryService.getByIdException(id));
+    }
+
+
+    @PreAuthorize("hasAuthority('platform:category:list:tree')")
+    @ApiOperation(value = "获取基础分类tree结构的列表")
+    @RequestMapping(value = "/list/tree", method = RequestMethod.GET)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "type", value = "类型ID | 类型,2  附件分类, 4 设置分类, 6 配置分类", example = "1"),
+            @ApiImplicitParam(name = "status", value = "-1=全部,0=未生效,1=已生效", example = "1"),
+            @ApiImplicitParam(name = "name", value = "模糊搜索", example = "电视")
+    })
+    public CommonResult<List<CategoryTreeVo>> getListTree(@RequestParam(name = "type") Integer type,
+                                                          @RequestParam(name = "status") Integer status,
+                                                          @RequestParam(name = "name", required = false) String name) {
+        List<CategoryTreeVo> listTree = categoryService.getListTree(type, status, name);
+        return CommonResult.success(listTree);
+    }
+
+    @PreAuthorize("hasAuthority('platform:category:list:ids')")
+    @ApiOperation(value = "根据id集合获取基础分类列表")
+    @RequestMapping(value = "/list/ids", method = RequestMethod.GET)
+    @ApiImplicitParam(name = "ids", value = "分类id集合")
+    public CommonResult<List<Category>> getByIds(@Validated @RequestParam(name = "ids") String ids) {
+        return CommonResult.success(categoryService.getByIds(CrmebUtil.stringToArray(ids)));
+    }
+
+    @PreAuthorize("hasAuthority('platform:category:update:status')")
+    @ApiOperation(value = "更改基础分类状态")
+    @RequestMapping(value = "/updateStatus/{id}", method = RequestMethod.POST)
+    public CommonResult<Object> getByIds(@PathVariable(name = "id") Integer id) {
+        if (categoryService.updateStatus(id)) {
+            return CommonResult.success("修改成功");
+        }
+        return CommonResult.failed("修改失败");
+    }
+}
+
+
+

+ 41 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PlatformLogController.java

@@ -0,0 +1,41 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.common.model.record.SensitiveMethodLog;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.SensitiveMethodLogService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 日志控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/log")
+@Api(tags = "平台端敏感日志控制器")
+public class PlatformLogController {
+
+    @Autowired
+    private SensitiveMethodLogService sensitiveMethodLogService;
+
+    /**
+     * 敏感操作日志列表
+     */
+    @PreAuthorize("hasAuthority('platform:log:sensitive:list')")
+    @ApiOperation(value = "敏感操作日志分页列表")
+    @RequestMapping(value = "/sensitive/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<SensitiveMethodLog>> getList(@Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(sensitiveMethodLogService.getPlatformPageList(pageParamRequest)));
+    }
+
+}

+ 84 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PlatformLoginController.java

@@ -0,0 +1,84 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.admin.service.AdminLoginService;
+import com.zbkj.common.request.LoginAdminUpdateRequest;
+import com.zbkj.common.request.SystemAdminLoginRequest;
+import com.zbkj.common.response.AdminLoginPicResponse;
+import com.zbkj.common.response.LoginAdminResponse;
+import com.zbkj.common.response.MenusResponse;
+import com.zbkj.common.response.SystemLoginResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.utils.CrmebUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+
+/**
+ * 平台端登录控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform")
+@Api(tags = "平台端登录控制器")
+public class PlatformLoginController {
+
+    @Autowired
+    private AdminLoginService loginService;
+
+    @ApiOperation(value="登录")
+    @RequestMapping(value = "/login", method = RequestMethod.POST)
+    public CommonResult<SystemLoginResponse> systemAdminLogin(@RequestBody @Validated SystemAdminLoginRequest systemAdminLoginRequest, HttpServletRequest request) {
+        String ip = CrmebUtil.getClientIp(request);
+        SystemLoginResponse systemAdminResponse = loginService.platformLogin(systemAdminLoginRequest, ip);
+        return CommonResult.success(systemAdminResponse, "login success");
+    }
+
+    @PreAuthorize("hasAuthority('platform:logout')")
+    @ApiOperation(value="登出")
+    @RequestMapping(value = "/logout", method = RequestMethod.GET)
+    public CommonResult<Object> systemAdminLogout() {
+        loginService.logout();
+        return CommonResult.success("logout success");
+    }
+
+    @PreAuthorize("hasAuthority('platform:login:user:info')")
+    @ApiOperation(value="获取登录用户详情")
+    @RequestMapping(value = "/getAdminInfoByToken", method = RequestMethod.GET)
+    public CommonResult<LoginAdminResponse> getAdminInfo() {
+        return CommonResult.success(loginService.getInfoByToken());
+    }
+
+    @ApiOperation(value = "获取登录页图片")
+    @RequestMapping(value = "/getLoginPic", method = RequestMethod.GET)
+    public CommonResult<AdminLoginPicResponse> getLoginPic() {
+        return CommonResult.success(loginService.getLoginPic());
+    }
+
+    @PreAuthorize("hasAuthority('platform:login:menus')")
+    @ApiOperation(value = "获取管理员可访问目录")
+    @RequestMapping(value = "/getMenus", method = RequestMethod.GET)
+    public CommonResult<List<MenusResponse>> getMenus() {
+        return CommonResult.success(loginService.getMenus());
+    }
+
+    @PreAuthorize("hasAuthority('platform:login:admin:update')")
+    @ApiOperation(value="修改登录用户信息")
+    @RequestMapping(value = "/login/admin/update", method = RequestMethod.POST)
+    public CommonResult<SystemLoginResponse> loginAdminUpdate(@RequestBody @Validated LoginAdminUpdateRequest request) {
+        if (loginService.loginAdminUpdate(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+}

+ 102 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PlatformMenuController.java

@@ -0,0 +1,102 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.model.admin.SystemMenu;
+import com.zbkj.common.request.SystemMenuRequest;
+import com.zbkj.common.request.SystemMenuSearchRequest;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.vo.MenuCheckVo;
+import com.zbkj.service.service.SystemMenuService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+
+/**
+ * 平台菜单控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/menu")
+@Api(tags = "平台端菜单控制器")
+public class PlatformMenuController {
+
+    @Autowired
+    private SystemMenuService systemMenuService;
+
+    @PreAuthorize("hasAuthority('platform:menu:list')")
+    @ApiOperation(value = "菜单列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<List<SystemMenu>> getList(@Validated SystemMenuSearchRequest request) {
+        return CommonResult.success(systemMenuService.getPlatformList(request));
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.ADD, description = "新增菜单")
+    @PreAuthorize("hasAuthority('platform:menu:add')")
+    @ApiOperation(value = "新增菜单")
+    @RequestMapping(value = "/add", method = RequestMethod.POST)
+    public CommonResult<String> add(@RequestBody @Validated SystemMenuRequest systemMenuRequest) {
+        if (systemMenuService.addPlatformMenu(systemMenuRequest)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.DELETE, description = "删除菜单")
+    @PreAuthorize("hasAuthority('platform:menu:delete')")
+    @ApiOperation(value = "删除菜单")
+    @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
+    public CommonResult<String> delete(@PathVariable(value = "id") Integer id) {
+        if (systemMenuService.deletePlatformMenu(id)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "修改菜单")
+    @PreAuthorize("hasAuthority('platform:menu:update')")
+    @ApiOperation(value = "修改菜单")
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    public CommonResult<String> update(@RequestBody @Validated SystemMenuRequest systemMenuRequest) {
+        if (systemMenuService.editPlatformMenu(systemMenuRequest)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:menu:info')")
+    @ApiOperation(value = "菜单详情")
+    @RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
+    public CommonResult<SystemMenu> info(@PathVariable(value = "id") Integer id) {
+        return CommonResult.success(systemMenuService.getInfo(id));
+   }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "修改菜单显示状态")
+    @PreAuthorize("hasAuthority('platform:menu:show:status')")
+    @ApiOperation(value = "修改菜单显示状态")
+    @RequestMapping(value = "/update/show/{id}", method = RequestMethod.POST)
+    public CommonResult<Object> updateShowStatus(@PathVariable(value = "id") Integer id) {
+        if (systemMenuService.updatePlatformShowStatus(id)) {
+            return CommonResult.success("修改成功");
+        }
+        return CommonResult.failed("修改失败");
+    }
+
+    @PreAuthorize("hasAuthority('platform:menu:cache:tree')")
+    @ApiOperation(value = "菜单缓存树")
+    @RequestMapping(value = "/cache/tree", method = RequestMethod.GET)
+    public CommonResult<List<MenuCheckVo>> getPlatformMenuCacheTree() {
+        return CommonResult.success(systemMenuService.getPlatformMenuCacheTree());
+    }
+}
+
+
+

+ 93 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PlatformMerchantMenuController.java

@@ -0,0 +1,93 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.model.admin.SystemMenu;
+import com.zbkj.common.request.SystemMenuRequest;
+import com.zbkj.common.request.SystemMenuSearchRequest;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.SystemMenuService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+
+/**
+ * 平台端商户菜单控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/merchant/menu")
+@Api(tags = "平台端商户菜单控制器")
+public class PlatformMerchantMenuController {
+
+    @Autowired
+    private SystemMenuService systemMenuService;
+
+    @PreAuthorize("hasAuthority('platform:merchant:menu:list')")
+    @ApiOperation(value = "菜单列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<List<SystemMenu>> getList(@Validated SystemMenuSearchRequest request) {
+        return CommonResult.success(systemMenuService.getMerchantList(request));
+    }
+
+    @PreAuthorize("hasAuthority('platform:merchant:menu:add')")
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.ADD, description = "新增商户菜单")
+    @ApiOperation(value = "新增菜单")
+    @RequestMapping(value = "/add", method = RequestMethod.POST)
+    public CommonResult<String> add(@RequestBody @Validated SystemMenuRequest systemMenuRequest) {
+        if (systemMenuService.addMerchantMenu(systemMenuRequest)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:merchant:menu:delete')")
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "删除商户菜单")
+    @ApiOperation(value = "删除菜单")
+    @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
+    public CommonResult<String> delete(@PathVariable(value = "id") Integer id) {
+        if (systemMenuService.deleteMerchantMenu(id)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:merchant:menu:update')")
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "修改商户菜单")
+    @ApiOperation(value = "修改菜单")
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    public CommonResult<String> update(@RequestBody @Validated SystemMenuRequest systemMenuRequest) {
+        if (systemMenuService.editMerchantMenu(systemMenuRequest)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:merchant:menu:info')")
+    @ApiOperation(value = "菜单详情")
+    @RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
+    public CommonResult<SystemMenu> info(@PathVariable(value = "id") Integer id) {
+        return CommonResult.success(systemMenuService.getInfo(id));
+   }
+
+    @PreAuthorize("hasAuthority('platform:merchant:menu:show:status')")
+    @ApiOperation(value = "修改菜单显示状态")
+    @RequestMapping(value = "/update/show/{id}", method = RequestMethod.POST)
+    public CommonResult<Object> updateShowStatus(@PathVariable(value = "id") Integer id) {
+        if (systemMenuService.updateMerchantShowStatus(id)) {
+            return CommonResult.success("修改成功");
+        }
+        return CommonResult.failed("修改失败");
+    }
+}
+
+
+

+ 73 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PlatformOrderController.java

@@ -0,0 +1,73 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.OrderSearchRequest;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.response.OrderCountItemResponse;
+import com.zbkj.common.response.OrderInvoiceResponse;
+import com.zbkj.common.response.PlatformOrderAdminDetailResponse;
+import com.zbkj.common.response.PlatformOrderPageResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.common.vo.LogisticsResultVo;
+import com.zbkj.service.service.OrderService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 订单表 前端控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/order")
+@Api(tags = "平台端订单控制器") //配合swagger使用
+public class PlatformOrderController {
+
+    @Autowired
+    private OrderService orderService;
+
+    @PreAuthorize("hasAuthority('platform:order:page:list')")
+    @ApiOperation(value = "平台端订单分页列表") //配合swagger使用
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<PlatformOrderPageResponse>> getList(@Validated OrderSearchRequest request, @Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(orderService.getPlatformAdminPage(request, pageParamRequest)));
+    }
+
+    @PreAuthorize("hasAuthority('platform:order:status:num')")
+    @ApiOperation(value = "平台端获取订单各状态数量")
+    @RequestMapping(value = "/status/num", method = RequestMethod.GET)
+    public CommonResult<OrderCountItemResponse> getOrderStatusNum(@RequestParam(value = "dateLimit", defaultValue = "") String dateLimit) {
+        return CommonResult.success(orderService.getPlatformOrderStatusNum(dateLimit));
+    }
+
+    @PreAuthorize("hasAuthority('platform:order:info')")
+    @ApiOperation(value = "平台端订单详情")
+    @RequestMapping(value = "/info", method = RequestMethod.GET)
+    public CommonResult<PlatformOrderAdminDetailResponse> info(@RequestParam(value = "orderNo") String orderNo) {
+        return CommonResult.success(orderService.platformInfo(orderNo));
+    }
+
+    @PreAuthorize("hasAuthority('platform:order:invoice:list')")
+    @ApiOperation(value = "获取订单发货单列表")
+    @RequestMapping(value = "/{orderNo}/invoice/list", method = RequestMethod.GET)
+    public CommonResult<List<OrderInvoiceResponse>> getInvoiceList(@PathVariable(value = "orderNo") String orderNo) {
+        return CommonResult.success(orderService.getInvoiceList(orderNo));
+    }
+
+    @PreAuthorize("hasAuthority('platform:order:logistics:info')")
+    @ApiOperation(value = "订单物流详情")
+    @RequestMapping(value = "/get/{invoiceId}/logistics/info", method = RequestMethod.GET)
+    public CommonResult<LogisticsResultVo> getLogisticsInfo(@PathVariable(value = "invoiceId") Integer invoiceId) {
+        return CommonResult.success(orderService.getLogisticsInfo(invoiceId));
+    }
+}
+
+
+

+ 70 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PlatformRefundOrderController.java

@@ -0,0 +1,70 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.request.RefundOrderRemarkRequest;
+import com.zbkj.common.request.RefundOrderSearchRequest;
+import com.zbkj.common.response.PlatformRefundOrderPageResponse;
+import com.zbkj.common.response.RefundOrderAdminDetailResponse;
+import com.zbkj.common.response.RefundOrderCountItemResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.RefundOrderService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 平台端退款订单控制器
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/refund/order")
+@Api(tags = "平台端退款订单控制器")
+public class PlatformRefundOrderController {
+
+    @Autowired
+    private RefundOrderService refundOrderService;
+
+    @PreAuthorize("hasAuthority('platform:refund:order:page:list')")
+    @ApiOperation(value = "平台端退款订单分页列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<PlatformRefundOrderPageResponse>> getList(@Validated RefundOrderSearchRequest request, @Validated PageParamRequest pageParamRequest) {
+        return CommonResult.success(CommonPage.restPage(refundOrderService.getPlatformAdminPage(request, pageParamRequest)));
+    }
+
+    @PreAuthorize("hasAuthority('platform:refund:order:status:num')")
+    @ApiOperation(value = "平台端获取退款订单各状态数量")
+    @RequestMapping(value = "/status/num", method = RequestMethod.GET)
+    public CommonResult<RefundOrderCountItemResponse> getOrderStatusNum(@RequestParam(value = "dateLimit", defaultValue = "") String dateLimit) {
+        return CommonResult.success(refundOrderService.getPlatformOrderStatusNum(dateLimit));
+    }
+
+    @PreAuthorize("hasAuthority('platform:refund:order:detail')")
+    @ApiOperation(value = "平台端退款订单详情")
+    @RequestMapping(value = "/detail/{refundOrderNo}", method = RequestMethod.GET)
+    public CommonResult<RefundOrderAdminDetailResponse> getDetail(@PathVariable(value = "refundOrderNo") String refundOrderNo) {
+        return CommonResult.success(refundOrderService.getPlatformDetail(refundOrderNo));
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "平台备注退款订单")
+    @PreAuthorize("hasAuthority('platform:refund:order:mark')")
+    @ApiOperation(value = "平台备注退款订单")
+    @RequestMapping(value = "/mark", method = RequestMethod.POST)
+    public CommonResult<String> mark(@RequestBody @Validated RefundOrderRemarkRequest request) {
+        if (refundOrderService.platformMark(request)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+}
+
+
+

+ 97 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/PlatformRoleController.java

@@ -0,0 +1,97 @@
+package com.zbkj.admin.controller.platform;
+
+import com.zbkj.common.annotation.LogControllerAnnotation;
+import com.zbkj.common.enums.MethodType;
+import com.zbkj.common.model.admin.SystemRole;
+import com.zbkj.common.page.CommonPage;
+import com.zbkj.common.request.PageParamRequest;
+import com.zbkj.common.request.SystemRoleRequest;
+import com.zbkj.common.request.SystemRoleSearchRequest;
+import com.zbkj.common.request.SystemRoleStatusRequest;
+import com.zbkj.common.response.RoleInfoResponse;
+import com.zbkj.common.result.CommonResult;
+import com.zbkj.service.service.SystemRoleService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+
+/**
+ * 身份管理表 前端控制器 平台端
+
+ */
+@Slf4j
+@RestController
+@RequestMapping("api/admin/platform/role")
+@Api(tags = "平台端 角色管理")
+public class PlatformRoleController {
+
+    @Autowired
+    private SystemRoleService systemRoleService;
+
+    @PreAuthorize("hasAuthority('platform:admin:role:list')")
+    @ApiOperation(value = "角色分页列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public CommonResult<CommonPage<SystemRole>> getList(@Validated SystemRoleSearchRequest request, @Validated PageParamRequest pageParamRequest) {
+        CommonPage<SystemRole> systemRoleCommonPage = CommonPage.restPage(systemRoleService.getList(request, pageParamRequest));
+        return CommonResult.success(systemRoleCommonPage);
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.ADD, description = "新增角色")
+    @PreAuthorize("hasAuthority('platform:admin:role:save')")
+    @ApiOperation(value = "新增角色")
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    public CommonResult<String> save(@RequestBody @Validated SystemRoleRequest systemRoleRequest) {
+        if (systemRoleService.add(systemRoleRequest)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.DELETE, description = "角色删除")
+    @PreAuthorize("hasAuthority('platform:admin:role:delete')")
+    @ApiOperation(value = "角色删除")
+    @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
+    public CommonResult<String> delete(@PathVariable(value = "id") Integer id) {
+        if (systemRoleService.delete(id)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "角色编辑")
+    @PreAuthorize("hasAuthority('platform:admin:role:update')")
+    @ApiOperation(value = "角色编辑")
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    public CommonResult<String> update(@RequestBody @Validated SystemRoleRequest systemRoleRequest) {
+        if (systemRoleService.edit(systemRoleRequest)) {
+            return CommonResult.success();
+        }
+        return CommonResult.failed();
+    }
+
+    @PreAuthorize("hasAuthority('platform:admin:role:info')")
+    @ApiOperation(value = "角色详情")
+    @RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
+    public CommonResult<RoleInfoResponse> info(@PathVariable Integer id) {
+        return CommonResult.success(systemRoleService.getInfo(id));
+    }
+
+    @LogControllerAnnotation(intoDB = true, methodType = MethodType.UPDATE, description = "修改角色状态")
+    @PreAuthorize("hasAuthority('platform:admin:role:update:status')")
+    @ApiOperation(value = "修改角色状态")
+    @RequestMapping(value = "/updateStatus", method = RequestMethod.POST)
+    public CommonResult<Object> updateStatus(@Validated @RequestBody SystemRoleStatusRequest request) {
+        if (systemRoleService.updateStatus(request)) {
+            return CommonResult.success("修改成功");
+        }
+        return CommonResult.failed("修改失败");
+    }
+}
+
+
+

部分文件因文件數量過多而無法顯示