Prechádzať zdrojové kódy

1、处分查询接口
2、处分表字段调整

dzx142631 2 rokov pred
rodič
commit
f8a2680939

+ 133 - 0
src/main/java/com/xjrsoft/module/student/controller/BaseStudentPunishmentInfoController.java

@@ -0,0 +1,133 @@
+package com.xjrsoft.module.student.controller;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.StrUtil;
+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.module.base.entity.BaseSemester;
+import com.xjrsoft.module.student.dto.AddBaseStudentPunishmentInfoDto;
+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.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;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+* @title: 学生处分信息管理
+* @Author dzx
+* @Date: 2023-11-15
+* @Version 1.0
+*/
+@RestController
+@RequestMapping("/student" + "/basestudentpunishmentinfo")
+@Api(value = "/student"  + "/basestudentpunishmentinfo",tags = "学生处分信息管理代码")
+@AllArgsConstructor
+public class BaseStudentPunishmentInfoController {
+
+
+    private final IBaseStudentPunishmentInfoService baseStudentPunishmentInfoService;
+
+    @GetMapping(value = "/page")
+    @ApiOperation(value="学生处分信息管理列表(分页)")
+    @SaCheckPermission("basestudentpunishmentinfo:detail")
+    public RT<PageOutput<BaseStudentPunishmentInfoPageVo>> page(@Valid BaseStudentPunishmentInfoPageDto dto){
+
+        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())
+                .like(StrUtil.isNotBlank(dto.getArchivesStatus()), BaseStudentSchoolRoll::getArchivesStatus, dto.getArchivesStatus())
+                .like(StrUtil.isNotBlank(dto.getSemesterId()), BaseStudentPunishmentInfo::getBaseSemesterId, dto.getSemesterId())
+                .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)
+        );
+
+
+        PageOutput<BaseStudentPunishmentInfoPageVo> pageOutput = ConventPage.getPageOutput(page, BaseStudentPunishmentInfoPageVo.class);
+        return RT.ok(pageOutput);
+    }
+
+    @GetMapping(value = "/info")
+    @ApiOperation(value="根据id查询学生处分信息管理信息")
+    @SaCheckPermission("basestudentpunishmentinfo:detail")
+    public RT<BaseStudentPunishmentInfoVo> info(@RequestParam Long id){
+        BaseStudentPunishmentInfo baseStudentPunishmentInfo = baseStudentPunishmentInfoService.getByIdDeep(id);
+        if (baseStudentPunishmentInfo == null) {
+           return RT.error("找不到此数据!");
+        }
+        return RT.ok(BeanUtil.toBean(baseStudentPunishmentInfo, BaseStudentPunishmentInfoVo.class));
+    }
+
+
+    @PostMapping
+    @ApiOperation(value = "新增学生处分信息管理")
+    @SaCheckPermission("basestudentpunishmentinfo:add")
+    public RT<Boolean> add(@Valid @RequestBody AddBaseStudentPunishmentInfoDto dto){
+        BaseStudentPunishmentInfo baseStudentPunishmentInfo = BeanUtil.toBean(dto, BaseStudentPunishmentInfo.class);
+        boolean isSuccess = baseStudentPunishmentInfoService.add(baseStudentPunishmentInfo);
+    return RT.ok(isSuccess);
+    }
+
+    @PutMapping
+    @ApiOperation(value = "修改学生处分信息管理")
+    @SaCheckPermission("basestudentpunishmentinfo:edit")
+    public RT<Boolean> update(@Valid @RequestBody UpdateBaseStudentPunishmentInfoDto dto){
+
+        BaseStudentPunishmentInfo baseStudentPunishmentInfo = BeanUtil.toBean(dto, BaseStudentPunishmentInfo.class);
+        return RT.ok(baseStudentPunishmentInfoService.update(baseStudentPunishmentInfo));
+
+    }
+
+    @DeleteMapping
+    @ApiOperation(value = "删除学生处分信息管理")
+    @SaCheckPermission("basestudentpunishmentinfo:delete")
+    public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
+        return RT.ok(baseStudentPunishmentInfoService.delete(ids));
+
+    }
+
+}

+ 88 - 0
src/main/java/com/xjrsoft/module/student/dto/AddBasePunishmentStudentRelationDto.java

@@ -0,0 +1,88 @@
+package com.xjrsoft.module.student.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Date;
+
+
+
+/**
+* @title: 学生处分信息-关联学生
+* @Author dzx
+* @Date: 2023-11-15
+* @Version 1.0
+*/
+@Data
+public class AddBasePunishmentStudentRelationDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 学生id
+    */
+    @ApiModelProperty("学生id")
+    private Long userId;
+    /**
+    * 处分信息id
+    */
+    @ApiModelProperty("处分信息id")
+    private Long punishmentInfoId;
+    /**
+    * 序号
+    */
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+    /**
+    * 学号
+    */
+    @ApiModelProperty("学号")
+    private String studentId;
+    /**
+    * 姓名
+    */
+    @ApiModelProperty("姓名")
+    private String name;
+    /**
+    * 性别
+    */
+    @ApiModelProperty("性别")
+    private String gender;
+    /**
+    * 民族(xjr_dictionary_item[nation])
+    */
+    @ApiModelProperty("民族(xjr_dictionary_item[nation])")
+    private String nation;
+    /**
+    * 所在班级
+    */
+    @ApiModelProperty("所在班级")
+    private String className;
+    /**
+    * 所学专业
+    */
+    @ApiModelProperty("所学专业")
+    private String major;
+    /**
+    * 调整类型 1:升级 2:降级 3:撤销
+    */
+    @ApiModelProperty("调整类型 1:升级 2:降级 3:撤销")
+    private Integer adjustType;
+    /**
+    * 调整日期
+    */
+    @ApiModelProperty("调整日期")
+    private Date adjustDate;
+    /**
+    * 调整原因
+    */
+    @ApiModelProperty("调整原因")
+    private String adjustReason;
+
+}

+ 79 - 0
src/main/java/com/xjrsoft/module/student/dto/AddBaseStudentPunishmentInfoDto.java

@@ -0,0 +1,79 @@
+package com.xjrsoft.module.student.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+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;
+
+
+
+/**
+* @title: 学生处分信息管理
+* @Author dzx
+* @Date: 2023-11-15
+* @Version 1.0
+*/
+@Data
+public class AddBaseStudentPunishmentInfoDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 学期ID(base_semester)
+    */
+    @ApiModelProperty("学期ID(base_semester)")
+    private Long baseSemesterId;
+    /**
+    * 处分类型id
+    */
+    @ApiModelProperty("处分类型id")
+    private Long punishmentTypeId;
+    /**
+    * 处分开始日期
+    */
+    @ApiModelProperty("处分开始日期")
+    private Date startTime;
+    /**
+    * 处分结束日期
+    */
+    @ApiModelProperty("处分结束日期")
+    private Date 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;
+
+    /**
+    * basePunishmentStudentRelation
+    */
+    @ApiModelProperty("basePunishmentStudentRelation子表")
+    private List<AddBasePunishmentStudentRelationDto> basePunishmentStudentRelationList;
+}

+ 53 - 0
src/main/java/com/xjrsoft/module/student/dto/BaseStudentPunishmentInfoPageDto.java

@@ -0,0 +1,53 @@
+package com.xjrsoft.module.student.dto;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+import com.xjrsoft.common.page.PageInput;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.Date;
+
+
+/**
+* @title: 学生处分信息管理分页查询入参
+* @Author dzx
+* @Date: 2023-11-15
+* @Version 1.0
+*/
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class BaseStudentPunishmentInfoPageDto extends PageInput {
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("学号")
+    @ApiModelProperty("学号")
+    private String studentId;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("学生姓名")
+    @ApiModelProperty("学生姓名")
+    private String userName;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("证件号码")
+    @ApiModelProperty("证件号码")
+    private String credentialNumber;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("学籍状态")
+    @ApiModelProperty("学籍状态")
+    private String archivesStatus;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("处分学期")
+    @ApiModelProperty("处分学期")
+    private String semesterId;
+
+
+}

+ 33 - 0
src/main/java/com/xjrsoft/module/student/dto/UpdateBaseStudentPunishmentInfoDto.java

@@ -0,0 +1,33 @@
+package com.xjrsoft.module.student.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.io.Serializable;
+
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import java.util.List;
+import java.util.Date;
+import com.xjrsoft.module.student.entity.BasePunishmentStudentRelation;
+
+
+
+/**
+* @title: 学生处分信息管理
+* @Author dzx
+* @Date: 2023-11-15
+* @Version 1.0
+*/
+@Data
+public class UpdateBaseStudentPunishmentInfoDto extends AddBaseStudentPunishmentInfoDto {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("主键编号")
+    private Long id;
+}

+ 112 - 0
src/main/java/com/xjrsoft/module/student/entity/BasePunishmentStudentRelation.java

@@ -0,0 +1,112 @@
+package com.xjrsoft.module.student.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.github.yulichang.annotation.EntityMapping;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.io.Serializable;
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Date;
+
+
+/**
+* @title: 学生处分信息-关联学生
+* @Author dzx
+* @Date: 2023-11-15
+* @Version 1.0
+*/
+@Data
+@TableName("base_punishment_student_relation")
+@ApiModel(value = "学生处分信息-关联学生对象", description = "学生处分信息-关联学生")
+public class BasePunishmentStudentRelation implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("主键编号")
+    @TableId
+    private Long id;
+    /**
+    * 学生id
+    */
+    @ApiModelProperty("学生id")
+    private Long userId;
+    /**
+    * 处分信息id
+    */
+    @ApiModelProperty("处分信息id")
+    private Long punishmentInfoId;
+    /**
+    * 序号
+    */
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+    /**
+    * 学号
+    */
+    @ApiModelProperty("学号")
+    private String studentId;
+    /**
+    * 姓名
+    */
+    @ApiModelProperty("姓名")
+    private String name;
+    /**
+    * 性别
+    */
+    @ApiModelProperty("性别")
+    private String gender;
+    /**
+    * 民族(xjr_dictionary_item[nation])
+    */
+    @ApiModelProperty("民族(xjr_dictionary_item[nation])")
+    private String nation;
+    /**
+    * 所在班级
+    */
+    @ApiModelProperty("所在班级")
+    private String className;
+    /**
+    * 所学专业
+    */
+    @ApiModelProperty("所学专业")
+    private String major;
+    /**
+    * 调整类型 1:升级 2:降级 3:撤销
+    */
+    @ApiModelProperty("调整类型 1:升级 2:降级 3:撤销")
+    private Integer adjustType;
+    /**
+    * 调整日期
+    */
+    @ApiModelProperty("调整日期")
+    private Date adjustDate;
+    /**
+    * 调整原因
+    */
+    @ApiModelProperty("调整原因")
+    private String adjustReason;
+
+    /**
+     * 修改人
+     */
+    @ApiModelProperty("修改人")
+    @TableField(fill = FieldFill.UPDATE)
+    private Long modifyUserId;
+    /**
+     * 修改时间
+     */
+    @ApiModelProperty("修改时间")
+    @TableField(fill = FieldFill.UPDATE)
+    private Date modifyDate;
+}

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

@@ -0,0 +1,130 @@
+package com.xjrsoft.module.student.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.github.yulichang.annotation.EntityMapping;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.io.Serializable;
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Date;
+
+
+/**
+* @title: 学生处分信息管理
+* @Author dzx
+* @Date: 2023-11-15
+* @Version 1.0
+*/
+@Data
+@TableName("base_student_punishment_info")
+@ApiModel(value = "学生处分信息管理对象", description = "学生处分信息管理")
+public class BaseStudentPunishmentInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("主键编号")
+    @TableId
+    private Long id;
+    /**
+    * 创建人
+    */
+    @ApiModelProperty("创建人")
+    @TableField(fill = FieldFill.INSERT)
+    private Long createUserId;
+    /**
+    * 创建时间
+    */
+    @ApiModelProperty("创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createDate;
+    /**
+    * 修改人
+    */
+    @ApiModelProperty("修改人")
+    @TableField(fill = FieldFill.UPDATE)
+    private Long modifyUserId;
+    /**
+    * 修改时间
+    */
+    @ApiModelProperty("修改时间")
+    @TableField(fill = FieldFill.UPDATE)
+    private Date modifyDate;
+    /**
+    * 删除标记
+    */
+    @ApiModelProperty("删除标记")
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic
+    private Integer deleteMark;
+    /**
+    * 有效标志
+    */
+    @ApiModelProperty("有效标志")
+    @TableField(fill = FieldFill.INSERT)
+    private Integer enabledMark;
+    /**
+    * 学期ID(base_semester)
+    */
+    @ApiModelProperty("学期ID(base_semester)")
+    private Long baseSemesterId;
+    /**
+    * 处分类型id
+    */
+    @ApiModelProperty("处分类型id")
+    private Long punishmentTypeId;
+    /**
+    * 处分开始日期
+    */
+    @ApiModelProperty("处分开始日期")
+    private Date startTime;
+    /**
+    * 处分结束日期
+    */
+    @ApiModelProperty("处分结束日期")
+    private Date 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 Long classId;
+    /**
+    * 附件文件id
+    */
+    @ApiModelProperty("附件文件id")
+    private Long fileId;
+
+    /**
+    * basePunishmentStudentRelation
+    */
+    @ApiModelProperty("basePunishmentStudentRelation子表")
+    @TableField(exist = false)
+    @EntityMapping(thisField = "id", joinField = "punishmentInfoId")
+    private List<BasePunishmentStudentRelation> basePunishmentStudentRelationList;
+
+}

+ 17 - 0
src/main/java/com/xjrsoft/module/student/mapper/BasePunishmentStudentRelationMapper.java

@@ -0,0 +1,17 @@
+package com.xjrsoft.module.student.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.student.entity.BasePunishmentStudentRelation;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+* @title: 学生处分信息-关联学生
+* @Author dzx
+* @Date: 2023-11-15
+* @Version 1.0
+*/
+@Mapper
+public interface BasePunishmentStudentRelationMapper extends MPJBaseMapper<BasePunishmentStudentRelation> {
+
+}

+ 17 - 0
src/main/java/com/xjrsoft/module/student/mapper/BaseStudentPunishmentInfoMapper.java

@@ -0,0 +1,17 @@
+package com.xjrsoft.module.student.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.student.entity.BaseStudentPunishmentInfo;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+* @title: 学生处分信息管理
+* @Author dzx
+* @Date: 2023-11-15
+* @Version 1.0
+*/
+@Mapper
+public interface BaseStudentPunishmentInfoMapper extends MPJBaseMapper<BaseStudentPunishmentInfo> {
+
+}

+ 40 - 0
src/main/java/com/xjrsoft/module/student/service/IBaseStudentPunishmentInfoService.java

@@ -0,0 +1,40 @@
+package com.xjrsoft.module.student.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.student.entity.BaseStudentPunishmentInfo;
+import lombok.Data;
+import java.util.List;
+
+/**
+* @title: 学生处分信息管理
+* @Author dzx
+* @Date: 2023-11-15
+* @Version 1.0
+*/
+
+public interface IBaseStudentPunishmentInfoService extends MPJBaseService<BaseStudentPunishmentInfo> {
+    /**
+    * 新增
+    *
+    * @param baseStudentPunishmentInfo
+    * @return
+    */
+    Boolean add(BaseStudentPunishmentInfo baseStudentPunishmentInfo);
+
+    /**
+    * 更新
+    *
+    * @param baseStudentPunishmentInfo
+    * @return
+    */
+    Boolean update(BaseStudentPunishmentInfo baseStudentPunishmentInfo);
+
+    /**
+    * 删除
+    *
+    * @param ids
+    * @return
+    */
+    Boolean delete(List<Long> ids);
+}

+ 88 - 0
src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentPunishmentInfoServiceImpl.java

@@ -0,0 +1,88 @@
+package com.xjrsoft.module.student.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.module.student.entity.BasePunishmentStudentRelation;
+import com.xjrsoft.module.student.mapper.BasePunishmentStudentRelationMapper;
+import com.xjrsoft.module.student.entity.BaseStudentPunishmentInfo;
+import com.xjrsoft.module.student.mapper.BaseStudentPunishmentInfoMapper;
+import com.xjrsoft.module.student.service.IBaseStudentPunishmentInfoService;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+
+/**
+* @title: 学生处分信息管理
+* @Author dzx
+* @Date: 2023-11-15
+* @Version 1.0
+*/
+@Service
+@AllArgsConstructor
+public class BaseStudentPunishmentInfoServiceImpl extends MPJBaseServiceImpl<BaseStudentPunishmentInfoMapper, BaseStudentPunishmentInfo> implements IBaseStudentPunishmentInfoService {
+    private final BaseStudentPunishmentInfoMapper baseStudentPunishmentInfoBaseStudentPunishmentInfoMapper;
+
+    private final BasePunishmentStudentRelationMapper baseStudentPunishmentInfoBasePunishmentStudentRelationMapper;
+
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean add(BaseStudentPunishmentInfo baseStudentPunishmentInfo) {
+        baseStudentPunishmentInfoBaseStudentPunishmentInfoMapper.insert(baseStudentPunishmentInfo);
+        for (BasePunishmentStudentRelation basePunishmentStudentRelation : baseStudentPunishmentInfo.getBasePunishmentStudentRelationList()) {
+            basePunishmentStudentRelation.setPunishmentInfoId(baseStudentPunishmentInfo.getId());
+            baseStudentPunishmentInfoBasePunishmentStudentRelationMapper.insert(basePunishmentStudentRelation);
+        }
+
+        return true;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean update(BaseStudentPunishmentInfo baseStudentPunishmentInfo) {
+        baseStudentPunishmentInfoBaseStudentPunishmentInfoMapper.updateById(baseStudentPunishmentInfo);
+        //********************************* BasePunishmentStudentRelation  增删改  开始 *******************************************/
+        {
+            // 查出所有子级的id
+            List<BasePunishmentStudentRelation> basePunishmentStudentRelationList = baseStudentPunishmentInfoBasePunishmentStudentRelationMapper.selectList(Wrappers.lambdaQuery(BasePunishmentStudentRelation.class).eq(BasePunishmentStudentRelation::getPunishmentInfoId, baseStudentPunishmentInfo.getId()).select(BasePunishmentStudentRelation::getId));
+            List<Long> basePunishmentStudentRelationIds = basePunishmentStudentRelationList.stream().map(BasePunishmentStudentRelation::getId).collect(Collectors.toList());
+            //原有子表单 没有被删除的主键
+            List<Long> basePunishmentStudentRelationOldIds = baseStudentPunishmentInfo.getBasePunishmentStudentRelationList().stream().map(BasePunishmentStudentRelation::getId).filter(Objects::nonNull).collect(Collectors.toList());
+            //找到需要删除的id
+            List<Long> basePunishmentStudentRelationRemoveIds = basePunishmentStudentRelationIds.stream().filter(item -> !basePunishmentStudentRelationOldIds.contains(item)).collect(Collectors.toList());
+
+            for (BasePunishmentStudentRelation basePunishmentStudentRelation : baseStudentPunishmentInfo.getBasePunishmentStudentRelationList()) {
+                //如果不等于空则修改
+                if (basePunishmentStudentRelation.getId() != null) {
+                    baseStudentPunishmentInfoBasePunishmentStudentRelationMapper.updateById(basePunishmentStudentRelation);
+                }
+                //如果等于空 则新增
+                else {
+                    //已经不存在的id 删除
+                    basePunishmentStudentRelation.setPunishmentInfoId(baseStudentPunishmentInfo.getId());
+                    baseStudentPunishmentInfoBasePunishmentStudentRelationMapper.insert(basePunishmentStudentRelation);
+                }
+            }
+            //已经不存在的id 删除
+            if(basePunishmentStudentRelationRemoveIds.size() > 0){
+                baseStudentPunishmentInfoBasePunishmentStudentRelationMapper.deleteBatchIds(basePunishmentStudentRelationRemoveIds);
+            }
+        }
+        //********************************* BasePunishmentStudentRelation  增删改  结束 *******************************************/
+
+        return true;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delete(List<Long> ids) {
+        baseStudentPunishmentInfoBaseStudentPunishmentInfoMapper.deleteBatchIds(ids);
+        baseStudentPunishmentInfoBasePunishmentStudentRelationMapper.delete(Wrappers.lambdaQuery(BasePunishmentStudentRelation.class).in(BasePunishmentStudentRelation::getPunishmentInfoId, ids));
+
+        return true;
+    }
+}

+ 89 - 0
src/main/java/com/xjrsoft/module/student/vo/BasePunishmentStudentRelationVo.java

@@ -0,0 +1,89 @@
+package com.xjrsoft.module.student.vo;
+
+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;
+
+/**
+* @title: 学生处分信息-关联学生表单出参
+* @Author dzx
+* @Date: 2023-11-15
+* @Version 1.0
+*/
+@Data
+public class BasePunishmentStudentRelationVo {
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("主键编号")
+    private Long id;
+    /**
+    * 学生id
+    */
+    @ApiModelProperty("学生id")
+    private Long userId;
+    /**
+    * 处分信息id
+    */
+    @ApiModelProperty("处分信息id")
+    private Long punishmentInfoId;
+    /**
+    * 序号
+    */
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+    /**
+    * 学号
+    */
+    @ApiModelProperty("学号")
+    private String studentId;
+    /**
+    * 姓名
+    */
+    @ApiModelProperty("姓名")
+    private String name;
+    /**
+    * 性别
+    */
+    @ApiModelProperty("性别")
+    private String gender;
+    /**
+    * 民族(xjr_dictionary_item[nation])
+    */
+    @ApiModelProperty("民族(xjr_dictionary_item[nation])")
+    private String nation;
+    /**
+    * 所在班级
+    */
+    @ApiModelProperty("所在班级")
+    private String className;
+    /**
+    * 所学专业
+    */
+    @ApiModelProperty("所学专业")
+    private String major;
+    /**
+    * 调整类型 1:升级 2:降级 3:撤销
+    */
+    @ApiModelProperty("调整类型 1:升级 2:降级 3:撤销")
+    private Integer adjustType;
+    /**
+    * 调整日期
+    */
+    @ApiModelProperty("调整日期")
+    private Date adjustDate;
+    /**
+    * 调整原因
+    */
+    @ApiModelProperty("调整原因")
+    private String adjustReason;
+
+
+
+}

+ 147 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseStudentPunishmentInfoPageVo.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 dzx
+* @Date: 2023-11-15
+* @Version 1.0
+*/
+@Data
+public class BaseStudentPunishmentInfoPageVo {
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("主键编号")
+    private String id;
+    /**
+    * 创建人
+    */
+    @ApiModelProperty("创建人")
+    private Long createUserId;
+    /**
+    * 创建时间
+    */
+    @ApiModelProperty("创建时间")
+    private Date createDate;
+    /**
+    * 修改人
+    */
+    @ApiModelProperty("修改人")
+    private Long modifyUserId;
+    /**
+    * 修改时间
+    */
+    @ApiModelProperty("修改时间")
+    private Date 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 Date startTime;
+    /**
+    * 处分结束日期
+    */
+    @ApiModelProperty("处分结束日期")
+    private Date 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;
+
+}

+ 80 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseStudentPunishmentInfoVo.java

@@ -0,0 +1,80 @@
+package com.xjrsoft.module.student.vo;
+
+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;
+
+/**
+* @title: 学生处分信息管理表单出参
+* @Author dzx
+* @Date: 2023-11-15
+* @Version 1.0
+*/
+@Data
+public class BaseStudentPunishmentInfoVo {
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("主键编号")
+    private Long id;
+    /**
+    * 学期ID(base_semester)
+    */
+    @ApiModelProperty("学期ID(base_semester)")
+    private Long baseSemesterId;
+    /**
+    * 处分类型id
+    */
+    @ApiModelProperty("处分类型id")
+    private Long punishmentTypeId;
+    /**
+    * 处分开始日期
+    */
+    @ApiModelProperty("处分开始日期")
+    private Date startTime;
+    /**
+    * 处分结束日期
+    */
+    @ApiModelProperty("处分结束日期")
+    private Date 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;
+
+
+    /**
+    * basePunishmentStudentRelation
+    */
+    @ApiModelProperty("basePunishmentStudentRelation子表")
+    private List<BasePunishmentStudentRelationVo> basePunishmentStudentRelationList;
+
+}

+ 2 - 0
src/main/resources/sqlScript/20231113_sql.sql

@@ -127,6 +127,8 @@ ALTER TABLE `tl`.`base_punishment_student_relation`
 ALTER TABLE `tl`.`base_student_punishment_info`
   CHANGE `class_id` `class_id` BIGINT NULL   COMMENT '班级id';
 
+--------------------------------------------------------------------学生考核--------------------------------------------------------------------
+
 -- ----------------------------
 -- 学生考核基础分设置
 -- ----------------------------