|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | try{ | 
|---|
|  |  |  | SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); | 
|---|
|  |  |  | //上课时间 | 
|---|
|  |  |  | String classTime = "9:00:00"; | 
|---|
|  |  |  | //当前时间 | 
|---|
|  |  |  | String currentTime = sdf.format(new Date()); | 
|---|
|  |  |  | String hqlTwo = "from Subject where name = ?"; | 
|---|
|  |  |  | List<Object> argsTwo = CollectionUtils.newList(subjectName); | 
|---|
|  |  |  | Subject subject = findUnique(hqlTwo,argsTwo,Subject.class); | 
|---|
|  |  |  | //上课时间 | 
|---|
|  |  |  | String classTime = subject.getEndTime(); | 
|---|
|  |  |  | //当前时间 | 
|---|
|  |  |  | String currentTime = sdf.format(new Date()); | 
|---|
|  |  |  | //添加subjectId | 
|---|
|  |  |  | if(subject.getSubjectId() == subjectId){ | 
|---|
|  |  |  | stuStudent.setSubjectId(subjectId); | 
|---|
|  |  |  | 
|---|
|  |  |  | int compareTo = classTime.compareTo(currentTime); | 
|---|
|  |  |  | if(compareTo>0) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | s="签到时间已过,本节课按照旷课处理"; | 
|---|
|  |  |  | s="签到时间已过"; | 
|---|
|  |  |  | stuStudent.setAttendanceStatus(stuStudent.STATUS_TRUANCY); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //打卡时间 | 
|---|
|  |  |  | String clockTime = "8:50:00"; | 
|---|
|  |  |  | String clockTime = subject.getEndTime(); | 
|---|
|  |  |  | compareTo = currentTime.compareTo(clockTime); | 
|---|
|  |  |  | if(compareTo<0) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | s="未到签到时间,请与上课时间前10分钟签到"; | 
|---|
|  |  |  | s="未到签到时间"; | 
|---|
|  |  |  | stuStudent.setAttendanceStatus(stuStudent.STATUS_NO_CLOCKING); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public List<StuStudent> findAttendanceList(Integer limit, Integer pageNum, String keyword, String subjectId) { | 
|---|
|  |  |  | StringBuffer hql=new StringBuffer("from StuStudent where name like ? and subjectId = ? and deleteFlag is false"); | 
|---|
|  |  |  | public List<StuStudent> findAttendanceList(Integer limit, Integer pageNum, String keyword, String classId) { | 
|---|
|  |  |  | StringBuffer hql=new StringBuffer("from StuStudent where name like ? and classId = ? and deleteFlag is false"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<Object> args = CollectionUtils.newList(keyword + "%",subjectId); | 
|---|
|  |  |  | List<Object> args = CollectionUtils.newList(keyword + "%",classId); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | hql.append(" order by createTime desc"); | 
|---|
|  |  |  |  | 
|---|