From e79abc1405b30e7a6b8e825b399e499a4cb2a810 Mon Sep 17 00:00:00 2001 From: perry <292303709@qq.com> Date: Mon, 29 May 2023 12:54:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E9=94=80=E6=95=B0=E6=8D=AE=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shop/controller/app/member/MemberController.java | 9 +++------ .../shop/service/recharge/RechargeOrderServiceImpl.java | 5 +++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/member/MemberController.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/member/MemberController.java index a3e2f99bb..8343e7c22 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/member/MemberController.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/member/MemberController.java @@ -20,10 +20,7 @@ import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -63,10 +60,10 @@ public class MemberController { return CommonResult.success(rechargeOrderService.memberOrderInfo()); } @Operation(summary = "获取当前登录账号的推广员推广会员记录") - @RequestMapping(value = "/promoterOrderInfo", method = RequestMethod.GET) + @RequestMapping(value = "/promoterOrderInfo", method = RequestMethod.POST) @PreAuthenticated @TenantIgnore - public CommonResult> promoterOrderInfo(RechargeOrderPageReqVO pageRespVO) { + public CommonResult> promoterOrderInfo(@RequestBody RechargeOrderPageReqVO pageRespVO) { pageRespVO.setPromoterId(SecurityFrameworkUtils.getLoginUserId()); return CommonResult.success(rechargeOrderService.promoterOrderInfo(pageRespVO)); } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java index e35cb0b5f..1be0c09eb 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java @@ -207,7 +207,7 @@ public class RechargeOrderServiceImpl implements RechargeOrderService { appUserInfoReqDTO.setStartTime(LocalDateTimeUtil.beginOfDay(LocalDateTime.now())); appUserInfoReqDTO.setEndTime(LocalDateTimeUtil.endOfDay(LocalDateTime.now())); }else if (type == 2){ - LocalDateTime todayOfLastWeek = LocalDateTime.now(); + LocalDateTime todayOfLastWeek = LocalDateTime.now().minusDays(7); LocalDateTime monday = todayOfLastWeek.with(TemporalAdjusters.previous(DayOfWeek.SUNDAY)).plusDays(1); LocalDateTime sunday = todayOfLastWeek.with(TemporalAdjusters.next(DayOfWeek.MONDAY)).minusDays(1); appUserInfoReqDTO.setStartTime(LocalDateTimeUtil.beginOfDay(monday)); @@ -219,7 +219,8 @@ public class RechargeOrderServiceImpl implements RechargeOrderService { appUserInfoReqDTO.setStartTime(LocalDateTimeUtil.beginOfDay(firstDay)); appUserInfoReqDTO.setEndTime(LocalDateTimeUtil.endOfDay(lastDay)); } - promoterMemberOrderVO.setTotalAmount(rechargeOrderMapper.promoterOrderCount(appUserInfoReqDTO.getStartTime(),appUserInfoReqDTO.getEndTime(),promoterId)); + BigDecimal totalAmount =rechargeOrderMapper.promoterOrderCount(appUserInfoReqDTO.getStartTime(),appUserInfoReqDTO.getEndTime(),promoterId); + promoterMemberOrderVO.setTotalAmount(totalAmount); promoterMemberOrderVO.setMemberCount(memberUserApi.promoterOrderCount(appUserInfoReqDTO)); TenantDTO tenantDTO = tenantApi.getTenant(TenantContextHolder.getTenantId()); promoterMemberOrderVO.setMemberCommission(tenantDTO.getMemberCommission());