package com.srs.quartz.task;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.srs.stureg.domain.SrsStuCheck;
import com.srs.stureg.service.ISrsStuCheckDataSyncService;
import com.srs.stureg.service.ISrsStuCheckService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

import static com.srs.common.utils.DateUtils.getNowDate;

@Component("RegTask")
public class RegTask {

    @Autowired
    ISrsStuCheckDataSyncService srsStuCheckService;

    @Autowired
    ISrsStuCheckService checkService;

    public void checkInDataSync()
    {
        List<SrsStuCheck> list= srsStuCheckService.getSrsStucheckList();
        for (SrsStuCheck m:list) {
            SrsStuCheck srsStuCheck=new SrsStuCheck();
            srsStuCheck.setIsCheck(m.getIsCheck());
            srsStuCheck.setKsh(m.getKsh());
            srsStuCheck.setCheckTime(m.getCheckTime());
            UpdateWrapper<SrsStuCheck> updateWrapper = new UpdateWrapper<>();
            updateWrapper.eq("ksh",m.getKsh());
            checkService.update(srsStuCheck,updateWrapper);
        }
    }

}
