feat: 每个自然月重置优质标准

This commit is contained in:
2023-09-13 11:52:38 +08:00
parent b768be07b9
commit 59d1056fdd
2 changed files with 29 additions and 0 deletions
@@ -0,0 +1,27 @@
package com.jero.modules.laws.enterprise.job;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.jero.modules.laws.enterprise.entity.EnterpriseStandardPlan;
import com.jero.modules.laws.enterprise.service.EnterpriseStandardPlanService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Slf4j
@Component
public class QualityStandardResetTask {
@Resource
private EnterpriseStandardPlanService enterpriseStandardPlanService;
@Scheduled(cron = "0 0 0 1 * ?")
public void qualityStandardResetTask() {
LambdaUpdateWrapper<EnterpriseStandardPlan> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(EnterpriseStandardPlan::getQualityFlag, 0);
enterpriseStandardPlanService.update(updateWrapper);
log.info("重置优质企标状态完成");
}
}