package com.yeshi.fanli.job;
|
|
import java.math.BigDecimal;
|
import java.util.Random;
|
|
import javax.annotation.Resource;
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.stereotype.Component;
|
|
import com.yeshi.fanli.service.inter.config.InviteGetMoneyService;
|
|
@Component
|
public class UpdateInviteRankJob {
|
|
@Resource
|
private InviteGetMoneyService inviteGetMoneyService;
|
|
//每天0点 随机增加榜单igd_money
|
@Scheduled(cron = "0 0 0 * * ?")
|
public void UpdateInviteRank() {
|
Random random = new Random();
|
//产生int类型的随机数
|
int updateMoney = random.nextInt(10);
|
//int转换为 BigDecimal
|
BigDecimal bigDecimalMoney = new BigDecimal(updateMoney);
|
inviteGetMoneyService.updateInviteRank(bigDecimalMoney);
|
}
|
|
}
|