| | |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | *考勤管理 |
| | | */ |
| | | public interface AttendanceService { |
| | | /** |
| | | * 打卡 |
| | |
| | | |
| | | import com.qxueyou.scc.base.model.Result; |
| | | |
| | | /** |
| | | * 毕业情况管理 |
| | | */ |
| | | public interface GraduationService { |
| | | /** |
| | | *添加修改毕业状态 |
| | |
| | | |
| | | 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()); |
| | | public List<StuStudent> findStudentFiles(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 + "%",classId); |
| | | |
| | | hql.append(" order by createTime desc"); |
| | | |
| | | List<StuStudent> list = findList(hql.toString(), new Pager(limit, pageNum), args, StuStudent.class); |
| | | |
| | | return list; |
| | | } |
| | | @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 + "%" )); |
| | | public int findfindStudentFilesListCount(String keyword, String classId) { |
| | | StringBuffer hql=new StringBuffer("from StuStudent where name like ? and subjectId = ? and deleteFlag is false"); |
| | | |
| | | } |
| | | List<Object> args = CollectionUtils.newList(keyword + "%",classId); |
| | | |
| | | @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 ""; |
| | | return findCount(hql.toString(),args); |
| | | } |
| | | } |
| | |
| | | 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 limit |
| | | * @param pageNum |
| | | * @param keyword |
| | | * @param pager |
| | | * @param classId |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getStudentLst(String classId, String keyword, Pager pager); |
| | | List<StuStudent> findStudentFiles(Integer limit, Integer pageNum, String keyword, String classId); |
| | | |
| | | /** |
| | | * 获取学员数量 |
| | | * @param classId 班级id |
| | | * @param keyword 关键词 |
| | | * @return |
| | | */ |
| | | int getStudentsCount(String classId,String keyword); |
| | | /** |
| | | * 评语 |
| | | * @param studentIds |
| | | * @param comment |
| | | * @return |
| | | */ |
| | | String studentCommentAddAndUp(String[] studentIds,String comment); |
| | | int findfindStudentFilesListCount(String keyword, String classId); |
| | | } |
| | |
| | | |
| | | return new Result(true,"success", CollectionUtils.newObjectMap("schoolRollList", |
| | | QBeanUtils.listBean2ListMap(schoolRollList, |
| | | CollectionUtils.newStringMap("name", "studentName","studentId","studentId", "studentNo", "studentNo","sex","sex", "status", |
| | | "status", "createTime", "createTime","mobilePhone","mobilePhone","studentNumber","studentNumber")), |
| | | CollectionUtils.newStringMap("name", "studentName","studentId","studentId", "studentNo", "studentNo","sex","sex", "status", "status", "createTime", "createTime","mobilePhone","mobilePhone","studentNumber","studentNumber","photo","photo","passporName","passporName","nationality","nationality","ancestralHome","ancestralHome","birthday","birthday","birthplace","birthplace","chinaStatus","chinaStatus","registeredAddress","registeredAddress","homeAddress","homeAddress","religiousBelief","religiousBelief","email","email","workUnit","workUnit","graduationDestination","graduationDestination")), |
| | | "schoolrollCount", count)); |
| | | } |
| | | |
| | |
| | | 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 io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Api(tags="学生档案管理接口") |
| | | @RestController |
| | |
| | | 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) { |
| | | public Result studentFilesList(@RequestParam(defaultValue = "10") Integer limit, @RequestParam(defaultValue = "1") Integer pageNum, String keyword, String classId) { |
| | | |
| | | List<Map<String, Object>> students = studentFilesService.getStudentLst(classId, keyword, new Pager(limit, pageNum)); |
| | | int studentCount = studentFilesService.getStudentsCount(classId, keyword); |
| | | List<StuStudent> stuStudents = studentFilesService.findStudentFiles(limit, pageNum, keyword,classId); |
| | | |
| | | return new Result(true, "success", |
| | | CollectionUtils.newObjectMap("studentCount", studentCount, "studentLst", students)); |
| | | } |
| | | int count = studentFilesService.findfindStudentFilesListCount(keyword,classId); |
| | | |
| | | @ApiOperation(value = "学生评语", notes = "") |
| | | @PostMapping(value = "/studentCommentAddAndUp") |
| | | public String studentCommentAddAndUp(String[] studentIds, String comment) { |
| | | return studentFilesService.studentCommentAddAndUp(studentIds,comment); |
| | | return new Result(true,"success", CollectionUtils.newObjectMap("attendanceList", |
| | | QBeanUtils.listBean2ListMap(stuStudents, |
| | | CollectionUtils.newStringMap("name", "studentName","studentId","studentId", "studentNo", "studentNo","sex","sex", "status", "status", "createTime", "createTime","mobilePhone","mobilePhone","studentNumber","studentNumber","photo","photo","passporName","passporName","nationality","nationality","ancestralHome","ancestralHome","birthday","birthday","birthplace","birthplace","chinaStatus","chinaStatus","registeredAddress","registeredAddress","homeAddress","homeAddress","religiousBelief","religiousBelief","email","email","workUnit","workUnit","graduationDestination","graduationDestination","attendanceStatus", "attendanceStatus")), |
| | | "attendanceCount", count)); |
| | | } |
| | | } |
| | |
| | | private String attendanceStatus; |
| | | private String graduationText; |
| | | private String comment; |
| | | //照片 |
| | | private String photo; |
| | | //护照名 |
| | | private String passporName; |
| | | //国籍 |
| | | private String nationality; |
| | | //祖籍地 |
| | | private String ancestralHome; |
| | | //出生日期 |
| | | private String birthday; |
| | | //出生地 |
| | | private String birthplace; |
| | | //是否港澳台侨 |
| | | private String chinaStatus; |
| | | //户口详细地址 |
| | | private String registeredAddress; |
| | | //家庭详细地址 |
| | | private String homeAddress; |
| | | //宗教信仰 |
| | | private String religiousBelief; |
| | | //邮箱地址 |
| | | private String email; |
| | | //工作单位 |
| | | private String workUnit; |
| | | //毕业去向 |
| | | private String graduationDestination; |
| | | |
| | | public StuStudent() { |
| | | } |
| | | |
| | | public StuStudent(String studentId, Date createTime, Date updateTime, String creator, String createId, |
| | | boolean deleteFlag,String studentNumber) { |
| | | this.studentId = studentId; |
| | | this.createTime = createTime; |
| | | this.updateTime = updateTime; |
| | | this.creator = creator; |
| | | this.createId = createId; |
| | | this.deleteFlag = deleteFlag; |
| | | this.studentNumber=studentNumber; |
| | | } |
| | | |
| | | 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 comment,String studentNumber) { |
| | | 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 subjectId, String tenantId, String status, String studentNo, boolean sex, String mobilePhone, BigDecimal studyDuration, BigDecimal score, String studentNumber, String attendanceStatus, String graduationText, String comment, String photo, String passporName, String nationality, String ancestralHome, String birthday, String birthplace, String chinaStatus, String registeredAddress, String homeAddress, String religiousBelief, String email, String workUnit, String graduationDestination) { |
| | | this.studentId = studentId; |
| | | this.createTime = createTime; |
| | | this.updateTime = updateTime; |
| | |
| | | this.userId = userId; |
| | | this.name = name; |
| | | this.classId = classId; |
| | | this.subjectId = subjectId; |
| | | this.tenantId = tenantId; |
| | | this.status = status; |
| | | this.studentNo = studentNo; |
| | | this.sex = sex; |
| | | this.mobilePhone = mobilePhone; |
| | | this.studyDuration = studyDuration; |
| | | this.score = score; |
| | | this.studentNumber = studentNumber; |
| | | this.attendanceStatus = attendanceStatus; |
| | | this.graduationText = graduationText; |
| | | this.comment = comment; |
| | | this.studentNumber=studentNumber; |
| | | this.photo = photo; |
| | | this.passporName = passporName; |
| | | this.nationality = nationality; |
| | | this.ancestralHome = ancestralHome; |
| | | this.birthday = birthday; |
| | | this.birthplace = birthplace; |
| | | this.chinaStatus = chinaStatus; |
| | | this.registeredAddress = registeredAddress; |
| | | this.homeAddress = homeAddress; |
| | | this.religiousBelief = religiousBelief; |
| | | this.email = email; |
| | | this.workUnit = workUnit; |
| | | this.graduationDestination = graduationDestination; |
| | | } |
| | | |
| | | public StuStudent() { |
| | | } |
| | | |
| | | @Id |
| | |
| | | this.studentNumber = studentNumber; |
| | | } |
| | | |
| | | @Column(name = "PHOTO", length = 50) |
| | | public String getPhoto() { |
| | | return photo; |
| | | } |
| | | |
| | | public void setPhoto(String photo) { |
| | | this.photo = photo; |
| | | } |
| | | |
| | | @Column(name = "PASSPORT_NAME", length = 100) |
| | | public String getPassporName() { |
| | | return passporName; |
| | | } |
| | | |
| | | public void setPassporName(String passporName) { |
| | | this.passporName = passporName; |
| | | } |
| | | |
| | | @Column(name = "NATIONALITY", length = 32) |
| | | public String getNationality() { |
| | | return nationality; |
| | | } |
| | | |
| | | public void setNationality(String nationality) { |
| | | this.nationality = nationality; |
| | | } |
| | | |
| | | @Column(name = "ANCESTRAL_HOME", length = 50) |
| | | public String getAncestralHome() { |
| | | return ancestralHome; |
| | | } |
| | | |
| | | public void setAncestralHome(String ancestralHome) { |
| | | this.ancestralHome = ancestralHome; |
| | | } |
| | | |
| | | @Column(name = "BIRTHDAY", length = 50) |
| | | public String getBirthday() { |
| | | return birthday; |
| | | } |
| | | |
| | | public void setBirthday(String birthday) { |
| | | this.birthday = birthday; |
| | | } |
| | | |
| | | @Column(name = "BIRTHPLACE", length = 50) |
| | | public String getBirthplace() { |
| | | return birthplace; |
| | | } |
| | | |
| | | public void setBirthplace(String birthplace) { |
| | | this.birthplace = birthplace; |
| | | } |
| | | |
| | | @Column(name = "CHINA_STATUS", length = 16) |
| | | public String getChinaStatus() { |
| | | return chinaStatus; |
| | | } |
| | | |
| | | public void setChinaStatus(String chinaStatus) { |
| | | this.chinaStatus = chinaStatus; |
| | | } |
| | | |
| | | @Column(name = "REGISTERED_ADDRESS", length = 50) |
| | | public String getRegisteredAddress() { |
| | | return registeredAddress; |
| | | } |
| | | |
| | | public void setRegisteredAddress(String registeredAddress) { |
| | | this.registeredAddress = registeredAddress; |
| | | } |
| | | |
| | | @Column(name = "HOME_ADDRESS", length = 50) |
| | | public String getHomeAddress() { |
| | | return homeAddress; |
| | | } |
| | | |
| | | public void setHomeAddress(String homeAddress) { |
| | | this.homeAddress = homeAddress; |
| | | } |
| | | |
| | | @Column(name = "RELIGIOUS_BELIEF", length = 150) |
| | | public String getReligiousBelief() { |
| | | return religiousBelief; |
| | | } |
| | | |
| | | public void setReligiousBelief(String religiousBelief) { |
| | | this.religiousBelief = religiousBelief; |
| | | } |
| | | |
| | | @Column(name = "EMAIL", length = 32) |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | |
| | | @Column(name = "WORK_UNIT", length = 32) |
| | | public String getWorkUnit() { |
| | | return workUnit; |
| | | } |
| | | |
| | | public void setWorkUnit(String workUnit) { |
| | | this.workUnit = workUnit; |
| | | } |
| | | |
| | | @Column(name = "GRADUATION_DESTINATION", length = 32) |
| | | public String getGraduationDestination() { |
| | | return graduationDestination; |
| | | } |
| | | |
| | | public void setGraduationDestination(String graduationDestination) { |
| | | this.graduationDestination = graduationDestination; |
| | | } |
| | | } |
| | |
| | | map.put("score", tuple.get(qStuStudent.score)); |
| | | map.put("graduationText", tuple.get(qStuStudent.graduationText)); |
| | | map.put("imgPath", tuple.get(qUser.imgPath)); |
| | | map.put("photo", tuple.get(qStuStudent.photo)); |
| | | map.put("passporName", tuple.get(qStuStudent.passporName)); |
| | | map.put("nationality", tuple.get(qStuStudent.nationality)); |
| | | map.put("ancestralHome", tuple.get(qStuStudent.ancestralHome)); |
| | | map.put("birthday", tuple.get(qStuStudent.birthday)); |
| | | map.put("birthplace", tuple.get(qStuStudent.birthplace)); |
| | | map.put("chinaStatus", tuple.get(qStuStudent.chinaStatus)); |
| | | map.put("registeredAddress", tuple.get(qStuStudent.registeredAddress)); |
| | | map.put("homeAddress", tuple.get(qStuStudent.homeAddress)); |
| | | map.put("religiousBelief", tuple.get(qStuStudent.religiousBelief)); |
| | | map.put("email", tuple.get(qStuStudent.email)); |
| | | map.put("workUnit", tuple.get(qStuStudent.workUnit)); |
| | | map.put("graduationDestination", tuple.get(qStuStudent.graduationDestination)); |
| | | return map; |
| | | }).collect(Collectors.toList()); |
| | | } |