xiaoyong931011
2021-12-08 f0ac9f97682703601c73144a882b81355a13c830
20211208  fish
5 files modified
14 ■■■■■ changed files
src/main/java/com/xcong/excoin/modules/fish/entity/CannonAward.java 1 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/fish/service/impl/MemberCannonServiceImpl.java 5 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/fish/vo/AwardVo.java 3 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/fish/vo/CannonAwardVo.java 3 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/fish/CannonOwnRecordDao.xml 2 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/fish/entity/CannonAward.java
@@ -12,6 +12,7 @@
    private String name;
    //活动编码
    private String code;
    private String image;
    private Integer quantity;
    private Integer surplusQuantity;
src/main/java/com/xcong/excoin/modules/fish/service/impl/MemberCannonServiceImpl.java
@@ -354,18 +354,21 @@
                MemberAccountGold memberAccountGold = memberAccountGoldDao.selectAccountGoldByMemberId(memberId);
                memberCannonService.updateTotalBalanceAndAvailableBalance(memberAccountGold.getId(),quantity,quantity,null);
                cannonAwardVo.setName(cannonAward.getName());
                cannonAwardVo.setImage(cannonAward.getImage());
                cannonAwardVo.setQuantity(cannonAward.getQuantity());
            }else if("COIN".equals(cannonAward.getCode())){
                BigDecimal quantity = new BigDecimal(cannonAward.getQuantity());
                MemberWalletCoinEntity memberWalletCoinEntity = memberWalletCoinDao.selectWalletCoinBymIdAndCode(memberId, CoinTypeEnum.XCC.name());
                coinService.updateWalletBalance(memberWalletCoinEntity.getId(),quantity,quantity,null);
                cannonAwardVo.setName(cannonAward.getName());
                cannonAwardVo.setImage(cannonAward.getImage());
                cannonAwardVo.setQuantity(cannonAward.getQuantity());
            }else if("USDT".equals(cannonAward.getCode())){
                BigDecimal quantity = new BigDecimal(cannonAward.getQuantity());
                MemberWalletCoinEntity memberWalletCoinEntity = memberWalletCoinDao.selectWalletCoinBymIdAndCode(memberId, CoinTypeEnum.USDT.name());
                coinService.updateWalletBalance(memberWalletCoinEntity.getId(),quantity,quantity,null);
                cannonAwardVo.setName(cannonAward.getName());
                cannonAwardVo.setImage(cannonAward.getImage());
                cannonAwardVo.setQuantity(cannonAward.getQuantity());
            }else{
                CannonSetting cannonSetting = cannonSettingDao.selectCannonSettingByCannonCode(cannonAward.getCode());
@@ -384,6 +387,7 @@
                    cannonOwnRecordDao.insert(cannonOwnRecord);
                    cannonAwardVo.setName(cannonAward.getName());
                    cannonAwardVo.setImage(cannonAward.getImage());
                    cannonAwardVo.setQuantity(cannonAward.getQuantity());
                }else{
                    CannonAward cannonAwardGold = cannonOwnRecordDao.selectCannonAwardByCode("GOLD");
@@ -391,6 +395,7 @@
                    MemberAccountGold memberAccountGold = memberAccountGoldDao.selectAccountGoldByMemberId(memberId);
                    memberCannonService.updateTotalBalanceAndAvailableBalance(memberAccountGold.getId(),quantity,quantity,null);
                    cannonAwardVo.setName(cannonAwardGold.getName());
                    cannonAwardVo.setImage(cannonAwardGold.getImage());
                    cannonAwardVo.setQuantity(cannonAwardGold.getQuantity());
                }
            }
src/main/java/com/xcong/excoin/modules/fish/vo/AwardVo.java
@@ -11,6 +11,9 @@
    @ApiModelProperty(value = "奖品名称")
    private String name;
    @ApiModelProperty(value = "奖品图片")
    private String image;
    @ApiModelProperty(value = "奖品数量")
    private Integer quantity;
src/main/java/com/xcong/excoin/modules/fish/vo/CannonAwardVo.java
@@ -13,4 +13,7 @@
    @ApiModelProperty(value = "奖品数量")
    private Integer quantity;
    @ApiModelProperty(value = "奖品图片")
    private String image;
}
src/main/resources/mapper/fish/CannonOwnRecordDao.xml
@@ -24,6 +24,7 @@
        <collection property="awardVo" ofType="com.xcong.excoin.modules.fish.vo.AwardVo" >
            <result property="name" column="name" />
            <result property="quantity" column="quantity" />
            <result property="image" column="image" />
        </collection>
    </resultMap>
@@ -31,6 +32,7 @@
        select
            a.consume,
            b.quantity,
            b.image,
            b.name
        from cannon_award_set a
        inner join cannon_award b on a.code = b.activity_code