package com.engine.kq.biz;

import com.engine.kq.log.KQLog;
import weaver.common.DateUtil;
import weaver.conn.RecordSet;
import weaver.general.Util;
import weaver.interfaces.schedule.BaseCronJob;

/**
 * 格式化今天的考勤数据
 */
public class KQTodayFormatJob extends BaseCronJob{
  private KQLog kqLog = new KQLog();

	public void execute() {
		RecordSet rs = new RecordSet();
		try{
			
			kqLog.info("begin do KQScheduleFormatJob invoke ...");
      String date = DateUtil.getCurrentDate();
      String yesterday = DateUtil.addDate(date,-1);
			
			kqLog.info("do KQScheduleFormatJob invoke..["+date+";"+yesterday+"]");
      RecordSet rs1 = new RecordSet();
      String sql = "select id from hrmresource where status in (0,1,2,3)";
      rs1.execute(sql);
      while (rs1.next()){
        String resourceid = Util.null2String(rs1.getString("id"));
        kqLog.info("KQScheduleFormatJob:resourceid:"+resourceid+":date:"+date);
        new KQFormatData().formatKqDate(resourceid, date);
      }

			kqLog.info("end do KQScheduleFormatJob invoke  ...");
		}catch (Exception e) {
			kqLog.info(e) ;
		}
	}
}
