| | |
| | | @RequiresPermissions("orderMoneyFlow:update") |
| | | public String orderMoneyFlow(@PathVariable long id, Model model) { |
| | | idOrderMoneyFlow = id; |
| | | return FebsUtil.view("modules/order/orderMoneyFlow"); |
| | | return FebsUtil.view("goods/orderMoneyFlow"); |
| | | } |
| | | } |
| | |
| | | */ |
| | | @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), |
| | | //系统操作资产包 |
| | |
| | | @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("订单异常"); |
| | |
| | | * 获取用户前一天的所有返利记录 |
| | | */ |
| | | 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); |
| | |
| | | * 获取用户前一天的所有返利记录 |
| | | */ |
| | | 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); |
| | |
| | | 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()); |
| | | |
| | | } |
| | | |
| | |
| | | */ |
| | | 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); |
| | |
| | | } |
| | | } |
| | | |
| | | 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, |
| | |
| | | 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(), |
| | |
| | | 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(), |
| | |
| | | publisher-confirm-type: correlated |
| | | |
| | | system: |
| | | online-transfer: false |
| | | online-transfer: true |
| | | chain-listener: false |
| | | reset-job: false |
| | | quartz-job: false |
| | |
| | | <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"> |
| | |
| | | select |
| | | a.* |
| | | from dapp_node_order a |
| | | where a.node_code = #{nodeCode} for update |
| | | where a.node_code = #{nodeCode} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | where state = #{state} |
| | | order by id ASC |
| | | limit 1 |
| | | for update |
| | | </select> |
| | | |
| | | <select id="selectByIdForUpdate" resultType="cc.mrbird.febs.dapp.entity.DappSystemProfit"> |
| | |
| | | from dapp_system_profit a |
| | | where a.id = #{id} |
| | | and a.state = #{state} |
| | | for update |
| | | </select> |
| | | |
| | | <update id="updateLevelProfitById"> |
| | |
| | | <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"> |
| | |
| | | <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"> |
| | |
| | | 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"> |
| | |
| | | 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> |
| | |
| | | }); |
| | | } |
| | | if (layEvent === 'orderMoneyFlow') { |
| | | febs.modal.open( '订单流水', 'modules/goods/orderMoneyFlow/' + data.id, { |
| | | febs.modal.open( '订单流水', 'goodsView/orderMoneyFlow/' + data.id, { |
| | | maxmin: true, |
| | | }); |
| | | } |