feat(comprehensive): 新增学生信息核对功能模块
- 在 SrsStudentInfoCheck 实体类中添加主键ID、学号字段及基础信息字段 - 添加创建者、创建时间、更新者、更新时间、备注和删除标志等审计字段 - 创建 ISrsStudentInfoCheckService 接口定义学生信息查询和编辑方法 - 实现 SrsStudentInfoCheckServiceImpl 服务类提供学生信息业务逻辑处理 - 开发 SrsStudentInfoCheckController 控制器提供 REST API 接口 - 创建 SrsStudentInfoCheckMapper 数据访问接口和对应的 XML 映射文件 - 实现学生信息的增删改查、列表查询和 Excel 导出功能 - 添加权限控制和操作日志记录功能
This commit is contained in:
@@ -0,0 +1,89 @@
|
|||||||
|
package com.srs.web.controller.comprehensive;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
|
||||||
|
import com.srs.comprehensive.domain.SrsStudentInfoCheck;
|
||||||
|
import com.srs.comprehensive.service.ISrsStudentInfoCheckService;
|
||||||
|
import com.srs.common.core.controller.BaseController;
|
||||||
|
import com.srs.common.core.domain.AjaxResult;
|
||||||
|
import com.srs.common.enums.BusinessType;
|
||||||
|
import com.srs.common.annotation.Log;
|
||||||
|
import com.srs.common.core.page.TableDataInfo;
|
||||||
|
import com.srs.common.utils.poi.ExcelUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学生信息核对 Controller
|
||||||
|
*
|
||||||
|
* @author srs
|
||||||
|
* @date 2024-03-27
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/comprehensive/studentInfo")
|
||||||
|
@Api(value = "学生信息核对管理", tags = "学生信息核对")
|
||||||
|
public class SrsStudentInfoCheckController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISrsStudentInfoCheckService srsStudentInfoCheckService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询学生自己的信息
|
||||||
|
*/
|
||||||
|
@GetMapping("/getOwnInfo")
|
||||||
|
@ApiOperation("查询学生自己的信息")
|
||||||
|
public AjaxResult getOwnInfo() {
|
||||||
|
SrsStudentInfoCheck info = srsStudentInfoCheckService.getStuInfo(getUsername());
|
||||||
|
return AjaxResult.success(info);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据学号查询学生信息(辅导员专用)
|
||||||
|
*/
|
||||||
|
@GetMapping("/getStuInfoByStuNo")
|
||||||
|
@ApiOperation("根据学号查询学生信息")
|
||||||
|
public AjaxResult getStuInfoByStuNo(@RequestParam String stuNo) {
|
||||||
|
SrsStudentInfoCheck info = srsStudentInfoCheckService.getStuInfo(stuNo);
|
||||||
|
return AjaxResult.success(info);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改学生自己的信息
|
||||||
|
*/
|
||||||
|
@PostMapping("/editOwnInfo")
|
||||||
|
@ApiOperation("修改学生自己的信息")
|
||||||
|
public AjaxResult editOwnInfo(@RequestBody SrsStudentInfoCheck param) {
|
||||||
|
if (param.getStuNo() == null || "".equals(param.getStuNo())) {
|
||||||
|
param.setStuNo(getUsername());
|
||||||
|
}
|
||||||
|
return srsStudentInfoCheckService.editStuInfo(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询学生信息列表(管理端使用)
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('comprehensive:studentInfo:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperation("查询学生信息列表")
|
||||||
|
public TableDataInfo list(SrsStudentInfoCheck srsStudentInfoCheck) {
|
||||||
|
startPage();
|
||||||
|
List<SrsStudentInfoCheck> list = srsStudentInfoCheckService.selectSrsStudentInfoCheckList(srsStudentInfoCheck);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出学生信息列表(管理端使用)
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('comprehensive:studentInfo:export')")
|
||||||
|
@Log(title = "学生信息", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
@ApiOperation("导出学生信息列表")
|
||||||
|
public void export(HttpServletResponse response, SrsStudentInfoCheck srsStudentInfoCheck) {
|
||||||
|
List<SrsStudentInfoCheck> list = srsStudentInfoCheckService.selectSrsStudentInfoCheckList(srsStudentInfoCheck);
|
||||||
|
ExcelUtil<SrsStudentInfoCheck> util = new ExcelUtil<SrsStudentInfoCheck>(SrsStudentInfoCheck.class);
|
||||||
|
util.exportExcel(response, list, "学生信息数据");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,13 +12,19 @@ import io.swagger.annotations.ApiModelProperty;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@Data
|
@Data
|
||||||
public class SrsStudentInfoCheck { @TableField(exist = false)
|
public class SrsStudentInfoCheck {
|
||||||
|
@TableField(exist = false)
|
||||||
public String tNo;
|
public String tNo;
|
||||||
@NotNull("银行卡")
|
@NotNull("银行卡")
|
||||||
public String xhk;
|
public String xhk;
|
||||||
|
|
||||||
|
/** 主键 ID */
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 学号 */
|
||||||
|
@TableField("stu_no")
|
||||||
|
private String stuNo;
|
||||||
|
|
||||||
/** 生日 */
|
/** 生日 */
|
||||||
@NotNull("生日")
|
@NotNull("生日")
|
||||||
@@ -74,68 +80,56 @@ public class SrsStudentInfoCheck { @TableField(exist = false)
|
|||||||
/**
|
/**
|
||||||
* 户口所在地区县以下详细地址
|
* 户口所在地区县以下详细地址
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private String hkxxdz;
|
private String hkxxdz;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生居住地址
|
* 学生居住地址
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private String xsjzdz;
|
private String xsjzdz;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所属派出所
|
* 所属派出所
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private String sspcs;
|
private String sspcs;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所属街道
|
* 所属街道
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private String ssjd;
|
private String ssjd;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 乘火车区间
|
* 乘火车区间
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private String chcqj;
|
private String chcqj;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 详细联系地址
|
* 详细联系地址
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private String xxlxdz;
|
private String xxlxdz;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 邮政编码
|
* 邮政编码
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private String yzbm;
|
private String yzbm;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 现家庭地址
|
* 现家庭地址
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private String xjtdz;
|
private String xjtdz;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 家庭邮政编码
|
* 家庭邮政编码
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private String jtyzbm;
|
private String jtyzbm;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 家庭电话
|
* 家庭电话
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private String jtdh;
|
private String jtdh;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 照片
|
* 照片
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
private String dailyPhoto;
|
private String dailyPhoto;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -153,4 +147,34 @@ public class SrsStudentInfoCheck { @TableField(exist = false)
|
|||||||
*/
|
*/
|
||||||
private String bluePhoto;
|
private String bluePhoto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建者
|
||||||
|
*/
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新者
|
||||||
|
*/
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除标志(0 代表存在 1 代表删除)
|
||||||
|
*/
|
||||||
|
@TableField("del_flag")
|
||||||
|
private String delFlag;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.srs.comprehensive.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.srs.comprehensive.domain.SrsStudentInfoCheck;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学生信息核对 Mapper 接口
|
||||||
|
*
|
||||||
|
* @author srs
|
||||||
|
* @date 2024-03-27
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface SrsStudentInfoCheckMapper extends BaseMapper<SrsStudentInfoCheck> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.srs.comprehensive.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.srs.comprehensive.domain.SrsStudentInfoCheck;
|
||||||
|
import com.srs.common.core.domain.AjaxResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学生信息核对 Service 接口
|
||||||
|
*
|
||||||
|
* @author srs
|
||||||
|
* @date 2024-03-27
|
||||||
|
*/
|
||||||
|
public interface ISrsStudentInfoCheckService extends IService<SrsStudentInfoCheck> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询学生信息
|
||||||
|
* @param stuNo 学号
|
||||||
|
* @return 学生信息
|
||||||
|
*/
|
||||||
|
SrsStudentInfoCheck getStuInfo(String stuNo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改学生信息
|
||||||
|
* @param srsStudentInfoCheck 学生信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
AjaxResult editStuInfo(SrsStudentInfoCheck srsStudentInfoCheck);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询学生信息列表
|
||||||
|
* @param srsStudentInfoCheck 学生信息
|
||||||
|
* @return 学生信息集合
|
||||||
|
*/
|
||||||
|
List<SrsStudentInfoCheck> selectSrsStudentInfoCheckList(SrsStudentInfoCheck srsStudentInfoCheck);
|
||||||
|
}
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
package com.srs.comprehensive.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.srs.common.core.domain.AjaxResult;
|
||||||
|
import com.srs.comprehensive.domain.SrsStudentInfoCheck;
|
||||||
|
import com.srs.comprehensive.mapper.SrsStudentInfoCheckMapper;
|
||||||
|
import com.srs.comprehensive.service.ISrsStudentInfoCheckService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学生信息核对 Service 业务层处理
|
||||||
|
*
|
||||||
|
* @author srs
|
||||||
|
* @date 2024-03-27
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SrsStudentInfoCheckServiceImpl extends ServiceImpl<SrsStudentInfoCheckMapper, SrsStudentInfoCheck>
|
||||||
|
implements ISrsStudentInfoCheckService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询学生信息
|
||||||
|
* @param stuNo 学号
|
||||||
|
* @return 学生信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SrsStudentInfoCheck getStuInfo(String stuNo) {
|
||||||
|
if (!StringUtils.hasText(stuNo)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
LambdaQueryWrapper<SrsStudentInfoCheck> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(SrsStudentInfoCheck::getStuNo, stuNo);
|
||||||
|
wrapper.eq(SrsStudentInfoCheck::getDelFlag, "0");
|
||||||
|
|
||||||
|
return this.getOne(wrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改学生信息
|
||||||
|
* @param srsStudentInfoCheck 学生信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult editStuInfo(SrsStudentInfoCheck srsStudentInfoCheck) {
|
||||||
|
try {
|
||||||
|
// 先查询是否存在
|
||||||
|
SrsStudentInfoCheck existing = getStuInfo(srsStudentInfoCheck.getStuNo());
|
||||||
|
|
||||||
|
if (existing != null) {
|
||||||
|
// 存在则更新
|
||||||
|
srsStudentInfoCheck.setId(existing.getId());
|
||||||
|
this.updateById(srsStudentInfoCheck);
|
||||||
|
} else {
|
||||||
|
// 不存在则插入
|
||||||
|
this.save(srsStudentInfoCheck);
|
||||||
|
}
|
||||||
|
|
||||||
|
return AjaxResult.success("修改成功");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return AjaxResult.error("修改失败:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询学生信息列表
|
||||||
|
* @param srsStudentInfoCheck 学生信息
|
||||||
|
* @return 学生信息集合
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SrsStudentInfoCheck> selectSrsStudentInfoCheckList(SrsStudentInfoCheck srsStudentInfoCheck) {
|
||||||
|
LambdaQueryWrapper<SrsStudentInfoCheck> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
// 动态查询条件
|
||||||
|
if (StringUtils.hasText(srsStudentInfoCheck.getStuNo())) {
|
||||||
|
wrapper.eq(SrsStudentInfoCheck::getStuNo, srsStudentInfoCheck.getStuNo());
|
||||||
|
}
|
||||||
|
if (StringUtils.hasText(srsStudentInfoCheck.getMz())) {
|
||||||
|
wrapper.eq(SrsStudentInfoCheck::getMz, srsStudentInfoCheck.getMz());
|
||||||
|
}
|
||||||
|
if (StringUtils.hasText(srsStudentInfoCheck.getZzmm())) {
|
||||||
|
wrapper.eq(SrsStudentInfoCheck::getZzmm, srsStudentInfoCheck.getZzmm());
|
||||||
|
}
|
||||||
|
|
||||||
|
wrapper.eq(SrsStudentInfoCheck::getDelFlag, "0");
|
||||||
|
|
||||||
|
return this.list(wrapper);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
<?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.srs.comprehensive.mapper.SrsStudentInfoCheckMapper">
|
||||||
|
|
||||||
|
<resultMap type="SrsStudentInfoCheck" id="SrsStudentInfoCheckResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="stuNo" column="stu_no" />
|
||||||
|
<result property="birthday" column="birthday" />
|
||||||
|
<result property="idCard" column="id_card" />
|
||||||
|
<result property="phone" column="phone" />
|
||||||
|
<result property="mz" column="mz" />
|
||||||
|
<result property="zzmm" column="zzmm" />
|
||||||
|
<result property="hksz1" column="hksz1" />
|
||||||
|
<result property="hksz2" column="hksz2" />
|
||||||
|
<result property="hksz3" column="hksz3" />
|
||||||
|
<result property="hkszd" column="hkszd" />
|
||||||
|
<result property="hkxz" column="hkxz" />
|
||||||
|
<result property="hkxxdz" column="hkxxdz" />
|
||||||
|
<result property="xsjzdz" column="xsjzdz" />
|
||||||
|
<result property="sspcs" column="sspcs" />
|
||||||
|
<result property="ssjd" column="ssjd" />
|
||||||
|
<result property="chcqj" column="chcqj" />
|
||||||
|
<result property="xxlxdz" column="xxlxdz" />
|
||||||
|
<result property="yzbm" column="yzbm" />
|
||||||
|
<result property="xjtdz" column="xjtdz" />
|
||||||
|
<result property="jtyzbm" column="jtyzbm" />
|
||||||
|
<result property="jtdh" column="jtdh" />
|
||||||
|
<result property="dailyPhoto" column="daily_photo" />
|
||||||
|
<result property="whitePhoto" column="white_photo" />
|
||||||
|
<result property="redPhoto" column="red_photo" />
|
||||||
|
<result property="bluePhoto" column="blue_photo" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="delFlag" column="del_flag" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user