2 Commits

  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> <profile>
<id>prod</id> <id>prod</id>
<properties> <properties>
<spring.profiles.active>pro</spring.profiles.active>
<spring.profiles.active>prod</spring.profiles.active>
</properties> </properties>
</profile> </profile>
</profiles> </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) { } else if (dto instanceof ArticleDTO articleDTO) {
requestData.put(requestDataKey, articleDTO.getBeanConsumeArticle()); requestData.put(requestDataKey, articleDTO.getBeanConsumeArticle());
} else if (dto instanceof BeanRechargeDTO beanRechargeDTO){ } else if (dto instanceof BeanRechargeDTO beanRechargeDTO){
requestData.put(requestDataKey, beanRechargeDTO.getBeanRechargeInfo());
requestData.put(requestDataKey, beanRechargeDTO.getBeanSystemRechargeInfo());
} else if (dto instanceof OnlineDTO onlineDTO){ } else if (dto instanceof OnlineDTO onlineDTO){
requestData.put(requestDataKey, onlineDTO.getBeanRechargeInfo());
requestData.put(requestDataKey, onlineDTO.getBeanOnlineRechargeInfo());
} }
exportData.put("requestData", requestData); exportData.put("requestData", requestData);
@ -282,11 +282,11 @@ public class ExportServiceImpl implements ExportService {
@Override @Override
public Result addExportBean(BeanRechargeDTO dto) { public Result addExportBean(BeanRechargeDTO dto) {
return addExport(dto, "金豆明细", "bean:queue:export_queue", "beanRechargeInfo");
return addExport(dto, "金豆明细", "bean:queue:export_queue", "beanSystemRechargeInfo");
} }
@Override @Override
public Result addExportOnline(OnlineDTO dto) { 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.BeanConsumeArticle;
import com.example.demo.domain.vo.bean.BeanRechargeInfo; import com.example.demo.domain.vo.bean.BeanRechargeInfo;
import com.example.demo.domain.vo.bean.BeanSystemRechargeInfo;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@ -33,5 +34,5 @@ public class BeanRechargeDTO {
private Integer page = 1; private Integer page = 1;
@NotNull(message = "pageSize不能为空") @NotNull(message = "pageSize不能为空")
private Integer pageSize = 20; 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; private Integer page = 1;
@NotNull(message = "pageSize不能为空") @NotNull(message = "pageSize不能为空")
private Integer pageSize = 20; 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 com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; 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.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.AuthenticationManager;
@ -87,6 +88,11 @@ public class ExportExcelServiceImpl implements ExportExcelService {
public Exception handleExcelExportData(String message) throws Exception { public Exception handleExcelExportData(String message) throws Exception {
return exportExcelGeneric(message, "goldDetail", page -> { return exportExcelGeneric(message, "goldDetail", page -> {
try { 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); return goldDetailController.ExcelGoldDetail(page);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
@ -99,6 +105,11 @@ public class ExportExcelServiceImpl implements ExportExcelService {
public Exception handleExcel(String message) throws Exception { public Exception handleExcel(String message) throws Exception {
return exportExcelGeneric(message, "user", page -> { return exportExcelGeneric(message, "user", page -> {
try { 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); return goldDetailController.ExcelGold(page);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
@ -111,6 +122,11 @@ public class ExportExcelServiceImpl implements ExportExcelService {
public Exception rechargeExcel(String message) throws Exception { public Exception rechargeExcel(String message) throws Exception {
return exportExcelGeneric(message, "rechargeUser", page -> { return exportExcelGeneric(message, "rechargeUser", page -> {
try { 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); return rechargeController.selcet(page);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
@ -122,6 +138,11 @@ public class ExportExcelServiceImpl implements ExportExcelService {
public Exception consumeExcel(String message) throws Exception { public Exception consumeExcel(String message) throws Exception {
return exportExcelGeneric(message, "consumeUser", page -> { return exportExcelGeneric(message, "consumeUser", page -> {
try { 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); return consumeController.select(page);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
@ -134,6 +155,11 @@ public class ExportExcelServiceImpl implements ExportExcelService {
public Exception refundExcel(String message) throws Exception { public Exception refundExcel(String message) throws Exception {
return exportExcelGeneric(message, "refundUser", page -> { return exportExcelGeneric(message, "refundUser", page -> {
try { 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); return refundController.selcet(page);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
@ -145,6 +171,11 @@ public class ExportExcelServiceImpl implements ExportExcelService {
public Exception LiveExcel(String message) throws Exception { public Exception LiveExcel(String message) throws Exception {
return exportExcelGeneric(message, "liveUser", page -> { return exportExcelGeneric(message, "liveUser", page -> {
try { 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); return beanConsumeController.selectLiveBy(page);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
@ -156,6 +187,11 @@ public class ExportExcelServiceImpl implements ExportExcelService {
public Exception FanExcel(String message) throws Exception { public Exception FanExcel(String message) throws Exception {
return exportExcelGeneric(message, "fanUser", page -> { return exportExcelGeneric(message, "fanUser", page -> {
try { 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); return beanConsumeController.selectFanBy(page);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
@ -167,6 +203,11 @@ public class ExportExcelServiceImpl implements ExportExcelService {
public Exception ArticleExcel(String message) throws Exception { public Exception ArticleExcel(String message) throws Exception {
return exportExcelGeneric(message, "articleUser", page -> { return exportExcelGeneric(message, "articleUser", page -> {
try { 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); return beanConsumeController.selectArticleBy(page);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
@ -177,6 +218,11 @@ public class ExportExcelServiceImpl implements ExportExcelService {
public Exception BeanExcel(String message) throws Exception { public Exception BeanExcel(String message) throws Exception {
return exportExcelGeneric(message, "beanUser", page -> { return exportExcelGeneric(message, "beanUser", page -> {
try { 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); return beanRechargeController.selectBySystem(page);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
@ -187,6 +233,11 @@ public class ExportExcelServiceImpl implements ExportExcelService {
public Exception OnlineExcel(String message) throws Exception { public Exception OnlineExcel(String message) throws Exception {
return exportExcelGeneric(message, "onlineUser", page -> { return exportExcelGeneric(message, "onlineUser", page -> {
try { 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); return beanRechargeController.selectByOnline(page);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
@ -261,6 +312,9 @@ public class ExportExcelServiceImpl implements ExportExcelService {
Page page = new Page(); Page page = new Page();
page.setPageNum(1); page.setPageNum(1);
page.setPageSize(PAGE_SIZE); page.setPageSize(PAGE_SIZE);
if (exportType.equals("goldDetail")){
}
Integer totalCount = 0; Integer totalCount = 0;
boolean hasMore = true; boolean hasMore = true;

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

@ -4,7 +4,7 @@ spring:
fail-on-unknown-properties: false fail-on-unknown-properties: false
datasource: datasource:
mysql1: 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 username: hwgoldc
password: zB48T55wCsHC8KPz password: zB48T55wCsHC8KPz
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
@ -35,7 +35,7 @@ spring:
data: data:
redis: redis:
database: 0 database: 0
host: 18.143.76.3
host: localhost
port: 10703 port: 10703
password: Ngc0FYUTA6h3wC5J password: Ngc0FYUTA6h3wC5J

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

@ -4,7 +4,7 @@ spring:
fail-on-unknown-properties: false fail-on-unknown-properties: false
datasource: datasource:
mysql1: 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 username: hwgold
password: aDiw7MERSATdfGta password: aDiw7MERSATdfGta
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
@ -36,8 +36,8 @@ spring:
redis: redis:
database: 2 database: 2
host: localhost host: localhost
port: 6379
password: 123456
port: 10703
password: Ngc0FYUTA6h3wC5J
lettuce: lettuce:
pool: pool:

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

@ -4,7 +4,7 @@ spring:
fail-on-unknown-properties: false fail-on-unknown-properties: false
datasource: datasource:
mysql1: 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 username: hwgoldc
password: zB48T55wCsHC8KPz password: zB48T55wCsHC8KPz
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
@ -35,9 +35,9 @@ spring:
data: data:
redis: redis:
database: 0 database: 0
host: 18.143.76.3
port: 10703
password: Ngc0FYUTA6h3wC5J
host: localhost
port: 6379
password: 123456
lettuce: lettuce:
pool: pool:

Loading…
Cancel
Save