package com.engine.kq.biz;

import weaver.general.BaseBean;

import java.util.ArrayList;
import java.util.List;

/**
 * 由于节假日设置的变更会影响到考勤汇总报表，所以在节假日发生变更后需要格式化考勤
 * 由于格式化考勤比较耗时，所以如果节假日设置完后可能会因需要格式化考勤等到很长一段时间，所以改为线程去调用格式化考勤的方法
 */
public class KQHolidaySetThread extends Thread {

    private List<String> groupIdList;

    private List<String> holidayDateList;

    public KQHolidaySetThread(List<String> groupIdList, List<String> holidayDateList) {
        this.groupIdList = groupIdList;
        this.holidayDateList = holidayDateList;
        if (this.groupIdList == null) {
            this.groupIdList = new ArrayList<String>();
        }
        if (this.holidayDateList == null) {
            this.holidayDateList = new ArrayList<String>();
        }
    }

    @Override
    public void run() {
        for (String groupId : this.groupIdList) {
            for (String holidayDate : this.holidayDateList) {
                new KQFormatBiz().formatDateByGroupId(groupId, holidayDate);//刷新考勤报表
            }
        }
    }
}
