Просмотр исходного кода

考勤模板修改,并修改对应接口数据

luojing 5 лет назад
Родитель
Сommit
a4f020ee59

+ 40 - 0
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;

+ 2 - 0
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 );

+ 40 - 6
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);
 						}
 					}