From 04502b56852d1e94146c5dcd5fb0f2dc26fc1ec2 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Tue, 9 Sep 2025 17:53:44 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E9=87=91=E5=B8=81=E4=BB=A3=E7=90=86):=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=87=91=E5=B8=81=E4=BB=A3=E7=90=86=E5=BD=93?= =?UTF-8?q?=E6=9C=88=E4=B8=8A=E6=9C=88=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/UserMonthlyRechargeClientApi.java | 8 ++++ .../model/dto/MonthlyRechargeSummaryVO.java | 38 +++++++++++++++++++ .../rds/dao/count/UserMonthlyRechargeDAO.java | 4 ++ .../count/UserMonthlyRechargeService.java | 5 +++ .../impl/UserMonthlyRechargeServiceImpl.java | 8 ++++ .../dao/count/UserMonthlyRechargeDAO.xml | 18 +++++++++ .../UserMonthlyRechargeClientEndpoint.java | 6 +++ .../UserMonthlyRechargeClientService.java | 7 ++++ .../UserMonthlyRechargeClientServiceImpl.java | 6 +++ .../app/h5/MemberActiveController.java | 11 ++++++ .../user/user/RechargeUserServiceImpl.java | 8 +++- .../service/recharge/RechargeUserService.java | 4 ++ 12 files changed, 121 insertions(+), 2 deletions(-) create mode 100644 rc-service/rc-inner-api/order-inner/order-inner-model/src/main/java/com/red/circle/order/inner/model/dto/MonthlyRechargeSummaryVO.java diff --git a/rc-service/rc-inner-api/order-inner/order-inner-api/src/main/java/com/red/circle/order/inner/endpoint/api/UserMonthlyRechargeClientApi.java b/rc-service/rc-inner-api/order-inner/order-inner-api/src/main/java/com/red/circle/order/inner/endpoint/api/UserMonthlyRechargeClientApi.java index 438f753f..43d7ada6 100644 --- a/rc-service/rc-inner-api/order-inner/order-inner-api/src/main/java/com/red/circle/order/inner/endpoint/api/UserMonthlyRechargeClientApi.java +++ b/rc-service/rc-inner-api/order-inner/order-inner-api/src/main/java/com/red/circle/order/inner/endpoint/api/UserMonthlyRechargeClientApi.java @@ -3,6 +3,7 @@ package com.red.circle.order.inner.endpoint.api; import com.red.circle.framework.dto.ResultResponse; import com.red.circle.order.inner.model.cmd.MonthlyRechargeDatesQryCmd; import com.red.circle.order.inner.model.cmd.MonthlyRechargeQryCmd; +import com.red.circle.order.inner.model.dto.MonthlyRechargeSummaryVO; import com.red.circle.order.inner.model.dto.UserMonthlyRechargeDTO; import java.util.List; import java.util.Map; @@ -54,4 +55,11 @@ public interface UserMonthlyRechargeClientApi { @GetMapping("/listLastMonthByIds") ResultResponse> listLastMonthByIds(@RequestParam("userIds") List userIds); + /** + * 获取金币代理本月和上个月的充值汇总. + */ + @GetMapping("/monthly-summary") + ResultResponse> getMonthlyRechargeSummary(); + + } diff --git a/rc-service/rc-inner-api/order-inner/order-inner-model/src/main/java/com/red/circle/order/inner/model/dto/MonthlyRechargeSummaryVO.java b/rc-service/rc-inner-api/order-inner/order-inner-model/src/main/java/com/red/circle/order/inner/model/dto/MonthlyRechargeSummaryVO.java new file mode 100644 index 00000000..0f7efe76 --- /dev/null +++ b/rc-service/rc-inner-api/order-inner/order-inner-model/src/main/java/com/red/circle/order/inner/model/dto/MonthlyRechargeSummaryVO.java @@ -0,0 +1,38 @@ +package com.red.circle.order.inner.model.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 月度充值汇总VO + * + * @author + * @date + */ +@Data +public class MonthlyRechargeSummaryVO { + + /** + * 充值月份显示 + */ + private String rechargeMonth; + + /** + * 充值日期 + */ + private Integer rechargeDate; + + /** + * 充值用户数量 + */ + private Long userCount; + + /** + * 总充值金额 + */ + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal totalAmount; + +} \ No newline at end of file diff --git a/rc-service/rc-service-order/order-infrastructure/src/main/java/com/red/circle/order/infra/database/rds/dao/count/UserMonthlyRechargeDAO.java b/rc-service/rc-service-order/order-infrastructure/src/main/java/com/red/circle/order/infra/database/rds/dao/count/UserMonthlyRechargeDAO.java index 4297d6d4..9fb0f300 100644 --- a/rc-service/rc-service-order/order-infrastructure/src/main/java/com/red/circle/order/infra/database/rds/dao/count/UserMonthlyRechargeDAO.java +++ b/rc-service/rc-service-order/order-infrastructure/src/main/java/com/red/circle/order/infra/database/rds/dao/count/UserMonthlyRechargeDAO.java @@ -2,6 +2,9 @@ package com.red.circle.order.infra.database.rds.dao.count; import com.red.circle.framework.mybatis.dao.BaseDAO; import com.red.circle.order.infra.database.rds.entity.count.UserMonthlyRecharge; +import com.red.circle.order.inner.model.dto.MonthlyRechargeSummaryVO; + +import java.util.List; /** *

@@ -13,4 +16,5 @@ import com.red.circle.order.infra.database.rds.entity.count.UserMonthlyRecharge; */ public interface UserMonthlyRechargeDAO extends BaseDAO { + List getMonthlyTotalRecharge(); } diff --git a/rc-service/rc-service-order/order-infrastructure/src/main/java/com/red/circle/order/infra/database/rds/service/count/UserMonthlyRechargeService.java b/rc-service/rc-service-order/order-infrastructure/src/main/java/com/red/circle/order/infra/database/rds/service/count/UserMonthlyRechargeService.java index 2ef759bb..908b8851 100644 --- a/rc-service/rc-service-order/order-infrastructure/src/main/java/com/red/circle/order/infra/database/rds/service/count/UserMonthlyRechargeService.java +++ b/rc-service/rc-service-order/order-infrastructure/src/main/java/com/red/circle/order/infra/database/rds/service/count/UserMonthlyRechargeService.java @@ -2,6 +2,7 @@ package com.red.circle.order.infra.database.rds.service.count; import com.red.circle.framework.mybatis.service.BaseService; import com.red.circle.order.infra.database.rds.entity.count.UserMonthlyRecharge; +import com.red.circle.order.inner.model.dto.MonthlyRechargeSummaryVO; import com.red.circle.order.inner.model.enums.MonthlyRechargeType; import java.math.BigDecimal; import java.util.List; @@ -68,4 +69,8 @@ public interface UserMonthlyRechargeService extends BaseService listLastMonthByIds(List userIds); + /** + * 当月和上个月 金币代理充值汇总 + */ + List getMonthlyRechargeSummary(); } diff --git a/rc-service/rc-service-order/order-infrastructure/src/main/java/com/red/circle/order/infra/database/rds/service/count/impl/UserMonthlyRechargeServiceImpl.java b/rc-service/rc-service-order/order-infrastructure/src/main/java/com/red/circle/order/infra/database/rds/service/count/impl/UserMonthlyRechargeServiceImpl.java index 91c92695..36ba87a0 100644 --- a/rc-service/rc-service-order/order-infrastructure/src/main/java/com/red/circle/order/infra/database/rds/service/count/impl/UserMonthlyRechargeServiceImpl.java +++ b/rc-service/rc-service-order/order-infrastructure/src/main/java/com/red/circle/order/infra/database/rds/service/count/impl/UserMonthlyRechargeServiceImpl.java @@ -6,6 +6,7 @@ import com.red.circle.framework.mybatis.service.impl.BaseServiceImpl; import com.red.circle.order.infra.database.rds.dao.count.UserMonthlyRechargeDAO; import com.red.circle.order.infra.database.rds.entity.count.UserMonthlyRecharge; import com.red.circle.order.infra.database.rds.service.count.UserMonthlyRechargeService; +import com.red.circle.order.inner.model.dto.MonthlyRechargeSummaryVO; import com.red.circle.order.inner.model.enums.MonthlyRechargeType; import com.red.circle.tool.core.collection.CollectionUtils; import com.red.circle.tool.core.date.LocalDateUtils; @@ -36,6 +37,8 @@ public class UserMonthlyRechargeServiceImpl extends BaseServiceImpl implements UserMonthlyRechargeService { + private final UserMonthlyRechargeDAO userMonthlyRechargeDAO; + @Override public void incrThisMonthAmount(Long userId, BigDecimal amount, MonthlyRechargeType type) { UserMonthlyRecharge userMonthlyRecharge = query() @@ -180,6 +183,11 @@ public class UserMonthlyRechargeServiceImpl extends .list(); } + @Override + public List getMonthlyRechargeSummary() { + return userMonthlyRechargeDAO.getMonthlyTotalRecharge(); + } + private int nowThisMonth() { return LocalDateUtils.nowThisMonthToInteger(); } diff --git a/rc-service/rc-service-order/order-infrastructure/src/main/resources/dao/count/UserMonthlyRechargeDAO.xml b/rc-service/rc-service-order/order-infrastructure/src/main/resources/dao/count/UserMonthlyRechargeDAO.xml index 810d5c4e..87ceaf88 100644 --- a/rc-service/rc-service-order/order-infrastructure/src/main/resources/dao/count/UserMonthlyRechargeDAO.xml +++ b/rc-service/rc-service-order/order-infrastructure/src/main/resources/dao/count/UserMonthlyRechargeDAO.xml @@ -4,4 +4,22 @@ + + diff --git a/rc-service/rc-service-order/order-inner-endpoint/src/main/java/com/red/circle/order/inner/endpoint/UserMonthlyRechargeClientEndpoint.java b/rc-service/rc-service-order/order-inner-endpoint/src/main/java/com/red/circle/order/inner/endpoint/UserMonthlyRechargeClientEndpoint.java index 0816b700..a7d76271 100644 --- a/rc-service/rc-service-order/order-inner-endpoint/src/main/java/com/red/circle/order/inner/endpoint/UserMonthlyRechargeClientEndpoint.java +++ b/rc-service/rc-service-order/order-inner-endpoint/src/main/java/com/red/circle/order/inner/endpoint/UserMonthlyRechargeClientEndpoint.java @@ -4,6 +4,7 @@ import com.red.circle.framework.dto.ResultResponse; import com.red.circle.order.inner.endpoint.api.UserMonthlyRechargeClientApi; import com.red.circle.order.inner.model.cmd.MonthlyRechargeDatesQryCmd; import com.red.circle.order.inner.model.cmd.MonthlyRechargeQryCmd; +import com.red.circle.order.inner.model.dto.MonthlyRechargeSummaryVO; import com.red.circle.order.inner.model.dto.UserMonthlyRechargeDTO; import com.red.circle.order.inner.service.UserMonthlyRechargeClientService; import java.util.List; @@ -66,4 +67,9 @@ public class UserMonthlyRechargeClientEndpoint implements UserMonthlyRechargeCli ); } + @Override + public ResultResponse> getMonthlyRechargeSummary() { + return ResultResponse.success(userMonthlyRechargeClientService.getMonthlyRechargeSummary()); + } + } diff --git a/rc-service/rc-service-order/order-inner-endpoint/src/main/java/com/red/circle/order/inner/service/UserMonthlyRechargeClientService.java b/rc-service/rc-service-order/order-inner-endpoint/src/main/java/com/red/circle/order/inner/service/UserMonthlyRechargeClientService.java index fb345ff2..577e43f8 100644 --- a/rc-service/rc-service-order/order-inner-endpoint/src/main/java/com/red/circle/order/inner/service/UserMonthlyRechargeClientService.java +++ b/rc-service/rc-service-order/order-inner-endpoint/src/main/java/com/red/circle/order/inner/service/UserMonthlyRechargeClientService.java @@ -2,6 +2,7 @@ package com.red.circle.order.inner.service; import com.red.circle.order.inner.model.cmd.MonthlyRechargeDatesQryCmd; import com.red.circle.order.inner.model.cmd.MonthlyRechargeQryCmd; +import com.red.circle.order.inner.model.dto.MonthlyRechargeSummaryVO; import com.red.circle.order.inner.model.dto.UserMonthlyRechargeDTO; import java.util.List; import java.util.Map; @@ -39,4 +40,10 @@ public interface UserMonthlyRechargeClientService { */ List listLastMonthByIds(List userIds); + /** + * 批量获取用户上月充值. + */ + List getMonthlyRechargeSummary(); + + } diff --git a/rc-service/rc-service-order/order-inner-endpoint/src/main/java/com/red/circle/order/inner/service/impl/UserMonthlyRechargeClientServiceImpl.java b/rc-service/rc-service-order/order-inner-endpoint/src/main/java/com/red/circle/order/inner/service/impl/UserMonthlyRechargeClientServiceImpl.java index c89bd5bd..d91e09c0 100644 --- a/rc-service/rc-service-order/order-inner-endpoint/src/main/java/com/red/circle/order/inner/service/impl/UserMonthlyRechargeClientServiceImpl.java +++ b/rc-service/rc-service-order/order-inner-endpoint/src/main/java/com/red/circle/order/inner/service/impl/UserMonthlyRechargeClientServiceImpl.java @@ -4,6 +4,7 @@ import com.red.circle.order.infra.database.rds.service.count.UserMonthlyRecharge import com.red.circle.order.inner.convertor.UserMonthlyRechargeInnerConvertor; import com.red.circle.order.inner.model.cmd.MonthlyRechargeDatesQryCmd; import com.red.circle.order.inner.model.cmd.MonthlyRechargeQryCmd; +import com.red.circle.order.inner.model.dto.MonthlyRechargeSummaryVO; import com.red.circle.order.inner.model.dto.UserMonthlyRechargeDTO; import com.red.circle.order.inner.service.UserMonthlyRechargeClientService; import java.util.List; @@ -60,4 +61,9 @@ public class UserMonthlyRechargeClientServiceImpl implements UserMonthlyRecharge ); } + @Override + public List getMonthlyRechargeSummary() { + return userMonthlyRechargeService.getMonthlyRechargeSummary(); + } + } diff --git a/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/h5/MemberActiveController.java b/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/h5/MemberActiveController.java index a9e41c4f..1ec4e34c 100644 --- a/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/h5/MemberActiveController.java +++ b/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/h5/MemberActiveController.java @@ -7,6 +7,7 @@ import com.red.circle.framework.web.controller.BaseController; import com.red.circle.order.inner.endpoint.UserFreightRechargeRecordClient; import com.red.circle.order.inner.endpoint.UserMonthlyRechargeClient; import com.red.circle.order.inner.endpoint.api.UserMonthlyRechargeClientApi; +import com.red.circle.order.inner.model.dto.MonthlyRechargeSummaryVO; import com.red.circle.other.app.dto.h5.MemberActiveDTO; import com.red.circle.other.app.dto.h5.RechargePageVO; import com.red.circle.other.app.dto.h5.UserIdentityVO; @@ -18,6 +19,8 @@ import lombok.RequiredArgsConstructor; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.*; +import java.util.List; + @RequiredArgsConstructor @RestController @RequestMapping(value = "/app/h5/", produces = MediaType.APPLICATION_JSON_VALUE) @@ -62,4 +65,12 @@ public class MemberActiveController extends BaseController { return rechargeUserService.getRechargePage(page, cmd); } + /** + * 货运代理充值月度汇总(当月,上月) + */ + @GetMapping("/recharge-summary") + public List rechargeSummary(AppExtCommand cmd) { + return rechargeUserService.getRechargeSummary(cmd); + } + } diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/user/RechargeUserServiceImpl.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/user/RechargeUserServiceImpl.java index ba081296..95e063d4 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/user/RechargeUserServiceImpl.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/user/RechargeUserServiceImpl.java @@ -9,6 +9,7 @@ import com.red.circle.framework.dto.PageQuery; import com.red.circle.framework.dto.PageResult; import com.red.circle.framework.dto.ResultResponse; import com.red.circle.order.inner.endpoint.UserMonthlyRechargeClient; +import com.red.circle.order.inner.model.dto.MonthlyRechargeSummaryVO; import com.red.circle.order.inner.model.dto.UserMonthlyRechargeDTO; import com.red.circle.other.app.dto.h5.RechargePageVO; import com.red.circle.other.app.dto.h5.RechargeVO; @@ -48,8 +49,6 @@ public class RechargeUserServiceImpl implements RechargeUserService { } UserFreightBalancePageQryCmd qryCmd = new UserFreightBalancePageQryCmd(); - qryCmd.setClose(false); - qryCmd.setDisplay(false); qryCmd.setSysOrigin(cmd.getReqSysOrigin().getOrigin()); qryCmd.setPageQuery(page.getPageQuery()); PageResult pageResult = freightGoldClient.pageFreight(qryCmd).getBody(); @@ -76,6 +75,11 @@ public class RechargeUserServiceImpl implements RechargeUserService { }); } + @Override + public List getRechargeSummary(AppExtCommand cmd) { + return userMonthlyRechargeClient.getMonthlyRechargeSummary().getBody(); + } + private Map getThisMonthRechargeAmount(List collect) { List recharges = userMonthlyRechargeClient.listThisMonthByIds(collect).getBody(); return getLongBigDecimalMap(recharges); diff --git a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/service/recharge/RechargeUserService.java b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/service/recharge/RechargeUserService.java index dd596c8f..b1eebbb3 100644 --- a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/service/recharge/RechargeUserService.java +++ b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/service/recharge/RechargeUserService.java @@ -3,8 +3,11 @@ package com.red.circle.other.app.service.recharge; import com.red.circle.common.business.dto.cmd.AppExtCommand; import com.red.circle.common.business.dto.cmd.PageUserIdCmd; import com.red.circle.framework.dto.PageResult; +import com.red.circle.order.inner.model.dto.MonthlyRechargeSummaryVO; import com.red.circle.other.app.dto.h5.RechargePageVO; +import java.util.List; + public interface RechargeUserService { /** @@ -12,4 +15,5 @@ public interface RechargeUserService { */ PageResult getRechargePage(PageUserIdCmd page, AppExtCommand cmd); + List getRechargeSummary(AppExtCommand cmd); }