From 9a7ac1e0d0e6c8e4166a1b552cef0f2a185d720a Mon Sep 17 00:00:00 2001 From: huangqizhen Date: Mon, 20 Jan 2025 11:09:46 +0800 Subject: [PATCH] quanxian --- pom.xml | 6 +++++ .../com/example/demo/config/WebClientConfig.java | 17 ++++++++++++++ .../example/demo/controller/DetailYController.java | 1 + .../demo/serviceImpl/ConsumeServiceImpl.java | 2 +- .../example/demo/serviceImpl/OtherServiceImpl.java | 27 ++++++++++++---------- src/main/resources/application.yml | 26 ++++++++++++++------- 6 files changed, 58 insertions(+), 21 deletions(-) create mode 100644 src/main/java/com/example/demo/config/WebClientConfig.java diff --git a/pom.xml b/pom.xml index 14fd1f8..5ccf92d 100644 --- a/pom.xml +++ b/pom.xml @@ -65,6 +65,12 @@ commons-pool2 + + org.springframework.boot + spring-boot-starter-webflux + + + diff --git a/src/main/java/com/example/demo/config/WebClientConfig.java b/src/main/java/com/example/demo/config/WebClientConfig.java new file mode 100644 index 0000000..197a170 --- /dev/null +++ b/src/main/java/com/example/demo/config/WebClientConfig.java @@ -0,0 +1,17 @@ +package com.example.demo.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.reactive.function.client.WebClient; + + +@Configuration +public class WebClientConfig { + + @Bean + public WebClient webClient() { + return WebClient.builder() + .baseUrl("http://hwapi.rzfwq.com") + .build(); + } +} diff --git a/src/main/java/com/example/demo/controller/DetailYController.java b/src/main/java/com/example/demo/controller/DetailYController.java index 6442f4e..5731dc3 100644 --- a/src/main/java/com/example/demo/controller/DetailYController.java +++ b/src/main/java/com/example/demo/controller/DetailYController.java @@ -62,6 +62,7 @@ public class DetailYController { } @PostMapping("/ERP") public Result addERP(@RequestBody ERP erp) throws Exception { + log.info("erp:{}", erp); return Result.success(otherService.addERP(erp)); } } diff --git a/src/main/java/com/example/demo/serviceImpl/ConsumeServiceImpl.java b/src/main/java/com/example/demo/serviceImpl/ConsumeServiceImpl.java index f29d88f..9fcf0e3 100644 --- a/src/main/java/com/example/demo/serviceImpl/ConsumeServiceImpl.java +++ b/src/main/java/com/example/demo/serviceImpl/ConsumeServiceImpl.java @@ -35,7 +35,7 @@ public class ConsumeServiceImpl implements ConsumeService { ConsumeMapper consumeMapper; private final UserMapper userMapper; private final UserServiceImpl userService; - @CacheEvict(value = "consume,detailY", allEntries = true) + @CacheEvict(value = {"consume", "detailY"}, allEntries = true) @Override //新增消费记录 public int insert(DetailY detailY) throws Exception { diff --git a/src/main/java/com/example/demo/serviceImpl/OtherServiceImpl.java b/src/main/java/com/example/demo/serviceImpl/OtherServiceImpl.java index 13ef0ce..46e8ffe 100644 --- a/src/main/java/com/example/demo/serviceImpl/OtherServiceImpl.java +++ b/src/main/java/com/example/demo/serviceImpl/OtherServiceImpl.java @@ -91,18 +91,16 @@ public class OtherServiceImpl implements OtherService { typesToUpdateTwo.add("59"); typesToUpdateTwo.add("61"); - typesToUpdateThree.add("9"); - typesToUpdateThree.add("15"); - typesToUpdateThree.add("17"); - typesToUpdateThree.add("25"); - typesToUpdateThree.add("27"); - typesToUpdateThree.add("37"); - typesToUpdateThree.add("41"); - typesToUpdateThree.add("42"); - typesToUpdateThree.add("43"); - typesToUpdateThree.add("50"); - typesToUpdateThree.add("51"); - typesToUpdateThree.add("52"); + typesToUpdateThree.add("10"); + typesToUpdateThree.add("16"); + typesToUpdateThree.add("30"); + typesToUpdateThree.add("31"); + typesToUpdateThree.add("32"); + typesToUpdateThree.add("33"); + typesToUpdateThree.add("34"); + typesToUpdateThree.add("39"); + typesToUpdateThree.add("44"); + } @Override @@ -172,6 +170,7 @@ public class OtherServiceImpl implements OtherService { if (typesToUpdateZero.contains(type)) { + System.out.println("充值------------------------------------------------------"); detailY.setUpdateType(0);// 设置 updateType 为 0 detailY.setJwcode(JwCode); detailY.setRechargeCoin(rechargeJb); @@ -191,6 +190,7 @@ public class OtherServiceImpl implements OtherService { } else if (typesToUpdateOne.contains(type)) { + System.out.println("消费------------------------------------------------------"); detailY.setUpdateType(1); // 设置 updateType 为 1 detailY.setJwcode(JwCode); detailY.setRechargeCoin(rechargeJb); @@ -204,6 +204,7 @@ public class OtherServiceImpl implements OtherService { detailY.setConsumePlatform("ERP系统"); detailY.setConsumeType(Way); } else if (typesToUpdateTwo.contains(type)) { + System.out.println("退款------------------------------------------------------"); detailY.setUpdateType(2); // 设置 updateType 为 2 detailY.setJwcode(JwCode); detailY.setRechargeCoin(rechargeJb); @@ -217,6 +218,7 @@ public class OtherServiceImpl implements OtherService { detailY.setConsumePlatform("ERP系统"); detailY.setRefundType(Way); }else if (typesToUpdateThree.contains(type)) { + System.out.println("其他------------------------------------------------------"); detailY.setUpdateType(3); // 设置 updateType 为 3 detailY.setJwcode(JwCode); detailY.setRechargeCoin(rechargeJb); @@ -231,6 +233,7 @@ public class OtherServiceImpl implements OtherService { detailY.setReson(Way); } // 添加其他业务逻辑 + System.out.println(detailY+"-----测试能否传输------"); return detailYMapper.add(detailY); } } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index d1b3c5b..db3a541 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,5 +1,6 @@ server: - port: 10702 +# port: 10702 + port: 10010 spring: servlet: @@ -15,7 +16,8 @@ spring: connection-timeout: 30000 pool-name: HwgoldHikariCP driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://54.251.137.151:10701/hwgold?serverTimezone=GMT%2b8 +# url: jdbc:mysql://54.251.137.151:10701/hwgold?serverTimezone=GMT%2b8 + url: jdbc:mysql://39.101.133.168/hwgold?serverTimezone=GMT%2b8 username: hwgold password: 'AGX4Z3YMxiCG3GR2' application: @@ -28,19 +30,27 @@ spring: cache-null-values: true data: redis: - host: 54.251.137.151 - port: 10703 - password: 8912h12jhhajsd +# host: 54.251.137.151 +# port: 10703 +# password: 8912h12jhhajsd +# timeout: 1000 + host: 127.0.0.1 + port: 6379 timeout: 1000 - # host: 127.0.0.1 - # port: 6379 - # timeout: 1000 +# host: 39.99.159.73 +# port: 20001 +# password: 8912h12jhhajsd +# timeout: 1000 + lettuce: pool: max-active: 20 max-wait: -1 max-idle: 5 + + + mybatis: configuration: map-underscore-to-camel-case: true