package com.ssm.task;

import com.ssm.manage.entity.StoreMemberList;
import com.ssm.manage.service.SsmStoreMemberService;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
@DisallowConcurrentExecution
public class SsmStoreMemberStartTask extends QuartzJobBean {
    @Autowired
    private SsmStoreMemberService ssmStoreMemberService;

    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        Map map = jobExecutionContext.getJobDetail().getJobDataMap();
        StoreMemberList storeMemberList = (StoreMemberList) map.get("memberList");
        ssmStoreMemberService.updateNotNull(storeMemberList);
    }
}
