| | |
| | | |
| | | @Override |
| | | public List<Subject> list(String text, String teacherId, String status, Integer type, Integer pageSize, Integer pageNum) { |
| | | |
| | | StringBuffer hql = new StringBuffer("from Subject where name like ? and orgId=? and deleteFlag is false and origSubjectId is null "); |
| | | //and origSubjectId is null |
| | | StringBuffer hql = new StringBuffer("from Subject where name like ? and orgId=? and deleteFlag is false "); |
| | | |
| | | List<Object> args = CollectionUtils.newList(text + "%", ClientUtils.getOrgId()); |
| | | |
| | |
| | | args.add(status); |
| | | } |
| | | |
| | | // if (!StringUtils.isEmpty(teacherId)) { |
| | | // hql.append(" and createId=?"); |
| | | // args.add(teacherId); |
| | | // } |
| | | if (!StringUtils.isEmpty(teacherId)) { |
| | | hql.append(" and createId=?"); |
| | | hql.append(" and teacherId=?"); |
| | | args.add(teacherId); |
| | | } |
| | | hql.append(" order by createTime desc"); |
| | |
| | | @Override |
| | | public Result addClsSubject(String classId, String origSubjectId, String teacherId, Integer schoolYear, Integer term) throws IllegalAccessException, InvocationTargetException { |
| | | //新增老师课程 |
| | | Subject newSubject = new Subject(); |
| | | Subject origSubject = this.read(origSubjectId); |
| | | // Subject newSubject = new Subject(); |
| | | Subject newSubject = this.read(origSubjectId); |
| | | UserTeacher teacher = this.read(UserTeacher.class, teacherId); |
| | | BeanUtils.copyProperties(newSubject, origSubject); |
| | | // BeanUtils.copyProperties(newSubject, origSubject); |
| | | |
| | | TraceUtils.setCreateTrace(newSubject); |
| | | newSubject.setSubjectId(null); |
| | | // newSubject.setSubjectId(null); |
| | | newSubject.setTeacherId(teacherId); |
| | | newSubject.setSchoolYear(schoolYear); |
| | | newSubject.setTerm(term); |
| | | newSubject.setStatus(origSubject.getStatus()); |
| | | // newSubject.setStatus(origSubject.getStatus()); |
| | | newSubject.setOrigSubjectId(origSubjectId); |
| | | newSubject.setOrigCopySubjectId(origSubjectId); |
| | | newSubject.setType(Subject.TYPE_CLS_SUBJECT); |