xiaoyong931011
2023-08-11 86c9e2f51f0b8b0fb1a6ee4b6d6a703878ad53e8
数据修改
13 files modified
154 ■■■■ changed files
src/main/java/cc/mrbird/febs/dapp/controller/ViewAdminMallGoodsController.java 2 ●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/dapp/enumerate/FundFlowEnum.java 14 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/dapp/service/impl/DappMemberServiceImpl.java 4 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/dapp/service/impl/DappSystemServiceImpl.java 86 ●●●● patch | view | raw | blame | history
src/main/resources/application-dev.yml 2 ●●● patch | view | raw | blame | history
src/main/resources/mapper/dapp/DappFundFlowDao.xml 1 ●●●● patch | view | raw | blame | history
src/main/resources/mapper/dapp/DappNodeOrderMapper.xml 2 ●●● patch | view | raw | blame | history
src/main/resources/mapper/dapp/DappSystemProfitDao.xml 2 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/dapp/DappWalletCoinDao.xml 2 ●●● patch | view | raw | blame | history
src/main/resources/mapper/dapp/DappWalletMineDao.xml 2 ●●● patch | view | raw | blame | history
src/main/resources/mapper/dapp/MallAchieveRecordMapper.xml 4 ●●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/dapp/money-change-flow.html 31 ●●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/goods/orderList.html 2 ●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/dapp/controller/ViewAdminMallGoodsController.java
@@ -75,6 +75,6 @@
    @RequiresPermissions("orderMoneyFlow:update")
    public String orderMoneyFlow(@PathVariable long id, Model model) {
        idOrderMoneyFlow = id;
        return FebsUtil.view("modules/order/orderMoneyFlow");
        return FebsUtil.view("goods/orderMoneyFlow");
    }
}
src/main/java/cc/mrbird/febs/dapp/enumerate/FundFlowEnum.java
@@ -7,6 +7,20 @@
 */
@Getter
public enum FundFlowEnum {
    //全网加速V7
    ALL_PERK_V7("ALL_PERK_V7", 37),
    //全网加速V6
    ALL_PERK_V6("ALL_PERK_V6", 36),
    //全网加速V5
    ALL_PERK_V5("ALL_PERK_V5", 35),
    //全网加速V4
    ALL_PERK_V4("ALL_PERK_V4", 34),
    //全网加速V3
    ALL_PERK_V3("ALL_PERK_V3", 33),
    //全网加速V2
    ALL_PERK_V2("ALL_PERK_V2", 32),
    //全网加速V1
    ALL_PERK_V1("ALL_PERK_V1", 31),
    //新增业绩
    ACHIEVE_ADD("ACHIEVE_ADD", 30),
    //系统操作资产包
src/main/java/cc/mrbird/febs/dapp/service/impl/DappMemberServiceImpl.java
@@ -663,8 +663,8 @@
    @Override
    @Transactional
    public void cancelOrder(Long id) {
        DappMemberEntity member = LoginUserUtil.getAppUser();
//        DappMemberEntity member = dappMemberDao.selectById(1L);
//        DappMemberEntity member = LoginUserUtil.getAppUser();
        DappMemberEntity member = dappMemberDao.selectById(1L);
        MallOrderInfo orderInfo = mallOrderInfoMapper.selectById(id);
        if (ObjectUtil.isEmpty(orderInfo)) {
            throw new FebsException("订单异常");
src/main/java/cc/mrbird/febs/dapp/service/impl/DappSystemServiceImpl.java
@@ -2812,7 +2812,7 @@
                 * 获取用户前一天的所有返利记录
                 */
                List<DappFundFlowEntity> dappFundFlowEntities = dappFundFlowDao.selectListByMemberIdAndTypeAndDate(directMemberId,
                        FundFlowEnum.STATIC_RELEASE.getCode(),DateUtil.offsetHour(DateUtil.date(),12));
                        FundFlowEnum.STATIC_RELEASE.getCode(),DateUtil.offsetHour(DateUtil.date(),-12));
                for(DappFundFlowEntity dappFundFlowEntity : dappFundFlowEntities){
                    BigDecimal staticReleaseAmount = dappFundFlowEntity.getAmount();
                    BigDecimal directReleaseAmount = staticReleaseAmount.multiply(directRelease).setScale(2, BigDecimal.ROUND_DOWN);
@@ -2845,7 +2845,7 @@
         * 获取用户前一天的所有返利记录
         */
        List<DappFundFlowEntity> dappFundFlowEntities = dappFundFlowDao.selectListByMemberIdAndTypeAndDate(memberId,
                FundFlowEnum.STATIC_RELEASE.getCode(),DateUtil.offsetHour(DateUtil.date(),12));
                FundFlowEnum.STATIC_RELEASE.getCode(),DateUtil.offsetHour(DateUtil.date(),-12));
        for(DappFundFlowEntity dappFundFlowEntity : dappFundFlowEntities){
            BigDecimal staticReleaseAmount = dappFundFlowEntity.getAmount();
            BigDecimal directReleaseAmount = staticReleaseAmount.multiply(directRelease).setScale(2, BigDecimal.ROUND_DOWN);
@@ -2868,30 +2868,37 @@
        List<DappMemberEntity> dappMemberEntities = dappMemberDao.selectMemberByAccountType(MemberLevelEnum.V1.getType());
        shareStaticPerk(dappMemberEntities,FundFlowEnum.SHARE_PERK_V1.getCode());
        teamStaticPerkMemberLevel(dappMemberEntities,teamPerkEquals,staticRelease,FundFlowEnum.TEAM_PERK_V1.getCode());
        isAllPerkMemberLevel(dappMemberEntities,MemberLevelEnum.V1.getType(),FundFlowEnum.ALL_PERK_V1.getCode());
        List<DappMemberEntity> v2DappMemberEntities = dappMemberDao.selectMemberByAccountType(MemberLevelEnum.V2.getType());
        shareStaticPerk(dappMemberEntities,FundFlowEnum.SHARE_PERK_V2.getCode());
        shareStaticPerk(v2DappMemberEntities,FundFlowEnum.SHARE_PERK_V2.getCode());
        teamStaticPerkMemberLevel(v2DappMemberEntities,teamPerkEquals,staticRelease,FundFlowEnum.TEAM_PERK_V2.getCode());
        isAllPerkMemberLevel(v2DappMemberEntities,MemberLevelEnum.V2.getType(),FundFlowEnum.ALL_PERK_V2.getCode());
        List<DappMemberEntity> v3DappMemberEntities = dappMemberDao.selectMemberByAccountType(MemberLevelEnum.V3.getType());
        shareStaticPerk(dappMemberEntities,FundFlowEnum.SHARE_PERK_V3.getCode());
        shareStaticPerk(v3DappMemberEntities,FundFlowEnum.SHARE_PERK_V3.getCode());
        teamStaticPerkMemberLevel(v3DappMemberEntities,teamPerkEquals,staticRelease,FundFlowEnum.TEAM_PERK_V3.getCode());
        isAllPerkMemberLevel(v3DappMemberEntities,MemberLevelEnum.V3.getType(),FundFlowEnum.ALL_PERK_V3.getCode());
        List<DappMemberEntity> v4DappMemberEntities = dappMemberDao.selectMemberByAccountType(MemberLevelEnum.V4.getType());
        shareStaticPerk(dappMemberEntities,FundFlowEnum.SHARE_PERK_V4.getCode());
        shareStaticPerk(v4DappMemberEntities,FundFlowEnum.SHARE_PERK_V4.getCode());
        teamStaticPerkMemberLevel(v4DappMemberEntities,teamPerkEquals,staticRelease,FundFlowEnum.TEAM_PERK_V4.getCode());
        isAllPerkMemberLevel(v4DappMemberEntities,MemberLevelEnum.V4.getType(),FundFlowEnum.ALL_PERK_V4.getCode());
        List<DappMemberEntity> v5DappMemberEntities = dappMemberDao.selectMemberByAccountType(MemberLevelEnum.V5.getType());
        shareStaticPerk(dappMemberEntities,FundFlowEnum.SHARE_PERK_V5.getCode());
        shareStaticPerk(v5DappMemberEntities,FundFlowEnum.SHARE_PERK_V5.getCode());
        teamStaticPerkMemberLevel(v5DappMemberEntities,teamPerkEquals,staticRelease,FundFlowEnum.TEAM_PERK_V5.getCode());
        isAllPerkMemberLevel(v5DappMemberEntities,MemberLevelEnum.V5.getType(),FundFlowEnum.ALL_PERK_V5.getCode());
        List<DappMemberEntity> v6DappMemberEntities = dappMemberDao.selectMemberByAccountType(MemberLevelEnum.V6.getType());
        shareStaticPerk(dappMemberEntities,FundFlowEnum.SHARE_PERK_V6.getCode());
        shareStaticPerk(v6DappMemberEntities,FundFlowEnum.SHARE_PERK_V6.getCode());
        teamStaticPerkMemberLevel(v6DappMemberEntities,teamPerkEquals,staticRelease,FundFlowEnum.TEAM_PERK_V6.getCode());
        isAllPerkMemberLevel(v6DappMemberEntities,MemberLevelEnum.V6.getType(),FundFlowEnum.ALL_PERK_V6.getCode());
        List<DappMemberEntity> v7DappMemberEntities = dappMemberDao.selectMemberByAccountType(MemberLevelEnum.V7.getType());
        shareStaticPerk(dappMemberEntities,FundFlowEnum.SHARE_PERK_V7.getCode());
        shareStaticPerk(v7DappMemberEntities,FundFlowEnum.SHARE_PERK_V7.getCode());
        teamStaticPerkMemberLevel(v7DappMemberEntities,teamPerkEquals,staticRelease,FundFlowEnum.TEAM_PERK_V7.getCode());
        isAllPerkMemberLevel(v7DappMemberEntities,MemberLevelEnum.V7.getType(),FundFlowEnum.ALL_PERK_V7.getCode());
    }
@@ -2951,7 +2958,9 @@
                 */
                for(MallAchieveRecord memberAchieve : mallAchieveRecords){
                    BigDecimal achieveAmount = memberAchieve.getAmount();
                    if(amount.compareTo(achieveAmount) < 0){
                    if(BigDecimal.ZERO.compareTo(amount) >= 0){
                        break;
                    }else if(amount.compareTo(achieveAmount) < 0){
                        memberAchieve.setAmount(achieveAmount.subtract(amount).setScale(2,BigDecimal.ROUND_DOWN));
                        mallAchieveRecordMapper.updateById(memberAchieve);
                        localTotalAchieve = localTotalAchieve.add(amount);
@@ -3163,6 +3172,47 @@
        }
    }
    public void isAllPerkMemberLevel(List<DappMemberEntity> dappMemberEntities,
                                     String level,
                                     int code){
        if(CollUtil.isEmpty(dappMemberEntities)){
            return;
        }
        DataDictionaryCustom teamPerkMemberDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
                "TEAM_LEVEL", level);
        TeamLevelPerk adminAgentInfo = JSONObject.parseObject(teamPerkMemberDic.getValue(), TeamLevelPerk.class);
        BigDecimal orderSalePercent = adminAgentInfo.getOrderSalePercent();
        if(BigDecimal.ZERO.compareTo(orderSalePercent) >= 0){
            return;
        }
        allPerkMemberLevel(dappMemberEntities,level,code);
    }
    public void allPerkMemberLevel(List<DappMemberEntity> dappMemberEntities,
                                   String level,
                                   int code) {
        /**
         * 全网24小时内的全部分红
         */
        Date createTime = DateUtil.offsetHour(DateUtil.date(),-24);
        //下第一单之后的共享区全部业绩
        BigDecimal totalAchieve = mallAchieveRecordMapper.selectAchieveTotalByCreateTime(createTime);
        if(BigDecimal.ZERO.compareTo(totalAchieve) >= 0){
            return;
        }
        DataDictionaryCustom teamPerkMemberDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
                "TEAM_LEVEL", level);
        TeamLevelPerk adminAgentInfo = JSONObject.parseObject(teamPerkMemberDic.getValue(), TeamLevelPerk.class);
        BigDecimal orderSalePercent = adminAgentInfo.getOrderSalePercent();
        //每人平分数量
        BigDecimal divide = totalAchieve.multiply(orderSalePercent).divide(new BigDecimal(dappMemberEntities.size()), 2, BigDecimal.ROUND_DOWN);
        for(DappMemberEntity dappMemberEntity : dappMemberEntities){
            sendPerk(dappMemberEntity, divide, dappMemberEntity.getId(), code);
        }
    }
    public void teamStaticPerkMemberLevel(List<DappMemberEntity> dappMemberEntities,
                                          BigDecimal teamPerkEquals,
                                          BigDecimal staticRelease,
@@ -3217,15 +3267,6 @@
        if(BigDecimal.ZERO.compareTo(directReleaseAmount) >= 0){
            return realScoreReduce;
        }
        //插入积分流水
        DappFundFlowEntity scoreFlow = new DappFundFlowEntity(
                parentMember.getId(),
                realScoreReduce.negate(),
                FundFlowEnum.REDUCE_SCORE.getCode(),
                DappFundFlowEntity.WITHDRAW_STATUS_AGREE,
                BigDecimal.ZERO,
                orderId);
        dappFundFlowDao.insert(scoreFlow);
        //生成一条静态补贴的流水
        DappFundFlowEntity realUsdtAmountFlow = new DappFundFlowEntity(
                parentMember.getId(),
@@ -3235,6 +3276,15 @@
                BigDecimal.ZERO,
                orderId);
        dappFundFlowDao.insert(realUsdtAmountFlow);
        //插入积分流水
        DappFundFlowEntity scoreFlow = new DappFundFlowEntity(
                parentMember.getId(),
                realScoreReduce.negate(),
                FundFlowEnum.REDUCE_SCORE.getCode(),
                DappFundFlowEntity.WITHDRAW_STATUS_AGREE,
                BigDecimal.ZERO,
                orderId);
        dappFundFlowDao.insert(scoreFlow);
        //插入余额流水
        DappFundFlowEntity amountFlow = new DappFundFlowEntity(
                parentMember.getId(),
src/main/resources/application-dev.yml
@@ -54,7 +54,7 @@
    publisher-confirm-type: correlated
system:
  online-transfer: false
  online-transfer: true
  chain-listener: false
  reset-job: false
  quartz-job: false
src/main/resources/mapper/dapp/DappFundFlowDao.xml
@@ -112,7 +112,6 @@
    <select id="selectInfoById" resultType="cc.mrbird.febs.dapp.entity.DappFundFlowEntity">
        select a.* from dapp_fund_flow a
        where a.id = #{id}
          for update
    </select>
    <update id="updateStatusById">
src/main/resources/mapper/dapp/DappNodeOrderMapper.xml
@@ -23,7 +23,7 @@
        select
               a.*
        from dapp_node_order a
        where a.node_code = #{nodeCode} for update
        where a.node_code = #{nodeCode}
    </select>
</mapper>
src/main/resources/mapper/dapp/DappSystemProfitDao.xml
@@ -8,7 +8,6 @@
        where state = #{state}
        order by id ASC
        limit 1
        for update
    </select>
    <select id="selectByIdForUpdate" resultType="cc.mrbird.febs.dapp.entity.DappSystemProfit">
@@ -16,7 +15,6 @@
        from dapp_system_profit a
        where a.id = #{id}
        and a.state = #{state}
        for update
    </select>
    <update id="updateLevelProfitById">
src/main/resources/mapper/dapp/DappWalletCoinDao.xml
@@ -3,7 +3,7 @@
<mapper namespace="cc.mrbird.febs.dapp.mapper.DappWalletCoinDao">
    <select id="selectByMemberId" resultType="cc.mrbird.febs.dapp.entity.DappWalletCoinEntity">
        select * from dapp_wallet_coin where member_id=#{memberId} for update
        select * from dapp_wallet_coin where member_id=#{memberId}
    </select>
    <select id="selectInPage" resultType="cc.mrbird.febs.dapp.entity.DappWalletCoinEntity">
src/main/resources/mapper/dapp/DappWalletMineDao.xml
@@ -3,7 +3,7 @@
<mapper namespace="cc.mrbird.febs.dapp.mapper.DappWalletMineDao">
    <select id="selectByMemberId" resultType="cc.mrbird.febs.dapp.entity.DappWalletMineEntity">
        select * from dapp_wallet_mine where member_id=#{memberId} for update
        select * from dapp_wallet_mine where member_id=#{memberId}
    </select>
    <select id="selectInPage" resultType="cc.mrbird.febs.dapp.entity.DappWalletMineEntity">
src/main/resources/mapper/dapp/MallAchieveRecordMapper.xml
@@ -48,13 +48,13 @@
        select IFNULL(sum(IFNULL(amount,0)),0) from mall_achieve_record
        where
            member_id = #{memberId}
            and payTime >= #{date}
            and pay_time >= #{date}
    </select>
    <select id="selectAchieveTotalByCreateTime" resultType="java.math.BigDecimal">
        select IFNULL(sum(IFNULL(amount,0)),0) from mall_achieve_record
        where payTime >= #{date}
        where pay_time >= #{date}
    </select>
    <select id="selectAchieveByMemberId" resultType="java.math.BigDecimal">
src/main/resources/templates/febs/views/dapp/money-change-flow.html
@@ -93,27 +93,30 @@
    11: {title: '团队静态收益V5', color: 'green'},
    12: {title: '团队静态收益V6', color: 'blue'},
    13: {title: '团队静态收益V7', color: 'orange'},
    14: {title: '共享区加速V1', color: 'green'},
    15: {title: '共享区加速V2', color: 'blue'},
    16: {title: '共享区加速V3', color: 'orange'},
    17: {title: '共享区加速V4', color: 'green'},
    18: {title: '共享区加速V5', color: 'blue'},
    19: {title: '共享区加速V6', color: 'orange'},
    20: {title: '共享区加速V7', color: 'green'},
    14: {title: '共享加速V1', color: 'green'},
    15: {title: '共享加速V2', color: 'blue'},
    16: {title: '共享加速V3', color: 'orange'},
    17: {title: '共享加速V4', color: 'green'},
    18: {title: '共享加速V5', color: 'blue'},
    19: {title: '共享加速V6', color: 'orange'},
    20: {title: '共享加速V7', color: 'green'},
    21: {title: '实际减少赠送积分', color: 'blue'},
    22: {title: '实际增加余额', color: 'orange'},
    23: {title: '卖出资产', color: 'green'},
    24: {title: '卖出资产获得余额', color: 'blue'},
    25: {title: '卖出资产手续费', color: 'orange'},
    26: {title: '每日获取金额(前端提示记录)', color: 'orange'},
    27: {title: '系统操作余额', color: 'green'},
    28: {title: '系统操作赠送积分', color: 'blue'},
    29: {title: '系统操作资产包', color: 'orange'},
    27: {title: '系统拨付余额', color: 'green'},
    28: {title: '系统拨付赠送积分', color: 'blue'},
    29: {title: '系统拨付资产包', color: 'orange'},
    30: {title: '新增业绩', color: 'green'},
    31: {title: 'AUSDT互转', color: 'blue'},
    32: {title: 'ANDAO互转', color: 'orange'},
    33: {title: '权益额度增加', color: 'green'},
    34: {title: '进入提现池', color: 'green'},
    31: {title: '全网分红V1', color: 'green'},
    32: {title: '全网分红V2', color: 'green'},
    33: {title: '全网分红V3', color: 'green'},
    34: {title: '全网分红V4', color: 'green'},
    35: {title: '全网分红V5', color: 'green'},
    36: {title: '全网分红V6', color: 'green'},
    37: {title: '全网分红V7', color: 'green'},
    }[d.type];
    }}
    <span class="layui-badge febs-bg-{{type.color}}">{{ type.title }}</span>
src/main/resources/templates/febs/views/goods/orderList.html
@@ -151,7 +151,7 @@
                });
            }
            if (layEvent === 'orderMoneyFlow') {
                febs.modal.open( '订单流水', 'modules/goods/orderMoneyFlow/' + data.id, {
                febs.modal.open( '订单流水', 'goodsView/orderMoneyFlow/' + data.id, {
                    maxmin: true,
                });
            }