Jelajahi Sumber

1、学生处分增加移动端分页
2、批量添加增加逻辑验证

dzx142631 2 tahun lalu
induk
melakukan
e1bbd6fe0e

+ 4 - 3
src/main/java/com/xjrsoft/module/student/controller/BaseStudentCadreController.java

@@ -178,15 +178,16 @@ public class BaseStudentCadreController {
         //循环判定,是否已经存在于数据库,并查询出班级id
         List<AddBaseStudentCadreDto> addDtoList = new ArrayList<>();
         for (AddBaseStudentCadreDto baseStudentCadreDto : dto) {
-            BaseStudentCadre one = baseStudentCadreService.getOne(
+            List<BaseStudentCadre> list = baseStudentCadreService.list(
                     Wrappers.lambdaQuery(BaseStudentCadre.class)
                             .eq(BaseStudentCadre::getUserId, baseStudentCadreDto.getUserId())
                             .eq(BaseStudentCadre::getPostId, baseStudentCadreDto.getPostId())
             );
-            BaseStudentSchoolRoll baseStudentSchoolRoll = baseStudentSchoolRollMapper.selectOne(Wrappers.lambdaQuery(BaseStudentSchoolRoll.class).eq(BaseStudentSchoolRoll::getUserId, baseStudentCadreDto.getUserId()));
-            if(ObjectUtil.isNotNull(one)){
+            if(ObjectUtil.isNotNull(list) && list.size() == 1){
                 continue;
             }
+
+            BaseStudentSchoolRoll baseStudentSchoolRoll = baseStudentSchoolRollMapper.selectOne(Wrappers.lambdaQuery(BaseStudentSchoolRoll.class).eq(BaseStudentSchoolRoll::getUserId, baseStudentCadreDto.getUserId()));
             if(ObjectUtil.isNotNull(baseStudentSchoolRoll)){
                 baseStudentCadreDto.setClassId(baseStudentSchoolRoll.getClassId());
             }

+ 53 - 1
src/main/java/com/xjrsoft/module/student/controller/BaseStudentPunishmentInfoController.java

@@ -18,12 +18,16 @@ 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.BaseStudentAssessmentProjectPageVo;
+import com.xjrsoft.module.student.vo.BaseStudentPunishmentInfoMobliePageVo;
 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;
@@ -82,11 +86,59 @@ public class BaseStudentPunishmentInfoController {
                 .innerJoin(BaseSemester.class, BaseSemester::getId, BaseStudentPunishmentInfo::getBaseSemesterId)
         );
 
-
         PageOutput<BaseStudentPunishmentInfoPageVo> pageOutput = ConventPage.getPageOutput(page, BaseStudentPunishmentInfoPageVo.class);
         return RT.ok(pageOutput);
     }
 
+    @GetMapping(value = "/mobilePage")
+    @ApiOperation(value="学生处分信息管理列表(移动端分页)")
+    @SaCheckPermission("basestudentpunishmentinfo:detail")
+    public RT<PageOutput<BaseStudentPunishmentInfoMobliePageVo>> mobilePage(@Valid BaseStudentPunishmentInfoPageDto dto){
+
+        IPage<BaseStudentPunishmentInfoMobliePageVo> page = baseStudentPunishmentInfoService.selectJoinListPage(ConventPage.getPage(dto), BaseStudentPunishmentInfoMobliePageVo.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())
+                .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)
+                .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)
+                .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)
+        );
+
+        PageOutput<BaseStudentPunishmentInfoMobliePageVo> pageOutput = ConventPage.getPageOutput(page, BaseStudentPunishmentInfoMobliePageVo.class);
+        return RT.ok(pageOutput);
+    }
+
     @GetMapping(value = "/info")
     @ApiOperation(value="根据id查询学生处分信息管理信息")
     @SaCheckPermission("basestudentpunishmentinfo:detail")

+ 147 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseStudentPunishmentInfoMobliePageVo.java

@@ -0,0 +1,147 @@
+package com.xjrsoft.module.student.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+* @title: 学生考核项目分页列表出参
+* @Author fanxp
+* @Date: 2023-11-14
+* @Version 1.0
+*/
+@Data
+public class BaseStudentPunishmentInfoMobliePageVo {
+
+    /**
+     * 主键编号
+     */
+    @ApiModelProperty("主键编号")
+    private String id;
+    /**
+     * 创建人
+     */
+    @ApiModelProperty("创建人")
+    private Long createUserId;
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty("创建时间")
+    private Date createDate;
+    /**
+     * 修改人
+     */
+    @ApiModelProperty("修改人")
+    private Long modifyUserId;
+    /**
+     * 修改时间
+     */
+    @ApiModelProperty("修改时间")
+    private String modifyDate;
+    /**
+     * 删除标记
+     */
+    @ApiModelProperty("删除标记")
+    private Integer deleteMark;
+    /**
+     * 有效标志
+     */
+    @ApiModelProperty("有效标志")
+    private Integer enabledMark;
+    /**
+     * 学期ID(base_semester)
+     */
+    @ApiModelProperty("学期ID(base_semester)")
+    private Long baseSemesterId;
+    /**
+     * 处分类型id
+     */
+    @ApiModelProperty("处分类型id")
+    private Long punishmentTypeId;
+    /**
+     * 处分开始日期
+     */
+    @ApiModelProperty("处分开始日期")
+    private String startTime;
+    /**
+     * 处分结束日期
+     */
+    @ApiModelProperty("处分结束日期")
+    private String endTime;
+    /**
+     * 是否公示(1:是 0:否)
+     */
+    @ApiModelProperty("是否公示(1:是 0:否)")
+    private Integer isPublicity;
+    /**
+     * 发送处分(1:班主任 2:学生 3:家长)
+     */
+    @ApiModelProperty("发送处分(1:班主任 2:学生 3:家长)")
+    private Integer pushMessageObject;
+    /**
+     * 处分原因
+     */
+    @ApiModelProperty("处分原因")
+    private String reason;
+    /**
+     * 班级id
+     */
+    @ApiModelProperty("班级id")
+    private String classId;
+    /**
+     * 附件文件id
+     */
+    @ApiModelProperty("附件文件id")
+    private Long fileId;
+
+    /**
+     * 处分类型
+     */
+    @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;
+
+}