package cn.com.countrygarden.bi.main.controller.Time;

import cn.com.countrygarden.bi.main.dao.ck.CkCleanerBasicMapper;
import cn.com.countrygarden.bi.main.dao.twerp.hm.TbSysOrganMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.transaction.annotation.Transactional;

@Transactional
@Configuration
@PropertySource(value = "classpath:application.properties")
@ComponentScan("cn.com.countrygarden.bi.main.*")
public class CkOrgtimedTask {

    @Autowired
    private TbSysOrganMapper tbSysOrganMapper;

    @Autowired
    private CkCleanerBasicMapper ckCleanerBasicMapper;

    @Scheduled(cron = "${schedule.cron.ckOrgtimedTask}")
    public void doResignation(){
      /* List<ProjectListVO> projectListVOList=tbSysOrganMapper.allAreas(null);
       List<CkCleanerBasic> basicList=new ArrayList<>();

        LocalDate date= LocalDate.now();
        int YesValue=0;
        int MonthValue=0;
        if(date.getMonthValue()-1==0){
            YesValue=date.getYear()-1;
            MonthValue=12;
        }else {
            YesValue=date.getYear();
            MonthValue=date.getMonthValue()-1;
        }

        for (int i = 0; i <projectListVOList.size() ; i++) {
            CkCleanerBasic basic=new CkCleanerBasic();
            basic.setCommCode(projectListVOList.get(i).getCommId());
            basic.setCommName(projectListVOList.get(i).getCommName());
            basic.setOrgCode(projectListVOList.get(i).getOrganCode());
            basic.setOrgName(projectListVOList.get(i).getOrganName());
            basic.setYear(String.valueOf(YesValue));
            basic.setMonth(String.valueOf(MonthValue));
            basic.setStatus(0);
            basic.setCreateTime(new Date());
            basicList.add(basic);
        }
        ckCleanerBasicMapper.insertList(basicList);*/
    }
}
