| | |
| | | StuStudent stuStudent = findUnique(hql.toString(), args, StuStudent.class); |
| | | |
| | | try{ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); |
| | | String hqlTwo = "from Subject where name = ?"; |
| | | List<Object> argsTwo = CollectionUtils.newList(subjectName); |
| | | Subject subject = findUnique(hqlTwo,argsTwo,Subject.class); |
| | | //上课时间 |
| | | String classTime = subject.getEndTime(); |
| | | //结束时间 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String classTime = sdf.format(subject.getEndTime()); |
| | | //当前时间 |
| | | String currentTime = sdf.format(new Date()); |
| | | //添加subjectId |
| | |
| | | }else { |
| | | stuStudent.setSubjectId(subject.getSubjectId()); |
| | | } |
| | | //如果上课时间(9点)>当前时间 |
| | | //结束时间 >当前时间 |
| | | int compareTo = classTime.compareTo(currentTime); |
| | | if(compareTo>0) |
| | | { |
| | |
| | | else |
| | | { |
| | | //打卡时间 |
| | | String clockTime = subject.getEndTime(); |
| | | String clockTime = sdf.format(subject.getStartTime()); |
| | | compareTo = currentTime.compareTo(clockTime); |
| | | if(compareTo<0) |
| | | { |