diff --git a/src/com/engine/kq/cmd/report/ExportDailyExcelCmd.java b/src/com/engine/kq/cmd/report/ExportDailyExcelCmd.java index e10483d..a221d54 100644 --- a/src/com/engine/kq/cmd/report/ExportDailyExcelCmd.java +++ b/src/com/engine/kq/cmd/report/ExportDailyExcelCmd.java @@ -310,6 +310,9 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand> employAndResignDates = getAllEmployAndResignDateById(); + /*考勤二开--入离职时间end*/ rs.execute(sql); while (rs.next()) { @@ -410,11 +413,13 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand map = getEmployAndResignDateById(id); + //Map map = getEmployAndResignDateById(id); + Map map = employAndResignDates.get(id); fieldValue = map.get("companystartdate"); }else if(fieldName.equals("resignDate")){ //根据id查询离职日期 - Map map = getEmployAndResignDateById(id); + //Map map = getEmployAndResignDateById(id); + Map map = employAndResignDates.get(id); fieldValue = map.get("resignDate"); }else if(fieldName.equals("jobtitle")){ String tmpJobtitleId = Util.null2String(rs.getString("jobtitle")); @@ -834,6 +839,31 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand> getAllEmployAndResignDateById(){ + RecordSet rs = new RecordSet(); + Map> result = new HashMap<>(); + + String companystartdate = "";//入职时间 + String id = "";//人员 + String created = "";//创建日期 + String field30 = "";//离职时间 + String sql = "select a.id, b.companystartdate,b.created,a.field30 from cus_fielddata a left join hrmresource b on" + + " a.id = b.id where a.scope='HrmCustomFieldByInfoType' and a.scopeid= 3 "; + rs.executeQuery(sql); + while (rs.next()){ + id = Util.null2String(rs.getString("id")); + companystartdate = Util.null2String(rs.getString("companystartdate")); + created = Util.null2String(rs.getString("created")); + field30 = Util.null2String(rs.getString("field30")); + Map map = new HashMap<>(); + companystartdate = "".equals(companystartdate)?created:companystartdate; + map.put("companystartdate",companystartdate); + map.put("resignDate",field30); + result.put(id, map); + } + return result; + } private Map getChildColumnsInfo(String parentid, User user){ Map returnMap = new HashMap<>(); diff --git a/src/com/engine/kq/cmd/report/ExportExcelCmd.java b/src/com/engine/kq/cmd/report/ExportExcelCmd.java index 50c2a46..92ebfc0 100644 --- a/src/com/engine/kq/cmd/report/ExportExcelCmd.java +++ b/src/com/engine/kq/cmd/report/ExportExcelCmd.java @@ -448,11 +448,13 @@ public class ExportExcelCmd extends AbstractCommonCommand> { fieldValue = overtimeType; }else if(fieldName.equals("companystartdate")){ //根据id查询入职日期 - Map map = getEmployAndResignDateById(id); + //Map map = getEmployAndResignDateById(id); + Map map = employAndResignDates.get(id); fieldValue = map.get("companystartdate"); }else if(fieldName.equals("resignDate")){ //根据id查询离职日期 - Map map = getEmployAndResignDateById(id); + //Map map = getEmployAndResignDateById(id); + Map map = employAndResignDates.get(id); fieldValue = map.get("resignDate"); }else if (fieldName.equals("jobtitle")) { String tmpJobtitleId = Util.null2String(rs.getString("jobtitle")); diff --git a/src/com/engine/kq/cmd/report/GetKQDailyReportCmd.java b/src/com/engine/kq/cmd/report/GetKQDailyReportCmd.java index 68e7f48..119ad31 100644 --- a/src/com/engine/kq/cmd/report/GetKQDailyReportCmd.java +++ b/src/com/engine/kq/cmd/report/GetKQDailyReportCmd.java @@ -295,6 +295,10 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand> employAndResignDates = getAllEmployAndResignDateById(); + /*考勤二开--入离职时间end*/ rs.execute(sql); writeLog("howec::::::::::::::::sql:"+sql); while (rs.next()) { @@ -413,12 +417,14 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand map = getEmployAndResignDateById(id); + //Map map = getEmployAndResignDateById(id); + Map map = employAndResignDates.get(id); fieldValue = map.get("companystartdate"); data.put(fieldName,fieldValue); }else if(fieldName.equals("resignDate")){ //根据id查询离职日期 - Map map = getEmployAndResignDateById(id); + //Map map = getEmployAndResignDateById(id); + Map map = employAndResignDates.get(id); fieldValue = map.get("resignDate"); data.put(fieldName,fieldValue); } else if (fieldName.equals("jobtitle")) { @@ -725,6 +731,31 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand> getAllEmployAndResignDateById(){ + RecordSet rs = new RecordSet(); + Map> result = new HashMap<>(); + + String companystartdate = "";//入职时间 + String id = "";//人员 + String created = "";//创建日期 + String field30 = "";//离职时间 + String sql = "select a.id, b.companystartdate,b.created,a.field30 from cus_fielddata a left join hrmresource b on" + + " a.id = b.id where a.scope='HrmCustomFieldByInfoType' and a.scopeid= 3 "; + rs.executeQuery(sql); + while (rs.next()){ + id = Util.null2String(rs.getString("id")); + companystartdate = Util.null2String(rs.getString("companystartdate")); + created = Util.null2String(rs.getString("created")); + field30 = Util.null2String(rs.getString("field30")); + Map map = new HashMap<>(); + companystartdate = "".equals(companystartdate)?created:companystartdate; + map.put("companystartdate",companystartdate); + map.put("resignDate",field30); + result.put(id, map); + } + return result; + } private String getUnitType(String unitType, User user){ diff --git a/src/com/engine/kq/cmd/report/GetKQReportCmd.java b/src/com/engine/kq/cmd/report/GetKQReportCmd.java index 6712cef..050adf9 100644 --- a/src/com/engine/kq/cmd/report/GetKQReportCmd.java +++ b/src/com/engine/kq/cmd/report/GetKQReportCmd.java @@ -493,12 +493,14 @@ public class GetKQReportCmd extends AbstractCommonCommand> { fieldValue = overtimeType; }else if(fieldName.equals("companystartdate")){ //根据id查询入职日期 - Map map = getEmployAndResignDateById(id); + //Map map = getEmployAndResignDateById(id); + Map map = employAndResignDates.get(id); data.put("companystartdate",map.get("companystartdate")); fieldValue = map.get("companystartdate"); }else if(fieldName.equals("resignDate")){ //根据id查询离职日期 - Map map = getEmployAndResignDateById(id); + //Map map = getEmployAndResignDateById(id); + Map map = employAndResignDates.get(id); data.put("resignDate",map.get("resignDate")); fieldValue = map.get("resignDate"); } else if(fieldName.equals("jobtitle")){