入伍保留学籍申请、保留学籍编号和时间格式修改
This commit is contained in:
@@ -50,6 +50,9 @@ public interface RtEnlistmentReserveMapper extends BaseMapper<RtEnlistmentReserv
|
|||||||
*/
|
*/
|
||||||
List<RtEnlistmentReserve> selectRtEnlistmentReserveList(RtEnlistmentReserve rtEnlistmentReserve);
|
List<RtEnlistmentReserve> selectRtEnlistmentReserveList(RtEnlistmentReserve rtEnlistmentReserve);
|
||||||
|
|
||||||
|
// 查询全部申请记录
|
||||||
|
List<RtEnlistmentReserve> getEnlistmentReserves();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增应征入伍保留学籍申请
|
* 新增应征入伍保留学籍申请
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.srs.routine.service.impl;
|
package com.srs.routine.service.impl;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -13,6 +15,7 @@ import com.srs.common.utils.SecurityUtils;
|
|||||||
import com.srs.dormitory.domain.DmsOutsideAccommodationApply;
|
import com.srs.dormitory.domain.DmsOutsideAccommodationApply;
|
||||||
import com.srs.dormitory.mapper.DmsOutsideAccommodationApplyMapper;
|
import com.srs.dormitory.mapper.DmsOutsideAccommodationApplyMapper;
|
||||||
import com.srs.flowable.service.IFlowDefinitionService;
|
import com.srs.flowable.service.IFlowDefinitionService;
|
||||||
|
import com.srs.routine.domain.RtEnlistmentReserveApproval;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import com.srs.routine.mapper.RtStuLeaveApplicationMapper;
|
import com.srs.routine.mapper.RtStuLeaveApplicationMapper;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@@ -100,6 +103,25 @@ public class RtEnlistmentReserveServiceImpl extends ServiceImpl<RtEnlistmentRese
|
|||||||
throw new ServiceException("您已经申请过了,请勿重新申请!", 400);
|
throw new ServiceException("您已经申请过了,请勿重新申请!", 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ========== 生成保留学籍编号 ==========
|
||||||
|
// 查询申请记录数量
|
||||||
|
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());
|
||||||
|
|
||||||
|
// 2. 计算自增序号(总数+1,确保新编号是下一个序号),补零为4位
|
||||||
|
int seq = total + 1;
|
||||||
|
String seqStr = String.format("%04d", seq); // 不足4位时前面补0,如1→0001,10→0010
|
||||||
|
|
||||||
|
// 3. 拼接保留学籍编号:LBXJ + 4位序号 + 8位日期
|
||||||
|
String reserveNo = "LBXJ" + seqStr + dateStr;
|
||||||
|
|
||||||
|
// 4. 设置到实体对象中
|
||||||
|
rtEnlistmentReserve.setReserveNo(reserveNo);
|
||||||
|
|
||||||
rtEnlistmentReserve.setCreateTime(DateUtils.getNowDate());
|
rtEnlistmentReserve.setCreateTime(DateUtils.getNowDate());
|
||||||
|
|
||||||
// 先插入申请表数据,获取自增 ID(数据库自动为 applyStatus 赋值 0 若未传值)
|
// 先插入申请表数据,获取自增 ID(数据库自动为 applyStatus 赋值 0 若未传值)
|
||||||
|
|||||||
@@ -182,6 +182,12 @@
|
|||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部申请记录 -->
|
||||||
|
<select id="getEnlistmentReserves" parameterType="RtEnlistmentReserve"
|
||||||
|
resultMap="RtEnlistmentReserveResult">
|
||||||
|
select * from rt_enlistment_reserve
|
||||||
|
</select>
|
||||||
|
|
||||||
<!-- 根据流程编号查询申请记录 -->
|
<!-- 根据流程编号查询申请记录 -->
|
||||||
<select id="selectRtEnlistmentReserveByProcessInstanceId" parameterType="String"
|
<select id="selectRtEnlistmentReserveByProcessInstanceId" parameterType="String"
|
||||||
resultMap="RtEnlistmentReserveResult">
|
resultMap="RtEnlistmentReserveResult">
|
||||||
|
|||||||
Reference in New Issue
Block a user