package com.kiisoo.ic.activity.scheduleds;

import com.kiisoo.ic.activity.service.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class ActivityExpire {
    @Autowired
    IPmnActivityInstanceService pmnActivityInstanceService;

    @Scheduled(cron = "0 0 0 * * ?")
    public void scheduled(){
        //TODO 活动实例/实例关联信息/活动码失效
        log.info("执行活动状态: {}",System.currentTimeMillis());
        /**
         * 有效
         */
        pmnActivityInstanceService.scanValidAndSet();
        /**
         * 失效
         */
        pmnActivityInstanceService.scanInvalidAndSer();
    }
}
