|
|
@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
+import com.github.yulichang.toolkit.MPJWrappers;
|
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
import com.xjrsoft.common.constant.GlobalConstant;
|
|
|
import com.xjrsoft.common.enums.DeleteMark;
|
|
|
@@ -29,6 +30,7 @@ import com.xjrsoft.common.utils.RedisUtil;
|
|
|
import com.xjrsoft.common.utils.TreeUtil;
|
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
import com.xjrsoft.config.CommonPropertiesConfig;
|
|
|
+import com.xjrsoft.module.attendance.entity.StudentAttendanceRecord;
|
|
|
import com.xjrsoft.module.base.entity.BaseClass;
|
|
|
import com.xjrsoft.module.base.entity.BaseGrade;
|
|
|
import com.xjrsoft.module.base.service.IBaseClassService;
|
|
|
@@ -46,13 +48,7 @@ import com.xjrsoft.module.organization.dto.UserPageDto;
|
|
|
import com.xjrsoft.module.organization.dto.UserStudentAddDto;
|
|
|
import com.xjrsoft.module.organization.dto.UserStudentBindDto;
|
|
|
import com.xjrsoft.module.organization.dto.UserStudentDeleteDto;
|
|
|
-import com.xjrsoft.module.organization.entity.Department;
|
|
|
-import com.xjrsoft.module.organization.entity.Post;
|
|
|
-import com.xjrsoft.module.organization.entity.Role;
|
|
|
-import com.xjrsoft.module.organization.entity.User;
|
|
|
-import com.xjrsoft.module.organization.entity.UserDeptRelation;
|
|
|
-import com.xjrsoft.module.organization.entity.UserPostRelation;
|
|
|
-import com.xjrsoft.module.organization.entity.UserRoleRelation;
|
|
|
+import com.xjrsoft.module.organization.entity.*;
|
|
|
import com.xjrsoft.module.organization.service.IDepartmentService;
|
|
|
import com.xjrsoft.module.organization.service.IPostService;
|
|
|
import com.xjrsoft.module.organization.service.IRoleService;
|
|
|
@@ -65,10 +61,13 @@ import com.xjrsoft.module.organization.utils.OrganizationUtil;
|
|
|
import com.xjrsoft.module.organization.vo.*;
|
|
|
import com.xjrsoft.module.oss.factory.OssFactory;
|
|
|
import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
|
|
|
+import com.xjrsoft.module.student.entity.BaseStudentUser;
|
|
|
+import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
|
|
|
import com.xjrsoft.module.system.entity.DictionaryDetail;
|
|
|
import com.xjrsoft.module.system.entity.File;
|
|
|
import com.xjrsoft.module.system.service.IFileService;
|
|
|
import com.xjrsoft.module.teacher.entity.BaseTeacher;
|
|
|
+import com.xjrsoft.module.teacher.entity.XjrUser;
|
|
|
import com.xjrsoft.module.workflow.constant.WorkflowConstant;
|
|
|
import com.xjrsoft.module.workflow.entity.WorkflowExtra;
|
|
|
import com.xjrsoft.module.workflow.mapper.WorkflowExtraMapper;
|
|
|
@@ -140,6 +139,8 @@ public class UserController {
|
|
|
|
|
|
private final HistoryService historyService;
|
|
|
|
|
|
+ private final IBaseStudentSchoolRollService baseStudentSchoolRollService;
|
|
|
+
|
|
|
|
|
|
@GetMapping(value = "/list")
|
|
|
@ApiOperation(value = "用户列表(不分页)")
|
|
|
@@ -687,6 +688,26 @@ public class UserController {
|
|
|
return R.ok(userStudentService.add(userStudentAddDto));
|
|
|
}
|
|
|
|
|
|
+ @GetMapping(value = "/validate-student")
|
|
|
+ public RT<UserStudentInfoVo> getValidateStudent(UserStudentBindDto dto) {
|
|
|
+
|
|
|
+ UserStudentInfoVo userStudentInfoVo = baseStudentSchoolRollService.selectJoinOne(UserStudentInfoVo.class,
|
|
|
+ MPJWrappers.<BaseStudentSchoolRoll>lambdaJoin()
|
|
|
+ .innerJoin(User.class, User::getId, BaseStudentSchoolRoll::getUserId)
|
|
|
+ .leftJoin(BaseClass.class,BaseClass::getId,BaseStudentSchoolRoll::getClassId)
|
|
|
+ .eq(User::getName, dto.getName())
|
|
|
+ .eq(User::getCredentialNumber, dto.getIdCard())
|
|
|
+ .select(User::getId, User::getName, User::getMobile, User::getCredentialNumber)
|
|
|
+ .select(BaseClass::getTeacherId)
|
|
|
+
|
|
|
+ );
|
|
|
+ if (userStudentInfoVo == null) {
|
|
|
+ return RT.error("学生不存在!");
|
|
|
+ }
|
|
|
+
|
|
|
+ return RT.ok(userStudentInfoVo);
|
|
|
+ }
|
|
|
+
|
|
|
@DeleteMapping("/unbind-student")
|
|
|
@ApiOperation(value = "解绑学生")
|
|
|
public R unBindStudent(@Valid @RequestBody UserStudentDeleteDto dto) {
|
|
|
@@ -699,6 +720,26 @@ public class UserController {
|
|
|
return R.ok(baseClassService.getStudents(id));
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/user-student")
|
|
|
+ @ApiOperation(value = "获取绑定学生")
|
|
|
+ public RT<List<UserStudentVo>> getBindStudent(@Valid @RequestParam Long id) {
|
|
|
+
|
|
|
+ List<UserStudentVo> userStudentVoList = userStudentService.selectJoinList(UserStudentVo.class,
|
|
|
+ MPJWrappers.<UserStudent>lambdaJoin()
|
|
|
+ .innerJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getUserId, UserStudent::getStudentId)
|
|
|
+ .innerJoin(BaseStudentUser.class, BaseStudentUser::getId, UserStudent::getStudentId)
|
|
|
+ .leftJoin(BaseClass.class, BaseClass::getId, BaseStudentSchoolRoll::getClassId)
|
|
|
+ .select(BaseStudentSchoolRoll::getClassId)
|
|
|
+ .select(UserStudent::getStudentId,UserStudent::getStatus)
|
|
|
+ .selectAs(BaseClass::getName, UserStudentVo::getClassName)
|
|
|
+ .selectAs(BaseStudentUser::getName, UserStudentVo::getStudentName)
|
|
|
+ .selectAs(BaseStudentUser::getAvatar, UserStudentVo::getAvatar)
|
|
|
+ .eq(UserStudent::getUserId, id)
|
|
|
+
|
|
|
+ );
|
|
|
+ return RT.ok(userStudentVoList);
|
|
|
+ }
|
|
|
+
|
|
|
@PostMapping("/upload-sign")
|
|
|
@ApiOperation(value = "上传签名")
|
|
|
public RT<Boolean> uploadSign(@Valid @RequestBody UploadSignDto dto) {
|