Administrator
2018-10-30 c0c91fbda1ba601c4c8cb6d12fd43dfbe02eea5d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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);
        }
 
}