入伍申请记录学院名称过滤
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;
|
||||
|
||||
/**
|
||||
* 入伍保留学籍申请表-审核记录
|
||||
*/
|
||||
|
||||
@@ -62,6 +62,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),补零为3位(001、002...999)
|
||||
int seq = yearTotal + 1;
|
||||
String seqStr = String.format("%03d", seq); // 不足3位补0,如1→001,10→010
|
||||
|
||||
// 4. 设置到实体对象中
|
||||
// 4. 拼接最终编号:BLXJ(年份)序号
|
||||
String reserveNo = "BLXJ(" + currentYear + ")" + seqStr;
|
||||
|
||||
// 5. 设置到实体对象中
|
||||
rtEnlistmentReserve.setReserveNo(reserveNo);
|
||||
|
||||
rtEnlistmentReserve.setCreateTime(DateUtils.getNowDate());
|
||||
|
||||
Reference in New Issue
Block a user