Browse Source

Merge remote-tracking branch 'origin/dev' into dev

fanxp 1 year ago
parent
commit
b6766ace23

+ 136 - 0
src/main/java/com/xjrsoft/module/student/controller/BaseStudentCadreController.java

@@ -0,0 +1,136 @@
+package com.xjrsoft.module.student.controller;
+
+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.alibaba.excel.EasyExcel;
+import com.alibaba.excel.support.ExcelTypeEnum;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+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.organization.entity.Department;
+import com.xjrsoft.module.student.dto.AddBaseStudentCadreDto;
+import com.xjrsoft.module.student.dto.BaseStudentCadrePageDto;
+import com.xjrsoft.module.student.dto.UpdateBaseStudentCadreDto;
+import com.xjrsoft.module.student.entity.BaseStudent;
+import com.xjrsoft.module.student.entity.BaseStudentCadre;
+import com.xjrsoft.module.student.entity.BaseStudentPost;
+import com.xjrsoft.module.student.service.IBaseStudentCadreService;
+import com.xjrsoft.module.student.vo.BaseStudentCadrePageVo;
+import com.xjrsoft.module.student.vo.BaseStudentCadreVo;
+import com.xjrsoft.module.teacher.entity.XjrUser;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.http.ResponseEntity;
+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.io.ByteArrayOutputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+* @title: 学生干部管理
+* @Author dzx
+* @Date: 2023-11-14
+* @Version 1.0
+*/
+@RestController
+@RequestMapping("/student" + "/basestudentcadre")
+@Api(value = "/student"  + "/basestudentcadre",tags = "学生干部管理代码")
+@AllArgsConstructor
+public class BaseStudentCadreController {
+
+
+    private final IBaseStudentCadreService baseStudentCadreService;
+
+    @GetMapping(value = "/page")
+    @ApiOperation(value="学生干部管理列表(分页)")
+    @SaCheckPermission("basestudentcadre:detail")
+    public RT<PageOutput<BaseStudentCadrePageVo>> page(@Valid BaseStudentCadrePageDto dto){
+
+        MPJLambdaWrapper<BaseStudentCadre> queryWrapper = new MPJLambdaWrapper<>();
+        queryWrapper.disableLogicDel()
+                .like(StrUtil.isNotBlank(dto.getUserName()), XjrUser::getName, dto.getUserName())
+                .eq(ObjectUtil.isNotEmpty(dto.getOrgId()), BaseStudentCadre::getOrgId, dto.getOrgId())
+                .eq(ObjectUtil.isNotEmpty(dto.getClassId()), BaseStudentCadre::getClassId, dto.getClassId())
+                .orderByDesc(BaseStudentCadre::getId)
+                .selectAs(BaseStudent::getStudentId, BaseStudentCadre::getStudentId)
+                .selectAs(XjrUser::getName, BaseStudentCadre::getUserName)
+                .selectAs(BaseClass::getName, BaseStudentCadre::getClassName)
+                .selectAs(BaseStudentPost::getPost, BaseStudentCadre::getPost)
+                .selectAs(BaseStudentPost::getLevel, BaseStudentCadre::getLevel)
+                .selectAs(Department::getName, BaseStudentCadre::getOrgName)
+                .select(BaseStudentCadre.class,x -> VoToColumnUtil.fieldsToColumns(BaseStudentCadrePageVo.class).contains(x.getProperty()))
+                .innerJoin(XjrUser.class, XjrUser::getId, BaseStudentCadre::getUserId)
+                .innerJoin(BaseStudent.class, BaseStudent::getUserId, BaseStudentCadre::getUserId)
+                .innerJoin(BaseStudentPost.class, BaseStudentPost::getId, BaseStudentCadre::getPostId)
+                .innerJoin(BaseClass.class, BaseClass::getId, BaseStudentCadre::getClassId)
+                .innerJoin(Department.class, Department::getId, BaseClass::getOrgId);
+        IPage<BaseStudentCadre> page = baseStudentCadreService.page(ConventPage.getPage(dto), queryWrapper);
+        PageOutput<BaseStudentCadrePageVo> pageOutput = ConventPage.getPageOutput(page, BaseStudentCadrePageVo.class);
+        return RT.ok(pageOutput);
+    }
+
+    @GetMapping(value = "/info")
+    @ApiOperation(value="根据id查询学生干部管理信息")
+    @SaCheckPermission("basestudentcadre:detail")
+    public RT<BaseStudentCadreVo> info(@RequestParam Long id){
+        BaseStudentCadre baseStudentCadre = baseStudentCadreService.getById(id);
+        if (baseStudentCadre == null) {
+           return RT.error("找不到此数据!");
+        }
+        return RT.ok(BeanUtil.toBean(baseStudentCadre, BaseStudentCadreVo.class));
+    }
+
+
+    @PostMapping
+    @ApiOperation(value = "新增学生干部管理")
+    @SaCheckPermission("basestudentcadre:add")
+    public RT<Boolean> add(@Valid @RequestBody AddBaseStudentCadreDto dto){
+        BaseStudentCadre baseStudentCadre = BeanUtil.toBean(dto, BaseStudentCadre.class);
+        boolean isSuccess = baseStudentCadreService.save(baseStudentCadre);
+    return RT.ok(isSuccess);
+    }
+
+    @PutMapping
+    @ApiOperation(value = "修改学生干部管理")
+    @SaCheckPermission("basestudentcadre:edit")
+    public RT<Boolean> update(@Valid @RequestBody UpdateBaseStudentCadreDto dto){
+
+        BaseStudentCadre baseStudentCadre = BeanUtil.toBean(dto, BaseStudentCadre.class);
+        return RT.ok(baseStudentCadreService.updateById(baseStudentCadre));
+
+    }
+
+    @DeleteMapping
+    @ApiOperation(value = "删除学生干部管理")
+    @SaCheckPermission("basestudentcadre:delete")
+    public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
+        return RT.ok(baseStudentCadreService.removeBatchByIds(ids));
+
+    }
+
+    @GetMapping("/export")
+    @ApiOperation(value = "导出")
+    public ResponseEntity<byte[]> exportData(@Valid BaseStudentCadrePageDto dto, @RequestParam(defaultValue = "false") Boolean isTemplate) {
+        List<BaseStudentCadrePageVo> customerList = isTemplate != null && isTemplate ? new ArrayList<>() : ((PageOutput<BaseStudentCadrePageVo>) page(dto).getData()).getList();
+        ByteArrayOutputStream bot = new ByteArrayOutputStream();
+        EasyExcel.write(bot, BaseStudentCadrePageVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(customerList);
+
+        return RT.fileStream(bot.toByteArray(), "BaseStudentCadre" + ExcelTypeEnum.XLSX.getValue());
+    }
+}

+ 78 - 0
src/main/java/com/xjrsoft/module/student/dto/AddBaseStudentCadreDto.java

@@ -0,0 +1,78 @@
+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-14
+* @Version 1.0
+*/
+@Data
+public class AddBaseStudentCadreDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 序号
+    */
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+    /**
+    * 学生id
+    */
+    @ApiModelProperty("学生id")
+    private Long userId;
+    /**
+    * 班级id
+    */
+    @ApiModelProperty("班级id")
+    private Long classId;
+    /**
+    * 职务id
+    */
+    @ApiModelProperty("职务id")
+    private Long postId;
+    /**
+    * 学生任职机构
+    */
+    @ApiModelProperty("学生任职机构")
+    private Long orgId;
+    /**
+    * 任职开始时间
+    */
+    @ApiModelProperty("任职开始时间")
+    private Date startTime;
+    /**
+    * 任职结束时间
+    */
+    @ApiModelProperty("任职结束时间")
+    private Date endTime;
+    /**
+    * 状态(1:在职 0:离职)
+    */
+    @ApiModelProperty("状态(1:在职 0:离职)")
+    private Integer status;
+    /**
+    * 离职生效日期
+    */
+    @ApiModelProperty("离职生效日期")
+    private Date leaveTime;
+    /**
+    * 离职原因
+    */
+    @ApiModelProperty("离职原因")
+    private String leaveReason;
+
+}

+ 62 - 0
src/main/java/com/xjrsoft/module/student/dto/BaseStudentCadrePageDto.java

@@ -0,0 +1,62 @@
+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 java.util.List;
+
+
+/**
+* @title: 学生干部管理分页查询入参
+* @Author dzx
+* @Date: 2023-11-14
+* @Version 1.0
+*/
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class BaseStudentCadrePageDto 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 className;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("职务")
+    @ApiModelProperty("职务")
+    private String post;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("级别")
+    @ApiModelProperty("级别")
+    private String level;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("学生任职机构名称")
+    @ApiModelProperty("学生任职机构名称")
+    private String orgName;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("学生任职机构")
+    @ApiModelProperty("学生任职机构")
+    private Long orgId;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("班级id")
+    @ApiModelProperty("班级id")
+    private Long classId;
+}

+ 32 - 0
src/main/java/com/xjrsoft/module/student/dto/UpdateBaseStudentCadreDto.java

@@ -0,0 +1,32 @@
+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;
+
+
+
+/**
+* @title: 学生干部管理
+* @Author dzx
+* @Date: 2023-11-14
+* @Version 1.0
+*/
+@Data
+public class UpdateBaseStudentCadreDto extends AddBaseStudentCadreDto {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("主键编号")
+    private Long id;
+}

+ 153 - 0
src/main/java/com/xjrsoft/module/student/entity/BaseStudentCadre.java

@@ -0,0 +1,153 @@
+package com.xjrsoft.module.student.entity;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+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-14
+* @Version 1.0
+*/
+@Data
+@TableName("base_student_cadre")
+@ApiModel(value = "学生干部管理对象", description = "学生干部管理")
+public class BaseStudentCadre 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;
+    /**
+    * 序号
+    */
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+    /**
+    * 学生id
+    */
+    @ApiModelProperty("学生id")
+    private Long userId;
+    /**
+    * 班级id
+    */
+    @ApiModelProperty("班级id")
+    private Long classId;
+    /**
+    * 职务id
+    */
+    @ApiModelProperty("职务id")
+    private Long postId;
+    /**
+    * 学生任职机构
+    */
+    @ApiModelProperty("学生任职机构")
+    private Long orgId;
+    /**
+    * 任职开始时间
+    */
+    @ApiModelProperty("任职开始时间")
+    private Date startTime;
+    /**
+    * 任职结束时间
+    */
+    @ApiModelProperty("任职结束时间")
+    private Date endTime;
+    /**
+    * 状态(1:在职 0:离职)
+    */
+    @ApiModelProperty("状态(1:在职 0:离职)")
+    private Integer status;
+    /**
+    * 离职生效日期
+    */
+    @ApiModelProperty("离职生效日期")
+    private Date leaveTime;
+    /**
+    * 离职原因
+    */
+    @ApiModelProperty("离职原因")
+    private String leaveReason;
+
+    @ApiModelProperty("学号")
+    @TableField(exist = false)
+    private String studentId;
+
+    @ApiModelProperty("学生姓名")
+    @TableField(exist = false)
+    private String userName;
+
+    @ApiModelProperty("班级名称")
+    @TableField(exist = false)
+    private String className;
+
+    @ApiModelProperty("职务")
+    @TableField(exist = false)
+    private String post;
+
+    @ApiModelProperty("级别")
+    @TableField(exist = false)
+    private String level;
+
+    @ApiModelProperty("学生任职机构名称")
+    @TableField(exist = false)
+    private String orgName;
+
+}

+ 17 - 0
src/main/java/com/xjrsoft/module/student/mapper/BaseStudentCadreMapper.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.BaseStudentCadre;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+* @title: 学生干部管理
+* @Author dzx
+* @Date: 2023-11-14
+* @Version 1.0
+*/
+@Mapper
+public interface BaseStudentCadreMapper extends BaseMapper<BaseStudentCadre> {
+
+}

+ 17 - 0
src/main/java/com/xjrsoft/module/student/service/IBaseStudentCadreService.java

@@ -0,0 +1,17 @@
+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.BaseStudentCadre;
+import lombok.Data;
+import java.util.List;
+
+/**
+* @title: 学生干部管理
+* @Author dzx
+* @Date: 2023-11-14
+* @Version 1.0
+*/
+
+public interface IBaseStudentCadreService extends IService<BaseStudentCadre> {
+}

+ 25 - 0
src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentCadreServiceImpl.java

@@ -0,0 +1,25 @@
+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.BaseStudentCadre;
+import com.xjrsoft.module.student.mapper.BaseStudentCadreMapper;
+import com.xjrsoft.module.student.service.IBaseStudentCadreService;
+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-14
+* @Version 1.0
+*/
+@Service
+@AllArgsConstructor
+public class BaseStudentCadreServiceImpl extends ServiceImpl<BaseStudentCadreMapper, BaseStudentCadre> implements IBaseStudentCadreService {
+}

+ 177 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseStudentCadrePageVo.java

@@ -0,0 +1,177 @@
+package com.xjrsoft.module.student.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import com.xjrsoft.common.annotation.Trans;
+import com.xjrsoft.common.enums.TransType;
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+* @title: 学生干部管理分页列表出参
+* @Author dzx
+* @Date: 2023-11-14
+* @Version 1.0
+*/
+@Data
+public class BaseStudentCadrePageVo {
+
+    /**
+    * 主键编号
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("主键编号")
+    @ApiModelProperty("主键编号")
+    private String id;
+    /**
+    * 创建人
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("创建人")
+    @ApiModelProperty("创建人")
+    private Long createUserId;
+    /**
+    * 创建时间
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("创建时间")
+    @ApiModelProperty("创建时间")
+    private Date createDate;
+    /**
+    * 修改人
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("修改人")
+    @ApiModelProperty("修改人")
+    private Long modifyUserId;
+    /**
+    * 修改时间
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("修改时间")
+    @ApiModelProperty("修改时间")
+    private Date modifyDate;
+    /**
+    * 删除标记
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("删除标记")
+    @ApiModelProperty("删除标记")
+    private Integer deleteMark;
+    /**
+    * 有效标志
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("有效标志")
+    @ApiModelProperty("有效标志")
+    private Integer enabledMark;
+    /**
+    * 序号
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("序号")
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+    /**
+    * 学生id
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("学生id")
+    @ApiModelProperty("学生id")
+    private Long userId;
+    /**
+    * 班级id
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("班级id")
+    @ApiModelProperty("班级id")
+    private Long classId;
+    /**
+    * 职务id
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("职务id")
+    @ApiModelProperty("职务id")
+    private Long postId;
+    /**
+    * 学生任职机构
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("学生任职机构")
+    @ApiModelProperty("学生任职机构")
+    private Long orgId;
+    /**
+    * 任职开始时间
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("任职开始时间")
+    @ApiModelProperty("任职开始时间")
+    private Date startTime;
+    /**
+    * 任职结束时间
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("任职结束时间")
+    @ApiModelProperty("任职结束时间")
+    private Date endTime;
+    /**
+    * 状态(1:在职 0:离职)
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("状态(1:在职 0:离职)")
+    @ApiModelProperty("状态(1:在职 0:离职)")
+    private Integer status;
+    /**
+    * 离职生效日期
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("离职生效日期")
+    @ApiModelProperty("离职生效日期")
+    private Date leaveTime;
+    /**
+    * 离职原因
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("离职原因")
+    @ApiModelProperty("离职原因")
+    private String leaveReason;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("学号")
+    @ApiModelProperty("学号")
+    private String studentId;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("学生姓名")
+    @ApiModelProperty("学生姓名")
+    private String userName;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("班级名称")
+    @ApiModelProperty("班级名称")
+    private String className;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("职务")
+    @ApiModelProperty("职务")
+    private String post;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("级别")
+    @ApiModelProperty("级别")
+    private String level;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("学生任职机构名称")
+    @ApiModelProperty("学生任职机构名称")
+    private String orgName;
+
+
+}

+ 79 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseStudentCadreVo.java

@@ -0,0 +1,79 @@
+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-14
+* @Version 1.0
+*/
+@Data
+public class BaseStudentCadreVo {
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("主键编号")
+    private Long id;
+    /**
+    * 序号
+    */
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+    /**
+    * 学生id
+    */
+    @ApiModelProperty("学生id")
+    private Long userId;
+    /**
+    * 班级id
+    */
+    @ApiModelProperty("班级id")
+    private Long classId;
+    /**
+    * 职务id
+    */
+    @ApiModelProperty("职务id")
+    private Long postId;
+    /**
+    * 学生任职机构
+    */
+    @ApiModelProperty("学生任职机构")
+    private Long orgId;
+    /**
+    * 任职开始时间
+    */
+    @ApiModelProperty("任职开始时间")
+    private Date startTime;
+    /**
+    * 任职结束时间
+    */
+    @ApiModelProperty("任职结束时间")
+    private Date endTime;
+    /**
+    * 状态(1:在职 0:离职)
+    */
+    @ApiModelProperty("状态(1:在职 0:离职)")
+    private Integer status;
+    /**
+    * 离职生效日期
+    */
+    @ApiModelProperty("离职生效日期")
+    private Date leaveTime;
+    /**
+    * 离职原因
+    */
+    @ApiModelProperty("离职原因")
+    private String leaveReason;
+
+
+
+}

+ 5 - 34
src/test/java/com/xjrsoft/xjrsoftboot/FreeMarkerGeneratorTest.java

@@ -401,46 +401,15 @@ public class FreeMarkerGeneratorTest {
         apiGeneratorService.generateCodes(params);
     }
 
-    /**
-     * 学生校级干部管理
-     */
-    @Test
-    public void gcBaseStudentSchoolCadre() throws IOException {
-        List<TableConfig> tableConfigs = new ArrayList<>();
-        TableConfig mainTable = new TableConfig();
-        mainTable.setTableName("base_student_school_cadre");//init_sql中的表名
-        mainTable.setIsMain(true);//是否是主表,一般默认为true
-        mainTable.setPkField(GlobalConstant.DEFAULT_PK);//设置主键
-        mainTable.setPkType(GlobalConstant.DEFAULT_PK_TYPE);//设置主键类型
-
-        tableConfigs.add(mainTable);
-
-
-        ApiGenerateCodesDto params = new ApiGenerateCodesDto();
-        params.setAuthor("dzx");//作者名称
-        params.setPackageName("student");//包名
-        params.setTableConfigs(tableConfigs);
-        params.setPage(true);//是否生成分页接口
-        params.setImport(false);//是否生成导入接口
-        params.setExport(true);//是否生成导出接口
-        params.setOutMainDir(true);//是否生成在主目录,前期测试可设置成false
-        params.setDs(ds);
-
-
-        IApiGeneratorService apiGeneratorService = new ApiGeneratorServiceImpl();
-
-        apiGeneratorService.generateCodes(params);
-    }
-
 
     /**
-     * 学生班级干部管理
+     * 学生干部管理
      */
     @Test
-    public void gcBaseStudentClassCadre() throws IOException {
+    public void gcBaseStudentCadre() throws IOException {
         List<TableConfig> tableConfigs = new ArrayList<>();
         TableConfig mainTable = new TableConfig();
-        mainTable.setTableName("base_student_class_cadre");//init_sql中的表名
+        mainTable.setTableName("base_student_cadre");//init_sql中的表名
         mainTable.setIsMain(true);//是否是主表,一般默认为true
         mainTable.setPkField(GlobalConstant.DEFAULT_PK);//设置主键
         mainTable.setPkType(GlobalConstant.DEFAULT_PK_TYPE);//设置主键类型
@@ -526,4 +495,6 @@ public class FreeMarkerGeneratorTest {
 
         apiGeneratorService.generateCodes(params);
     }
+
+
 }