diff --git a/interface/KQScheduleFormat.jsp b/interface/KQScheduleFormat.jsp new file mode 100644 index 0000000..b8ded80 --- /dev/null +++ b/interface/KQScheduleFormat.jsp @@ -0,0 +1,33 @@ +<%@ page import="weaver.common.DateUtil" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="com.engine.kq.log.KQLog" %> +<%@ page import="com.engine.kq.biz.KQFormatData" %> +<%@ page import="weaver.general.Util" %> +<%@ page contentType="text/html; charset=UTF-8" %> +<% + String yesterday = request.getParameter("formatDate"); + String date = DateUtil.addDate(yesterday, 1); + KQLog kqLog = new KQLog(); + try { + + kqLog.info("begin do KQScheduleFormatJob invoke ..."); + + + 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 + ":yesterday:" + yesterday); + new KQFormatData().formatKqDate(resourceid, yesterday); + //处理一下今天的数据,不然的话今天的数据会显示成休息 + new KQFormatData().formatKqDate(resourceid, date); + } + + kqLog.info("end do KQScheduleFormatJob invoke ..."); + } catch (Exception e) { + kqLog.info(e); + } + out.println("do KQScheduleFormatJob invoke..[" + date + ";" + yesterday + "]"); +%> \ No newline at end of file diff --git a/src/com/engine/kq/biz/KQFormatData.java b/src/com/engine/kq/biz/KQFormatData.java index bfec69b..bea20db 100644 --- a/src/com/engine/kq/biz/KQFormatData.java +++ b/src/com/engine/kq/biz/KQFormatData.java @@ -12,6 +12,7 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.googlecode.aviator.AviatorEvaluator; import com.googlecode.aviator.Expression; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import weaver.common.DateUtil; @@ -661,10 +662,8 @@ public class KQFormatData extends BaseBean { if(this.writeLog) { logInfo.put(""+weaver.systeminfo.SystemEnv.getHtmlLabelName(10005301,weaver.general.ThreadVarLanguage.getLang())+"",kqShiftRuleEntity); } - // 考勤二开 设置第二次打卡,允许迟到239分钟 - new BaseBean().writeLog("###考勤二开###,i=[" + i + "],lsWorkTime.size()=[" + lsWorkTime.size() + "],lsWorkTime.get(1).getBeginTime()=[" + lsWorkTime.get(1).getBeginTime() + "]"); - new BaseBean().writeLog(JSON.toJSON(lsWorkTime)); - if (lsWorkTime.size() == 2 && lsWorkTime.get(1).getBeginTime().equals("24:00") && i == 1) { + // 考勤二开 设置第二次打卡,不记录迟到 + if (CollectionUtils.isNotEmpty(lsWorkTime) && lsWorkTime.size() == 2 && lsWorkTime.get(1).getBeginTime().equals("24:00") && i == 1) { WorkTimeEntity cusWorkTimeEntity = new WorkTimeEntity(); BeanUtils.copyProperties(workTime,cusWorkTimeEntity); Map shiftRuleInfo = cusWorkTimeEntity.getShiftRuleInfo();