| | |
| | | |
| | | try{ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); |
| | | //上课时间 |
| | | String s1 = "9:00:00"; |
| | | //如果上课时间(9点)>当前时间 |
| | | //上课时间 |
| | | String s1 = "9:00:00"; |
| | | //如果上课时间(9点)>当前时间 |
| | | String s2 = sdf.format(new Date()); |
| | | int compareTo = s1.compareTo(s2); |
| | | if(compareTo>0) |
| | | { |
| | | s="签到时间已过,本节课按照旷课处理"; |
| | | stuStudent.setAttendanceStatus("旷课"); |
| | | s="签到时间已过,本节课按照旷课处理"; |
| | | stuStudent.setAttendanceStatus("旷课"); |
| | | } |
| | | else |
| | | { |
| | | String s3 = "8:50:00"; |
| | | String s3 = "8:50:00"; |
| | | compareTo = s2.compareTo(s3); |
| | | if(compareTo<0) |
| | | { |
| | | s="未到签到时间,请与上课时间前10分钟签到"; |
| | | stuStudent.setAttendanceStatus("未打卡"); |
| | | s="未到签到时间,请与上课时间前10分钟签到"; |
| | | stuStudent.setAttendanceStatus("未打卡"); |
| | | } |
| | | else |
| | | { |
| | | if(stuStudent!=null && subjectId!=null){ |
| | | stuStudent.setSubjectId(subjectId); |
| | | stuStudent.setAttendanceStatus("已打卡"); |
| | | s = "成功完成签到"; |
| | | stuStudent.setAttendanceStatus("已打卡"); |
| | | s = "成功完成签到"; |
| | | } |
| | | } |
| | | } |