Procházet zdrojové kódy

登录者为为学生时,接口返回班主任姓名和电话

dzx před 4 měsíci
rodič
revize
2130e62697

+ 6 - 1
src/main/java/com/xjrsoft/module/base/service/impl/BaseClassServiceImpl.java

@@ -18,6 +18,7 @@ import com.xjrsoft.module.organization.vo.UserStudentVo;
 import com.xjrsoft.module.student.entity.BaseStudent;
 import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
 import com.xjrsoft.module.student.entity.BaseStudentUser;
+import com.xjrsoft.module.teacher.entity.XjrUser;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 
@@ -69,10 +70,14 @@ public class BaseClassServiceImpl extends MPJBaseServiceImpl<BaseClassMapper, Ba
         MPJLambdaWrapper<BaseClass> queryWrapper = new MPJLambdaWrapper<>();
         queryWrapper
                 .disableSubLogicDel()
-                .rightJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getClassId, BaseStudent::getId)
+                .innerJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getClassId, BaseStudent::getId)
                 .innerJoin(BaseStudentUser.class, BaseStudentUser::getId, BaseStudentSchoolRoll::getUserId)
+                .leftJoin(XjrUser.class, XjrUser::getId, BaseClass::getTeacherId)
                 .eq(BaseStudentSchoolRoll::getUserId, id)
                 .selectAs(BaseClass::getName, UserStudentVo::getClassName)
+                .selectAs(XjrUser::getName, UserStudentVo::getTeacherName)
+                .selectAs(XjrUser::getMobile, UserStudentVo::getTeacherMobile)
+                .selectAs(XjrUser::getId, UserStudentVo::getTeacherId)
                 .selectAs(BaseStudentUser::getName, UserStudentVo::getStudentName)
                 .selectAs(BaseStudentUser::getId, UserStudentVo::getStudentId)
                 .selectAs(BaseStudentSchoolRoll::getClassId, UserStudentVo::getClassId)

+ 3 - 4
src/main/java/com/xjrsoft/module/organization/controller/UserController.java

@@ -29,10 +29,7 @@ import com.xjrsoft.common.sms.SmsCtcc;
 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.base.dto.BaseClassroomChangeStatusDto;
 import com.xjrsoft.module.base.entity.BaseClass;
-import com.xjrsoft.module.base.entity.BaseClassroom;
 import com.xjrsoft.module.base.entity.BaseGrade;
 import com.xjrsoft.module.base.service.IBaseClassService;
 import com.xjrsoft.module.base.service.IBaseGradeService;
@@ -90,7 +87,6 @@ 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.workflow.constant.WorkflowConstant;
-import com.xjrsoft.module.workflow.mapper.WorkflowExtraMapper;
 import com.xjrsoft.module.workflow.service.IWorkflowExecuteService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -390,6 +386,9 @@ public class UserController {
         if (userStudentVo != null) {
             vo.setClassId(userStudentVo.getClassId());
             vo.setClassName(userStudentVo.getClassName());
+            vo.setTeacherId(userStudentVo.getTeacherId());
+            vo.setTeacherName(userStudentVo.getTeacherName());
+            vo.setTeacherMobile(userStudentVo.getTeacherMobile());
         }
 
         List<File> fileList = fileService.list(Wrappers.lambdaQuery(File.class).eq(File::getFolderId, user.getSignFolderId()));

+ 9 - 0
src/main/java/com/xjrsoft/module/organization/vo/UserInfoVo.java

@@ -129,4 +129,13 @@ public class UserInfoVo {
 
     @ApiModelProperty("身份证")
     private String credentialNumber;
+
+    @ApiModelProperty("班主任id")
+    private Long teacherId;
+
+    @ApiModelProperty("班主任姓名")
+    private String teacherName;
+
+    @ApiModelProperty("班主任电话")
+    private String teacherMobile;
 }