refactor(mall): 重构签到列表接口返回值
-将 ApiSignListVo 中的 amount 字段改为 remark 字段
- 更新 ScoreFlowTypeEnum 中的枚举值
- 修改 ScoreServiceImpl 中的查询逻辑,支持查询签到获得的积分和经验
| | |
| | | /** |
| | | * |
| | | */ |
| | | |
| | | PAY_BALANCE(9, "余额支付{}"), |
| | | PAY(1, "支付{}积分"), |
| | | |
| | | SIGN_EXPERIENCE(8, "签到获得{}会员经验"), |
| | | SIGN_SCORE(7, "签到获得{}积分"), |
| | | |
| | | SALE_RECOMMEND(6, "好友下单获得{}佣金"), |
| | | OTHER_RECOMMEND(5, "推荐下单获得{}积分"), |
| | | MINE_RECOMMEND(4, "下单获得{}积分"), |
| | | |
| | | PAY(1, "支付{}积分"), |
| | | |
| | | BUY(2, "购买商品,获得{}会员经验"), |
| | | |
| | | RECOMMEND(3, "推荐下单获得积分"); |
| | |
| | | // 创建分页对象,传入当前页和每页大小 |
| | | Page<MallMoneyFlow> page = new Page<>(dto.getPageNow(), dto.getPageSize()); |
| | | LambdaQueryWrapper<MallMoneyFlow> mallMoneyFlowLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | List<Integer> integers = Arrays.asList(ScoreFlowTypeEnum.SIGN_SCORE.getValue(), ScoreFlowTypeEnum.SIGN_EXPERIENCE.getValue()); |
| | | mallMoneyFlowLambdaQueryWrapper |
| | | .select(MallMoneyFlow::getCreatedTime, MallMoneyFlow::getAmount) |
| | | .select(MallMoneyFlow::getCreatedTime, MallMoneyFlow::getRemark) |
| | | .eq(MallMoneyFlow::getMemberId, memberId) |
| | | .eq(MallMoneyFlow::getFlowType, FlowTypeEnum.PRIZE_SCORE.getValue()) |
| | | .eq(MallMoneyFlow::getType, MoneyFlowTypeEnum.SCORE_SIGN.getValue()) |
| | | .in(MallMoneyFlow::getType, integers) |
| | | .orderByDesc(MallMoneyFlow::getId) |
| | | ; |
| | | // 调用Mapper方法获取活动分页数据 |
| | | Page<MallMoneyFlow> mallMoneyFlowPage = mallMoneyFlowService.getBaseMapper().selectPage(page, mallMoneyFlowLambdaQueryWrapper); |
| | | if(CollUtil.isNotEmpty(mallMoneyFlowPage.getRecords())){ |
| | | mallMoneyFlowPage.getRecords().forEach(item -> { |
| | | ApiSignListVo apiSignListVo = new ApiSignListVo(); |
| | | apiSignListVo.setAmount(item.getAmount()); |
| | | apiSignListVo.setRemark(item.getRemark()); |
| | | apiSignListVo.setCreatedTime(item.getCreatedTime()); |
| | | apiSignListVos.add(apiSignListVo); |
| | | }); |
| | |
| | | @ApiModel(value = "ApiSignListVo", description = "信息返回类") |
| | | public class ApiSignListVo { |
| | | |
| | | @ApiModelProperty(value = "金额,有正负") |
| | | private BigDecimal amount; |
| | | @ApiModelProperty(value = "内容") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |