diff --git a/admin-core/src/main/java/com/ibeetl/admin/core/dao/CoreUserDao.java b/admin-core/src/main/java/com/ibeetl/admin/core/dao/CoreUserDao.java index dc41ddb8..b39702cf 100644 --- a/admin-core/src/main/java/com/ibeetl/admin/core/dao/CoreUserDao.java +++ b/admin-core/src/main/java/com/ibeetl/admin/core/dao/CoreUserDao.java @@ -49,4 +49,6 @@ public interface CoreUserDao extends BaseMapper<CoreUser> { Map<String,Object> getAdminByNo(String username); void updateUserId(Long newId,Long oldId); + + List<CoreUser> getCoreUserListAndOldIdIsNull(); } diff --git a/admin-core/src/main/java/com/ibeetl/admin/core/service/CoreUserService.java b/admin-core/src/main/java/com/ibeetl/admin/core/service/CoreUserService.java index 108caa07..4a922a8c 100644 --- a/admin-core/src/main/java/com/ibeetl/admin/core/service/CoreUserService.java +++ b/admin-core/src/main/java/com/ibeetl/admin/core/service/CoreUserService.java @@ -150,6 +150,11 @@ public class CoreUserService extends CoreBaseService<CoreUser> { return coreUserDao.template(coreUser); } + + public List<CoreUser> getCoreUserListAndOldIdIsNull(){ + return coreUserDao.getCoreUserListAndOldIdIsNull(); + } + /** * 验证 * @return diff --git a/admin-core/src/main/resources/sql/core/coreUser.md b/admin-core/src/main/resources/sql/core/coreUser.md index f7746311..3e1c2a25 100644 --- a/admin-core/src/main/resources/sql/core/coreUser.md +++ b/admin-core/src/main/resources/sql/core/coreUser.md @@ -94,4 +94,8 @@ getAdminByNo select core_user.old_id AS userId, core_user.NAME AS NAME, core_role.NAME AS roleName from core_user JOIN core_user_role ON core_user_role.USER_ID = core_user.ID -JOIN core_role ON core_user_role.ROLE_ID = core_role.ID where core_user.CODE = #username# \ No newline at end of file +JOIN core_role ON core_user_role.ROLE_ID = core_role.ID where core_user.CODE = #username# + +getCoreUserListAndOldIdIsNull +=== + select * from core_user where old_id is null \ No newline at end of file diff --git a/web/src/main/java/com/ibeetl/jlw/dao/SchoolClassDao.java b/web/src/main/java/com/ibeetl/jlw/dao/SchoolClassDao.java index b50ec5fb..56f60bba 100644 --- a/web/src/main/java/com/ibeetl/jlw/dao/SchoolClassDao.java +++ b/web/src/main/java/com/ibeetl/jlw/dao/SchoolClassDao.java @@ -38,4 +38,6 @@ public interface SchoolClassDao extends BaseMapper<SchoolClass> { List<Map<String,Object>> getClassListByMajorId(String majorId); + List<Map<String,Object>> getClassesBySchoolId(Long schoolId); + } \ No newline at end of file diff --git a/web/src/main/java/com/ibeetl/jlw/dao/StudentDao.java b/web/src/main/java/com/ibeetl/jlw/dao/StudentDao.java index 7f8e3beb..c856ef7e 100644 --- a/web/src/main/java/com/ibeetl/jlw/dao/StudentDao.java +++ b/web/src/main/java/com/ibeetl/jlw/dao/StudentDao.java @@ -121,4 +121,6 @@ public interface StudentDao extends BaseMapper<Student>{ PageQuery<Map<String,Object>> pagedListStudentInfoByClassId(PageQuery query); + List<Student> findAllBySchoolId(Long schoolId); + } \ No newline at end of file diff --git a/web/src/main/java/com/ibeetl/jlw/dao/TeacherDao.java b/web/src/main/java/com/ibeetl/jlw/dao/TeacherDao.java index 4dd01ec2..4f809302 100644 --- a/web/src/main/java/com/ibeetl/jlw/dao/TeacherDao.java +++ b/web/src/main/java/com/ibeetl/jlw/dao/TeacherDao.java @@ -53,4 +53,7 @@ public interface TeacherDao extends BaseMapper<Teacher>{ List<TeacherExtendSchoolInfo> getTeacherExtendSchoolInfoListByUserIds(String userIds); List<TeacherUserCenterData.TeacherRuleInfo> getTeacherUserInfoRuleInfo(Long userId, Long teacherId); + + + List<Teacher> findAllTeacherBySchoolId(Long schoolId); } \ No newline at end of file diff --git a/web/src/main/java/com/ibeetl/jlw/dao/UniversitiesCollegesDao.java b/web/src/main/java/com/ibeetl/jlw/dao/UniversitiesCollegesDao.java index 853c80a4..e2b9819e 100644 --- a/web/src/main/java/com/ibeetl/jlw/dao/UniversitiesCollegesDao.java +++ b/web/src/main/java/com/ibeetl/jlw/dao/UniversitiesCollegesDao.java @@ -10,6 +10,7 @@ import org.beetl.sql.mapper.annotation.Update; import org.springframework.stereotype.Repository; import java.util.List; +import java.util.Map; /** @@ -43,4 +44,7 @@ public interface UniversitiesCollegesDao extends BaseMapper<UniversitiesColleges * @return */ List<String> getAllUniversitiesColleges(); + + + List<Map<String,Object>> findAllUniversitiesColleges(); } diff --git a/web/src/main/java/com/ibeetl/jlw/service/SchoolClassService.java b/web/src/main/java/com/ibeetl/jlw/service/SchoolClassService.java index 6a9b071f..5fa76e19 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/SchoolClassService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/SchoolClassService.java @@ -256,6 +256,10 @@ public class SchoolClassService extends CoreBaseService<SchoolClass> { return schoolClassDao.getClassesByOrgId(orgId); } + public List<Map<String,Object>> getClassesBySchoolId(Long schoolId){ + return schoolClassDao.getClassesBySchoolId(schoolId); + } + public List<Map<String, Object>> getClassListByMajorId(String majorId) { return schoolClassDao.getClassListByMajorId(majorId); } diff --git a/web/src/main/java/com/ibeetl/jlw/service/StudentService.java b/web/src/main/java/com/ibeetl/jlw/service/StudentService.java index e0e8bb63..82b372fa 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/StudentService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/StudentService.java @@ -1631,4 +1631,8 @@ public class StudentService extends CoreBaseService<Student> { pageQuery.setParas(map); return studentDao.pagedListStudentInfoByClassId(pageQuery); } + + public List<Student> findAllBySchoolId(Long schoolId) { + return studentDao.findAllBySchoolId(schoolId); + } } \ No newline at end of file diff --git a/web/src/main/java/com/ibeetl/jlw/service/TeacherService.java b/web/src/main/java/com/ibeetl/jlw/service/TeacherService.java index c69f241f..bbfd4cce 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/TeacherService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/TeacherService.java @@ -828,4 +828,9 @@ public class TeacherService extends CoreBaseService<Teacher> { errorRowIndex, 4, StrUtil.format("已存在的教师编号:\"{}\"!", duplicateElement)); } } + + + public List<Teacher> findAllTeacherBySchoolId(Long schoolId){ + return teacherDao.findAllTeacherBySchoolId(schoolId); + } } \ No newline at end of file diff --git a/web/src/main/java/com/ibeetl/jlw/service/UniversitiesCollegesService.java b/web/src/main/java/com/ibeetl/jlw/service/UniversitiesCollegesService.java index 74ed7044..f527d340 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/UniversitiesCollegesService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/UniversitiesCollegesService.java @@ -356,4 +356,9 @@ public class UniversitiesCollegesService extends CoreBaseService<UniversitiesCol public LambdaQuery<UniversitiesColleges> createLambdaQuery() { return universitiesCollegesDao.createLambdaQuery(); } + + + public List<Map<String,Object>> findAll(){ + return universitiesCollegesDao.findAllUniversitiesColleges(); + } } diff --git a/web/src/main/java/com/ibeetl/jlw/web/AccountController.java b/web/src/main/java/com/ibeetl/jlw/web/AccountController.java index 9801c1bd..eb575a05 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/AccountController.java +++ b/web/src/main/java/com/ibeetl/jlw/web/AccountController.java @@ -51,6 +51,11 @@ public class AccountController { private SchoolClassService schoolClassService; @Autowired private UniversitySystemService universitySystemService; + @Autowired + private UniversitiesCollegesService universitiesCollegesService; + + @Autowired + private TeacherService teacherService; private final static String URL = "jdbc:sqlserver://120.79.161.177:1433;databaseName=Test.Zhiyun_v2.0;trustServerCertificate=true;encrypt=true"; private final static String USER = "sa"; @@ -104,9 +109,9 @@ public class AccountController { return JsonResult.success(userService.getStudentByNo(username)); } else if (roleName.equals("教师")) { return JsonResult.success(userService.getTeacherByNo(username)); - }else if (roleName.equals("超级管理员")) { + } else if (roleName.equals("超级管理员")) { return JsonResult.success(userService.getAdminByNo(username)); - }else{ + } else { return null; } } @@ -835,7 +840,9 @@ public class AccountController { List<CoreUser> coreUsers = userService.getCoreUserList(coreUser); int i = 0; for (CoreUser user : coreUsers) { - if(user.getOldId()!=null){continue;} + if (user.getOldId() != null) { + continue; + } Connection conn = openConn(); PreparedStatement ps = conn.prepareStatement("select * from EduUsers where username = '" + user.getCode() + "' and IsDeleted = 0"); @@ -847,8 +854,49 @@ public class AccountController { } closeConn(conn); ps.close(); - System.out.println("已完成:"+i++); + System.out.println("已完成:" + i++); + } + return JsonResult.success(); + } + + @ApiOperation("修改用户表userid") + @PostMapping("updateUserIdAndOldIdIsNull.json") + public JsonResult updateUserIdAndOldIdIsNull() throws SQLException { + CoreUser coreUser = new CoreUser(); + List<CoreUser> coreUsers = userService.getCoreUserListAndOldIdIsNull(); + int i = 0; + Long j = 50000L; + for (CoreUser user : coreUsers) { + j++; + user.setOldId(j); + userService.updateTemplate(user); + System.out.println("已完成:" + i++); } return JsonResult.success(); } + + @ApiOperation("根据学校id查询班级数据") + @GetMapping("getClassesBySchoolId.json") + public JsonResult<List<Map<String, Object>>> getClassesBySchoolId(Long schoolId) { + return JsonResult.success(schoolClassService.getClassesBySchoolId(schoolId)); + } + + @ApiOperation("获取所有学校") + @GetMapping("findAllSchool.json") + public JsonResult<List<Map<String, Object>>> findAllSchool() { + return JsonResult.success(universitiesCollegesService.findAll()); + } + + @ApiOperation("根据学校id获取学生信息") + @GetMapping("findAllStudentBySchoolId.json") + public JsonResult<List<Student>> findAllStudentBySchoolId(Long schoolId) { + return JsonResult.success(studentService.findAllBySchoolId(schoolId)); + } + + @ApiOperation("根据学校id获取教师信息") + @GetMapping("findAllTeacherBySchoolId.json") + public JsonResult<List<Teacher>> findAllTeacherBySchoolId(Long schoolId) { + return JsonResult.success(teacherService.findAllTeacherBySchoolId(schoolId)); + } + } diff --git a/web/src/main/resources/sql/jlw/schoolClass.md b/web/src/main/resources/sql/jlw/schoolClass.md index bb1e85da..c4e3b871 100644 --- a/web/src/main/resources/sql/jlw/schoolClass.md +++ b/web/src/main/resources/sql/jlw/schoolClass.md @@ -192,4 +192,8 @@ school_class.universities_colleges_id = universities_colleges.universities_colle getClassListByMajorId === -select class_id as id,class_name as name from school_class where university_system_id = #majorId# \ No newline at end of file +select class_id as id,class_name as name from school_class where university_system_id = #majorId# + +getClassesBySchoolId +=== +select class_id as id,class_name as name from school_class where universities_colleges_id = #schoolId# \ No newline at end of file diff --git a/web/src/main/resources/sql/jlw/student.md b/web/src/main/resources/sql/jlw/student.md index a3c9a4df..52366afb 100644 --- a/web/src/main/resources/sql/jlw/student.md +++ b/web/src/main/resources/sql/jlw/student.md @@ -2209,4 +2209,9 @@ pagedListStudentInfoByClassId join core_user on core_user.CODE = student.student_sn WHERE 1=1 @if(!isEmpty(classIds)){ and find_in_set(student.class_id ,#classIds#) - @} \ No newline at end of file + @} + + +findAllBySchoolId +=== +select * from student join universities_colleges uc on student.org_id = uc.org_id where universities_colleges_id = #schoolId# \ No newline at end of file diff --git a/web/src/main/resources/sql/jlw/teacher.md b/web/src/main/resources/sql/jlw/teacher.md index b1314650..1e64e935 100644 --- a/web/src/main/resources/sql/jlw/teacher.md +++ b/web/src/main/resources/sql/jlw/teacher.md @@ -559,3 +559,6 @@ getTeacherUserInfoRuleInfo and t.user_id =#userId# @} +findAllTeacherBySchoolId +=== +select * from teacher where universities_colleges_id =#schoolId# \ No newline at end of file diff --git a/web/src/main/resources/sql/jlw/universitiesColleges.md b/web/src/main/resources/sql/jlw/universitiesColleges.md index fb5e7b9f..c7624a8f 100644 --- a/web/src/main/resources/sql/jlw/universitiesColleges.md +++ b/web/src/main/resources/sql/jlw/universitiesColleges.md @@ -278,4 +278,8 @@ getAllUniversitiesColleges FROM universities_colleges t WHERE 1 - AND t.universities_colleges_status = 1 \ No newline at end of file + AND t.universities_colleges_status = 1 + +findAllUniversitiesColleges +=== +select universities_colleges_id as id,universities_colleges_name as name from universities_colleges \ No newline at end of file