From 3a27392dc23193ae839526efd779f36589bc91cc Mon Sep 17 00:00:00 2001 From: EricsHu <hrr145632> Date: 星期五, 24 十一月 2023 10:17:52 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/main/java/com/qxueyou/scc/admin/studentFiles/StudentFilesService.java | 27 +--- src/main/java/com/qxueyou/scc/controller/StudentFilesController.java | 25 +-- src/main/java/com/qxueyou/scc/teach/student/service/impl/StudentService.java | 13 ++ src/main/java/com/qxueyou/scc/admin/graduation/GraduationService.java | 3 src/main/java/com/qxueyou/scc/controller/SchoolRollController.java | 3 src/main/java/com/qxueyou/scc/teach/student/model/StuStudent.java | 184 +++++++++++++++++++++++++++--- src/main/java/com/qxueyou/scc/admin/attendance/AttendanceService.java | 3 src/main/java/com/qxueyou/scc/admin/studentFiles/Impl/StudentFilesServiceImpl.java | 72 ++--------- 8 files changed, 217 insertions(+), 113 deletions(-) diff --git a/src/main/java/com/qxueyou/scc/admin/attendance/AttendanceService.java b/src/main/java/com/qxueyou/scc/admin/attendance/AttendanceService.java index a1d8300..cfea9fb 100644 --- a/src/main/java/com/qxueyou/scc/admin/attendance/AttendanceService.java +++ b/src/main/java/com/qxueyou/scc/admin/attendance/AttendanceService.java @@ -5,6 +5,9 @@ import java.util.List; +/** + *鑰冨嫟绠$悊 + */ public interface AttendanceService { /** * 鎵撳崱 diff --git a/src/main/java/com/qxueyou/scc/admin/graduation/GraduationService.java b/src/main/java/com/qxueyou/scc/admin/graduation/GraduationService.java index 62c5288..4cc18c7 100644 --- a/src/main/java/com/qxueyou/scc/admin/graduation/GraduationService.java +++ b/src/main/java/com/qxueyou/scc/admin/graduation/GraduationService.java @@ -2,6 +2,9 @@ import com.qxueyou.scc.base.model.Result; +/** + * 姣曚笟鎯呭喌绠$悊 + */ public interface GraduationService { /** *娣诲姞淇敼姣曚笟鐘舵�� diff --git a/src/main/java/com/qxueyou/scc/admin/studentFiles/Impl/StudentFilesServiceImpl.java b/src/main/java/com/qxueyou/scc/admin/studentFiles/Impl/StudentFilesServiceImpl.java index d6d1489..acd42d7 100644 --- a/src/main/java/com/qxueyou/scc/admin/studentFiles/Impl/StudentFilesServiceImpl.java +++ b/src/main/java/com/qxueyou/scc/admin/studentFiles/Impl/StudentFilesServiceImpl.java @@ -2,77 +2,33 @@ 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); } } diff --git a/src/main/java/com/qxueyou/scc/admin/studentFiles/StudentFilesService.java b/src/main/java/com/qxueyou/scc/admin/studentFiles/StudentFilesService.java index 6cd9348..c5f82ca 100644 --- a/src/main/java/com/qxueyou/scc/admin/studentFiles/StudentFilesService.java +++ b/src/main/java/com/qxueyou/scc/admin/studentFiles/StudentFilesService.java @@ -1,37 +1,22 @@ 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; /** * 瀛︾敓妗f绠$悊 */ public interface StudentFilesService { /** - * 瀛︾敓妗f鏌ヨ - * @param classId + *瀛︾敓妗f鏌ヨ + * @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); } diff --git a/src/main/java/com/qxueyou/scc/controller/SchoolRollController.java b/src/main/java/com/qxueyou/scc/controller/SchoolRollController.java index 33da0aa..3744db2 100644 --- a/src/main/java/com/qxueyou/scc/controller/SchoolRollController.java +++ b/src/main/java/com/qxueyou/scc/controller/SchoolRollController.java @@ -46,8 +46,7 @@ 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)); } diff --git a/src/main/java/com/qxueyou/scc/controller/StudentFilesController.java b/src/main/java/com/qxueyou/scc/controller/StudentFilesController.java index d567a9f..fcf8e66 100644 --- a/src/main/java/com/qxueyou/scc/controller/StudentFilesController.java +++ b/src/main/java/com/qxueyou/scc/controller/StudentFilesController.java @@ -1,7 +1,6 @@ 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; @@ -9,10 +8,12 @@ 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="瀛︾敓妗f绠$悊鎺ュ彛") @RestController @@ -23,19 +24,15 @@ private StudentFilesService studentFilesService; @ApiOperation(value = "瀛︾敓妗f", 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)); } } diff --git a/src/main/java/com/qxueyou/scc/teach/student/model/StuStudent.java b/src/main/java/com/qxueyou/scc/teach/student/model/StuStudent.java index 1a235c0..6b66e97 100644 --- a/src/main/java/com/qxueyou/scc/teach/student/model/StuStudent.java +++ b/src/main/java/com/qxueyou/scc/teach/student/model/StuStudent.java @@ -65,24 +65,34 @@ 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; @@ -94,12 +104,34 @@ 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 @@ -316,4 +348,120 @@ 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; + } } diff --git a/src/main/java/com/qxueyou/scc/teach/student/service/impl/StudentService.java b/src/main/java/com/qxueyou/scc/teach/student/service/impl/StudentService.java index 3441543..19b3f81 100644 --- a/src/main/java/com/qxueyou/scc/teach/student/service/impl/StudentService.java +++ b/src/main/java/com/qxueyou/scc/teach/student/service/impl/StudentService.java @@ -185,6 +185,19 @@ 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()); } -- Gitblit v1.8.0