package cc.mrbird.febs.mall.quartz;
|
|
import cc.mrbird.febs.common.enumerates.AgentLevelEnum;
|
import cc.mrbird.febs.common.enumerates.DataDictionaryEnum;
|
import cc.mrbird.febs.common.enumerates.MoneyFlowTypeEnum;
|
import cc.mrbird.febs.common.utils.AppContants;
|
import cc.mrbird.febs.common.utils.MallUtils;
|
import cc.mrbird.febs.mall.chain.ChainEnum;
|
import cc.mrbird.febs.mall.chain.ChainService;
|
import cc.mrbird.febs.mall.entity.DataDictionaryCustom;
|
import cc.mrbird.febs.mall.entity.MallMember;
|
import cc.mrbird.febs.mall.entity.MallMoneyFlow;
|
import cc.mrbird.febs.mall.mapper.DataDictionaryCustomMapper;
|
import cc.mrbird.febs.mall.mapper.MallMemberMapper;
|
import cc.mrbird.febs.mall.mapper.MallMoneyFlowMapper;
|
import cc.mrbird.febs.mall.service.IAgentService;
|
import cc.mrbird.febs.mall.service.IApiMallMemberService;
|
import cc.mrbird.febs.mall.service.IApiMallMemberWalletService;
|
import cc.mrbird.febs.mall.service.IMemberProfitService;
|
import cc.mrbird.febs.mall.service.impl.CommonService;
|
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.date.DateTime;
|
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.StrUtil;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.stereotype.Component;
|
import org.springframework.transaction.annotation.Transactional;
|
|
import java.math.BigDecimal;
|
import java.math.RoundingMode;
|
import java.util.Date;
|
import java.util.List;
|
|
/**
|
* @author wzy
|
* @date 2021-09-28
|
**/
|
@Slf4j
|
@Component
|
public class ProfitJob {
|
|
@Autowired
|
private IMemberProfitService memberProfitService;
|
@Autowired
|
private IAgentService agentService;
|
@Autowired
|
private DataDictionaryCustomMapper dataDictionaryCustomMapper;
|
@Autowired
|
private CommonService commonService;
|
|
/**
|
* 代理分红
|
*/
|
// @Scheduled(cron = "0 30 0 * * ?")
|
// public void profitJob() {
|
// memberProfitService.agentProfit(null);
|
// }
|
|
// @Scheduled(cron = "0 30 1 * * ?")
|
// public void storeAndDirectorJob() {
|
// memberProfitService.storeAndDirectorProfit(null);
|
// }
|
|
// /**
|
// * 线下服务中心补贴
|
// */
|
// @Scheduled(cron = "0 0 1 * * ?")
|
// public void thankfulJob() {
|
// memberProfitService.thankfulProfit(null);
|
// }
|
|
// /**
|
// * 代理商补贴 TODO 需要去掉注释
|
// */
|
// @Scheduled(cron = "0 0 1 * * ?")
|
// public void agentPerkJob() {
|
// memberProfitService.agentPerkJob(null);
|
// }
|
//
|
// /**
|
// * 线下服务中心补贴
|
// */
|
// @Scheduled(cron = "0 0 1 * * ?")
|
// public void offLinePerkJob() {
|
// memberProfitService.offLinePerkJob(null);
|
// }
|
//
|
// /**
|
// * 平级奖励补贴
|
// */
|
// @Scheduled(cron = "0 0 1 * * ?")
|
// public void teamEqualsPerkJob() {
|
// memberProfitService.teamEqualsPerkJob(null);
|
// }
|
//
|
// /**
|
// * 补贴消息--重试
|
// * 一个小时运行一次
|
// */
|
// @Scheduled(cron = "0 0/5 * * * ?")
|
// public void mqPerkRetryJob() {
|
// memberProfitService.mqPerkRetryJob();
|
// }
|
// /**
|
// * 联创、合伙人的每日绿色凭证释放
|
// */
|
// @Scheduled(cron = "0 0 1 * * ?")
|
// public void scoreRecordReleaseJob() {
|
// memberProfitService.scoreRecordReleaseJob();
|
// }
|
//
|
// /**
|
// * 业绩产生凭证
|
// */
|
// @Scheduled(cron = "0 0 1 * * ?")
|
// public void achieveReleaseJob() {
|
// memberProfitService.achieveReleaseJob();
|
// }
|
//
|
// /**
|
// * 代理星级补贴
|
// */
|
// @Scheduled(cron = "0 0 0 * * ?")
|
// public void perkAgentAchieveJob() {
|
// agentService.perkAgent();
|
// }
|
|
/**
|
* 更新代币价格
|
*/
|
// @Scheduled(cron = "0 0/1 * * * ? ")
|
// public void gfaPrice() {
|
// /**
|
// * 定时器循环计算每个时间跨度内增加的滑点数量
|
// */
|
// log.info("更新代币价格");
|
// //获取滑点钱包的余额
|
// BigDecimal coinPrice = ChainService.getInstance(ChainEnum.BSC_GFA.name()).getPrice("0x1Ea392645f816BF15f1Fc87728eA010585bAAE7D").setScale(8,BigDecimal.ROUND_DOWN);
|
// //获取上一时刻的数据
|
// //更新价格
|
// commonService.updateDataDic(
|
// DataDictionaryEnum.FCM_PRICE.getType(),
|
// DataDictionaryEnum.FCM_PRICE.getCode(),
|
// coinPrice.toString());
|
// }
|
|
/**
|
* 用户预约完成之后,根据产品周期,将用户买单变成买单 todo 0411 停止
|
*/
|
@Scheduled(cron = "0 0 2 * * ?")
|
public void BuyToSell() {
|
// agentService.BuyToSell();
|
agentService.BuyToSellV2();
|
}
|
|
/**
|
* 用户预约完成之后,根据产品周期,将用户买单变成买单
|
*/
|
@Scheduled(cron = "0 0 3 * * ?")
|
public void memberLevelDown() {
|
agentService.memberLevelDown();
|
}
|
|
|
/**
|
* 用户等级升级
|
*/
|
@Scheduled(cron = "0 0 1 * * ?")
|
public void memberLevelUp() {
|
agentService.memberLevelUp();
|
}
|
|
/**
|
* 买单
|
* 看是否是开始显示订单的时间段,超出结束时间的买单,全部超时失败
|
*/
|
@Scheduled(cron = "0 0/2 * * * ? ")
|
public void timeGetOrderBuy() {
|
agentService.timeGetOrderBuy();
|
}
|
|
/**
|
* 买单
|
* 看是否是开始显示订单的时间段,超出结束时间的买单,全部超时返还令牌
|
*/
|
// @Scheduled(cron = "0 0/2 * * * ? ")
|
// public void timeGetOrderBuyCancel() {
|
// agentService.timeGetOrderBuyCancel();
|
// }
|
|
|
/**
|
* 直推奖励
|
* 从冻结到可用 todo 0411 停止
|
*/
|
@Scheduled(cron = "0 0 0/3 * * ? ")
|
public void basicMemberPerk() {
|
agentService.basicMemberPerk();
|
}
|
|
/**
|
* 团队奖励 todo 0411 停止
|
*/
|
@Scheduled(cron = "0 0 0/3 * * ? ")
|
public void teamMemberPerk() {
|
agentService.teamMemberPerk();
|
}
|
|
/**
|
* 平级奖励 todo 0411 停止
|
*/
|
@Scheduled(cron = "0 0 0/3 * * ? ")
|
public void equalsMemberPerk() {
|
agentService.equalsMemberPerk();
|
}
|
|
// /**
|
// * 卖单
|
// * 看是否是开始显示订单的时间段,超出结束时间的卖单,全部超时失败
|
// */
|
// @Scheduled(cron = "0 0/30 * * * ? ")
|
// public void timeGetOrderSell() {
|
// agentService.timeGetOrderSell();
|
// }
|
|
|
|
|
/**
|
* 静态分红
|
*/
|
// @Scheduled(cron = "0 0 0 * * ?")
|
// public void staticProfitJob() {
|
// memberProfitService.staticProfit(null);
|
// }
|
|
/**
|
* 排名奖 每月1号
|
*/
|
// @Scheduled(cron = "0 30 0 1 * ?")
|
// public void rankJob() {
|
// memberProfitService.rankProfit();
|
// }
|
|
/**
|
* 积分池,所有消费拿出10%放到积分池,然后按1%每天释放加权平分
|
*/
|
// @Scheduled(cron = "0 0 2 * * ?")
|
// @Scheduled(cron = "0 0/5 * * * ? ")
|
// public void scorePool() {
|
// memberProfitService.scorePool();
|
// }
|
}
|