|
|
|
@ -687,6 +687,7 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
|
|
|
|
|
} else if ("startOrEndDays".equals(fieldName)) {//考勤二开--入离职工时
|
|
|
|
|
int absenceDays = 0;
|
|
|
|
|
if ("3".equals(typeselect) || "7".equals(typeselect)) {
|
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
|
|
Map<String, String> employAndResignDates = getEmployAndResignDateById(id);
|
|
|
|
|
|
|
|
|
|
String companystartdate = Util.null2String(employAndResignDates.get("companystartdate"));
|
|
|
|
@ -696,6 +697,9 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
|
|
|
|
|
String substring1 = companystartdate.substring(0, 7);
|
|
|
|
|
String substring2 = fromDate.substring(0, 7);
|
|
|
|
|
if (substring1.equals(substring2)) {
|
|
|
|
|
LocalDate companystartdateL = LocalDate.parse(companystartdate, formatter);
|
|
|
|
|
LocalDate localDate = companystartdateL.plusDays(1);
|
|
|
|
|
companystartdate = localDate.format(formatter);
|
|
|
|
|
absenceDays = getAbsenceDays(id, fromDate, companystartdate, toDate);
|
|
|
|
|
}
|
|
|
|
|
} else if (StringUtils.isBlank(companystartdate) && StringUtils.isNotBlank(resignDate)) {
|
|
|
|
@ -712,10 +716,18 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
|
|
|
|
|
String substring4 = toDate.substring(0, 7);
|
|
|
|
|
if ( substring1.equals(substring2) && substring2.equals(substring3)
|
|
|
|
|
&& substring3.equals(substring4) ) {//考勤月入职且离职
|
|
|
|
|
LocalDate companystartdateL = LocalDate.parse(companystartdate, formatter);
|
|
|
|
|
LocalDate localDate = companystartdateL.plusDays(1);
|
|
|
|
|
companystartdate = localDate.format(formatter);
|
|
|
|
|
|
|
|
|
|
int temp1 = getAbsenceDays(id, fromDate, companystartdate, toDate);
|
|
|
|
|
int temp2 = getAbsenceDays(id, resignDate, toDate, fromDate);
|
|
|
|
|
absenceDays = temp1 + temp2;
|
|
|
|
|
} else if (substring1.equals(substring3) && !substring2.equals(substring3)) {//考勤月入职,非考勤月离职
|
|
|
|
|
LocalDate companystartdateL = LocalDate.parse(companystartdate, formatter);
|
|
|
|
|
LocalDate localDate = companystartdateL.plusDays(1);
|
|
|
|
|
companystartdate = localDate.format(formatter);
|
|
|
|
|
|
|
|
|
|
absenceDays = getAbsenceDays(id, fromDate, companystartdate, toDate);
|
|
|
|
|
} else if ( !substring1.equals(substring3) && !substring2.equals(substring3)){//非考勤月入职,考勤月离职
|
|
|
|
|
absenceDays = getAbsenceDays(id, resignDate, toDate, fromDate);
|
|
|
|
|