派生自 projectDept/qhighschool

yn147
2023-11-24 26780c533f2c2af6b9216306f649c1bcede94e4a
src/main/java/com/qxueyou/scc/admin/attendance/impl/AttendanceServiceImpl.java
@@ -27,35 +27,35 @@
        StuStudent stuStudent = findUnique(hql.toString(), args, StuStudent.class);
        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);
            //结束时间
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            String classTime = sdf.format(subject.getEndTime());
            //当前时间
            String currentTime = sdf.format(new Date());
            //添加subjectId
            if(subject.getSubjectId() == subjectId){
                stuStudent.setSubjectId(subjectId);
            }else {
                stuStudent.setSubjectId(subject.getSubjectId());
            }
            //如果上课时间(9点)>当前时间
            //结束时间 >当前时间
            int compareTo = classTime.compareTo(currentTime);
            if(compareTo>0)
            {
                s="签到时间已过,本节课按照旷课处理";
                s="签到时间已过";
                stuStudent.setAttendanceStatus(stuStudent.STATUS_TRUANCY);
            }
            else
            {
                //打卡时间
                String clockTime = "8:50:00";
                String clockTime = sdf.format(subject.getStartTime());
                compareTo = currentTime.compareTo(clockTime);
                if(compareTo<0)
                {
                    s="未到签到时间,请与上课时间前10分钟签到";
                    s="未到签到时间";
                    stuStudent.setAttendanceStatus(stuStudent.STATUS_NO_CLOCKING);
                }
                else
@@ -76,10 +76,10 @@
    }
    @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");