xiaoyong931011
2022-09-02 f9df0d0d02a10034968ee174eedf2e46537a6fc1
20220822
3 files modified
20 ■■■■■ changed files
src/main/java/cc/mrbird/febs/mall/service/impl/MallMemberWithdrawServiceImpl.java 7 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/vo/MallGoodsCommentVo.java 9 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/modules/MallGoodsMapper.xml 4 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/service/impl/MallMemberWithdrawServiceImpl.java
@@ -80,13 +80,16 @@
        }
        walletService.reduce(withdrawalDto.getAmount(), memberId, "balance");
        String withdrawalNo = "TX_"+MallUtils.getOrderNum();
//        String withdrawalNo = "TX_"+MallUtils.getOrderNum();
        MallMemberWithdraw withdraw = new MallMemberWithdraw();
        withdraw.setWithdrawNo(withdrawalNo);
//        withdraw.setWithdrawNo(withdrawalNo);
        withdraw.setMemberId(memberId);
        withdraw.setAmount(withdrawalDto.getAmount());
        withdraw.setStatus(1);
        this.baseMapper.insert(withdraw);
        String withdrawalNo = "TX_"+withdraw.getId().toString();
        withdraw.setWithdrawNo(withdrawalNo);
        this.baseMapper.updateById(withdraw);
        mallMemberService.addMoneyFlow(memberId, withdrawalDto.getAmount().negate(), MoneyFlowTypeEnum.WITHDRAWAL.getValue(), withdrawalNo, null, null, null, 1, FlowTypeEnum.BALANCE.getValue());
    }
src/main/java/cc/mrbird/febs/mall/vo/MallGoodsCommentVo.java
@@ -32,4 +32,13 @@
    @ApiModelProperty(value = "是否匿名评价 1:匿名 2:不匿名")
    private Integer anonymousState;
    @ApiModelProperty(value = "好评 大于四星")
    private Integer greatNum;
    @ApiModelProperty(value = "好评 大于三星小于四星")
    private Integer goodNum;
    @ApiModelProperty(value = "差评 小于三星")
    private Integer badNum;
}
src/main/resources/mapper/modules/MallGoodsMapper.xml
@@ -220,6 +220,10 @@
    <select id="selectMallGoodsCommentListQueryInPage" resultType="cc.mrbird.febs.mall.vo.MallGoodsCommentVo">
        select
        a.*,
        (select count(z.id) from mall_goods_comment z where z.goods_id=#{record.goodsId} and a.star <![CDATA[ > ]]> 4) greatNum,
        (select count(z.id) from mall_goods_comment z where z.goods_id=#{record.goodsId}
                                                        and (a.star <![CDATA[ >= ]]> 3 and a.star <![CDATA[ <= ]]> 4)) goodNum,
        (select count(z.id) from mall_goods_comment z where z.goods_id=#{record.goodsId} and (a.star <![CDATA[ < ]]> 3 )) badNum,
        b.name name,
        b.avatar avatar
        from mall_goods_comment a