提交 007bc2da 编写于 作者: O o2null

Merge branch 'frature/attendance715' into 'develop'

考勤导入模板修改并修改相应接口数据Frature/attendance715

See merge request o2oa/o2oa!1143
......@@ -90,11 +90,68 @@ public class ActionListMyMobileRecordToday extends BaseAction {
woSignFeature.setSignDate( signDate );
}
}
//列示排班详情
List<WoSignFeature> 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<WoSignFeature> 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<WoSignFeature> getScheduleInfos() { return scheduleInfos; }
public void setScheduleInfos(List<WoSignFeature> scheduleInfos) { this.scheduleInfos = scheduleInfos; }
}
public static class WoScheduleSetting extends AttendanceScheduleSetting {
......
......@@ -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;
......
......@@ -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 );
......
......@@ -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);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册