入伍申请-恢复被覆盖的代码
This commit is contained in:
@@ -216,6 +216,14 @@ private static final long serialVersionUID=1L;
|
||||
@Excel(name = "流程部署编号")
|
||||
private String deployId;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
@ApiModelProperty("学院名称")
|
||||
@TableField("dept_name")
|
||||
@Excel(name = "学院名称")
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 入伍保留学籍申请表-审核记录
|
||||
*/
|
||||
|
||||
@@ -31,6 +31,7 @@ public interface RtEnlistmentReserveMapper extends BaseMapper<RtEnlistmentReserv
|
||||
*/
|
||||
public RtEnlistmentReserve selectRtEnlistmentReserveByProcessInstanceId(String processInstanceId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询应征入伍保留学籍申请
|
||||
*
|
||||
@@ -62,6 +63,13 @@ public interface RtEnlistmentReserveMapper extends BaseMapper<RtEnlistmentReserv
|
||||
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
|
||||
int insertRtEnlistmentReserve(RtEnlistmentReserve rtEnlistmentReserve);
|
||||
|
||||
/**
|
||||
* Mapper接口方法:统计指定年份的保留学籍记录数
|
||||
* @param year 年份(如2026)
|
||||
* @return 该年份的记录总数
|
||||
*/
|
||||
int countByYear(@Param("year") String year);
|
||||
|
||||
/**
|
||||
* 修改应征入伍保留学籍申请
|
||||
*
|
||||
|
||||
@@ -114,22 +114,22 @@ public class RtEnlistmentReserveServiceImpl extends ServiceImpl<RtEnlistmentRese
|
||||
}
|
||||
|
||||
// ========== 生成保留学籍编号 ==========
|
||||
// 查询申请记录数量
|
||||
List<RtEnlistmentReserve> rtEnlistmentReserves = rtEnlistmentReserveMapper.getEnlistmentReserves();
|
||||
int total = rtEnlistmentReserves.size();
|
||||
// 设置保留学籍编号 (LBXJ0001(LBXJ是固定的,0001根据数据数量累加) + 时间(根据系统时间,但是格式要20260304))
|
||||
// 1. 获取当前系统时间,格式化为8位日期(yyyyMMdd)
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
||||
String dateStr = sdf.format(new Date());
|
||||
// 1. 获取当前系统年份(用于编号和序号重置判断)
|
||||
SimpleDateFormat yearSdf = new SimpleDateFormat("yyyy");
|
||||
String currentYear = yearSdf.format(new Date()); // 如2026
|
||||
|
||||
// 2. 计算自增序号(总数+1,确保新编号是下一个序号),补零为4位
|
||||
int seq = total + 1;
|
||||
String seqStr = String.format("%04d", seq); // 不足4位时前面补0,如1→0001,10→0010
|
||||
// 2. 查询「当前年份」的记录总数(按年份分组统计,实现每年序号重置)
|
||||
// 统计rt_enlistment_reserve表中,reserve_no以"BLXJ("+currentYear+")"开头的记录数
|
||||
int yearTotal = rtEnlistmentReserveMapper.countByYear(currentYear);
|
||||
|
||||
// 3. 拼接保留学籍编号:LBXJ + 4位序号 + 8位日期
|
||||
String reserveNo = "LBXJ" + seqStr + dateStr;
|
||||
// 3. 计算当年自增序号(总数+1),补零为4位(0001、0002...9999)
|
||||
int seq = yearTotal + 1;
|
||||
String seqStr = String.format("%04d", seq); // 不足4位补0,如1→0001,10→0010,100→0100
|
||||
|
||||
// 4. 设置到实体对象中
|
||||
// 4. 拼接最终编号:BLXJ(年份)序号
|
||||
String reserveNo = "BLXJ(" + currentYear + ")" + seqStr;
|
||||
|
||||
// 5. 设置到实体对象中
|
||||
rtEnlistmentReserve.setReserveNo(reserveNo);
|
||||
|
||||
rtEnlistmentReserve.setCreateTime(DateUtils.getNowDate());
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="affixId" column="affix_id"/>
|
||||
<result property="deployId" column="deploy_id" />
|
||||
<result property="deptName" column="dept_name"/>
|
||||
<!--入伍保留学籍申请表-审核记录 (多条件查询column里传入了多条件【{studentName = student_name, studentNo = student_no}】javaType里面写了list表明你有多条件 studentName student_name字段)-->
|
||||
<collection property="enlistmentReserveApprovalList"
|
||||
column="{studentName = student_name, studentNo = student_no}"
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="affixId" column="affix_id"/>
|
||||
<result property="deployId" column="deploy_id"/>
|
||||
<result property="deptName" column="dept_name" />
|
||||
<!--入伍保留学籍申请表-审核记录 (多条件查询column里传入了多条件【{studentName = student_name, studentNo = student_no}】javaType里面写了list表明你有多条件 studentName student_name字段)-->
|
||||
<collection property="enlistmentReserveApprovalList"
|
||||
column="{studentName = student_name, studentNo = student_no}"
|
||||
@@ -125,7 +126,8 @@
|
||||
create_time,
|
||||
update_time,
|
||||
affix_id,
|
||||
deploy_id
|
||||
deploy_id,
|
||||
dept_name
|
||||
from rt_enlistment_reserve
|
||||
</sql>
|
||||
|
||||
@@ -160,7 +162,9 @@
|
||||
<if test="approvalNo != null and approvalNo != ''">and approval_no = #{approvalNo}</if>
|
||||
<if test="affixId != null and affixId != ''">and affix_id = #{affixId}</if>
|
||||
<if test="deployId != null and deployId != ''">and deploy_id = #{deployId}</if>
|
||||
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
|
||||
</where>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<select id="selectRtEnlistmentReserveById" parameterType="Long" resultMap="RtEnlistmentReserveResult">
|
||||
@@ -188,6 +192,13 @@
|
||||
select * from rt_enlistment_reserve
|
||||
</select>
|
||||
|
||||
<!-- 匹配reserve_no以"BLXJ(年份)"开头的记录-->
|
||||
<select id="countByYear" resultType="int">
|
||||
SELECT COUNT(*)
|
||||
FROM rt_enlistment_reserve
|
||||
WHERE reserve_no LIKE CONCAT('BLXJ(', #{year}, ')%')
|
||||
</select>
|
||||
|
||||
<!-- 根据流程编号查询申请记录 -->
|
||||
<select id="selectRtEnlistmentReserveByProcessInstanceId" parameterType="String"
|
||||
resultMap="RtEnlistmentReserveResult">
|
||||
@@ -231,6 +242,7 @@
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="affixId != null">affix_id,</if>
|
||||
<if test="deployId != null">deploy_id,</if>
|
||||
<if test="deptName != null">dept_name,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="applyNo != null and applyNo != ''">#{applyNo},</if>
|
||||
@@ -256,6 +268,7 @@
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="affixId != null">#{affixId},</if>
|
||||
<if test="deployId != null">#{deployId},</if>
|
||||
<if test="deptName != null">#{deptName},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -285,6 +298,7 @@
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="affixId != null">affix_id = #{affixId},</if>
|
||||
<if test="deployId != null">deploy_id = #{deployId},</if>
|
||||
<if test="deptName != null">dept_name = #{deptName},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
Reference in New Issue
Block a user