Browse Source

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

phoenix 2 years ago
parent
commit
60ea6ceb60
19 changed files with 1056 additions and 46 deletions
  1. 39 31
      src/main/java/com/xjrsoft/common/interceptor/MagicApiRequestInterceptor.java
  2. 122 0
      src/main/java/com/xjrsoft/module/student/controller/StudentHonorsController.java
  3. 103 0
      src/main/java/com/xjrsoft/module/student/dto/AddStudentHonorsDto.java
  4. 28 0
      src/main/java/com/xjrsoft/module/student/dto/StudentHonorsPageDto.java
  5. 32 0
      src/main/java/com/xjrsoft/module/student/dto/UpdateStudentHonorsDto.java
  6. 153 0
      src/main/java/com/xjrsoft/module/student/entity/StudentHonors.java
  7. 28 0
      src/main/java/com/xjrsoft/module/student/mapper/StudentHonorsMapper.java
  8. 27 0
      src/main/java/com/xjrsoft/module/student/service/IStudentHonorsService.java
  9. 44 0
      src/main/java/com/xjrsoft/module/student/service/impl/StudentHonorsServiceImpl.java
  10. 24 0
      src/main/java/com/xjrsoft/module/student/vo/StudentHonorsListVo.java
  11. 74 0
      src/main/java/com/xjrsoft/module/student/vo/StudentHonorsPageVo.java
  12. 24 0
      src/main/java/com/xjrsoft/module/student/vo/StudentHonorsTreeVo.java
  13. 104 0
      src/main/java/com/xjrsoft/module/student/vo/StudentHonorsVo.java
  14. 6 10
      src/main/java/com/xjrsoft/module/system/service/impl/LoginServiceImpl.java
  15. 36 1
      src/main/java/com/xjrsoft/module/system/service/impl/SaOAuth2TemplateImpl.java
  16. 4 4
      src/main/resources/application-dev.yml
  17. 26 0
      src/main/resources/mapper/student/StudentHonorsMapper.xml
  18. 1 0
      src/main/resources/sqlScript/20231113_sql.sql
  19. 181 0
      src/main/resources/sqlScript/20231129_sql.sql

+ 39 - 31
src/main/java/com/xjrsoft/common/interceptor/MagicApiRequestInterceptor.java

@@ -4,9 +4,11 @@ import cn.dev33.satoken.exception.NotPermissionException;
 import cn.dev33.satoken.session.SaSession;
 import cn.dev33.satoken.stp.StpUtil;
 import cn.dev33.satoken.strategy.SaStrategy;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.xjrsoft.common.constant.GlobalConstant;
 import com.xjrsoft.common.enums.ResponseCode;
 import com.xjrsoft.common.model.result.R;
+import com.xjrsoft.module.organization.entity.UserRoleRelation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 import org.ssssssss.magicapi.core.context.RequestEntity;
@@ -18,6 +20,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * magic-api 接口鉴权
@@ -28,40 +31,45 @@ import java.util.List;
 @Slf4j
 public class MagicApiRequestInterceptor implements RequestInterceptor {
 
-	/***
-	 * 接口请求之前
-	 * @param requestEntity
-	 * @return
-	 */
-	@Override
-	public Object preHandle(RequestEntity requestEntity) {
+    /***
+     * 接口请求之前
+     * @param requestEntity
+     * @return
+     */
+    @Override
+    public Object preHandle(RequestEntity requestEntity) {
 
-		if(!StpUtil.isLogin()){
-			return R.error(ResponseCode.UN_AUTHORIZED.getCode(),ResponseCode.UN_AUTHORIZED.getMessage());
-		}
-		SaSession tokenSession = StpUtil.getTokenSession();
-		List<Long> roleIds = tokenSession.get(GlobalConstant.LOGIN_USER_ROLE_ID_KEY, new ArrayList<>());
-		//非管理员需要进行权限验证
-		if(!roleIds.contains(GlobalConstant.SUPER_ADMIN_ROLE_ID)) {
-			if (!SaStrategy.me.hasElement.apply(tokenSession.get(GlobalConstant.LOGIN_USER_INTERFACE_AUTH_CODE_KEY, new ArrayList<>()), requestEntity.getApiInfo().getId())) {
-				return R.error(ResponseCode.MAGIC_API_UN_AUTHORIZED.getCode(), ResponseCode.MAGIC_API_UN_AUTHORIZED.getMessage());
-			}
-		}
-		return null;
-	}
+        if (!StpUtil.isLogin()) {
+            return R.error(ResponseCode.UN_AUTHORIZED.getCode(), ResponseCode.UN_AUTHORIZED.getMessage());
+        }
+        SaSession tokenSession = StpUtil.getTokenSession();
+        List<Long> roleIds = tokenSession.get(GlobalConstant.LOGIN_USER_ROLE_ID_KEY, new ArrayList<>());
+        if (roleIds.size() == 0) {
+            tokenSession = StpUtil.getSessionByLoginId(StpUtil.getLoginId());
+            roleIds = tokenSession.get(GlobalConstant.LOGIN_USER_ROLE_ID_KEY, new ArrayList<>());
+        }
+        //非管理员需要进行权限验证
+        if (!roleIds.contains(GlobalConstant.SUPER_ADMIN_ROLE_ID)) {
+            if (!SaStrategy.me.hasElement.apply(tokenSession.get(GlobalConstant.LOGIN_USER_INTERFACE_AUTH_CODE_KEY, new ArrayList<>()), requestEntity.getApiInfo().getId())) {
+                return R.error(ResponseCode.MAGIC_API_UN_AUTHORIZED.getCode(), ResponseCode.MAGIC_API_UN_AUTHORIZED.getMessage());
+            }
+        }
+        return null;
+    }
 
 
-	/**
-	 * 接口执行之后
-	 * @param requestEntity
-	 * @param returnValue
-	 * @return
-	 */
-	@Override
-	public Object postHandle(RequestEntity requestEntity, Object returnValue) {
-		log.info("{} 执行完毕,返回结果:{}", requestEntity.getApiInfo().getName(), returnValue);
-		return null;
-	}
+    /**
+     * 接口执行之后
+     *
+     * @param requestEntity
+     * @param returnValue
+     * @return
+     */
+    @Override
+    public Object postHandle(RequestEntity requestEntity, Object returnValue) {
+        log.info("{} 执行完毕,返回结果:{}", requestEntity.getApiInfo().getName(), returnValue);
+        return null;
+    }
 
 
 }

+ 122 - 0
src/main/java/com/xjrsoft/module/student/controller/StudentHonorsController.java

@@ -0,0 +1,122 @@
+package com.xjrsoft.module.student.controller;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xjrsoft.common.model.result.RT;
+import com.xjrsoft.common.page.ConventPage;
+import com.xjrsoft.common.page.PageOutput;
+import com.xjrsoft.common.utils.TreeUtil;
+import com.xjrsoft.module.student.dto.AddStudentHonorsDto;
+import com.xjrsoft.module.student.dto.StudentHonorsPageDto;
+import com.xjrsoft.module.student.dto.UpdateStudentHonorsDto;
+import com.xjrsoft.module.student.entity.StudentHonors;
+import com.xjrsoft.module.student.service.IStudentHonorsService;
+import com.xjrsoft.module.student.vo.StudentHonorsPageVo;
+import com.xjrsoft.module.student.vo.StudentHonorsTreeVo;
+import com.xjrsoft.module.student.vo.StudentHonorsVo;
+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.ArrayList;
+import java.util.List;
+
+/**
+* @title: 学生荣誉
+* @Author dzx
+* @Date: 2023-12-05
+* @Version 1.0
+*/
+@RestController
+@RequestMapping("/student" + "/studentHonors")
+@Api(value = "/student"  + "/studentHonors",tags = "学生荣誉代码")
+@AllArgsConstructor
+public class StudentHonorsController {
+
+
+    private final IStudentHonorsService studentHonorsService;
+
+    @GetMapping(value = "/page")
+    @ApiOperation(value="学生荣誉列表(分页)")
+    @SaCheckPermission("studenthonors:detail")
+    public RT<PageOutput<StudentHonorsPageVo>> page(@Valid StudentHonorsPageDto dto){
+
+        Page<StudentHonorsPageVo> page = studentHonorsService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
+        PageOutput<StudentHonorsPageVo> pageOutput = ConventPage.getPageOutput(page, StudentHonorsPageVo.class);
+        return RT.ok(pageOutput);
+    }
+
+    @GetMapping(value = "/tree")
+    @ApiOperation(value = "学生荣誉列表(树)")
+    @SaCheckPermission("studenthonors:detail")
+    public RT<List<StudentHonorsTreeVo>> tree() {
+
+        List<StudentHonorsTreeVo> voList = new ArrayList<>();
+        studentHonorsService.getSemesterInfo().forEach((node) -> {
+            voList.add(new StudentHonorsTreeVo(){{
+                setId(node.getId());
+                setName(node.getName());
+            }});
+        });
+        studentHonorsService.getClassInfo().forEach((node) -> {
+            voList.add(new StudentHonorsTreeVo(){{
+                setId(node.getId());
+                setName(node.getName());
+                setParentId(node.getParentId());
+            }});
+        });
+        List<StudentHonorsTreeVo> treeVoList = TreeUtil.build(voList);
+
+        return RT.ok(treeVoList);
+    }
+
+    @GetMapping(value = "/info")
+    @ApiOperation(value="根据id查询学生荣誉信息")
+    @SaCheckPermission("studenthonors:detail")
+    public RT<StudentHonorsVo> info(@RequestParam Long id){
+        StudentHonors studentHonors = studentHonorsService.getById(id);
+        if (studentHonors == null) {
+           return RT.error("找不到此数据!");
+        }
+        return RT.ok(BeanUtil.toBean(studentHonors, StudentHonorsVo.class));
+    }
+
+
+    @PostMapping
+    @ApiOperation(value = "新增学生荣誉")
+    @SaCheckPermission("studenthonors:add")
+    public RT<Boolean> add(@Valid @RequestBody AddStudentHonorsDto dto){
+        StudentHonors studentHonors = BeanUtil.toBean(dto, StudentHonors.class);
+        boolean isSuccess = studentHonorsService.save(studentHonors);
+    return RT.ok(isSuccess);
+    }
+
+    @PutMapping
+    @ApiOperation(value = "修改学生荣誉")
+    @SaCheckPermission("studenthonors:edit")
+    public RT<Boolean> update(@Valid @RequestBody UpdateStudentHonorsDto dto){
+
+        StudentHonors studentHonors = BeanUtil.toBean(dto, StudentHonors.class);
+        return RT.ok(studentHonorsService.updateById(studentHonors));
+
+    }
+
+    @DeleteMapping
+    @ApiOperation(value = "删除学生荣誉")
+    @SaCheckPermission("studenthonors:delete")
+    public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
+        return RT.ok(studentHonorsService.removeBatchByIds(ids));
+
+    }
+
+}

+ 103 - 0
src/main/java/com/xjrsoft/module/student/dto/AddStudentHonorsDto.java

@@ -0,0 +1,103 @@
+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-12-05
+* @Version 1.0
+*/
+@Data
+public class AddStudentHonorsDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 序号
+    */
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+    /**
+    * 申请人
+    */
+    @ApiModelProperty("申请人")
+    private Long applicantUserId;
+    /**
+    * 数据录入方式 1=推荐 2=登记
+    */
+    @ApiModelProperty("数据录入方式 1=推荐 2=登记")
+    private Integer dataEntryMethod;
+    /**
+    * 学期ID(base_semester)
+    */
+    @ApiModelProperty("学期ID(base_semester)")
+    private Long baseSemesterId;
+    /**
+    * 班级id
+    */
+    @ApiModelProperty("班级id")
+    private Long classId;
+    /**
+    * 学生用户编号
+    */
+    @ApiModelProperty("学生用户编号")
+    private Long studentUserId;
+    /**
+    * 学号
+    */
+    @ApiModelProperty("学号")
+    private String studentId;
+    /**
+    * 所学专业
+    */
+    @ApiModelProperty("所学专业")
+    private String majorName;
+    /**
+    * 荣誉级别(xjr_dictionary_item[honors_level])
+    */
+    @ApiModelProperty("荣誉级别(xjr_dictionary_item[honors_level])")
+    private String honorsLevel;
+    /**
+    * 荣誉等级(xjr_dictionary_item[honors_grade])
+    */
+    @ApiModelProperty("荣誉等级(xjr_dictionary_item[honors_grade])")
+    private String honorsGrade;
+    /**
+    * 荣誉类型(xjr_dictionary_item[honors_type])
+    */
+    @ApiModelProperty("荣誉类型(xjr_dictionary_item[honors_type])")
+    private String honorsType;
+    /**
+    * 荣誉名称
+    */
+    @ApiModelProperty("荣誉名称")
+    private String name;
+    /**
+    * 获奖日期
+    */
+    @ApiModelProperty("获奖日期")
+    private Date awardDate;
+    /**
+    * 附件文件id
+    */
+    @ApiModelProperty("附件文件id")
+    private Long fileId;
+    /**
+    * 状态(1:结束 0:未结束)
+    */
+    @ApiModelProperty("状态(1:结束 0:未结束)")
+    private Integer status;
+
+}

+ 28 - 0
src/main/java/com/xjrsoft/module/student/dto/StudentHonorsPageDto.java

@@ -0,0 +1,28 @@
+package com.xjrsoft.module.student.dto;
+
+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-12-05
+* @Version 1.0
+*/
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class StudentHonorsPageDto extends PageInput {
+
+    @ApiModelProperty("班级id")
+    public Long classId;
+
+}

+ 32 - 0
src/main/java/com/xjrsoft/module/student/dto/UpdateStudentHonorsDto.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-12-05
+* @Version 1.0
+*/
+@Data
+public class UpdateStudentHonorsDto extends AddStudentHonorsDto {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("主键编号")
+    private Long id;
+}

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

@@ -0,0 +1,153 @@
+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-12-05
+* @Version 1.0
+*/
+@Data
+@TableName("student_honors")
+@ApiModel(value = "student_honors", description = "学生荣誉")
+public class StudentHonors 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;
+    /**
+    * 申请人
+    */
+    @ApiModelProperty("申请人")
+    private Long applicantUserId;
+    /**
+    * 数据录入方式 1=推荐 2=登记
+    */
+    @ApiModelProperty("数据录入方式 1=推荐 2=登记")
+    private Integer dataEntryMethod;
+    /**
+    * 学期ID(base_semester)
+    */
+    @ApiModelProperty("学期ID(base_semester)")
+    private Long baseSemesterId;
+    /**
+    * 班级id
+    */
+    @ApiModelProperty("班级id")
+    private Long classId;
+    /**
+    * 学生用户编号
+    */
+    @ApiModelProperty("学生用户编号")
+    private Long studentUserId;
+    /**
+    * 学号
+    */
+    @ApiModelProperty("学号")
+    private String studentId;
+    /**
+    * 所学专业
+    */
+    @ApiModelProperty("所学专业")
+    private String majorName;
+    /**
+    * 荣誉级别(xjr_dictionary_item[honors_level])
+    */
+    @ApiModelProperty("荣誉级别(xjr_dictionary_item[honors_level])")
+    private String honorsLevel;
+    /**
+    * 荣誉等级(xjr_dictionary_item[honors_grade])
+    */
+    @ApiModelProperty("荣誉等级(xjr_dictionary_item[honors_grade])")
+    private String honorsGrade;
+    /**
+    * 荣誉类型(xjr_dictionary_item[honors_type])
+    */
+    @ApiModelProperty("荣誉类型(xjr_dictionary_item[honors_type])")
+    private String honorsType;
+    /**
+    * 荣誉名称
+    */
+    @ApiModelProperty("荣誉名称")
+    private String name;
+    /**
+    * 获奖日期
+    */
+    @ApiModelProperty("获奖日期")
+    private Date awardDate;
+    /**
+    * 附件文件id
+    */
+    @ApiModelProperty("附件文件id")
+    private Long fileId;
+    /**
+    * 状态(1:结束 0:未结束)
+    */
+    @ApiModelProperty("状态(1:结束 0:未结束)")
+    private Integer status;
+
+
+}

+ 28 - 0
src/main/java/com/xjrsoft/module/student/mapper/StudentHonorsMapper.java

@@ -0,0 +1,28 @@
+package com.xjrsoft.module.student.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.student.dto.StudentHonorsPageDto;
+import com.xjrsoft.module.student.entity.StudentHonors;
+import com.xjrsoft.module.student.vo.StudentHonorsListVo;
+import com.xjrsoft.module.student.vo.StudentHonorsPageVo;
+import com.xjrsoft.module.student.vo.StudentHonorsTreeVo;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+* @title: 学生荣誉
+* @Author dzx
+* @Date: 2023-12-05
+* @Version 1.0
+*/
+@Mapper
+public interface StudentHonorsMapper extends MPJBaseMapper<StudentHonors> {
+    Page<StudentHonorsPageVo> getPage(Page<StudentHonorsPageDto> page, StudentHonorsPageDto dto);
+
+    List<StudentHonorsListVo> getClassInfo();
+
+    List<StudentHonorsListVo> getSemesterInfo();
+}

+ 27 - 0
src/main/java/com/xjrsoft/module/student/service/IStudentHonorsService.java

@@ -0,0 +1,27 @@
+package com.xjrsoft.module.student.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.student.dto.StudentHonorsPageDto;
+import com.xjrsoft.module.student.entity.StudentHonors;
+import com.xjrsoft.module.student.vo.StudentHonorsListVo;
+import com.xjrsoft.module.student.vo.StudentHonorsPageVo;
+import com.xjrsoft.module.student.vo.StudentHonorsTreeVo;
+
+import java.util.List;
+
+/**
+* @title: 学生荣誉
+* @Author dzx
+* @Date: 2023-12-05
+* @Version 1.0
+*/
+
+public interface IStudentHonorsService extends MPJBaseService<StudentHonors> {
+
+    Page<StudentHonorsPageVo> getPage(Page<StudentHonorsPageDto> page, StudentHonorsPageDto dto);
+
+    List<StudentHonorsListVo> getClassInfo();
+
+    List<StudentHonorsListVo> getSemesterInfo();
+}

+ 44 - 0
src/main/java/com/xjrsoft/module/student/service/impl/StudentHonorsServiceImpl.java

@@ -0,0 +1,44 @@
+package com.xjrsoft.module.student.service.impl;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.module.student.dto.StudentHonorsPageDto;
+import com.xjrsoft.module.student.entity.StudentHonors;
+import com.xjrsoft.module.student.mapper.StudentHonorsMapper;
+import com.xjrsoft.module.student.service.IStudentHonorsService;
+import com.xjrsoft.module.student.vo.StudentHonorsListVo;
+import com.xjrsoft.module.student.vo.StudentHonorsPageVo;
+import com.xjrsoft.module.student.vo.StudentHonorsTreeVo;
+import com.xjrsoft.module.system.service.IFileService;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+* @title: 学生荣誉
+* @Author dzx
+* @Date: 2023-12-05
+* @Version 1.0
+*/
+@Service
+@AllArgsConstructor
+public class StudentHonorsServiceImpl extends MPJBaseServiceImpl<StudentHonorsMapper, StudentHonors> implements IStudentHonorsService {
+    private final StudentHonorsMapper studentHonorsMapper;
+    private final IFileService fileService;
+    @Override
+    public Page<StudentHonorsPageVo> getPage(Page<StudentHonorsPageDto> page, StudentHonorsPageDto dto) {
+        Page<StudentHonorsPageVo> result = studentHonorsMapper.getPage(page, dto);
+        return result;
+    }
+
+    @Override
+    public List<StudentHonorsListVo> getClassInfo() {
+        return studentHonorsMapper.getClassInfo();
+    }
+
+    @Override
+    public List<StudentHonorsListVo> getSemesterInfo() {
+        return studentHonorsMapper.getSemesterInfo();
+    }
+}

+ 24 - 0
src/main/java/com/xjrsoft/module/student/vo/StudentHonorsListVo.java

@@ -0,0 +1,24 @@
+package com.xjrsoft.module.student.vo;
+
+import com.xjrsoft.common.model.tree.ITreeNode;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class StudentHonorsListVo implements ITreeNode<StudentHonorsListVo,Long>, Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+
+    @ApiModelProperty("名字")
+    private String name;
+
+    @ApiModelProperty("父级id")
+    private Long parentId;
+
+    private List<StudentHonorsListVo> children;
+}

+ 74 - 0
src/main/java/com/xjrsoft/module/student/vo/StudentHonorsPageVo.java

@@ -0,0 +1,74 @@
+package com.xjrsoft.module.student.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+* @title: 学生荣誉分页列表出参
+* @Author dzx
+* @Date: 2023-12-05
+* @Version 1.0
+*/
+@Data
+public class StudentHonorsPageVo {
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("主键编号")
+    private String id;
+    /**
+    * 序号
+    */
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+    /**
+    * 学生姓名
+    */
+    @ApiModelProperty("学生姓名")
+    private String studentName;
+    /**
+    * 学号
+    */
+    @ApiModelProperty("学号")
+    private String studentId;
+    /**
+    * 荣誉级别(xjr_dictionary_item[honors_level])
+    */
+    @ApiModelProperty("荣誉级别(xjr_dictionary_item[honors_level])")
+    private String honorsLevel;
+    /**
+    * 荣誉等级(xjr_dictionary_item[honors_grade])
+    */
+    @ApiModelProperty("荣誉等级(xjr_dictionary_item[honors_grade])")
+    private String honorsGrade;
+    /**
+    * 荣誉类型(xjr_dictionary_item[honors_type])
+    */
+    @ApiModelProperty("荣誉类型(xjr_dictionary_item[honors_type])")
+    private String honorsType;
+    /**
+    * 荣誉名称
+    */
+    @ApiModelProperty("荣誉名称")
+    private String name;
+    /**
+    * 获奖日期
+    */
+    @ApiModelProperty("获奖日期")
+    private Date awardDate;
+    /**
+    * 附件文件id
+    */
+    @ApiModelProperty("附件文件id")
+    private Long fileId;
+    /**
+    * 状态(1:结束 0:未结束)
+    */
+    @ApiModelProperty("状态(1:结束 0:未结束)")
+    private Integer status;
+
+
+}

+ 24 - 0
src/main/java/com/xjrsoft/module/student/vo/StudentHonorsTreeVo.java

@@ -0,0 +1,24 @@
+package com.xjrsoft.module.student.vo;
+
+import com.xjrsoft.common.model.tree.ITreeNode;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class StudentHonorsTreeVo implements ITreeNode<StudentHonorsTreeVo,Long>, Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+
+    @ApiModelProperty("名字")
+    private String name;
+
+    @ApiModelProperty("父级id")
+    private Long parentId;
+
+    private List<StudentHonorsTreeVo> children;
+}

+ 104 - 0
src/main/java/com/xjrsoft/module/student/vo/StudentHonorsVo.java

@@ -0,0 +1,104 @@
+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-12-05
+* @Version 1.0
+*/
+@Data
+public class StudentHonorsVo {
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("主键编号")
+    private Long id;
+    /**
+    * 序号
+    */
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+    /**
+    * 申请人
+    */
+    @ApiModelProperty("申请人")
+    private Long applicantUserId;
+    /**
+    * 数据录入方式 1=推荐 2=登记
+    */
+    @ApiModelProperty("数据录入方式 1=推荐 2=登记")
+    private Integer dataEntryMethod;
+    /**
+    * 学期ID(base_semester)
+    */
+    @ApiModelProperty("学期ID(base_semester)")
+    private Long baseSemesterId;
+    /**
+    * 班级id
+    */
+    @ApiModelProperty("班级id")
+    private Long classId;
+    /**
+    * 学生用户编号
+    */
+    @ApiModelProperty("学生用户编号")
+    private Long studentUserId;
+    /**
+    * 学号
+    */
+    @ApiModelProperty("学号")
+    private String studentId;
+    /**
+    * 所学专业
+    */
+    @ApiModelProperty("所学专业")
+    private String majorName;
+    /**
+    * 荣誉级别(xjr_dictionary_item[honors_level])
+    */
+    @ApiModelProperty("荣誉级别(xjr_dictionary_item[honors_level])")
+    private String honorsLevel;
+    /**
+    * 荣誉等级(xjr_dictionary_item[honors_grade])
+    */
+    @ApiModelProperty("荣誉等级(xjr_dictionary_item[honors_grade])")
+    private String honorsGrade;
+    /**
+    * 荣誉类型(xjr_dictionary_item[honors_type])
+    */
+    @ApiModelProperty("荣誉类型(xjr_dictionary_item[honors_type])")
+    private String honorsType;
+    /**
+    * 荣誉名称
+    */
+    @ApiModelProperty("荣誉名称")
+    private String name;
+    /**
+    * 获奖日期
+    */
+    @ApiModelProperty("获奖日期")
+    private Date awardDate;
+    /**
+    * 附件文件id
+    */
+    @ApiModelProperty("附件文件id")
+    private Long fileId;
+    /**
+    * 状态(1:结束 0:未结束)
+    */
+    @ApiModelProperty("状态(1:结束 0:未结束)")
+    private Integer status;
+
+
+
+}

+ 6 - 10
src/main/java/com/xjrsoft/module/system/service/impl/LoginServiceImpl.java

@@ -17,28 +17,24 @@ import com.xjrsoft.common.constant.GlobalConstant;
 import com.xjrsoft.common.enums.EnabledMark;
 import com.xjrsoft.common.enums.RoleEnum;
 import com.xjrsoft.common.exception.MyException;
-import com.xjrsoft.common.utils.FixedArithmeticCaptcha;
-import com.xjrsoft.common.utils.RSAUtil;
-import com.xjrsoft.common.utils.RedisUtil;
-import com.xjrsoft.common.utils.WeChatUtil;
+import com.xjrsoft.common.utils.*;
 import com.xjrsoft.config.CommonPropertiesConfig;
 import com.xjrsoft.config.LicenseConfig;
-import com.xjrsoft.module.organization.entity.Department;
-import com.xjrsoft.module.organization.entity.Post;
-import com.xjrsoft.module.organization.entity.User;
-import com.xjrsoft.module.organization.entity.UserDeptRelation;
-import com.xjrsoft.module.organization.entity.UserPostRelation;
-import com.xjrsoft.module.organization.entity.UserRoleRelation;
+import com.xjrsoft.module.magicapi.service.impl.InterfaceAuthServiceImpl;
+import com.xjrsoft.module.organization.entity.*;
+import com.xjrsoft.module.organization.mapper.RoleMapper;
 import com.xjrsoft.module.organization.mapper.UserRoleRelationMapper;
 import com.xjrsoft.module.organization.service.IDepartmentService;
 import com.xjrsoft.module.organization.service.IPostService;
 import com.xjrsoft.module.organization.service.IUserDeptRelationService;
 import com.xjrsoft.module.organization.service.IUserPostRelationService;
 import com.xjrsoft.module.organization.service.IUserService;
+import com.xjrsoft.module.organization.vo.UserRoleVo;
 import com.xjrsoft.module.system.dto.CreateTokenDto;
 import com.xjrsoft.module.system.dto.LoginByCodeDto;
 import com.xjrsoft.module.system.dto.LoginCaptchaDto;
 import com.xjrsoft.module.system.dto.LoginDto;
+import com.xjrsoft.module.system.service.IAuthorizeService;
 import com.xjrsoft.module.system.service.ILoginService;
 import com.xjrsoft.module.system.vo.CreateTokenVo;
 import com.xjrsoft.module.system.vo.ImgCaptchaVo;

+ 36 - 1
src/main/java/com/xjrsoft/module/system/service/impl/SaOAuth2TemplateImpl.java

@@ -2,16 +2,27 @@ package com.xjrsoft.module.system.service.impl;
 
 import cn.dev33.satoken.oauth2.logic.SaOAuth2Template;
 import cn.dev33.satoken.oauth2.model.SaClientModel;
+import cn.dev33.satoken.session.SaSession;
 import cn.dev33.satoken.stp.StpUtil;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.xjrsoft.common.constant.GlobalConstant;
 import com.xjrsoft.common.exception.MyException;
+import com.xjrsoft.common.utils.VoToColumnUtil;
+import com.xjrsoft.module.organization.entity.Role;
+import com.xjrsoft.module.organization.entity.UserRoleRelation;
+import com.xjrsoft.module.organization.mapper.RoleMapper;
+import com.xjrsoft.module.organization.mapper.UserRoleRelationMapper;
+import com.xjrsoft.module.organization.vo.UserRoleVo;
 import com.xjrsoft.module.system.entity.Datasource;
 import com.xjrsoft.module.system.entity.OauthClientDetails;
 import com.xjrsoft.module.system.service.IOauthClientDetailsService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.util.List;
+import java.util.stream.Collectors;
+
 /**
  * Sa-Token OAuth2.0 整合实现
  */
@@ -21,6 +32,12 @@ public class SaOAuth2TemplateImpl extends SaOAuth2Template {
     @Autowired
     private IOauthClientDetailsService oauthClientDetailsService;
 
+    @Autowired
+    private RoleMapper roleMapper;
+
+    @Autowired
+    private UserRoleRelationMapper userRoleRelationMapper;
+
     // 根据 id 获取 Client 信息
     @Override
     public SaClientModel getClientModel(String clientId) {
@@ -42,7 +59,6 @@ public class SaOAuth2TemplateImpl extends SaOAuth2Template {
     // 根据ClientId 和 LoginId 获取openid
     @Override
     public String getOpenid(String clientId, Object loginId) {
-        // 此为模拟数据,真实环境需要从数据库查询
         return "";
     }
 
@@ -50,6 +66,25 @@ public class SaOAuth2TemplateImpl extends SaOAuth2Template {
     @Override
     public String randomAccessToken(String clientId, Object loginId, String scope) {
         String tokenValue = StpUtil.createLoginSession(loginId);
+
+        // 手动授权
+        // 获取用户类型(根据固定角色进行匹配)
+        List<UserRoleRelation> relations = userRoleRelationMapper.selectList(Wrappers.lambdaQuery(UserRoleRelation.class)
+                .select(UserRoleRelation::getRoleId)
+                .eq(UserRoleRelation::getUserId, loginId));
+
+        List<Long> relationIds = relations.stream().map(UserRoleRelation::getRoleId).collect(Collectors.toList());
+
+        List<Role> roleList = roleMapper.selectList(Wrappers.lambdaQuery(Role.class)
+                .select(Role.class, x -> VoToColumnUtil.fieldsToColumns(UserRoleVo.class).contains(x.getColumn()))
+                .in(relationIds.size() > 0, Role::getId, relationIds));
+
+        List<String> roleCodeList = roleList.stream().map(Role::getCode).collect(Collectors.toList());
+        List<Long> roleIdList = roleList.stream().map(Role::getId).collect(Collectors.toList());
+        SaSession tokenSession = StpUtil.getSessionByLoginId(loginId);
+        tokenSession.set(GlobalConstant.LOGIN_USER_ROLE_CODE_KEY, roleCodeList);
+        tokenSession.set(GlobalConstant.LOGIN_USER_ROLE_ID_KEY, roleIdList);
+
         return tokenValue;
     }
 }

+ 4 - 4
src/main/resources/application-dev.yml

@@ -61,10 +61,10 @@ xjrsoft:
     druid-account: admin # druid 监控账户
     druid-password: admin # druid 监控密码
     default-password: "cqtlzjzx2023" #默认密码(用户重置密码后为该密码)
-#    domain-api: https://test.tl.web.yingcaibx.com/api #api域名地址
-#    domain-web: https://test.tl.web.yingcaibx.com #web域名地址
-    domain-api: http://127.0.0.1:9000/api #api域名地址
-    domain-web: http://127.0.0.1:9000 #web域名地址
+    domain-api: http://10.150.10.139:8888/api #api域名地址
+    domain-web: http://10.150.10.139:8888 #web域名地址
+#    domain-api: http://127.0.0.1:9000/api #api域名地址
+#    domain-web: http://127.0.0.1:9000 #web域名地址
     white-list:
       - 192.168.0.139
     exclude-urls:

+ 26 - 0
src/main/resources/mapper/student/StudentHonorsMapper.xml

@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.xjrsoft.module.student.mapper.StudentHonorsMapper">
+    <select id="getPage" parameterType="com.xjrsoft.module.student.dto.StudentHonorsPageDto" resultType="com.xjrsoft.module.student.vo.StudentHonorsPageVo">
+        SELECT t1.id,t1.sort_code,t2.name AS student_name,t1.student_id,t3.name AS honors_level,t4.name AS honors_type,
+        t5.name AS honors_grade,t1.name AS honors_name, t1.award_date,t1.status,t1.file_id FROM student_honors t1
+        LEFT JOIN xjr_user t2 ON t1.student_user_id = t2.id
+        LEFT JOIN xjr_dictionary_detail t3 ON t1.honors_level = t3.code AND t3.item_id = 1731576278748352514
+        LEFT JOIN xjr_dictionary_detail t4 ON t1.honors_type = t4.code AND t4.item_id = 1731577666295418881
+        LEFT JOIN xjr_dictionary_detail t5 ON t1.honors_grade = t5.code AND t5.item_id = 1731577201793028098
+        WHERE t1.delete_mark = 0 AND t1.class_id = #{dto.classId}
+    </select>
+
+    <select id="getSemesterInfo" resultType="com.xjrsoft.module.student.vo.StudentHonorsListVo">
+        SELECT DISTINCT t1.base_semester_id as id,t2.name FROM student_honors t1
+        INNER JOIN base_semester t2 ON t1.base_semester_id = t2.id
+        WHERE t1.delete_mark = 0
+    </select>
+    <select id="getClassInfo" resultType="com.xjrsoft.module.student.vo.StudentHonorsListVo">
+        SELECT DISTINCT t1.class_id as id,t2.name,t1.base_semester_id as parent_id FROM student_honors t1
+        INNER JOIN base_class t2 ON t1.class_id = t2.id
+        WHERE t1.delete_mark = 0
+    </select>
+</mapper>

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

@@ -64,6 +64,7 @@ CREATE TABLE base_punishment_type
     `sort_code` INT NULL DEFAULT NULL COMMENT '序号',
     `punishment_type` VARCHAR(100) NULL DEFAULT NULL COMMENT '处分类型',
     `punishment_level` INT NULL DEFAULT NULL COMMENT '处分级别',
+    `validity_period_day` INT NULL DEFAULT NULL COMMENT '有效期(天)',
     PRIMARY KEY (`id`)
 ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '处分类型维护';
 

+ 181 - 0
src/main/resources/sqlScript/20231129_sql.sql

@@ -184,6 +184,7 @@ CREATE TABLE school_roll_further_education
     `back_grade_id` bigint NULL DEFAULT NULL COMMENT '异动后入学年级(base_grade)',
     `back_class_id` bigint NULL DEFAULT NULL COMMENT '异动后班级(base_class)',
     `back_major_set_id` bigint NULL DEFAULT NULL COMMENT '异动后专业方向(base_major_set)',
+    `student_id` bigint NULL DEFAULT NULL COMMENT '学生编号(学生user_id)',
 
     `remark` varchar(1000) COMMENT '备注',
     `status` int not null default 0 COMMENT '状态(1:结束 0:未结束)',
@@ -191,6 +192,186 @@ CREATE TABLE school_roll_further_education
 ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '升学管理';
 -- ------------------------------------------------------------------学籍异动管理--------------------------------------------------------------------
 
+ALTER TABLE base_punishment_type ADD COLUMN `validity_period_day` INT NULL DEFAULT NULL COMMENT '有效期(天)' AFTER punishment_level;
+
+-- ------------------------------------------------------------------班主任请假--------------------------------------------------------------------
+-- ----------------------------
+-- 班主任事项请假
+-- ----------------------------
+DROP TABLE IF EXISTS wf_head_teacher_leave;
+CREATE TABLE wf_head_teacher_leave
+(
+    id BIGINT NOT NULL COMMENT '主键编号',
+    `create_user_id` BIGINT NULL DEFAULT NULL COMMENT '创建人',
+    `create_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
+    `modify_user_id` BIGINT NULL DEFAULT NULL COMMENT '修改人',
+    `modify_date` datetime NULL DEFAULT NULL COMMENT '修改时间',
+    `delete_mark` INT NOT NULL COMMENT '删除标记',
+    `enabled_mark` INT NOT NULL COMMENT '有效标志',
+    `sort_code` INT NULL DEFAULT NULL COMMENT '序号',
+    `applicant_user_id` bigint NULL DEFAULT NULL COMMENT '申请人',
+    `leave_reason`varchar(20) NULL DEFAULT NULL COMMENT '请假原因(xjr_dictionary_item[leave_reason])',
+    `start_time` date NULL DEFAULT NULL COMMENT '开始时间',
+    `end_time` date NULL DEFAULT NULL COMMENT '结束时间',
+    `is_substitute` INT NOT NULL default 0 COMMENT '是否有替班教师(1:是 0:否)',
+    `substitute_user_id` bigint NULL DEFAULT NULL COMMENT '替换教师',
+    `remark` varchar(1000) COMMENT '备注',
+    `status` int not null default 0 COMMENT '状态(1:结束 0:未结束)',
+    PRIMARY KEY (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '班主任事项请假';
+-- ------------------------------------------------------------------班主任请假--------------------------------------------------------------------
+
+-- ------------------------------------------------------------------荣誉--------------------------------------------------------------------
+-- ----------------------------
+-- 班级荣誉
+-- ----------------------------
+DROP TABLE IF EXISTS class_honors;
+CREATE TABLE class_honors
+(
+    id BIGINT NOT NULL COMMENT '主键编号',
+    `create_user_id` BIGINT NULL DEFAULT NULL COMMENT '创建人',
+    `create_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
+    `modify_user_id` BIGINT NULL DEFAULT NULL COMMENT '修改人',
+    `modify_date` datetime NULL DEFAULT NULL COMMENT '修改时间',
+    `delete_mark` INT NOT NULL COMMENT '删除标记',
+    `enabled_mark` INT NOT NULL COMMENT '有效标志',
+    `sort_code` INT NULL DEFAULT NULL COMMENT '序号',
+    `base_semester_id` BIGINT COMMENT '学期ID(base_semester)',
+    `class_id` BIGINT NULL DEFAULT NULL COMMENT '班级id',
+    `honors_level` varchar(20) NULL DEFAULT NULL COMMENT '荣誉级别(xjr_dictionary_item[honors_level])',
+    `honors_grade`varchar(20) NULL DEFAULT NULL COMMENT '荣誉等级(xjr_dictionary_item[honors_grade])',
+    `name` varchar(1000) NULL DEFAULT NULL COMMENT '荣誉名称',
+    `award_date` date NULL DEFAULT NULL COMMENT '获奖日期',
+    `file_id` BIGINT NULL DEFAULT NULL COMMENT '附件文件id',
+    PRIMARY KEY (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '班级荣誉';
+
+-- ----------------------------
+-- 学生荣誉
+-- ----------------------------
+DROP TABLE IF EXISTS student_honors;
+CREATE TABLE student_honors
+(
+    id BIGINT NOT NULL COMMENT '主键编号',
+    `create_user_id` BIGINT NULL DEFAULT NULL COMMENT '创建人',
+    `create_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
+    `modify_user_id` BIGINT NULL DEFAULT NULL COMMENT '修改人',
+    `modify_date` datetime NULL DEFAULT NULL COMMENT '修改时间',
+    `delete_mark` INT NOT NULL COMMENT '删除标记',
+    `enabled_mark` INT NOT NULL COMMENT '有效标志',
+    `sort_code` INT NULL DEFAULT NULL COMMENT '序号',
+    `applicant_user_id` bigint NULL DEFAULT NULL COMMENT '申请人',
+    `data_entry_method` int NULL DEFAULT 1 COMMENT '数据录入方式 1=推荐 2=登记',
+    `base_semester_id` BIGINT COMMENT '学期ID(base_semester)',
+    `class_id` BIGINT NULL DEFAULT NULL COMMENT '班级id',
+    `student_user_id` BIGINT NULL DEFAULT NULL COMMENT '学生用户编号',
+    `student_id` VARCHAR(30) NULL DEFAULT NULL COMMENT '学号',
+    `major_name` VARCHAR(50) NULL DEFAULT NULL COMMENT '所学专业',
+    `honors_level` varchar(20) NULL DEFAULT NULL COMMENT '荣誉级别(xjr_dictionary_item[honors_level])',
+    `honors_grade`varchar(20) NULL DEFAULT NULL COMMENT '荣誉等级(xjr_dictionary_item[honors_grade])',
+    `honors_type`varchar(20) NULL DEFAULT NULL COMMENT '荣誉类型(xjr_dictionary_item[honors_type])',
+    `name` varchar(1000) NULL DEFAULT NULL COMMENT '荣誉名称',
+    `award_date` date NULL DEFAULT NULL COMMENT '获奖日期',
+    `file_id` BIGINT NULL DEFAULT NULL COMMENT '附件文件id',
+    `status` int not null default 0 COMMENT '状态(1:结束 0:未结束)',
+    PRIMARY KEY (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '学生荣誉';
+-- ------------------------------------------------------------------荣誉--------------------------------------------------------------------
+
+
+-- ------------------------------------------------------------------公文--------------------------------------------------------------------
+-- ----------------------------
+-- 公文收文
+-- ----------------------------
+DROP TABLE IF EXISTS official_document_received;
+CREATE TABLE official_document_received
+(
+    id BIGINT NOT NULL COMMENT '主键编号',
+    `create_user_id` BIGINT NULL DEFAULT NULL COMMENT '创建人',
+    `create_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
+    `modify_user_id` BIGINT NULL DEFAULT NULL COMMENT '修改人',
+    `modify_date` datetime NULL DEFAULT NULL COMMENT '修改时间',
+    `delete_mark` INT NOT NULL COMMENT '删除标记',
+    `enabled_mark` INT NOT NULL COMMENT '有效标志',
+    `sort_code` INT NULL DEFAULT NULL COMMENT '序号',
+    `received_title` varchar(200) NULL DEFAULT NULL COMMENT '收文标题',
+    `received_number` varchar(200) NULL DEFAULT NULL COMMENT '收文文号',
+    `received_date` date NULL DEFAULT NULL COMMENT '收文时间',
+    `communication_org` varchar(200) NULL DEFAULT NULL COMMENT '来文机构',
+    `communication_number` varchar(200) NULL DEFAULT NULL COMMENT '来文文号',
+    `checkout_time` date NULL DEFAULT NULL COMMENT '办结时间',
+    `document_level`varchar(20) NULL DEFAULT NULL COMMENT '文件密级(xjr_dictionary_item[document_level])',
+    `emergency_level`varchar(20) NULL DEFAULT NULL COMMENT '紧急程度(xjr_dictionary_item[emergency_level])',
+    `file_id` BIGINT NULL DEFAULT NULL COMMENT '附件文件id',
+    PRIMARY KEY (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '公文收文';
+
+-- ----------------------------
+-- 公文发文
+-- ----------------------------
+DROP TABLE IF EXISTS official_document_post;
+CREATE TABLE official_document_post
+(
+    id BIGINT NOT NULL COMMENT '主键编号',
+    `create_user_id` BIGINT NULL DEFAULT NULL COMMENT '创建人',
+    `create_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
+    `modify_user_id` BIGINT NULL DEFAULT NULL COMMENT '修改人',
+    `modify_date` datetime NULL DEFAULT NULL COMMENT '修改时间',
+    `delete_mark` INT NOT NULL COMMENT '删除标记',
+    `enabled_mark` INT NOT NULL COMMENT '有效标志',
+    `sort_code` INT NULL DEFAULT NULL COMMENT '序号',
+    `post_title` varchar(200) NULL DEFAULT NULL COMMENT '发文标题',
+    `post_number` varchar(200) NULL DEFAULT NULL COMMENT '发文文号(发文文号自动生成,年+三位数字(三位数字从001开始)如2023001、2023002,依次生成)',
+    `post_date` date NULL DEFAULT NULL COMMENT '发文时间',
+    `post_department_id` bigint NOT NULL COMMENT '发文所属机构(xjr_department)',
+    `file_id` BIGINT NULL DEFAULT NULL COMMENT '附件文件id',
+    PRIMARY KEY (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '公文发文';
+-- ------------------------------------------------------------------公文--------------------------------------------------------------------
+
+-- ------------------------------------------------------------------教师获奖登记--------------------------------------------------------------------
+-- ----------------------------
+-- 教师获奖登记
+-- ----------------------------
+DROP TABLE IF EXISTS teacher_award;
+CREATE TABLE teacher_award
+(
+    id BIGINT NOT NULL COMMENT '主键编号',
+    `create_user_id` BIGINT NULL DEFAULT NULL COMMENT '创建人',
+    `create_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
+    `modify_user_id` BIGINT NULL DEFAULT NULL COMMENT '修改人',
+    `modify_date` datetime NULL DEFAULT NULL COMMENT '修改时间',
+    `delete_mark` INT NOT NULL COMMENT '删除标记',
+    `enabled_mark` INT NOT NULL COMMENT '有效标志',
+    `sort_code` INT NULL DEFAULT NULL COMMENT '序号',
+    `applicant_user_id` bigint NULL DEFAULT NULL COMMENT '申请人',
+    `award_type` varchar(20) NULL DEFAULT NULL COMMENT '获奖类型(xjr_dictionary_item[award_type])',
+
+    `award_level` varchar(20) NULL DEFAULT NULL COMMENT '奖项级别(xjr_dictionary_item[honors_level])',
+    `competition_name`varchar(200) NULL DEFAULT NULL COMMENT '赛项名称',
+    `award_grade`varchar(200) NULL DEFAULT NULL COMMENT '获奖等级(一等奖、二等奖、三等奖、指导奖一等奖、指导奖二等奖、指导奖三等奖)',
+    `award_group`varchar(200) NULL DEFAULT NULL COMMENT '组别(职工、师生同赛)',
+
+    `paper_name`varchar(200) NULL DEFAULT NULL COMMENT '论文名称',
+    `journal_name`varchar(200) NULL DEFAULT NULL COMMENT '期刊名称',
+    `journal_number`varchar(200) NULL DEFAULT NULL COMMENT '期刊号',
+    `journal_level`varchar(200) NULL DEFAULT NULL COMMENT '期刊级别(国家级、省级)',
+    `issue_date` date NULL DEFAULT NULL COMMENT '发表时间',
+
+    `honors_type`varchar(200) NULL DEFAULT NULL COMMENT '荣誉类型(骨干老师、双师型教师)',
+    `identify_date`date NULL DEFAULT NULL COMMENT '认定时间',
+    `certificate_file_id` BIGINT NULL DEFAULT NULL COMMENT '证书文件id',
+    `policy_file_id` BIGINT NULL DEFAULT NULL COMMENT '政策文件id',
+
+    `approval_user_id` bigint NULL DEFAULT NULL COMMENT '审核人',
+    `remark` varchar(1000) COMMENT '备注',
+    `file_id` BIGINT NULL DEFAULT NULL COMMENT '附件文件id',
+    `status` int not null default 0 COMMENT '状态(1:结束 0:未结束)',
+    PRIMARY KEY (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '教师获奖登记';
+-- ------------------------------------------------------------------教师获奖登记--------------------------------------------------------------------
+
+