From a52b672e9ba56c45dd84180fd8dc53547d6dc902 Mon Sep 17 00:00:00 2001 From: "itheinjury@163.com" Date: Wed, 2 Mar 2022 15:17:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0,BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.properties | 2 +- .../java/cn/lili/BuyerApiApplication.java | 1 + .../passport/MemberBuyerController.java | 10 + buyer-api/src/main/resources/application.yml | 27 +- .../src/main/resources/logback-spring.xml | 17 + buyer-api/src/test/resources/application.yml | 34 +- .../java/cn/lili/CommonApiApplication.java | 1 + .../lili/controller/common/IMController.java | 2 +- common-api/src/main/resources/application.yml | 46 +-- .../src/main/resources/logback-spring.xml | 16 + config/application.yml | 50 +-- .../java/cn/lili/ConsumerApplication.java | 1 + .../lili/sucurity/ConsumerSecurityConfig.java | 18 + .../promotion/PromotionEverydayExecute.java | 29 +- consumer/src/main/resources/application.yml | 34 +- .../src/main/resources/logback-spring.xml | 18 +- .../cn/lili/common/fulu/core/MethodConst.java | 30 ++ .../common/fulu/core/http/FuluClient.java | 58 +++ .../common/fulu/core/http/IFuluClient.java | 27 ++ .../lili/common/fulu/core/utils/CardUtil.java | 47 +++ .../fulu/core/utils/DateFormatUtil.java | 19 + .../lili/common/fulu/core/utils/HttpUtil.java | 206 +++++++++++ .../lili/common/fulu/core/utils/JSONUtil.java | 41 +++ .../cn/lili/common/fulu/core/utils/Test.java | 342 ++++++++++++++++++ .../lili/common/fulu/model/CommonRequest.java | 159 ++++++++ .../common/fulu/model/InputCardOrderDto.java | 56 +++ .../fulu/model/InputDirectOrderDto.java | 213 +++++++++++ .../model/InputMatchPhoneProductListDto.java | 44 +++ .../common/fulu/model/InputOrderGetDto.java | 31 ++ .../common/fulu/model/InputPhoneOrderDto.java | 57 +++ .../common/fulu/model/InputProductDto.java | 30 ++ .../fulu/model/InputProductTemplateDto.java | 29 ++ .../fulu/model/InputTrafficOrderDto.java | 72 ++++ .../lili/common/fulu/model/InputUserDto.java | 15 + .../model/response/DefaultClientResponse.java | 46 +++ .../common/fulu/sdk/DefaultOpenApiClient.java | 129 +++++++ .../fulu/sdk/IDefaultOpenApiClient.java | 44 +++ .../properties/SmsTemplateProperties.java | 10 +- .../sensitive/SensitiveWordsFilter.java | 5 + .../java/cn/lili/common/utils/IpUtils.java | 2 +- .../modules/connect/config/AuthConfig.java | 2 +- .../modules/connect/util/AuthChecker.java | 4 +- .../modules/connect/util/GlobalAuthUtils.java | 2 +- .../lili/modules/goods/entity/dos/Goods.java | 69 ++++ .../modules/goods/service/GoodsService.java | 9 + .../goods/serviceimpl/GoodsServiceImpl.java | 30 +- .../member/mapper/FootprintMapper.java | 2 +- .../modules/member/service/MemberService.java | 6 +- .../MemberEvaluationServiceImpl.java | 8 +- .../member/serviceimpl/MemberServiceImpl.java | 5 +- .../serviceimpl/AfterSaleServiceImpl.java | 4 +- .../modules/order/order/entity/dos/Order.java | 3 + .../order/order/service/OrderService.java | 15 + .../order/serviceimpl/OrderServiceImpl.java | 79 +++- .../modules/promotion/entity/dos/Seckill.java | 3 +- .../dto/search/FullDiscountSearchParams.java | 2 +- .../service/SeckillApplyService.java | 9 + .../serviceimpl/SeckillApplyServiceImpl.java | 37 ++ .../serviceimpl/SeckillServiceImpl.java | 19 + .../serviceimpl/EsGoodsIndexServiceImpl.java | 4 +- .../serviceimpl/EsGoodsSearchServiceImpl.java | 16 + .../modules/store/entity/dos/StoreDetail.java | 11 + .../store/entity/dto/FuLuConfigureDTO.java | 23 ++ .../store/mapper/StoreDetailMapper.java | 12 + .../store/service/FreightTemplateService.java | 2 +- .../store/service/StoreDetailService.java | 15 + .../serviceimpl/StoreDetailServiceImpl.java | 18 + .../modules/system/entity/dto/ImSetting.java | 4 - .../impl/VerificationSourceServiceImpl.java | 3 +- .../java/cn/lili/ManagerApiApplication.java | 1 + .../src/main/resources/application.yml | 34 +- .../src/main/resources/logback-spring.xml | 16 + .../java/cn/lili/StoreApiApplication.java | 2 +- .../goods/GoodsStoreController.java | 117 +++++- .../settings/StoreSettingsController.java | 16 + seller-api/src/main/resources/application.yml | 35 +- .../src/main/resources/logback-spring.xml | 16 + xxl-job/application.properties | 6 +- 78 files changed, 2499 insertions(+), 178 deletions(-) create mode 100644 consumer/src/main/java/cn/lili/sucurity/ConsumerSecurityConfig.java create mode 100644 framework/src/main/java/cn/lili/common/fulu/core/MethodConst.java create mode 100644 framework/src/main/java/cn/lili/common/fulu/core/http/FuluClient.java create mode 100644 framework/src/main/java/cn/lili/common/fulu/core/http/IFuluClient.java create mode 100644 framework/src/main/java/cn/lili/common/fulu/core/utils/CardUtil.java create mode 100644 framework/src/main/java/cn/lili/common/fulu/core/utils/DateFormatUtil.java create mode 100644 framework/src/main/java/cn/lili/common/fulu/core/utils/HttpUtil.java create mode 100644 framework/src/main/java/cn/lili/common/fulu/core/utils/JSONUtil.java create mode 100644 framework/src/main/java/cn/lili/common/fulu/core/utils/Test.java create mode 100644 framework/src/main/java/cn/lili/common/fulu/model/CommonRequest.java create mode 100644 framework/src/main/java/cn/lili/common/fulu/model/InputCardOrderDto.java create mode 100644 framework/src/main/java/cn/lili/common/fulu/model/InputDirectOrderDto.java create mode 100644 framework/src/main/java/cn/lili/common/fulu/model/InputMatchPhoneProductListDto.java create mode 100644 framework/src/main/java/cn/lili/common/fulu/model/InputOrderGetDto.java create mode 100644 framework/src/main/java/cn/lili/common/fulu/model/InputPhoneOrderDto.java create mode 100644 framework/src/main/java/cn/lili/common/fulu/model/InputProductDto.java create mode 100644 framework/src/main/java/cn/lili/common/fulu/model/InputProductTemplateDto.java create mode 100644 framework/src/main/java/cn/lili/common/fulu/model/InputTrafficOrderDto.java create mode 100644 framework/src/main/java/cn/lili/common/fulu/model/InputUserDto.java create mode 100644 framework/src/main/java/cn/lili/common/fulu/model/response/DefaultClientResponse.java create mode 100644 framework/src/main/java/cn/lili/common/fulu/sdk/DefaultOpenApiClient.java create mode 100644 framework/src/main/java/cn/lili/common/fulu/sdk/IDefaultOpenApiClient.java create mode 100644 framework/src/main/java/cn/lili/modules/store/entity/dto/FuLuConfigureDTO.java diff --git a/admin/src/main/resources/application.properties b/admin/src/main/resources/application.properties index fb11be42..5f433f01 100644 --- a/admin/src/main/resources/application.properties +++ b/admin/src/main/resources/application.properties @@ -16,6 +16,6 @@ spring.mail.username=1814994716@qq.com spring.mail.password=abcdefg123456!@#$%^ # 日志文件路径 logging.file.path=lili-logs/admin -lili.data.logstash.server=192.168.2.122:4560 +lili.data.logstash.server=106.124.130.167:4560 # 文件格式 logging.pattern.file=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(${PID}){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wEx diff --git a/buyer-api/src/main/java/cn/lili/BuyerApiApplication.java b/buyer-api/src/main/java/cn/lili/BuyerApiApplication.java index fd8fe5d7..c10d84f6 100644 --- a/buyer-api/src/main/java/cn/lili/BuyerApiApplication.java +++ b/buyer-api/src/main/java/cn/lili/BuyerApiApplication.java @@ -29,6 +29,7 @@ public class BuyerApiApplication { public static void main(String[] args) { System.setProperty("es.set.netty.runtime.available.processors", "false"); + System.setProperty("rocketmq.client.logUseSlf4j","true"); SpringApplication.run(BuyerApiApplication.class, args); } } diff --git a/buyer-api/src/main/java/cn/lili/controller/passport/MemberBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/passport/MemberBuyerController.java index d3b9929e..01281f99 100644 --- a/buyer-api/src/main/java/cn/lili/controller/passport/MemberBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/passport/MemberBuyerController.java @@ -39,6 +39,16 @@ public class MemberBuyerController { private VerificationService verificationService; + @ApiOperation(value = "手机号登录") + @ApiImplicitParams({ + @ApiImplicitParam(name = "mobile", value = "手机号", required = true, paramType = "query") + }) + @PostMapping("/phoneLogin") + public ResultMessage phoneLogin(@NotNull(message = "手机号为空") @RequestParam String mobile) { + return ResultUtil.data(memberService.mobilePhoneLogin(mobile)); + } + + @ApiOperation(value = "登录接口") @ApiImplicitParams({ @ApiImplicitParam(name = "username", value = "用户名", required = true, paramType = "query"), diff --git a/buyer-api/src/main/resources/application.yml b/buyer-api/src/main/resources/application.yml index e09b5768..051f7cde 100644 --- a/buyer-api/src/main/resources/application.yml +++ b/buyer-api/src/main/resources/application.yml @@ -51,9 +51,9 @@ spring: # Redis redis: - host: 192.168.2.122 + host: 120.71.145.134 port: 6379 - password: Gb84505016 + password: ekLhvPGraSj8DGO0 lettuce: pool: # 连接池最大连接数(使用负值表示没有限制) 默认 8 @@ -72,9 +72,9 @@ spring: default-datasource: type: com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://192.168.2.126:3306/rx-shop?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&allowPublicKeyRetrieval=true&verifyServerCertificate=false&useSSL=false - username: rx-shop - password: J2xEZ42HwPXrDXt3 + url: jdbc:mysql://120.71.183.195:3306/zyt_shop?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&allowPublicKeyRetrieval=true&verifyServerCertificate=false&useSSL=false + username: zyt_shop + password: Gb84505016@zytshop maxActive: 50 initialSize: 10 maxWait: 60000 @@ -135,6 +135,7 @@ ignored: - /buyer/passport/connect/** - /buyer/members/** - /buyer/passport/member/** + - /buyer/passport/member/refresh/** - /buyer/promotion/pintuan/** - /buyer/promotion/seckill/** - /buyer/promotion/pointsGoods/** @@ -218,10 +219,10 @@ lili: admin: https://admin-b2b2c.pickmall.cn #api地址 api: - buyer: https://buyer-api.pickmall.cn - common: https://common-api.pickmall.cn - manager: https://admin-api.pickmall.cn - store: https://store-api.pickmall.cn + buyer: https://zshop-api.sx1788.cn/buyer-api + common: https://zshop-api.sx1788.cn/common-api + manager: https://zshop-api.sx1788.cn/manager-api + store: https://zshop-api.sx1788.cn/seller-api # jwt 细节设定 jwt-setting: @@ -240,7 +241,7 @@ lili: data: elasticsearch: cluster-name: elasticsearch - cluster-nodes: 192.168.2.122:9200 + cluster-nodes: 106.124.130.167:9200 index: number-of-replicas: 0 number-of-shards: 3 @@ -250,7 +251,7 @@ lili: # username: elastic # password: LiLiShopES logstash: - server: 192.168.2.122:4560 + server: 106.124.130.167:4560 rocketmq: promotion-topic: lili_promotion_topic promotion-group: lili_promotion_group @@ -271,7 +272,7 @@ lili: after-sale-topic: lili_after_sale_topic after-sale-group: lili_after_sale_group rocketmq: - name-server: 192.168.2.122:9876 + name-server: 106.124.130.167:9876 producer: group: lili_group send-message-timeout: 30000 @@ -279,7 +280,7 @@ rocketmq: xxl: job: admin: - addresses: http://192.168.2.122:9001/xxl-job-admin + addresses: http://127.0.0.1:9001/xxl-job-admin executor: appname: xxl-job-executor-lilishop address: diff --git a/buyer-api/src/main/resources/logback-spring.xml b/buyer-api/src/main/resources/logback-spring.xml index a8d0eba6..f2904dd8 100644 --- a/buyer-api/src/main/resources/logback-spring.xml +++ b/buyer-api/src/main/resources/logback-spring.xml @@ -20,6 +20,23 @@ + + ${LOG_FILE_PATH}/rocketmq.log + + ${LOG_FILE_PATH}/rocketmq/rocketmq-%d{yyyy-MM-dd}.log + 30 + 30MB + + + %d{yy-MM-dd.HH:mm:ss.SSS} [%-16t] %-5p %-22c{0} %X{ServiceId} - %m%n + + + + + + + + diff --git a/buyer-api/src/test/resources/application.yml b/buyer-api/src/test/resources/application.yml index 9da6fb8d..438da1bc 100644 --- a/buyer-api/src/test/resources/application.yml +++ b/buyer-api/src/test/resources/application.yml @@ -28,7 +28,7 @@ spring: # mongodb data: mongodb: - host: 192.168.2.122 + host: 106.124.130.167 port: 27017 database: rx-shop username: goboo @@ -39,12 +39,12 @@ spring: type: redis #amqp # rabbitmq: - # host: 192.168.2.122 + # host: 106.124.130.167 # Redis redis: - host: 192.168.2.122 + host: 120.71.145.134 port: 6379 - password: Gb84505016 + password: ekLhvPGraSj8DGO0 lettuce: pool: # 连接池最大连接数(使用负值表示没有限制) 默认 8 @@ -73,9 +73,9 @@ spring: default-datasource: type: com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://192.168.2.126:3306/rx-shop?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&allowPublicKeyRetrieval=true&verifyServerCertificate=false&useSSL=false - username: rx-shop - password: J2xEZ42HwPXrDXt3 + url: jdbc:mysql://120.71.183.195:3306/zyt_shop?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&allowPublicKeyRetrieval=true&verifyServerCertificate=false&useSSL=false + username: zyt_shop + password: Gb84505016@zytshop maxActive: 20 initialSize: 5 maxWait: 60000 @@ -213,16 +213,16 @@ lili: sk: zhNKVrJK6UPOhqIjn8AQvG37b9sz6 #域名 domain: - pc: http://192.168.2.122:8885 - wap: http://192.168.2.122:8885 - seller: http://192.168.2.122:8885 - admin: http://192.168.2.122:8885 + pc: http://106.124.130.167:8885 + wap: http://106.124.130.167:8885 + seller: http://106.124.130.167:8885 + admin: http://106.124.130.167:8885 #api地址 api: buyer: https://z171l91606.51mypc.cn - base: http://192.168.2.122:8885 - manager: http://192.168.2.122:8885 - seller: http://192.168.2.122:8885 + base: http://106.124.130.167:8885 + manager: http://106.124.130.167:8885 + seller: http://106.124.130.167:8885 # jwt 细节设定 jwt-setting: @@ -241,7 +241,7 @@ lili: data: elasticsearch: cluster-name: elasticsearch - cluster-nodes: 192.168.2.122:9200 + cluster-nodes: 106.124.130.167:9200 index: number-of-replicas: 0 number-of-shards: 3 @@ -269,7 +269,7 @@ lili: notice-send-topic: lili_send_notice_topic notice-send-group: lili_send_notice_group rocketmq: - name-server: 192.168.2.122:9876 + name-server: 106.124.130.167:9876 producer: group: lili_group send-message-timeout: 30000 @@ -277,7 +277,7 @@ rocketmq: xxl: job: admin: - addresses: http://192.168.2.122:9001/xxl-job-admin + addresses: http://127.0.0.1:9001/xxl-job-admin executor: appname: xxl-job-executor-lilishop address: diff --git a/common-api/src/main/java/cn/lili/CommonApiApplication.java b/common-api/src/main/java/cn/lili/CommonApiApplication.java index ceeefb59..b338c74e 100644 --- a/common-api/src/main/java/cn/lili/CommonApiApplication.java +++ b/common-api/src/main/java/cn/lili/CommonApiApplication.java @@ -15,6 +15,7 @@ import org.springframework.cache.annotation.EnableCaching; public class CommonApiApplication { public static void main(String[] args) { + System.setProperty("rocketmq.client.logUseSlf4j","true"); SpringApplication.run(CommonApiApplication.class, args); } diff --git a/common-api/src/main/java/cn/lili/controller/common/IMController.java b/common-api/src/main/java/cn/lili/controller/common/IMController.java index 8111f9c4..7b17801e 100644 --- a/common-api/src/main/java/cn/lili/controller/common/IMController.java +++ b/common-api/src/main/java/cn/lili/controller/common/IMController.java @@ -39,7 +39,7 @@ public class IMController { try { Setting imSettingVal = settingService.get(SettingEnum.IM_SETTING.name()); ImSetting imSetting = JSONUtil.toBean(imSettingVal.getSettingValue(), ImSetting.class); - imUrl = imSetting.getHttpUrl() + "?tenant_id=" + imSetting.getTenantId()+"&merchant_euid="; + imUrl = imSetting.getHttpUrl(); } catch (Exception e) { throw new ServiceException(ResultCode.PLATFORM_NOT_SUPPORTED_IM); } diff --git a/common-api/src/main/resources/application.yml b/common-api/src/main/resources/application.yml index 0fa3f723..9386115c 100644 --- a/common-api/src/main/resources/application.yml +++ b/common-api/src/main/resources/application.yml @@ -32,9 +32,9 @@ spring: type: redis # Redis redis: - host: 192.168.2.122 + host: 120.71.145.134 port: 6379 - password: Gb84505016 + password: ekLhvPGraSj8DGO0 lettuce: pool: # 连接池最大连接数(使用负值表示没有限制) 默认 8 @@ -63,9 +63,9 @@ spring: default-datasource: type: com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://192.168.2.126:3306/rx-shop?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&allowPublicKeyRetrieval=true&verifyServerCertificate=false&useSSL=false - username: rx-shop - password: J2xEZ42HwPXrDXt3 + url: jdbc:mysql://120.71.183.195:3306/zyt_shop?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&allowPublicKeyRetrieval=true&verifyServerCertificate=false&useSSL=false + username: zyt_shop + password: Gb84505016@zytshop maxActive: 20 initialSize: 5 maxWait: 60000 @@ -190,17 +190,17 @@ lili: #短信模版配置 sms: #登录 - LOGIN: SMS_205755300 + LOGIN: SMS_185821482 #注册 - REGISTER: SMS_205755298 + REGISTER: SMS_185821482 #找回密码 - FIND_USER: SMS_205755301 + FIND_USER: SMS_185821482 #设置密码 - UPDATE_PASSWORD: SMS_205755297 + UPDATE_PASSWORD: SMS_185821482 #支付密码 - WALLET_PASSWORD: SMS_205755301 + WALLET_PASSWORD: SMS_185821482 system: - isTestModel: true + isTestModel: false statistics: # 在线人数统计 X 小时。这里设置48,即统计过去48小时每小时在线人数 onlineMember: 48 @@ -212,16 +212,16 @@ lili: sk: zhNKVrJK6UPOhqIjn8AQvG37b9sz6 #域名 domain: - pc: https://pc.b2b2c.pickmall.cn - wap: https://m.b2b2c.pickmall.cn - store: https://store.b2b2c.pickmall.cn - admin: https://admin.b2b2c.pickmall.cn + pc: http://zbuyer.sx1788.cn/buyer + wap: http://zshop.sx1788.cn/ + store: http://zseller.sx1788.cn/login + admin: http://zmanager.sx1788.cn/login #api地址 api: - buyer: https://buyer-api.pickmall.cn - common: https://common-api.pickmall.cn - manager: https://admin-api.pickmall.cn - store: https://store-api.pickmall.cn + buyer: https://zshop-api.sx1788.cn/buyer-api + common: https://zshop-api.sx1788.cn/common-api + manager: https://zshop-api.sx1788.cn/manager-api + store: https://zshop-api.sx1788.cn/seller-api # jwt 细节设定 jwt-setting: @@ -240,7 +240,7 @@ lili: data: elasticsearch: cluster-name: elasticsearch - cluster-nodes: 192.168.2.122:9200 + cluster-nodes: 106.124.130.167:9200 index: number-of-replicas: 0 number-of-shards: 3 @@ -250,7 +250,7 @@ lili: # username: elastic # password: LiLiShopES logstash: - server: 192.168.2.122:4560 + server: 106.124.130.167:4560 rocketmq: promotion-topic: lili_promotion_topic promotion-group: lili_promotion_group @@ -269,7 +269,7 @@ lili: notice-send-topic: lili_send_notice_topic notice-send-group: lili_send_notice_group rocketmq: - name-server: 192.168.2.122:9876 + name-server: 106.124.130.167:9876 producer: group: lili_group send-message-timeout: 30000 @@ -277,7 +277,7 @@ rocketmq: xxl: job: admin: - addresses: http://192.168.2.122:9001/xxl-job-admin + addresses: http://127.0.0.1:9001/xxl-job-admin executor: appname: xxl-job-executor-lilishop address: diff --git a/common-api/src/main/resources/logback-spring.xml b/common-api/src/main/resources/logback-spring.xml index a8d0eba6..b7c9425a 100644 --- a/common-api/src/main/resources/logback-spring.xml +++ b/common-api/src/main/resources/logback-spring.xml @@ -20,6 +20,22 @@ + + ${LOG_FILE_PATH}/rocketmq.log + + ${LOG_FILE_PATH}/rocketmq/rocketmq-%d{yyyy-MM-dd}.log + 30 + 30MB + + + %d{yy-MM-dd.HH:mm:ss.SSS} [%-16t] %-5p %-22c{0} %X{ServiceId} - %m%n + + + + + + + diff --git a/config/application.yml b/config/application.yml index 84779a54..9d5cc629 100644 --- a/config/application.yml +++ b/config/application.yml @@ -28,7 +28,7 @@ spring: # mongodb data: mongodb: - host: 192.168.2.122 + host: 106.124.130.167 port: 27017 database: rx-shop username: goboo @@ -39,9 +39,9 @@ spring: type: redis # Redis redis: - host: 192.168.2.122 + host: 120.71.145.134 port: 6379 - password: Gb84505016 + password: ekLhvPGraSj8DGO0 lettuce: pool: # 连接池最大连接数(使用负值表示没有限制) 默认 8 @@ -70,9 +70,9 @@ spring: default-datasource: type: com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://192.168.2.126:3306/rx-shop?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&allowPublicKeyRetrieval=true&verifyServerCertificate=false&useSSL=false - username: rx-shop - password: J2xEZ42HwPXrDXt3 + url: jdbc:mysql://120.71.183.195:3306/zyt_shop?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&allowPublicKeyRetrieval=true&verifyServerCertificate=false&useSSL=false + username: zyt_shop + password: Gb84505016@zytshop maxActive: 50 initialSize: 20 maxWait: 60000 @@ -126,6 +126,7 @@ ignored: - /weixin/** - /source/** - /store/passport/login/** + - /store/passport/login/refresh/** - /common/common/slider/** - /common/common/sms/** - /buyer/payment/cashier/** @@ -136,6 +137,7 @@ ignored: - /buyer/passport/connect/** - /buyer/members/** - /buyer/passport/member/** + - /buyer/passport/member/refresh/** - /buyer/promotion/pintuan/** - /buyer/promotion/seckill/** - /buyer/promotion/pointsGoods/** @@ -220,18 +222,18 @@ lili: #短信模版配置 sms: #登录 - LOGIN: SMS_205755300 + LOGIN: SMS_185821482 #注册 - REGISTER: SMS_205755298 + REGISTER: SMS_185821482 #找回密码 - FIND_USER: SMS_205755301 + FIND_USER: SMS_185821482 #设置密码 - UPDATE_PASSWORD: SMS_205755297 + UPDATE_PASSWORD: SMS_185821482 #支付密码 - WALLET_PASSWORD: SMS_205755301 + WALLET_PASSWORD: SMS_185821482 system: isDemoSite: false - isTestModel: true + isTestModel: false # 脱敏级别: # 0:不做脱敏处理 # 1:管理端用户手机号等信息脱敏 @@ -249,16 +251,16 @@ lili: sk: zhNKVrJK6UPOhqIjn8AQvG37b9sz6 #域名 domain: - pc: http://192.168.2.122:8885 - wap: http://192.168.2.122:8885 - seller: http://192.168.2.122:8885 - admin: http://192.168.2.122:8885 + pc: http://106.124.130.167:8885 + wap: http://106.124.130.167:8885 + seller: http://106.124.130.167:8885 + admin: http://106.124.130.167:8885 #api地址 api: buyer: https://z171l91606.51mypc.cn - base: http://192.168.2.122:8885 - manager: http://192.168.2.122:8885 - seller: http://192.168.2.122:8885 + base: http://106.124.130.167:8885 + manager: http://106.124.130.167:8885 + seller: http://106.124.130.167:8885 # jwt 细节设定 jwt-setting: @@ -277,7 +279,7 @@ lili: data: elasticsearch: cluster-name: elasticsearch - cluster-nodes: 192.168.2.122:9200 + cluster-nodes: 106.124.130.167:9200 index: number-of-replicas: 0 number-of-shards: 3 @@ -288,7 +290,7 @@ lili: # password: LiLiShopES logstash: - server: 192.168.2.122:4560 + server: 106.124.130.167:4560 rocketmq: promotion-topic: lili_promotion_topic promotion-group: lili_promotion_group @@ -306,8 +308,10 @@ lili: notice-group: lili_notice_group notice-send-topic: lili_send_notice_topic notice-send-group: lili_send_notice_group + after-sale-topic: lili_after_sale_topic + after-sale-group: lili_after_sale_group rocketmq: - name-server: 192.168.2.122:9876 + name-server: 106.124.130.167:9876 isVIPChannel: false producer: group: lili_group @@ -316,7 +320,7 @@ rocketmq: xxl: job: admin: - addresses: http://192.168.2.122:9001/xxl-job-admin + addresses: http://127.0.0.1:9001/xxl-job-admin executor: appname: xxl-job-executor-lilishop address: diff --git a/consumer/src/main/java/cn/lili/ConsumerApplication.java b/consumer/src/main/java/cn/lili/ConsumerApplication.java index 5b0ef78c..7b695512 100644 --- a/consumer/src/main/java/cn/lili/ConsumerApplication.java +++ b/consumer/src/main/java/cn/lili/ConsumerApplication.java @@ -14,6 +14,7 @@ public class ConsumerApplication { public static void main(String[] args) { System.setProperty("es.set.netty.runtime.available.processors", "false"); + System.setProperty("rocketmq.client.logUseSlf4j","true"); SpringApplication.run(ConsumerApplication.class, args); } diff --git a/consumer/src/main/java/cn/lili/sucurity/ConsumerSecurityConfig.java b/consumer/src/main/java/cn/lili/sucurity/ConsumerSecurityConfig.java new file mode 100644 index 00000000..761290bd --- /dev/null +++ b/consumer/src/main/java/cn/lili/sucurity/ConsumerSecurityConfig.java @@ -0,0 +1,18 @@ +package cn.lili.sucurity; + +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.stereotype.Component; + +/** + * @author paulG + * @since 2022/2/18 + **/ +@Component +public class ConsumerSecurityConfig extends WebSecurityConfigurerAdapter { + + @Override + protected void configure(HttpSecurity http) throws Exception { + http.formLogin().disable(); + } +} diff --git a/consumer/src/main/java/cn/lili/timetask/handler/impl/promotion/PromotionEverydayExecute.java b/consumer/src/main/java/cn/lili/timetask/handler/impl/promotion/PromotionEverydayExecute.java index d7a3db4c..98cdea1c 100644 --- a/consumer/src/main/java/cn/lili/timetask/handler/impl/promotion/PromotionEverydayExecute.java +++ b/consumer/src/main/java/cn/lili/timetask/handler/impl/promotion/PromotionEverydayExecute.java @@ -8,6 +8,7 @@ import cn.lili.modules.system.entity.dto.SeckillSetting; import cn.lili.modules.system.entity.enums.SettingEnum; import cn.lili.modules.system.service.SettingService; import cn.lili.timetask.handler.EveryDayExecute; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.google.gson.Gson; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -44,24 +45,40 @@ public class PromotionEverydayExecute implements EveryDayExecute { */ @Override public void execute() { - //清除所以商品索引的无效促销活动 - this.esGoodsIndexService.cleanInvalidPromotion(); - //定时创建活动 - addSeckill(); + try { + //清除所有商品索引的无效促销活动 + this.esGoodsIndexService.cleanInvalidPromotion(); + } catch (Exception e) { + log.error("清楚商品索引中无效促销异常", e); + } + try { + //定时创建活动 + addSeckill(); + } catch (Exception e) { + log.error("秒杀活动添加异常", e); + } } /** * 添加秒杀活动 * 从系统设置中获取秒杀活动的配置 - * 添加30天后的秒杀活动 + * 添加明天后的秒杀活动 */ private void addSeckill() { Setting setting = settingService.get(SettingEnum.SECKILL_SETTING.name()); SeckillSetting seckillSetting = new Gson().fromJson(setting.getSettingValue(), SeckillSetting.class); + log.info("生成秒杀活动设置:{}", seckillSetting); for (int i = 1; i <= SeckillService.PRE_CREATION; i++) { Seckill seckill = new Seckill(i, seckillSetting.getHours(), seckillSetting.getSeckillRule()); - seckillService.savePromotions(seckill); + + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(Seckill::getStartTime, seckill.getStartTime()); + //如果已经存在促销,则不再次保存 + if (seckillService.list(lambdaQueryWrapper).isEmpty()) { + boolean result = seckillService.savePromotions(seckill); + log.info("生成秒杀活动参数:{},结果:{}", seckill, result); + } } } } diff --git a/consumer/src/main/resources/application.yml b/consumer/src/main/resources/application.yml index 37c977d6..f4fd5ca3 100644 --- a/consumer/src/main/resources/application.yml +++ b/consumer/src/main/resources/application.yml @@ -35,9 +35,9 @@ spring: type: redis # Redis redis: - host: 192.168.2.122 + host: 120.71.145.134 port: 6379 - password: Gb84505016 + password: ekLhvPGraSj8DGO0 lettuce: pool: # 连接池最大连接数(使用负值表示没有限制) 默认 8 @@ -66,9 +66,9 @@ spring: default-datasource: type: com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://192.168.2.126:3306/rx-shop?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&allowPublicKeyRetrieval=true&verifyServerCertificate=false&useSSL=false - username: rx-shop - password: J2xEZ42HwPXrDXt3 + url: jdbc:mysql://120.71.183.195:3306/zyt_shop?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&allowPublicKeyRetrieval=true&verifyServerCertificate=false&useSSL=false + username: zyt_shop + password: Gb84505016@zytshop maxActive: 20 initialSize: 5 maxWait: 60000 @@ -209,16 +209,16 @@ lili: sk: zhNKVrJK6UPOhqIjn8AQvG37b9sz6 #域名 domain: - pc: https://pc.b2b2c.pickmall.cn - wap: https://m.b2b2c.pickmall.cn - store: https://store.b2b2c.pickmall.cn - admin: https://admin.b2b2c.pickmall.cn + pc: http://zbuyer.sx1788.cn/buyer + wap: http://zshop.sx1788.cn/ + store: http://zseller.sx1788.cn/login + admin: http://zmanager.sx1788.cn/login #api地址 api: - buyer: https://buyer-api.pickmall.cn - common: https://common-api.pickmall.cn - manager: https://admin-api.pickmall.cn - store: https://store-api.pickmall.cn + buyer: https://zshop-api.sx1788.cn/buyer-api + common: https://zshop-api.sx1788.cn/common-api + manager: https://zshop-api.sx1788.cn/manager-api + store: https://zshop-api.sx1788.cn/seller-api # jwt 细节设定 jwt-setting: @@ -237,7 +237,7 @@ lili: data: elasticsearch: cluster-name: elasticsearch - cluster-nodes: 192.168.2.122:9200 + cluster-nodes: 106.124.130.167:9200 index: number-of-replicas: 0 number-of-shards: 3 @@ -247,7 +247,7 @@ lili: # username: elastic # password: LiLiShopES logstash: - server: 192.168.2.122:4560 + server: 106.124.130.167:4560 rocketmq: promotion-topic: lili_promotion_topic promotion-group: lili_promotion_group @@ -268,7 +268,7 @@ lili: after-sale-topic: lili_after_sale_topic after-sale-group: lili_after_sale_group rocketmq: - name-server: 192.168.2.122:9876 + name-server: 106.124.130.167:9876 producer: group: lili_group send-message-timeout: 30000 @@ -276,7 +276,7 @@ rocketmq: xxl: job: admin: - addresses: http://192.168.2.122:9001/xxl-job-admin + addresses: http://127.0.0.1:9001/xxl-job-admin executor: appname: xxl-job-executor-lilishop address: diff --git a/consumer/src/main/resources/logback-spring.xml b/consumer/src/main/resources/logback-spring.xml index fddde5c5..b7c9425a 100644 --- a/consumer/src/main/resources/logback-spring.xml +++ b/consumer/src/main/resources/logback-spring.xml @@ -20,6 +20,22 @@ + + ${LOG_FILE_PATH}/rocketmq.log + + ${LOG_FILE_PATH}/rocketmq/rocketmq-%d{yyyy-MM-dd}.log + 30 + 30MB + + + %d{yy-MM-dd.HH:mm:ss.SSS} [%-16t] %-5p %-22c{0} %X{ServiceId} - %m%n + + + + + + + @@ -34,7 +50,7 @@ {"appName":"${APP_NAME}"} - + diff --git a/framework/src/main/java/cn/lili/common/fulu/core/MethodConst.java b/framework/src/main/java/cn/lili/common/fulu/core/MethodConst.java new file mode 100644 index 00000000..29776531 --- /dev/null +++ b/framework/src/main/java/cn/lili/common/fulu/core/MethodConst.java @@ -0,0 +1,30 @@ +package cn.lili.common.fulu.core; + +/** + * @Auther: chenYing + * @Date: 2019/8/26 0026 15:08 + */ +public interface MethodConst { + //卡密下单接口method方法 + String OPEN_API_CARD_ORDER_ADD = "fulu.order.card.add"; + // 根据话费查询归属地和城市编码,面值,城市等信息 + String OPEN_API_CHECK_PHONE = "fulu.mobile.info.get"; + // 直充下单接口method方法 + String OPEN_API_DIRECT_ORDER_ADD = "fulu.order.direct.add"; + // 获取商品信息接口method方法 + String OPEN_API_GOODS_GET = "fulu.goods.info.get"; + // 获取商品模板信息接口method方法 + String OPEN_API_GOODS_TEMPLATE_GET = "fulu.goods.template.get"; + // 查单接口method方法 + String OPEN_API_ORDER_GET = "fulu.order.info.get"; + // 话费下单接口method方法 + String OPEN_API_PHONE_ORDER_ADD = "fulu.order.mobile.add"; + // 流量下单接口method方法 + String OPEN_API_TRAFFIC_ORDER_ADD = "fulu.order.data.add"; + // 获取用户信息接口method方法 + String OPEN_API_USER_INFO_GET = "fulu.user.info.get"; + //获取商品列表method方法 + String OPEN_API_GOODS_LIST = "fulu.goods.list.get"; + + +} diff --git a/framework/src/main/java/cn/lili/common/fulu/core/http/FuluClient.java b/framework/src/main/java/cn/lili/common/fulu/core/http/FuluClient.java new file mode 100644 index 00000000..0b0d38aa --- /dev/null +++ b/framework/src/main/java/cn/lili/common/fulu/core/http/FuluClient.java @@ -0,0 +1,58 @@ +package cn.lili.common.fulu.core.http; + + +import cn.lili.common.fulu.core.utils.HttpUtil; + +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +/** + * @Auther: chenYing + * @Date: 2019/8/19 0019 16:16 + */ +public class FuluClient implements IFuluClient { + private static volatile ExecutorService executor; + private String url; + + public FuluClient() { + this.url = "http://openapi.fulu.com/api/getway"; + } + + public FuluClient(String url) { + this.url = url; + } + + /** + * 创建线程池 + */ + private static void createThreadPool() { + if (executor == null) { + synchronized (FuluClient.class) { + if (executor == null) { + executor = Executors.newCachedThreadPool(); + } + } + + } + } + + @Override + public String send(final String postData) { + String result = HttpUtil.sendPostJson(this.url, postData); + return result; + } + + @Override + public Future sendAsync(final String postData) { + createThreadPool(); + return executor.submit(new Callable() { + @Override + public String call() throws Exception { + String result = HttpUtil.sendPostJson(url, postData); + return result; + } + }); + } +} diff --git a/framework/src/main/java/cn/lili/common/fulu/core/http/IFuluClient.java b/framework/src/main/java/cn/lili/common/fulu/core/http/IFuluClient.java new file mode 100644 index 00000000..23525ec2 --- /dev/null +++ b/framework/src/main/java/cn/lili/common/fulu/core/http/IFuluClient.java @@ -0,0 +1,27 @@ +package cn.lili.common.fulu.core.http; + +import java.util.concurrent.Future; + +/** + * @Auther: chenYing + * @Date: 2019/8/19 0019 16:15 + */ +public interface IFuluClient { + /** + * 同步请求openapi2.0 + * + * @param postData + * @return String + */ + String send(final String postData); + + + /** + * 异步请求openapi2.0 + * + * @param postData + * @return Future + */ + Future sendAsync(final String postData); + +} diff --git a/framework/src/main/java/cn/lili/common/fulu/core/utils/CardUtil.java b/framework/src/main/java/cn/lili/common/fulu/core/utils/CardUtil.java new file mode 100644 index 00000000..f0a354f9 --- /dev/null +++ b/framework/src/main/java/cn/lili/common/fulu/core/utils/CardUtil.java @@ -0,0 +1,47 @@ +package cn.lili.common.fulu.core.utils; + +import javax.crypto.Cipher; +import javax.crypto.spec.SecretKeySpec; +import java.security.Security; + +/** + * @Auther: chenYing + * @Date: 2019/8/27 0027 17:38 + */ +public class CardUtil { + private static final String ALGORITHM = "AES/ECB/PKCS7Padding"; + + + private CardUtil() { + } + + public static String cardDecode(String str, byte[] key) { + byte[] bytes = org.apache.commons.codec.binary.Base64.decodeBase64(str); + String result = null; + try { + Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); + Cipher cipher = Cipher.getInstance(ALGORITHM, "BC"); + SecretKeySpec keySpec = new SecretKeySpec(key, "AES"); + cipher.init(Cipher.DECRYPT_MODE, keySpec); + byte[] decoded = cipher.doFinal(bytes); + result = new String(decoded, "UTF-8"); + } catch (Exception e) { + throw new RuntimeException(e.getMessage(), e); + } + return result; + } + + public static String cardEncode(String str, byte[] key) { + byte[] result = null; + try { + Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); + Cipher cipher = Cipher.getInstance(ALGORITHM, "BC"); + SecretKeySpec keySpec = new SecretKeySpec(key, "AES"); + cipher.init(Cipher.ENCRYPT_MODE, keySpec); + result = cipher.doFinal(str.getBytes("UTF-8")); + } catch (Exception e) { + throw new RuntimeException(e.getMessage(), e); + } + return new String(org.apache.commons.codec.binary.Base64.encodeBase64(result)); + } +} diff --git a/framework/src/main/java/cn/lili/common/fulu/core/utils/DateFormatUtil.java b/framework/src/main/java/cn/lili/common/fulu/core/utils/DateFormatUtil.java new file mode 100644 index 00000000..c4070685 --- /dev/null +++ b/framework/src/main/java/cn/lili/common/fulu/core/utils/DateFormatUtil.java @@ -0,0 +1,19 @@ +package cn.lili.common.fulu.core.utils; + +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * @Auther: chenYing + * @Date: 2019/8/19 0019 15:17 + */ +public class DateFormatUtil { + private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"; + + private DateFormatUtil() { + } + + public static String currentDateTime() { + return new SimpleDateFormat(DATE_FORMAT).format(new Date()); + } +} diff --git a/framework/src/main/java/cn/lili/common/fulu/core/utils/HttpUtil.java b/framework/src/main/java/cn/lili/common/fulu/core/utils/HttpUtil.java new file mode 100644 index 00000000..e2aa04e7 --- /dev/null +++ b/framework/src/main/java/cn/lili/common/fulu/core/utils/HttpUtil.java @@ -0,0 +1,206 @@ +package cn.lili.common.fulu.core.utils; + + +import org.apache.http.HttpResponse; +import org.apache.http.NameValuePair; +import org.apache.http.client.HttpClient; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.protocol.HTTP; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.net.*; +import java.util.*; + +/** + * @author cheny + */ +public class HttpUtil { + private static Logger log = LoggerFactory.getLogger(HttpUtil.class); + + public final static int CONNECT_TIMEOUT = 10000; + public final static int READ_TIMEOUT = 10000; + + private static final String ENCODING_GBK = "GBK"; + + /** + * POST请求,json字符串形式数据 + * + * @param url 请求地址 + * @param param 请求的json数据 + * @return response body + * @throws Exception + */ + public static String sendPostJson(String url, String param) { + return sendPostWithHeads(url, param, "application/json", null); + } + + private static String sendPostWithHeads(String url, String param, String contentType, Map heads) { + PrintWriter out = null; + BufferedReader in = null; + StringBuilder result = new StringBuilder(); + HttpURLConnection conn = null; + + try { + URL realUrl = new URL(url); + // 打开和URL之间的连接 + conn = (HttpURLConnection) realUrl.openConnection(); + // 设置通用的请求属性 + conn.setRequestMethod("POST");// 提交模式 + conn.setConnectTimeout(CONNECT_TIMEOUT);// 连接超时 单位毫秒 + conn.setReadTimeout(READ_TIMEOUT);// 读取超时 单位毫秒 + if (contentType != null && !contentType.isEmpty()) { + conn.setRequestProperty("Content-Type", contentType); + } + conn.setRequestProperty("accept", "*/*"); + conn.setRequestProperty("connection", "Keep-Alive"); + conn.setRequestProperty("user-agent", + "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36"); + + // 添加头信息 + if (heads != null && !heads.isEmpty()) { + for (String key : heads.keySet()) { + conn.setRequestProperty(key, heads.get(key)); + } + } + + // 发送POST请求必须设置如下两行 + conn.setDoOutput(true); + conn.setDoInput(true); + // 获取URLConnection对象对应的输出流 + out = new PrintWriter(conn.getOutputStream()); + // 发送请求参数 + out.print(param); + // flush输出流的缓冲 + out.flush(); + // 定义BufferedReader输入流来读取URL的响应 + in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8")); + String line; + while ((line = in.readLine()) != null) { + result.append(line); + } + } catch (Exception e) { + e.printStackTrace(); + throw new RuntimeException("send POST request exception :" + e.getMessage(), e); + } finally { + try { + if (out != null) { + out.close(); + } + if (in != null) { + in.close(); + } + if (conn != null) { + conn.disconnect(); + } + } catch (Exception e2) { + throw new RuntimeException("close Connection exception :" + e2.getMessage(), e2); + } + } + return result.toString(); + } + + /** + * POST请求,String字符串形式数据 + * + * @param url + * @param paramXmlStr + * @return + */ + public static String sendPostXmlStr(String url, String paramXmlStr) { + String tmpparamXmlStr = ""; + try { + tmpparamXmlStr = URLEncoder.encode(paramXmlStr, ENCODING_GBK); + tmpparamXmlStr = sendPostWithHeads(url, tmpparamXmlStr, "application/xml", null); + tmpparamXmlStr = URLDecoder.decode(tmpparamXmlStr,ENCODING_GBK); + + }catch (Exception e){ + e.printStackTrace(); + log.error("post请求URL数据转码报错,{}", e.getMessage()); + } + return tmpparamXmlStr; + } + + + + /** + * POST请求,String字符串形式数据 + * + * @param url + * @param paramXmlStr + * @return + */ + public static String sendPostXmlUrlencode(String url, String paramXmlStr) { + String tmpparamXmlStr = ""; + Map rspMap = new LinkedHashMap<>(); + rspMap.put("req", paramXmlStr); + + try { + tmpparamXmlStr = URLEncoder.encode(paramXmlStr, ENCODING_GBK); + tmpparamXmlStr = doPostMapParams(url, rspMap); + tmpparamXmlStr = URLDecoder.decode(tmpparamXmlStr,ENCODING_GBK); + }catch (Exception e){ + e.printStackTrace(); + log.error("post请求URL数据转码报错,{}", e.getMessage()); + } + return tmpparamXmlStr; + } + + /** + * 发送POST请求 + * @param url String对象为 目的地址 + * @param parameters 请求参数,Map类型。 + * @return 远程响应结果 + */ + public static String doPostMapParams(String url, Map parameters) { + + BufferedReader in = null; + try { + // 定义HttpClient + HttpClient client = new DefaultHttpClient(); + // 实例化HTTP方法 + HttpPost request = new HttpPost(); + request.setURI(new URI(url)); + + //设置参数 + List nvps = new ArrayList(); + for (Iterator iter = parameters.keySet().iterator(); iter.hasNext();) { + String name = (String) iter.next(); + String value = String.valueOf(parameters.get(name)); + nvps.add(new BasicNameValuePair(name, value)); + } + request.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8)); + + HttpResponse response = client.execute(request); + int code = response.getStatusLine().getStatusCode(); + if(code == 200){ //请求成功 + in = new BufferedReader(new InputStreamReader(response.getEntity() + .getContent(),"UTF-8")); + StringBuffer sb = new StringBuffer(""); + String line = ""; + String NL = System.getProperty("line.separator"); + while ((line = in.readLine()) != null) { + sb.append(line + NL); + } + + in.close(); + return sb.toString(); + }else{ + System.out.println("状态码:" + code); + return null; + } + } + catch(Exception e) { + e.printStackTrace(); + return null; + } + } + + +} diff --git a/framework/src/main/java/cn/lili/common/fulu/core/utils/JSONUtil.java b/framework/src/main/java/cn/lili/common/fulu/core/utils/JSONUtil.java new file mode 100644 index 00000000..db35392f --- /dev/null +++ b/framework/src/main/java/cn/lili/common/fulu/core/utils/JSONUtil.java @@ -0,0 +1,41 @@ +package cn.lili.common.fulu.core.utils; + +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; + +public class JSONUtil { + private static Gson gson = new Gson(); + + /** + * 将 JSON 字符串转为 Java 对象 + */ + public static T fromJSON(String json, Class type) { + T obj; + try { + obj = gson.fromJson(json, type); + } catch (Exception e) { + throw new RuntimeException(e); + } + return obj; + } + + /** + * json字符串转list或者map + */ + public static T fromJSON(String json, TypeToken typeToken) { + return gson.fromJson(json, typeToken.getType()); + } + + /** + * 将 Java 对象转为 JSON 字符串 + */ + public static String toJSON(T obj) { + String jsonStr; + try { + jsonStr = gson.toJson(obj); + } catch (Exception e) { + throw new RuntimeException(e); + } + return jsonStr; + } +} diff --git a/framework/src/main/java/cn/lili/common/fulu/core/utils/Test.java b/framework/src/main/java/cn/lili/common/fulu/core/utils/Test.java new file mode 100644 index 00000000..cc75c73b --- /dev/null +++ b/framework/src/main/java/cn/lili/common/fulu/core/utils/Test.java @@ -0,0 +1,342 @@ +package cn.lili.common.fulu.core.utils; + +import cn.lili.common.fulu.core.MethodConst; +import cn.lili.common.fulu.model.*; +import cn.lili.common.fulu.sdk.DefaultOpenApiClient; +import cn.lili.modules.store.entity.dto.FuLuConfigureDTO; +import com.alibaba.fastjson.JSON; +import com.google.gson.reflect.TypeToken; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.*; +import java.util.concurrent.*; + +public class Test { + private final static String APP_KEY = "lzHi7ewuTkplx2ePX0eQzN65TIFRk1zFClcoj1Jim/MHmu0X7ZqxMtSLENhvr1xD"; + private final static Logger LOGGER = LoggerFactory.getLogger(Test.class); + private final static String SYS_SECRET = "9da68b0f8bcb470e84c3d30e343727e2"; + private final static String URL = "http://openapi.fulu.com/api/getway"; + +// private final static String APP_KEY = "i4esv1l+76l/7NQCL3QudG90Fq+YgVfFGJAWgT+7qO1Bm9o/adG/1iwO2qXsAXNB"; +// private final static Logger LOGGER = LoggerFactory.getLogger(Test.class); +// private final static String SYS_SECRET = "0a091b3aa4324435aab703142518a8f7"; +// private final static String URL = "http://pre.openapi.fulu.com/api/getway"; + + private static String repeat(String ch, int num) { + StringBuilder str = new StringBuilder(); + for (int i = 0; i < num; i++) { + str.append(ch); + } + return str.toString(); + } + + private static void waitFor(Future future) throws Exception { + while (!future.isDone()) { + TimeUnit.MILLISECONDS.sleep(500); + } + LOGGER.info("excuteAsync:\n{}", future.get()); + } + + /** + * 卡密下单 + * + * @throws Exception + */ + public static void cardOrderAddTest(FuLuConfigureDTO fuLuConfigureDTO, Integer productId, Integer buyNum,String orderSn) throws Exception { + LOGGER.info("\n卡密下单{}", repeat("=", 100)); + DefaultOpenApiClient client = + new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_CARD_ORDER_ADD); + InputCardOrderDto dto = new InputCardOrderDto(); + dto.setProductId(productId); + dto.setCustomerOrderNo(orderSn); + dto.setBuyNum(buyNum); + + client.setBizObject(dto); + LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100)); + dto.setCustomerOrderNo(UUID.randomUUID().toString()); + waitFor(client.excuteAsync()); + } + + /** + * 直充下单 + * + * @throws Exception + */ + public static void directOrderAddTest(FuLuConfigureDTO fuLuConfigureDTO, Integer productId, Integer buyNum,String qrCode,String orderSn) throws Exception { + LOGGER.info("\n直充下单{}", repeat("=", 100)); + DefaultOpenApiClient client = + new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_DIRECT_ORDER_ADD); + InputDirectOrderDto dto = new InputDirectOrderDto(); + dto.setProductId(productId); + dto.setBuyNum(buyNum); + client.setBizObject(dto); + int count = 1; + + for (String chargeAccount : Arrays.asList(qrCode)) { + dto.setChargeAccount(chargeAccount); + dto.setCustomerOrderNo(orderSn); + + LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100)); + if (count++ >= 3) { + waitFor(client.excuteAsync()); + } else { + LOGGER.info("excuteAsync:\n{}\n{}", client.excuteAsync().get(), repeat("-", 100)); + } + + } + } + + /** + * 手机号归属地 + * + * @throws Exception + */ + public void matchPhoneProducGetTest(FuLuConfigureDTO fuLuConfigureDTO) throws Exception { + LOGGER.info("\n手机号归属地{}", repeat("=", 100)); + DefaultOpenApiClient client = new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_CHECK_PHONE); + InputMatchPhoneProductListDto dto = new InputMatchPhoneProductListDto(); + dto.setFaceValue(50D); + + int count = 1; + for (String phone : Arrays.asList("15972368779", "13971553804")) { + dto.setPhone(phone); + + client.setBizObject(dto); + + LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100)); + if (count++ >= 2) { + waitFor(client.excuteAsync()); + } else { + LOGGER.info("excuteAsync:\n{}\n{}", client.excuteAsync().get(), repeat("-", 100)); + } + + } + } + + /** + * 订单查单 + * + * @throws Exception + */ + public void orderInfoGetTest(FuLuConfigureDTO fuLuConfigureDTO) throws Exception { + LOGGER.info("\n订单查单{}", repeat("=", 100)); + DefaultOpenApiClient client = new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_ORDER_GET); + InputOrderGetDto dto = new InputOrderGetDto(); + client.setBizObject(dto); + int count = 1; + + for (String customerOrderNo : Arrays + .asList("0d19f8e4-5af3-490d-a8d8-47fd457da7de", "31b6b96b-a21e-4bc4-bc0c-6e77a2ffb698")) { + dto.setCustomerOrderNo(customerOrderNo); + + LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100)); + if (count++ >= 2) { + Future future = client.excuteAsync(); + waitFor(future); + Map result = JSONUtil.fromJSON(future.get(), new TypeToken() { + }); + Map resultMap = JSONUtil.fromJSON(result.get("result"), new TypeToken>() { + }); + + List> cardList = (List>) resultMap.get("cards"); + StringBuilder decodeStr = new StringBuilder(); + for (Map map : cardList) { + decodeStr.append("card_number:").append(map.get("card_number")).append(";desc_card_number:") + .append(CardUtil.cardDecode(map.get("card_number"), SYS_SECRET.getBytes("UTF-8"))); + decodeStr.append(" card_pwd:").append(map.get("card_pwd")).append(";card_pwd:") + .append(CardUtil.cardDecode(map.get("card_pwd"), SYS_SECRET.getBytes("UTF-8"))); + decodeStr.append("\n"); + } + + System.out.println(decodeStr.toString()); + System.out.println(CardUtil.cardEncode("CD10002502019061217430016421", SYS_SECRET.getBytes("UTF-8"))); + } else { + LOGGER.info("excuteAsync:\n{}\n{}", client.excuteAsync().get(), repeat("-", 100)); + } + + } + } + + /** + * 话费下单 + * + * @throws Exception + */ + public void phoneOrderAddTest(FuLuConfigureDTO fuLuConfigureDTO) throws Exception { + LOGGER.info("\n话费下单{}", repeat("=", 100)); + DefaultOpenApiClient client = + new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_PHONE_ORDER_ADD); + InputPhoneOrderDto dto = new InputPhoneOrderDto(); + dto.setChargeValue(Double.valueOf(50)); + int count = 1; + + for (String chargePhone : Arrays.asList("15972368779", "13971553804")) { + dto.setCustomerOrderNo(UUID.randomUUID().toString()); + dto.setChargePhone(chargePhone); + client.setBizObject(dto); + + LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100)); + dto.setCustomerOrderNo(UUID.randomUUID().toString()); + if (count++ >= 2) { + waitFor(client.excuteAsync()); + } else { + LOGGER.info("excuteAsync:\n{}\n{}", client.excuteAsync().get(), repeat("-", 100)); + } + + } + } + + + /** + * 获得商品信息 + * + * @throws Exception + */ + public static Map productInfoGetTest(FuLuConfigureDTO fuLuConfigureDTO,String productIdS) throws Exception { + LOGGER.info("\n获得商品信息{}", repeat("=", 100)); + DefaultOpenApiClient client = new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_GOODS_GET); + InputProductDto dto = new InputProductDto(); + int count = 1; + Map maps = new HashMap(); + for (String productId : Arrays.asList(productIdS)) { + dto.setProductId(productId); + client.setBizObject(dto); + maps = (Map) JSON.parse(client.excute()); + LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100)); + if (count++ >= 10) { + waitFor(client.excuteAsync()); + } else { + LOGGER.info("excuteAsync:\n{}\n{}", client.excuteAsync().get(), repeat("-", 100)); + } + } + return maps; + } + + /** + * 获得商品模板信息 + * + * @throws Exception + */ + public void productTemplateGetTest(FuLuConfigureDTO fuLuConfigureDTO) throws Exception { + LOGGER.info("\n获得商品模板信息{}", repeat("=", 100)); + DefaultOpenApiClient client = + new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_GOODS_TEMPLATE_GET); + InputProductTemplateDto dto = new InputProductTemplateDto(); + dto.setTemplateId("e1dac0ea-dc86-4c9d-a778-c9e19203ecb8"); + client.setBizObject(dto); + LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100)); + waitFor(client.excuteAsync()); + } + + /** + * 流量下单 + * + * @throws Exception + */ + public void trafficOrderAddTest(FuLuConfigureDTO fuLuConfigureDTO) throws Exception { + LOGGER.info("\n流量下单{}", repeat("=", 100)); + DefaultOpenApiClient client = + new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_TRAFFIC_ORDER_ADD); + InputTrafficOrderDto dto = new InputTrafficOrderDto(); + dto.setChargeValue(Double.valueOf(1024)); + dto.setPacketKind(4); + + int count = 1; + for (String chargePhone : Arrays.asList("15972368779", "13971553804")) { + client.setBizObject(dto); + dto.setChargePhone(chargePhone); + dto.setCustomerOrderNo(UUID.randomUUID().toString()); + + LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100)); + dto.setCustomerOrderNo(UUID.randomUUID().toString()); + if (count++ >= 2) { + waitFor(client.excuteAsync()); + } else { + LOGGER.info("excuteAsync:\n{}\n{}", client.excuteAsync().get(), repeat("-", 100)); + } + + } + } + + /** + * 用户信息 + * + * @throws Exception + */ + public static void userInfoGetTest(FuLuConfigureDTO fuLuConfigureDTO) throws Exception { + LOGGER.info("\n用户信息{}", repeat("=", 100)); + DefaultOpenApiClient client = + new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_USER_INFO_GET); + InputUserDto dto = new InputUserDto(); + client.setBizObject(dto); + + LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100)); + waitFor(client.excuteAsync()); + } + + + /** + * 用户信息:高并发场景 + * + * @throws Exception + */ + public static void userInfoGetTest2(FuLuConfigureDTO fuLuConfigureDTO) throws Exception { + LOGGER.info("\n用户信息:高并发场景{}", repeat("=", 100)); + Executor executor = Executors.newCachedThreadPool(); + + final int count = 10; + final CountDownLatch downLatch = new CountDownLatch(count); + + for (int i = 0; i < count; ++i) { + executor.execute(new Runnable() { + @Override + public void run() { + try { + String name = Thread.currentThread().getName(); + LOGGER.info("\n线程名:{}{}", name, repeat("+", 100)); + + DefaultOpenApiClient client = + new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_USER_INFO_GET); + InputUserDto dto = new InputUserDto(); + client.setBizObject(dto); + + LOGGER.info("\n线程名:{}\n{}\n{}", name, client.excute(), repeat("+", 100)); + waitFor(client.excuteAsync()); + } catch (Exception ex) { + LOGGER.error(ex.getMessage(), ex); + } finally { + downLatch.countDown(); + } + + } + }); + } + + downLatch.await(); + } + + + /* 获得商品信息列表 + * + * @throws Exception + */ + public static String getGoodsInfoList(FuLuConfigureDTO fuLuConfigureDTO) throws Exception { + LOGGER.info("\n获得商品信息{}", repeat("=", 100)); + DefaultOpenApiClient client = new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_GOODS_LIST); + InputProductDto dto = new InputProductDto(); + client.setBizObject(dto); + return client.excute().toString(); + } + + + + public static void main(String[] args) { + try { +// productInfoGetTest(); + } catch (Exception e) { + e.printStackTrace(); + } + } + +} diff --git a/framework/src/main/java/cn/lili/common/fulu/model/CommonRequest.java b/framework/src/main/java/cn/lili/common/fulu/model/CommonRequest.java new file mode 100644 index 00000000..0014c19c --- /dev/null +++ b/framework/src/main/java/cn/lili/common/fulu/model/CommonRequest.java @@ -0,0 +1,159 @@ +package cn.lili.common.fulu.model; + +import cn.lili.common.fulu.core.utils.DateFormatUtil; +import cn.lili.common.fulu.core.utils.JSONUtil; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; + +import java.io.Serializable; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +/** + * @Auther: chenYing + * @Date: 2019/8/19 0019 10:49 + */ +public class CommonRequest implements Serializable { + private static final long serialVersionUID = 2L; + + @SerializedName(value = "app_auth_token") + private String appAuthToken = ""; + @SerializedName(value = "app_key") + private String appKey; + @SerializedName(value = "biz_content") + private String bizContent = "{}"; + private transient Map bizContentMap = Collections.emptyMap(); + private String charset; + private String format; + private String method; + private String sign; + @SerializedName(value = "sign_type") + private String signType; + private String timestamp; + private String version; + + public CommonRequest() { + format = "json"; + version = "2.0"; + charset = "utf-8"; + signType = "md5"; + // timestamp = "2019-08-20 13:59:38"; + timestamp = DateFormatUtil.currentDateTime(); + } + + + public String getAppAuthToken() { + return appAuthToken; + } + + public void setAppAuthToken(String appAuthToken) { + this.appAuthToken = appAuthToken; + } + + public String getAppKey() { + return appKey; + } + + public void setAppKey(String appKey) { + this.appKey = appKey; + } + + public String getBizContent() { + if (!bizContentMap.isEmpty()) { + bizContent = JSONUtil.toJSON(bizContentMap); + } + return bizContent; + } + + /** + * 直接将变量以json格式保存 + * + * @param bizContent bizContent + */ + public void setBizContent(String bizContent) { + if (bizContent != null && !"".equals(bizContent.trim())) { + Map dataMap = JSONUtil.fromJSON(bizContent, new TypeToken>() { + }); + + if (bizContentMap.isEmpty()) { + bizContentMap = new HashMap(); + } + bizContentMap.putAll(dataMap); + + } + } + + public String getCharset() { + return charset; + } + + public void setCharset(String charset) { + this.charset = charset; + } + + public String getFormat() { + return format; + } + + public void setFormat(String format) { + this.format = format; + } + + public String getMethod() { + return method; + } + + public void setMethod(String method) { + this.method = method; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public String getSignType() { + return signType; + } + + public void setSignType(String signType) { + this.signType = signType; + } + + public String getTimestamp() { + return timestamp; + } + + public void setTimestamp(String timestamp) { + this.timestamp = timestamp; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + /** + * 以key:value形式保存,程序会转换为json格式 + * + * @param key key + * @param value value + */ + public void setBizContent(String key, Object value) { + if (bizContentMap.isEmpty()) { + bizContentMap = new HashMap(); + } + bizContentMap.put(key, value); + } + + protected Object getBizContentValue(String key) { + return bizContentMap.get(key); + } +} diff --git a/framework/src/main/java/cn/lili/common/fulu/model/InputCardOrderDto.java b/framework/src/main/java/cn/lili/common/fulu/model/InputCardOrderDto.java new file mode 100644 index 00000000..45deef51 --- /dev/null +++ b/framework/src/main/java/cn/lili/common/fulu/model/InputCardOrderDto.java @@ -0,0 +1,56 @@ +package cn.lili.common.fulu.model; + +/** + * 卡密订单input dto + * + * @Auther: chenYing + * @Date: 2019/8/19 0019 15:35 + */ +public class InputCardOrderDto extends CommonRequest { + public InputCardOrderDto() { + super(); + setMethod("fulu.order.card.add"); + } + + /** + * 购买数量 + * + * @return Integer + */ + public Integer getBuyNum() { + Object value = getBizContentValue("buy_num"); + return value != null ? Integer.valueOf(value.toString()) : null; + } + + public void setBuyNum(Integer buyNum) { + setBizContent("buy_num", buyNum); + } + + /** + * 外部订单号 + * + * @return String + */ + public String getCustomerOrderNo() { + Object value = getBizContentValue("customer_order_no"); + return value != null ? String.valueOf(value) : null; + } + + public void setCustomerOrderNo(String customerOrderNo) { + setBizContent("customer_order_no", customerOrderNo); + } + + /** + * 商品编号 + * + * @return Integer + */ + public Integer getProductId() { + Object value = getBizContentValue("product_id"); + return value != null ? Integer.valueOf(value.toString()) : null; + } + + public void setProductId(Integer productId) { + setBizContent("product_id", productId); + } +} diff --git a/framework/src/main/java/cn/lili/common/fulu/model/InputDirectOrderDto.java b/framework/src/main/java/cn/lili/common/fulu/model/InputDirectOrderDto.java new file mode 100644 index 00000000..f4cd1f0e --- /dev/null +++ b/framework/src/main/java/cn/lili/common/fulu/model/InputDirectOrderDto.java @@ -0,0 +1,213 @@ +package cn.lili.common.fulu.model; + +/** + * 直充商品订单input dto + * + * @Auther: chenYing + * @Date: 2019/8/19 0019 15:39 + */ +public class InputDirectOrderDto extends CommonRequest { + + public InputDirectOrderDto() { + super(); + setMethod("fulu.order.direct.add"); + } + + /** + * 购买数量 + * + * @return Integer + */ + public Integer getBuyNum() { + Object value = getBizContentValue("buy_num"); + return value != null ? Integer.valueOf(value.toString()) : null; + } + + public void setBuyNum(Integer buyNum) { + setBizContent("buy_num", buyNum); + } + + /** + * 充值账号 + * + * @return String + */ + public String getChargeAccount() { + Object value = getBizContentValue("charge_account"); + return value != null ? String.valueOf(value) : null; + } + + public void setChargeAccount(String chargeAccount) { + setBizContent("charge_account", chargeAccount); + } + + /** + * 充值游戏名称 + * + * @return String + */ + public String getChargeGameName() { + Object value = getBizContentValue("charge_game_name"); + return value != null ? String.valueOf(value) : null; + } + + public void setChargeGameName(String chargeGameName) { + setBizContent("charge_game_name", chargeGameName); + } + + /** + * 充值游戏区 + * + * @return String + */ + public String getChargeGameRegion() { + Object value = getBizContentValue("charge_game_region"); + return value != null ? String.valueOf(value) : null; + } + + public void setChargeGameRegion(String chargeGameRegion) { + setBizContent("charge_game_region", chargeGameRegion); + } + + /** + * 充值游戏角色 + * + * @return String + */ + public String getChargeGameRole() { + Object value = getBizContentValue("charge_game_role"); + return value != null ? String.valueOf(value) : null; + } + + public void setChargeGameRole(String chargeGameRole) { + setBizContent("charge_game_role", chargeGameRole); + } + + /** + * 充值游戏服 + * + * @return String + */ + public String getChargeGameSrv() { + Object value = getBizContentValue("charge_game_srv"); + return value != null ? String.valueOf(value) : null; + } + + public void setChargeGameSrv(String chargeGameSrv) { + setBizContent("charge_game_srv", chargeGameSrv); + } + + /** + * 下单真实Ip,区域商品要传 + * + * @return String + */ + public String getChargeIp() { + Object value = getBizContentValue("charge_ip"); + return value != null ? String.valueOf(value) : null; + } + + public void setChargeIp(String chargeIp) { + setBizContent("charge_ip", chargeIp); + } + + /** + * 充值密码,部分游戏类要传 + * + * @return String + */ + public String getChargePassword() { + Object value = getBizContentValue("charge_password"); + return value != null ? String.valueOf(value) : null; + } + + public void setChargePassword(String chargePassword) { + setBizContent("charge_password", chargePassword); + } + + /** + * 充值类型 + * + * @return String + */ + public String getChargeType() { + Object value = getBizContentValue("charge_type"); + return value != null ? String.valueOf(value) : null; + } + + public void setChargeType(String chargeType) { + setBizContent("charge_type", chargeType); + } + + /** + * 联系QQ + * + * @return String + */ + public String getContactQq() { + Object value = getBizContentValue("contact_qq"); + return value != null ? String.valueOf(value) : null; + } + + public void setContactQq(String contactQq) { + setBizContent("contact_qq", contactQq); + } + + /** + * 联系电话 + * + * @return String + */ + public String getContactTel() { + Object value = getBizContentValue("contact_tel"); + return value != null ? String.valueOf(value) : null; + } + + public void setContactTel(String contactTel) { + setBizContent("contact_tel", contactTel); + } + + /** + * 外部订单号 + * + * @return String + */ + public String getCustomerOrderNo() { + Object value = getBizContentValue("customer_order_no"); + return value != null ? String.valueOf(value) : null; + } + + public void setCustomerOrderNo(String customerOrderNo) { + setBizContent("customer_order_no", customerOrderNo); + } + + /** + * 商品编号 + * + * @return Integer + */ + public Integer getProductId() { + Object value = getBizContentValue("product_id"); + return value != null ? Integer.valueOf(value.toString()) : null; + } + + public void setProductId(Integer productId) { + setBizContent("product_id", productId); + } + + /** + * 剩余数量 + * + * @return Integer + */ + public Integer getRemainingNumber() { + Object value = getBizContentValue("remaining_number"); + return value != null ? Integer.valueOf(value.toString()) : null; + } + + public void setRemainingNumber(Integer remainingNumber) { + setBizContent("remaining_number", remainingNumber); + } + + +} diff --git a/framework/src/main/java/cn/lili/common/fulu/model/InputMatchPhoneProductListDto.java b/framework/src/main/java/cn/lili/common/fulu/model/InputMatchPhoneProductListDto.java new file mode 100644 index 00000000..e26349a3 --- /dev/null +++ b/framework/src/main/java/cn/lili/common/fulu/model/InputMatchPhoneProductListDto.java @@ -0,0 +1,44 @@ +package cn.lili.common.fulu.model; + +/** + * 手机号归属地input dto + * + * @Auther: chenYing + * @Date: 2019/8/19 0019 16:08 + */ +public class InputMatchPhoneProductListDto extends CommonRequest { + + public InputMatchPhoneProductListDto() { + super(); + setMethod("fulu.mobile.info.get"); + } + + /** + * 面值 + * + * @return Double + */ + public Double getFaceValue() { + Object value = getBizContentValue("face_value"); + return value != null ? Double.valueOf(value.toString()) : null; + } + + public void setFaceValue(Double faceValue) { + setBizContent("face_value", faceValue); + } + + /** + * 手机号 + * + * @return String + */ + public String getPhone() { + Object value = getBizContentValue("phone"); + return value != null ? String.valueOf(value) : null; + } + + public void setPhone(String phone) { + setBizContent("phone", phone); + } + +} diff --git a/framework/src/main/java/cn/lili/common/fulu/model/InputOrderGetDto.java b/framework/src/main/java/cn/lili/common/fulu/model/InputOrderGetDto.java new file mode 100644 index 00000000..bd49f83f --- /dev/null +++ b/framework/src/main/java/cn/lili/common/fulu/model/InputOrderGetDto.java @@ -0,0 +1,31 @@ +package cn.lili.common.fulu.model; + +/** + * 订单查单input dto + * + * @Auther: chenYing + * @Date: 2019/8/19 0019 15:23 + */ +public class InputOrderGetDto extends CommonRequest { + + public InputOrderGetDto() { + super(); + setMethod("fulu.order.info.get"); + } + + /** + * 外部订单号 + * + * @return String + */ + public String getCustomerOrderNo() { + Object value = getBizContentValue("customer_order_no"); + return value != null ? String.valueOf(value) : null; + } + + public void setCustomerOrderNo(String customerOrderNo) { + setBizContent("customer_order_no", customerOrderNo); + } + + +} diff --git a/framework/src/main/java/cn/lili/common/fulu/model/InputPhoneOrderDto.java b/framework/src/main/java/cn/lili/common/fulu/model/InputPhoneOrderDto.java new file mode 100644 index 00000000..ede727d0 --- /dev/null +++ b/framework/src/main/java/cn/lili/common/fulu/model/InputPhoneOrderDto.java @@ -0,0 +1,57 @@ +package cn.lili.common.fulu.model; + +/** + * 话费订单input dto + * + * @Auther: chenYing + * @Date: 2019/8/19 0019 15:31 + */ +public class InputPhoneOrderDto extends CommonRequest { + + public InputPhoneOrderDto() { + super(); + setMethod("fulu.order.mobile.add"); + } + + /** + * 充值手机号 + * + * @return String + */ + public String getChargePhone() { + Object value = getBizContentValue("charge_phone"); + return value != null ? String.valueOf(value) : null; + } + + public void setChargePhone(String chargePhone) { + setBizContent("charge_phone", chargePhone); + } + + /** + * 充值数额 + * + * @return Double + */ + public Double getChargeValue() { + Object value = getBizContentValue("charge_value"); + return value != null ? Double.valueOf(value.toString()) : null; + } + + public void setChargeValue(Double chargeValue) { + setBizContent("charge_value", chargeValue); + } + + /** + * 外部订单号 + * + * @return String + */ + public String getCustomerOrderNo() { + Object value = getBizContentValue("customer_order_no"); + return value != null ? String.valueOf(value) : null; + } + + public void setCustomerOrderNo(String customerOrderNo) { + setBizContent("customer_order_no", customerOrderNo); + } +} diff --git a/framework/src/main/java/cn/lili/common/fulu/model/InputProductDto.java b/framework/src/main/java/cn/lili/common/fulu/model/InputProductDto.java new file mode 100644 index 00000000..d1bc20d9 --- /dev/null +++ b/framework/src/main/java/cn/lili/common/fulu/model/InputProductDto.java @@ -0,0 +1,30 @@ +package cn.lili.common.fulu.model; + +/** + * 商品信息input dto + * + * @Auther: chenYing + * @Date: 2019/8/19 0019 16:04 + */ +public class InputProductDto extends CommonRequest { + + public InputProductDto() { + super(); + setMethod("fulu.goods.info.get"); + } + + /** + * 商品编号 + * + * @return String + */ + public String getProductId() { + Object value = getBizContentValue("product_id"); + return value != null ? String.valueOf(value) : null; + } + + public void setProductId(String productId) { + setBizContent("product_id", productId); + } + +} diff --git a/framework/src/main/java/cn/lili/common/fulu/model/InputProductTemplateDto.java b/framework/src/main/java/cn/lili/common/fulu/model/InputProductTemplateDto.java new file mode 100644 index 00000000..6ea77fea --- /dev/null +++ b/framework/src/main/java/cn/lili/common/fulu/model/InputProductTemplateDto.java @@ -0,0 +1,29 @@ +package cn.lili.common.fulu.model; + +/** + * 商品模板信息input dto + * + * @Auther: chenYing + * @Date: 2019/8/19 0019 16:01 + */ +public class InputProductTemplateDto extends CommonRequest { + + public InputProductTemplateDto() { + super(); + setMethod("fulu.goods.template.get"); + } + + /** + * 商品模板编号 + * + * @return String + */ + public String getTemplateId() { + Object value = getBizContentValue("template_id"); + return value != null ? String.valueOf(value) : null; + } + + public void setTemplateId(String templateId) { + setBizContent("template_id", templateId); + } +} diff --git a/framework/src/main/java/cn/lili/common/fulu/model/InputTrafficOrderDto.java b/framework/src/main/java/cn/lili/common/fulu/model/InputTrafficOrderDto.java new file mode 100644 index 00000000..332c50bf --- /dev/null +++ b/framework/src/main/java/cn/lili/common/fulu/model/InputTrafficOrderDto.java @@ -0,0 +1,72 @@ +package cn.lili.common.fulu.model; + +/** + * 流量订单input dto + * + * @Auther: chenYing + * @Date: 2019/8/19 0019 13:50 + */ +public class InputTrafficOrderDto extends CommonRequest { + + public InputTrafficOrderDto() { + super(); + setMethod("fulu.order.data.add"); + } + + /** + * 充值手机号 + * + * @return String + */ + public String getChargePhone() { + Object value = getBizContentValue("charge_phone"); + return value != null ? String.valueOf(value) : null; + } + + public void setChargePhone(String chargePhone) { + setBizContent("charge_phone", chargePhone); + } + + /** + * 充值数额(M) + * + * @return Double + */ + public Double getChargeValue() { + Object value = getBizContentValue("charge_value"); + return value != null ? Double.valueOf(value.toString()) : null; + } + + public void setChargeValue(Double chargeValue) { + setBizContent("charge_value", chargeValue); + } + + /** + * 外部订单号 + * + * @return String + */ + public String getCustomerOrderNo() { + Object value = getBizContentValue("customer_order_no"); + return value != null ? String.valueOf(value) : null; + } + + public void setCustomerOrderNo(String customerOrderNo) { + setBizContent("customer_order_no", customerOrderNo); + } + + /** + * 流量性质 1:小时 2:日 3:7天 4:月 5:季度 6:半年 7:年 + * + * @return Integer + */ + public Integer getPacketKind() { + Object value = getBizContentValue("packet_kind"); + return value != null ? Integer.valueOf(value.toString()) : null; + } + + public void setPacketKind(Integer packetKind) { + setBizContent("packet_kind", packetKind); + } + +} diff --git a/framework/src/main/java/cn/lili/common/fulu/model/InputUserDto.java b/framework/src/main/java/cn/lili/common/fulu/model/InputUserDto.java new file mode 100644 index 00000000..c94afddc --- /dev/null +++ b/framework/src/main/java/cn/lili/common/fulu/model/InputUserDto.java @@ -0,0 +1,15 @@ +package cn.lili.common.fulu.model; + +/** + * 用户信息input dto + * + * @Auther: chenYing + * @Date: 2019/8/19 0019 16:06 + */ +public class InputUserDto extends CommonRequest { + + public InputUserDto() { + super(); + setMethod("fulu.user.info.get"); + } +} diff --git a/framework/src/main/java/cn/lili/common/fulu/model/response/DefaultClientResponse.java b/framework/src/main/java/cn/lili/common/fulu/model/response/DefaultClientResponse.java new file mode 100644 index 00000000..adc0b16f --- /dev/null +++ b/framework/src/main/java/cn/lili/common/fulu/model/response/DefaultClientResponse.java @@ -0,0 +1,46 @@ +package cn.lili.common.fulu.model.response; + +/** + * 响应对象 + * + * @Auther: chenYing + * @Date: 2019/8/19 0019 15:06 + */ +public class DefaultClientResponse { + private String code; + private String message; + private String result; + private String sign; + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getResult() { + return result; + } + + public void setResult(String result) { + this.result = result; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } +} diff --git a/framework/src/main/java/cn/lili/common/fulu/sdk/DefaultOpenApiClient.java b/framework/src/main/java/cn/lili/common/fulu/sdk/DefaultOpenApiClient.java new file mode 100644 index 00000000..2363d6ab --- /dev/null +++ b/framework/src/main/java/cn/lili/common/fulu/sdk/DefaultOpenApiClient.java @@ -0,0 +1,129 @@ +package cn.lili.common.fulu.sdk; + +import cn.lili.common.fulu.core.http.FuluClient; +import cn.lili.common.fulu.core.http.IFuluClient; +import cn.lili.common.fulu.core.utils.JSONUtil; +import cn.lili.common.fulu.model.CommonRequest; +import org.apache.commons.codec.digest.DigestUtils; + +import java.util.Arrays; +import java.util.concurrent.Future; + +/** + * 默认OpenApi客户请求实现 + * + * @Auther: chenYing + * @Date: 2019/8/19 0019 16:45 + */ +public class DefaultOpenApiClient implements IDefaultOpenApiClient { + /** + * 商户AppKey + */ + private String appKey; + /** + * 业务参数 + */ + private CommonRequest bizContent; + /** + * http请求 + */ + private IFuluClient fuluClient; + /** + * 方法 + */ + private String method; + /** + * 应用秘钥 + */ + private String sysSecret; + + // public DefaultOpenApiClient(String url, String appKey, String sysSecret) { + // this.appKey = appKey; + // this.sysSecret = sysSecret; + // + // if (url == null || "".equals(url.trim())) { + // this.fuluClient = new FuluClient(); + // } else { + // this.fuluClient = new FuluClient(url); + // } + // } + + /** + * 如果url没改变,可以使用这个构造 + * + * @param appKey appKey + * @param sysSecret sysSecret + */ + // public DefaultOpenApiClient(String appKey, String sysSecret) { + // this.appKey = appKey; + // this.fuluClient = new FuluClient(); + // this.sysSecret = sysSecret; + // } + + /** + * 使用public void setBizContent(String bizContent)此方法,method不能为空,必填 + * 或者使用其它构造,调用fulu.sup.open.api.model.CommonRequest的setMethod也可以 + * + * @param url url + * @param appKey appKey + * @param sysSecret sysSecret + * @param method method + */ + public DefaultOpenApiClient(String url, String appKey, String sysSecret, String method) { + this.appKey = appKey; + this.sysSecret = sysSecret; + this.method = method; + + if (url == null || "".equals(url.trim())) { + this.fuluClient = new FuluClient(); + } else { + this.fuluClient = new FuluClient(url); + } + } + + + @Override + public String excute() { + doSign(); + return fuluClient.send(JSONUtil.toJSON(this.bizContent)); + } + + @Override + public Future excuteAsync() { + doSign(); + return fuluClient.sendAsync(JSONUtil.toJSON(this.bizContent)); + } + + @Override + public void setBizContent(String bizContent) { + this.bizContent = new CommonRequest(); + this.bizContent.setBizContent(bizContent); + this.bizContent.setAppKey(this.appKey); + this.bizContent.setMethod(this.method); + } + + @Override + public void setBizObject(CommonRequest bizModel) { + this.bizContent = bizModel; + this.bizContent.setAppKey(this.appKey); + + if (method != null && !"".equals(method)) { + this.bizContent.setMethod(this.method); + } + } + + private void doSign() { + if (bizContent.getMethod() == null || "".equals(bizContent.getMethod().trim())) { + throw new RuntimeException("param \"method\" can not blank!"); + } + + this.bizContent.setSign(null); + this.bizContent.getBizContent(); + String json = JSONUtil.toJSON(this.bizContent); + char[] charArray = json.toCharArray(); + Arrays.sort(charArray); + String signStr = new String(charArray); + signStr = String.format("%s%s", signStr, sysSecret); + this.bizContent.setSign(DigestUtils.md5Hex(signStr)); + } +} diff --git a/framework/src/main/java/cn/lili/common/fulu/sdk/IDefaultOpenApiClient.java b/framework/src/main/java/cn/lili/common/fulu/sdk/IDefaultOpenApiClient.java new file mode 100644 index 00000000..839132a7 --- /dev/null +++ b/framework/src/main/java/cn/lili/common/fulu/sdk/IDefaultOpenApiClient.java @@ -0,0 +1,44 @@ +package cn.lili.common.fulu.sdk; + + + +import cn.lili.common.fulu.model.CommonRequest; + +import java.util.concurrent.Future; + +/** + * 默认OpenApi客户请求接口 + * + * @Auther: chenYing + * @Date: 2019/8/19 0019 16:40 + */ +public interface IDefaultOpenApiClient { + + /** + * 执行请求,同步方法 + * + * @return String + */ + String excute(); + + /** + * 执行请求,异步方法 + * + * @return Future + */ + Future excuteAsync(); + + /** + * 设置业务参数 + * + * @param bizContent + */ + @Deprecated + void setBizContent(String bizContent); + + /** + * 设置业务参数 + */ + void setBizObject(CommonRequest bizModel); + +} diff --git a/framework/src/main/java/cn/lili/common/properties/SmsTemplateProperties.java b/framework/src/main/java/cn/lili/common/properties/SmsTemplateProperties.java index 55dbf7ae..36cec12c 100644 --- a/framework/src/main/java/cn/lili/common/properties/SmsTemplateProperties.java +++ b/framework/src/main/java/cn/lili/common/properties/SmsTemplateProperties.java @@ -16,21 +16,21 @@ public class SmsTemplateProperties { /** * 登录 */ - private String lOGIN = "SMS_205755300"; + private String lOGIN = "SMS_185821482"; /** * 注册 */ - private String REGISTER = "SMS_205755298"; + private String REGISTER = "SMS_185821482"; /** * 找回密码 */ - private String FIND_USER = "SMS_205755301"; + private String FIND_USER = "SMS_185821482"; /** * 设置密码 */ - private String UPDATE_PASSWORD = "SMS_205755297"; + private String UPDATE_PASSWORD = "SMS_185821482"; /** * 设置支付密码 */ - private String WALLET_PASSWORD = "SMS_205755297"; + private String WALLET_PASSWORD = "SMS_185821482"; } diff --git a/framework/src/main/java/cn/lili/common/sensitive/SensitiveWordsFilter.java b/framework/src/main/java/cn/lili/common/sensitive/SensitiveWordsFilter.java index 14f70b0c..99acf87e 100644 --- a/framework/src/main/java/cn/lili/common/sensitive/SensitiveWordsFilter.java +++ b/framework/src/main/java/cn/lili/common/sensitive/SensitiveWordsFilter.java @@ -77,6 +77,11 @@ public class SensitiveWordsFilter implements Serializable { int step = 1; //计算此位置开始2个字符的hash int hash = sp.nextTwoCharHash(i); + + //如果没有敏感词,则直接返回内容 + if (nodes.length == 0) { + return sentence; + } /* * 根据hash获取第一个节点, * 真正匹配的节点可能不是第一个, diff --git a/framework/src/main/java/cn/lili/common/utils/IpUtils.java b/framework/src/main/java/cn/lili/common/utils/IpUtils.java index 2a31a4ba..5672e934 100644 --- a/framework/src/main/java/cn/lili/common/utils/IpUtils.java +++ b/framework/src/main/java/cn/lili/common/utils/IpUtils.java @@ -55,7 +55,7 @@ public class IpUtils { } } if ("0:0:0:0:0:0:0:1".equals(ip)) { - ip = "127.0.0.1"; + ip = "106.124.130.167"; } return ip; } diff --git a/framework/src/main/java/cn/lili/modules/connect/config/AuthConfig.java b/framework/src/main/java/cn/lili/modules/connect/config/AuthConfig.java index b75b1e5a..6fd48b8a 100644 --- a/framework/src/main/java/cn/lili/modules/connect/config/AuthConfig.java +++ b/framework/src/main/java/cn/lili/modules/connect/config/AuthConfig.java @@ -77,7 +77,7 @@ public class AuthConfig { /** * 针对国外服务可以单独设置代理 * HttpConfig config = new HttpConfig(); - * config.setProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 10080))); + * config.setProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("106.124.130.167", 10080))); * config.setTimeout(15000); * * @since 1.15.5 diff --git a/framework/src/main/java/cn/lili/modules/connect/util/AuthChecker.java b/framework/src/main/java/cn/lili/modules/connect/util/AuthChecker.java index fb23837f..23337be6 100644 --- a/framework/src/main/java/cn/lili/modules/connect/util/AuthChecker.java +++ b/framework/src/main/java/cn/lili/modules/connect/util/AuthChecker.java @@ -47,9 +47,9 @@ public class AuthChecker { if (!GlobalAuthUtils.isHttpProtocol(redirectUri) && !GlobalAuthUtils.isHttpsProtocol(redirectUri)) { throw new AuthException(AuthResponseStatus.ILLEGAL_REDIRECT_URI, connectAuth); } - //支付宝在创建回调地址时,不允许使用localhost或者127.0.0.1 + //支付宝在创建回调地址时,不允许使用localhost或者106.124.130.167 if (ConnectAuthEnum.ALIPAY == connectAuth && GlobalAuthUtils.isLocalHost(redirectUri)) { - //The redirect uri of alipay is forbidden to use localhost or 127.0.0.1 + //The redirect uri of alipay is forbidden to use localhost or 106.124.130.167 throw new AuthException(AuthResponseStatus.ILLEGAL_REDIRECT_URI, connectAuth); } } diff --git a/framework/src/main/java/cn/lili/modules/connect/util/GlobalAuthUtils.java b/framework/src/main/java/cn/lili/modules/connect/util/GlobalAuthUtils.java index 2b1868b9..2acb5c35 100644 --- a/framework/src/main/java/cn/lili/modules/connect/util/GlobalAuthUtils.java +++ b/framework/src/main/java/cn/lili/modules/connect/util/GlobalAuthUtils.java @@ -171,7 +171,7 @@ public class GlobalAuthUtils { * @return true: 本地主机(域名), false: 非本地主机(域名) */ public static boolean isLocalHost(String url) { - return StringUtils.isEmpty(url) || url.contains("127.0.0.1") || url.contains("localhost"); + return StringUtils.isEmpty(url) || url.contains("106.124.130.167") || url.contains("localhost"); } diff --git a/framework/src/main/java/cn/lili/modules/goods/entity/dos/Goods.java b/framework/src/main/java/cn/lili/modules/goods/entity/dos/Goods.java index 205672c0..77ba2bc9 100644 --- a/framework/src/main/java/cn/lili/modules/goods/entity/dos/Goods.java +++ b/framework/src/main/java/cn/lili/modules/goods/entity/dos/Goods.java @@ -7,6 +7,7 @@ import cn.hutool.json.JSONUtil; import cn.lili.common.enums.ResultCode; import cn.lili.common.exception.ServiceException; import cn.lili.modules.goods.entity.dto.GoodsOperationDTO; +import cn.lili.modules.goods.entity.dto.GoodsOperationFuLuDTO; import cn.lili.modules.goods.entity.enums.GoodsStatusEnum; import cn.lili.modules.goods.entity.enums.GoodsTypeEnum; import cn.lili.mybatis.BaseEntity; @@ -143,15 +144,83 @@ public class Goods extends BaseEntity { @JsonIgnore private String params; + //福禄所需参数 + /** + * 商品编号 + */ + @Length(max = 30, message = "商品规格编号太长,不能超过30个字符") + @ApiModelProperty(value = "商品编号") + private String sn; + + /** + * 重量 + */ + @ApiModelProperty(value = "重量") + @Max(value = 99999999, message = "重量不能超过99999999") + private Double weight; public Goods() { } + /** + * 福禄 + * @param goodsOperationDTO + */ + public Goods(GoodsOperationFuLuDTO goodsOperationDTO) { + this.goodsName = goodsOperationDTO.getGoodsName(); + this.categoryPath = goodsOperationDTO.getCategoryPath(); + this.storeCategoryPath = goodsOperationDTO.getStoreCategoryPath(); + this.brandId = goodsOperationDTO.getBrandId(); + this.sn = goodsOperationDTO.getSn(); + this.price = goodsOperationDTO.getPrice(); + this.weight = goodsOperationDTO.getWeight(); + this.templateId = goodsOperationDTO.getTemplateId(); + this.recommend = goodsOperationDTO.getRecommend(); + this.sellingPoint = goodsOperationDTO.getSellingPoint(); + this.salesModel = goodsOperationDTO.getSalesModel(); + this.goodsUnit = goodsOperationDTO.getGoodsUnit(); + this.intro = goodsOperationDTO.getIntro(); + this.mobileIntro = goodsOperationDTO.getMobileIntro(); + this.goodsVideo = goodsOperationDTO.getGoodsVideo(); + this.price = goodsOperationDTO.getPrice(); + if (goodsOperationDTO.getGoodsParamsDTOList() != null && goodsOperationDTO.getGoodsParamsDTOList().isEmpty()) { + this.params = JSONUtil.toJsonStr(goodsOperationDTO.getGoodsParamsDTOList()); + } + //如果立即上架则 + this.marketEnable = Boolean.TRUE.equals(goodsOperationDTO.getRelease()) ? GoodsStatusEnum.UPPER.name() : GoodsStatusEnum.DOWN.name(); + this.goodsType = goodsOperationDTO.getGoodsType(); + this.grade = 100D; + + //循环sku,判定sku是否有效 + for (Map sku : goodsOperationDTO.getSkuList()) { + //判定参数不能为空 + if (!sku.containsKey("sn") || sku.get("sn") == null) { + throw new ServiceException(ResultCode.GOODS_SKU_SN_ERROR); + } + if (!sku.containsKey("price") || StringUtil.isEmpty(sku.get("price").toString()) || Convert.toDouble(sku.get("price")) <= 0) { + throw new ServiceException(ResultCode.GOODS_SKU_PRICE_ERROR); + } + if (!sku.containsKey("cost") || StringUtil.isEmpty(sku.get("cost").toString()) || Convert.toDouble(sku.get("cost")) <= 0) { + throw new ServiceException(ResultCode.GOODS_SKU_COST_ERROR); + } + //虚拟商品没有重量字段 + if (this.goodsType.equals(GoodsTypeEnum.PHYSICAL_GOODS.name()) && (!sku.containsKey("weight") || sku.containsKey("weight") && (StringUtil.isEmpty(sku.get("weight").toString()) || Convert.toDouble(sku.get("weight").toString()) < 0))) { + throw new ServiceException(ResultCode.GOODS_SKU_WEIGHT_ERROR); + } + if (!sku.containsKey("quantity") || StringUtil.isEmpty(sku.get("quantity").toString()) || Convert.toInt(sku.get("quantity").toString()) < 0) { + throw new ServiceException(ResultCode.GOODS_SKU_QUANTITY_ERROR); + } + + } + } + + public Goods(GoodsOperationDTO goodsOperationDTO) { this.goodsName = goodsOperationDTO.getGoodsName(); this.categoryPath = goodsOperationDTO.getCategoryPath(); this.storeCategoryPath = goodsOperationDTO.getStoreCategoryPath(); this.brandId = goodsOperationDTO.getBrandId(); + this.price = goodsOperationDTO.getPrice(); this.templateId = goodsOperationDTO.getTemplateId(); this.recommend = goodsOperationDTO.getRecommend(); this.sellingPoint = goodsOperationDTO.getSellingPoint(); diff --git a/framework/src/main/java/cn/lili/modules/goods/service/GoodsService.java b/framework/src/main/java/cn/lili/modules/goods/service/GoodsService.java index 16ac93e4..8f564650 100644 --- a/framework/src/main/java/cn/lili/modules/goods/service/GoodsService.java +++ b/framework/src/main/java/cn/lili/modules/goods/service/GoodsService.java @@ -2,6 +2,7 @@ package cn.lili.modules.goods.service; import cn.lili.modules.goods.entity.dos.Goods; import cn.lili.modules.goods.entity.dto.GoodsOperationDTO; +import cn.lili.modules.goods.entity.dto.GoodsOperationFuLuDTO; import cn.lili.modules.goods.entity.dto.GoodsSearchParams; import cn.lili.modules.goods.entity.enums.GoodsAuthEnum; import cn.lili.modules.goods.entity.enums.GoodsStatusEnum; @@ -58,6 +59,14 @@ public interface GoodsService extends IService { */ void addGoods(GoodsOperationDTO goodsOperationDTO); + + /** + * 添加福禄商品 + * + * @param goodsOperationFuLuDTO 商品查询条件 + */ + void fuLuAddGoods(GoodsOperationFuLuDTO goodsOperationFuLuDTO); + /** * 修改商品 * diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java index ee8fe200..761ed181 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java @@ -15,6 +15,7 @@ import cn.lili.modules.goods.entity.dos.Category; import cn.lili.modules.goods.entity.dos.Goods; import cn.lili.modules.goods.entity.dos.GoodsGallery; import cn.lili.modules.goods.entity.dto.GoodsOperationDTO; +import cn.lili.modules.goods.entity.dto.GoodsOperationFuLuDTO; import cn.lili.modules.goods.entity.dto.GoodsParamsDTO; import cn.lili.modules.goods.entity.dto.GoodsSearchParams; import cn.lili.modules.goods.entity.enums.GoodsAuthEnum; @@ -159,7 +160,9 @@ public class GoodsServiceImpl extends ServiceImpl implements //检查商品 this.checkGoods(goods); //向goods加入图片 - this.setGoodsGalleryParam(goodsOperationDTO.getGoodsGalleryList().get(0), goods); + if (goodsOperationDTO.getGoodsGalleryList().size() > 0 ) { + this.setGoodsGalleryParam(goodsOperationDTO.getGoodsGalleryList().get(0), goods); + } //添加商品参数 if (goodsOperationDTO.getGoodsParamsDTOList() != null && !goodsOperationDTO.getGoodsParamsDTOList().isEmpty()) { //给商品参数填充值 @@ -176,6 +179,31 @@ public class GoodsServiceImpl extends ServiceImpl implements } + @Override + @Transactional(rollbackFor = Exception.class) + public void fuLuAddGoods(GoodsOperationFuLuDTO goodsOperationDTO) { + Goods goods = new Goods(goodsOperationDTO); + //检查商品 + this.checkGoods(goods); + //向goods加入图片 + if (goodsOperationDTO.getGoodsGalleryList().size() > 0 ) { + this.setGoodsGalleryParam(goodsOperationDTO.getGoodsGalleryList().get(0), goods); + } + //添加商品参数 + if (goodsOperationDTO.getGoodsParamsDTOList() != null && !goodsOperationDTO.getGoodsParamsDTOList().isEmpty()) { + //给商品参数填充值 + goods.setParams(JSONUtil.toJsonStr(goodsOperationDTO.getGoodsParamsDTOList())); + } + //添加商品 + this.save(goods); + //添加商品sku信息 + this.goodsSkuService.add(goodsOperationDTO.getSkuList(), goods); + //添加相册 + if (goodsOperationDTO.getGoodsGalleryList() != null && !goodsOperationDTO.getGoodsGalleryList().isEmpty()) { + this.goodsGalleryService.add(goodsOperationDTO.getGoodsGalleryList(), goods.getId()); + } + } + @Override @Transactional(rollbackFor = Exception.class) public void editGoods(GoodsOperationDTO goodsOperationDTO, String goodsId) { diff --git a/framework/src/main/java/cn/lili/modules/member/mapper/FootprintMapper.java b/framework/src/main/java/cn/lili/modules/member/mapper/FootprintMapper.java index 6638d618..94b21988 100644 --- a/framework/src/main/java/cn/lili/modules/member/mapper/FootprintMapper.java +++ b/framework/src/main/java/cn/lili/modules/member/mapper/FootprintMapper.java @@ -34,7 +34,7 @@ public interface FootprintMapper extends BaseMapper { * * @param memberId 会员ID */ - @Delete("DELETE FROM li_foot_print l1 WHERE l1.id IN (" + + @Delete("DELETE FROM li_foot_print WHERE id IN (" + "SELECT l2.id FROM (" + "SELECT l3.id FROM li_foot_print l3 WHERE l3.member_id=${memberId} ORDER BY id DESC LIMIT 100,100) l2)") void deleteLastFootPrint(String memberId); diff --git a/framework/src/main/java/cn/lili/modules/member/service/MemberService.java b/framework/src/main/java/cn/lili/modules/member/service/MemberService.java index f79a123f..aaaca8c8 100644 --- a/framework/src/main/java/cn/lili/modules/member/service/MemberService.java +++ b/framework/src/main/java/cn/lili/modules/member/service/MemberService.java @@ -237,10 +237,10 @@ public interface MemberService extends IService { */ boolean updateMemberLoginTime(String memberId); - /** + /** * 获取用户VO - * @param id - * @return + * @param id 会员id + * @return 用户VO */ MemberVO getMember(String id); } \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberEvaluationServiceImpl.java b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberEvaluationServiceImpl.java index 90f7c823..393a2339 100644 --- a/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberEvaluationServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberEvaluationServiceImpl.java @@ -112,11 +112,15 @@ public class MemberEvaluationServiceImpl extends ServiceImpl impleme * @param mobilePhone 手机号 * @return 会员 */ - private Long findMember(String mobilePhone, String userName) { + private Long findMember(String userName, String mobilePhone) { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("mobile", mobilePhone) .or().eq("username", userName); @@ -624,7 +624,8 @@ public class MemberServiceImpl extends ServiceImpl impleme */ private void checkMember(String userName, String mobilePhone) { //判断手机号是否存在 - if (findMember(userName, mobilePhone) > 0) { + Long aa = findMember(userName, mobilePhone); + if (aa > 0) { throw new ServiceException(ResultCode.USER_EXIST); } } diff --git a/framework/src/main/java/cn/lili/modules/order/aftersale/serviceimpl/AfterSaleServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/aftersale/serviceimpl/AfterSaleServiceImpl.java index d86fee45..fa73ff32 100644 --- a/framework/src/main/java/cn/lili/modules/order/aftersale/serviceimpl/AfterSaleServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/order/aftersale/serviceimpl/AfterSaleServiceImpl.java @@ -273,9 +273,9 @@ public class AfterSaleServiceImpl extends ServiceImpl { */ Order getBySn(String orderSn); + /** + * 获取订单 + * + * @param receivableNo 微信支付单号 + * @return 订单信息 + */ + Order getOrderByReceivableNo(String receivableNo); + /** * 订单查询 * @@ -284,4 +292,11 @@ public interface OrderService extends IService { * @return 是否成功 */ boolean checkFictitiousOrder(String pintuanId, Integer requiredNum, Boolean fictitious); + + /** + * 验证福禄订单进行处理 + * @param tradeNo 第三方流水 + * + */ + void fuluOrder(String tradeNo); } \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderServiceImpl.java index 9abdbff3..bfa35704 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderServiceImpl.java @@ -11,19 +11,19 @@ import cn.hutool.poi.excel.ExcelWriter; import cn.lili.common.enums.PromotionTypeEnum; import cn.lili.common.enums.ResultCode; import cn.lili.common.exception.ServiceException; +import cn.lili.common.fulu.core.utils.Test; import cn.lili.common.properties.RocketmqCustomProperties; import cn.lili.common.security.OperationalJudgment; import cn.lili.common.security.context.UserContext; import cn.lili.common.security.enums.UserEnums; import cn.lili.common.utils.SnowFlake; +import cn.lili.modules.goods.entity.dos.Goods; import cn.lili.modules.goods.entity.dto.GoodsCompleteMessage; +import cn.lili.modules.goods.service.GoodsService; import cn.lili.modules.member.entity.dto.MemberAddressDTO; import cn.lili.modules.order.cart.entity.dto.TradeDTO; import cn.lili.modules.order.order.aop.OrderLogPoint; -import cn.lili.modules.order.order.entity.dos.Order; -import cn.lili.modules.order.order.entity.dos.OrderItem; -import cn.lili.modules.order.order.entity.dos.Receipt; -import cn.lili.modules.order.order.entity.dos.Trade; +import cn.lili.modules.order.order.entity.dos.*; import cn.lili.modules.order.order.entity.dto.OrderBatchDeliverDTO; import cn.lili.modules.order.order.entity.dto.OrderExportDTO; import cn.lili.modules.order.order.entity.dto.OrderMessage; @@ -41,6 +41,9 @@ import cn.lili.modules.order.trade.service.OrderLogService; import cn.lili.modules.payment.entity.enums.PaymentMethodEnum; import cn.lili.modules.promotion.entity.dos.Pintuan; import cn.lili.modules.promotion.service.PintuanService; +import cn.lili.modules.store.entity.dos.StoreDetail; +import cn.lili.modules.store.entity.dto.FuLuConfigureDTO; +import cn.lili.modules.store.service.StoreDetailService; import cn.lili.modules.system.aspect.annotation.SystemLogPoint; import cn.lili.modules.system.entity.dos.Logistics; import cn.lili.modules.system.entity.vo.Traces; @@ -55,6 +58,7 @@ import cn.lili.trigger.message.PintuanOrderMessage; import cn.lili.trigger.model.TimeExecuteConstant; import cn.lili.trigger.model.TimeTriggerMsg; import cn.lili.trigger.util.DelayQueueTools; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -142,6 +146,18 @@ public class OrderServiceImpl extends ServiceImpl implements @Autowired private TradeService tradeService; + /** + * 商品 + */ + @Autowired + private GoodsService goodsService; + + /** + * 商品 + */ + @Autowired + private StoreDetailService storeDetailService; + @Override @Transactional(rollbackFor = Exception.class) public void intoDB(TradeDTO tradeDTO) { @@ -956,4 +972,59 @@ public class OrderServiceImpl extends ServiceImpl implements throw new ServiceException(ResultCode.ORDER_TAKE_ERROR); } } + + + /** + * 获取订单 + * + * @param receivableNo 微信支付单号 + * @return 订单详情 + */ + @Override + public Order getOrderByReceivableNo(String receivableNo) { + return this.getOne(new LambdaQueryWrapper().eq(Order::getReceivableNo, receivableNo)); + } + + + /** + * 验证福禄订单进行处理 + * + * @param tradeNo 第三方流水 + */ + @Override + public void fuluOrder(String tradeNo) { + Order order = this.getOrderByReceivableNo(tradeNo); + if (order != null) { + List storeFlows = storeFlowService.list(new LambdaQueryWrapper().eq(StoreFlow::getOrderSn, order.getSn())); + if (storeFlows.size() > 0) { + Goods goods = goodsService.getById(storeFlows.get(0).getGoodsId()); + if (goods != null) { + FuLuConfigureDTO fuLuConfigureDTO = new FuLuConfigureDTO(); + StoreDetail storeDetail = storeDetailService.getOne( + new LambdaQueryWrapper() + .eq(StoreDetail::getStoreId, storeFlows.get(0).getStoreId()) + ); + + fuLuConfigureDTO.setAppSecretKey(storeDetail.getAppSecretKey()); + fuLuConfigureDTO.setMerchantNumber(storeDetail.getMerchantNumber()); + fuLuConfigureDTO.setAppMerchantKey(storeDetail.getAppMerchantKey()); + try { + if (goods.getBrandId().equals("1496301301183672321")) { + Map map1 = (Map) JSON.parse(Test.productInfoGetTest(fuLuConfigureDTO, goods.getSn()).get("result").toString()); + + if (map1.get("product_type").toString().equals("直充")) { + Test.directOrderAddTest(fuLuConfigureDTO, Integer.valueOf(goods.getSn()), order.getGoodsNum(), order.getQrCode(), order.getSn()); + } else if (map1.get("product_type").toString().equals("卡密")) { + Test.cardOrderAddTest(fuLuConfigureDTO, Integer.valueOf(goods.getSn()), order.getGoodsNum(), order.getSn()); + } else { + //不是直充也不是卡密需要修改代码 + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + } + } } \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/modules/promotion/entity/dos/Seckill.java b/framework/src/main/java/cn/lili/modules/promotion/entity/dos/Seckill.java index fbe4232d..f80c4b77 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/entity/dos/Seckill.java +++ b/framework/src/main/java/cn/lili/modules/promotion/entity/dos/Seckill.java @@ -1,6 +1,5 @@ package cn.lili.modules.promotion.entity.dos; -import cn.hutool.core.date.DateField; import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; import cn.lili.modules.promotion.entity.vos.SeckillVO; @@ -59,7 +58,7 @@ public class Seckill extends BasePromotions { public Seckill(int day, String hours, String seckillRule) { //默认创建*天后的秒杀活动 - DateTime dateTime = DateUtil.beginOfDay(DateUtil.offset(new DateTime(), DateField.DAY_OF_YEAR, day)); + DateTime dateTime = DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), day)); this.applyEndTime = dateTime; this.hours = hours; this.seckillRule = seckillRule; diff --git a/framework/src/main/java/cn/lili/modules/promotion/entity/dto/search/FullDiscountSearchParams.java b/framework/src/main/java/cn/lili/modules/promotion/entity/dto/search/FullDiscountSearchParams.java index c49c8e24..3c8d2d5d 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/entity/dto/search/FullDiscountSearchParams.java +++ b/framework/src/main/java/cn/lili/modules/promotion/entity/dto/search/FullDiscountSearchParams.java @@ -34,7 +34,7 @@ public class FullDiscountSearchParams extends BasePromotionsSearchParams impleme public QueryWrapper queryWrapper() { QueryWrapper queryWrapper = super.queryWrapper(); if (CharSequenceUtil.isNotEmpty(promotionName)) { - queryWrapper.like("title", promotionName); + queryWrapper.like("promotion_name", promotionName); } if (couponFlag != null) { queryWrapper.eq("coupon_flag", couponFlag); diff --git a/framework/src/main/java/cn/lili/modules/promotion/service/SeckillApplyService.java b/framework/src/main/java/cn/lili/modules/promotion/service/SeckillApplyService.java index 99b60133..8d67dd74 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/service/SeckillApplyService.java +++ b/framework/src/main/java/cn/lili/modules/promotion/service/SeckillApplyService.java @@ -1,6 +1,7 @@ package cn.lili.modules.promotion.service; import cn.lili.common.vo.PageVO; +import cn.lili.modules.promotion.entity.dos.Seckill; import cn.lili.modules.promotion.entity.dos.SeckillApply; import cn.lili.modules.promotion.entity.dto.search.SeckillSearchParams; import cn.lili.modules.promotion.entity.vos.SeckillApplyVO; @@ -97,4 +98,12 @@ public interface SeckillApplyService extends IService { */ void updateSeckillApplyQuantity(String seckillId, String skuId, Integer quantity); + /** + * 更新秒杀活动时间 + * + * @param seckill 秒杀活动 + * @return 是否更新成功 + */ + boolean updateSeckillApplyTime(Seckill seckill); + } \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java index a421e9e6..66071234 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java @@ -185,6 +185,7 @@ public class SeckillApplyServiceImpl extends ServiceImpl promotionGoodsList = new ArrayList<>(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(SeckillApply::getSeckillId, seckill.getId()); + List list = this.list(queryWrapper); + for (SeckillApply seckillApply : list) { + //获取参与活动的商品信息 + GoodsSku goodsSku = goodsSkuService.getGoodsSkuByIdFromCache(seckillApply.getSkuId()); + //获取促销商品 + PromotionGoods promotionGoods = this.setSeckillGoods(goodsSku, seckillApply, seckill); + promotionGoodsList.add(promotionGoods); + } + //保存促销活动商品信息 + if (!promotionGoodsList.isEmpty()) { + PromotionGoodsSearchParams searchParams = new PromotionGoodsSearchParams(); + searchParams.setPromotionType(PromotionTypeEnum.SECKILL.name()); + searchParams.setSkuIds(promotionGoodsList.stream().map(PromotionGoods::getSkuId).collect(Collectors.toList())); + promotionGoodsService.deletePromotionGoods(searchParams); + //初始化促销商品 + PromotionTools.promotionGoodsInit(promotionGoodsList, seckill, PromotionTypeEnum.SECKILL); + result = promotionGoodsService.saveBatch(promotionGoodsList); + this.seckillService.updateEsGoodsSeckill(seckill, list); + } + return result; + } + /** * 检查秒杀活动申请列表参数信息 * diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillServiceImpl.java index 7d9619db..8b092527 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillServiceImpl.java @@ -131,12 +131,31 @@ public class SeckillServiceImpl extends AbstractPromotionsServiceImpl seckillApplies) { if (seckillApplies != null && !seckillApplies.isEmpty()) { // 更新促销范围 diff --git a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java index 3c89d442..9eacac60 100644 --- a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java @@ -356,7 +356,6 @@ public class EsGoodsIndexServiceImpl extends BaseElasticsearchService implements addIndex(goodsIndex); resultMap.put(KEY_SUCCESS, resultMap.get(KEY_SUCCESS) + 1); } catch (Exception e) { - e.printStackTrace(); log.error("商品{}生成索引错误!", goodsIndex); resultMap.put(KEY_FAIL, resultMap.get(KEY_FAIL) + 1); } @@ -536,7 +535,8 @@ public class EsGoodsIndexServiceImpl extends BaseElasticsearchService implements if (promotionMap != null && !promotionMap.isEmpty()) { //促销不为空则进行清洗 promotionMap.entrySet().removeIf(i -> { - BasePromotions promotion = (BasePromotions) i.getValue(); + JSONObject promotionJson = JSONUtil.parseObj(i.getValue()); + BasePromotions promotion = promotionJson.toBean(BasePromotions.class); return promotion.getEndTime() != null && promotion.getEndTime().getTime() < DateUtil.date().getTime(); }); } diff --git a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java index 29e58226..ec9e3391 100644 --- a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java @@ -14,6 +14,7 @@ import cn.lili.modules.search.entity.dto.EsGoodsSearchDTO; import cn.lili.modules.search.entity.dto.HotWordsDTO; import cn.lili.modules.search.entity.dto.ParamOptions; import cn.lili.modules.search.entity.dto.SelectorOptions; +import cn.lili.modules.search.service.EsGoodsIndexService; import cn.lili.modules.search.service.EsGoodsSearchService; import com.alibaba.druid.util.StringUtils; import lombok.extern.slf4j.Slf4j; @@ -74,6 +75,9 @@ public class EsGoodsSearchServiceImpl implements EsGoodsSearchService { @Autowired @Qualifier("elasticsearchRestTemplate") private ElasticsearchRestTemplate restTemplate; + + @Autowired + private EsGoodsIndexService esGoodsIndexService; /** * 缓存 */ @@ -82,6 +86,10 @@ public class EsGoodsSearchServiceImpl implements EsGoodsSearchService { @Override public SearchPage searchGoods(EsGoodsSearchDTO searchDTO, PageVO pageVo) { + boolean exists = restTemplate.indexOps(EsGoodsIndex.class).exists(); + if (!exists) { + esGoodsIndexService.init(); + } if (CharSequenceUtil.isNotEmpty(searchDTO.getKeyword())) { cache.incrementScore(CachePrefix.HOT_WORD.getPrefix(), searchDTO.getKeyword()); } @@ -89,6 +97,14 @@ public class EsGoodsSearchServiceImpl implements EsGoodsSearchService { NativeSearchQuery searchQuery = searchQueryBuilder.build(); log.info("searchGoods DSL:{}", searchQuery.getQuery()); SearchHits search = restTemplate.search(searchQuery, EsGoodsIndex.class); + for (int i = 0; i < search.getSearchHits().size() ; i++){ + if (search.getSearchHits().get(i).getContent().getSmall().contains("fuluapiossproductnew.oss-cn-hangzhou.aliyuncs.com")){ + search.getSearchHits().get(i).getContent().setSmall(search.getSearchHits().get(i).getContent().getSmall().replace("?x-oss-process=style/200X200", "")); + } + if (search.getSearchHits().get(i).getContent().getThumbnail().contains("fuluapiossproductnew.oss-cn-hangzhou.aliyuncs.com")){ + search.getSearchHits().get(i).getContent().setThumbnail(search.getSearchHits().get(i).getContent().getThumbnail().replace("?x-oss-process=style/400X400", "")); + } + } return SearchHitSupport.searchPageFor(search, searchQuery.getPageable()); } diff --git a/framework/src/main/java/cn/lili/modules/store/entity/dos/StoreDetail.java b/framework/src/main/java/cn/lili/modules/store/entity/dos/StoreDetail.java index ed8d8d37..e37b57b5 100644 --- a/framework/src/main/java/cn/lili/modules/store/entity/dos/StoreDetail.java +++ b/framework/src/main/java/cn/lili/modules/store/entity/dos/StoreDetail.java @@ -173,6 +173,17 @@ public class StoreDetail extends BaseIdEntity { @ApiModelProperty(value = "详细地址") private String salesConsigneeDetail; + //店铺福禄配置 + + @ApiModelProperty(value = "福禄app密钥") + private String appSecretKey; + + @ApiModelProperty(value = "福禄商户号") + private String merchantNumber; + + @ApiModelProperty(value = "福禄appKEY商户key") + private String appMerchantKey; + public StoreDetail(Store store, AdminStoreApplyDTO adminStoreApplyDTO) { this.storeId = store.getId(); diff --git a/framework/src/main/java/cn/lili/modules/store/entity/dto/FuLuConfigureDTO.java b/framework/src/main/java/cn/lili/modules/store/entity/dto/FuLuConfigureDTO.java new file mode 100644 index 00000000..571d3d2b --- /dev/null +++ b/framework/src/main/java/cn/lili/modules/store/entity/dto/FuLuConfigureDTO.java @@ -0,0 +1,23 @@ +package cn.lili.modules.store.entity.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 店铺福禄配置 + * + * @author pikachu + * @since 2021-01-11 15:10:51 + */ +@Data +public class FuLuConfigureDTO { + + @ApiModelProperty(value = "福禄app密钥") + private String appSecretKey; + + @ApiModelProperty(value = "福禄商户号") + private String merchantNumber; + + @ApiModelProperty(value = "福禄appKEY商户key") + private String appMerchantKey; +} diff --git a/framework/src/main/java/cn/lili/modules/store/mapper/StoreDetailMapper.java b/framework/src/main/java/cn/lili/modules/store/mapper/StoreDetailMapper.java index e2b3fe7b..b74b9c71 100644 --- a/framework/src/main/java/cn/lili/modules/store/mapper/StoreDetailMapper.java +++ b/framework/src/main/java/cn/lili/modules/store/mapper/StoreDetailMapper.java @@ -2,6 +2,7 @@ package cn.lili.modules.store.mapper; import cn.hutool.core.date.DateTime; import cn.lili.modules.store.entity.dos.StoreDetail; +import cn.lili.modules.store.entity.dto.FuLuConfigureDTO; import cn.lili.modules.store.entity.dto.StoreAfterSaleAddressDTO; import cn.lili.modules.store.entity.dto.StoreSettlementDay; import cn.lili.modules.store.entity.vos.StoreBasicInfoVO; @@ -60,6 +61,17 @@ public interface StoreDetailMapper extends BaseMapper { "from li_store_detail s where s.store_id=#{storeId}") StoreAfterSaleAddressDTO getStoreAfterSaleAddressDTO(String storeId); + + /** + * 获取店铺福禄配置DTO + * + * @param storeId 店铺ID + * @return 店铺店铺福禄配置DTO + */ + @Select("select s.app_secret_key,s.merchant_number,s.app_merchant_key from li_store_detail s where s.store_id =#{storeId}") + FuLuConfigureDTO getFuLuConfigureDTO(String storeId); + + /** * 获取待结算店铺列表 * diff --git a/framework/src/main/java/cn/lili/modules/store/service/FreightTemplateService.java b/framework/src/main/java/cn/lili/modules/store/service/FreightTemplateService.java index 7cebb983..c5d60b89 100644 --- a/framework/src/main/java/cn/lili/modules/store/service/FreightTemplateService.java +++ b/framework/src/main/java/cn/lili/modules/store/service/FreightTemplateService.java @@ -70,7 +70,7 @@ public interface FreightTemplateService extends IService { * @param id 运费模板ID * @return 操作状态 */ - @CacheEvict(key = "#freightTemplateVO.id") + @CacheEvict(key = "#id") boolean removeFreightTemplate(String id); } \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/modules/store/service/StoreDetailService.java b/framework/src/main/java/cn/lili/modules/store/service/StoreDetailService.java index 07995f46..e95ef724 100644 --- a/framework/src/main/java/cn/lili/modules/store/service/StoreDetailService.java +++ b/framework/src/main/java/cn/lili/modules/store/service/StoreDetailService.java @@ -3,6 +3,7 @@ package cn.lili.modules.store.service; import cn.hutool.core.date.DateTime; import cn.lili.modules.store.entity.dos.Store; import cn.lili.modules.store.entity.dos.StoreDetail; +import cn.lili.modules.store.entity.dto.FuLuConfigureDTO; import cn.lili.modules.store.entity.dto.StoreAfterSaleAddressDTO; import cn.lili.modules.store.entity.dto.StoreSettingDTO; import cn.lili.modules.store.entity.dto.StoreSettlementDay; @@ -69,6 +70,12 @@ public interface StoreDetailService extends IService { */ StoreAfterSaleAddressDTO getStoreAfterSaleAddressDTO(); + /** + * 获取当前登录店铺福禄配置 + * + * @return 店铺福禄配置 + */ + FuLuConfigureDTO getFuLuConfigureDTO(); /** * 获取某一个店铺的退货收件地址信息 * @@ -85,6 +92,14 @@ public interface StoreDetailService extends IService { */ boolean editStoreAfterSaleAddressDTO(StoreAfterSaleAddressDTO storeAfterSaleAddressDTO); + /** + * 修改当前登录店铺福禄配置 + * + * @param fuLuConfigureDTO 店铺福禄配置DTO + * @return 店铺福禄配置 + */ + boolean editFuLuConfigureDTO(FuLuConfigureDTO fuLuConfigureDTO); + /** * 修改店铺库存预警数量 * diff --git a/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreDetailServiceImpl.java b/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreDetailServiceImpl.java index 50ff1703..9aa487ad 100644 --- a/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreDetailServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreDetailServiceImpl.java @@ -13,6 +13,7 @@ import cn.lili.modules.goods.service.GoodsService; import cn.lili.modules.search.utils.EsIndexUtil; import cn.lili.modules.store.entity.dos.Store; import cn.lili.modules.store.entity.dos.StoreDetail; +import cn.lili.modules.store.entity.dto.FuLuConfigureDTO; import cn.lili.modules.store.entity.dto.StoreAfterSaleAddressDTO; import cn.lili.modules.store.entity.dto.StoreSettingDTO; import cn.lili.modules.store.entity.dto.StoreSettlementDay; @@ -148,6 +149,12 @@ public class StoreDetailServiceImpl extends ServiceImpl lambdaUpdateWrapper = Wrappers.lambdaUpdate(); + lambdaUpdateWrapper.set(StoreDetail::getAppSecretKey, fuLuConfigureDTO.getAppSecretKey()); + lambdaUpdateWrapper.set(StoreDetail::getMerchantNumber, fuLuConfigureDTO.getMerchantNumber()); + lambdaUpdateWrapper.set(StoreDetail::getAppMerchantKey, fuLuConfigureDTO.getAppMerchantKey()); + lambdaUpdateWrapper.eq(StoreDetail::getStoreId, storeId); + return this.update(lambdaUpdateWrapper); + } + @Override public boolean updateStockWarning(Integer stockWarning) { String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId(); diff --git a/framework/src/main/java/cn/lili/modules/system/entity/dto/ImSetting.java b/framework/src/main/java/cn/lili/modules/system/entity/dto/ImSetting.java index 4ba51a1e..b3c644ae 100644 --- a/framework/src/main/java/cn/lili/modules/system/entity/dto/ImSetting.java +++ b/framework/src/main/java/cn/lili/modules/system/entity/dto/ImSetting.java @@ -19,8 +19,4 @@ public class ImSetting implements Serializable { private String httpUrl; - @ApiModelProperty(value = "平台ID") - private String tenantId; - - } diff --git a/framework/src/main/java/cn/lili/modules/verification/service/impl/VerificationSourceServiceImpl.java b/framework/src/main/java/cn/lili/modules/verification/service/impl/VerificationSourceServiceImpl.java index 8f5900e4..375119b0 100644 --- a/framework/src/main/java/cn/lili/modules/verification/service/impl/VerificationSourceServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/verification/service/impl/VerificationSourceServiceImpl.java @@ -1,5 +1,6 @@ package cn.lili.modules.verification.service.impl; +import cn.hutool.core.util.StrUtil; import cn.lili.cache.Cache; import cn.lili.modules.system.mapper.VerificationSourceMapper; import cn.lili.modules.verification.entity.dos.VerificationSource; @@ -52,7 +53,7 @@ public class VerificationSourceServiceImpl extends ServiceImpl + + ${LOG_FILE_PATH}/rocketmq.log + + ${LOG_FILE_PATH}/rocketmq/rocketmq-%d{yyyy-MM-dd}.log + 30 + 30MB + + + %d{yy-MM-dd.HH:mm:ss.SSS} [%-16t] %-5p %-22c{0} %X{ServiceId} - %m%n + + + + + + + diff --git a/seller-api/src/main/java/cn/lili/StoreApiApplication.java b/seller-api/src/main/java/cn/lili/StoreApiApplication.java index b2f3f73c..284df1b6 100644 --- a/seller-api/src/main/java/cn/lili/StoreApiApplication.java +++ b/seller-api/src/main/java/cn/lili/StoreApiApplication.java @@ -28,7 +28,7 @@ public class StoreApiApplication { } public static void main(String[] args) { - + System.setProperty("rocketmq.client.logUseSlf4j","true"); System.setProperty("es.set.netty.runtime.available.processors", "false"); SpringApplication.run(StoreApiApplication.class, args); } diff --git a/seller-api/src/main/java/cn/lili/controller/goods/GoodsStoreController.java b/seller-api/src/main/java/cn/lili/controller/goods/GoodsStoreController.java index 5aadb600..7f1267f3 100644 --- a/seller-api/src/main/java/cn/lili/controller/goods/GoodsStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/goods/GoodsStoreController.java @@ -1,12 +1,14 @@ package cn.lili.controller.goods; import cn.lili.common.enums.ResultUtil; +import cn.lili.common.fulu.core.utils.Test; import cn.lili.common.security.OperationalJudgment; import cn.lili.common.security.context.UserContext; import cn.lili.common.vo.ResultMessage; 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.GoodsOperationFuLuDTO; import cn.lili.modules.goods.entity.dto.GoodsSearchParams; import cn.lili.modules.goods.entity.dto.GoodsSkuStockDTO; import cn.lili.modules.goods.entity.enums.GoodsStatusEnum; @@ -16,7 +18,10 @@ import cn.lili.modules.goods.entity.vos.StockWarningVO; import cn.lili.modules.goods.service.GoodsService; import cn.lili.modules.goods.service.GoodsSkuService; import cn.lili.modules.store.entity.dos.StoreDetail; +import cn.lili.modules.store.entity.dto.FuLuConfigureDTO; import cn.lili.modules.store.service.StoreDetailService; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import io.swagger.annotations.Api; @@ -27,8 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; -import java.util.List; -import java.util.Objects; +import java.util.*; import java.util.stream.Collectors; /** @@ -171,4 +175,113 @@ public class GoodsStoreController { return ResultUtil.success(); } + + @ApiOperation(value = "新增商品(minShengLotteryRecordService商品迁移)") + @PostMapping(value = "/fuluCreate") + public ResultMessage fuluSave() throws Exception { + String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId(); + GoodsOperationFuLuDTO goodsOperationDTO = new GoodsOperationFuLuDTO(); + + FuLuConfigureDTO fuLuConfigureDTO = storeDetailService.getFuLuConfigureDTO(); + //获取并解析福禄商品数据 + Map maps = (Map) JSON.parse(Test.getGoodsInfoList(fuLuConfigureDTO)); + if (!maps.get("code").toString().equals("0")) { + return ResultUtil.error(201, "商品不存在或配置参数错误"); + } + int i = 0; + List> listObjectSec = JSONArray.parseObject(maps.get("result").toString(), List.class); + for (Map mapList : listObjectSec) { + if (listObjectSec.size() <= 0) { + break; + } + for (Map.Entry entry : mapList.entrySet()) { + if (entry.getKey().equals("product_id")) { + Map map1 = (Map) JSON.parse(Test.productInfoGetTest(fuLuConfigureDTO, entry.getValue().toString()).get("result").toString()); + if (map1.get("product_type").toString().equals("直充")) { + goodsOperationDTO.setCategoryPath("1496301573515636737");//分类path + } else if (map1.get("product_type").toString().equals("卡密")) { + goodsOperationDTO.setCategoryPath("1496301573515636737");//分类path + } else { + //不是直充也不是卡密需要修改代码 + continue; + } + + List goodsList = goodsService.list( + new LambdaQueryWrapper() + .eq(Goods::getStoreId, storeId) + .eq(Goods::getSn, map1.get("product_id").toString()) + .eq(Goods::getDeleteFlag, false) + ); + + goodsOperationDTO.setStoreCategoryPath("");//店铺分类id + goodsOperationDTO.setBrandId("1496301301183672321");//品牌ID + goodsOperationDTO.setGoodsName(map1.get("product_name").toString());//商品名称 + goodsOperationDTO.setSn(map1.get("product_id").toString());//商品编号 + goodsOperationDTO.setPrice(Double.valueOf(map1.get("purchase_price").toString()));//商品价格 + goodsOperationDTO.setCost(Double.valueOf(map1.get("purchase_price").toString()));//市场价格 + goodsOperationDTO.setWeight(Double.valueOf("0"));//重量 + goodsOperationDTO.setIntro(map1.get("product_name").toString());//详情 + goodsOperationDTO.setMobileIntro(map1.get("product_name").toString());//移动端详情 + goodsOperationDTO.setQuantity(99999999);//库存 + goodsOperationDTO.setRelease(true);//是否立即发布 + goodsOperationDTO.setRecommend(true);//是否是推荐商品 + goodsOperationDTO.setGoodsParamsDTOList(new ArrayList<>());//商品参数 + List goodsGalleryList = new ArrayList<>(); + if (map1.containsKey("four_category_icon") && map1.get("four_category_icon") != null) { + goodsGalleryList.add(map1.get("four_category_icon").toString()); + } + goodsOperationDTO.setGoodsGalleryList(goodsGalleryList); + goodsOperationDTO.setTemplateId("0");//运费模板id,不需要运费模板时值是0 + goodsOperationDTO.setSellingPoint(map1.get("product_name").toString()); + goodsOperationDTO.setSalesModel("RETAIL");//销售模式 +// goodsOperationDTO.setHaveSpec();//是否有规格 + goodsOperationDTO.setGoodsUnit("个");//销售模式1471044596808024065 + goodsOperationDTO.setInfo(map1.get("product_name").toString());//商品描述 + goodsOperationDTO.setGoodsType("VIRTUAL_GOODS");//商品类型 + + +// goodsOperationDTO.setGoodsVideo();//商品视频 + + List> mapArrayList = new ArrayList<>(); + Map map = new HashMap<>(); + map.put("sn", goodsOperationDTO.getSn()); + map.put("price", goodsOperationDTO.getPrice()); + map.put("cost", goodsOperationDTO.getCost()); + map.put("weight", goodsOperationDTO.getWeight()); + map.put("quantity", goodsOperationDTO.getQuantity()); + map.put("category_path", "1496301573515636737"); + + if (map1.containsKey("four_category_icon") && map1.get("four_category_icon") != null) { + List> images = new ArrayList<>(); + Map map2 = new HashMap<>(); + map2.put("url",map1.get("four_category_icon").toString()); + images.add(map2); + map.put("images", images); + i += 1; + } + + mapArrayList.add(map); + goodsOperationDTO.setSkuList(mapArrayList);//sku列表 + + if (goodsList.size() > 0) { + GoodsOperationDTO goodsOperationDTO1 = new GoodsOperationDTO(); + goodsOperationDTO1.setPrice(Double.valueOf(map1.get("purchase_price").toString())); + goodsService.editGoods(goodsOperationDTO1, goodsList.get(0).getId()); + }else{ + goodsService.fuLuAddGoods(goodsOperationDTO); + } + + + + break; + } +// if (i == 1) { +// break; +// } + } + } + return ResultUtil.success(); + } + + } diff --git a/seller-api/src/main/java/cn/lili/controller/settings/StoreSettingsController.java b/seller-api/src/main/java/cn/lili/controller/settings/StoreSettingsController.java index 3287d59d..728263fc 100644 --- a/seller-api/src/main/java/cn/lili/controller/settings/StoreSettingsController.java +++ b/seller-api/src/main/java/cn/lili/controller/settings/StoreSettingsController.java @@ -3,6 +3,7 @@ package cn.lili.controller.settings; import cn.lili.common.enums.ResultUtil; import cn.lili.common.vo.ResultMessage; +import cn.lili.modules.store.entity.dto.FuLuConfigureDTO; import cn.lili.modules.store.entity.dto.StoreAfterSaleAddressDTO; import cn.lili.modules.store.entity.dto.StoreSettingDTO; import cn.lili.modules.store.entity.vos.StoreVO; @@ -87,4 +88,19 @@ public class StoreSettingsController { boolean result = storeDetailService.editStoreAfterSaleAddressDTO(storeAfterSaleAddressDTO); return ResultUtil.data(result); } + + @ApiOperation(value = "获取商家福禄配置") + @GetMapping("/fuLuConfigure") + public ResultMessage getFuLuConfigure() { + //获取当前登录商家内容 + return ResultUtil.data(storeDetailService.getFuLuConfigureDTO()); + } + + @ApiOperation(value = "修改商家福禄配置") + @PutMapping("/fuLuConfigure") + public ResultMessage editFuLuConfigure(@Valid FuLuConfigureDTO fuLuConfigureDTO) { + //修改商家退货收件地址 + boolean result = storeDetailService.editFuLuConfigureDTO(fuLuConfigureDTO); + return ResultUtil.data(result); + } } diff --git a/seller-api/src/main/resources/application.yml b/seller-api/src/main/resources/application.yml index 911d7f87..f8eb411d 100644 --- a/seller-api/src/main/resources/application.yml +++ b/seller-api/src/main/resources/application.yml @@ -33,9 +33,9 @@ spring: type: redis # Redis redis: - host: 192.168.2.122 + host: 120.71.145.134 port: 6379 - password: Gb84505016 + password: ekLhvPGraSj8DGO0 lettuce: pool: # 连接池最大连接数(使用负值表示没有限制) 默认 8 @@ -64,9 +64,9 @@ spring: default-datasource: type: com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://192.168.2.126:3306/rx-shop?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&allowPublicKeyRetrieval=true&verifyServerCertificate=false&useSSL=false - username: rx-shop - password: J2xEZ42HwPXrDXt3 + url: jdbc:mysql://120.71.183.195:3306/zyt_shop?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&allowPublicKeyRetrieval=true&verifyServerCertificate=false&useSSL=false + username: zyt_shop + password: Gb84505016@zytshop maxActive: 20 initialSize: 5 maxWait: 60000 @@ -120,6 +120,7 @@ ignored: - /weixin/** - /source/** - /store/passport/login/** + - /store/passport/login/refresh/** - /druid/** - /swagger-ui.html - /doc.html @@ -190,16 +191,16 @@ lili: sk: zhNKVrJK6UPOhqIjn8AQvG37b9sz6 #域名 domain: - pc: https://pc.b2b2c.pickmall.cn - wap: https://m.b2b2c.pickmall.cn - store: https://store.b2b2c.pickmall.cn - admin: https://admin.b2b2c.pickmall.cn + pc: http://zbuyer.sx1788.cn/buyer + wap: http://zshop.sx1788.cn/ + store: http://zseller.sx1788.cn/login + admin: http://zmanager.sx1788.cn/login #api地址 api: - buyer: https://buyer-api.pickmall.cn - common: https://common-api.pickmall.cn - manager: https://admin-api.pickmall.cn - store: https://store-api.pickmall.cn + buyer: https://zshop-api.sx1788.cn/buyer-api + common: https://zshop-api.sx1788.cn/common-api + manager: https://zshop-api.sx1788.cn/manager-api + store: https://zshop-api.sx1788.cn/seller-api # jwt 细节设定 jwt-setting: @@ -218,7 +219,7 @@ lili: data: elasticsearch: cluster-name: elasticsearch - cluster-nodes: 192.168.2.122:9200 + cluster-nodes: 106.124.130.167:9200 index: number-of-replicas: 0 number-of-shards: 3 @@ -228,7 +229,7 @@ lili: # username: elastic # password: LiLiShopES logstash: - server: 192.168.2.122:4560 + server: 106.124.130.167:4560 rocketmq: promotion-topic: lili_promotion_topic promotion-group: lili_promotion_group @@ -249,7 +250,7 @@ lili: after-sale-topic: lili_after_sale_topic after-sale-group: lili_after_sale_group rocketmq: - name-server: 192.168.2.122:9876 + name-server: 106.124.130.167:9876 producer: group: lili_group send-message-timeout: 30000 @@ -257,7 +258,7 @@ rocketmq: xxl: job: admin: - addresses: http://192.168.2.122:9001/xxl-job-admin + addresses: http://127.0.0.1:9001/xxl-job-admin executor: appname: xxl-job-executor-lilishop address: diff --git a/seller-api/src/main/resources/logback-spring.xml b/seller-api/src/main/resources/logback-spring.xml index a8d0eba6..b7c9425a 100644 --- a/seller-api/src/main/resources/logback-spring.xml +++ b/seller-api/src/main/resources/logback-spring.xml @@ -20,6 +20,22 @@ + + ${LOG_FILE_PATH}/rocketmq.log + + ${LOG_FILE_PATH}/rocketmq/rocketmq-%d{yyyy-MM-dd}.log + 30 + 30MB + + + %d{yy-MM-dd.HH:mm:ss.SSS} [%-16t] %-5p %-22c{0} %X{ServiceId} - %m%n + + + + + + + diff --git a/xxl-job/application.properties b/xxl-job/application.properties index eae3a677..e5f73a72 100644 --- a/xxl-job/application.properties +++ b/xxl-job/application.properties @@ -23,9 +23,9 @@ mybatis.mapper-locations=classpath:/mybatis-mapper/*Mapper.xml #mybatis.type-aliases-package=com.xxl.job.admin.core.model ### xxl-job, datasource -spring.datasource.url=jdbc:mysql://192.168.0.106:3306/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai -spring.datasource.username=root -spring.datasource.password=lilishop +spring.datasource.url=jdbc:mysql://120.71.183.195:3306/zyt_shop/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai +spring.datasource.username=zyt_shop +spring.datasource.password=Gb84505016@zytshop spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver ### datasource-pool