|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.engine.kq.cmd.report;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.engine.common.biz.AbstractCommonCommand;
|
|
|
|
@ -12,6 +13,7 @@ import com.engine.kq.log.KQLog;
|
|
|
|
|
import com.engine.kq.util.KQDurationCalculatorUtil;
|
|
|
|
|
import com.engine.kq.util.PageUidFactory;
|
|
|
|
|
import weaver.conn.RecordSet;
|
|
|
|
|
import weaver.general.BaseBean;
|
|
|
|
|
import weaver.general.TimeUtil;
|
|
|
|
|
import weaver.general.Util;
|
|
|
|
|
import weaver.hrm.User;
|
|
|
|
@ -27,6 +29,7 @@ import java.util.*;
|
|
|
|
|
public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Object>> {
|
|
|
|
|
|
|
|
|
|
private KQLog kqLog = new KQLog();
|
|
|
|
|
BaseBean bb = new BaseBean();
|
|
|
|
|
|
|
|
|
|
public GetKQDailyReportCmd(Map<String, Object> params, User user) {
|
|
|
|
|
this.user = user;
|
|
|
|
@ -202,12 +205,10 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
|
|
|
|
|
} else if (rs.getDBType().equals("mysql")) {
|
|
|
|
|
sql = " select " + sql;
|
|
|
|
|
sql = "select t1.* from (" + sql + ") t1 limit " + ((pageIndex - 1) * pageSize) + "," + pageSize;
|
|
|
|
|
}
|
|
|
|
|
else if (rs.getDBType().equals("postgresql")) {
|
|
|
|
|
} else if (rs.getDBType().equals("postgresql")) {
|
|
|
|
|
sql = " select " + sql;
|
|
|
|
|
sql = "select t1.* from (" + sql + ") t1 limit " + pageSize+ " offset " + ((pageIndex - 1) * pageSize);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
} else {
|
|
|
|
|
orderBy = " order by dsporder asc, lastname asc, kqdate asc ";
|
|
|
|
|
descOrderBy = " order by dsporder desc, lastname desc, kqdate desc ";
|
|
|
|
|
if (pageIndex > 1) {
|
|
|
|
@ -511,6 +512,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
|
|
|
|
|
String sql = "";
|
|
|
|
|
KQTimesArrayComInfo kqTimesArrayComInfo = new KQTimesArrayComInfo();
|
|
|
|
|
try{
|
|
|
|
|
bb.writeLog("-----getSignDetailInfo start-----");
|
|
|
|
|
sql = " select kqdate,resourceid,serialid,serialnumber,workbegindate,workbegintime, " +
|
|
|
|
|
" workenddate,workendtime,workmins,signindate,signintime,signoutdate,signouttime, \n" +
|
|
|
|
|
" attendanceMins,belatemins,graveBeLateMins,leaveearlymins,graveLeaveEarlyMins,absenteeismmins,forgotcheckMins,forgotBeginWorkCheckMins," +
|
|
|
|
@ -519,6 +521,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
|
|
|
|
|
" where resourceid = " + resourceId + " and kqdate ='" + kqDate + "' \n" +
|
|
|
|
|
" order by serialnumber \n";
|
|
|
|
|
rs.execute(sql);
|
|
|
|
|
bb.writeLog("sql: " + sql);
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
String resourceid = Util.null2String(rs.getString("resourceid"));
|
|
|
|
|
String kqdate = Util.null2String(rs.getString("kqdate"));
|
|
|
|
@ -560,6 +563,19 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
|
|
|
|
|
signStatusInfo.put("leaveInfo",leaveInfo);
|
|
|
|
|
signStatusInfo.put("evectionMins",evectionMins);
|
|
|
|
|
signStatusInfo.put("outMins",outMins);
|
|
|
|
|
/*考勤二开--当前时间在当天班次下班点之前,不显示旷工start*/
|
|
|
|
|
String nowDay = DateUtil.format(new Date(), "yyyy-MM-dd");
|
|
|
|
|
String nowTime = DateUtil.format(new Date(), "HH:mm");
|
|
|
|
|
bb.writeLog("nowDay: " + nowDay);
|
|
|
|
|
bb.writeLog("nowTime: " + nowTime);
|
|
|
|
|
bb.writeLog("workenddate: " + workenddate);
|
|
|
|
|
bb.writeLog("workendtime: " + kqTimesArrayComInfo.turn48to24Time(workendtime));
|
|
|
|
|
|
|
|
|
|
if (workenddate.equals(nowDay) && nowTime.compareTo(kqTimesArrayComInfo.turn48to24Time(workendtime)) < 0) {
|
|
|
|
|
signStatusInfo.put("isneedcal","1");
|
|
|
|
|
}
|
|
|
|
|
bb.writeLog("signStatusInfo: " + signStatusInfo);
|
|
|
|
|
/*考勤二开--当前时间在当天班次下班点之前,不显示旷工end*/
|
|
|
|
|
|
|
|
|
|
data.put("signintime"+serialnumber, signintime.length()==0?SystemEnv.getHtmlLabelName(25994, user.getLanguage()):signintime);
|
|
|
|
|
data.put("signinstatus"+serialnumber, KQReportBiz.getSignStatus(signStatusInfo,user,"on"));
|
|
|
|
@ -578,6 +594,19 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
|
|
|
|
|
signStatusInfo.put("leaveInfo",leaveInfo);
|
|
|
|
|
signStatusInfo.put("evectionMins",evectionMins);
|
|
|
|
|
signStatusInfo.put("outMins",outMins);
|
|
|
|
|
/*考勤二开--当前时间在当天班次下班点之前,不显示旷工start*/
|
|
|
|
|
String nowDay = DateUtil.format(new Date(), "yyyy-MM-dd");
|
|
|
|
|
String nowTime = DateUtil.format(new Date(), "HH:mm");
|
|
|
|
|
bb.writeLog("nowDay: " + nowDay);
|
|
|
|
|
bb.writeLog("nowTime: " + nowTime);
|
|
|
|
|
bb.writeLog("workenddate: " + workenddate);
|
|
|
|
|
bb.writeLog("workendtime: " + kqTimesArrayComInfo.turn48to24Time(workendtime));
|
|
|
|
|
|
|
|
|
|
if (workenddate.equals(nowDay) && nowTime.compareTo(kqTimesArrayComInfo.turn48to24Time(workendtime)) < 0) {
|
|
|
|
|
signStatusInfo.put("isneedcal","1");
|
|
|
|
|
}
|
|
|
|
|
bb.writeLog("signStatusInfo: " + signStatusInfo);
|
|
|
|
|
/*考勤二开--当前时间在当天班次下班点之前,不显示旷工end*/
|
|
|
|
|
|
|
|
|
|
data.put("signouttime"+serialnumber, signouttime.length()==0?SystemEnv.getHtmlLabelName(25994, user.getLanguage()):signouttime);
|
|
|
|
|
data.put("signoutstatus"+serialnumber, KQReportBiz.getSignStatus(signStatusInfo,user,"off"));
|
|
|
|
|