From d9361b75e7072b29535c571a76e0b9e7860d6805 Mon Sep 17 00:00:00 2001 From: KKSU <15274802129@163.com> Date: Mon, 06 Jan 2025 14:38:53 +0800 Subject: [PATCH] feat(mall): 后台活动列表添加分页和搜索功能 - 在 ActivityServiceImpl 中实现 getAdminListInPage 方法,支持分页和搜索 - 在 AdminActivityController 中添加 list 接口,返回分页数据 - 在 IActivityService 中定义 getAdminListInPage 接口 - 更新前端模板,根据活动状态控制按钮显示 --- src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallActServiceImpl.java | 21 +++++++++++++++++++-- 1 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallActServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallActServiceImpl.java index 6dc0050..137e07b 100644 --- a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallActServiceImpl.java +++ b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallActServiceImpl.java @@ -190,6 +190,7 @@ }else{ apiMallAwardDetailsVo.setAwardName("未中奖"); } + apiMallAwardDetailsVo.setAwardType(MallActAwardSet.AWARD_TYPE_XXCY); }else if(new BigDecimal(randomInt).compareTo(failureScope) > 0 && new BigDecimal(randomInt).compareTo(failureScope.add(maxProbability.multiply(new BigDecimal(100)))) <= 0){ //大于failureScope.add(maxProbability.multiply(new BigDecimal(100)))这个数字,则中奖 @@ -225,6 +226,7 @@ }else{ apiMallAwardDetailsVo.setAwardName("未中奖"); } + apiMallAwardDetailsVo.setAwardType(MallActAwardSet.AWARD_TYPE_XXCY); }else{ List<MallActAwardSet> idList = new ArrayList(); for(MallActAwardSet mallActAwardSet : mallActAwardSets){ @@ -293,6 +295,7 @@ }else{ apiMallAwardDetailsVo.setAwardName("未中奖"); } + apiMallAwardDetailsVo.setAwardType(MallActAwardSet.AWARD_TYPE_XXCY); } }else{ //获取活动下该类别的奖品 @@ -315,6 +318,7 @@ }else{ apiMallAwardDetailsVo.setAwardName("未中奖"); } + apiMallAwardDetailsVo.setAwardType(MallActAwardSet.AWARD_TYPE_XXCY); }else{ List<MallActAwardSet> idList = new ArrayList(); for(MallActAwardSet mallActAwardSet : mallActAwardSets){ @@ -400,6 +404,7 @@ }else{ apiMallAwardDetailsVo.setAwardName("未中奖"); } + apiMallAwardDetailsVo.setAwardType(MallActAwardSet.AWARD_TYPE_XXCY); }else{ List<MallActAwardSet> idList = new ArrayList(); for(MallActAwardSet mallActAwardSet : mallActAwardSets){ @@ -468,6 +473,7 @@ }else{ apiMallAwardDetailsVo.setAwardName("未中奖"); } + apiMallAwardDetailsVo.setAwardType(MallActAwardSet.AWARD_TYPE_XXCY); } }else{ //获取活动下该类别的奖品 @@ -490,6 +496,7 @@ }else{ apiMallAwardDetailsVo.setAwardName("未中奖"); } + apiMallAwardDetailsVo.setAwardType(MallActAwardSet.AWARD_TYPE_XXCY); }else{ List<MallActAwardSet> idList = new ArrayList(); for(MallActAwardSet mallActAwardSet : mallActAwardSets){ @@ -549,11 +556,21 @@ // wallet.setCommission(commission); // mallMemberWalletMapper.updateAmountWithVersion(wallet); + // 消耗积分 BigDecimal useScore = new BigDecimal(actScoreCnt); mallMemberWalletService.reduce(useScore, wallet.getMemberId(), "prizeScore"); - mallMemberWalletService.add(commission, wallet.getMemberId(), "commission"); mallMoneyFlowService.addMoneyFlow(wallet.getMemberId(), useScore.negate(), MoneyFlowTypeEnum.PRIZE.getValue(), null, FlowTypeEnum.PRIZE_SCORE.getValue()); - mallMoneyFlowService.addMoneyFlow(wallet.getMemberId(), commission, MoneyFlowTypeEnum.PRIZE.getValue(), null, FlowTypeEnum.COMMISSION.getValue()); + + if (apiMallAwardDetailsVo.getAwardType() != 3) { + BigDecimal prize = new BigDecimal(apiMallAwardDetailsVo.getAwardValue()); + if (apiMallAwardDetailsVo.getAwardType() == 1) { + mallMemberWalletService.add(prize, wallet.getMemberId(), "prizeScore"); + mallMoneyFlowService.addMoneyFlow(wallet.getMemberId(), prize, MoneyFlowTypeEnum.PRIZE.getValue(), null, FlowTypeEnum.PRIZE_SCORE.getValue()); + } else if (apiMallAwardDetailsVo.getAwardType() == 2) { + mallMemberWalletService.add(prize, wallet.getMemberId(), "commission"); + mallMoneyFlowService.addMoneyFlow(wallet.getMemberId(), prize, MoneyFlowTypeEnum.PRIZE.getValue(), null, FlowTypeEnum.COMMISSION.getValue()); + } + } return apiMallAwardDetailsVo; } -- Gitblit v1.9.1