From e445596114a81627f709d855ca83a70608896f5f Mon Sep 17 00:00:00 2001 From: zhangming <965499528@qq.com> Date: Mon, 1 Apr 2024 09:59:22 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kq/cmd/report/ExportDailyExcelCmd.java | 18 ++++----- .../hostar/action/OutSignSyncAction.java | 40 ++++++++++--------- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/src/com/engine/kq/cmd/report/ExportDailyExcelCmd.java b/src/com/engine/kq/cmd/report/ExportDailyExcelCmd.java index 5adab4d..fd2daf8 100644 --- a/src/com/engine/kq/cmd/report/ExportDailyExcelCmd.java +++ b/src/com/engine/kq/cmd/report/ExportDailyExcelCmd.java @@ -185,18 +185,18 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand='"+fromDate+"' and b.kqdate <='"+toDate+"' and zm.xm=a.id and zm.rq = b.kqdate "; String sqlWhere = rightSql; if(subCompanyId.length()>0){ sqlWhere +=" and a.subcompanyid1 in("+subCompanyId+") "; @@ -435,7 +435,7 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand '" + startDate + "' and operate_date < '" + endDate + "' and operate in (?) "; + "where operate_date > '" + startDate + "' and operate_date < '" + endDate + "' and operater in (?) "; rs.executeQuery(acqOutSignSql, resourceid); while (rs.next()) { String signinfo = Util.null2String(rs.getString("signinfo")); @@ -69,7 +73,7 @@ public class OutSignSyncAction implements Action { } for (String inf : infos) { - if (inf != null ) { + if (inf != null) { Map in = mapStringToMap(inf); String userId = Util.null2String(in.get("userId")); String userType = Util.null2String(in.get("userType")); @@ -87,25 +91,25 @@ public class OutSignSyncAction implements Action { String deviceInfo = Util.null2String(in.get("deviceInfo")); String belongdateIsNull = Util.null2String(in.get("belongdateIsNull")); - String punchSql = "insert into HrmScheduleSign(userId,userType,signType,signDate,signTime,clientAddress,isInCom,timeZone,belongdate,signfrom,longitude,latitude,addr,deviceInfo,isdev) "+ + String punchSql = "insert into HrmScheduleSign(userId,userType,signType,signDate,signTime,clientAddress,isInCom,timeZone,belongdate,signfrom,longitude,latitude,addr,deviceInfo,isdev) " + " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; - boolean isok = rs.executeUpdate(punchSql,resourceid,userType,signType,signDate,signTime,clientAddress,isInCom, - timeZone,belongdate,signfrom,longitude,latitude,address,deviceInfo,"1"); + boolean isok = rs.executeUpdate(punchSql, resourceid, userType, signType, signDate, signTime, clientAddress, isInCom, + timeZone, belongdate, signfrom, longitude, latitude, address, deviceInfo, "1"); bb.writeLog("isok: " + isok); //同步更新考勤数据到考勤报表 - if("true".equals(belongdateIsNull)){ + if ("true".equals(belongdateIsNull)) { //外勤签到没有归属日期,遇到跨天班次打卡可能归属前一天,需要格式化前一天考勤 - bb.writeLog("PunchOutButtonCmd:userId:"+userId+":belongdate:"+ DateUtil.getYesterday()); - new KQFormatBiz().formatDate(""+userId,DateUtil.getYesterday()); + bb.writeLog("PunchOutButtonCmd:userId:" + userId + ":belongdate:" + DateUtil.getYesterday()); + new KQFormatBiz().formatDate("" + userId, DateUtil.getYesterday()); } - bb.writeLog("PunchOutButtonCmd:userId:"+userId+":belongdate:"+(belongdate.length() == 0 ? DateUtil.getCurrentDate() : belongdate)); - if(belongdate.length()==0){ + bb.writeLog("PunchOutButtonCmd:userId:" + userId + ":belongdate:" + (belongdate.length() == 0 ? DateUtil.getCurrentDate() : belongdate)); + if (belongdate.length() == 0) { //外勤签到没有归属日期,遇到跨天班次打卡可能归属前一天,需要格式化前一天考勤 - new KQFormatBiz().formatDate(""+userId,DateUtil.getYesterday()); + new KQFormatBiz().formatDate("" + userId, DateUtil.getYesterday()); } - new KQFormatBiz().formatDate(""+userId,(belongdate.length() == 0 ? DateUtil.getCurrentDate() : belongdate)); + new KQFormatBiz().formatDate("" + userId, (belongdate.length() == 0 ? DateUtil.getCurrentDate() : belongdate)); //外勤签到转的考勤 处理加班规则 - SplitActionUtil.pushOverTimeTasksAll(belongdate,belongdate,""+userId); + SplitActionUtil.pushOverTimeTasksAll(belongdate, belongdate, "" + userId); } } @@ -118,10 +122,10 @@ public class OutSignSyncAction implements Action { return Action.SUCCESS; } - public static Map mapStringToMap(String str){ - str = str.substring(1, str.length()-1); + public static Map mapStringToMap(String str) { + str = str.substring(1, str.length() - 1); String[] strs = str.split(","); - Map map = new HashMap<>(); + Map map = new HashMap<>(); for (String string : strs) { String key = string.split("=")[0]; String value = string.split("=")[1];