Browse Source

8.4打包配置

huangqizheng/feature-20250805200446-配置修改及充值导出修改
huangqizhen 2 weeks ago
parent
commit
a7ad0b6a47
  1. 2
      pom.xml
  2. 8
      src/main/java/com/example/demo/Export/ExportServiceImpl.java
  3. 3
      src/main/java/com/example/demo/domain/DTO/BeanRechargeDTO.java
  4. 2
      src/main/java/com/example/demo/domain/DTO/OnlineDTO.java
  5. 54
      src/main/java/com/example/demo/serviceImpl/coin/ExportExcelServiceImpl.java
  6. 4
      src/main/resources/application-dev.yml
  7. 6
      src/main/resources/application-prod.yml
  8. 8
      src/main/resources/application-test.yml

2
pom.xml

@ -185,7 +185,7 @@
<profile>
<id>prod</id>
<properties>
<spring.profiles.active>pro</spring.profiles.active>
<spring.profiles.active>prod</spring.profiles.active>
</properties>
</profile>
</profiles>

8
src/main/java/com/example/demo/Export/ExportServiceImpl.java

@ -231,9 +231,9 @@ public class ExportServiceImpl implements ExportService {
} else if (dto instanceof ArticleDTO articleDTO) {
requestData.put(requestDataKey, articleDTO.getBeanConsumeArticle());
} else if (dto instanceof BeanRechargeDTO beanRechargeDTO){
requestData.put(requestDataKey, beanRechargeDTO.getBeanRechargeInfo());
requestData.put(requestDataKey, beanRechargeDTO.getBeanSystemRechargeInfo());
} else if (dto instanceof OnlineDTO onlineDTO){
requestData.put(requestDataKey, onlineDTO.getBeanRechargeInfo());
requestData.put(requestDataKey, onlineDTO.getBeanOnlineRechargeInfo());
}
exportData.put("requestData", requestData);
@ -282,11 +282,11 @@ public class ExportServiceImpl implements ExportService {
@Override
public Result addExportBean(BeanRechargeDTO dto) {
return addExport(dto, "金豆明细", "bean:queue:export_queue", "beanRechargeInfo");
return addExport(dto, "金豆明细", "bean:queue:export_queue", "beanSystemRechargeInfo");
}
@Override
public Result addExportOnline(OnlineDTO dto) {
return addExport(dto, "在线明细", "online:queue:export_queue", "beanRechargeInfo");
return addExport(dto, "在线明细", "online:queue:export_queue", "beanOnlineRechargeInfo");
}
}

3
src/main/java/com/example/demo/domain/DTO/BeanRechargeDTO.java

@ -2,6 +2,7 @@ package com.example.demo.domain.DTO;
import com.example.demo.domain.vo.bean.BeanConsumeArticle;
import com.example.demo.domain.vo.bean.BeanRechargeInfo;
import com.example.demo.domain.vo.bean.BeanSystemRechargeInfo;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -33,5 +34,5 @@ public class BeanRechargeDTO {
private Integer page = 1;
@NotNull(message = "pageSize不能为空")
private Integer pageSize = 20;
private BeanRechargeInfo beanRechargeInfo;
private BeanSystemRechargeInfo beanSystemRechargeInfo;
}

2
src/main/java/com/example/demo/domain/DTO/OnlineDTO.java

@ -32,5 +32,5 @@ public class OnlineDTO {
private Integer page = 1;
@NotNull(message = "pageSize不能为空")
private Integer pageSize = 20;
private BeanOnlineRechargeInfo beanRechargeInfo;
private BeanOnlineRechargeInfo beanOnlineRechargeInfo;
}

54
src/main/java/com/example/demo/serviceImpl/coin/ExportExcelServiceImpl.java

@ -32,6 +32,7 @@ import com.example.demo.service.coin.AiEmotionService;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.xmlbeans.impl.xb.xsdschema.Attribute;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.authentication.AuthenticationManager;
@ -87,6 +88,11 @@ public class ExportExcelServiceImpl implements ExportExcelService {
public Exception handleExcelExportData(String message) throws Exception {
return exportExcelGeneric(message, "goldDetail", page -> {
try {
JsonNode rootNode = objectMapper.readTree(message);
JsonNode requestDataNode = rootNode.path("requestData");
JsonNode GoldDetailNode = requestDataNode.path("goldDetail");
GoldDetail goldDetail = objectMapper.treeToValue(GoldDetailNode, GoldDetail.class);
page.setGoldDetail(goldDetail);
return goldDetailController.ExcelGoldDetail(page);
} catch (Exception e) {
throw new RuntimeException(e);
@ -99,6 +105,11 @@ public class ExportExcelServiceImpl implements ExportExcelService {
public Exception handleExcel(String message) throws Exception {
return exportExcelGeneric(message, "user", page -> {
try {
JsonNode rootNode = objectMapper.readTree(message);
JsonNode requestDataNode = rootNode.path("requestData");
JsonNode UserNode = requestDataNode.path("user");
User user = objectMapper.treeToValue(UserNode, User.class);
page.setUser(user);
return goldDetailController.ExcelGold(page);
} catch (Exception e) {
throw new RuntimeException(e);
@ -111,6 +122,11 @@ public class ExportExcelServiceImpl implements ExportExcelService {
public Exception rechargeExcel(String message) throws Exception {
return exportExcelGeneric(message, "rechargeUser", page -> {
try {
JsonNode rootNode = objectMapper.readTree(message);
JsonNode requestDataNode = rootNode.path("requestData");
JsonNode rechargeUserNode = requestDataNode.path("rechargeUser");
RechargeUser rechargeUser = objectMapper.treeToValue(rechargeUserNode, RechargeUser.class);
page.setRechargeUser(rechargeUser);
return rechargeController.selcet(page);
} catch (Exception e) {
throw new RuntimeException(e);
@ -122,6 +138,11 @@ public class ExportExcelServiceImpl implements ExportExcelService {
public Exception consumeExcel(String message) throws Exception {
return exportExcelGeneric(message, "consumeUser", page -> {
try {
JsonNode rootNode = objectMapper.readTree(message);
JsonNode requestDataNode = rootNode.path("requestData");
JsonNode consumeUserNode = requestDataNode.path("consumeUser");
ConsumeUser consumeUser = objectMapper.treeToValue(consumeUserNode, ConsumeUser.class);
page.setConsumeUser(consumeUser);
return consumeController.select(page);
} catch (Exception e) {
throw new RuntimeException(e);
@ -134,6 +155,11 @@ public class ExportExcelServiceImpl implements ExportExcelService {
public Exception refundExcel(String message) throws Exception {
return exportExcelGeneric(message, "refundUser", page -> {
try {
JsonNode rootNode = objectMapper.readTree(message);
JsonNode requestDataNode = rootNode.path("requestData");
JsonNode refundUserNode = requestDataNode.path("refundUser");
RefundUser refundUser = objectMapper.treeToValue(refundUserNode, RefundUser.class);
page.setRefundUser(refundUser);
return refundController.selcet(page);
} catch (Exception e) {
throw new RuntimeException(e);
@ -145,6 +171,11 @@ public class ExportExcelServiceImpl implements ExportExcelService {
public Exception LiveExcel(String message) throws Exception {
return exportExcelGeneric(message, "liveUser", page -> {
try {
JsonNode rootNode = objectMapper.readTree(message);
JsonNode requestDataNode = rootNode.path("requestData");
JsonNode beanConsumeLiveNode = requestDataNode.path("beanConsumeLive");
BeanConsumeLive beanConsumeLive = objectMapper.treeToValue(beanConsumeLiveNode, BeanConsumeLive.class);
page.setBeanConsumeLive(beanConsumeLive);
return beanConsumeController.selectLiveBy(page);
} catch (Exception e) {
throw new RuntimeException(e);
@ -156,6 +187,11 @@ public class ExportExcelServiceImpl implements ExportExcelService {
public Exception FanExcel(String message) throws Exception {
return exportExcelGeneric(message, "fanUser", page -> {
try {
JsonNode rootNode = objectMapper.readTree(message);
JsonNode requestDataNode = rootNode.path("requestData");
JsonNode beanConsumeFanNode = requestDataNode.path("beanConsumeFan");
BeanConsumeFan beanConsumeFan = objectMapper.treeToValue(beanConsumeFanNode, BeanConsumeFan.class);
page.setBeanConsumeFan(beanConsumeFan);
return beanConsumeController.selectFanBy(page);
} catch (Exception e) {
throw new RuntimeException(e);
@ -167,6 +203,11 @@ public class ExportExcelServiceImpl implements ExportExcelService {
public Exception ArticleExcel(String message) throws Exception {
return exportExcelGeneric(message, "articleUser", page -> {
try {
JsonNode rootNode = objectMapper.readTree(message);
JsonNode requestDataNode = rootNode.path("requestData");
JsonNode beanConsumeArticleNode = requestDataNode.path("beanConsumeArticle");
BeanConsumeArticle beanConsumeArticle = objectMapper.treeToValue(beanConsumeArticleNode, BeanConsumeArticle.class);
page.setBeanConsumeArticle(beanConsumeArticle);
return beanConsumeController.selectArticleBy(page);
} catch (Exception e) {
throw new RuntimeException(e);
@ -177,6 +218,11 @@ public class ExportExcelServiceImpl implements ExportExcelService {
public Exception BeanExcel(String message) throws Exception {
return exportExcelGeneric(message, "beanUser", page -> {
try {
JsonNode rootNode = objectMapper.readTree(message);
JsonNode requestDataNode = rootNode.path("requestData");
JsonNode beanRechargeNode = requestDataNode.path("beanSystemRechargeInfo");
BeanSystemRechargeInfo beanSystemRechargeInfo = objectMapper.treeToValue(beanRechargeNode, BeanSystemRechargeInfo.class);
page.setBeanSystemRechargeInfo(beanSystemRechargeInfo);
return beanRechargeController.selectBySystem(page);
} catch (Exception e) {
throw new RuntimeException(e);
@ -187,6 +233,11 @@ public class ExportExcelServiceImpl implements ExportExcelService {
public Exception OnlineExcel(String message) throws Exception {
return exportExcelGeneric(message, "onlineUser", page -> {
try {
JsonNode rootNode = objectMapper.readTree(message);
JsonNode requestDataNode = rootNode.path("requestData");
JsonNode beanRechargeNode = requestDataNode.path("beanOnlineRechargeInfo");
BeanOnlineRechargeInfo beanOnlineRechargeInfo = objectMapper.treeToValue(beanRechargeNode, BeanOnlineRechargeInfo.class);
page.setBeanOnlineRechargeInfo(beanOnlineRechargeInfo);
return beanRechargeController.selectByOnline(page);
} catch (Exception e) {
throw new RuntimeException(e);
@ -261,6 +312,9 @@ public class ExportExcelServiceImpl implements ExportExcelService {
Page page = new Page();
page.setPageNum(1);
page.setPageSize(PAGE_SIZE);
if (exportType.equals("goldDetail")){
}
Integer totalCount = 0;
boolean hasMore = true;

4
src/main/resources/application-dev.yml

@ -4,7 +4,7 @@ spring:
fail-on-unknown-properties: false
datasource:
mysql1:
jdbc-url: jdbc:mysql://18.143.76.3:3306/hwgoldc?serverTimezone=Asia/Shanghai&useSSL=false&useUnicode=true&allowMultiQueries=true&rewriteBatchedStatements=true
jdbc-url: jdbc:mysql://localhost:3306/hwgoldc?serverTimezone=Asia/Shanghai&useSSL=false&useUnicode=true&allowMultiQueries=true&rewriteBatchedStatements=true
username: hwgoldc
password: zB48T55wCsHC8KPz
driver-class-name: com.mysql.cj.jdbc.Driver
@ -35,7 +35,7 @@ spring:
data:
redis:
database: 0
host: 18.143.76.3
host: localhost
port: 10703
password: Ngc0FYUTA6h3wC5J

6
src/main/resources/application-prod.yml

@ -4,7 +4,7 @@ spring:
fail-on-unknown-properties: false
datasource:
mysql1:
jdbc-url: jdbc:mysql://18.143.76.3:3306/hwgold?serverTimezone=Asia/Shanghai&useSSL=false&useUnicode=true&allowMultiQueries=true&rewriteBatchedStatements=true
jdbc-url: jdbc:mysql://localhost:3306/hwgold?serverTimezone=Asia/Shanghai&useSSL=false&useUnicode=true&allowMultiQueries=true&rewriteBatchedStatements=true
username: hwgold
password: aDiw7MERSATdfGta
driver-class-name: com.mysql.cj.jdbc.Driver
@ -36,8 +36,8 @@ spring:
redis:
database: 2
host: localhost
port: 6379
password: 123456
port: 10703
password: Ngc0FYUTA6h3wC5J
lettuce:
pool:

8
src/main/resources/application-test.yml

@ -4,7 +4,7 @@ spring:
fail-on-unknown-properties: false
datasource:
mysql1:
jdbc-url: jdbc:mysql://18.143.76.3:3306/hwgoldc?serverTimezone=Asia/Shanghai&useSSL=false&useUnicode=true&allowMultiQueries=true&rewriteBatchedStatements=true
jdbc-url: jdbc:mysql://54.255.212.181:3306/hwgoldc?serverTimezone=Asia/Shanghai&useSSL=false&useUnicode=true&allowMultiQueries=true&rewriteBatchedStatements=true
username: hwgoldc
password: zB48T55wCsHC8KPz
driver-class-name: com.mysql.cj.jdbc.Driver
@ -35,9 +35,9 @@ spring:
data:
redis:
database: 0
host: 18.143.76.3
port: 10703
password: Ngc0FYUTA6h3wC5J
host: localhost
port: 6379
password: 123456
lettuce:
pool:

Loading…
Cancel
Save