|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.ibeetl.jlw.web;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.ibeetl.admin.console.web.query.UserQuery;
|
|
|
|
|
import com.ibeetl.admin.core.entity.CoreUser;
|
|
|
|
|
import com.ibeetl.admin.core.service.CoreUserService;
|
|
|
|
|
import com.ibeetl.admin.core.web.JsonResult;
|
|
|
|
@ -101,8 +102,12 @@ public class AccountController {
|
|
|
|
|
String roleName = objectMap.get("name").toString();
|
|
|
|
|
if (roleName.equals("学生")) {
|
|
|
|
|
return JsonResult.success(userService.getStudentByNo(username));
|
|
|
|
|
} else {
|
|
|
|
|
} else if (roleName.equals("教师")) {
|
|
|
|
|
return JsonResult.success(userService.getTeacherByNo(username));
|
|
|
|
|
}else if (roleName.equals("超级管理员")) {
|
|
|
|
|
return JsonResult.success(userService.getAdminByNo(username));
|
|
|
|
|
}else{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return JsonResult.success(objectMap);
|
|
|
|
@ -795,31 +800,54 @@ public class AccountController {
|
|
|
|
|
|
|
|
|
|
@ApiOperation("根据专业id获取班级列表")
|
|
|
|
|
@GetMapping("getClassListByMajorId.json")
|
|
|
|
|
public JsonResult<List<Map<String,Object>>> getClassListByMajorId(String majorId){
|
|
|
|
|
return JsonResult.success(schoolClassService.getClassListByMajorId(majorId));
|
|
|
|
|
public JsonResult<List<Map<String, Object>>> getClassListByMajorId(String majorId) {
|
|
|
|
|
return JsonResult.success(schoolClassService.getClassListByMajorId(majorId));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ApiOperation("根据关键字查询学生信息")
|
|
|
|
|
@GetMapping("getStudentByKeyword.json")
|
|
|
|
|
public JsonResult<List<Map<String, Object>>> getStudentByKeyword(String keyword,Integer schoolId){
|
|
|
|
|
return JsonResult.success(studentService.getStudentInfoByKeyword(keyword,Long.valueOf(schoolId)));
|
|
|
|
|
public JsonResult<List<Map<String, Object>>> getStudentByKeyword(String keyword, Integer schoolId) {
|
|
|
|
|
return JsonResult.success(studentService.getStudentInfoByKeyword(keyword, Long.valueOf(schoolId)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ApiOperation("根据班级id分页展示学生数据")
|
|
|
|
|
@GetMapping("pagedListStudentByClassId.json")
|
|
|
|
|
public Map<String, Object> pagedListStudentByClassId(String classList,Integer page,Integer size){
|
|
|
|
|
if(page==null||page<1){
|
|
|
|
|
page=1;
|
|
|
|
|
public Map<String, Object> pagedListStudentByClassId(String classList, Integer page, Integer size) {
|
|
|
|
|
if (page == null || page < 1) {
|
|
|
|
|
page = 1;
|
|
|
|
|
}
|
|
|
|
|
if(size==null){
|
|
|
|
|
size=10;
|
|
|
|
|
if (size == null) {
|
|
|
|
|
size = 10;
|
|
|
|
|
}
|
|
|
|
|
PageQuery<Map<String, Object>> mapPageQuery = studentService.pagedListStudentInfoByClassId(classList,page,size);
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("code",0);
|
|
|
|
|
map.put("msg","成功");
|
|
|
|
|
map.put("count",mapPageQuery.getTotalRow());
|
|
|
|
|
map.put("content",mapPageQuery);
|
|
|
|
|
PageQuery<Map<String, Object>> mapPageQuery = studentService.pagedListStudentInfoByClassId(classList, page, size);
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
map.put("code", 0);
|
|
|
|
|
map.put("msg", "成功");
|
|
|
|
|
map.put("count", mapPageQuery.getTotalRow());
|
|
|
|
|
map.put("content", mapPageQuery);
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ApiOperation("修改用户表userid")
|
|
|
|
|
@PostMapping("updateUserId.json")
|
|
|
|
|
public JsonResult updateUserId() throws SQLException {
|
|
|
|
|
CoreUser coreUser = new CoreUser();
|
|
|
|
|
List<CoreUser> coreUsers = userService.getCoreUserList(coreUser);
|
|
|
|
|
int i = 0;
|
|
|
|
|
for (CoreUser user : coreUsers) {
|
|
|
|
|
Connection conn = openConn();
|
|
|
|
|
PreparedStatement ps = conn.prepareStatement("select * from EduUsers where username = '" + user.getCode() + "' and IsDeleted = 0");
|
|
|
|
|
|
|
|
|
|
ResultSet rs = ps.executeQuery();
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
Long userId = rs.getLong("id");
|
|
|
|
|
user.setOldId(userId);
|
|
|
|
|
userService.updateTemplate(user);
|
|
|
|
|
}
|
|
|
|
|
closeConn(conn);
|
|
|
|
|
ps.close();
|
|
|
|
|
System.out.println("已完成:"+i++);
|
|
|
|
|
}
|
|
|
|
|
return JsonResult.success();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|