Browse Source

quanxian

pull/1/head
huangqizhen 4 months ago
parent
commit
9a7ac1e0d0
  1. 6
      pom.xml
  2. 17
      src/main/java/com/example/demo/config/WebClientConfig.java
  3. 1
      src/main/java/com/example/demo/controller/DetailYController.java
  4. 2
      src/main/java/com/example/demo/serviceImpl/ConsumeServiceImpl.java
  5. 27
      src/main/java/com/example/demo/serviceImpl/OtherServiceImpl.java
  6. 26
      src/main/resources/application.yml

6
pom.xml

@ -65,6 +65,12 @@
<artifactId>commons-pool2</artifactId> <artifactId>commons-pool2</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<!-- <dependency>--> <!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>--> <!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-data-elasticsearch</artifactId>--> <!-- <artifactId>spring-boot-starter-data-elasticsearch</artifactId>-->

17
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();
}
}

1
src/main/java/com/example/demo/controller/DetailYController.java

@ -62,6 +62,7 @@ public class DetailYController {
} }
@PostMapping("/ERP") @PostMapping("/ERP")
public Result addERP(@RequestBody ERP erp) throws Exception { public Result addERP(@RequestBody ERP erp) throws Exception {
log.info("erp:{}", erp);
return Result.success(otherService.addERP(erp)); return Result.success(otherService.addERP(erp));
} }
} }

2
src/main/java/com/example/demo/serviceImpl/ConsumeServiceImpl.java

@ -35,7 +35,7 @@ public class ConsumeServiceImpl implements ConsumeService {
ConsumeMapper consumeMapper; ConsumeMapper consumeMapper;
private final UserMapper userMapper; private final UserMapper userMapper;
private final UserServiceImpl userService; private final UserServiceImpl userService;
@CacheEvict(value = "consume,detailY", allEntries = true)
@CacheEvict(value = {"consume", "detailY"}, allEntries = true)
@Override @Override
//新增消费记录 //新增消费记录
public int insert(DetailY detailY) throws Exception { public int insert(DetailY detailY) throws Exception {

27
src/main/java/com/example/demo/serviceImpl/OtherServiceImpl.java

@ -91,18 +91,16 @@ public class OtherServiceImpl implements OtherService {
typesToUpdateTwo.add("59"); typesToUpdateTwo.add("59");
typesToUpdateTwo.add("61"); 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 @Override
@ -172,6 +170,7 @@ public class OtherServiceImpl implements OtherService {
if (typesToUpdateZero.contains(type)) { if (typesToUpdateZero.contains(type)) {
System.out.println("充值------------------------------------------------------");
detailY.setUpdateType(0);// 设置 updateType 0 detailY.setUpdateType(0);// 设置 updateType 0
detailY.setJwcode(JwCode); detailY.setJwcode(JwCode);
detailY.setRechargeCoin(rechargeJb); detailY.setRechargeCoin(rechargeJb);
@ -191,6 +190,7 @@ public class OtherServiceImpl implements OtherService {
} else if (typesToUpdateOne.contains(type)) { } else if (typesToUpdateOne.contains(type)) {
System.out.println("消费------------------------------------------------------");
detailY.setUpdateType(1); // 设置 updateType 1 detailY.setUpdateType(1); // 设置 updateType 1
detailY.setJwcode(JwCode); detailY.setJwcode(JwCode);
detailY.setRechargeCoin(rechargeJb); detailY.setRechargeCoin(rechargeJb);
@ -204,6 +204,7 @@ public class OtherServiceImpl implements OtherService {
detailY.setConsumePlatform("ERP系统"); detailY.setConsumePlatform("ERP系统");
detailY.setConsumeType(Way); detailY.setConsumeType(Way);
} else if (typesToUpdateTwo.contains(type)) { } else if (typesToUpdateTwo.contains(type)) {
System.out.println("退款------------------------------------------------------");
detailY.setUpdateType(2); // 设置 updateType 2 detailY.setUpdateType(2); // 设置 updateType 2
detailY.setJwcode(JwCode); detailY.setJwcode(JwCode);
detailY.setRechargeCoin(rechargeJb); detailY.setRechargeCoin(rechargeJb);
@ -217,6 +218,7 @@ public class OtherServiceImpl implements OtherService {
detailY.setConsumePlatform("ERP系统"); detailY.setConsumePlatform("ERP系统");
detailY.setRefundType(Way); detailY.setRefundType(Way);
}else if (typesToUpdateThree.contains(type)) { }else if (typesToUpdateThree.contains(type)) {
System.out.println("其他------------------------------------------------------");
detailY.setUpdateType(3); // 设置 updateType 3 detailY.setUpdateType(3); // 设置 updateType 3
detailY.setJwcode(JwCode); detailY.setJwcode(JwCode);
detailY.setRechargeCoin(rechargeJb); detailY.setRechargeCoin(rechargeJb);
@ -231,6 +233,7 @@ public class OtherServiceImpl implements OtherService {
detailY.setReson(Way); detailY.setReson(Way);
} }
// 添加其他业务逻辑 // 添加其他业务逻辑
System.out.println(detailY+"-----测试能否传输------");
return detailYMapper.add(detailY); return detailYMapper.add(detailY);
} }
} }

26
src/main/resources/application.yml

@ -1,5 +1,6 @@
server: server:
port: 10702
# port: 10702
port: 10010
spring: spring:
servlet: servlet:
@ -15,7 +16,8 @@ spring:
connection-timeout: 30000 connection-timeout: 30000
pool-name: HwgoldHikariCP pool-name: HwgoldHikariCP
driver-class-name: com.mysql.cj.jdbc.Driver 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 username: hwgold
password: 'AGX4Z3YMxiCG3GR2' password: 'AGX4Z3YMxiCG3GR2'
application: application:
@ -28,19 +30,27 @@ spring:
cache-null-values: true cache-null-values: true
data: data:
redis: 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 timeout: 1000
# host: 127.0.0.1
# port: 6379
# timeout: 1000
# host: 39.99.159.73
# port: 20001
# password: 8912h12jhhajsd
# timeout: 1000
lettuce: lettuce:
pool: pool:
max-active: 20 max-active: 20
max-wait: -1 max-wait: -1
max-idle: 5 max-idle: 5
mybatis: mybatis:
configuration: configuration:
map-underscore-to-camel-case: true map-underscore-to-camel-case: true

Loading…
Cancel
Save