Browse Source

调整学生处分管理查询

dzx142631 1 year ago
parent
commit
2d28e00bcc

+ 17 - 23
src/main/java/com/xjrsoft/module/student/controller/BaseStudentPunishmentInfoController.java

@@ -4,11 +4,13 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.yulichang.toolkit.MPJWrappers;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
+import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.entity.BaseSemester;
 import com.xjrsoft.module.student.dto.AddBaseStudentPunishmentInfoDto;
@@ -16,13 +18,12 @@ import com.xjrsoft.module.student.dto.BaseStudentPunishmentInfoPageDto;
 import com.xjrsoft.module.student.dto.UpdateBaseStudentPunishmentInfoDto;
 import com.xjrsoft.module.student.entity.BasePunishmentStudentRelation;
 import com.xjrsoft.module.student.entity.BasePunishmentType;
-import com.xjrsoft.module.student.entity.BaseStudentCadre;
 import com.xjrsoft.module.student.entity.BaseStudentPunishmentInfo;
 import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
+import com.xjrsoft.module.student.mapper.BasePunishmentStudentRelationMapper;
 import com.xjrsoft.module.student.service.IBaseStudentPunishmentInfoService;
 import com.xjrsoft.module.student.vo.BaseStudentPunishmentInfoPageVo;
 import com.xjrsoft.module.student.vo.BaseStudentPunishmentInfoVo;
-import com.xjrsoft.module.teacher.entity.XjrUser;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
@@ -52,6 +53,7 @@ public class BaseStudentPunishmentInfoController {
 
 
     private final IBaseStudentPunishmentInfoService baseStudentPunishmentInfoService;
+    private final BasePunishmentStudentRelationMapper basePunishmentStudentRelationMapper;
 
     @GetMapping(value = "/page")
     @ApiOperation(value="学生处分信息管理列表(分页)")
@@ -60,42 +62,24 @@ public class BaseStudentPunishmentInfoController {
 
         IPage<BaseStudentPunishmentInfoPageVo> page = baseStudentPunishmentInfoService.selectJoinListPage(ConventPage.getPage(dto), BaseStudentPunishmentInfoPageVo.class,
                 MPJWrappers.<BaseStudentPunishmentInfo>lambdaJoin()
-                .like(StrUtil.isNotBlank(dto.getUserName()), BasePunishmentStudentRelation::getName, dto.getUserName())
-                .like(StrUtil.isNotBlank(dto.getStudentId()), BasePunishmentStudentRelation::getStudentId, dto.getStudentId())
-                .like(StrUtil.isNotBlank(dto.getCredentialNumber()), XjrUser::getCredentialNumber, dto.getCredentialNumber())
                 .eq(StrUtil.isNotBlank(dto.getArchivesStatus()), BaseStudentSchoolRoll::getArchivesStatus, dto.getArchivesStatus())
                 .eq(StrUtil.isNotBlank(dto.getSemesterId()), BaseStudentPunishmentInfo::getBaseSemesterId, dto.getSemesterId())
                 .eq(ObjectUtil.isNotNull(dto.getClassId()), BaseStudentPunishmentInfo::getClassId, dto.getClassId())
                 .eq(ObjectUtil.isNotNull(dto.getGradeId()), BaseStudentSchoolRoll::getGradeId, dto.getGradeId())
-                .eq(ObjectUtil.isNotNull(dto.getAdjustType()), BasePunishmentStudentRelation::getAdjustType, dto.getAdjustType())
-                .eq(ObjectUtil.isNotNull(dto.getIsPublicity()), BaseStudentPunishmentInfo::getIsPublicity, dto.getIsPublicity())
+                .eq(BaseStudentPunishmentInfo::getStatus, 1)
                 .in(ObjectUtil.isNotNull(dto.getOrgIds()), BaseClass::getOrgId, dto.getOrgIds())
                 .between(ObjectUtil.isNotNull(dto.getStartTimeStart()) && ObjectUtil.isNotNull(dto.getStartTimeEnd()), BaseStudentPunishmentInfo::getStartTime,dto.getStartTimeStart(),dto.getStartTimeEnd())
                 .between(ObjectUtil.isNotNull(dto.getEndTimeStart()) && ObjectUtil.isNotNull(dto.getEndTimeEnd()), BaseStudentPunishmentInfo::getEndTime,dto.getEndTimeStart(),dto.getEndTimeEnd())
-                .between(ObjectUtil.isNotNull(dto.getAdjustDateStart()) && ObjectUtil.isNotNull(dto.getAdjustDateEnd()), BasePunishmentStudentRelation::getAdjustDate,dto.getAdjustDateStart(),dto.getAdjustDateEnd())
-                .between(ObjectUtil.isNotNull(dto.getModifyDateStart()) && ObjectUtil.isNotNull(dto.getModifyDateEnd()), BasePunishmentStudentRelation::getModifyDate,dto.getModifyDateStart(),dto.getModifyDateEnd())
-                .select(BasePunishmentStudentRelation::getId)
-                .select(BasePunishmentStudentRelation::getStudentId)
-                .select(BasePunishmentStudentRelation::getName)
-                .select(BasePunishmentStudentRelation::getGender)
-                .select(BasePunishmentStudentRelation::getClassName)
-                .select(BasePunishmentStudentRelation::getMajor)
+                .select(BaseStudentPunishmentInfo::getId)
                 .selectAs(BaseSemester::getName, BaseStudentPunishmentInfoPageVo::getSemesterName)
                 .select(BasePunishmentType::getPunishmentType)
                 .select(BaseStudentPunishmentInfo::getStartTime)
                 .select(BaseStudentPunishmentInfo::getEndTime)
                 .select(BaseStudentPunishmentInfo::getIsPublicity)
                 .select(BaseStudentPunishmentInfo::getReason)
-                .select(BasePunishmentStudentRelation::getAdjustType)
-                .select(BasePunishmentStudentRelation::getAdjustDate)
-                .select(BasePunishmentStudentRelation::getModifyDate)
-                .orderByDesc(BaseStudentCadre::getId)
-                .innerJoin(BasePunishmentStudentRelation.class, BasePunishmentStudentRelation::getPunishmentInfoId, BaseStudentPunishmentInfo::getId)
+                .orderByDesc(BaseStudentPunishmentInfo::getId)
                 .innerJoin(BasePunishmentType.class, BasePunishmentType::getId, BaseStudentPunishmentInfo::getPunishmentTypeId)
-                .innerJoin(XjrUser.class, XjrUser::getId, BasePunishmentStudentRelation::getUserId)
                 .innerJoin(BaseSemester.class, BaseSemester::getId, BaseStudentPunishmentInfo::getBaseSemesterId)
-                .leftJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getUserId, BasePunishmentStudentRelation::getUserId)
-                .leftJoin(BaseClass.class, BaseClass::getId, BaseStudentPunishmentInfo::getClassId)
         );
 
 
@@ -111,6 +95,16 @@ public class BaseStudentPunishmentInfoController {
         if (baseStudentPunishmentInfo == null) {
            return RT.error("找不到此数据!");
         }
+
+        //查询班级
+        LambdaQueryWrapper<BasePunishmentStudentRelation> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper
+                .eq(BasePunishmentStudentRelation::getPunishmentInfoId, id)
+                .select(BasePunishmentStudentRelation.class, x -> VoToColumnUtil.fieldsToColumns(BasePunishmentStudentRelation.class).contains(x.getProperty()));
+        List<BasePunishmentStudentRelation> studentRelationList = basePunishmentStudentRelationMapper.selectList(queryWrapper);
+
+        baseStudentPunishmentInfo.setBasePunishmentStudentRelationList(studentRelationList);
+
         return RT.ok(BeanUtil.toBean(baseStudentPunishmentInfo, BaseStudentPunishmentInfoVo.class));
     }
 

+ 3 - 0
src/main/java/com/xjrsoft/module/student/entity/BaseStudentPunishmentInfo.java

@@ -127,4 +127,7 @@ public class BaseStudentPunishmentInfo implements Serializable {
     @EntityMapping(thisField = "id", joinField = "punishmentInfoId")
     private List<BasePunishmentStudentRelation> basePunishmentStudentRelationList;
 
+    @ApiModelProperty("状态(1:结束 0:未结束)")
+    private Integer status;
+
 }

+ 0 - 45
src/main/java/com/xjrsoft/module/student/vo/BaseStudentPunishmentInfoPageVo.java

@@ -85,11 +85,6 @@ public class BaseStudentPunishmentInfoPageVo {
     @ApiModelProperty("处分原因")
     private String reason;
     /**
-    * 班级id
-    */
-    @ApiModelProperty("班级id")
-    private String classId;
-    /**
     * 附件文件id
     */
     @ApiModelProperty("附件文件id")
@@ -101,46 +96,6 @@ public class BaseStudentPunishmentInfoPageVo {
     @ApiModelProperty("处分类型")
     private String punishmentType;
 
-    /**
-     * 处分类型
-     */
-    @ApiModelProperty("学籍状态")
-    private String archivesStatus;
-
-    /**
-     * 调整类型
-     */
-    @ApiModelProperty("调整类型")
-    private String adjustType;
-
-    /**
-     * 调整时间
-     */
-    @ApiModelProperty("调整时间")
-    private Date adjustDate;
-
-    /**
-     * 调整原因
-     */
-    @ApiModelProperty("调整原因")
-    private String adjustReason;
-
-
-    @ApiModelProperty("学号")
-    private String studentId;
-
-    @ApiModelProperty("姓名")
-    private String name;
-
-    @ApiModelProperty("性别")
-    private String gender;
-
-    @ApiModelProperty("所学专业")
-    private String major;
-
-    @ApiModelProperty("所在班级")
-    private String className;
-
     @ApiModelProperty("处分学期")
     private String semesterName;
 

+ 10 - 5
src/main/java/com/xjrsoft/module/student/vo/BaseStudentPunishmentInfoVo.java

@@ -4,12 +4,8 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
-import java.time.LocalTime;
-import java.time.LocalDateTime;
-import java.math.BigDecimal;
-import java.util.List;
 import java.util.Date;
-import com.xjrsoft.module.student.entity.BasePunishmentStudentRelation;
+import java.util.List;
 
 /**
 * @title: 学生处分信息管理表单出参
@@ -80,4 +76,13 @@ public class BaseStudentPunishmentInfoVo {
     @ApiModelProperty("basePunishmentStudentRelation子表")
     private List<BasePunishmentStudentRelationVo> basePunishmentStudentRelationList;
 
+    /**
+     * 处分类型
+     */
+    @ApiModelProperty("处分类型")
+    private String punishmentType;
+
+    @ApiModelProperty("处分学期")
+    private String semesterName;
+
 }