Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -16,10 +16,12 @@ import com.srs.common.utils.StringUtils;
|
||||
import com.srs.comprehensive.domain.Dto.StuDataSelcetDto;
|
||||
import com.srs.comprehensive.domain.Dto.StuStatusImport;
|
||||
import com.srs.comprehensive.domain.SrsStudent;
|
||||
import com.srs.comprehensive.domain.CphStudentDetailExport;
|
||||
|
||||
import com.srs.comprehensive.domain.Vo.*;
|
||||
import com.srs.comprehensive.service.ICascaderDataStudentService;
|
||||
import com.srs.comprehensive.service.ISrsStudentService;
|
||||
import com.srs.comprehensive.service.ICphStudentDetailExportService;
|
||||
import com.srs.system.domain.vo.StuStatus;
|
||||
import com.srs.system.service.ISysPostService;
|
||||
import com.srs.web.controller.common.RoleBool;
|
||||
@@ -52,9 +54,13 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
public class SrsStudentController extends BaseController {
|
||||
@Autowired
|
||||
private ISrsStudentService srsStudentService;
|
||||
@Resource
|
||||
|
||||
@Autowired
|
||||
private ICascaderDataStudentService cascaderDataStudentService;
|
||||
|
||||
@Autowired
|
||||
private ICphStudentDetailExportService cphStudentDetailExportService;
|
||||
|
||||
@Autowired
|
||||
ISysPostService _postService;
|
||||
|
||||
@@ -334,6 +340,31 @@ public class SrsStudentController extends BaseController {
|
||||
util.exportExcel(response, list, "学生信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出全部学生信息(包含查新详情)
|
||||
*/
|
||||
//@PreAuthorize("@ss.hasPermi('system:student:exportAll')")
|
||||
@Log(title = "学生信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/exportAll")
|
||||
public void exportAll(HttpServletResponse response, SrsStudent srsStudent) {
|
||||
List<CphStudentDetailExport> list = cphStudentDetailExportService.getStudentDetailExportList(srsStudent);
|
||||
ExcelUtil<CphStudentDetailExport> util = new ExcelUtil<CphStudentDetailExport>(CphStudentDetailExport.class);
|
||||
util.exportExcel(response, list, "学生查新详情数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 在我的学生页面导出学生信息
|
||||
*/
|
||||
//@PreAuthorize("@ss.hasPermi('system:student:exportAllOwnStu')")
|
||||
@Log(title = "学生信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/exportAllOwnStu")
|
||||
public void exportAllOwnStu(HttpServletResponse response, SrsStudent srsStudent) {
|
||||
srsStudent.tNo = getUsername();
|
||||
List<CphStudentDetailExport> list = cphStudentDetailExportService.getStudentDetailExportList(srsStudent);
|
||||
ExcelUtil<CphStudentDetailExport> util = new ExcelUtil<CphStudentDetailExport>(CphStudentDetailExport.class);
|
||||
util.exportExcel(response, list, "学生查新详情数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载导入模板
|
||||
*
|
||||
|
||||
@@ -64,8 +64,8 @@ spring:
|
||||
# 国际化资源文件路径
|
||||
basename: i18n/messages
|
||||
profiles:
|
||||
active: druid #正式环境
|
||||
# active: dev #测试环境
|
||||
# active: druid #正式环境
|
||||
active: dev #测试环境
|
||||
# 文件上传
|
||||
servlet:
|
||||
multipart:
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.srs.comprehensive.domain;
|
||||
|
||||
import com.srs.common.annotation.Excel;
|
||||
import com.srs.common.annotation.Excels;
|
||||
import com.srs.common.core.domain.entity.SysDept;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 学生查新详情导出实体类
|
||||
* 包含重要信息、其他信息、家庭成员、教育经历
|
||||
*/
|
||||
@Data
|
||||
public class CphStudentDetailExport {
|
||||
|
||||
/** 基本信息 */
|
||||
@Excel(name = "学号")
|
||||
private String stuNo;
|
||||
|
||||
@Excel(name = "姓名")
|
||||
private String name;
|
||||
|
||||
@Excel(name = "性别")
|
||||
private String gender;
|
||||
|
||||
@Excel(name = "身份证号码")
|
||||
private String idCard;
|
||||
|
||||
@Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date birthday;
|
||||
|
||||
@Excel(name = "手机号码")
|
||||
private String phone;
|
||||
|
||||
@Excel(name = "银行卡")
|
||||
private String xhk;
|
||||
|
||||
@Excel(name = "开户行")
|
||||
private String bankAddr;
|
||||
|
||||
/** 班级专业信息 */
|
||||
@Excel(name = "班级名称")
|
||||
private String className;
|
||||
|
||||
@Excel(name = "专业名称")
|
||||
private String majorName;
|
||||
|
||||
@Excel(name = "学院名称")
|
||||
private String deptName;
|
||||
|
||||
@Excel(name = "年级")
|
||||
private String gradeName;
|
||||
|
||||
@Excel(name = "辅导员姓名")
|
||||
private String teacherName;
|
||||
|
||||
/** 其他信息 */
|
||||
@Excel(name = "民族")
|
||||
private String mz;
|
||||
|
||||
@Excel(name = "政治面貌")
|
||||
private String zzmm;
|
||||
|
||||
@Excel(name = "血型")
|
||||
private String xx;
|
||||
|
||||
@Excel(name = "考生号")
|
||||
private String ksh;
|
||||
|
||||
@Excel(name = "籍贯")
|
||||
private String jg;
|
||||
|
||||
@Excel(name = "户口所在地")
|
||||
private String hkszd;
|
||||
|
||||
@Excel(name = "户口所在省")
|
||||
private String hksz1;
|
||||
|
||||
@Excel(name = "户口所在市/区")
|
||||
private String hksz2;
|
||||
|
||||
@Excel(name = "户口所在区/县")
|
||||
private String hksz3;
|
||||
|
||||
@Excel(name = "户口性质")
|
||||
private String hkxz;
|
||||
|
||||
@Excel(name = "户口所在地区县以下详细地址")
|
||||
private String hkxxdz;
|
||||
|
||||
/*@Excel(name = "学生居住地址")
|
||||
private String xsjzdz;*/
|
||||
|
||||
@Excel(name = "所属派出所")
|
||||
private String sspcs;
|
||||
|
||||
@Excel(name = "所属街道")
|
||||
private String ssjd;
|
||||
|
||||
@Excel(name = "乘火车区间")
|
||||
private String chcqj;
|
||||
|
||||
@Excel(name = "详细联系地址")
|
||||
private String xxlxdz;
|
||||
|
||||
/*@Excel(name = "邮政编码")
|
||||
private String yzbm;*/
|
||||
|
||||
@Excel(name = "现家庭地址")
|
||||
private String xjtdz;
|
||||
|
||||
@Excel(name = "家庭邮政编码")
|
||||
private String jtyzbm;
|
||||
|
||||
@Excel(name = "家庭电话")
|
||||
private String jtdh;
|
||||
|
||||
/** 家庭成员信息 */
|
||||
@Excel(name = "家庭成员信息", width = 100)
|
||||
private String familyMembers;
|
||||
|
||||
/** 教育经历信息 */
|
||||
@Excel(name = "教育经历信息", width = 100)
|
||||
private String educationExperiences;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.srs.comprehensive.mapper;
|
||||
|
||||
import com.srs.comprehensive.domain.CphStudentDetailExport;
|
||||
import com.srs.comprehensive.domain.SrsStudent;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 学生查新详情导出Mapper接口
|
||||
*/
|
||||
@Mapper
|
||||
public interface CphStudentDetailExportMapper {
|
||||
|
||||
/**
|
||||
* 查询学生查新详情导出列表
|
||||
*
|
||||
* @param srsStudent 学生信息
|
||||
* @return 学生查新详情导出列表
|
||||
*/
|
||||
List<CphStudentDetailExport> selectStudentDetailExportList(SrsStudent srsStudent);
|
||||
|
||||
/**
|
||||
* 根据学号查询学生查新详情导出信息
|
||||
*
|
||||
* @param stuNo 学号
|
||||
* @return 学生查新详情导出信息
|
||||
*/
|
||||
CphStudentDetailExport selectStudentDetailExportByStuNo(@Param("stuNo") String stuNo);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.srs.comprehensive.service;
|
||||
|
||||
import com.srs.comprehensive.domain.CphStudentDetailExport;
|
||||
import com.srs.comprehensive.domain.SrsStudent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 学生查新详情导出服务接口
|
||||
*/
|
||||
public interface ICphStudentDetailExportService {
|
||||
/**
|
||||
* 根据查询条件获取学生查新详情列表
|
||||
* @param srsStudent 查询条件
|
||||
* @return 学生查新详情列表
|
||||
*/
|
||||
List<CphStudentDetailExport> getStudentDetailExportList(SrsStudent srsStudent);
|
||||
|
||||
/**
|
||||
* 根据学号获取学生查新详情
|
||||
* @param stuNo 学号
|
||||
* @return 学生查新详情
|
||||
*/
|
||||
CphStudentDetailExport getStudentDetailExportByStuNo(String stuNo);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.srs.comprehensive.service.impl;
|
||||
|
||||
import com.srs.comprehensive.domain.CphStudentDetailExport;
|
||||
import com.srs.comprehensive.domain.SrsStudent;
|
||||
import com.srs.comprehensive.mapper.CphStudentDetailExportMapper;
|
||||
import com.srs.comprehensive.service.ICphStudentDetailExportService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 学生查新详情导出服务实现类
|
||||
*/
|
||||
@Service
|
||||
public class CphStudentDetailExportServiceImpl implements ICphStudentDetailExportService {
|
||||
|
||||
@Autowired
|
||||
private CphStudentDetailExportMapper cphStudentDetailExportMapper;
|
||||
|
||||
@Override
|
||||
public List<CphStudentDetailExport> getStudentDetailExportList(SrsStudent srsStudent) {
|
||||
// 直接调用Mapper查询,使用SQL聚合处理数据
|
||||
return cphStudentDetailExportMapper.selectStudentDetailExportList(srsStudent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CphStudentDetailExport getStudentDetailExportByStuNo(String stuNo) {
|
||||
// 直接调用Mapper查询,使用SQL聚合处理数据
|
||||
return cphStudentDetailExportMapper.selectStudentDetailExportByStuNo(stuNo);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,221 @@
|
||||
<?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.CphStudentDetailExportMapper">
|
||||
|
||||
<!-- 学生查新详情导出结果映射 -->
|
||||
<resultMap type="CphStudentDetailExport" id="CphStudentDetailExportResult">
|
||||
<!-- 基本信息 -->
|
||||
<result property="stuNo" column="stu_no"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="gender" column="gender"/>
|
||||
<result property="idCard" column="id_card"/>
|
||||
<result property="birthday" column="birthday"/>
|
||||
<result property="phone" column="phone"/>
|
||||
<result property="xhk" column="xhk"/>
|
||||
<result property="bankAddr" column="bank_addr"/>
|
||||
|
||||
<!-- 班级专业信息 -->
|
||||
<result property="className" column="class_name"/>
|
||||
<result property="majorName" column="major_name"/>
|
||||
<result property="deptName" column="dept_name"/>
|
||||
<result property="gradeName" column="grade_name"/>
|
||||
<result property="teacherName" column="teacher_name"/>
|
||||
|
||||
<!-- 其他信息 -->
|
||||
<result property="mz" column="mz"/>
|
||||
<result property="zzmm" column="zzmm"/>
|
||||
<result property="xx" column="xx"/>
|
||||
<result property="ksh" column="ksh"/>
|
||||
<result property="jg" column="jg"/>
|
||||
<result property="hkszd" column="hkszd"/>
|
||||
<result property="hksz1" column="hksz1"/>
|
||||
<result property="hksz2" column="hksz2"/>
|
||||
<result property="hksz3" column="hksz3"/>
|
||||
<result property="hkxz" column="hkxz"/>
|
||||
<result property="hkxxdz" column="hkxxdz"/>
|
||||
<result property="sspcs" column="sspcs"/>
|
||||
<result property="ssjd" column="ssjd"/>
|
||||
<result property="chcqj" column="chcqj"/>
|
||||
<result property="xxlxdz" column="xxlxdz"/>
|
||||
<result property="xjtdz" column="xjtdz"/>
|
||||
<result property="jtyzbm" column="jtyzbm"/>
|
||||
<result property="jtdh" column="jtdh"/>
|
||||
|
||||
<!-- 家庭成员信息(使用MySQL的GROUP_CONCAT函数聚合) -->
|
||||
<result property="familyMembers" column="family_members"/>
|
||||
|
||||
<!-- 教育经历信息(使用MySQL的GROUP_CONCAT函数聚合) -->
|
||||
<result property="educationExperiences" column="education_experiences"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 查询学生查新详情导出数据 -->
|
||||
<select id="selectStudentDetailExportList" parameterType="SrsStudent" resultMap="CphStudentDetailExportResult">
|
||||
SELECT
|
||||
s.stu_no,
|
||||
s.name,
|
||||
s.gender,
|
||||
AES_DECRYPT(UNHEX(s.id_card), 'zhxg') as id_card,
|
||||
s.birthday,
|
||||
s.phone,
|
||||
s.xhk,
|
||||
s.bank_addr,
|
||||
c.class_name,
|
||||
m.major_name,
|
||||
d.dept_name,
|
||||
f.grade_name,
|
||||
e.name as teacher_name,
|
||||
g.mz,
|
||||
g.zzmm,
|
||||
g.xx,
|
||||
g.ksh,
|
||||
g.jg,
|
||||
g.hkszd,
|
||||
g.hkxz,
|
||||
g.hkxxdz,
|
||||
g.hksz1,
|
||||
g.hksz2,
|
||||
g.hksz3,
|
||||
g.sspcs,
|
||||
g.ssjd,
|
||||
g.chcqj,
|
||||
g.xxlxdz,
|
||||
g.xjtdz,
|
||||
g.jtyzbm,
|
||||
g.jtdh,
|
||||
|
||||
-- 聚合家庭成员信息(使用DISTINCT避免重复)
|
||||
GROUP_CONCAT(
|
||||
DISTINCT CONCAT(
|
||||
'姓名: ', fm.family_name,
|
||||
',关系: ', fm.family_relation,
|
||||
',年龄: ', fm.age,
|
||||
',政治面貌: ', fm.zzmm,
|
||||
',职业: ', fm.job,
|
||||
',工作单位: ', fm.work_place,
|
||||
',年收入: ', COALESCE(fm.year_money, ''),
|
||||
',联系方式: ', fm.phone,
|
||||
',健康状况: ', fm.health
|
||||
) SEPARATOR '\n'
|
||||
) as family_members,
|
||||
|
||||
-- 聚合教育经历信息(使用DISTINCT避免重复)
|
||||
GROUP_CONCAT(
|
||||
DISTINCT CONCAT(
|
||||
'开始时间: ', DATE_FORMAT(ee.start_time, '%Y-%m-%d'),
|
||||
',结束时间: ', DATE_FORMAT(ee.end_time, '%Y-%m-%d'),
|
||||
',学校: ', ee.school_name,
|
||||
',职务: ', ee.post,
|
||||
',证明人: ', ee.certifier
|
||||
) SEPARATOR '\n'
|
||||
) as education_experiences
|
||||
|
||||
FROM srs_student s
|
||||
LEFT JOIN srs_class c ON s.class_id = c.class_id
|
||||
LEFT JOIN srs_majors m ON c.major_id = m.major_id
|
||||
LEFT JOIN sys_dept d ON m.college_id = d.dept_id
|
||||
LEFT JOIN cph_teacher e ON c.teacher_id = e.teacher_id
|
||||
LEFT JOIN srs_grade f ON f.grade_id = c.grade_id
|
||||
LEFT JOIN cph_stu_extra_info g ON g.stu_no = s.stu_no
|
||||
LEFT JOIN cph_family_member fm ON fm.stu_no = s.stu_no
|
||||
LEFT JOIN srs_education_experience ee ON ee.stu_no = s.stu_no
|
||||
|
||||
<where>
|
||||
<if test="stuNo != null and stuNo != ''">and s.stu_no like concat('%', #{stuNo}, '%')</if>
|
||||
<if test="name != null and name != ''">and s.name like concat('%', #{name}, '%')</if>
|
||||
<if test="gender != null and gender != ''">and s.gender = #{gender}</if>
|
||||
<if test="birthday != null ">and s.birthday = #{birthday}</if>
|
||||
<if test="idCard != null and idCard != ''">and s.id_card = #{idCard}</if>
|
||||
<if test="deptId != null ">and d.dept_id = #{deptId}</if>
|
||||
<if test="majorId != null ">and m.major_id = #{majorId}</if>
|
||||
<if test="classId != null ">and s.class_id = #{classId}</if>
|
||||
<if test="phone != null and phone != ''">and s.phone like concat('%', #{phone} , '%')</if>
|
||||
<if test="address != null and address != ''">and s.address like concat('%', #{address} , '%')</if>
|
||||
<if test="status != null and status != ''">and s.status = #{status}</if>
|
||||
<if test="tNo != null and tNo != ''">and e.employee_id = #{tNo}</if>
|
||||
<if test="gradeId != null">and c.grade_id = #{gradeId}</if>
|
||||
<if test="cphName != null and cphName!=''">and e.name = #{cphName}</if>
|
||||
</where>
|
||||
|
||||
GROUP BY s.stu_no
|
||||
ORDER BY s.stu_no desc
|
||||
</select>
|
||||
|
||||
<!-- 根据学号查询学生查新详情导出数据 -->
|
||||
<select id="selectStudentDetailExportByStuNo" parameterType="String" resultMap="CphStudentDetailExportResult">
|
||||
SELECT
|
||||
s.stu_no,
|
||||
s.name,
|
||||
s.gender,
|
||||
AES_DECRYPT(UNHEX(s.id_card), 'zhxg') as id_card,
|
||||
s.birthday,
|
||||
s.phone,
|
||||
s.xhk,
|
||||
s.bank_addr,
|
||||
c.class_name,
|
||||
m.major_name,
|
||||
d.dept_name,
|
||||
f.grade_name,
|
||||
e.name as teacher_name,
|
||||
g.mz,
|
||||
g.zzmm,
|
||||
g.xx,
|
||||
g.ksh,
|
||||
g.jg,
|
||||
g.hkszd,
|
||||
g.hkxz,
|
||||
g.hkxxdz,
|
||||
g.hksz1,
|
||||
g.hksz2,
|
||||
g.hksz3,
|
||||
g.sspcs,
|
||||
g.ssjd,
|
||||
g.chcqj,
|
||||
g.xxlxdz,
|
||||
g.xjtdz,
|
||||
g.jtyzbm,
|
||||
g.jtdh,
|
||||
|
||||
-- 聚合家庭成员信息(使用DISTINCT避免重复)
|
||||
GROUP_CONCAT(
|
||||
DISTINCT CONCAT(
|
||||
'姓名: ', fm.family_name,
|
||||
',关系: ', fm.family_relation,
|
||||
',年龄: ', fm.age,
|
||||
',政治面貌: ', fm.zzmm,
|
||||
',职业: ', fm.job,
|
||||
',工作单位: ', fm.work_place,
|
||||
',年收入: ', COALESCE(fm.year_money, ''),
|
||||
',联系方式: ', fm.phone,
|
||||
',健康状况: ', fm.health
|
||||
) SEPARATOR '\n'
|
||||
) as family_members,
|
||||
|
||||
-- 聚合教育经历信息(使用DISTINCT避免重复)
|
||||
GROUP_CONCAT(
|
||||
DISTINCT CONCAT(
|
||||
'开始时间: ', DATE_FORMAT(ee.start_time, '%Y-%m-%d'),
|
||||
',结束时间: ', DATE_FORMAT(ee.end_time, '%Y-%m-%d'),
|
||||
',学校: ', ee.school_name,
|
||||
',职务: ', ee.post,
|
||||
',证明人: ', ee.certifier
|
||||
) SEPARATOR '\n'
|
||||
) as education_experiences
|
||||
|
||||
FROM srs_student s
|
||||
LEFT JOIN srs_class c ON s.class_id = c.class_id
|
||||
LEFT JOIN srs_majors m ON c.major_id = m.major_id
|
||||
LEFT JOIN sys_dept d ON m.college_id = d.dept_id
|
||||
LEFT JOIN cph_teacher e ON c.teacher_id = e.teacher_id
|
||||
LEFT JOIN srs_grade f ON f.grade_id = c.grade_id
|
||||
LEFT JOIN cph_stu_extra_info g ON g.stu_no = s.stu_no
|
||||
LEFT JOIN cph_family_member fm ON fm.stu_no = s.stu_no
|
||||
LEFT JOIN srs_education_experience ee ON ee.stu_no = s.stu_no
|
||||
|
||||
WHERE s.stu_no = #{stuNo}
|
||||
|
||||
GROUP BY s.stu_no
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -13,7 +13,7 @@ import com.srs.common.core.domain.BaseEntity;
|
||||
* 退伍复学材料对象 sys_dis_mate
|
||||
*
|
||||
* @author srs
|
||||
* @date 2025-11-12
|
||||
* @date 2026-03-01
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@@ -89,11 +89,11 @@ private static final long serialVersionUID=1L;
|
||||
private String newgrade;
|
||||
|
||||
/**
|
||||
* 新专业
|
||||
* 新班级
|
||||
*/
|
||||
@ApiModelProperty("新专业")
|
||||
@ApiModelProperty("新班级")
|
||||
@TableField("newmajor")
|
||||
@Excel(name = "新专业")
|
||||
@Excel(name = "新班级")
|
||||
private String newmajor;
|
||||
|
||||
/**
|
||||
@@ -121,20 +121,52 @@ private static final long serialVersionUID=1L;
|
||||
private String material;
|
||||
|
||||
/**
|
||||
* 保留字段1
|
||||
* 学院ID
|
||||
*/
|
||||
@ApiModelProperty("保留字段1")
|
||||
@ApiModelProperty("学院ID")
|
||||
@TableField("data1")
|
||||
@Excel(name = "保留字段1")
|
||||
@Excel(name = "学院ID")
|
||||
private String data1;
|
||||
|
||||
/**
|
||||
* 保留字段2
|
||||
* 专业ID
|
||||
*/
|
||||
@ApiModelProperty("保留字段2")
|
||||
@ApiModelProperty("专业ID")
|
||||
@TableField("data2")
|
||||
@Excel(name = "保留字段2")
|
||||
@Excel(name = "专业ID")
|
||||
private String data2;
|
||||
|
||||
/**
|
||||
* 最终专业1
|
||||
*/
|
||||
@ApiModelProperty("最终专业1")
|
||||
@TableField("finaldata1")
|
||||
@Excel(name = "最终专业1")
|
||||
private String finaldata1;
|
||||
|
||||
/**
|
||||
* 最终专业1
|
||||
*/
|
||||
@ApiModelProperty("最终专业1")
|
||||
@TableField("finaldata2")
|
||||
@Excel(name = "最终专业1")
|
||||
private String finaldata2;
|
||||
|
||||
/**
|
||||
* 最终年级
|
||||
*/
|
||||
@ApiModelProperty("最终年级")
|
||||
@TableField("finalmajor")
|
||||
@Excel(name = "最终年级")
|
||||
private String finalmajor;
|
||||
|
||||
/**
|
||||
* 保留字段
|
||||
*/
|
||||
@ApiModelProperty("保留字段")
|
||||
@TableField("finallabel")
|
||||
@Excel(name = "保留字段")
|
||||
private String finallabel;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -44,6 +44,9 @@ public interface SysDisMateMapper extends BaseMapper<SysDisMate> {
|
||||
*/
|
||||
int updateSysDisMate(SysDisMate sysDisMate);
|
||||
|
||||
// 新增:按学号更新子表
|
||||
int updateSysDisMateByStId(SysDisMate sysDisMate);
|
||||
|
||||
/**
|
||||
* 删除退伍复学材料
|
||||
*
|
||||
|
||||
@@ -44,6 +44,7 @@ public interface ISysDisMateService extends IService<SysDisMate> {
|
||||
*/
|
||||
int updateSysDisMate(SysDisMate sysDisMate);
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除退伍复学材料
|
||||
*
|
||||
|
||||
@@ -5,14 +5,20 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.srs.common.core.domain.AjaxResult;
|
||||
import com.srs.common.doman.dto.ProcessResultDto;
|
||||
import com.srs.common.doman.vo.TeacherVo;
|
||||
import com.srs.common.exception.ServiceException;
|
||||
import com.srs.common.utils.SecurityUtils;
|
||||
import com.srs.flowable.service.IFlowDefinitionService;
|
||||
import com.srs.routine.domain.SysDisMate;
|
||||
import com.srs.routine.mapper.RtEnlistmentReserveMapper;
|
||||
import com.srs.routine.mapper.RtStuLeaveApplicationMapper;
|
||||
import com.srs.routine.mapper.SysDisMateMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.engine.IdentityService;
|
||||
import org.flowable.engine.RuntimeService;
|
||||
@@ -26,6 +32,7 @@ import org.springframework.stereotype.Service;
|
||||
import com.srs.routine.mapper.SysDisBasicMapper;
|
||||
import com.srs.routine.domain.SysDisBasic;
|
||||
import com.srs.routine.service.ISysDisBasicService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 退伍复学申请Service业务层处理
|
||||
@@ -39,6 +46,9 @@ public class SysDisBasicServiceImpl extends ServiceImpl<SysDisBasicMapper,SysDis
|
||||
@Autowired
|
||||
private SysDisBasicMapper sysDisBasicMapper;
|
||||
|
||||
@Autowired
|
||||
private SysDisMateMapper sysDisMateMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询退伍复学申请
|
||||
@@ -108,6 +118,8 @@ public class SysDisBasicServiceImpl extends ServiceImpl<SysDisBasicMapper,SysDis
|
||||
return insertData;
|
||||
}
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(SysDisBasicServiceImpl.class);
|
||||
|
||||
/**
|
||||
* 修改退伍复学申请
|
||||
*
|
||||
@@ -115,13 +127,88 @@ public class SysDisBasicServiceImpl extends ServiceImpl<SysDisBasicMapper,SysDis
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class) // 事务保证原子性
|
||||
public int updateSysDisBasic(SysDisBasic sysDisBasic) {
|
||||
// ProcessResultDto processResultDto = startBasicProcess(sysDisBasic);
|
||||
// if (processResultDto != null){
|
||||
// sysDisBasic.setProcessId(processResultDto.getProcessInstanceId());
|
||||
// sysDisBasic.setDeployId(processResultDto.getDeploymentId());
|
||||
// }
|
||||
// return sysDisBasicMapper.updateSysDisBasic(sysDisBasic);
|
||||
// ========== 1. 原有主表更新逻辑(完全保留) ==========
|
||||
ProcessResultDto processResultDto = startBasicProcess(sysDisBasic);
|
||||
if (processResultDto != null){
|
||||
sysDisBasic.setProcessId(processResultDto.getProcessInstanceId());
|
||||
sysDisBasic.setDeployId(processResultDto.getDeploymentId());
|
||||
}
|
||||
return sysDisBasicMapper.updateSysDisBasic(sysDisBasic);
|
||||
int mainTableUpdateCount = sysDisBasicMapper.updateSysDisBasic(sysDisBasic);
|
||||
logger.info("主表更新完成,影响行数: {}", mainTableUpdateCount);
|
||||
|
||||
// ========== 2. 整合自定义子表更新逻辑(核心修复) ==========
|
||||
List<SysDisMate> maList = sysDisBasic.getMaList();
|
||||
logger.info("开始执行子表更新,maList大小: {}", maList != null ? maList.size() : 0);
|
||||
|
||||
if (maList != null && !maList.isEmpty()) {
|
||||
for (SysDisMate mate : maList) {
|
||||
logger.info("正在更新子表记录,子表ID: {}, finaldata1: {}", mate.getId(), mate.getFinaldata1());
|
||||
|
||||
int updateResult = 0;
|
||||
// 优先使用子表主键id更新(自定义SQL,避免update_time)
|
||||
if (mate.getId() != null) {
|
||||
LambdaUpdateWrapper<SysDisMate> updateWrapper = Wrappers.lambdaUpdate(SysDisMate.class);
|
||||
updateWrapper.eq(SysDisMate::getId, mate.getId())
|
||||
.set(mate.getStId() != null, SysDisMate::getStId, mate.getStId())
|
||||
.set(mate.getStName() != null, SysDisMate::getStName, mate.getStName())
|
||||
.set(mate.getCollege() != null, SysDisMate::getCollege, mate.getCollege())
|
||||
.set(mate.getOldgrade() != null, SysDisMate::getOldgrade, mate.getOldgrade())
|
||||
.set(mate.getOldmajor() != null, SysDisMate::getOldmajor, mate.getOldmajor())
|
||||
.set(mate.getNewgrade() != null, SysDisMate::getNewgrade, mate.getNewgrade())
|
||||
.set(mate.getNewmajor() != null, SysDisMate::getNewmajor, mate.getNewmajor())
|
||||
.set(mate.getFinaldata1() != null, SysDisMate::getFinaldata1, mate.getFinaldata1())
|
||||
.set(mate.getFinaldata2() != null, SysDisMate::getFinaldata2, mate.getFinaldata2())
|
||||
.set(mate.getFinalmajor() != null, SysDisMate::getFinalmajor, mate.getFinalmajor())
|
||||
.set(mate.getFinallabel() != null, SysDisMate::getFinallabel, mate.getFinallabel());
|
||||
|
||||
updateResult = sysDisMateMapper.update(null, updateWrapper);
|
||||
logger.info("通过子表ID自定义更新,影响行数: {}", updateResult);
|
||||
}
|
||||
// 兼容:无id时按st_id更新(同样自定义SQL)
|
||||
else if (mate.getStId() != null && !mate.getStId().isEmpty()) {
|
||||
LambdaUpdateWrapper<SysDisMate> updateWrapper = Wrappers.lambdaUpdate(SysDisMate.class);
|
||||
updateWrapper.eq(SysDisMate::getStId, mate.getStId())
|
||||
.set(mate.getStName() != null, SysDisMate::getStName, mate.getStName())
|
||||
.set(mate.getCollege() != null, SysDisMate::getCollege, mate.getCollege())
|
||||
.set(mate.getOldgrade() != null, SysDisMate::getOldgrade, mate.getOldgrade())
|
||||
.set(mate.getOldmajor() != null, SysDisMate::getOldmajor, mate.getOldmajor())
|
||||
.set(mate.getNewgrade() != null, SysDisMate::getNewgrade, mate.getNewgrade())
|
||||
.set(mate.getNewmajor() != null, SysDisMate::getNewmajor, mate.getNewmajor())
|
||||
.set(mate.getFinaldata1() != null, SysDisMate::getFinaldata1, mate.getFinaldata1())
|
||||
.set(mate.getFinaldata2() != null, SysDisMate::getFinaldata2, mate.getFinaldata2())
|
||||
.set(mate.getFinalmajor() != null, SysDisMate::getFinalmajor, mate.getFinalmajor())
|
||||
.set(mate.getFinallabel() != null, SysDisMate::getFinallabel, mate.getFinallabel());
|
||||
|
||||
updateResult = sysDisMateMapper.update(null, updateWrapper);
|
||||
logger.info("通过st_id自定义更新,影响行数: {}", updateResult);
|
||||
}
|
||||
// 无更新条件时提示
|
||||
else {
|
||||
logger.warn("子表记录缺少id和stId,无法更新");
|
||||
continue;
|
||||
}
|
||||
|
||||
// 校验更新结果,失败时打印错误日志
|
||||
if (updateResult <= 0) {
|
||||
logger.error("子表更新失败,子表ID: {}, stId: {}", mate.getId(), mate.getStId());
|
||||
// 可选:抛出异常让事务回滚(根据业务需求决定是否开启)
|
||||
// throw new RuntimeException("子表更新失败,影响行数为0");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
logger.warn("子表数据为空,跳过子表更新");
|
||||
}
|
||||
|
||||
// ========== 3. 原有返回值不变 ==========
|
||||
return mainTableUpdateCount;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -72,6 +72,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="material" column="material" />
|
||||
<result property="data1" column="data1" />
|
||||
<result property="data2" column="data2" />
|
||||
<result property="finaldata1" column="finaldata1" />
|
||||
<result property="finaldata2" column="finaldata2" />
|
||||
<result property="finalmajor" column="finalmajor" />
|
||||
<result property="finallabel" column="finallabel" />
|
||||
</resultMap>
|
||||
|
||||
<!--材料上传-->
|
||||
|
||||
@@ -19,10 +19,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="material" column="material" />
|
||||
<result property="data1" column="data1" />
|
||||
<result property="data2" column="data2" />
|
||||
<result property="finaldata1" column="finaldata1" />
|
||||
<result property="finaldata2" column="finaldata2" />
|
||||
<result property="finalmajor" column="finalmajor" />
|
||||
<result property="finallabel" column="finallabel" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysDisMateVo">
|
||||
select id, st_id, st_name, times, college, oldgrade, oldmajor, newgrade, newmajor, proof, idcard, material, data1, data2 from sys_dis_mate
|
||||
select id, st_id, st_name, times, college, oldgrade, oldmajor, newgrade, newmajor, proof, idcard, material, data1, data2, finaldata1, finaldata2, finalmajor, finallabel from sys_dis_mate
|
||||
</sql>
|
||||
|
||||
<select id="selectSysDisMateList" parameterType="SysDisMate" resultMap="SysDisMateResult">
|
||||
@@ -41,6 +45,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="material != null and material != ''"> and material = #{material}</if>
|
||||
<if test="data1 != null and data1 != ''"> and data1 = #{data1}</if>
|
||||
<if test="data2 != null and data2 != ''"> and data2 = #{data2}</if>
|
||||
<if test="finaldata1 != null and finaldata1 != ''"> and finaldata1 = #{finaldata1}</if>
|
||||
<if test="finaldata2 != null and finaldata2 != ''"> and finaldata2 = #{finaldata2}</if>
|
||||
<if test="finalmajor != null and finalmajor != ''"> and finalmajor = #{finalmajor}</if>
|
||||
<if test="finallabel != null and finallabel != ''"> and finallabel = #{finallabel}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -65,6 +73,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="material != null">material,</if>
|
||||
<if test="data1 != null">data1,</if>
|
||||
<if test="data2 != null">data2,</if>
|
||||
<if test="finaldata1 != null">finaldata1,</if>
|
||||
<if test="finaldata2 != null">finaldata2,</if>
|
||||
<if test="finalmajor != null">finalmajor,</if>
|
||||
<if test="finallabel != null">finallabel,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="stId != null">#{stId},</if>
|
||||
@@ -80,6 +92,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="material != null">#{material},</if>
|
||||
<if test="data1 != null">#{data1},</if>
|
||||
<if test="data2 != null">#{data2},</if>
|
||||
<if test="finaldata1 != null">#{finaldata1},</if>
|
||||
<if test="finaldata2 != null">#{finaldata2},</if>
|
||||
<if test="finalmajor != null">#{finalmajor},</if>
|
||||
<if test="finallabel != null">#{finallabel},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -99,10 +115,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="material != null">material = #{material},</if>
|
||||
<if test="data1 != null">data1 = #{data1},</if>
|
||||
<if test="data2 != null">data2 = #{data2},</if>
|
||||
<if test="finaldata1 != null">finaldata1 = #{finaldata1},</if>
|
||||
<if test="finaldata2 != null">finaldata2 = #{finaldata2},</if>
|
||||
<if test="finalmajor != null">finalmajor = #{finalmajor},</if>
|
||||
<if test="finallabel != null">finallabel = #{finallabel},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 新增:子表更新语句 -->
|
||||
<update id="updateSysDisMateByStId" parameterType="SysDisMate">
|
||||
update sys_dis_mate
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="stName != null">st_name = #{stName},</if>
|
||||
<if test="times != null">times = #{times},</if>
|
||||
<if test="college != null">college = #{college},</if>
|
||||
<if test="oldgrade != null">oldgrade = #{oldgrade},</if>
|
||||
<if test="oldmajor != null">oldmajor = #{oldmajor},</if>
|
||||
<if test="newgrade != null">newgrade = #{newgrade},</if>
|
||||
<if test="newmajor != null">newmajor = #{newmajor},</if>
|
||||
<if test="proof != null">proof = #{proof},</if>
|
||||
<if test="idcard != null">idcard = #{idcard},</if>
|
||||
<if test="material != null">material = #{material},</if>
|
||||
<if test="data1 != null">data1 = #{data1},</if>
|
||||
<if test="data2 != null">data2 = #{data2},</if>
|
||||
<!-- 核心:更新年级/班级相关字段 -->
|
||||
<if test="finaldata1 != null">finaldata1 = #{finaldata1},</if>
|
||||
<if test="finaldata2 != null">finaldata2 = #{finaldata2},</if>
|
||||
<if test="finalmajor != null">finalmajor = #{finalmajor},</if>
|
||||
<if test="finallabel != null">finallabel = #{finallabel},</if>
|
||||
</trim>
|
||||
where st_id = #{stId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysDisMateById" parameterType="Long">
|
||||
delete from sys_dis_mate where id = #{id}
|
||||
</delete>
|
||||
|
||||
Reference in New Issue
Block a user