| | |
| | | package cc.mrbird.febs.job; |
| | | |
| | | import cc.mrbird.febs.dapp.entity.DappFundFlowEntity; |
| | | import cc.mrbird.febs.dapp.mapper.DappFundFlowDao; |
| | | import cc.mrbird.febs.rabbit.producer.ChainProducer; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cc.mrbird.febs.dapp.mapper.DappAKlineMapper; |
| | | import cc.mrbird.febs.dapp.service.DappSystemService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @ConditionalOnProperty(prefix = "system", name = "online-transfer", havingValue = "true") |
| | | public class BnbTransferJob{ |
| | | /** |
| | | * 搜索还未发生转账操作,但是记录已经更新没有产生HASH值的流水记录,并发起转账操作 |
| | | */ |
| | | @Autowired |
| | | private DappFundFlowDao dappFundFlowDao; |
| | | @Autowired |
| | | private ChainProducer chainProducer; |
| | | |
| | | @Scheduled(cron = "0/10 * * * * ? ") |
| | | public void BnbTransferAgain() { |
| | | DappFundFlowEntity dappFundFlowEntity = dappFundFlowDao.selectByStateAndVersionAndFromHashLimitOne(2,2); |
| | | if(ObjectUtil.isNotEmpty(dappFundFlowEntity)){ |
| | | Integer isReturn = dappFundFlowEntity.getIsReturn(); |
| | | if(DappFundFlowEntity.WITHDRAW_STATUS_AGREE == isReturn){ |
| | | dappFundFlowEntity.setIsReturn(1); |
| | | dappFundFlowDao.updateById(dappFundFlowEntity); |
| | | chainProducer.sendBnbTransferTestMsg(dappFundFlowEntity.getId()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Autowired |
| | | private DappSystemService dappSystemService; |
| | | @Autowired |
| | | private DappAKlineMapper dappAKlineMapper; |
| | | |
| | | // @Scheduled(cron = "0 0 0 * * ?") |
| | | // @Scheduled(cron = "0 0 2 * * ?") |
| | | // public void memberPerk() { |
| | | // /** |
| | | // * 加速团队静态收益的70%(业绩全算) |
| | | // * 加速团队静态收益为极差制,平级10% |
| | | // * 如V1加速团队静态收益的15%=每日静态的20000*6‰*15%=18元的额外释放加速 |
| | | // * 共享区加速万分之5,上限1.8%(按本金计) |
| | | // */ |
| | | // dappSystemService.teamStaticPerk(); |
| | | // /** |
| | | // * 每天按照消费金额的5‰静释放(千分之五的静态释放比例) |
| | | // * (按购买顺序结算,同时有5个订单就有结算记录) |
| | | // * (设置多少,全部按照最新的来释放) |
| | | // */ |
| | | // dappSystemService.memberPerk(); |
| | | // /** |
| | | // * 直推消费分享:享受直接分享人每日消费金额释放的100%加速; |
| | | // */ |
| | | // dappSystemService.directMemberPerk(); |
| | | // /** |
| | | // * 实际更新账户业绩余额和积分 |
| | | // */ |
| | | // Set<DappMemberEntity> dappMemberEntities = dappSystemService.updateAchieve(); |
| | | // if(CollUtil.isNotEmpty(dappMemberEntities)){ |
| | | // /** |
| | | // * 奖励;团队产生的收益1%奖励积分,对标价格 |
| | | // */ |
| | | // dappSystemService.updatePackage(dappMemberEntities); |
| | | // } |
| | | // } |
| | | // |
| | | // @Scheduled(cron = "0 0 0/4 * * ?") |
| | | // public void klineUpdate() { |
| | | // DappAKlineEntity dappAKlineEntity = new DappAKlineEntity(); |
| | | // dappAKlineEntity.setType(2); |
| | | // DappAKlineEntity dappAKlineOld = dappAKlineMapper.selectOneHourByType(); |
| | | // if(ObjectUtil.isEmpty(dappAKlineOld)){ |
| | | // dappAKlineEntity.setOpenPrice(BigDecimal.ZERO); |
| | | // }else{ |
| | | // dappAKlineEntity.setOpenPrice(dappAKlineOld.getOpenPrice()); |
| | | // } |
| | | // dappAKlineMapper.insert(dappAKlineEntity); |
| | | // } |
| | | |
| | | } |