Commit fa035bed authored by gaoyingwei's avatar gaoyingwei

修改 同步中控考勤

parent 910a500b
...@@ -287,24 +287,24 @@ public class AttendanceSyncSchedule { ...@@ -287,24 +287,24 @@ public class AttendanceSyncSchedule {
cal1.add(Calendar.MINUTE, -10); cal1.add(Calendar.MINUTE, -10);
endTime = cal1.getTime(); endTime = cal1.getTime();
log.error("----------同步时间段:" + DateUtil.format(beginTime,"yyyy-MM-dd HH:mm:ss")+" " +DateUtil.format(endTime,"yyyy-MM-dd HH:mm:ss")); log.error("----------同步时间段:" + DateUtil.format(beginTime,"yyyy-MM-dd HH:mm:ss")+" " +DateUtil.format(endTime,"yyyy-MM-dd HH:mm:ss"));
// if (zkTecoService.saveDoorRecordInfo(DateUtil.format(beginTime,"yyyy-MM-dd HH:mm:ss") if (zkTecoService.saveDoorRecordInfo(DateUtil.format(beginTime,"yyyy-MM-dd HH:mm:ss")
// ,DateUtil.format(endTime,"yyyy-MM-dd HH:mm:ss"))) { ,DateUtil.format(endTime,"yyyy-MM-dd HH:mm:ss"))) {
ScheduledTime scheduledTime = new ScheduledTime(); ScheduledTime scheduledTime = new ScheduledTime();
String date = DateUtil.format(now,"yyyy-MM-dd") + " 00:00:00"; String date = DateUtil.format(now,"yyyy-MM-dd") + " 00:00:00";
scheduledTime.setScheduleDate(DateUtil.parseDate(date)); scheduledTime.setScheduleDate(DateUtil.parseDate(date));
scheduledTime.setBeginTime(DateUtil.parse(date,"yyyy-MM-dd HH:mm:ss")); scheduledTime.setBeginTime(DateUtil.parse(date,"yyyy-MM-dd HH:mm:ss"));
scheduledTime.setEndTime(endTime); scheduledTime.setEndTime(endTime);
scheduledResultRepository.insertScheduledTime(scheduledTime); scheduledResultRepository.insertScheduledTime(scheduledTime);
// } }
} else { } else {
log.error("----------同步时间段:" + DateUtil.format(beginTime,"yyyy-MM-dd HH:mm:ss")+" " +DateUtil.format(endTime,"yyyy-MM-dd HH:mm:ss")); log.error("----------同步时间段:" + DateUtil.format(beginTime,"yyyy-MM-dd HH:mm:ss")+" " +DateUtil.format(endTime,"yyyy-MM-dd HH:mm:ss"));
int minute = (int) ((endTime.getTime() - beginTime.getTime()) / 1000);//求出两个时间段相差的秒数 int minute = (int) ((endTime.getTime() - beginTime.getTime()) / 1000);//求出两个时间段相差的秒数
log.error("----------minute:"+minute); log.error("----------minute:"+minute);
if (minute<=600){//如果求出的秒数超出十分钟,则说明之前有报错,后续不执行 if (minute<=600){//如果求出的秒数超出十分钟,则说明之前有报错,后续不执行
// if (zkTecoService.saveDoorRecordInfo(DateUtil.format(beginTime,"yyyy-MM-dd HH:mm:ss") if (zkTecoService.saveDoorRecordInfo(DateUtil.format(beginTime,"yyyy-MM-dd HH:mm:ss")
// ,DateUtil.format(endTime,"yyyy-MM-dd HH:mm:ss"))) { ,DateUtil.format(endTime,"yyyy-MM-dd HH:mm:ss"))) {
scheduledResultRepository.updateScheduledTime(time.getEndTime(), endTime,time.getBusinessId()); scheduledResultRepository.updateScheduledTime(time.getEndTime(), endTime,time.getBusinessId());
// } }
} }
} }
} }
......
...@@ -426,10 +426,10 @@ public class ScheduledResultServiceImpl extends ServiceImpl<ScheduledResultRepos ...@@ -426,10 +426,10 @@ public class ScheduledResultServiceImpl extends ServiceImpl<ScheduledResultRepos
cal1.add(Calendar.SECOND, 1); cal1.add(Calendar.SECOND, 1);
endTime = cal1.getTime(); endTime = cal1.getTime();
log.error("----------同步时间段:" + DateUtil.format(beginTime,"yyyy-MM-dd HH:mm:ss")+" " +DateUtil.format(endTime,"yyyy-MM-dd HH:mm:ss")); log.error("----------同步时间段:" + DateUtil.format(beginTime,"yyyy-MM-dd HH:mm:ss")+" " +DateUtil.format(endTime,"yyyy-MM-dd HH:mm:ss"));
// if (zkTecoService.saveDoorRecordInfo(DateUtil.format(beginTime,"yyyy-MM-dd HH:mm:ss") if (zkTecoService.saveDoorRecordInfo(DateUtil.format(beginTime,"yyyy-MM-dd HH:mm:ss")
// ,DateUtil.format(endTime,"yyyy-MM-dd HH:mm:ss"))) { ,DateUtil.format(endTime,"yyyy-MM-dd HH:mm:ss"))) {
scheduledResultRepository.updateScheduledTime(time.getEndTime(), endTime,time.getBusinessId()); scheduledResultRepository.updateScheduledTime(time.getEndTime(), endTime,time.getBusinessId());
// } }
return new CyPersistModel(1); return new CyPersistModel(1);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment