diff --git a/o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/jaxrs/attendancedetail/ActionListMyMobileRecordToday.java b/o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/jaxrs/attendancedetail/ActionListMyMobileRecordToday.java index 6b2e9261cb5e9aa0be32225af01ff51266df443f..37c1d7022aa3e1c72129203277d161306886f9b2 100644 --- a/o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/jaxrs/attendancedetail/ActionListMyMobileRecordToday.java +++ b/o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/jaxrs/attendancedetail/ActionListMyMobileRecordToday.java @@ -90,11 +90,68 @@ public class ActionListMyMobileRecordToday extends BaseAction { woSignFeature.setSignDate( signDate ); } } + + //列示排班详情 + List scheduleInfos = new ArrayList<>(); + if (check + && !StringUtils.equalsAnyIgnoreCase("xadmin", effectivePerson.getName()) + && !StringUtils.equalsAnyIgnoreCase("cipher", effectivePerson.getName())) { + //打卡策略:1-两次打卡(上午上班,下午下班) 2-三次打卡(上午上班,下午下班加中午一次共三次) 3-四次打卡(上午下午都打上班下班 + + if( woScheduleSetting != null ){ + WoSignFeature scheduleInfo1 = new WoSignFeature(); + scheduleInfo1.setSignSeq(1); + scheduleInfo1.setCheckinType( AttendanceDetailMobile.CHECKIN_TYPE_ONDUTY ); + scheduleInfo1.setSignTime(scheduleSetting.getOnDutyTime()); + scheduleInfo1.setSignDate( signDate ); + scheduleInfos.add(scheduleInfo1); + + + if( woScheduleSetting.getSignProxy() == 3 ){ + //3-四次打卡(上午下午都打上班下班卡) + WoSignFeature scheduleInfo2 = new WoSignFeature(); + scheduleInfo2.setSignSeq(2); + scheduleInfo2.setCheckinType( AttendanceDetailMobile.CHECKIN_TYPE_MORNING_OFFDUTY ); + scheduleInfo2.setSignTime(scheduleSetting.getMiddayRestStartTime()); + scheduleInfo2.setSignDate( signDate ); + scheduleInfos.add(scheduleInfo2); + + WoSignFeature scheduleInfo3 = new WoSignFeature(); + scheduleInfo3.setSignSeq(3); + scheduleInfo3.setCheckinType( AttendanceDetailMobile.CHECKIN_TYPE_AFTERNOON_ONDUTY ); + scheduleInfo3.setSignTime(scheduleSetting.getMiddayRestEndTime()); + scheduleInfo3.setSignDate( signDate ); + scheduleInfos.add(scheduleInfo3); + + }else if( woScheduleSetting.getSignProxy() == 2 ){ + //2-三次打卡(上午上班,下午下班加中午一次共三次) + WoSignFeature scheduleInfo3 = new WoSignFeature(); + scheduleInfo3.setSignSeq(3); + scheduleInfo3.setCheckinType( AttendanceDetailMobile.CHECKIN_TYPE_AFTERNOON_ONDUTY ); + scheduleInfo3.setSignTime(scheduleSetting.getMiddayRestEndTime()); + scheduleInfo3.setSignDate( signDate ); + scheduleInfos.add(scheduleInfo3); + }else{ + //1-两次打卡(上午上班,下午下班) + } + + WoSignFeature scheduleInfo4 = new WoSignFeature(); + scheduleInfo4.setSignSeq(4); + scheduleInfo4.setCheckinType( AttendanceDetailMobile.CHECKIN_TYPE_OFFDUTY ); + scheduleInfo4.setSignTime(scheduleSetting.getOffDutyTime()); + scheduleInfo4.setSignDate( signDate ); + scheduleInfos.add(scheduleInfo4); + } + /*if( scheduleIf != null ){ + scheduleIf.setSignDate( signDate ); + }*/ + } Wo wo = new Wo(); wo.setRecords( wraps ); wo.setFeature( woSignFeature ); wo.setScheduleSetting( woScheduleSetting ); + wo.setScheduleInfos(scheduleInfos); result.setCount(total); result.setData(wo); @@ -111,6 +168,9 @@ public class ActionListMyMobileRecordToday extends BaseAction { @FieldDescribe("下一次打卡信息") private WoSignFeature feature; + + @FieldDescribe("排班详情") + private List scheduleInfos; public WoScheduleSetting getScheduleSetting() { return scheduleSetting; } @@ -123,6 +183,10 @@ public class ActionListMyMobileRecordToday extends BaseAction { public WoSignFeature getFeature() { return feature; } public void setFeature(WoSignFeature feature) { this.feature = feature; } + + public List getScheduleInfos() { return scheduleInfos; } + + public void setScheduleInfos(List scheduleInfos) { this.scheduleInfos = scheduleInfos; } } public static class WoScheduleSetting extends AttendanceScheduleSetting { diff --git a/o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/processor/EntityImportDataDetail.java b/o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/processor/EntityImportDataDetail.java index 5560def3ceb990cd64d9266e84f63d5686bed64a..5918e54df42491f8921c14b137cc91bf75f8902f 100644 --- a/o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/processor/EntityImportDataDetail.java +++ b/o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/processor/EntityImportDataDetail.java @@ -34,10 +34,18 @@ public class EntityImportDataDetail extends AbStractDataForOperator { private String onDutyTime = ""; + private String morningOffDutyTime = ""; + + private String afternoonOnDutyTime = ""; + private String offDutyTime = ""; private String onDutyTimeFormated = ""; + private String morningOffDutyTimeFormated = ""; + + private String afternoonOnDutyTimeFormated = ""; + private String offDutyTimeFormated = ""; private String recordDateStringFormated = ""; @@ -87,6 +95,22 @@ public class EntityImportDataDetail extends AbStractDataForOperator { public void setOnDutyTime(String onDutyTime) { this.onDutyTime = onDutyTime; } + + public String getMorningOffDutyTime() { + return morningOffDutyTime; + } + + public void setMorningOffDutyTime(String morningOffDutyTime) { + this.morningOffDutyTime = morningOffDutyTime; + } + + public String getAfternoonOnDutyTime() { + return afternoonOnDutyTime; + } + + public void setAfternoonOnDutyTime(String afternoonOnDutyTime) { + this.afternoonOnDutyTime = afternoonOnDutyTime; + } public String getOffDutyTime() { return offDutyTime; @@ -103,6 +127,22 @@ public class EntityImportDataDetail extends AbStractDataForOperator { public void setOnDutyTimeFormated(String onDutyTimeFormated) { this.onDutyTimeFormated = onDutyTimeFormated; } + + public String getMorningOffDutyTimeFormated() { + return morningOffDutyTimeFormated; + } + + public void setMorningOffDutyTimeFormated(String morningOffDutyTimeFormated) { + this.morningOffDutyTimeFormated = morningOffDutyTimeFormated; + } + + public String getAfternoonOnDutyTimeFormated() { + return afternoonOnDutyTimeFormated; + } + + public void setAfternoonOnDutyTimeFormated(String afternoonOnDutyTimeFormated) { + this.afternoonOnDutyTimeFormated = afternoonOnDutyTimeFormated; + } public String getOffDutyTimeFormated() { return offDutyTimeFormated; diff --git a/o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/processor/thread/OperatorDataSaver.java b/o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/processor/thread/OperatorDataSaver.java index 783603e4d7f99fe0a16276a6716e295c288c1d98..b79fc334cb9615536fc2b8ff79794396c874ce77 100644 --- a/o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/processor/thread/OperatorDataSaver.java +++ b/o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/processor/thread/OperatorDataSaver.java @@ -48,6 +48,8 @@ public class OperatorDataSaver implements Runnable { attendanceDetail.setRecordDate( cacheImportRowDetail.getRecordDate() ); attendanceDetail.setRecordDateString(cacheImportRowDetail.getRecordDateStringFormated()); attendanceDetail.setOnDutyTime(cacheImportRowDetail.getOnDutyTimeFormated()); + attendanceDetail.setMorningOffDutyTime(cacheImportRowDetail.getMorningOffDutyTimeFormated()); + attendanceDetail.setAfternoonOnDutyTime(cacheImportRowDetail.getAfternoonOnDutyTimeFormated()); attendanceDetail.setOffDutyTime(cacheImportRowDetail.getOffDutyTimeFormated()); attendanceDetail.setRecordStatus( 0 ); attendanceDetail.setBatchName( file_id ); diff --git a/o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/processor/thread/OperatorDataValidator.java b/o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/processor/thread/OperatorDataValidator.java index 1225a5e46019a8ced68e06300ac44ba3db37248e..07d96e5966b37dede9ddc5148b2a76070f0afe05 100644 --- a/o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/processor/thread/OperatorDataValidator.java +++ b/o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/processor/thread/OperatorDataValidator.java @@ -79,11 +79,17 @@ public class OperatorDataValidator implements Runnable { cacheImportRowDetail.setRecordDateString( colmlist.get(2) ); //打卡日期 if( colmlist.size() > 3 ){ - cacheImportRowDetail.setOnDutyTime( colmlist.get(3) ); //上班打卡时间 + cacheImportRowDetail.setOnDutyTime( colmlist.get(3) ); //上午上班打卡时间 } - if( colmlist.size() > 4 ){ - cacheImportRowDetail.setOffDutyTime( colmlist.get(4) ); //下班打卡时间 + cacheImportRowDetail.setMorningOffDutyTime( colmlist.get(4) ); //上午下班打卡时间 + } + if( colmlist.size() > 5 ){ + cacheImportRowDetail.setAfternoonOnDutyTime( colmlist.get(5) ); //下午上班打卡时间 + } + + if( colmlist.size() > 6 ){ + cacheImportRowDetail.setOffDutyTime( colmlist.get(6) ); //下午下班打卡时间 } cacheImportRowDetail.setCheckStatus( "success" ); //设置数据检查状态为正常 @@ -145,16 +151,44 @@ public class OperatorDataValidator implements Runnable { if( cacheImportRowDetail.getOnDutyTime() != null && cacheImportRowDetail.getOnDutyTime().trim().length() > 0 ){ try{ datetime = dateOperation.getDateFromString( cacheImportRowDetail.getOnDutyTime() ); - cacheImportRowDetail.setOnDutyTimeFormated( dateOperation.getDateStringFromDate( datetime, "HH:mm:ss") ); //上班打卡时间 + cacheImportRowDetail.setOnDutyTimeFormated( dateOperation.getDateStringFromDate( datetime, "HH:mm:ss") ); //上午上班打卡时间 }catch( Exception e ){ checkSuccess = false; cacheImportRowDetail.setCheckStatus("error"); - cacheImportRowDetail.setDescription( cacheImportRowDetail.getDescription() + "上班打卡时间格式异常:" + cacheImportRowDetail.getOnDutyTime() ); + cacheImportRowDetail.setDescription( cacheImportRowDetail.getDescription() + "上午上班打卡时间格式异常:" + cacheImportRowDetail.getOnDutyTime() ); logger.info("step 2, data check on row "+curRow+", found an error!format on field 'onDutyTime':" + cacheImportRowDetail.getOnDutyTime(), e); } } } + if( checkSuccess ) { + if( cacheImportRowDetail.getMorningOffDutyTime() != null && cacheImportRowDetail.getMorningOffDutyTime().trim().length() > 0 ){ + try{ + datetime = dateOperation.getDateFromString( cacheImportRowDetail.getMorningOffDutyTime() ); + cacheImportRowDetail.setMorningOffDutyTimeFormated( dateOperation.getDateStringFromDate( datetime, "HH:mm:ss") ); //上午下班打卡时间 + }catch( Exception e ){ + checkSuccess = false; + cacheImportRowDetail.setCheckStatus("error"); + cacheImportRowDetail.setDescription( cacheImportRowDetail.getDescription() + "上午下班打卡时间格式异常:" + cacheImportRowDetail.getMorningOffDutyTime() ); + logger.info("step 2, data check on row "+curRow+", found an error!format on field 'onDutyTime':" + cacheImportRowDetail.getMorningOffDutyTime(), e); + } + } + } + + if( checkSuccess ) { + if( cacheImportRowDetail.getAfternoonOnDutyTime() != null && cacheImportRowDetail.getAfternoonOnDutyTime().trim().length() > 0 ){ + try{ + datetime = dateOperation.getDateFromString( cacheImportRowDetail.getAfternoonOnDutyTime() ); + cacheImportRowDetail.setAfternoonOnDutyTimeFormated( dateOperation.getDateStringFromDate( datetime, "HH:mm:ss") ); //上午下班打卡时间 + }catch( Exception e ){ + checkSuccess = false; + cacheImportRowDetail.setCheckStatus("error"); + cacheImportRowDetail.setDescription( cacheImportRowDetail.getDescription() + "上午下班打卡时间格式异常:" + cacheImportRowDetail.getAfternoonOnDutyTime() ); + logger.info("step 2, data check on row "+curRow+", found an error!format on field 'onDutyTime':" + cacheImportRowDetail.getAfternoonOnDutyTime(), e); + } + } + } + if( checkSuccess ) { if( cacheImportRowDetail.getOffDutyTime() != null && cacheImportRowDetail.getOffDutyTime().trim().length() > 0 ){ try{ @@ -163,7 +197,7 @@ public class OperatorDataValidator implements Runnable { }catch( Exception e ){ checkSuccess = false; cacheImportRowDetail.setCheckStatus("error"); - cacheImportRowDetail.setDescription( cacheImportRowDetail.getDescription() + "下班打卡时间格式异常:" + cacheImportRowDetail.getOffDutyTime() ); + cacheImportRowDetail.setDescription( cacheImportRowDetail.getDescription() + "下午下班打卡时间格式异常:" + cacheImportRowDetail.getOffDutyTime() ); logger.info("step 2, data check on row "+curRow+", found an error!format on field 'offDutyTime':" + cacheImportRowDetail.getOffDutyTime(), e); } }