package com.chinaweal.aiccs.schedule;

import com.chinaweal.aiccs.aiccs.abnormal.service.EBaseinfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDate;

/**
 * 新版智慧认领
 *
 * @author huangx
 * @since 2025/7/9
 **/
@Slf4j
@Component
public class SmartClaimSchedule {

    @Autowired
    private EBaseinfoService eBaseinfoService;

    /**
     * 个体户智慧认领字段片区更新
     *
     * @author huangx
     */
    @Scheduled(cron = "${scheduling.cron.autoIndividualArea}")
    public void autoIndividualArea() {
        log.info("===========开始匹配个体户片区所字段===========");
        int i = eBaseinfoService.automaticClaimCenter();
        log.info("===========结束匹配个体户片区所字段，累计更新{}条===========", i);
    }

    /**
     * 企业的智慧认领字段片区更新
     *
     * @author huangx
     */
    @Scheduled(cron = "${scheduling.cron.autoEntArea}")
    public void autoEntArea() {
        log.info("===========开始匹配企业片区所字段===========");
        int i = eBaseinfoService.autoEntArea();
        log.info("===========结束匹配企业片区所字段，累计更新{}条===========", i);
    }

}
