Browse Source

1、职务字典增加中文字段
2、学生接口增加classId

dzx 1 year ago
parent
commit
50399c1ad8

+ 10 - 5
src/main/java/com/xjrsoft/module/student/controller/BaseStudentPostController.java

@@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.github.yulichang.toolkit.MPJWrappers;
 import com.xjrsoft.common.annotation.XjrLog;
 import com.xjrsoft.common.constant.GlobalConstant;
 import com.baomidou.mybatisplus.core.toolkit.StringPool;
@@ -24,8 +25,10 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
 import com.alibaba.excel.EasyExcel;
 import com.alibaba.excel.support.ExcelTypeEnum;
 import com.xjrsoft.module.student.entity.BaseStudentBehaviorProject;
+import com.xjrsoft.module.student.entity.BaseStudentUser;
 import com.xjrsoft.module.student.vo.BaseStudentPostListVo;
 import com.xjrsoft.module.student.vo.BaseStudentPostTreeVo;
+import com.xjrsoft.module.system.entity.DictionaryDetail;
 import org.springframework.http.ResponseEntity;
 import java.io.ByteArrayOutputStream;
 import java.util.ArrayList;
@@ -81,11 +84,13 @@ public class BaseStudentPostController {
     @SaCheckPermission("basestudentpost:detail")
     public RT<PageOutput<BaseStudentPostPageVo>> page(@Valid BaseStudentPostPageDto dto){
 
-        LambdaQueryWrapper<BaseStudentPost> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper
-                    .orderByDesc(BaseStudentPost::getId)
-                .select(BaseStudentPost.class,x -> VoToColumnUtil.fieldsToColumns(BaseStudentPostPageVo.class).contains(x.getProperty()));
-        IPage<BaseStudentPost> page = baseStudentPostService.page(ConventPage.getPage(dto), queryWrapper);
+        IPage<BaseStudentPostPageVo> page = baseStudentPostService.selectJoinListPage(ConventPage.getPage(dto), BaseStudentPostPageVo.class,
+                MPJWrappers.<BaseStudentPost>lambdaJoin()
+                .orderByDesc(BaseStudentPost::getSortCode)
+                .selectAs(DictionaryDetail::getName, BaseStudentPostPageVo::getLevelCn)
+                .select(BaseStudentPost.class,x -> VoToColumnUtil.fieldsToColumns(BaseStudentPostPageVo.class).contains(x.getProperty()))
+                .leftJoin(DictionaryDetail.class, DictionaryDetail::getCode, BaseStudentPost::getLevel)
+        );
         PageOutput<BaseStudentPostPageVo> pageOutput = ConventPage.getPageOutput(page, BaseStudentPostPageVo.class);
         return RT.ok(pageOutput);
     }

+ 1 - 0
src/main/java/com/xjrsoft/module/student/controller/StudentManagerController.java

@@ -52,6 +52,7 @@ public class StudentManagerController {
                         .like(StrUtil.isNotBlank(dto.getMobile()), BaseStudentUser::getMobile, dto.getMobile())
                         .like(StrUtil.isNotBlank(dto.getName()), BaseStudentUser::getName, dto.getName())
                         .like(StrUtil.isNotBlank(dto.getEmail()), BaseStudentUser::getEmail, dto.getEmail())
+                        .eq(ObjectUtil.isNotNull(dto.getClassId()), BaseStudent::getId, dto.getClassId())
                         .in((ObjectUtil.isNotNull(dto.getTokenType()) && dto.getTokenType() == 1), BaseClass::getTeacherId, StpUtil.getLoginIdAsLong())
                         .orderByDesc(BaseStudentUser::getId)
                         .select(BaseStudentUser::getId)

+ 6 - 0
src/main/java/com/xjrsoft/module/student/dto/BaseStudentUserPageDto.java

@@ -35,4 +35,10 @@ public class BaseStudentUserPageDto extends PageInput {
     @ApiModelProperty("权限标识")
     private Integer tokenType;
 
+    /**
+     * 班级id
+     */
+    @ApiModelProperty("班级id")
+    private Long classId;
+
 }

+ 1 - 1
src/main/java/com/xjrsoft/module/student/mapper/BaseStudentPostMapper.java

@@ -12,6 +12,6 @@ import org.apache.ibatis.annotations.Mapper;
 * @Version 1.0
 */
 @Mapper
-public interface BaseStudentPostMapper extends BaseMapper<BaseStudentPost> {
+public interface BaseStudentPostMapper extends MPJBaseMapper<BaseStudentPost> {
 
 }

+ 1 - 1
src/main/java/com/xjrsoft/module/student/service/IBaseStudentPostService.java

@@ -13,5 +13,5 @@ import java.util.List;
 * @Version 1.0
 */
 
-public interface IBaseStudentPostService extends IService<BaseStudentPost> {
+public interface IBaseStudentPostService extends MPJBaseService<BaseStudentPost> {
 }

+ 1 - 1
src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentPostServiceImpl.java

@@ -21,5 +21,5 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 */
 @Service
 @AllArgsConstructor
-public class BaseStudentPostServiceImpl extends ServiceImpl<BaseStudentPostMapper, BaseStudentPost> implements IBaseStudentPostService {
+public class BaseStudentPostServiceImpl extends MPJBaseServiceImpl<BaseStudentPostMapper, BaseStudentPost> implements IBaseStudentPostService {
 }

+ 9 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseStudentPostPageVo.java

@@ -93,6 +93,15 @@ public class BaseStudentPostPageVo {
     @ExcelProperty("职务级别")
     @ApiModelProperty("职务级别")
     private String level;
+
+    /**
+     * 职务级别
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("职务级别中文")
+    @ApiModelProperty("职务级别中文")
+    private String levelCn;
+
     /**
     * 是否允许德育检查(1:是 0:否)
     */