New file |
| | |
| | | package com.qxueyou.scc.admin.studentFiles.Impl; |
| | | |
| | | import com.qxueyou.scc.admin.studentFiles.StudentFilesService; |
| | | import com.qxueyou.scc.base.model.Pager; |
| | | import com.qxueyou.scc.base.model.Result; |
| | | import com.qxueyou.scc.base.service.impl.CommonAppService; |
| | | import com.qxueyou.scc.base.util.CollectionUtils; |
| | | import com.qxueyou.scc.teach.student.model.QStuStudent; |
| | | import com.qxueyou.scc.teach.student.model.StuStudent; |
| | | import com.qxueyou.scc.user.model.QUser; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class StudentFilesServiceImpl extends CommonAppService implements StudentFilesService { |
| | | @Override |
| | | public List<Map<String, Object>> getStudentLst(String classId, String keyword, Pager pager) { |
| | | QUser qUser = QUser.user; |
| | | QStuStudent qStuStudent = QStuStudent.stuStudent; |
| | | return this.getQueryFactory() |
| | | .select(qStuStudent.studentId, qStuStudent.name, qStuStudent.studentNo, qStuStudent.sex, |
| | | qStuStudent.mobilePhone, qStuStudent.status, qStuStudent.studyDuration, qStuStudent.tenantId, qStuStudent.score,qStuStudent.attendanceStatus, qStuStudent.graduationText,qStuStudent.comment, |
| | | qUser.imgPath) |
| | | .from(qUser, qStuStudent) |
| | | .where(qUser.deleteFlag.isFalse().and(qUser.userId.eq(qStuStudent.userId)) |
| | | .and(qStuStudent.classId.eq(classId)).and(qStuStudent.name.like("%" + keyword + "%")).and(qStuStudent.deleteFlag.isFalse())) |
| | | .limit(pager.getPageSize()).offset(pager.getOffset()).orderBy(qStuStudent.createTime.desc()).fetch().stream().map(tuple -> { |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | map.put("studentId", tuple.get(qStuStudent.studentId)); |
| | | map.put("name", tuple.get(qStuStudent.name)); |
| | | map.put("studentNo", tuple.get(qStuStudent.studentNo)); |
| | | map.put("studentNumber", tuple.get(qStuStudent.studentNo)); |
| | | map.put("sex", tuple.get(qStuStudent.sex)); |
| | | map.put("mobilePhone", tuple.get(qStuStudent.mobilePhone)); |
| | | map.put("status", tuple.get(qStuStudent.status)); |
| | | map.put("studyDuration", tuple.get(qStuStudent.studyDuration)); |
| | | map.put("tenantId", tuple.get(qStuStudent.tenantId)); |
| | | map.put("score", tuple.get(qStuStudent.score)); |
| | | map.put("graduationText", tuple.get(qStuStudent.graduationText)); |
| | | map.put("attendanceStatus", tuple.get(qStuStudent.attendanceStatus)); |
| | | map.put("comment", tuple.get(qStuStudent.comment)); |
| | | map.put("imgPath", tuple.get(qUser.imgPath)); |
| | | return map; |
| | | }).collect(Collectors.toList()); |
| | | } |
| | | @Override |
| | | public int getStudentsCount(String classId, String keyword) { |
| | | // //TODO 判断是否为补考分组 |
| | | // ClsClass cls = clsService.read(classId); |
| | | // String hql=null; |
| | | // if(cls!=null && cls.getClassTypes()!=null && "1".equals(cls.getClassTypes())){ |
| | | // //TODO 补考分组需要另一种查询学员 stu.tenantId = class.classId |
| | | // hql = "from StuStudent where tenantId=:classId and name like :keyword and deleteFlag is false"; |
| | | // }else { |
| | | String hql = "from StuStudent where classId=:classId and name like :keyword and deleteFlag is false"; |
| | | // } |
| | | return findCountByComplexHql(hql, CollectionUtils.newObjectMap("classId", classId, "keyword", "%" + keyword + "%" )); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public String studentCommentAddAndUp(String[] studentIds,String comment) { |
| | | StringBuffer hql=new StringBuffer("from StuStudent where studentId=? and deleteFlag is false"); |
| | | |
| | | List<Object> args = CollectionUtils.newList(studentIds); |
| | | |
| | | StuStudent stuStudent = findUnique(hql.toString(), args, StuStudent.class); |
| | | |
| | | stuStudent.setComment(comment); |
| | | |
| | | save(stuStudent); |
| | | return ""; |
| | | } |
| | | } |
New file |
| | |
| | | package com.qxueyou.scc.admin.studentFiles; |
| | | |
| | | import com.qxueyou.scc.base.model.Pager; |
| | | import com.qxueyou.scc.base.model.Result; |
| | | import com.qxueyou.scc.teach.student.model.StuStudent; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 学生档案管理 |
| | | */ |
| | | public interface StudentFilesService { |
| | | /** |
| | | * 学生档案查询 |
| | | * @param classId |
| | | * @param keyword |
| | | * @param pager |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getStudentLst(String classId, String keyword, Pager pager); |
| | | |
| | | /** |
| | | * 获取学员数量 |
| | | * @param classId 班级id |
| | | * @param keyword 关键词 |
| | | * @return |
| | | */ |
| | | int getStudentsCount(String classId,String keyword); |
| | | /** |
| | | * 评语 |
| | | * @param studentIds |
| | | * @param comment |
| | | * @return |
| | | */ |
| | | String studentCommentAddAndUp(String[] studentIds,String comment); |
| | | } |
New file |
| | |
| | | package com.qxueyou.scc.controller; |
| | | |
| | | import com.qxueyou.scc.admin.studentFiles.StudentFilesService; |
| | | import com.qxueyou.scc.base.model.Pager; |
| | | import com.qxueyou.scc.base.model.Result; |
| | | import com.qxueyou.scc.base.util.CollectionUtils; |
| | | import com.qxueyou.scc.base.util.QBeanUtils; |
| | | import com.qxueyou.scc.teach.student.model.StuStudent; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Api(tags="学生档案管理接口") |
| | | @RestController |
| | | @RequestMapping("/admin/StudentFiles") |
| | | public class StudentFilesController { |
| | | |
| | | @Autowired |
| | | private StudentFilesService studentFilesService; |
| | | @ApiOperation(value = "学生档案", notes = "") |
| | | @GetMapping(value = "/studentFilesList") |
| | | public Result studentFilesList(String classId, @RequestParam(defaultValue = "10") Integer limit, |
| | | @RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "") String keyword) { |
| | | |
| | | List<Map<String, Object>> students = studentFilesService.getStudentLst(classId, keyword, new Pager(limit, pageNum)); |
| | | int studentCount = studentFilesService.getStudentsCount(classId, keyword); |
| | | |
| | | return new Result(true, "success", |
| | | CollectionUtils.newObjectMap("studentCount", studentCount, "studentLst", students)); |
| | | } |
| | | |
| | | @ApiOperation(value = "学生评语", notes = "") |
| | | @PostMapping(value = "/studentCommentAddAndUp") |
| | | public String studentCommentAddAndUp(String[] studentIds, String comment) { |
| | | return studentFilesService.studentCommentAddAndUp(studentIds,comment); |
| | | } |
| | | } |
| | |
| | | private String studentNumber; |
| | | private String attendanceStatus; |
| | | private String graduationText; |
| | | private String comment; |
| | | |
| | | public StuStudent() { |
| | | } |
| | |
| | | |
| | | public StuStudent(String studentId, Date createTime, Date updateTime, String creator, String createId, |
| | | String updator, String updateId, boolean deleteFlag, String userId, String name, String classId, |
| | | String tenantId, String status, String attendanceStatus, String graduationText,String studentNumber) { |
| | | String tenantId, String status, String attendanceStatus, String graduationText,String comment,String studentNumber) { |
| | | this.studentId = studentId; |
| | | this.createTime = createTime; |
| | | this.updateTime = updateTime; |
| | |
| | | this.status = status; |
| | | this.attendanceStatus = attendanceStatus; |
| | | this.graduationText = graduationText; |
| | | this.comment = comment; |
| | | this.studentNumber=studentNumber; |
| | | } |
| | | |
| | |
| | | this.graduationText = graduationText; |
| | | } |
| | | |
| | | @Column(name = "COMMENT", length = 200) |
| | | public String getComment() { |
| | | return this.comment; |
| | | } |
| | | public void setComment(String comment) { |
| | | this.comment = comment; |
| | | } |
| | | |
| | | @Column(name = "STUDENT_NO", length = 32) |
| | | public String getStudentNo() { |
| | | return studentNo; |