package com.sinata.rest.modular.mall.job;
|
|
import cn.hutool.core.date.DateUtil;
|
import com.sinata.common.enums.EnumMemberGrade;
|
import com.sinata.common.enums.EnumSystemSetKey;
|
import com.sinata.rest.modular.member.service.IMemUserService;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.stereotype.Component;
|
|
/**
|
* 定时任务-品行分检测
|
*/
|
@Slf4j
|
@Component
|
@EnableScheduling
|
public class CheckCreditScoreWork {
|
|
@Autowired
|
IMemUserService memUserService;
|
|
/**
|
* 品行分检测 每月一号凌晨执行
|
*/
|
@Scheduled(cron = "0 0 0 1 * ?")
|
public void run() {
|
log.debug("品行分检测");
|
if (DateUtil.thisDayOfMonth() == 1) {
|
// 黄金营销员检测
|
memUserService.updateUserGradeByCreditScore(EnumSystemSetKey.SET_305.index, EnumMemberGrade.G_3.index, EnumMemberGrade.G_1.index);
|
|
// 城市合伙人检测
|
memUserService.updateUserGradeByCreditScore(EnumSystemSetKey.SET_328.index, EnumMemberGrade.G_4.index, EnumMemberGrade.G_3.index);
|
|
// 市场总监检测
|
memUserService.updateUserGradeByCreditScore(EnumSystemSetKey.SET_348.index, EnumMemberGrade.G_5.index, EnumMemberGrade.G_3.index);
|
}
|
|
|
|
}
|
|
}
|