Browse Source

华为云 obs 配置

lianghanqiang 4 năm trước cách đây
mục cha
commit
7ca5ca9ca3
57 tập tin đã thay đổi với 2135 bổ sung314 xóa
  1. 3 3
      admin/src/main/resources/application.properties
  2. 6 0
      admin/src/main/resources/banner.txt
  3. 3 0
      buyer-api/src/main/java/cn/lili/controller/passport/MemberBuyerController.java
  4. 1 1
      buyer-api/src/main/resources/application.yml
  5. 6 19
      buyer-api/src/main/resources/banner.txt
  6. 1 1
      buyer-api/src/main/resources/logback.xml
  7. 3 0
      common-api/src/main/java/cn/lili/controller/common/SmsController.java
  8. 1 4
      common-api/src/main/java/cn/lili/controller/common/UploadController.java
  9. 6 0
      common-api/src/main/resources/banner.txt
  10. 1 1
      common-api/src/main/resources/logback.xml
  11. 317 0
      config/application-wx.yml
  12. 33 32
      config/application.yml
  13. 3 0
      consumer/src/main/java/cn/lili/listener/NoticeSendMessageListener.java
  14. 6 0
      consumer/src/main/resources/banner.txt
  15. 1 1
      consumer/src/main/resources/logback.xml
  16. 11 0
      framework/pom.xml
  17. 4 1
      framework/src/main/java/cn/lili/common/elasticsearch/BaseElasticsearchService.java
  18. 3 0
      framework/src/main/java/cn/lili/common/enums/ResultCode.java
  19. 110 13
      framework/src/main/java/cn/lili/common/sms/impl/HweiSmsUtil.java
  20. 31 0
      framework/src/main/java/cn/lili/common/utils/excel/ExcelUtils.java
  21. 103 0
      framework/src/main/java/cn/lili/common/utils/excel/ImportHandle.java
  22. 17 0
      framework/src/main/java/cn/lili/common/utils/excel/ReadHandle.java
  23. 1 1
      framework/src/main/java/cn/lili/modules/connect/serviceimpl/ConnectServiceImpl.java
  24. 1 1
      framework/src/main/java/cn/lili/modules/file/plugin/impl/ObsFileManagerPlugin.java
  25. 4 1
      framework/src/main/java/cn/lili/modules/goods/entity/dto/GoodsOperationDTO.java
  26. 29 0
      framework/src/main/java/cn/lili/modules/goods/entity/dto/ImportDto.java
  27. 2 0
      framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java
  28. 1 1
      framework/src/main/java/cn/lili/modules/order/order/entity/enums/OrderOperateEnum.java
  29. 2 0
      framework/src/main/java/cn/lili/modules/payment/kit/CashierSupport.java
  30. 15 1
      framework/src/main/java/cn/lili/modules/payment/kit/Payment.java
  31. 13 1
      framework/src/main/java/cn/lili/modules/payment/kit/enums/PaymentClientEnum.java
  32. 1 0
      framework/src/main/java/cn/lili/modules/payment/kit/enums/PaymentMethodEnum.java
  33. 119 49
      framework/src/main/java/cn/lili/modules/payment/kit/plugin/alipay/AliPayPlugin.java
  34. 253 132
      framework/src/main/java/cn/lili/modules/payment/kit/plugin/wechat/WechatPlugin.java
  35. 129 0
      framework/src/main/java/cn/lili/modules/payment/kit/plugin/yeepay/YeepayPlugin.java
  36. 30 0
      framework/src/main/java/cn/lili/modules/payment/kit/plugin/yeepay/common/YeePayConst.java
  37. 38 0
      framework/src/main/java/cn/lili/modules/payment/kit/plugin/yeepay/entity/ConfigAppDto.java
  38. 71 0
      framework/src/main/java/cn/lili/modules/payment/kit/plugin/yeepay/entity/InitOrderDto.java
  39. 11 0
      framework/src/main/java/cn/lili/modules/payment/kit/plugin/yeepay/entity/KeyAndValue.java
  40. 44 0
      framework/src/main/java/cn/lili/modules/payment/kit/plugin/yeepay/entity/PayGateWayDto.java
  41. 107 0
      framework/src/main/java/cn/lili/modules/payment/kit/plugin/yeepay/entity/TransferDto.java
  42. 46 0
      framework/src/main/java/cn/lili/modules/payment/kit/plugin/yeepay/service/Sm4GcmUtils.java
  43. 297 0
      framework/src/main/java/cn/lili/modules/payment/kit/plugin/yeepay/service/YeePayService.java
  44. 3 0
      framework/src/main/java/cn/lili/modules/search/entity/dto/EsGoodsSearchDTO.java
  45. 4 0
      framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java
  46. 6 19
      framework/src/main/resources/banner.txt
  47. 3 0
      framework/src/main/resources/config/4421256739.cer
  48. BIN
      framework/src/main/resources/config/4421256739.pfx
  49. 86 0
      framework/src/main/resources/config/yop_sdk_config_default.json
  50. BIN
      framework/src/main/resources/demo.jpeg
  51. 34 0
      framework/src/main/resources/payConfig.properties
  52. 7 7
      manager-api/src/main/resources/application.yml
  53. 6 19
      manager-api/src/main/resources/banner.txt
  54. 1 1
      manager-api/src/main/resources/manager.xml
  55. 94 4
      seller-api/src/main/java/cn/lili/controller/goods/GoodsStoreController.java
  56. 6 0
      seller-api/src/main/resources/banner.txt
  57. 1 1
      seller-api/src/main/resources/logback.xml

+ 3 - 3
admin/src/main/resources/application.properties

@@ -9,10 +9,10 @@ spring.security.user.name=admin
 spring.security.user.password=admin
 spring.mail.host=smtp.qq.com
 # to和from都要配置,否则发送邮件时会报错
-spring.boot.admin.notify.mail.to=1814994716@qq.com
-spring.boot.admin.notify.mail.from=1814994716@qq.com
+spring.boot.admin.notify.mail.to=1197890431@qq.com
+spring.boot.admin.notify.mail.from=1197890431@qq.com
 # 邮件的用户名和密码
-spring.mail.username=1814994716@qq.com
+spring.mail.username=1197890431@qq.com
 spring.mail.password=abcdefg123456!@#$%^
 # 日志文件路径
 logging.file.path=lili-logs/admin

+ 6 - 0
admin/src/main/resources/banner.txt

@@ -0,0 +1,6 @@
+   ___   __   __   ____   _  _    _  __       _  
+  / __|  \ \ / /  |_  /  | || |  | |/ /    _ | | 
+ | (__    \ V /    / /   | __ |  | ' <    | || | 
+  \___|   _|_|_   /___|  |_||_|  |_|\_\   _\__/  
+_|"""""|_| """ |_|"""""|_|"""""|_|"""""|_|"""""| 
+"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-' 

+ 3 - 0
buyer-api/src/main/java/cn/lili/controller/passport/MemberBuyerController.java

@@ -4,6 +4,7 @@ import cn.lili.common.enums.ResultCode;
 import cn.lili.common.exception.ServiceException;
 import cn.lili.common.sms.SmsUtil;
 import cn.lili.common.enums.ResultUtil;
+import cn.lili.common.sms.enums.SmsType;
 import cn.lili.common.verification.enums.VerificationEnums;
 import cn.lili.common.verification.service.VerificationService;
 import cn.lili.common.vo.ResultMessage;
@@ -15,6 +16,7 @@ import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.constraints.NotNull;
@@ -33,6 +35,7 @@ public class MemberBuyerController {
     @Autowired
     private MemberService memberService;
     @Autowired
+    @Qualifier(SmsType.SMS_HWEI)
     private SmsUtil smsUtil;
     @Autowired
     private VerificationService verificationService;

+ 1 - 1
buyer-api/src/main/resources/application.yml

@@ -261,7 +261,7 @@ lili:
     #        username: elastic
     #        password: LiLiShopES
     logstash:
-      server: 192.168.0.116:4560
+      server: 8.135.47.166:4560
     rocketmq:
       promotion-topic: lili_promotion_topic
       promotion-group: lili_promotion_group

+ 6 - 19
buyer-api/src/main/resources/banner.txt

@@ -1,19 +1,6 @@
- ___       ___  ___       ___                 ________ ________  _______   ________  _____ ______   ___       __   ________  ________  ___  __       
-|\  \     |\  \|\  \     |\  \               |\  _____\\   __  \|\  ___ \ |\   __  \|\   _ \  _   \|\  \     |\  \|\   __  \|\   __  \|\  \|\  \     
-\ \  \    \ \  \ \  \    \ \  \  ____________\ \  \__/\ \  \|\  \ \   __/|\ \  \|\  \ \  \\\__\ \  \ \  \    \ \  \ \  \|\  \ \  \|\  \ \  \/  /|_   
- \ \  \    \ \  \ \  \    \ \  \|\____________\ \   __\\ \   _  _\ \  \_|/_\ \   __  \ \  \\|__| \  \ \  \  __\ \  \ \  \\\  \ \   _  _\ \   ___  \  
-  \ \  \____\ \  \ \  \____\ \  \|____________|\ \  \_| \ \  \\  \\ \  \_|\ \ \  \ \  \ \  \    \ \  \ \  \|\__\_\  \ \  \\\  \ \  \\  \\ \  \\ \  \ 
-   \ \_______\ \__\ \_______\ \__\              \ \__\   \ \__\\ _\\ \_______\ \__\ \__\ \__\    \ \__\ \____________\ \_______\ \__\\ _\\ \__\\ \__\
-    \|_______|\|__|\|_______|\|__|               \|__|    \|__|\|__|\|_______|\|__|\|__|\|__|     \|__|\|____________|\|_______|\|__|\|__|\|__| \|__|
-
-
-
-                                                 ___       ___  ___       ___                 ________  ___  ___  ________  ________
-                                                |\  \     |\  \|\  \     |\  \               |\   ____\|\  \|\  \|\   __  \|\   __  \
-                                                \ \  \    \ \  \ \  \    \ \  \  ____________\ \  \___|\ \  \\\  \ \  \|\  \ \  \|\  \
-                                                 \ \  \    \ \  \ \  \    \ \  \|\____________\ \_____  \ \   __  \ \  \\\  \ \   ____\
-                                                  \ \  \____\ \  \ \  \____\ \  \|____________|\|____|\  \ \  \ \  \ \  \\\  \ \  \___|
-                                                   \ \_______\ \__\ \_______\ \__\               ____\_\  \ \__\ \__\ \_______\ \__\
-                                                    \|_______|\|__|\|_______|\|__|              |\_________\|__|\|__|\|_______|\|__|
-                                                                                                \|_________|
-
+   ___   __   __   ____   _  _    _  __       _  
+  / __|  \ \ / /  |_  /  | || |  | |/ /    _ | | 
+ | (__    \ V /    / /   | __ |  | ' <    | || | 
+  \___|   _|_|_   /___|  |_||_|  |_|\_\   _\__/  
+_|"""""|_| """ |_|"""""|_|"""""|_|"""""|_|"""""| 
+"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-' 

+ 1 - 1
buyer-api/src/main/resources/logback.xml

@@ -21,7 +21,7 @@
 
     <!--输出到elk的LOGSTASH-->
     <appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
-        <destination>127.0.0.1:4560</destination>
+        <destination>8.135.47.166:4560</destination>
         <encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">
             <providers>
                 <timestamp>

+ 3 - 0
common-api/src/main/java/cn/lili/controller/common/SmsController.java

@@ -5,6 +5,7 @@ import cn.lili.common.enums.ResultCode;
 import cn.lili.common.exception.ServiceException;
 import cn.lili.common.sms.SmsUtil;
 import cn.lili.common.enums.ResultUtil;
+import cn.lili.common.sms.enums.SmsType;
 import cn.lili.common.verification.enums.VerificationEnums;
 import cn.lili.common.verification.service.VerificationService;
 import cn.lili.common.vo.ResultMessage;
@@ -13,6 +14,7 @@ import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.web.bind.annotation.*;
 
 /**
@@ -27,6 +29,7 @@ import org.springframework.web.bind.annotation.*;
 public class SmsController {
 
     @Autowired
+    @Qualifier(SmsType.SMS_HWEI)
     private SmsUtil smsUtil;
     @Autowired
     private VerificationService verificationService;

+ 1 - 4
common-api/src/main/java/cn/lili/controller/common/UploadController.java

@@ -25,10 +25,7 @@ import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestHeader;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.io.InputStream;

+ 6 - 0
common-api/src/main/resources/banner.txt

@@ -0,0 +1,6 @@
+   ___   __   __   ____   _  _    _  __       _  
+  / __|  \ \ / /  |_  /  | || |  | |/ /    _ | | 
+ | (__    \ V /    / /   | __ |  | ' <    | || | 
+  \___|   _|_|_   /___|  |_||_|  |_|\_\   _\__/  
+_|"""""|_| """ |_|"""""|_|"""""|_|"""""|_|"""""| 
+"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-' 

+ 1 - 1
common-api/src/main/resources/logback.xml

@@ -22,7 +22,7 @@
     <!--输出到elk的LOGSTASH-->
     <appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
         <!-- 配置elk日志收集 配饰的是 LOGSTASH 的地址-->
-        <destination>127.0.0.1:4560</destination>
+        <destination>8.135.47.166:4560</destination>
         <encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">
             <providers>
                 <timestamp>

+ 317 - 0
config/application-wx.yml

@@ -0,0 +1,317 @@
+server:
+  servlet:
+    context-path: /
+
+  tomcat:
+    uri-encoding: UTF-8
+    threads:
+      min-spare: 50
+      max: 1000
+
+# 与Spring Boot 2一样,默认情况下,大多数端点都不通过http公开,我们公开了所有端点。对于生产,您应该仔细选择要公开的端点。
+management:
+  #  health:
+  #    elasticsearch:
+  #      enabled: false
+  #    datasource:
+  #      enabled: false
+  endpoints:
+    web:
+      exposure:
+        include: '*'
+spring:
+  # 要在其中注册的Spring Boot Admin Server的URL。
+  boot:
+    admin:
+      client:
+        url: http://8.129.99.119/minitor-admin
+  # mongodb
+  data:
+    mongodb:
+      host: 8.135.47.166
+      port: 27017
+      database: wx-shop
+      username: root
+      password: guoxin-shop
+      authentication-database: admin
+  #      replica-set-name: mongoreplset
+  cache:
+    type: redis
+  #amqp
+  #  rabbitmq:
+  #    host: 192.168.0.116
+  jpa:
+    # 自动生成表结构
+    generate-ddl: true
+    open-in-view: false
+  # Redis
+  redis:
+    host: 8.135.47.166
+    port: 6379
+    password: guoxin-shop
+    database: 1
+    lettuce:
+      pool:
+        # 连接池最大连接数(使用负值表示没有限制) 默认 8
+        max-active: 200
+        # 连接池最大阻塞等待时间(使用负值表示没有限制) 默认 -1
+        max-wait: 20
+        # 连接池中的最大空闲连接 默认 8
+        max-idle: 10
+        # 连接池中的最小空闲连接 默认 8
+        min-idle: 8
+  # 文件大小上传配置
+  servlet:
+    multipart:
+      max-file-size: 20MB
+      max-request-size: 20MB
+  jackson:
+    time-zone: GMT+8
+    serialization:
+      #关闭jackson 对json做解析
+      fail-on-empty-beans: false
+
+  shardingsphere:
+    datasource:
+      #  数据库名称,可自定义,可以为多个,以逗号隔开,每个在这里定义的库,都要在下面定义连接属性
+      names: default-datasource
+      default-datasource:
+        type: com.alibaba.druid.pool.DruidDataSource
+        driverClassName: com.mysql.cj.jdbc.Driver
+        url: jdbc:mysql://8.135.47.166:3306/nanyue-wx?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+        username: root
+        password: guoxin-shop
+        maxActive: 20
+        initialSize: 5
+        maxWait: 60000
+        minIdle: 5
+        timeBetweenEvictionRunsMillis: 60000
+        minEvictableIdleTimeMillis: 300000
+        validationQuery: SELECT 1 FROM DUAL
+        testWhileIdle: true
+        testOnBorrow: false
+        testOnReturn: false
+        #是否缓存preparedStatement,也就是PSCache。在mysql下建议关闭。 PSCache对支持游标的数据库性能提升巨大,比如说oracle。
+        poolPreparedStatements: false
+        #要启用PSCache,-1为关闭 必须配置大于0,当大于0时,poolPreparedStatements自动触发修改为true  可以把这个数值配置大一些,比如说100
+        maxOpenPreparedStatements: -1
+        #配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+        filters: stat,wall,log4j2
+        #通过connectProperties属性来打开mergeSql功能;慢SQL记录
+        connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
+        #合并多个DruidDataSource的监控数据
+        useGlobalDataSourceStat: true
+        loginUsername: druid
+        loginPassword: druid
+    #    sharding:
+    #      default-data-source-name: default-datasource
+    #      #需要拆分的表,可以设置多个  在 li_order 级别即可
+    #      tables:
+    #        #需要进行分表的逻辑表名
+    #        li_order:
+    #          #实际的表结点,下面代表的是li_order_为开头的所有表,如果能确定表的范围例如按月份分表,这里的写法是data2020.li_order_$->{2020..2021}_$->{01..12}  表示例如 li_order_2020_01 li_order_2020_03 li_order_2021_01
+    #          actual-data-nodes: data2020.li_order_$->{2019..2021}_$->{01..12}
+    #          table-strategy:
+    #            # 分表策略,根据创建日期
+    #            standard:
+    #              sharding-column: create_time
+    #              #分表策略
+    #              precise-algorithm-class-name: cn.lili.config.sharding.CreateTimeShardingTableAlgorithm
+    #              #范围查询实现
+    #              range-algorithm-class-name: cn.lili.config.sharding.CreateTimeShardingTableAlgorithm
+    props:
+      #是否打印逻辑SQL语句和实际SQL语句,建议调试时打印,在生产环境关闭
+      sql:
+        show: true
+
+# 忽略鉴权url
+ignored:
+  urls:
+    - /editor-app/**
+    - /actuator**
+    - /actuator/**
+    - /MP_verify_qSyvBPhDsPdxvOhC.txt
+    - /weixin/**
+    - /source/**
+    - /buyer/mini-program/**
+    - /buyer/cashier/**
+    - /buyer/pageData/**
+    - /buyer/article/**
+    - /buyer/goods/**
+    - /buyer/category/**
+    - /buyer/store/**
+    - /buyer/connect/**
+    - /buyer/members/**
+    - /buyer/promotion/pintuan/**
+    - /buyer/promotion/seckill/**
+    - /buyer/promotion/pointsGoods/**
+    - /buyer/promotion/coupon
+    - /buyer/memberEvaluation/**/goodsEvaluation
+    - /buyer/memberEvaluation/**/evaluationNumber
+    - /buyer/appVersion/**
+    - /buyer/broadcast/studio/**
+    - /store/login/**
+    - /manager/user/login
+    - /manager/user/refresh/**
+    - /druid/**
+    - /swagger-ui.html
+    - /doc.html
+    - /swagger-resources/**
+    - /swagger/**
+    - /**/**.js
+    - /**/**.png
+    - /**/**.css
+    - /webjars/**
+    - /v2/api-docs
+    - /configuration/ui
+    - /boot-admin
+    - /manager/promotion/seckill/init
+  statics:
+    - /**/*.js
+    - /**/*.css
+    - /**/*.png
+    - /**/*.ico
+
+# Swagger界面内容配置
+swagger:
+  title:  API接口文档
+  description:  Api Documentation
+  version: 1.0.0
+  termsOfServiceUrl: http://nanyue6688.com
+  contact:
+    name: 南粤商城
+    url: http://nanyue6688.com
+    email: 1197890431@qq.com
+
+# Mybatis-plus
+mybatis-plus:
+  mapper-locations: classpath*:mapper/*.xml
+  configuration:
+    #缓存开启
+    cache-enabled: true
+    #日志
+#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+
+# 日志
+logging:
+  # 输出级别
+  level:
+    cn.lili: info
+#    org.hibernate: debug
+#    org.springframework: debug
+#    org.springframework.data.mongodb.core: debug
+  file:
+    # 指定路径
+    path: lili-logs
+    # 最大保存天数
+    max-history: 7
+    # 每个文件最大大小
+    max-size: 5MB
+#加密参数
+jasypt:
+  encryptor:
+    password: lili
+
+lili:
+  #短信模版配置
+  sms:
+    #登录
+    LOGIN: 02901fe3c0fd45efaf67a1d0f1755b62
+    #注册
+    REGISTER: 02901fe3c0fd45efaf67a1d0f1755b62
+    #找回密码
+    FIND_USER: 02901fe3c0fd45efaf67a1d0f1755b62
+    #设置密码
+    UPDATE_PASSWORD: 02901fe3c0fd45efaf67a1d0f1755b62
+    #支付密码
+    WALLET_PASSWORD: 02901fe3c0fd45efaf67a1d0f1755b62
+  system:
+    isDemoSite: false
+    isTestModel: false
+  statistics:
+    # 在线人数统计 X 小时。这里设置48,即统计过去48小时每小时在线人数
+    onlineMember: 48
+    # 当前在线人数刷新时间间隔,单位秒,设置为600,则每10分钟刷新一次
+    currentOnlineUpdate: 600
+  #qq lbs 申请
+  lbs:
+    key: 4BYBZ-7MT6S-PUAOA-6BNWL-FJUD7-UUFXT
+    sk: zhNKVrJK6UPOhqIjn8AQvG37b9sz6
+  #域名
+  domain:
+    pc: http://8.129.99.119:8888
+    wap: http://8.129.99.119:8888
+    seller: http://192.168.1.48:10002
+    admin: http://8.129.99.119:8888
+  #api地址
+  api:
+    buyer: http://8.129.99.119/buyer-api
+    base: http://8.129.99.119/common-api
+    manager: http://8.129.99.119/manager-api
+    seller: http://8.129.99.119/seller-api
+
+  # jwt 细节设定
+  jwt-setting:
+    # token过期时间(分钟)
+    tokenExpireTime: 30
+
+  # 使用Spring @Cacheable注解失效时间
+  cache:
+    # 过期时间 单位秒 永久不过期设为-1
+    timeout: 1500
+  #多线程配置
+  thread:
+    corePoolSize: 5
+    maxPoolSize: 50
+    queueCapacity: 50
+  data:
+    elasticsearch:
+      cluster-name: elasticsearch
+      cluster-nodes: 8.135.47.166:9200
+      index:
+        number-of-replicas: 0
+        number-of-shards: 3
+      index-prefix: wx-shop
+      schema: http
+    #      account:
+    #        username: elastic
+    #        password: LiLiShopES
+
+    logstash:
+      server: 8.135.47.166:4560
+    rocketmq:
+      promotion-topic: wx_promotion_topic
+      promotion-group: wx_promotion_group
+      msg-ext-topic: wx_msg_topic
+      msg-ext-group: wx_msg_group
+      goods-topic: wx_goods_topic
+      goods-group: wx_goods_group
+      order-topic: wx_order_topic
+      order-group: wx_order_group
+      member-topic: wx_member_topic
+      member-group: wx_member_group
+      other-topic: wx_other_topic
+      other-group: wx_other_group
+      notice-topic: wx_notice_topic
+      notice-group: wx_notice_group
+      notice-send-topic: wx_send_notice_topic
+      notice-send-group: wx_send_notice_group
+rocketmq:
+  name-server: 8.135.47.166:9876
+  namesrvAddr: 8.135.47.166:9876
+  isVIPChannel: false
+  producer:
+    group: wx_group
+    send-message-timeout: 30000
+
+xxl:
+  job:
+    admin:
+      addresses: http://8.135.47.166:9001/xxl-job-admin
+    executor:
+      appname: xxl-job-executor-lilishop
+      address:
+      ip:
+      port: 8891
+      logpath: ./xxl-job/executor
+      logretentiondays: 7

+ 33 - 32
config/application.yml

@@ -24,15 +24,15 @@ spring:
   boot:
     admin:
       client:
-        url: http://192.168.1.48:8000
+        url: http://8.129.99.119/minitor-admin
   # mongodb
   data:
     mongodb:
-      host: 192.168.1.72
+      host: 8.135.47.166
       port: 27017
       database: lilishop
       username: root
-      password: lilishop
+      password: guoxin-shop
       authentication-database: admin
   #      replica-set-name: mongoreplset
   cache:
@@ -46,9 +46,9 @@ spring:
     open-in-view: false
   # Redis
   redis:
-    host: 192.168.1.48
+    host: 8.135.47.166
     port: 6379
-    password:
+    password: guoxin-shop
     lettuce:
       pool:
         # 连接池最大连接数(使用负值表示没有限制) 默认 8
@@ -77,9 +77,9 @@ spring:
       default-datasource:
         type: com.alibaba.druid.pool.DruidDataSource
         driverClassName: com.mysql.cj.jdbc.Driver
-        url: jdbc:mysql://192.168.1.48:3306/lilishop?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+        url: jdbc:mysql://8.135.47.166:3306/nanyue?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
         username: root
-        password: 123456
+        password: guoxin-shop
         maxActive: 20
         initialSize: 5
         maxWait: 60000
@@ -165,6 +165,7 @@ ignored:
     - /configuration/ui
     - /boot-admin
     - /manager/promotion/seckill/init
+    - /store//goods/fetchTemplate
   statics:
     - /**/*.js
     - /**/*.css
@@ -173,14 +174,14 @@ ignored:
 
 # Swagger界面内容配置
 swagger:
-  title: lili API接口文档
-  description: lili Api Documentation
+  title:  API接口文档
+  description:  Api Documentation
   version: 1.0.0
-  termsOfServiceUrl: https://pickmall.cn
+  termsOfServiceUrl: http://nanyue6688.com
   contact:
-    name: lili
-    url: https://pickmall.cn
-    email: admin@pickmall.com
+    name: 南粤商城
+    url: http://nanyue6688.com
+    email: 1197890431@qq.com
 
 # Mybatis-plus
 mybatis-plus:
@@ -215,18 +216,18 @@ lili:
   #短信模版配置
   sms:
     #登录
-    LOGIN: SMS_205755300
+    LOGIN: 02901fe3c0fd45efaf67a1d0f1755b62
     #注册
-    REGISTER: SMS_205755298
+    REGISTER: 02901fe3c0fd45efaf67a1d0f1755b62
     #找回密码
-    FIND_USER: SMS_205755301
+    FIND_USER: 02901fe3c0fd45efaf67a1d0f1755b62
     #设置密码
-    UPDATE_PASSWORD: SMS_205755297
+    UPDATE_PASSWORD: 02901fe3c0fd45efaf67a1d0f1755b62
     #支付密码
-    WALLET_PASSWORD: SMS_205755301
+    WALLET_PASSWORD: 02901fe3c0fd45efaf67a1d0f1755b62
   system:
     isDemoSite: false
-    isTestModel: true
+    isTestModel: false
   statistics:
     # 在线人数统计 X 小时。这里设置48,即统计过去48小时每小时在线人数
     onlineMember: 48
@@ -238,16 +239,16 @@ lili:
     sk: zhNKVrJK6UPOhqIjn8AQvG37b9sz6
   #域名
   domain:
-    pc: http://192.168.1.48:8888
-    wap: http://192.168.1.48:8888
-    seller: http://192.168.1.48:8888
-    admin: http://192.168.1.48:8888
+    pc: http://8.129.99.119:8888
+    wap: http://8.129.99.119:8888
+    seller: http://192.168.1.48:10002
+    admin: http://8.129.99.119:8888
   #api地址
   api:
-    buyer: https://z171l91606.51mypc.cn
-    base: http://192.168.1.48:8888
-    manager: http://192.168.1.48:8888
-    seller: http://192.168.1.48:8888
+    buyer: http://8.129.99.119/buyer-api
+    base: http://8.129.99.119/common-api
+    manager: http://8.129.99.119/manager-api
+    seller: http://8.129.99.119/seller-api
 
   # jwt 细节设定
   jwt-setting:
@@ -266,7 +267,7 @@ lili:
   data:
     elasticsearch:
       cluster-name: elasticsearch
-      cluster-nodes: 192.168.1.72:9200
+      cluster-nodes: 8.135.47.166:9200
       index:
         number-of-replicas: 0
         number-of-shards: 3
@@ -277,7 +278,7 @@ lili:
     #        password: LiLiShopES
 
     logstash:
-      server: 192.168.1.72:4560
+      server: 8.135.47.166:4560
     rocketmq:
       promotion-topic: lili_promotion_topic
       promotion-group: lili_promotion_group
@@ -296,8 +297,8 @@ lili:
       notice-send-topic: lili_send_notice_topic
       notice-send-group: lili_send_notice_group
 rocketmq:
-  name-server: 192.168.1.72:9876
-  namesrvAddr: 192.168.1.72:9876
+  name-server: 8.135.47.166:9876
+  namesrvAddr: 8.135.47.166:9876
   isVIPChannel: false
   producer:
     group: lili_group
@@ -306,7 +307,7 @@ rocketmq:
 xxl:
   job:
     admin:
-      addresses: http://192.168.1.72:9001/xxl-job-admin
+      addresses: http://8.135.47.166:9001/xxl-job-admin
     executor:
       appname: xxl-job-executor-lilishop
       address:

+ 3 - 0
consumer/src/main/java/cn/lili/listener/NoticeSendMessageListener.java

@@ -4,6 +4,7 @@ import cn.hutool.json.JSONUtil;
 import cn.lili.common.enums.SwitchEnum;
 import cn.lili.common.rocketmq.tags.OtherTagsEnum;
 import cn.lili.common.sms.SmsUtil;
+import cn.lili.common.sms.enums.SmsType;
 import cn.lili.common.vo.PageVO;
 import cn.lili.modules.member.entity.dos.Member;
 import cn.lili.modules.member.entity.vo.MemberSearchVO;
@@ -26,6 +27,7 @@ import org.apache.rocketmq.common.message.MessageExt;
 import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
 import org.apache.rocketmq.spring.core.RocketMQListener;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
@@ -46,6 +48,7 @@ public class NoticeSendMessageListener implements RocketMQListener<MessageExt> {
     private MemberMapper memberMapper;
     //短信
     @Autowired
+    @Qualifier(SmsType.SMS_HWEI)
     private SmsUtil smsUtil;
     //店铺消息
     @Autowired

+ 6 - 0
consumer/src/main/resources/banner.txt

@@ -0,0 +1,6 @@
+   ___   __   __   ____   _  _    _  __       _  
+  / __|  \ \ / /  |_  /  | || |  | |/ /    _ | | 
+ | (__    \ V /    / /   | __ |  | ' <    | || | 
+  \___|   _|_|_   /___|  |_||_|  |_|\_\   _\__/  
+_|"""""|_| """ |_|"""""|_|"""""|_|"""""|_|"""""| 
+"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-' 

+ 1 - 1
consumer/src/main/resources/logback.xml

@@ -22,7 +22,7 @@
     <!--输出到elk的LOGSTASH-->
     <appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
         <!-- 配置elk日志收集 配饰的是 LOGSTASH 的地址-->
-        <destination>192.168.0.116:4560</destination>
+        <destination>8.135.47.166:4560</destination>
         <encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">
             <providers>
                 <timestamp>

+ 11 - 0
framework/pom.xml

@@ -404,6 +404,17 @@
             <version>[3.21.4,)</version>
         </dependency>
 
+        <!--  易宝支付SDK   -->
+        <dependency>
+            <groupId>com.yeepay.yop.sdk</groupId>
+            <artifactId>yop-java-sdk</artifactId>
+            <version>4.1.4-jdk7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcpkix-jdk15on</artifactId>
+            <version>1.60</version>
+        </dependency>
     </dependencies>
 
 

+ 4 - 1
framework/src/main/java/cn/lili/common/elasticsearch/BaseElasticsearchService.java

@@ -245,7 +245,7 @@ public abstract class BaseElasticsearchService {
                         "        \"type\": \"float\"\n" +
                         "      },\n" +
                         "      \"salesModel\": {\n" +
-                        "        \"type\": \"text\",\n" +
+                        "        \"type\": \"keyword\",\n" +
                         "        \"fields\": {\n" +
                         "          \"keyword\": {\n" +
                         "            \"type\": \"keyword\",\n" +
@@ -253,6 +253,9 @@ public abstract class BaseElasticsearchService {
                         "          }\n" +
                         "        }\n" +
                         "      },\n" +
+                        "      \"recommend\": {\n" +
+                        "        \"type\": \"boolean\"\n" +
+                        "      },\n" +
                         "      \"selfOperated\": {\n" +
                         "        \"type\": \"boolean\"\n" +
                         "      },\n" +

+ 3 - 0
framework/src/main/java/cn/lili/common/enums/ResultCode.java

@@ -71,6 +71,8 @@ public enum ResultCode {
     PHYSICAL_GOODS_NEED_TEMP(11014,"实物商品需选择配送模板"),
     VIRTUAL_GOODS_NOT_NEED_TEMP(11015,"实物商品需选择配送模板"),
     GOODS_TYPE_ERROR(11016, "需选择商品类型"),
+    GOODS_IMPORT_ERROR(11017, "导入商品异常"),
+    GOODS_EXPORT_ERROR(11018, "导出文件异常"),
 
     /**
      * 参数
@@ -390,6 +392,7 @@ public enum ResultCode {
      * 验证码
      */
     VERIFICATION_SEND_SUCCESS(80201, "短信验证码,发送成功"),
+    VERIFICATION_SEND_FAIL(80204, "短信验证码,发送失败"),
     VERIFICATION_ERROR(80202, "验证失败"),
     VERIFICATION_SMS_ERROR(80203, "短信验证码错误,请重新校验"),
     VERIFICATION_SMS_EXPIRED_ERROR(80205, "验证码已失效,请重新校验"),

+ 110 - 13
framework/src/main/java/cn/lili/common/sms/impl/HweiSmsUtil.java

@@ -1,6 +1,9 @@
 package cn.lili.common.sms.impl;
 
 import cn.hutool.core.util.StrUtil;
+import cn.hutool.http.Header;
+import cn.hutool.http.HttpRequest;
+import cn.hutool.json.JSONUtil;
 import cn.lili.common.cache.Cache;
 import cn.lili.common.enums.ResultCode;
 import cn.lili.common.exception.ServiceException;
@@ -17,15 +20,24 @@ import cn.lili.modules.system.entity.dos.Setting;
 import cn.lili.modules.system.entity.dto.SmsSetting;
 import cn.lili.modules.system.entity.enums.SettingEnum;
 import cn.lili.modules.system.service.SettingService;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.aliyun.dysmsapi20170525.models.SendBatchSmsRequest;
 import com.google.gson.Gson;
 import com.xkcoding.http.util.StringUtil;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.codec.binary.Hex;
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.utils.URLEncodedUtils;
+import org.apache.http.message.BasicNameValuePair;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
+import org.springframework.util.Assert;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.nio.charset.Charset;
+import java.text.SimpleDateFormat;
+import java.util.*;
 
 import static cn.lili.common.sms.impl.SmsUtilAliImplService.cacheKey;
 
@@ -40,6 +52,13 @@ import static cn.lili.common.sms.impl.SmsUtilAliImplService.cacheKey;
 @Slf4j
 public class HweiSmsUtil implements SmsUtil {
 
+    //无需修改,用于格式化鉴权头域,给"X-WSSE"参数赋值
+    private static final String WSSE_HEADER_FORMAT = "UsernameToken Username=\"%s\",PasswordDigest=\"%s\",Nonce=\"%s\",Created=\"%s\"";
+    //无需修改,用于格式化鉴权头域,给"Authorization"参数赋值
+    private static final String AUTH_HEADER_VALUE = "WSSE realm=\"SDP\",profile=\"UsernameToken\",type=\"Appkey\"";
+    //APP接入地址+接口访问URI
+    private static final String sendMessageUrl = "https://rtcsms.cn-north-1.myhuaweicloud.com:10743/sms/batchSendSms/v1";
+    private SmsSetting smsSetting;
     @Autowired
     private Cache cache;
     @Autowired
@@ -54,12 +73,8 @@ public class HweiSmsUtil implements SmsUtil {
 
     @Override
     public void sendSmsCode(String mobile, VerificationEnums verificationEnums, String uuid) {
-        //获取短信配置
-        Setting setting = settingService.get(SettingEnum.SMS_SETTING.name());
-        if (StrUtil.isBlank(setting.getSettingValue())) {
-            throw new ServiceException(ResultCode.ALI_SMS_SETTING_ERROR);
-        }
-        SmsSetting smsSetting = new Gson().fromJson(setting.getSettingValue(), SmsSetting.class);
+
+        SmsSetting smsSetting = getSmsSetting();
 
         //验证码
         String code = CommonUtil.getRandomNum();
@@ -67,8 +82,8 @@ public class HweiSmsUtil implements SmsUtil {
         //准备发送短信参数
         Map<String, String> params = new HashMap<>();
         //验证码内容
-        params.put("code", code);
-
+        params.put("1", code);
+        params.put("2","5");
         //模版 默认为登录验证
         String templateCode;
 
@@ -139,19 +154,101 @@ public class HweiSmsUtil implements SmsUtil {
      *  发送短信具体实现
      * @param signName 短信签名
      * @param mobile 手机号码
-     * @param param 自定义参数
+     * @param param 自定义参数(key值为排序权重,值越大,参数越往后)
      * @param templateCode 短信模板ID
      * */
     @Override
     public void sendSmsCode(String signName, String mobile, Map<String, String> param, String templateCode) {
-
+        SmsSetting smsSetting = getSmsSetting();
+        String headerWss = buildWsseHeader(smsSetting.getAccessKeyId(),smsSetting.getAccessSecret());
+        String form = buildRequestBody(param,mobile,templateCode);
+        String result = HttpRequest.post(sendMessageUrl)
+                .header(Header.CONTENT_TYPE, "application/x-www-form-urlencoded")
+                .header(Header.AUTHORIZATION, AUTH_HEADER_VALUE)
+                .header("X-WSSE",headerWss)
+                .body(form)//表单内容
+                .execute().body();
+        JSONObject jsonObject = JSON.parseObject(result);
+        if(!"000000".equals(jsonObject.getString("code"))){
+            throw new ServiceException(ResultCode.VERIFICATION_SEND_FAIL);
+        }
     }
 
 
     @Override
     public void sendBatchSms(String signName, List<String> mobile, String templateCode) {
+        StringBuilder stringBuilder = new StringBuilder(16);
+        mobile.stream().forEach(item -> {stringBuilder.append(item+",");});
+        sendSmsCode(signName,stringBuilder.substring(0,stringBuilder.length()-1),null,templateCode);
+    }
 
+    /**
+     * 构造X-WSSE参数值
+     * @param appKey
+     * @param appSecret
+     * @return
+     */
+    static String buildWsseHeader(String appKey, String appSecret) {
+        if (null == appKey || null == appSecret || appKey.isEmpty() || appSecret.isEmpty()) {
+            System.out.println("buildWsseHeader(): appKey or appSecret is null.");
+            return null;
+        }
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
+        String time = sdf.format(new Date()); //Created
+        String nonce = UUID.randomUUID().toString().replace("-", ""); //Nonce
+
+        byte[] passwordDigest = DigestUtils.sha256(nonce + time + appSecret);
+        String hexDigest = Hex.encodeHexString(passwordDigest);
+
+        String passwordDigestBase64Str = Base64.getEncoder().encodeToString(hexDigest.getBytes()); //PasswordDigest
+
+        return String.format(WSSE_HEADER_FORMAT, appKey, passwordDigestBase64Str, nonce, time);
     }
 
+    /**
+     * 构造requestBody
+     * @param params 短信模板参数
+     * @param mobile  接收方手机号码
+     * @param templateCode 短信模板ID
+     * @return
+     */
+    private  String buildRequestBody(Map<String, String> params, String mobile, String templateCode) {
+        SmsSetting smsSetting = getSmsSetting();
+        //模板参数进行权重排序后重组成数组
+        String[] paramArray = params==null? null: params.keySet().stream().sorted().map(params::get).toArray(String[]::new);
+        List<NameValuePair> form = new ArrayList<NameValuePair>(16);
+        form.add(new BasicNameValuePair("from",smsSetting.getRegionId()));
+        form.add(new BasicNameValuePair("to",mobile));
+        form.add(new BasicNameValuePair("templateId",templateCode));
+        if(paramArray!=null){
+            form.add(new BasicNameValuePair("templateParas",paramArray==null? "":JSON.toJSONString(paramArray)));
+        }
+        form.add(new BasicNameValuePair("signature",smsSetting.getSignName()));
+        return URLEncodedUtils.format(form, Charset.forName("UTF-8")) ;
+    }
+
+
+    /**
+     *  获取短信配置
+     * */
+    private SmsSetting getSmsSetting(){
+        if(smsSetting==null){
+            Setting setting = settingService.get(SettingEnum.SMS_SETTING.name());
+            if (StrUtil.isBlank(setting.getSettingValue())) {
+                throw new ServiceException(ResultCode.ALI_SMS_SETTING_ERROR);
+            }
+            smsSetting = new Gson().fromJson(setting.getSettingValue(), SmsSetting.class);
+        }
+        return  smsSetting;
+    }
+
+    public static void main(String[] args) {
+        String result = "{\"result\":[{\"originTo\":\"13126058204\",\"createTime\":\"2021-07-14T04:42:54Z\",\"from\":\"8820121814420\",\"smsMsgId\":\"263a6b5a-f9c4-4939-a584-9a82be9f410c_5326029527\",\"status\":\"000000\"}],\"code\":\"000000\",\"description\":\"Success\"}";
+        JSONObject jsonObject = JSON.parseObject(result);
+        if(!"000000".equals(jsonObject.getString("code"))){
+            throw new ServiceException(ResultCode.VERIFICATION_SEND_FAIL);
+        }
+        System.out.println(jsonObject.getString("code"));
+    }
 
 }

+ 31 - 0
framework/src/main/java/cn/lili/common/utils/excel/ExcelUtils.java

@@ -0,0 +1,31 @@
+package cn.lili.common.utils.excel;
+
+import org.apache.poi.xssf.usermodel.*;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * @author: lianghanqiang
+ * @description:   xlsx 文件工具类
+ * @since: 8/20/21 -- 4:09 PM
+ */
+public class ExcelUtils {
+
+    public static void read(InputStream inputStream,Integer sheetIndex,ReadHandle readHandle) throws IOException {
+        Integer rowIndex = 0;
+        XSSFWorkbook excel=new XSSFWorkbook(inputStream);
+        XSSFSheet sheet = excel.getSheetAt(sheetIndex);
+        List<XSSFShape> list = sheet.getDrawingPatriarch().getShapes();
+
+        readHandle.initImages(list);
+
+        for (Iterator rowIterator = sheet.iterator(); rowIterator.hasNext();)
+        {
+            XSSFRow row=(XSSFRow) rowIterator.next();
+            readHandle.handleRow(row,rowIndex++);
+        }
+    }
+}

+ 103 - 0
framework/src/main/java/cn/lili/common/utils/excel/ImportHandle.java

@@ -0,0 +1,103 @@
+package cn.lili.common.utils.excel;
+
+
+import cn.lili.modules.connect.util.UuidUtils;
+import cn.lili.modules.file.plugin.FileManagerPlugin;
+import cn.lili.modules.goods.entity.dto.GoodsOperationDTO;
+import cn.lili.modules.goods.service.GoodsService;
+import org.apache.poi.xssf.usermodel.*;
+
+import java.io.ByteArrayInputStream;
+import java.util.*;
+
+/**
+ * @author: lianghanqiang
+ * @description:
+ * @since: 8/20/21 -- 4:16 PM
+ */
+
+public class ImportHandle implements ReadHandle {
+
+    private String categoryPath;
+    private FileManagerPlugin fileManagerPlugin;
+    private GoodsService goodsService;
+    private Map<String,String> picMap;
+
+    public ImportHandle(String categoryPath,FileManagerPlugin fileManagerPlugin,GoodsService goodsService) {
+        this.categoryPath = categoryPath;
+        this.fileManagerPlugin = fileManagerPlugin;
+        this.goodsService = goodsService;
+    }
+
+    @Override
+    public void handleRow(XSSFRow row, Integer rowIndex) {
+        if(rowIndex>0){
+            String image = picMap.get("row_"+rowIndex);
+            String mobileIntro = row.getCell(1).toString();
+            double cost = Double.parseDouble(row.getCell(2).toString());
+            int quantity = Integer.parseInt(row.getCell(3).toString());
+            String salesModel = "零售型".equals(row.getCell(4).toString())?"RETAIL":"WHOLESALE";
+            double price = Double.parseDouble(row.getCell(5).toString());
+            String intro = row.getCell(6).toString();
+            double weight = Double.parseDouble(row.getCell(7).toString());
+            String sellingPoint = row.getCell(8).toString();
+            String goodsUnit = row.getCell(9).toString();
+            String sn = row.getCell(10).toString();
+            String goodsName = row.getCell(11).toString();
+
+
+
+            List<Map<String, Object>> skuList = new ArrayList<>(8);
+
+            skuList.add(new HashMap(){{
+                put("weight",weight);
+                put("sn",sn);
+                put("quantity",quantity);
+                put("cost",cost);
+                put("price",price);
+            }});
+            goodsService.addGoods(GoodsOperationDTO.builder()
+                    .skuList(skuList)
+                    .categoryPath(categoryPath)
+                    .goodsName(goodsName)
+                    .salesModel(salesModel)
+                    .weight(weight)
+                    .release(true)
+                    .recommend(true)
+                    .brandId("0")
+                    .goodsUnit(goodsUnit)
+                    .goodsType("PHYSICAL_GOODS")
+                    .intro(intro)
+                    .sellingPoint(sellingPoint)
+                    .mobileIntro(mobileIntro)
+                    .price(price)
+                    .cost(cost)
+                    .sn(sn)
+                    .goodsGalleryList(Arrays.asList(image))
+                    .quantity(quantity)
+                    .regeneratorSkuFlag(true)
+                    .templateId("1376434171555086336")
+                    .build());
+        }
+    }
+
+    @Override
+    public void initImages(List<XSSFShape> list) {
+        this.picMap = handleImages(list);
+    }
+
+    private Map handleImages(List<XSSFShape> list) {
+        Map<String,String> images = new HashMap<>(32);
+        for (XSSFShape shape : list) {
+            if (shape instanceof XSSFPicture) {
+                XSSFPicture picture = (XSSFPicture) shape;
+                XSSFClientAnchor cAnchor = (XSSFClientAnchor) picture.getAnchor();
+                XSSFPictureData pdata = picture.getPictureData();
+                byte[] data = pdata.getData();
+                String url = fileManagerPlugin.inputStreamUpload(new ByteArrayInputStream(data), UuidUtils.getUUID()+"."+pdata.getPackagePart().getContentTypeDetails().getSubType());
+                images.put("row_"+cAnchor.getRow1(),url);
+            }
+        }
+        return images;
+    }
+}

+ 17 - 0
framework/src/main/java/cn/lili/common/utils/excel/ReadHandle.java

@@ -0,0 +1,17 @@
+package cn.lili.common.utils.excel;
+
+import org.apache.poi.xssf.usermodel.XSSFRow;
+import org.apache.poi.xssf.usermodel.XSSFShape;
+
+import java.util.List;
+
+/**
+ * @author: lianghanqiang
+ * @description:
+ * @since: 8/20/21 -- 4:15 PM
+ */
+public interface ReadHandle {
+    void handleRow(XSSFRow row, Integer rowIndex);
+
+    void initImages(List<XSSFShape> list);
+}

+ 1 - 1
framework/src/main/java/cn/lili/modules/connect/serviceimpl/ConnectServiceImpl.java

@@ -162,7 +162,7 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
 
         Object cacheData = cache.get(CachePrefix.WECHAT_SESSION_PARAMS.getPrefix() + params.getUuid());
         Map<String, String> map = new HashMap<>(3);
-        if (cacheData == null) {
+        if (cacheData == null || ((HashMap)cacheData).size()==0) {
             //得到微信小程序联合登陆信息
             JSONObject json = this.getConnect(params.getCode());
             //存储session key 后续登录用得到

+ 1 - 1
framework/src/main/java/cn/lili/modules/file/plugin/impl/ObsFileManagerPlugin.java

@@ -137,7 +137,7 @@ public class ObsFileManagerPlugin implements FileManagerPlugin {
     public String getUrl(String url, Integer width, Integer height) {
         //缩略图全路径
         //返回缩略图全路径
-        return url + "?x-oss-process=style/" + width + "X" + height;
+        return url;
     }
 
 }

+ 4 - 1
framework/src/main/java/cn/lili/modules/goods/entity/dto/GoodsOperationDTO.java

@@ -1,6 +1,8 @@
 package cn.lili.modules.goods.entity.dto;
 
+import cn.hutool.core.convert.Convert;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Builder;
 import lombok.Data;
 import lombok.ToString;
 import org.hibernate.validator.constraints.Length;
@@ -11,6 +13,7 @@ import javax.validation.constraints.Min;
 import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
 import java.io.Serializable;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -22,6 +25,7 @@ import java.util.Map;
  */
 @Data
 @ToString
+@Builder
 public class GoodsOperationDTO implements Serializable {
 
     private static final long serialVersionUID = -509667581371776913L;
@@ -121,5 +125,4 @@ public class GoodsOperationDTO implements Serializable {
     private String goodsType;
 
 
-
 }

+ 29 - 0
framework/src/main/java/cn/lili/modules/goods/entity/dto/ImportDto.java

@@ -0,0 +1,29 @@
+package cn.lili.modules.goods.entity.dto;
+
+import lombok.Builder;
+import lombok.Data;
+
+import java.awt.image.BufferedImage;
+
+/**
+ * @author: lianghanqiang
+ * @description:
+ * @since: 8/20/21 -- 11:03 AM
+ */
+@Data
+@Builder
+public class ImportDto {
+    BufferedImage image;
+    String brandName;
+    String goodsName;
+    String sn;
+    String price;
+    String cost;
+    String weight;
+    String intro;
+    String mobileIntro;
+    String quantity;
+    String goodsUnit;
+    String salesModel;
+    String sellingPoint;
+}

+ 2 - 0
framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java

@@ -121,6 +121,8 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
             //给商品参数填充值
             goods.setParams(JSONUtil.toJsonStr(goodsOperationDTO.getGoodsParamsDTOList()));
         }
+
+
         //添加商品
         this.save(goods);
         //添加商品sku信息

+ 1 - 1
framework/src/main/java/cn/lili/modules/order/order/entity/enums/OrderOperateEnum.java

@@ -15,7 +15,7 @@ public enum OrderOperateEnum {
     CONFIRM("确认"),
 
     /**
-     * 支付
+     * 8.135.47.166:4560
      */
     PAY("支付"),
 

+ 2 - 0
framework/src/main/java/cn/lili/modules/payment/kit/CashierSupport.java

@@ -75,6 +75,8 @@ public class CashierSupport {
                 return payment.nativePay(request, payParam);
             case MP:
                 return payment.mpPay(request, payParam);
+            case GATEWAY:
+                return payment.gatewayPay(request, payParam);
             default:
                 return null;
         }

+ 15 - 1
framework/src/main/java/cn/lili/modules/payment/kit/Payment.java

@@ -71,7 +71,18 @@ public interface Payment {
      * @param payParam 支付参数
      * @return 二维码内容
      */
-    default ResultMessage<Object> mpPay(HttpServletRequest request, PayParam payParam) {
+    default ResultMessage<Object> mpPay(HttpServletRequest request, PayParam payParam)  {
+        throw new ServiceException(ResultCode.PAY_ERROR);
+    }
+
+    /**
+     * 易宝网关支付
+     *
+     * @param request  HttpServletRequest
+     * @param payParam 支付参数
+     * @return 网关回调页面地址
+     */
+    default ResultMessage<Object> gatewayPay(HttpServletRequest request, PayParam payParam){
         throw new ServiceException(ResultCode.PAY_ERROR);
     }
 
@@ -156,6 +167,8 @@ public interface Payment {
         return api + "/buyer/cashier/refund/notify/" + paymentMethodEnum.name();
     }
 
+
+
     public static void main(String[] args) {
         String str = "orderType=TRADE&sn=O202104271386961176205721601";
         System.out.println(str.length());
@@ -163,4 +176,5 @@ public interface Payment {
         System.out.println(urlEncoder.encode(str, StandardCharsets.UTF_8));
     }
 
+
 }

+ 13 - 1
framework/src/main/java/cn/lili/modules/payment/kit/enums/PaymentClientEnum.java

@@ -27,5 +27,17 @@ public enum PaymentClientEnum {
     /**
      *  小程序,通常指微信小程序
      */
-    MP
+    MP,
+    /**
+     *  易宝网关支付
+     */
+    GATEWAY,
+    /**
+     *  易宝支付宝
+     */
+    YEEPAYALI,
+    /**
+     *  易宝微信
+     */
+    YEEPAYWX,
 }

+ 1 - 0
framework/src/main/java/cn/lili/modules/payment/kit/enums/PaymentMethodEnum.java

@@ -10,6 +10,7 @@ public enum PaymentMethodEnum {
 
     WECHAT("wechatPlugin", "微信"),
     ALIPAY("aliPayPlugin", "支付宝"),
+    YEEPAY("yeepayPlugin","易宝支付"),
     WALLET("walletPlugin", "余额支付"),
     BANK_TRANSFER("bankTransferPlugin", "线下转账");
 

+ 119 - 49
framework/src/main/java/cn/lili/modules/payment/kit/plugin/alipay/AliPayPlugin.java

@@ -3,6 +3,7 @@ package cn.lili.modules.payment.kit.plugin.alipay;
 import cn.hutool.core.net.URLDecoder;
 import cn.hutool.core.net.URLEncoder;
 import cn.hutool.json.JSONUtil;
+import cn.lili.common.cache.Cache;
 import cn.lili.common.enums.ResultCode;
 import cn.lili.common.enums.ResultUtil;
 import cn.lili.common.exception.ServiceException;
@@ -18,12 +19,16 @@ import cn.lili.modules.payment.kit.dto.PayParam;
 import cn.lili.modules.payment.kit.dto.PaymentSuccessParams;
 import cn.lili.modules.payment.kit.enums.PaymentMethodEnum;
 import cn.lili.modules.payment.kit.params.dto.CashierParam;
+import cn.lili.modules.payment.kit.plugin.yeepay.common.YeePayConst;
+import cn.lili.modules.payment.kit.plugin.yeepay.entity.InitOrderDto;
+import cn.lili.modules.payment.kit.plugin.yeepay.service.YeePayService;
 import cn.lili.modules.payment.service.PaymentService;
 import cn.lili.modules.payment.service.RefundLogService;
 import cn.lili.modules.system.entity.dos.Setting;
 import cn.lili.modules.system.entity.dto.payment.AlipayPaymentSetting;
 import cn.lili.modules.system.entity.enums.SettingEnum;
 import cn.lili.modules.system.service.SettingService;
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.alipay.api.AlipayApiException;
 import com.alipay.api.domain.*;
@@ -39,6 +44,8 @@ import javax.servlet.http.HttpServletResponse;
 import java.nio.charset.StandardCharsets;
 import java.util.Map;
 
+import static cn.lili.modules.payment.kit.plugin.yeepay.service.YeePayService.PREFIX_PAYMENT;
+
 /**
  * 支付宝支付
  *
@@ -64,6 +71,16 @@ public class AliPayPlugin implements Payment {
     @Autowired
     private ApiProperties apiProperties;
 
+    @Autowired
+    private YeePayService yeePayService;
+
+    //缓存
+    @Autowired
+    private Cache<String> cache;
+
+    @Autowired
+    private YeePayConst yeePayConst;
+
     @Override
     public ResultMessage<Object> h5pay(HttpServletRequest request, HttpServletResponse response, PayParam payParam) {
 
@@ -130,38 +147,54 @@ public class AliPayPlugin implements Payment {
             log.error("支付业务异常:", e);
             throw new ServiceException(ResultCode.PAY_ERROR);
         }
-    }
+
+        }
 
     @Override
     public ResultMessage<Object> nativePay(HttpServletRequest request, PayParam payParam) {
 
-        try {
+//        try {
             CashierParam cashierParam = cashierSupport.cashierParam(payParam);
 
-            AlipayTradePrecreateModel payModel = new AlipayTradePrecreateModel();
+//            AlipayTradePrecreateModel payModel = new AlipayTradePrecreateModel();
 
             //请求订单编号
             String outTradeNo = SnowFlake.getIdStr();
 
-            payModel.setBody(cashierParam.getTitle());
-            payModel.setSubject(cashierParam.getDetail());
-            payModel.setTotalAmount(cashierParam.getPrice() + "");
-
-            //回传数据
-            payModel.setPassbackParams(URLEncoder.createAll().encode(BeanUtil.formatKeyValuePair(payParam), StandardCharsets.UTF_8));
-//       payModel.setStoreId("store_id");
-            payModel.setTimeoutExpress("3m");
-            payModel.setOutTradeNo(outTradeNo);
-            log.info("支付宝扫码:{}", payModel);
-            String resultStr = AliPayRequest.tradePrecreatePayToResponse(payModel, notifyUrl(apiProperties.getBuyer(), PaymentMethodEnum.ALIPAY)).getBody();
-
-            log.info("支付宝扫码交互返回:{}", resultStr);
-            JSONObject jsonObject = JSONObject.parseObject(resultStr);
-            return ResultUtil.data(jsonObject.getJSONObject("alipay_trade_precreate_response").getString("qr_code"));
-        } catch (Exception e) {
-            log.error("支付业务异常:", e);
-            throw new ServiceException(ResultCode.PAY_ERROR);
-        }
+//            payModel.setBody(cashierParam.getTitle());
+//            payModel.setSubject(cashierParam.getDetail());
+//            payModel.setTotalAmount(cashierParam.getPrice() + "");
+//
+//            //回传数据
+//            payModel.setPassbackParams(URLEncoder.createAll().encode(BeanUtil.formatKeyValuePair(payParam), StandardCharsets.UTF_8));
+////       payModel.setStoreId("store_id");
+//            payModel.setTimeoutExpress("3m");
+//            payModel.setOutTradeNo(outTradeNo);
+//            log.info("支付宝扫码:{}", payModel);
+//            String resultStr = AliPayRequest.tradePrecreatePayToResponse(payModel, notifyUrl(apiProperties.getBuyer(), PaymentMethodEnum.ALIPAY)).getBody();
+//
+//            log.info("支付宝扫码交互返回:{}", resultStr);
+//            JSONObject jsonObject = JSONObject.parseObject(resultStr);
+//            return ResultUtil.data(jsonObject.getJSONObject("alipay_trade_precreate_response").getString("qr_code"));
+//        } catch (Exception e) {
+//            log.error("支付业务异常:", e);
+//            throw new ServiceException(ResultCode.PAY_ERROR);
+//        }
+        cache.put(PREFIX_PAYMENT+outTradeNo,URLEncoder.createDefault().encode(JSONUtil.toJsonStr(payParam), StandardCharsets.UTF_8));
+
+
+        InitOrderDto initOrderDto = InitOrderDto.builder()
+                .channel("ALIPAY")
+                .goodsName(cashierParam.getTitle())
+                .orderAmount(cashierParam.getPrice())
+                .orderId(outTradeNo)
+                .payWay("USER_SCAN")
+                .notifyUrl(notifyUrl(apiProperties.getBuyer(), PaymentMethodEnum.ALIPAY))
+                .scene("OFFLINE")
+                .userIp("127.0.0.1")
+                .build();
+
+        return ResultUtil.data(yeePayService.initOrder(initOrderDto));
     }
 
 
@@ -243,33 +276,70 @@ public class AliPayPlugin implements Payment {
      * @param request
      */
     private void verifyNotify(HttpServletRequest request) {
-        try {
-            AlipayPaymentSetting alipayPaymentSetting = alipayPaymentSetting();
-            //获取支付宝反馈信息
-            Map<String, String> map = AliPayApi.toMap(request);
-            log.info("支付回调响应:{}", JSONUtil.toJsonStr(map));
-            boolean verifyResult = AlipaySignature.rsaCertCheckV1(map, alipayPaymentSetting.getAlipayPublicCertPath(), "UTF-8",
-                    "RSA2");
-
-            String payParamStr = map.get("passback_params");
-            String payParamJson = URLDecoder.decode(payParamStr, StandardCharsets.UTF_8);
-            PayParam payParam = BeanUtil.formatKeyValuePair(payParamJson, new PayParam());
-
-
-            if (verifyResult) {
-                String tradeNo = map.get("trade_no");
-                Double totalAmount = Double.parseDouble(map.get("total_amount"));
-                PaymentSuccessParams paymentSuccessParams =
-                        new PaymentSuccessParams(PaymentMethodEnum.ALIPAY.name(), tradeNo, totalAmount, payParam);
-
-                paymentService.success(paymentSuccessParams);
-                log.info("支付回调通知:支付成功-参数:{},回调参数:{}", map, payParam);
-            } else {
-                log.info("支付回调通知:支付失败-参数:{}", map);
-            }
-        } catch (AlipayApiException e) {
-            log.error("支付回调通知异常", e);
-        }
+        System.out.println("支付宝-易宝支付回调: map"+ JSON.toJSONString(request.getParameterMap()));
+        com.alibaba.fastjson.JSONObject jsonObject = yeePayService.deCodeNotifyData(request.getParameterMap().get("cipherText")[0]);
+        log.info("支付宝解密回调密文:"+jsonObject.toJSONString());
+
+                                /*
+                                * {
+                            "channelOrderId":"4200001146202107231811930975",
+                            "orderId":"1418392045155778560",
+                            "bankOrderId":"5937679445210723",
+                            "paySuccessDate":"2021-07-23 10:06:38",
+                            "channel":"WECHAT",
+                            "payWay":"USER_SCAN",
+                            "uniqueOrderNo":"1013202107230000002449173814",
+                            "orderAmount":"0.01",
+                            "payAmount":"0.01",
+                            "payerInfo":"{\"bankCardNo\":\"\",\"bankId\":\"CFT\",\"cardType\":\"CFT\",\"mobilePhoneNo\":\"\",\"userID\":\"o19581K7Nz5lUwsqaT10yTqOe1MI\"}",
+                            "realPayAmount":"0.01",
+                            "parentMerchantNo":"10086062555",
+                            "merchantNo":"10086062555",
+                            "status":"SUCCESS"
+                        }
+                                * */
+
+
+        String payParamStr = cache.get(PREFIX_PAYMENT+jsonObject.getString("orderId"));
+        String payParamJson = URLDecoder.decode(payParamStr, StandardCharsets.UTF_8);
+        PayParam payParam = JSONUtil.toBean(payParamJson, PayParam.class);
+
+        PaymentSuccessParams paymentSuccessParams = new PaymentSuccessParams(
+                PaymentMethodEnum.ALIPAY.name(),
+                jsonObject.getString("orderId"),
+                jsonObject.getDouble("orderAmount"),
+                payParam
+        );
+
+        paymentService.success(paymentSuccessParams);
+
+//        try {
+//            AlipayPaymentSetting alipayPaymentSetting = alipayPaymentSetting();
+//            //获取支付宝反馈信息
+//            Map<String, String> map = AliPayApi.toMap(request);
+//            log.info("支付回调响应:{}", JSONUtil.toJsonStr(map));
+//            boolean verifyResult = AlipaySignature.rsaCertCheckV1(map, alipayPaymentSetting.getAlipayPublicCertPath(), "UTF-8",
+//                    "RSA2");
+//
+//            String payParamStr = map.get("passback_params");
+//            String payParamJson = URLDecoder.decode(payParamStr, StandardCharsets.UTF_8);
+//            PayParam payParam = BeanUtil.formatKeyValuePair(payParamJson, new PayParam());
+//
+//
+//            if (verifyResult) {
+//                String tradeNo = map.get("trade_no");
+//                Double totalAmount = Double.parseDouble(map.get("total_amount"));
+//                PaymentSuccessParams paymentSuccessParams =
+//                        new PaymentSuccessParams(PaymentMethodEnum.ALIPAY.name(), tradeNo, totalAmount, payParam);
+//
+//                paymentService.success(paymentSuccessParams);
+//                log.info("支付回调通知:支付成功-参数:{},回调参数:{}", map, payParam);
+//            } else {
+//                log.info("支付回调通知:支付失败-参数:{}", map);
+//            }
+//        } catch (AlipayApiException e) {
+//            log.error("支付回调通知异常", e);
+//        }
 
     }
 

+ 253 - 132
framework/src/main/java/cn/lili/modules/payment/kit/plugin/wechat/WechatPlugin.java

@@ -34,6 +34,9 @@ import cn.lili.modules.payment.kit.enums.PaymentMethodEnum;
 import cn.lili.modules.payment.kit.params.dto.CashierParam;
 import cn.lili.modules.payment.kit.plugin.wechat.enums.WechatDomain;
 import cn.lili.modules.payment.kit.plugin.wechat.model.*;
+import cn.lili.modules.payment.kit.plugin.yeepay.common.YeePayConst;
+import cn.lili.modules.payment.kit.plugin.yeepay.entity.InitOrderDto;
+import cn.lili.modules.payment.kit.plugin.yeepay.service.YeePayService;
 import cn.lili.modules.payment.service.PaymentService;
 import cn.lili.modules.payment.service.RefundLogService;
 import cn.lili.modules.system.entity.dos.Setting;
@@ -42,6 +45,7 @@ import cn.lili.modules.system.entity.dto.connect.dto.WechatConnectSettingItem;
 import cn.lili.modules.system.entity.dto.payment.WechatPaymentSetting;
 import cn.lili.modules.system.entity.enums.SettingEnum;
 import cn.lili.modules.system.service.SettingService;
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -56,6 +60,8 @@ import java.util.Date;
 import java.util.Map;
 import java.util.Objects;
 
+import static cn.lili.modules.payment.kit.plugin.yeepay.service.YeePayService.PREFIX_PAYMENT;
+
 /**
  * 微信支付
  *
@@ -88,6 +94,12 @@ public class WechatPlugin implements Payment {
     @Autowired
     private ConnectService connectService;
 
+    @Autowired
+    private YeePayService yeePayService;
+
+    @Autowired
+    private YeePayConst yeePayConst;
+
 
     @Override
     public ResultMessage<Object> h5pay(HttpServletRequest request, HttpServletResponse response1, PayParam payParam) {
@@ -279,66 +291,160 @@ public class WechatPlugin implements Payment {
     @Override
     public ResultMessage<Object> nativePay(HttpServletRequest request, PayParam payParam) {
 
-        try {
-
+//        try {
+//
             CashierParam cashierParam = cashierSupport.cashierParam(payParam);
-
-            //支付金额
-            Integer fen = CurrencyUtil.fen(cashierParam.getPrice());
-            //第三方付款订单
+//
+//            //支付金额
+//            Integer fen = CurrencyUtil.fen(cashierParam.getPrice());
+//            //第三方付款订单
             String outOrderNo = SnowFlake.getIdStr();
-            //过期时间
-            String timeExpire = DateTimeZoneUtil.dateToTimeZone(System.currentTimeMillis() + 1000 * 60 * 3);
-
-            String attach = URLEncoder.createDefault().encode(JSONUtil.toJsonStr(payParam), StandardCharsets.UTF_8);
-
-            WechatPaymentSetting setting = wechatPaymentSetting();
-            UnifiedOrderModel unifiedOrderModel = new UnifiedOrderModel()
-                    .setAppid(setting.getAppId())
-                    .setMchid(setting.getMchId())
-                    .setDescription(cashierParam.getDetail())
-                    .setOut_trade_no(outOrderNo)
-                    .setTime_expire(timeExpire)
-                    //回传参数
-                    .setAttach(attach)
-                    .setNotify_url(notifyUrl(apiProperties.getBuyer(), PaymentMethodEnum.WECHAT))
-                    .setAmount(new Amount().setTotal(fen));
-
-            log.info("统一下单参数 {}", JSONUtil.toJsonStr(unifiedOrderModel));
-            PaymentHttpResponse response = WechatApi.v3(
-                    RequestMethodEnums.POST,
-                    WechatDomain.CHINA.toString(),
-                    cn.lili.modules.payment.kit.plugin.wechat.enums.WechatApi.NATIVE_PAY.toString(),
-                    setting.getMchId(),
-                    setting.getSerialNumber(),
-                    null,
-                    setting.getApiclient_key(),
-                    JSONUtil.toJsonStr(unifiedOrderModel)
-            );
-            log.info("统一下单响应 {}", response);
-            //根据证书序列号查询对应的证书来验证签名结果
-            boolean verifySignature = WxPayKit.verifySignature(response, getPlatformCert());
-            log.info("verifySignature: {}", verifySignature);
-
-            if (verifySignature) {
-                return ResultUtil.data(new JSONObject(response.getBody()).getStr("code_url"));
-            } else {
-                log.error("微信支付参数验证错误,请及时处理");
-                throw new ServiceException(ResultCode.PAY_ERROR);
-            }
-        } catch (ServiceException e) {
-            log.error("支付异常", e);
-            throw new ServiceException(ResultCode.PAY_ERROR);
-        } catch (Exception e) {
-            log.error("支付异常", e);
-            throw new ServiceException(ResultCode.PAY_ERROR);
-        }
+//            //过期时间
+//            String timeExpire = DateTimeZoneUtil.dateToTimeZone(System.currentTimeMillis() + 1000 * 60 * 3);
+//
+//            String attach = URLEncoder.createDefault().encode(JSONUtil.toJsonStr(payParam), StandardCharsets.UTF_8);
+//
+//            WechatPaymentSetting setting = wechatPaymentSetting();
+//            UnifiedOrderModel unifiedOrderModel = new UnifiedOrderModel()
+//                    .setAppid(setting.getAppId())
+//                    .setMchid(setting.getMchId())
+//                    .setDescription(cashierParam.getDetail())
+//                    .setOut_trade_no(outOrderNo)
+//                    .setTime_expire(timeExpire)
+//                    //回传参数
+//                    .setAttach(attach)
+//                    .setNotify_url(notifyUrl(apiProperties.getBuyer(), PaymentMethodEnum.WECHAT))
+//                    .setAmount(new Amount().setTotal(fen));
+//
+//            log.info("统一下单参数 {}", JSONUtil.toJsonStr(unifiedOrderModel));
+//            PaymentHttpResponse response = WechatApi.v3(
+//                    RequestMethodEnums.POST,
+//                    WechatDomain.CHINA.toString(),
+//                    cn.lili.modules.payment.kit.plugin.wechat.enums.WechatApi.NATIVE_PAY.toString(),
+//                    setting.getMchId(),
+//                    setting.getSerialNumber(),
+//                    null,
+//                    setting.getApiclient_key(),
+//                    JSONUtil.toJsonStr(unifiedOrderModel)
+//            );
+//            log.info("统一下单响应 {}", response);
+//            //根据证书序列号查询对应的证书来验证签名结果
+//            boolean verifySignature = WxPayKit.verifySignature(response, getPlatformCert());
+//            log.info("verifySignature: {}", verifySignature);
+//
+//            if (verifySignature) {
+//                return ResultUtil.data(new JSONObject(response.getBody()).getStr("code_url"));
+//            } else {
+//                log.error("微信支付参数验证错误,请及时处理");
+//                throw new ServiceException(ResultCode.PAY_ERROR);
+//            }
+//        } catch (ServiceException e) {
+//            log.error("支付异常", e);
+//            throw new ServiceException(ResultCode.PAY_ERROR);
+//        } catch (Exception e) {
+//            log.error("支付异常", e);
+//            throw new ServiceException(ResultCode.PAY_ERROR);
+//        }
+
+        cache.put(PREFIX_PAYMENT+outOrderNo,URLEncoder.createDefault().encode(JSONUtil.toJsonStr(payParam), StandardCharsets.UTF_8));
+
+        InitOrderDto initOrderDto = InitOrderDto.builder()
+                .channel("WECHAT")
+                .goodsName(cashierParam.getTitle())
+                .orderAmount(cashierParam.getPrice())
+                .orderId(outOrderNo)
+                .payWay("USER_SCAN")
+                .notifyUrl(notifyUrl(apiProperties.getBuyer(), PaymentMethodEnum.WECHAT))
+                .scene("OFFLINE")
+                .userIp("127.0.0.1")
+                .build();
+
+        return ResultUtil.data(yeePayService.initOrder(initOrderDto));
     }
+//      这里为微信原生,现已替换易宝代付
+//    @Override
+//    public ResultMessage<Object> mpPay(HttpServletRequest request, PayParam payParam) {
+//
+//        try {
+//            LambdaQueryWrapper<Connect> queryWrapper = new LambdaQueryWrapper<>();
+//            queryWrapper.eq(Connect::getUserId, UserContext.getCurrentUser().getId())
+//                    .eq(Connect::getUnionType, ConnectEnum.WECHAT_MP_OPEN_ID.name());
+//            Connect connect = connectService.getOne(queryWrapper);
+//            if (connect == null) {
+//                return null;
+//            }
+//
+//            Payer payer = new Payer();
+//            payer.setOpenid(connect.getUnionId());
+//
+//            CashierParam cashierParam = cashierSupport.cashierParam(payParam);
+//
+//            //支付金额
+//            Integer fen = CurrencyUtil.fen(cashierParam.getPrice());
+//            //第三方付款订单
+//            String outOrderNo = SnowFlake.getIdStr();
+//            //过期时间
+//            String timeExpire = DateTimeZoneUtil.dateToTimeZone(System.currentTimeMillis() + 1000 * 60 * 3);
+//
+//            //微信小程序,appid 需要单独获取,这里读取了联合登陆配置的appid ,实际场景小程序自动登录,所以这个appid是最为保险的做法
+//            //如果有2开需求,这里需要调整,修改这个appid的获取途径即可
+//            WechatConnectSettingItem wechatConnectSettingItem = getWechatMPSetting();
+//            String appid = null;
+//            if (wechatConnectSettingItem != null) {
+//                appid = getWechatMPSetting().getAppId();
+//            }
+//
+//            String attach = URLEncoder.createDefault().encode(JSONUtil.toJsonStr(payParam), StandardCharsets.UTF_8);
+//
+//            WechatPaymentSetting setting = wechatPaymentSetting();
+//            UnifiedOrderModel unifiedOrderModel = new UnifiedOrderModel()
+//                    .setAppid(appid)
+//                    .setMchid(setting.getMchId())
+//                    .setDescription(cashierParam.getDetail())
+//                    .setOut_trade_no(outOrderNo)
+//                    .setTime_expire(timeExpire)
+//                    .setAttach(attach)
+//                    .setNotify_url(notifyUrl(apiProperties.getBuyer(), PaymentMethodEnum.WECHAT))
+//                    .setAmount(new Amount().setTotal(fen))
+//                    .setPayer(payer);
+//
+//            log.info("统一下单参数 {}", JSONUtil.toJsonStr(unifiedOrderModel));
+//            PaymentHttpResponse response = WechatApi.v3(
+//                    RequestMethodEnums.POST,
+//                    WechatDomain.CHINA.toString(),
+//                    cn.lili.modules.payment.kit.plugin.wechat.enums.WechatApi.JS_API_PAY.toString(),
+//                    setting.getMchId(),
+//                    setting.getSerialNumber(),
+//                    null,
+//                    setting.getApiclient_key(),
+//                    JSONUtil.toJsonStr(unifiedOrderModel)
+//            );
+//            //根据证书序列号查询对应的证书来验证签名结果
+//            boolean verifySignature = WxPayKit.verifySignature(response, getPlatformCert());
+//            log.info("verifySignature: {}", verifySignature);
+//            log.info("统一下单响应 {}", response);
+//
+//            if (verifySignature) {
+//                String body = response.getBody();
+//                JSONObject jsonObject = JSONUtil.parseObj(body);
+//                String prepayId = jsonObject.getStr("prepay_id");
+//                Map<String, String> map = WxPayKit.jsApiCreateSign(appid, prepayId, setting.getApiclient_key());
+//                log.info("唤起支付参数:{}", map);
+//
+//                return ResultUtil.data(map);
+//            }
+//            log.error("微信支付参数验证错误,请及时处理");
+//            throw new ServiceException(ResultCode.PAY_ERROR);
+//        } catch (Exception e) {
+//            log.error("支付异常", e);
+//            throw new ServiceException(ResultCode.PAY_ERROR);
+//        }
+//
+//    }
 
     @Override
-    public ResultMessage<Object> mpPay(HttpServletRequest request, PayParam payParam) {
+    public ResultMessage<Object> mpPay(HttpServletRequest request, PayParam payParam)  {
 
-        try {
             LambdaQueryWrapper<Connect> queryWrapper = new LambdaQueryWrapper<>();
             queryWrapper.eq(Connect::getUserId, UserContext.getCurrentUser().getId())
                     .eq(Connect::getUnionType, ConnectEnum.WECHAT_MP_OPEN_ID.name());
@@ -347,19 +453,22 @@ public class WechatPlugin implements Payment {
                 return null;
             }
 
-            Payer payer = new Payer();
-            payer.setOpenid(connect.getUnionId());
 
             CashierParam cashierParam = cashierSupport.cashierParam(payParam);
 
-            //支付金额
-            Integer fen = CurrencyUtil.fen(cashierParam.getPrice());
+
             //第三方付款订单
-            String outOrderNo = SnowFlake.getIdStr();
-            //过期时间
-            String timeExpire = DateTimeZoneUtil.dateToTimeZone(System.currentTimeMillis() + 1000 * 60 * 3);
 
-            //微信小程序,appid 需要单独获取,这里读取了联合登陆配置的appid ,实际场景小程序自动登录,所以这个appid是最为保险的做法
+                String outOrderNo = SnowFlake.getIdStr();
+            String timeExpire = null;
+        //过期时间
+            try {
+                timeExpire = DateTimeZoneUtil.dateToTimeZone(System.currentTimeMillis() + 1000 * 60 * 3);
+            } catch (Exception e) {
+                log.error("支付过期时间异常:"+e.getMessage());
+            }
+
+        //微信小程序,appid 需要单独获取,这里读取了联合登陆配置的appid ,实际场景小程序自动登录,所以这个appid是最为保险的做法
             //如果有2开需求,这里需要调整,修改这个appid的获取途径即可
             WechatConnectSettingItem wechatConnectSettingItem = getWechatMPSetting();
             String appid = null;
@@ -367,52 +476,26 @@ public class WechatPlugin implements Payment {
                 appid = getWechatMPSetting().getAppId();
             }
 
-            String attach = URLEncoder.createDefault().encode(JSONUtil.toJsonStr(payParam), StandardCharsets.UTF_8);
-
-            WechatPaymentSetting setting = wechatPaymentSetting();
-            UnifiedOrderModel unifiedOrderModel = new UnifiedOrderModel()
-                    .setAppid(appid)
-                    .setMchid(setting.getMchId())
-                    .setDescription(cashierParam.getDetail())
-                    .setOut_trade_no(outOrderNo)
-                    .setTime_expire(timeExpire)
-                    .setAttach(attach)
-                    .setNotify_url(notifyUrl(apiProperties.getBuyer(), PaymentMethodEnum.WECHAT))
-                    .setAmount(new Amount().setTotal(fen))
-                    .setPayer(payer);
-
-            log.info("统一下单参数 {}", JSONUtil.toJsonStr(unifiedOrderModel));
-            PaymentHttpResponse response = WechatApi.v3(
-                    RequestMethodEnums.POST,
-                    WechatDomain.CHINA.toString(),
-                    cn.lili.modules.payment.kit.plugin.wechat.enums.WechatApi.JS_API_PAY.toString(),
-                    setting.getMchId(),
-                    setting.getSerialNumber(),
-                    null,
-                    setting.getApiclient_key(),
-                    JSONUtil.toJsonStr(unifiedOrderModel)
-            );
-            //根据证书序列号查询对应的证书来验证签名结果
-            boolean verifySignature = WxPayKit.verifySignature(response, getPlatformCert());
-            log.info("verifySignature: {}", verifySignature);
-            log.info("统一下单响应 {}", response);
-
-            if (verifySignature) {
-                String body = response.getBody();
-                JSONObject jsonObject = JSONUtil.parseObj(body);
-                String prepayId = jsonObject.getStr("prepay_id");
-                Map<String, String> map = WxPayKit.jsApiCreateSign(appid, prepayId, setting.getApiclient_key());
-                log.info("唤起支付参数:{}", map);
+            cache.put(PREFIX_PAYMENT+outOrderNo, URLEncoder.createDefault().encode(JSONUtil.toJsonStr(payParam), StandardCharsets.UTF_8));
+
+        com.alibaba.fastjson.JSONObject res = yeePayService.initOrder(
+                InitOrderDto.builder()
+                        .appId(appid)
+                        .channel("WECHAT")
+                        .expiredTime(timeExpire)
+                        .goodsName(cashierParam.getTitle())
+                        .notifyUrl(notifyUrl(apiProperties.getBuyer(), PaymentMethodEnum.WECHAT))
+                        .orderAmount(cashierParam.getPrice())
+                        .scene("ONLINE")
+                        .orderId(outOrderNo)
+                        .payWay("MINI_PROGRAM")
+                        .userId(connect.getUnionId())
+                        .userIp("127.0.0.1")
+                        .build()
 
-                return ResultUtil.data(map);
-            }
-            log.error("微信支付参数验证错误,请及时处理");
-            throw new ServiceException(ResultCode.PAY_ERROR);
-        } catch (Exception e) {
-            log.error("支付异常", e);
-            throw new ServiceException(ResultCode.PAY_ERROR);
-        }
+        );
 
+        return ResultUtil.data(res.getJSONObject("prePayTn"));
     }
 
     @Override
@@ -440,42 +523,80 @@ public class WechatPlugin implements Payment {
      * @throws Exception
      */
     private void verifyNotify(HttpServletRequest request) throws Exception {
-
-        String timestamp = request.getHeader("Wechatpay-Timestamp");
-        String nonce = request.getHeader("Wechatpay-Nonce");
-        String serialNo = request.getHeader("Wechatpay-Serial");
-        String signature = request.getHeader("Wechatpay-Signature");
-
-        log.info("timestamp:{} nonce:{} serialNo:{} signature:{}", timestamp, nonce, serialNo, signature);
-        String result = HttpKit.readData(request);
-        log.info("微信支付通知密文 {}", result);
-
-        WechatPaymentSetting setting = wechatPaymentSetting();
-        //校验服务器端响应¬
-        String plainText = WxPayKit.verifyNotify(serialNo, result, signature, nonce, timestamp,
-                setting.getApiKey3(), Objects.requireNonNull(getPlatformCert()));
-
-        log.info("微信支付通知明文 {}", plainText);
-
-        JSONObject jsonObject = JSONUtil.parseObj(plainText);
-
-        String payParamStr = jsonObject.getStr("attach");
+        System.out.println("微信-易宝支付回调: map"+ JSON.toJSONString(request.getParameterMap()));
+        com.alibaba.fastjson.JSONObject jsonObject = yeePayService.deCodeNotifyData(request.getParameterMap().get("cipherText")[0]);
+            log.info("微信解密回调密文:"+jsonObject.toJSONString());
+
+                        /*
+                        * {
+                    "channelOrderId":"4200001146202107231811930975",
+                    "orderId":"1418392045155778560",
+                    "bankOrderId":"5937679445210723",
+                    "paySuccessDate":"2021-07-23 10:06:38",
+                    "channel":"WECHAT",
+                    "payWay":"USER_SCAN",
+                    "uniqueOrderNo":"1013202107230000002449173814",
+                    "orderAmount":"0.01",
+                    "payAmount":"0.01",
+                    "payerInfo":"{\"bankCardNo\":\"\",\"bankId\":\"CFT\",\"cardType\":\"CFT\",\"mobilePhoneNo\":\"\",\"userID\":\"o19581K7Nz5lUwsqaT10yTqOe1MI\"}",
+                    "realPayAmount":"0.01",
+                    "parentMerchantNo":"10086062555",
+                    "merchantNo":"10086062555",
+                    "status":"SUCCESS"
+                }
+                        * */
+
+
+        String payParamStr = cache.get(PREFIX_PAYMENT+jsonObject.getString("orderId"));
         String payParamJson = URLDecoder.decode(payParamStr, StandardCharsets.UTF_8);
         PayParam payParam = JSONUtil.toBean(payParamJson, PayParam.class);
 
 
-        String tradeNo = jsonObject.getStr("transaction_id");
-        Double totalAmount = CurrencyUtil.reversalFen(jsonObject.getJSONObject("amount").getDouble("total"));
-
         PaymentSuccessParams paymentSuccessParams = new PaymentSuccessParams(
                 PaymentMethodEnum.WECHAT.name(),
-                tradeNo,
-                totalAmount,
+                jsonObject.getString("orderId"),
+                jsonObject.getDouble("orderAmount"),
                 payParam
         );
 
         paymentService.success(paymentSuccessParams);
-        log.info("微信支付回调:支付成功{}", plainText);
+
+
+//        String timestamp = request.getHeader("Wechatpay-Timestamp");
+//        String nonce = request.getHeader("Wechatpay-Nonce");
+//        String serialNo = request.getHeader("Wechatpay-Serial");
+//        String signature = request.getHeader("Wechatpay-Signature");
+//
+//        log.info("timestamp:{} nonce:{} serialNo:{} signature:{}", timestamp, nonce, serialNo, signature);
+//        String result = HttpKit.readData(request);
+//        log.info("微信支付通知密文 {}", result);
+//
+//        WechatPaymentSetting setting = wechatPaymentSetting();
+//        //校验服务器端响应¬
+//        String plainText = WxPayKit.verifyNotify(serialNo, result, signature, nonce, timestamp,
+//                setting.getApiKey3(), Objects.requireNonNull(getPlatformCert()));
+//
+//        log.info("微信支付通知明文 {}", plainText);
+//
+//        JSONObject jsonObject = JSONUtil.parseObj(plainText);
+//
+//        String payParamStr = jsonObject.getStr("attach");
+//        String payParamJson = URLDecoder.decode(payParamStr, StandardCharsets.UTF_8);
+//        PayParam payParam = JSONUtil.toBean(payParamJson, PayParam.class);
+//
+//
+//        String tradeNo = jsonObject.getStr("transaction_id");
+//        Double totalAmount = CurrencyUtil.reversalFen(jsonObject.getJSONObject("amount").getDouble("total"));
+//
+//        PaymentSuccessParams paymentSuccessParams = new PaymentSuccessParams(
+//                PaymentMethodEnum.WECHAT.name(),
+//                tradeNo,
+//                totalAmount,
+//                payParam
+//        );
+//
+//        paymentService.success(paymentSuccessParams);
+//        log.info("微信支付回调:支付成功{}", plainText);
     }
 
     @Override

+ 129 - 0
framework/src/main/java/cn/lili/modules/payment/kit/plugin/yeepay/YeepayPlugin.java

@@ -0,0 +1,129 @@
+package cn.lili.modules.payment.kit.plugin.yeepay;
+
+import cn.hutool.core.net.URLDecoder;
+import cn.hutool.core.net.URLEncoder;
+import cn.hutool.json.JSONUtil;
+import cn.lili.common.cache.Cache;
+import cn.lili.common.enums.ResultCode;
+import cn.lili.common.enums.ResultUtil;
+import cn.lili.common.exception.ServiceException;
+import cn.lili.common.utils.BeanUtil;
+import cn.lili.common.utils.ResponseUtil;
+import cn.lili.common.utils.SnowFlake;
+import cn.lili.common.vo.ResultMessage;
+import cn.lili.config.properties.ApiProperties;
+import cn.lili.modules.payment.kit.CashierSupport;
+import cn.lili.modules.payment.kit.Payment;
+import cn.lili.modules.payment.kit.dto.PayParam;
+import cn.lili.modules.payment.kit.dto.PaymentSuccessParams;
+import cn.lili.modules.payment.kit.enums.PaymentMethodEnum;
+import cn.lili.modules.payment.kit.params.dto.CashierParam;
+import cn.lili.modules.payment.kit.plugin.alipay.AliPayApi;
+import cn.lili.modules.payment.kit.plugin.yeepay.common.YeePayConst;
+import cn.lili.modules.payment.kit.plugin.yeepay.entity.PayGateWayDto;
+import cn.lili.modules.payment.kit.plugin.yeepay.service.YeePayService;
+import cn.lili.modules.payment.service.PaymentService;
+import cn.lili.modules.payment.service.RefundLogService;
+import cn.lili.modules.system.entity.dto.payment.AlipayPaymentSetting;
+import cn.lili.modules.system.service.SettingService;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.alipay.api.AlipayApiException;
+import com.alipay.api.internal.util.AlipaySignature;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.http.HttpServletRequest;
+import java.nio.charset.StandardCharsets;
+import java.util.Map;
+
+import static cn.lili.modules.payment.kit.plugin.yeepay.service.YeePayService.PREFIX_PAYMENT;
+
+
+/**
+ * @author lianghanqiang
+ * @date 2021/7/16 4:09 下午
+ */
+@Component
+@Slf4j
+public class YeepayPlugin implements Payment {
+    //支付日志
+    @Autowired
+    private PaymentService paymentService;
+    //退款日志
+    @Autowired
+    private RefundLogService refundLogService;
+    //收银台
+    @Autowired
+    private CashierSupport cashierSupport;
+    //设置
+    @Autowired
+    private SettingService settingService;
+    //API域名
+    @Autowired
+    private ApiProperties apiProperties;
+    @Autowired
+    private YeePayConst yeePayConst;
+    @Autowired
+    private YeePayService yeePayService;
+    //缓存
+    @Autowired
+    private Cache<String> cache;
+
+    /**
+     * 易宝网关支付
+     *
+     * @param request  HttpServletRequest
+     * @param payParam 支付参数
+     * @return 网关回调页面地址
+     */
+    public ResultMessage<Object> gatewayPay(HttpServletRequest request, PayParam payParam){
+        CashierParam cashierParam = cashierSupport.cashierParam(payParam);
+        //请求订单编号
+        String outTradeNo = SnowFlake.getIdStr();
+
+        cache.put(PREFIX_PAYMENT+outTradeNo, URLEncoder.createDefault().encode(JSONUtil.toJsonStr(payParam), StandardCharsets.UTF_8));
+
+        PayGateWayDto payGateWayDto = PayGateWayDto.builder()
+                .orderId(outTradeNo)
+                .goodsName(cashierParam.getTitle())
+                .orderAmount(cashierParam.getPrice())
+                .notifyUrl(notifyUrl(apiProperties.getBuyer(), PaymentMethodEnum.YEEPAY))
+                .build();
+
+        return ResultUtil.data(yeePayService.payByGateWay(payGateWayDto));
+    }
+
+
+    @Override
+    public void notify(HttpServletRequest request) {
+        verifyNotify(request);
+        log.info("支付异步通知:");
+    }
+
+    /**
+     * 验证支付结果
+     *
+     * @param request
+     */
+    private void verifyNotify(HttpServletRequest request) {
+        System.out.println("易宝网关支付回调: map"+ JSON.toJSONString(request.getParameterMap()));
+        com.alibaba.fastjson.JSONObject jsonObject = yeePayService.deCodeNotifyData(request.getParameterMap().get("cipherText")[0]);
+        log.info("易宝网关支付解密回调密文:"+jsonObject.toJSONString());
+        String payParamStr = cache.get(PREFIX_PAYMENT+jsonObject.getString("orderId"));
+        String payParamJson = URLDecoder.decode(payParamStr, StandardCharsets.UTF_8);
+        PayParam payParam = JSONUtil.toBean(payParamJson, PayParam.class);
+
+
+        PaymentSuccessParams paymentSuccessParams = new PaymentSuccessParams(
+                PaymentMethodEnum.YEEPAY.name(),
+                jsonObject.getString("orderId"),
+                jsonObject.getDouble("orderAmount"),
+                payParam
+        );
+
+        paymentService.success(paymentSuccessParams);
+
+    }
+}

+ 30 - 0
framework/src/main/java/cn/lili/modules/payment/kit/plugin/yeepay/common/YeePayConst.java

@@ -0,0 +1,30 @@
+package cn.lili.modules.payment.kit.plugin.yeepay.common;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.stereotype.Component;
+
+@Component
+@Data
+@PropertySource(value = {"payConfig.properties"})
+@ConfigurationProperties(prefix = "yee-pay")
+public class YeePayConst {
+	String parentMerchantNo;
+	String merchantNo;
+	String sm4Key;
+	String weChatConfigAddUrl;
+	String weChatConfigQueryUrl;
+	String prePayUrl;
+	String transferOrderUrl;
+	String queryTransferOrderUrl;
+	String payNotify;
+	String transferNotify;
+	String queryBalanceUrl;
+	String payGateWayUrl;
+	String gatewayNotify;
+	String batchTransferUrl;
+	String batchTransferNotify;
+	String appKey;
+	String privateKey;
+}

+ 38 - 0
framework/src/main/java/cn/lili/modules/payment/kit/plugin/yeepay/entity/ConfigAppDto.java

@@ -0,0 +1,38 @@
+package cn.lili.modules.payment.kit.plugin.yeepay.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Builder;
+import lombok.Data;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotBlank;
+
+
+@Data
+@Builder
+@Validated
+public class ConfigAppDto {
+	String [] tradeAuthDirList;
+	AppInfo [] appIdList;
+
+		@ApiModel("App信息实体类,包括小程序以及公众号")
+		@Data
+		@Valid
+		public static class AppInfo{
+			@NotBlank
+			@ApiModelProperty(value = "公众号ID",required = true)
+			String appId;
+			@NotBlank
+			@ApiModelProperty(value = "公众号秘钥",required = true)
+			String appSecret;
+			@NotBlank
+			@ApiModelProperty(value = "appIdType appId类型(OFFICIAL_ACCOUNT:公众号;MINI_PROGRAM:小程序)",required = true)
+			String appIdType ;
+			@NotBlank
+			@ApiModelProperty(value = "推荐关注的公众号ID",required = true)
+			String subscribeAppId;
+		}
+
+}

+ 71 - 0
framework/src/main/java/cn/lili/modules/payment/kit/plugin/yeepay/entity/InitOrderDto.java

@@ -0,0 +1,71 @@
+package cn.lili.modules.payment.kit.plugin.yeepay.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Builder;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+@Data
+@Builder
+public class InitOrderDto {
+	@NotBlank
+	@ApiModelProperty(value = "商户订单号,保证订单唯一性", required = true)
+	String orderId;
+
+	@ApiModelProperty(value = "订单金额,单位: 元, 两位小数, 最低 0.01", required = true)
+	@NotNull
+	Double orderAmount;
+
+	@ApiModelProperty("订单截止时间: 格式: yyyy-MM-dd HH:mm:ss 不传默认一天")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	String expiredTime;
+
+	@NotBlank
+	@ApiModelProperty(value = "支付成功服务器回调地址", required = true)
+	String notifyUrl;
+
+	@ApiModelProperty("页面回调地址。如使用易宝收银台需要上送前端页面回调地址")
+	String redirectUrl;
+
+	@ApiModelProperty("自定义对账备注;商户可以自定义自身业务需要使用的字段: 如对账时定义该订单应属的会计科目")
+	String memo;
+
+	@NotBlank
+	@ApiModelProperty(value = "商品名称", required = true)
+	String goodsName;
+
+	@ApiModelProperty("分账订单标记,DELAY_SETTLE:需要分账;REAL_TIME:不需要分账,示例值:REAL_TIME")
+	String fundProcessType;
+
+	@NotBlank
+	@ApiModelProperty(value = "支付方式类型: USER_SCAN:用户扫码 ;MINI_PROGRAM:小程序支付 ; WECHAT_OFFIACCOUNT:微信公众号 ;ALIPAY_LIFE:支付宝生活号 ;JS_PAY:JS支付 ;SDK_PAY:SDK支付 ;H5_PAY:H5支付", required = true)
+	String payWay;
+
+	@NotBlank
+	@ApiModelProperty(value = "渠道类型 : WECHAT:微信 ; ALIPAY:支付宝 ;UNIONPAY:银联云闪付", required = true)
+	String channel;
+
+	@ApiModelProperty("场景: ONLINE:线上 ; OFFLINE:线下 ; BAOXIAN:保险 ; 渠道类型为银联时,不必传")
+	String scene;
+
+	@ApiModelProperty("支付渠道为微信时需要提供用户的openId")
+	String userId;
+
+	@NotBlank
+	@ApiModelProperty(value = "用户的真实IP地址", required = true)
+	String userIp;
+
+	String channelSpecifiedInfo;
+
+	String channelPromotionInfo;
+
+	String uniqueOrderNo;
+
+	String csUrl;
+
+	@ApiModelProperty("支付渠道为微信时需要提供appID")
+	String appId;
+}

+ 11 - 0
framework/src/main/java/cn/lili/modules/payment/kit/plugin/yeepay/entity/KeyAndValue.java

@@ -0,0 +1,11 @@
+package cn.lili.modules.payment.kit.plugin.yeepay.entity;
+
+import lombok.Builder;
+import lombok.Data;
+
+@Data
+@Builder
+public class KeyAndValue {
+	String key;
+	String value;
+}

+ 44 - 0
framework/src/main/java/cn/lili/modules/payment/kit/plugin/yeepay/entity/PayGateWayDto.java

@@ -0,0 +1,44 @@
+package cn.lili.modules.payment.kit.plugin.yeepay.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Builder;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+@Data
+@Builder
+@ApiModel("网关支付入参")
+public class PayGateWayDto {
+	@NotBlank
+	@ApiModelProperty(value = "商户请求号",required = true)
+	String orderId;
+
+	@NotNull
+	@ApiModelProperty(value = "充值金额",required = true)
+	Double orderAmount;
+
+//	@NotBlank
+//	@ApiModelProperty(value = "可选项如下:" +
+//		"B2C:个人网银" +
+//		"B2B:企业网银",required = true)
+//	String payType;
+
+//	@NotBlank
+//	@ApiModelProperty(value = "银行编码",required = true)
+//	String bankCode;
+
+	@NotBlank
+	@ApiModelProperty(value = "商户通知地址",required = true)
+	String notifyUrl;
+
+	@NotBlank
+	@ApiModelProperty(value = "商品名称",required = true)
+	String goodsName;
+
+	@ApiModelProperty(value = "支付成功跳转地址",required = false)
+	String redirectUrl;
+
+}

+ 107 - 0
framework/src/main/java/cn/lili/modules/payment/kit/plugin/yeepay/entity/TransferDto.java

@@ -0,0 +1,107 @@
+package cn.lili.modules.payment.kit.plugin.yeepay.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+@Data
+@Builder
+@ApiModel("转账入参实体")
+@NoArgsConstructor
+@AllArgsConstructor
+public class TransferDto {
+
+	@ApiModelProperty(value = "单位:元,非负浮点数,保留2位小数,示例值:1000.00",required = true)
+	@NotNull
+	Double orderAmount;
+
+	@ApiModelProperty(value = "手续费承担方(若不传默认付款方)\n" +
+		"可选项如下:\n" +
+		"PAYER:付款方\n" +
+		"PAYEE:收款方\n" +
+		"示例值:当商户承担且计费方式为预付实扣或后收时,不支持收款方承担;当平台商或服务商承担时无需指定此手续费承担方;",required = false)
+	String feeChargeSide;
+
+	@NotBlank
+	@ApiModelProperty(value = "到账类型\n" +
+		"可选项如下:\n" +
+		"REAL_TIME:实时\n" +
+		"TWO_HOUR:两小时到账\n" +
+		"NEXT_DAY:次日到账(无特殊情况资金于次日上午7点左右到收款银行账户中)\n" +
+		"示例值:REAL_TIME",required = true)
+	String receiveType;
+
+	@ApiModelProperty(value = "收款帐户的卡号",required = true)
+	@NotBlank
+	String receiverAccountNo;
+
+	@NotBlank
+	@ApiModelProperty(value = "收款方开户名",required = true)
+	String receiverAccountName;
+
+	@ApiModelProperty(value = "收款方开户行\n" +
+		"银行卡所在开户行编号,详见\n" +
+		"https://open.yeepay.com/attachments/2020/07/23/doc_FFTv15d8TY_1595490360236.xlsx?fileName=%E6%80%BB%E8%A1%8C%E5%8F%8A%E7%9B%B8%E5%BA%94%E6%94%AF%E8%A1%8C%E7%BC%96%E7%A0%81.xlsx\n" +
+		"示例值:ICBC",required = true)
+	@NotBlank
+	String receiverBankCode;
+
+	@NotBlank
+	@ApiModelProperty(value = "账户类型\n" +
+		"可选项如下:\n" +
+		"DEBIT_CARD:借记卡\n" +
+		"CREDIT_CARD:贷记卡\n" +
+		"QUASI_CREDIT_CARD:准贷卡\n" +
+		"PASSBOOK:存折\n" +
+		"UNIT_SETTLE_CARD:单位结算卡\n" +
+		"PUBLIC_CARD:对公卡\n" +
+		"示例值:DEBIT_CARD",required = true)
+	String bankAccountType;
+
+	@ApiModelProperty("支行编码\n" +
+		"详见 https://open.yeepay.com/attachments/2020/08/06/doc_6PhAgFxEau_1596701395666.xlsx?fileName=%E6%94%AF%E8%A1%8C%E4%BF%A1%E6%81%AF20200826.xlsx")
+	String branchBankCode;
+
+	@ApiModelProperty("银行附言\n" +
+		"展示在收款银行系统中的附言,由数字、字母、汉字组成(最终附言内容以银行实际账单为准)\n" +
+		"示例值:xx平台付款")
+	String comments;
+
+	@ApiModelProperty("终端类型\n" +
+		"可选项如下:\n" +
+		"PC:电脑\n" +
+		"PHONE:手机\n" +
+		"PAD:平板\n" +
+		"NFC:可穿戴设备\n" +
+		"DTV:数字电视\n" +
+		"MPOS:条码支付受理终端\n" +
+		"OTHER:其他\n" +
+		"示例值:PC")
+	String terminalType;
+
+	@ApiModelProperty("商户通知地址,不传则不通知回调内容请参看:付款结果通知\n" +
+		"示例值:http://www.baidu.com")
+	String notifyUrl;
+
+	@ApiModelProperty(value = "请求订单号,自定义生成,唯一",required = true)
+	String requestNo;
+
+
+	/**
+	 * 商户id
+	 */
+
+	private Long bussinessId;
+
+	/**
+	 * 代付单号,每个商户唯一
+	 */
+
+	private String bussinessOrderId;
+}

+ 46 - 0
framework/src/main/java/cn/lili/modules/payment/kit/plugin/yeepay/service/Sm4GcmUtils.java

@@ -0,0 +1,46 @@
+package cn.lili.modules.payment.kit.plugin.yeepay.service;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.lang3.StringUtils;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+
+import javax.crypto.Cipher;
+import javax.crypto.spec.GCMParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+import java.security.Key;
+import java.security.Security;
+
+public class Sm4GcmUtils {
+	static {
+		if (Security.getProvider("BC") == null) {
+			Security.addProvider(new BouncyCastleProvider());
+		}
+	}
+
+	/**
+	 * 解密
+	 *
+	 * @param key
+	 * @param data
+	 * @param once
+	 * @param associatedData
+	 * @return
+	 */
+	public static String decrypt_GCM_NoPadding(String key, String data, String once, String associatedData) throws Exception {
+		Cipher cipher = Cipher.getInstance("SM4/GCM/NoPadding", BouncyCastleProvider.PROVIDER_NAME);
+		Key sm4Key = new SecretKeySpec(Base64.decodeBase64(key), "SM4");
+		byte[] iv = new byte[12];
+		if (StringUtils.isNotEmpty(once)) {
+			iv = Base64.decodeBase64(once);
+		}
+		if (StringUtils.isNotEmpty(associatedData)) {
+			byte[] aad = associatedData.getBytes();
+			cipher.updateAAD(aad);
+		}
+		GCMParameterSpec s = new GCMParameterSpec(128, iv);
+		cipher.init(Cipher.DECRYPT_MODE, sm4Key, s);
+		return new String(cipher.doFinal(Base64.decodeBase64(data)));
+
+	}
+
+}

+ 297 - 0
framework/src/main/java/cn/lili/modules/payment/kit/plugin/yeepay/service/YeePayService.java

@@ -0,0 +1,297 @@
+package cn.lili.modules.payment.kit.plugin.yeepay.service;
+
+import cn.hutool.core.lang.Assert;
+import cn.lili.common.enums.ResultCode;
+import cn.lili.common.exception.ServiceException;
+import cn.lili.modules.payment.kit.plugin.yeepay.common.YeePayConst;
+import cn.lili.modules.payment.kit.plugin.yeepay.entity.InitOrderDto;
+import cn.lili.modules.payment.kit.plugin.yeepay.entity.KeyAndValue;
+import cn.lili.modules.payment.kit.plugin.yeepay.entity.PayGateWayDto;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.yeepay.yop.sdk.exception.YopClientException;
+import com.yeepay.yop.sdk.security.DigestAlgEnum;
+import com.yeepay.yop.sdk.service.common.YopClient;
+import com.yeepay.yop.sdk.service.common.YopClientBuilder;
+import com.yeepay.yop.sdk.service.common.request.YopRequest;
+import com.yeepay.yop.sdk.service.common.response.YopResponse;
+import com.yeepay.yop.sdk.utils.Sm2Utils;
+import lombok.extern.slf4j.Slf4j;
+import org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationEventPublisher;
+import org.springframework.stereotype.Service;
+
+import java.security.PrivateKey;
+import java.util.*;
+
+@Service
+@Slf4j
+public class YeePayService {
+
+	@Autowired
+	YeePayConst yeePayConst;
+	@Autowired
+	private ApplicationEventPublisher eventPublisher;
+
+	public static final String PREFIX_PAYMENT = "{payment_params}:";
+
+	YopClient yopClient = YopClientBuilder.builder().build();
+
+
+//	/**
+//	 *	易宝 公众号配置
+//	 * @param configAppDto
+//	 * @return*/
+//	public R configApp(ConfigAppDto configAppDto) {
+//		YopRequest request = new YopRequest(yeePayConst.getWeChatConfigAddUrl(), "POST");
+//		addMerchantNo(request);
+//		if(configAppDto.getAppIdList()!=null){
+//			request.addParameter("appIdList", JSON.toJSONString(configAppDto.getAppIdList()));
+//		}
+//		if(configAppDto.getTradeAuthDirList()!=null){
+//			request.addParameter("tradeAuthDirList",JSON.toJSONString(configAppDto.getTradeAuthDirList()));
+//		}
+//		try {
+//			YopResponse response = yopClient.request(request);
+//			return R.data(JSON.parseObject(response.getStringResult()));
+//		} catch (YopClientException e) {
+//			e.printStackTrace();
+//		}
+//		return R.fail("配置失败");
+//	}
+
+//	/**
+//	 *	易宝 查询公众号配置
+//	 *
+//	 * @param appIdType
+//	 * @return*/
+//	public R queryApp(String appIdType) {
+//		YopRequest request = new YopRequest(yeePayConst.getWeChatConfigQueryUrl(), "GET");
+//		if(appIdType!=null){
+//			request.addParameter("appIdType",appIdType);
+//		}
+//		addMerchantNo(request);
+//		try {
+//			YopResponse response = yopClient.request(request);
+//			return R.data(JSON.parseObject(response.getStringResult()));
+//		} catch (YopClientException e) {
+//			e.printStackTrace();
+//		}
+//		return R.fail("查询失败");
+//	}
+
+	/**
+	 * 	易宝 统一下单
+	 *
+	 * @param initOrderDto
+	 * @return*/
+	public JSONObject initOrder(InitOrderDto initOrderDto){
+		YopRequest request = new YopRequest(yeePayConst.getPrePayUrl(), "POST");
+		addMerchantNo(request);
+		addParamsFromObj(initOrderDto,request,initOrderDto.getClass());
+		YopResponse response = null;
+		try {
+			response = yopClient.request(request);
+			return JSON.parseObject(response.getStringResult());
+		} catch (YopClientException e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+
+
+	/**
+	 * 	添加请求参数
+	 * @param obj 请求所需DTO对象
+	 * @param request 所需添加参数请求
+	 * @param clazz */
+	private void addParamsFromObj(Object obj, YopRequest request, Class clazz){
+		Arrays.stream(clazz.getDeclaredFields())
+			.forEach(field -> {
+					field.setAccessible(true);
+					try {
+						String paramValue = Optional.ofNullable(field.get(obj)).orElse("").toString();
+						if(paramValue!=null&!"".equals(paramValue)){
+							request.addParameter(field.getName(),paramValue);
+						}
+					} catch (IllegalAccessException e) {
+						e.printStackTrace();
+					}
+				}
+			);
+	}
+
+	/**
+	 * 	解析解密支付通知数据
+	 * @param cipherText 加密数据
+	 * */
+	public JSONObject deCodeNotifyData(String cipherText) {
+
+		try {
+			String decryptData = Sm4GcmUtils.decrypt_GCM_NoPadding(
+				yeePayConst.getSm4Key(),
+					cipherText,
+				"",
+				""
+			);
+			log.info("通知解密数据:"+ decryptData);
+			return JSON.parseObject(decryptData);
+		} catch (Exception e) {
+			log.error("回调解析错误: "+ e.getMessage());
+		}
+		return null;
+	}
+
+
+//	/**
+//	 *	代付:转账到银行卡(单笔出款)
+//	 * @param transferDto 转账信息
+//	 * */
+//	public R transferToCard(TransferDto transferDto) {
+//		YopRequest request = new YopRequest(yeePayConst.getTransferOrderUrl(), "POST");
+//		transferDto.setNotifyUrl(yeePayConst.getTransferNotify());
+//		addMerchantNo(request);
+////		request.addParameter("requestNo", IdUtil.simpleUUID());
+//		addParamsFromObj(transferDto,request, transferDto.getClass());
+//		YopResponse response = null;
+//		try {
+//			response = yopClient.request(request);
+//			return R.data(JSON.parseObject(response.getStringResult()));
+//		} catch (YopClientException e) {
+//			e.printStackTrace();
+//		}
+//		return R.fail("操作失败");
+//	}
+
+//	/**
+//	 * 	转账订单查询
+//	 * @param requestNo 易宝订单号
+//	 * */
+//	public R queryTransferOrder( String requestNo ){
+//		YopRequest request = new YopRequest(yeePayConst.getQueryTransferOrderUrl(), "GET");
+//		addMerchantNo(request);
+//		request.addParameter("requestNo", requestNo);
+//		YopResponse response = null;
+//		try {
+//			response = yopClient.request(request);
+//			return R.data(JSON.parseObject(response.getStringResult()));
+//		} catch (YopClientException e) {
+//			e.printStackTrace();
+//		}
+//		return R.fail("查询失败!");
+//	}
+
+
+	private void addMerchantNo(YopRequest request){
+		request.addParameter("parentMerchantNo",yeePayConst.getParentMerchantNo());
+		request.addParameter("merchantNo",yeePayConst.getMerchantNo());
+	}
+
+//	public void orderNotify(Map<String, Object> params) {
+//		JSONObject decryptData = deCodeNotifyData(params);
+//		PayNotifyEvent payNotifyEvent = new PayNotifyEvent(decryptData);
+//		eventPublisher.publishEvent(payNotifyEvent);
+//	}
+
+
+//	public void transferNotify(Map<String, Object> params) {
+//		log.info("======================== 转账原始数据 =======================");
+//		log.info(JSON.toJSONString(params));
+//		JSONObject decryptData = deCodeNotifyData(params);
+//		log.info("======================== 转账回调解密数据 =======================");
+//		log.info(decryptData.toJSONString());
+//		TransferEvent transferEvent = new TransferEvent(decryptData);
+//		eventPublisher.publishEvent(transferEvent);
+//	}
+
+
+//	/**
+//	 * 	查询账户余额
+//	 * */
+//	public R queryBalance() {
+//		YopRequest request = new YopRequest(yeePayConst.getQueryBalanceUrl(), "GET");
+//		request.addParameter("merchantNo", yeePayConst.getMerchantNo());
+//		YopResponse response = null;
+//		try {
+//			response = yopClient.request(request);
+//			return R.data(JSON.parseObject(response.getStringResult()));
+//		} catch (YopClientException e) {
+//			e.printStackTrace();
+//		}
+//		return R.fail("查询失败!");
+//	}
+	private	 String sign(List<KeyAndValue> params){
+		StringBuilder stringBuilder = new StringBuilder();
+		params.stream().forEach(item ->
+				stringBuilder.append(item.getKey()+"="+item.getValue()+"&")
+		);
+		String s = stringBuilder.deleteCharAt(stringBuilder.length() - 1).toString();
+		System.out.println(s);
+		String priKey = yeePayConst.getPrivateKey();
+		PrivateKey privateKey1 = Sm2Utils.string2PrivateKey(priKey);
+		String sign = Sm2Utils.sign(s, (BCECPrivateKey) privateKey1)+"$"+ DigestAlgEnum.SM3.getValue();
+		return sign;
+	}
+
+	/**
+	 * 	网关--充值
+	 * @param payGateWayDto 网关入参实体
+	 * */
+	public JSONObject payByGateWay(PayGateWayDto payGateWayDto) {
+		YopRequest request = new YopRequest(yeePayConst.getPayGateWayUrl(), "POST");
+//		payGateWayDto.setNotifyUrl(yeePayConst.getGatewayNotify());
+		addMerchantNo(request);
+		addParamsFromObj(payGateWayDto,request,payGateWayDto.getClass());
+		YopResponse response = null;
+		String token = null;
+		try {
+			response = yopClient.request(request);
+			token= JSON.parseObject(response.getStringResult()).getString("token");
+		} catch (YopClientException e) {
+			e.printStackTrace();
+			throw new ServiceException(ResultCode.PAY_ERROR);
+		}
+		Assert.notNull(token,"获取订单token失败,下单异常");
+		List<KeyAndValue> params = new ArrayList<>();
+		String timeStr = System.currentTimeMillis() / 1000 + "";
+		params.add(KeyAndValue.builder().key("appKey").value(yeePayConst.getAppKey()).build());
+		params.add(KeyAndValue.builder().key("merchantNo").value(yeePayConst.getMerchantNo()).build());
+		params.add(KeyAndValue.builder().key("token").value(token).build());
+		params.add(KeyAndValue.builder().key("timestamp").value(timeStr).build());
+		params.add(KeyAndValue.builder().key("directPayType").value("").build());
+		params.add(KeyAndValue.builder().key("cardType").value("").build());
+		params.add(KeyAndValue.builder().key("userNo").value("").build());
+		params.add(KeyAndValue.builder().key("userType").value("").build());
+		params.add(KeyAndValue.builder().key("ext").value("").build());
+
+		String payUrl = "https://cash.yeepay.com/cashier/std?" +
+				"appKey="+yeePayConst.getAppKey()+
+				"&merchantNo=" + yeePayConst.getMerchantNo()+
+				"&token=" +token+
+				"&timestamp=" +timeStr+
+				"&directPayType=" +
+				"&cardType=" +
+				"&userNo=" +
+				"&userType=" +
+				"&ext=" +
+				"&sign="+this.sign(params);
+		return JSONObject.parseObject("{\n" +
+				" \"payUrl\": \""+payUrl+"\"\n" +
+				"}");
+	}
+
+
+//	/**
+//	 * 网关充值回调
+//	 * */
+//	public void gatewayNotify(Map<String, Object> params) {
+//		log.info("======================== 网关充值原始数据 =======================");
+//		log.info(JSON.toJSONString(params));
+//		JSONObject decryptData = deCodeNotifyData(params);
+//		log.info("======================== 网关充值回调解密数据 =======================");
+//		log.info(decryptData.toJSONString());
+//		GatewayEvent gatewayEvent = new GatewayEvent(decryptData);
+//		eventPublisher.publishEvent(gatewayEvent);
+//	}
+}

+ 3 - 0
framework/src/main/java/cn/lili/modules/search/entity/dto/EsGoodsSearchDTO.java

@@ -38,6 +38,9 @@ public class EsGoodsSearchDTO {
     @ApiModelProperty(value = "商家分组id,搜索店铺商品的时候使用")
     private String storeCatId;
 
+    @ApiModelProperty(value = "销售类型,批发还是零售")
+    private String salesModel;
+
     @ApiModelProperty(hidden = true)
     private Map<String, List<String>> notShowCol = new HashMap<>();
 

+ 4 - 0
framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java

@@ -328,6 +328,10 @@ public class EsGoodsSearchServiceImpl implements EsGoodsSearchService {
         if (CharSequenceUtil.isNotEmpty(searchDTO.getCategoryId())) {
             filterBuilder.must(QueryBuilders.wildcardQuery("categoryPath", "*" + searchDTO.getCategoryId() + "*"));
         }
+        //销售类型判定
+        if (CharSequenceUtil.isNotEmpty(searchDTO.getSalesModel())) {
+            filterBuilder.must(QueryBuilders.termQuery("salesModel", searchDTO.getSalesModel()));
+        }
         //店铺分类判定
         if (CharSequenceUtil.isNotEmpty(searchDTO.getStoreCatId())) {
             filterBuilder.must(QueryBuilders.wildcardQuery("storeCategoryPath", "*" + searchDTO.getStoreCatId() + "*"));

+ 6 - 19
framework/src/main/resources/banner.txt

@@ -1,19 +1,6 @@
- ___       ___  ___       ___                 ________ ________  _______   ________  _____ ______   ___       __   ________  ________  ___  __       
-|\  \     |\  \|\  \     |\  \               |\  _____\\   __  \|\  ___ \ |\   __  \|\   _ \  _   \|\  \     |\  \|\   __  \|\   __  \|\  \|\  \     
-\ \  \    \ \  \ \  \    \ \  \  ____________\ \  \__/\ \  \|\  \ \   __/|\ \  \|\  \ \  \\\__\ \  \ \  \    \ \  \ \  \|\  \ \  \|\  \ \  \/  /|_   
- \ \  \    \ \  \ \  \    \ \  \|\____________\ \   __\\ \   _  _\ \  \_|/_\ \   __  \ \  \\|__| \  \ \  \  __\ \  \ \  \\\  \ \   _  _\ \   ___  \  
-  \ \  \____\ \  \ \  \____\ \  \|____________|\ \  \_| \ \  \\  \\ \  \_|\ \ \  \ \  \ \  \    \ \  \ \  \|\__\_\  \ \  \\\  \ \  \\  \\ \  \\ \  \ 
-   \ \_______\ \__\ \_______\ \__\              \ \__\   \ \__\\ _\\ \_______\ \__\ \__\ \__\    \ \__\ \____________\ \_______\ \__\\ _\\ \__\\ \__\
-    \|_______|\|__|\|_______|\|__|               \|__|    \|__|\|__|\|_______|\|__|\|__|\|__|     \|__|\|____________|\|_______|\|__|\|__|\|__| \|__|
-
-
-
-                                                 ___       ___  ___       ___                 ________  ___  ___  ________  ________
-                                                |\  \     |\  \|\  \     |\  \               |\   ____\|\  \|\  \|\   __  \|\   __  \
-                                                \ \  \    \ \  \ \  \    \ \  \  ____________\ \  \___|\ \  \\\  \ \  \|\  \ \  \|\  \
-                                                 \ \  \    \ \  \ \  \    \ \  \|\____________\ \_____  \ \   __  \ \  \\\  \ \   ____\
-                                                  \ \  \____\ \  \ \  \____\ \  \|____________|\|____|\  \ \  \ \  \ \  \\\  \ \  \___|
-                                                   \ \_______\ \__\ \_______\ \__\               ____\_\  \ \__\ \__\ \_______\ \__\
-                                                    \|_______|\|__|\|_______|\|__|              |\_________\|__|\|__|\|_______|\|__|
-                                                                                                \|_________|
-
+   ___   __   __   ____   _  _    _  __       _  
+  / __|  \ \ / /  |_  /  | || |  | |/ /    _ | | 
+ | (__    \ V /    / /   | __ |  | ' <    | || | 
+  \___|   _|_|_   /___|  |_||_|  |_|\_\   _\__/  
+_|"""""|_| """ |_|"""""|_|"""""|_|"""""|_|"""""| 
+"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-' 

+ 3 - 0
framework/src/main/resources/config/4421256739.cer

@@ -0,0 +1,3 @@
+-----BEGIN CERTIFICATE-----
+MIIDXzCCAwOgAwIBAgIFRCElZzkwDAYIKoEcz1UBg3UFADBcMQswCQYDVQQGEwJDTjEwMC4GA1UECgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRswGQYDVQQDDBJDRkNBIEFDUyBTTTIgT0NBMzEwHhcNMjEwNzA2MDk0NjE3WhcNMjYwNzA2MDk0NjE3WjCBkTELMAkGA1UEBhMCQ04xGzAZBgNVBAoMEkNGQ0EgQUNTIFNNMiBPQ0EzMTEPMA0GA1UECwwGWUVFUEFZMRkwFwYDVQQLDBBPcmdhbml6YXRpb25hbC0xMTkwNwYDVQQDDDAwNTFA5bm/5Lic5Y2X57Kk6I2v5Lia5pyJ6ZmQ5YWs5Y+4QDEwMDg2MDYyNTU1QDEwWTATBgcqhkjOPQIBBggqgRzPVQGCLQNCAATmrDkcCyGrN4NlQQdAeAEHh6UbJGH19u2P+1n65FYJpDVsAXlEwoNZrBbwlu9TVH8JAbuTDaTAA/5rVfuEqOkqo4IBeDCCAXQwbAYIKwYBBQUHAQEEYDBeMCgGCCsGAQUFBzABhhxodHRwOi8vb2NzcC5jZmNhLmNvbS5jbi9vY3NwMDIGCCsGAQUFBzAChiZodHRwOi8vY3JsLmNmY2EuY29tLmNuL29jYTMxL29jYTMxLmNlcjAfBgNVHSMEGDAWgBQI2NEmxEh9nOysmOnxf2K5gM6pRTAMBgNVHRMBAf8EAjAAMEgGA1UdIARBMD8wPQYIYIEchu8qAQQwMTAvBggrBgEFBQcCARYjaHR0cDovL3d3dy5jZmNhLmNvbS5jbi91cy91cy0xNC5odG0wPQYDVR0fBDYwNDAyoDCgLoYsaHR0cDovL2NybC5jZmNhLmNvbS5jbi9vY2EzMS9TTTIvY3JsMTQxMy5jcmwwDgYDVR0PAQH/BAQDAgbAMB0GA1UdDgQWBBS64zDSxeb9SAGl1e9iyy+NUA6BkzAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwQwDAYIKoEcz1UBg3UFAANIADBFAiEA6A+szbA4zlNWv3lk7l8fDlBGjI775Tj7mUou91qUtIwCIBSRKpIzvSIPgVnwOeJg0rQ0lpxobJQkLWwS2xL9xoL9
+-----END CERTIFICATE-----

BIN
framework/src/main/resources/config/4421256739.pfx


+ 86 - 0
framework/src/main/resources/config/yop_sdk_config_default.json

@@ -0,0 +1,86 @@
+{
+  "app_key": "app_10086062555",
+  "isv_private_key": [
+    {
+      "store_type": "file_p12",
+      "cert_type": "SM2",
+      "value": "config/4421256739.pfx",
+      "password": "123456"
+    }
+  ],
+  "server_root": "https://openapi.yeepay.com/yop-center",
+  "yos_server_root": "https://yos.yeepay.com/yop-center",
+  "yop_public_key": [
+    {
+      "store_type": "file_cer",
+      "cert_type": "RSA2048",
+      "value": "config/certs/yop_platform_rsa_cert_290297451928.cer"
+    }
+  ],
+  "yop_cert_store": {
+    "enable":true,
+    "lazy":false
+  },
+  "http_client": {
+    "connect_timeout": 10000,
+    "read_timeout": 30000,
+    "max_conn_total": 200,
+    "max_conn_per_route": 100
+  }
+}
+/*
+
+"app_key": "app_10086066206",
+秘钥: "MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQggXJnzSm9p+7ENkEgG3CtFPX3lVBeNYWQ3opOdP6ni/2gCgYIKoEcz1UBgi2hRANCAAQoXBavXcjK+p+0eAvQylP+Q1XjztEUK8HJZ518oSyfcIu7TjkgDkv1Bjdh0F1AJlRplWhv7Kf8JOyzsSA+/yQ5"
+公钥: MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEKFwWr13IyvqftHgL0MpT/kNV487RFCvByWedfKEsn3CLu045IA5L9QY3YdBdQCZUaZVob+yn/CTss7EgPv8kOQ==
+
+"app_key": "app_10086062555",
+秘钥: MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgzsZ3+LzkLHTJ7cD/nvsYgvMsaE5cqELSrgVcbGSF4u+gCgYIKoEcz1UBgi2hRANCAASnuftvXO3ZeM0JbkI2tG72mMfdd6nWYjhK59Szp4lDhMyuAJinixMkMfmow3DvcTu0d+gv6QPH7eaJQMZabvUa
+公钥:MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEp7n7b1zt2XjNCW5CNrRu9pjH3Xep1mI4SufUs6eJQ4TMrgCYp4sTJDH5qMNw73E7tHfoL+kDx+3miUDGWm71Gg==
+
+CFCA:{
+  私钥: MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQg0R6BbZZeK++i8MFM72GQMQ8vZKpPg3YWHR1mSDEulrWgCgYIKoEcz1UBgi2hRANCAATmrDkcCyGrN4NlQQdAeAEHh6UbJGH19u2P+1n65FYJpDVsAXlEwoNZrBbwlu9TVH8JAbuTDaTAA/5rVfuEqOkq
+公钥:MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAE5qw5HAshqzeDZUEHQHgBB4elGyRh9fbtj/tZ+uRWCaQ1bAF5RMKDWawW8JbvU1R/CQG7kw2kwAP+a1X7hKjpKg==
+}
+
+
+- app_key: 应用标识
+- aes_secret_key: 应用密钥。当认证鉴权机制为RSA时请忽略该项;当认证鉴权机制为对称、Basic时需要提供
+- yop_public_key: YOP平台公钥,当认证鉴权机制为非对称时需要提供,不需要修改
+    - store_type: 存储类型,目前仅支持string
+    - cert_type: RSA2048/RSA4096
+    - value: 密钥文本
+- yop_cert_store:
+	- enable: true/false,默认true,是否将YOP国密证书存储本地
+	- path: /path/to/be/store/in 存储路径,默认值:/tmp/yop/certs,请确保该路径有赋予读写权限
+
+- isv_private_key(list): ISV 私钥,当认证鉴权机制为非对称时需要提供
+    - store_type:
+        - string: 密钥文本
+        - file_p12: p12格式的密钥文件
+    - cert_type: RSA2048/SM2
+    - value: 如果store_type为string,则该值为密钥文本;如果store_type为file_*,则该值为密钥文件路径
+    - password: 如果p12需要密码
+
+- isv_encrypt_key(list): ISV 对称加密密钥,用于解密平台证书和商户通知,配置多个时按顺序重试
+    - store_type: 存储类型,目前仅支持string
+    - cert_type: SM4,目前仅支持该算法
+    - value: 密钥文本
+
+- httpclient:
+    - connect_timeout: 全局连接超时,默认值:30*1000
+    - read_timeout: 全局读取超时时间,默认值:30*1000
+    - max_connections: 最大连接数,默认值:50
+- server_root: 同步API请求地址。默认值:https://openapi.yeepay.com/yop-center
+- yos_server_root: YOS API 请求地址。默认值:https://yos.yeepay.com/yop-center
+- async_server_root: 异步API请求地址。默认值:https://asyncapi.yeepay.com/yop-center
+- proxy:
+    - host: 代理服务器IP
+    - port:  代理服务器端口,默认值:-1
+    - username: 代理账号
+    - password: 代理密码
+    - domain: 代理域
+    - workstation: 代理工作站
+- protocol_version: 协议版本,默认:yop-auth-v2
+- config_version: 配置文件版本
+*/

BIN
framework/src/main/resources/demo.jpeg


+ 34 - 0
framework/src/main/resources/payConfig.properties

@@ -0,0 +1,34 @@
+pay.serviceType = wxpub_pay
+pay.mchId = 200111010000
+pay.interfaceVersion = V3.1
+pay.inputCharset = UTF-8
+pay.signType = RSA-S
+pay.notifyUrl = test
+pay.secondMerchantId =
+pay.publicKey = MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDJOWwS6NLWdyWFVO+/wZdRQEhutP+ZT39UK7Hq21RmBrJeGmnxOOHVdL3Fc7D+vfYS4VIJDNoLbJPfid9zZmDGf2yCRQxw6Ixkr/4LVwQGhtrhFeuh1g3CFtg5Cd7yQn07tBuLN6vFH5+UzOJqetcrFM3JXFcDY6rZ6Lybkug0rwIDAQAB
+pay.payUrl = https://api.dinpay.com/gateway/api/pay
+pay.secret = MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAMk5bBLo0tZ3JYVU77/Bl1FASG60/5lPf1QrserbVGYGsl4aafE44dV0vcVzsP699hLhUgkM2gtsk9+J33NmYMZ/bIJFDHDojGSv/gtXBAaG2uEV66HWDcIW2DkJ3vJCfTu0G4s3q8Ufn5TM4mp61ysUzclcVwNjqtnovJuS6DSvAgMBAAECgYAWOG4TxHwLzMpq5881yKXyBfw5pWkYP+wamlyiR6gRQCoQNDCAv7xIewS9uiHQb5+txA3wC+hEHLBTngD72FFVR+j+c67256W7F0fTYBxHu3Ip5RKMwmYXZbv4R1izySZ5VmnuJJu/RAChTmLynGK1JyWxdtmxJ/obUL48JlQc4QJBAO8i7+cLia5vDjsh25o8fnQFWy+dujOXpyM6zctl5jo4Q+Oy92ou2LwUi0+GKENh6hQJ3zy4kpGDk7SIJ3+k1FECQQDXahFDq7POqXZmCpvppUKJ1ctCXdQ3Wtbc/4KLTitX4vclXej/wgxXGGE3T7N4vyqCqcl9Wpf0vVrVB6yMFzj/AkEA1NA/tVr0PTMB9CfOefVKB9BYdQimE5HroROM320gtUErUbEMNAfaw454592ZaVXy7cBXVX9gmHUC9s+Qbyzt8QJBAKYO3Ro2jdj9aAlHmmNmA0IwLo2NuV+mxkX9LkxnSSBqFa2XlFs84rhtUdwKs8acT5AEhQ/+O2/uXMwmK0yfRk8CQA2y5vDglr+VwMTLbggH3oDjv/xgnNLyAr5hiikFWAQ8jH9uuPoM00O910xDAysjoZx8q9uhf4lp0o927WLfqdo=
+
+
+#yee-pay.parentMerchantNo = 10086066206
+#yee-pay.merchantNo = 10086066206
+
+yee-pay.parentMerchantNo = 10086062555
+yee-pay.merchantNo = 10086062555
+yee-pay.sm4Key = U1FjWERFSFl5M1NlczYzaQ==
+yee-pay.weChatConfigAddUrl = /rest/v2.0/aggpay/wechat-config/add
+yee-pay.weChatConfigQueryUrl = /rest/v2.0/aggpay/wechat-config/query
+yee-pay.prePayUrl = /rest/v1.0/aggpay/pre-pay
+yee-pay.transferOrderUrl = /rest/v1.0/account/pay/order
+yee-pay.queryTransferOrderUrl = /rest/v1.0/account/pay/query
+yee-pay.payNotify = https://music.nanyue6688.com/ldt/api/yeePay/notify
+yee-pay.transferNotify = https://music.nanyue6688.com/ldt/api/yeePay/transfer/notify
+yee-pay.batchTransferNotify = https://music.nanyue6688.com/ldt/api/yeePay/batchTransfer/notify
+yee-pay.gatewayNotify = https://music.nanyue6688.com/ldt/api/yeePay/gateway/
+yee-pay.queryBalanceUrl = /rest/v1.0/account/accountinfos/query
+yee-pay.payGateWayUrl = /rest/v1.0/trade/order
+yee-pay.batchTransferUrl = /rest/v1.0/account/pay/batch-order
+yee-pay.appKey = app_10086062555
+yee-pay.privateKey = MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQg0R6BbZZeK++i8MFM72GQMQ8vZKpPg3YWHR1mSDEulrWgCgYIKoEcz1UBgi2hRANCAATmrDkcCyGrN4NlQQdAeAEHh6UbJGH19u2P+1n65FYJpDVsAXlEwoNZrBbwlu9TVH8JAbuTDaTAA/5rVfuEqOkq
+
+

+ 7 - 7
manager-api/src/main/resources/application.yml

@@ -26,15 +26,15 @@ spring:
   boot:
     admin:
       client:
-        url: http://127.0.0.1:8000
+        url: http://8.135.47.166:8000
   # mongodb
   data:
     mongodb:
-      host: 127.0.0.1
+      host: 8.135.47.166
       port: 27017
       database: lilishop
       username: root
-      password: lilishop
+      password: guoxin-shop
       authentication-database: admin
   #      replica-set-name: mongoreplset
   cache:
@@ -46,9 +46,9 @@ spring:
     open-in-view: false
   # Redis
   redis:
-    host: 127.0.0.1
+    host: 8.135.47.166
     port: 6379
-    password: lilishop
+    password: guoxin-shop
     lettuce:
       pool:
         # 连接池最大连接数(使用负值表示没有限制) 默认 8
@@ -77,9 +77,9 @@ spring:
       default-datasource:
         type: com.alibaba.druid.pool.DruidDataSource
         driverClassName: com.mysql.cj.jdbc.Driver
-        url: jdbc:mysql://127.0.0.1:3306/lilishop?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+        url: jdbc:mysql://8.135.47.166:3306/nanyue?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
         username: root
-        password: lilishop
+        password: guoxin-shop
         maxActive: 20
         initialSize: 5
         maxWait: 60000

+ 6 - 19
manager-api/src/main/resources/banner.txt

@@ -1,19 +1,6 @@
- ___       ___  ___       ___                 ________ ________  _______   ________  _____ ______   ___       __   ________  ________  ___  __       
-|\  \     |\  \|\  \     |\  \               |\  _____\\   __  \|\  ___ \ |\   __  \|\   _ \  _   \|\  \     |\  \|\   __  \|\   __  \|\  \|\  \     
-\ \  \    \ \  \ \  \    \ \  \  ____________\ \  \__/\ \  \|\  \ \   __/|\ \  \|\  \ \  \\\__\ \  \ \  \    \ \  \ \  \|\  \ \  \|\  \ \  \/  /|_   
- \ \  \    \ \  \ \  \    \ \  \|\____________\ \   __\\ \   _  _\ \  \_|/_\ \   __  \ \  \\|__| \  \ \  \  __\ \  \ \  \\\  \ \   _  _\ \   ___  \  
-  \ \  \____\ \  \ \  \____\ \  \|____________|\ \  \_| \ \  \\  \\ \  \_|\ \ \  \ \  \ \  \    \ \  \ \  \|\__\_\  \ \  \\\  \ \  \\  \\ \  \\ \  \ 
-   \ \_______\ \__\ \_______\ \__\              \ \__\   \ \__\\ _\\ \_______\ \__\ \__\ \__\    \ \__\ \____________\ \_______\ \__\\ _\\ \__\\ \__\
-    \|_______|\|__|\|_______|\|__|               \|__|    \|__|\|__|\|_______|\|__|\|__|\|__|     \|__|\|____________|\|_______|\|__|\|__|\|__| \|__|
-
-
-
-                                                 ___       ___  ___       ___                 ________  ___  ___  ________  ________
-                                                |\  \     |\  \|\  \     |\  \               |\   ____\|\  \|\  \|\   __  \|\   __  \
-                                                \ \  \    \ \  \ \  \    \ \  \  ____________\ \  \___|\ \  \\\  \ \  \|\  \ \  \|\  \
-                                                 \ \  \    \ \  \ \  \    \ \  \|\____________\ \_____  \ \   __  \ \  \\\  \ \   ____\
-                                                  \ \  \____\ \  \ \  \____\ \  \|____________|\|____|\  \ \  \ \  \ \  \\\  \ \  \___|
-                                                   \ \_______\ \__\ \_______\ \__\               ____\_\  \ \__\ \__\ \_______\ \__\
-                                                    \|_______|\|__|\|_______|\|__|              |\_________\|__|\|__|\|_______|\|__|
-                                                                                                \|_________|
-
+   ___   __   __   ____   _  _    _  __       _  
+  / __|  \ \ / /  |_  /  | || |  | |/ /    _ | | 
+ | (__    \ V /    / /   | __ |  | ' <    | || | 
+  \___|   _|_|_   /___|  |_||_|  |_|\_\   _\__/  
+_|"""""|_| """ |_|"""""|_|"""""|_|"""""|_|"""""| 
+"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-' 

+ 1 - 1
manager-api/src/main/resources/manager.xml

@@ -22,7 +22,7 @@
     <!--输出到elk的LOGSTASH-->
     <appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
         <!-- 配置elk日志收集 配饰的是 LOGSTASH 的地址-->
-        <destination>127.0.0.1:4560</destination>
+        <destination>8.135.47.166:4560</destination>
         <encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">
             <providers>
                 <timestamp>

+ 94 - 4
seller-api/src/main/java/cn/lili/controller/goods/GoodsStoreController.java

@@ -1,16 +1,27 @@
 package cn.lili.controller.goods;
 
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.convert.Convert;
+import cn.hutool.core.io.IoUtil;
+import cn.hutool.poi.excel.ExcelReader;
+import cn.hutool.poi.excel.ExcelUtil;
+import cn.hutool.poi.excel.ExcelWriter;
 import cn.lili.common.enums.ResultCode;
 import cn.lili.common.exception.ServiceException;
 import cn.lili.common.security.AuthUser;
 import cn.lili.common.security.context.UserContext;
 import cn.lili.common.enums.ResultUtil;
+import cn.lili.common.utils.excel.ExcelUtils;
+import cn.lili.common.utils.excel.ImportHandle;
 import cn.lili.common.vo.ResultMessage;
+import cn.lili.modules.file.enums.OssType;
+import cn.lili.modules.file.plugin.FileManagerPlugin;
 import cn.lili.modules.goods.entity.dos.Goods;
 import cn.lili.modules.goods.entity.dos.GoodsSku;
 import cn.lili.modules.goods.entity.dto.GoodsOperationDTO;
 import cn.lili.modules.goods.entity.dto.GoodsSearchParams;
 import cn.lili.modules.goods.entity.dto.GoodsSkuStockDTO;
+import cn.lili.modules.goods.entity.dto.ImportDto;
 import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;
 import cn.lili.modules.goods.entity.vos.GoodsSkuVO;
 import cn.lili.modules.goods.entity.vos.GoodsVO;
@@ -24,9 +35,13 @@ import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
+import org.springframework.web.multipart.MultipartFile;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.*;
 
 /**
  * 店铺端,商品接口
@@ -39,6 +54,9 @@ import java.util.List;
 @RequestMapping("/store/goods")
 public class GoodsStoreController {
 
+    @Autowired
+    @Qualifier(OssType.HAWEI_OBS)
+    private FileManagerPlugin fileManagerPlugin;
     //商品
     @Autowired
     private GoodsService goodsService;
@@ -98,7 +116,6 @@ public class GoodsStoreController {
     @ApiOperation(value = "新增商品")
     @PostMapping(value = "/create", consumes = "application/json", produces = "application/json")
     public ResultMessage<GoodsOperationDTO> save(@RequestBody GoodsOperationDTO goodsOperationDTO) {
-
         goodsService.addGoods(goodsOperationDTO);
         return ResultUtil.success();
     }
@@ -149,7 +166,6 @@ public class GoodsStoreController {
     @ApiOperation(value = "根据goodsId分页获取商品规格列表")
     @GetMapping(value = "/sku/{goodsId}/list")
     public ResultMessage<List<GoodsSkuVO>> getSkuByList(@PathVariable String goodsId) {
-
         return ResultUtil.data(goodsSkuService.getGoodsListByGoodsId(goodsId));
     }
 
@@ -160,4 +176,78 @@ public class GoodsStoreController {
         return ResultUtil.success();
     }
 
+    @ApiOperation(value = "批量导入商品")
+    @PostMapping(value = "/batch")
+    public ResultMessage batchImport( MultipartFile file,String categoryPath) {
+        try {
+            ExcelUtils.read(file.getInputStream(),0,new ImportHandle(categoryPath,fileManagerPlugin,goodsService));
+        } catch (Exception e) {
+            throw new ServiceException(ResultCode.GOODS_IMPORT_ERROR);
+        }
+
+        return ResultUtil.success();
+    }
+
+    @ApiOperation(value = "下载商品模板")
+    @GetMapping(value = "/fetchTemplate")
+    public void fetchTemplate(HttpServletResponse response) {
+
+        ExcelWriter writer = ExcelUtil.getWriter(true);
+
+
+        //自定义标题别名
+        Map<String,String> alias = new HashMap(){{
+            put("image","商品主图");
+            put("goodsName","商品名称");
+            put("sn","商品编号");
+            put("price","商品价格");
+            put("cost","市场价格");
+            put("weight","重量(kg)");
+            put("intro","详情");
+            put("mobileIntro","商品移动端详情");
+            put("quantity","库存");
+            put("goodsUnit","计量单位");
+            put("sellingPoint","卖点");
+            put("salesModel","销售模式");
+        }};
+
+        writer.setHeaderAlias(alias);
+        writer.setOnlyAlias(true);
+
+//        File demoImage = new File("demo.jpeg");
+//        BufferedImage bufferedImage = ImageIO.read(demoImage);
+        ImportDto demo = ImportDto.builder()
+//                .image(bufferedImage)
+                .goodsName("测试商品")
+                .cost("10")
+                .goodsUnit("个")
+                .intro("PC端描述")
+                .mobileIntro("移动端描述")
+                .price("9")
+                .quantity("99")
+                .salesModel("批发型")
+                .sn("123456789")
+                .weight("0.2")
+                .sellingPoint("好产品")
+                .build();
+
+        List<ImportDto> row = CollUtil.newArrayList(demo);
+
+        writer.write(row, true);
+        response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
+        response.setHeader("Content-Disposition","attachment;filename=template.xlsx");
+
+        ServletOutputStream out = null;
+
+        try {
+            out = response.getOutputStream();
+        } catch (IOException e) {
+           throw new ServiceException(ResultCode.GOODS_EXPORT_ERROR);
+        }
+
+        writer.flush(out, true);
+        writer.close();
+        IoUtil.close(out);
+    }
+
 }

+ 6 - 0
seller-api/src/main/resources/banner.txt

@@ -0,0 +1,6 @@
+   ___   __   __   ____   _  _    _  __       _  
+  / __|  \ \ / /  |_  /  | || |  | |/ /    _ | | 
+ | (__    \ V /    / /   | __ |  | ' <    | || | 
+  \___|   _|_|_   /___|  |_||_|  |_|\_\   _\__/  
+_|"""""|_| """ |_|"""""|_|"""""|_|"""""|_|"""""| 
+"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-' 

+ 1 - 1
seller-api/src/main/resources/logback.xml

@@ -22,7 +22,7 @@
     <!--输出到elk的LOGSTASH-->
     <appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
         <!-- 配置elk日志收集 配饰的是 LOGSTASH 的地址-->
-        <destination>127.0.0.1:4560</destination>
+        <destination>8.135.47.166:4560</destination>
         <encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">
             <providers>
                 <timestamp>