From 6f783e6d70600e897716b70824a5f12bc649fde6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=81=92=E6=88=90?= <962704835@qq.com> Date: Mon, 16 Mar 2026 17:48:58 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E5=85=A5=E4=BC=8D=E4=BF=9D=E7=95=99?= =?UTF-8?q?=E5=AD=A6=E7=B1=8D=E7=94=B3=E8=AF=B7=E8=BE=85=E5=AF=BC=E5=91=98?= =?UTF-8?q?=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/RtEnlistmentReserveServiceImpl.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/srs-routine/src/main/java/com/srs/routine/service/impl/RtEnlistmentReserveServiceImpl.java b/srs-routine/src/main/java/com/srs/routine/service/impl/RtEnlistmentReserveServiceImpl.java index dd91db5..b4c19b6 100644 --- a/srs-routine/src/main/java/com/srs/routine/service/impl/RtEnlistmentReserveServiceImpl.java +++ b/srs-routine/src/main/java/com/srs/routine/service/impl/RtEnlistmentReserveServiceImpl.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.Map; import com.srs.common.core.domain.AjaxResult; +import com.srs.common.core.domain.entity.SysUser; import com.srs.common.doman.dto.ProcessResultDto; import com.srs.common.doman.vo.TeacherVo; import com.srs.common.exception.ServiceException; @@ -16,6 +17,7 @@ import com.srs.dormitory.domain.DmsOutsideAccommodationApply; import com.srs.dormitory.mapper.DmsOutsideAccommodationApplyMapper; import com.srs.flowable.service.IFlowDefinitionService; import com.srs.routine.domain.RtEnlistmentReserveApproval; +import com.srs.system.service.ISysUserService; import lombok.extern.slf4j.Slf4j; import com.srs.routine.mapper.RtStuLeaveApplicationMapper; import org.apache.commons.lang3.StringUtils; @@ -53,6 +55,9 @@ public class RtEnlistmentReserveServiceImpl extends ServiceImpl rtEnlistmentReserves = rtEnlistmentReserveMapper.getEnlistmentReserves(); @@ -139,7 +149,9 @@ public class RtEnlistmentReserveServiceImpl extends ServiceImpl Date: Tue, 17 Mar 2026 10:44:17 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E5=85=A5=E4=BC=8D=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=AD=A6=E9=99=A2=E5=90=8D=E7=A7=B0=E8=BF=87?= =?UTF-8?q?=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../routine/domain/RtEnlistmentReserve.java | 8 ++++++ .../mapper/RtEnlistmentReserveMapper.java | 7 +++++ .../impl/RtEnlistmentReserveServiceImpl.java | 26 +++++++++---------- .../RtEnlistmentReserveAttachMapper.xml | 1 + .../routine/RtEnlistmentReserveMapper.xml | 17 +++++++++++- 5 files changed, 45 insertions(+), 14 deletions(-) diff --git a/srs-routine/src/main/java/com/srs/routine/domain/RtEnlistmentReserve.java b/srs-routine/src/main/java/com/srs/routine/domain/RtEnlistmentReserve.java index 49e6ec0..8673cf6 100644 --- a/srs-routine/src/main/java/com/srs/routine/domain/RtEnlistmentReserve.java +++ b/srs-routine/src/main/java/com/srs/routine/domain/RtEnlistmentReserve.java @@ -216,6 +216,14 @@ private static final long serialVersionUID=1L; @Excel(name = "流程部署编号") private String deployId; + /** + * 学院名称 + */ + @ApiModelProperty("学院名称") + @TableField("dept_name") + @Excel(name = "学院名称") + private String deptName; + /** * 入伍保留学籍申请表-审核记录 */ diff --git a/srs-routine/src/main/java/com/srs/routine/mapper/RtEnlistmentReserveMapper.java b/srs-routine/src/main/java/com/srs/routine/mapper/RtEnlistmentReserveMapper.java index 129e91b..b310ab4 100644 --- a/srs-routine/src/main/java/com/srs/routine/mapper/RtEnlistmentReserveMapper.java +++ b/srs-routine/src/main/java/com/srs/routine/mapper/RtEnlistmentReserveMapper.java @@ -62,6 +62,13 @@ public interface RtEnlistmentReserveMapper extends BaseMapper 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()); diff --git a/srs-routine/src/main/resources/mapper/routine/RtEnlistmentReserveAttachMapper.xml b/srs-routine/src/main/resources/mapper/routine/RtEnlistmentReserveAttachMapper.xml index 370f133..d3c7898 100644 --- a/srs-routine/src/main/resources/mapper/routine/RtEnlistmentReserveAttachMapper.xml +++ b/srs-routine/src/main/resources/mapper/routine/RtEnlistmentReserveAttachMapper.xml @@ -46,6 +46,7 @@ + + @@ -160,7 +162,9 @@ and approval_no = #{approvalNo} and affix_id = #{affixId} and deploy_id = #{deployId} + and dept_name like concat('%', #{deptName}, '%') + order by id desc + + + + - - - - + + + + @@ -176,6 +206,40 @@ + + + + select id, From 6e13d84802ec92955dede5a341b45b5a27ef9242 Mon Sep 17 00:00:00 2001 From: LWH <2199719306@qq.com> Date: Thu, 19 Mar 2026 09:29:54 +0800 Subject: [PATCH 5/9] =?UTF-8?q?docs(teacher):=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=95=99=E5=B8=88KPI=E5=A1=AB=E5=86=99=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=99=A8=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在SysTeacherKpiFillingBonusPointsController中添加省略号注释 - 在SysTeacherKpiFillingGraduationGuidanceController中添加省略号注释 - 为查询详细信息方法补充文档注释 - 为导出就业指导工作列表方法补充文档注释 --- .../teacher/SysTeacherKpiFillingBonusPointsController.java | 1 + .../SysTeacherKpiFillingGraduationGuidanceController.java | 1 + 2 files changed, 2 insertions(+) diff --git a/srs-admin/src/main/java/com/srs/web/controller/teacher/SysTeacherKpiFillingBonusPointsController.java b/srs-admin/src/main/java/com/srs/web/controller/teacher/SysTeacherKpiFillingBonusPointsController.java index 01533b7..0152415 100644 --- a/srs-admin/src/main/java/com/srs/web/controller/teacher/SysTeacherKpiFillingBonusPointsController.java +++ b/srs-admin/src/main/java/com/srs/web/controller/teacher/SysTeacherKpiFillingBonusPointsController.java @@ -44,6 +44,7 @@ public class SysTeacherKpiFillingBonusPointsController extends BaseController { } /** + * …… * 根据辅导员名称、年份 月份 查询详细信息 */ // @PreAuthorize("@ss.hasPermi('teacher:kpiFillingBonusPoints:list')") diff --git a/srs-admin/src/main/java/com/srs/web/controller/teacher/SysTeacherKpiFillingGraduationGuidanceController.java b/srs-admin/src/main/java/com/srs/web/controller/teacher/SysTeacherKpiFillingGraduationGuidanceController.java index 419d5a9..2c0baea 100644 --- a/srs-admin/src/main/java/com/srs/web/controller/teacher/SysTeacherKpiFillingGraduationGuidanceController.java +++ b/srs-admin/src/main/java/com/srs/web/controller/teacher/SysTeacherKpiFillingGraduationGuidanceController.java @@ -56,6 +56,7 @@ public class SysTeacherKpiFillingGraduationGuidanceController extends BaseContro } /** + * …… * 导出业绩考核-个人填报-就业指导工作列表 */ // @PreAuthorize("@ss.hasPermi('teacher:kpiFillingGraduationGuidance:export')") From 1e359df1b2b7cc5f756a0f8fe854e925bc9f1bc9 Mon Sep 17 00:00:00 2001 From: LWH <2199719306@qq.com> Date: Thu, 19 Mar 2026 11:36:38 +0800 Subject: [PATCH 6/9] =?UTF-8?q?docs(teacher):=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=95=99=E5=B8=88KPI=E5=A1=AB=E5=86=99=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=99=A8=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在SysTeacherKpiFillingBonusPointsController中添加省略号注释 - 在SysTeacherKpiFillingGraduationGuidanceController中添加省略号注释 - 为查询详细信息方法补充文档注释 - 为导出就业指导工作列表方法补充文档注释 --- ...tStuDisciplinaryApplicationController.java | 2 +- .../RtStuDisciplinaryRelieveController.java | 18 +++++ .../IRtStuDisciplinaryRelieveService.java | 8 ++ ...StuDisciplinaryApplicationServiceImpl.java | 15 +++- .../RtStuDisciplinaryRelieveServiceImpl.java | 73 +++++++++++++++++-- 5 files changed, 108 insertions(+), 8 deletions(-) diff --git a/srs-admin/src/main/java/com/srs/web/controller/routine/RtStuDisciplinaryApplicationController.java b/srs-admin/src/main/java/com/srs/web/controller/routine/RtStuDisciplinaryApplicationController.java index 1b5e4ab..df5c797 100644 --- a/srs-admin/src/main/java/com/srs/web/controller/routine/RtStuDisciplinaryApplicationController.java +++ b/srs-admin/src/main/java/com/srs/web/controller/routine/RtStuDisciplinaryApplicationController.java @@ -159,7 +159,7 @@ public class RtStuDisciplinaryApplicationController extends BaseController { } @Log(title = "学生处分申请", businessType = BusinessType.IMPORT) -// @PreAuthorize("@ss.hasPermi('routine:disciplinaryApplication:import')") + @PreAuthorize("@ss.hasPermi('routine:disciplinaryApplication:import')") @PostMapping("/importData") @ApiOperation("导入学生处分申请") public AjaxResult importData(org.springframework.web.multipart.MultipartFile file, boolean updateSupport) throws Exception { diff --git a/srs-admin/src/main/java/com/srs/web/controller/routine/RtStuDisciplinaryRelieveController.java b/srs-admin/src/main/java/com/srs/web/controller/routine/RtStuDisciplinaryRelieveController.java index bf7090d..0e1dd32 100644 --- a/srs-admin/src/main/java/com/srs/web/controller/routine/RtStuDisciplinaryRelieveController.java +++ b/srs-admin/src/main/java/com/srs/web/controller/routine/RtStuDisciplinaryRelieveController.java @@ -121,6 +121,24 @@ public class RtStuDisciplinaryRelieveController extends BaseController { util.exportExcel(response, list, "学生解除处分申请数据"); } + @PostMapping("/importTemplate") + @ApiOperation("下载学生解除处分导入模板") + public void importTemplate(HttpServletResponse response) { + ExcelUtil util = new ExcelUtil(RtStuDisciplinaryRelieve.class); + util.importTemplateExcel(response, "学生解除处分申请数据导入"); + } + + @Log(title = "学生解除处分申请", businessType = BusinessType.IMPORT) + @PreAuthorize("@ss.hasPermi('routine:relieve:import')") + @PostMapping("/importData") + @ApiOperation("导入学生解除处分申请") + public AjaxResult importData(org.springframework.web.multipart.MultipartFile file, boolean updateSupport) throws Exception { + ExcelUtil util = new ExcelUtil(RtStuDisciplinaryRelieve.class); + List list = util.importExcel(file.getInputStream()); + String message = rtStuDisciplinaryRelieveService.importDisciplinaryRelieve(list, updateSupport); + return success(message); + } + /** * 获取学生解除处分申请详细信息 */ diff --git a/srs-routine/src/main/java/com/srs/routine/service/IRtStuDisciplinaryRelieveService.java b/srs-routine/src/main/java/com/srs/routine/service/IRtStuDisciplinaryRelieveService.java index 2575551..5ee879b 100644 --- a/srs-routine/src/main/java/com/srs/routine/service/IRtStuDisciplinaryRelieveService.java +++ b/srs-routine/src/main/java/com/srs/routine/service/IRtStuDisciplinaryRelieveService.java @@ -95,4 +95,12 @@ public interface IRtStuDisciplinaryRelieveService extends IService selectRtStuDisciplinaryRelieveListByXW(RtStuDisciplinaryRelieve rtStuDisciplinaryRelieve); + + /** + * 导入解除处分数据 + * @param list 解除处分数据列表 + * @param updateSupport 是否更新已经存在的数据 + * @return 导入结果信息 + */ + String importDisciplinaryRelieve(List list, boolean updateSupport); } diff --git a/srs-routine/src/main/java/com/srs/routine/service/impl/RtStuDisciplinaryApplicationServiceImpl.java b/srs-routine/src/main/java/com/srs/routine/service/impl/RtStuDisciplinaryApplicationServiceImpl.java index 379cadf..40ef311 100644 --- a/srs-routine/src/main/java/com/srs/routine/service/impl/RtStuDisciplinaryApplicationServiceImpl.java +++ b/srs-routine/src/main/java/com/srs/routine/service/impl/RtStuDisciplinaryApplicationServiceImpl.java @@ -21,7 +21,7 @@ import org.flowable.task.api.Task; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; - +import com.srs.common.utils.StringUtils; import java.util.*; /** @@ -209,7 +209,18 @@ public class RtStuDisciplinaryApplicationServiceImpl extends ServiceImpl list, boolean updateSupport) { + if (com.srs.common.utils.StringUtils.isNull(list) || list.size() == 0) { + throw new ServiceException("导入数据不能为空!"); + } + int successNum = 0; + int failureNum = 0; + StringBuilder successMsg = new StringBuilder(); + StringBuilder failureMsg = new StringBuilder(); + + for (int i = 0; i < list.size(); i++) { + RtStuDisciplinaryRelieve rtStuDisciplinaryRelieve = list.get(i); + // 跳过 null 元素 + if (rtStuDisciplinaryRelieve == null) { + continue; + } + + // 跳过必填字段为空的行(学号为空则跳过) + if (StringUtils.isEmpty(rtStuDisciplinaryRelieve.getStuNo())) { + continue; + } + + try { + if (com.srs.common.utils.StringUtils.isNotNull(rtStuDisciplinaryRelieve.getStuNo())) { + SysUser sysUser = sysUserMapper.selectUserByUserName(rtStuDisciplinaryRelieve.getStuNo()); + if (sysUser != null) { + rtStuDisciplinaryRelieve.setStuId(sysUser.getUserId()); + rtStuDisciplinaryRelieve.setStuName(sysUser.getNickName()); + } + } + + rtStuDisciplinaryRelieve.setCreateBy(SecurityUtils.getUsername()); + rtStuDisciplinaryRelieve.setCreateTime(DateUtils.getNowDate()); + rtStuDisciplinaryRelieve.setApplicantName(SecurityUtils.getLoginUser().getUser().getNickName()); + + if (rtStuDisciplinaryRelieve.getSubmissionStatus() == null) { + rtStuDisciplinaryRelieve.setSubmissionStatus(0L); + } + + if (rtStuDisciplinaryRelieve.getPenaltyStatus() == null) { + rtStuDisciplinaryRelieve.setPenaltyStatus(1L); + } + + rtStuDisciplinaryRelieveMapper.insertRtStuDisciplinaryRelieve(rtStuDisciplinaryRelieve); + successNum++; + successMsg.append("
" + successNum + "、学号 " + rtStuDisciplinaryRelieve.getStuNo() + " 导入成功"); + } catch (Exception e) { + failureNum++; + String msg = "
" + failureNum + "、学号 " + rtStuDisciplinaryRelieve.getStuNo() + " 导入失败:"; + failureMsg.append(msg + e.getMessage()); + } + } + + if (failureNum > 0) { + failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:"); + throw new ServiceException(failureMsg.toString()); + } else { + successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:"); + } + return successMsg.toString(); + } + } From 21e967a72e09238082cf5500b83f5c4b47558c1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9F=A6=E4=B8=9C=E6=81=92?= <1747763533@qq.com> Date: Thu, 19 Mar 2026 15:48:00 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E9=80=80=E4=BC=8D=E5=A4=8D=E5=AD=A6-?= =?UTF-8?q?=E4=BC=81=E4=B8=9A=E6=B6=88=E6=81=AF=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../routine/SysDisBasicController.java | 4 +- .../listener/disbasic/DiscListener.java | 98 ++++++++++++++++++- .../srs/routine/domain/dto/SysDisMateDao.java | 32 +----- .../service/impl/SysDisMateServiceImpl.java | 5 + .../mapper/routine/SysDisMateMapper.xml | 4 +- 5 files changed, 106 insertions(+), 37 deletions(-) diff --git a/srs-admin/src/main/java/com/srs/web/controller/routine/SysDisBasicController.java b/srs-admin/src/main/java/com/srs/web/controller/routine/SysDisBasicController.java index 24d05a7..2be457e 100644 --- a/srs-admin/src/main/java/com/srs/web/controller/routine/SysDisBasicController.java +++ b/srs-admin/src/main/java/com/srs/web/controller/routine/SysDisBasicController.java @@ -104,8 +104,8 @@ public class SysDisBasicController extends BaseController { for (SysDisMate mate : item.getMaList()){ dao1.setOldgrade(mate.getOldgrade()); dao1.setOldmajor(mate.getOldmajor()); - dao1.setNewgrade(mate.getNewgrade()); - dao1.setNewmajor(mate.getNewmajor()); +// dao1.setNewgrade(mate.getNewgrade()); +// dao1.setNewmajor(mate.getNewmajor()); dao1.setProof(baseUrl.substring(0,baseUrl.length()-1) + mate.getProof()); dao1.setIdcard(baseUrl.substring(0,baseUrl.length()-1) + mate.getIdcard()); dao1.setMaterial(baseUrl.substring(0,baseUrl.length()-1) + mate.getMaterial()); diff --git a/srs-flowable/src/main/java/com/srs/flowable/listener/disbasic/DiscListener.java b/srs-flowable/src/main/java/com/srs/flowable/listener/disbasic/DiscListener.java index 73e2be3..499c03f 100644 --- a/srs-flowable/src/main/java/com/srs/flowable/listener/disbasic/DiscListener.java +++ b/srs-flowable/src/main/java/com/srs/flowable/listener/disbasic/DiscListener.java @@ -3,10 +3,15 @@ package com.srs.flowable.listener.disbasic; import com.srs.common.core.domain.entity.SysUser; import com.srs.common.doman.vo.TeacherVo; +import com.srs.common.utils.DateUtils; +import com.srs.common.utils.SecurityUtils; +import com.srs.common.utils.WeChatUtil; import com.srs.common.utils.spring.SpringUtils; import com.srs.flowable.domain.DisBasic; +import com.srs.flowable.domain.NotificationManage; import com.srs.flowable.mapper.DisBasicMapper; import com.srs.flowable.mapper.EnlistmentReserveMapper; +import com.srs.flowable.mapper.LeaveMapper; import com.srs.system.service.ISysUserService; import org.flowable.bpmn.model.BpmnModel; import org.flowable.bpmn.model.FlowNode; @@ -76,6 +81,8 @@ public class DiscListener implements ExecutionListener { execution.setVariable("approval", nextAssigneeId); execution.setVariable("currentNode", currentNodeName); } + // ========== 发送通知逻辑 ========== + sendApprovalNotification(execution, currentNodeName, nextAssigneeId, stId); } /** @@ -188,9 +195,6 @@ public class DiscListener implements ExecutionListener { // 暂时选择学籍管理科第一个人作为审核人 return shenDataInfo.get(0).getUserId(); - - - case "教务处主管": // 最后一个节点通过后 → 流程结束(无需设置负责人) List teacherVos = sysDisBasicMapper.getShenDataInfo("教务处主管领导"); @@ -207,4 +211,92 @@ public class DiscListener implements ExecutionListener { } } + /** + * 发送审批通知(系统通知+企业微信通知) + * 适配DisBasic(退伍复学)业务场景 + */ + private void sendApprovalNotification(DelegateExecution execution, String currentNodeName, + Long nextAssigneeId, Long basicId) { + try { + // 1. 获取需要的Mapper和工具类(通过SpringUtils获取,避免Autowired循环依赖) + LeaveMapper leaveMapper = (LeaveMapper) SpringUtils.getBean("leaveMapper"); + WeChatUtil weChatUtil = SpringUtils.getBean(WeChatUtil.class); + + // 2. 查询退伍复学申请详情 + DisBasicMapper disBasicMapper = (DisBasicMapper) SpringUtils.getBean(DisBasicMapper.class); + DisBasic disBasic = disBasicMapper.selectSysDisBasicById(basicId); + if (disBasic == null) { + log.warn("未找到退伍复学申请记录,basicId:{}", basicId); + return; + } + + // 3. 查询下一个审批人的信息 + SysUser nextApprover = sysUserService.selectUserById(nextAssigneeId); + if (nextApprover == null) { + log.warn("未找到审批人信息,用户ID:{}", nextAssigneeId); + return; + } + String approverUserName = nextApprover.getUserName(); // 审批人工号/用户名 + String approverName = nextApprover.getNickName(); // 审批人姓名 + + log.info("开始发送【退伍复学审批】通知,审批节点:{},审批人:{}({}),申请ID:{}", + currentNodeName, approverName, approverUserName, basicId); + + // 4. 处理系统通知(先删后加,避免重复通知) + NotificationManage notificationManage = new NotificationManage(); + notificationManage.setContent(String.format("您有一条【退伍复学审批】待处理(节点:%s)", currentNodeName)); + notificationManage.setReceiver(nextAssigneeId); // 接收人:下一个审批人 + + // 4.1 查询是否已有相同通知,有则删除 + NotificationManage existNotify = leaveMapper.selectCphMsgListForFlowable(notificationManage); + if (existNotify != null) { + int delRes = leaveMapper.deleteCphMsgById(existNotify.getId()); + log.info("删除重复的系统通知,通知ID:{},删除结果:{}", existNotify.getId(), delRes); + } + + // 4.2 添加新的系统通知 + notificationManage.setSender(SecurityUtils.getUserId()); // 发送人:当前操作人 + notificationManage.setCreateTime(DateUtils.getNowDate()); // 创建时间 + int addRes = leaveMapper.insertCphMsg(notificationManage); + log.info("新增系统通知成功,接收人ID:{},添加结果:{}", nextAssigneeId, addRes); + + // 5. 企业微信推送消息(带超链接) + if (approverUserName != null && !approverUserName.isEmpty()) { + String weChatContent = String.format( + "您有一条【退伍复学审批】待处理(节点:%s),请点击前往处理", + currentNodeName + ); + weChatUtil.sendTextMessage(approverUserName, weChatContent); + log.info("企业微信通知发送成功,接收人工号:{},节点:{},申请ID:{}", approverUserName, currentNodeName, basicId); + } else { + log.warn("审批人工号为空,无法发送企业微信通知,用户ID:{},申请ID:{}", nextAssigneeId, basicId); + } + + // 6. 删除当前审批人的待处理通知(清理已处理的待办) + Long currentApproverId = SecurityUtils.getUserId(); + if (currentApproverId == null) { + log.warn("当前审批人ID为空,无法删除其待处理通知,申请ID:{}", basicId); + return; + } + + NotificationManage currentNotifyQuery = new NotificationManage(); + currentNotifyQuery.setContent(String.format("您有一条【退伍复学审批】待处理(节点:%s)", currentNodeName)); + currentNotifyQuery.setReceiver(currentApproverId); + + NotificationManage currentExistNotify = leaveMapper.selectCphMsgListForFlowable(currentNotifyQuery); + if (currentExistNotify != null) { + int currentDelRes = leaveMapper.deleteCphMsgById(currentExistNotify.getId()); + log.info("删除当前审批人({})的【{}】待处理通知,通知ID:{},删除结果:{},申请ID:{}", + currentApproverId, currentNodeName, currentExistNotify.getId(), currentDelRes, basicId); + } else { + log.info("当前审批人({})无【{}】节点的待处理通知,无需删除,申请ID:{}", currentApproverId, currentNodeName, basicId); + } + + } catch (Exception e) { + // 捕获所有异常,仅记录日志,不影响主流程 + log.error("发送退伍复学审批通知失败,节点:{},审批人ID:{},申请ID:{},错误信息:{}", + currentNodeName, nextAssigneeId, basicId, e.getMessage(), e); + } + } + } \ No newline at end of file diff --git a/srs-routine/src/main/java/com/srs/routine/domain/dto/SysDisMateDao.java b/srs-routine/src/main/java/com/srs/routine/domain/dto/SysDisMateDao.java index 5e95791..5810b09 100644 --- a/srs-routine/src/main/java/com/srs/routine/domain/dto/SysDisMateDao.java +++ b/srs-routine/src/main/java/com/srs/routine/domain/dto/SysDisMateDao.java @@ -70,20 +70,6 @@ public class SysDisMateDao { @Excel(name = "原专业") private String oldmajor; - /** - * 新年级 - */ - @ApiModelProperty("新年级") - @Excel(name = "新年级") - private String newgrade; - - /** - * 新专业 - */ - @ApiModelProperty("新专业") - @Excel(name = "新专业") - private String newmajor; - /** * 退役证明 */ @@ -104,22 +90,8 @@ public class SysDisMateDao { @ApiModelProperty("材料") @Excel(name = "材料") private String material; -// -// /** -// * 保留字段1 -// */ -// @ApiModelProperty("保留字段1") -// @TableField("data1") -// @Excel(name = "保留字段1") -// private String data1; -// -// /** -// * 保留字段2 -// */ -// @ApiModelProperty("保留字段2") -// @TableField("data2") -// @Excel(name = "保留字段2") -// private String data2; + + } diff --git a/srs-routine/src/main/java/com/srs/routine/service/impl/SysDisMateServiceImpl.java b/srs-routine/src/main/java/com/srs/routine/service/impl/SysDisMateServiceImpl.java index 4311aba..f86bfeb 100644 --- a/srs-routine/src/main/java/com/srs/routine/service/impl/SysDisMateServiceImpl.java +++ b/srs-routine/src/main/java/com/srs/routine/service/impl/SysDisMateServiceImpl.java @@ -1,6 +1,8 @@ package com.srs.routine.service.impl; import java.util.List; + +import com.srs.routine.domain.dto.SysDisMateDao; import org.springframework.beans.factory.annotation.Autowired; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; @@ -8,6 +10,8 @@ import com.srs.routine.mapper.SysDisMateMapper; import com.srs.routine.domain.SysDisMate; import com.srs.routine.service.ISysDisMateService; +import javax.servlet.http.HttpServletResponse; + /** * 退伍复学材料Service业务层处理 * @@ -84,4 +88,5 @@ public class SysDisMateServiceImpl extends ServiceImpl and finallabel = #{finallabel} - + - + insert into sys_dis_mate From ae92e4372b236d21ad9f4d00ba5708242b0759cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=81=92=E6=88=90?= <962704835@qq.com> Date: Thu, 19 Mar 2026 16:40:29 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E5=85=A5=E4=BC=8D=E4=BF=9D=E7=95=99?= =?UTF-8?q?=E5=AD=A6=E7=B1=8D=E7=94=B3=E8=AF=B7=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- srs-admin/pom.xml | 2 +- .../RtEnlistmentReserveController.java | 70 +++++++++- .../dto/RtEnlistmentReserveExportDto.java | 130 ++++++++++++++++++ 3 files changed, 198 insertions(+), 4 deletions(-) create mode 100644 srs-routine/src/main/java/com/srs/routine/domain/dto/RtEnlistmentReserveExportDto.java diff --git a/srs-admin/pom.xml b/srs-admin/pom.xml index c4722a1..814b6ce 100644 --- a/srs-admin/pom.xml +++ b/srs-admin/pom.xml @@ -215,7 +215,7 @@ false ${project.artifactId} - org.apache.maven.pluginsmaven-compiler-plugin88 + org.apache.maven.pluginsmaven-compiler-plugin1414 ${project.artifactId} diff --git a/srs-admin/src/main/java/com/srs/web/controller/routine/RtEnlistmentReserveController.java b/srs-admin/src/main/java/com/srs/web/controller/routine/RtEnlistmentReserveController.java index 669acb8..780b47b 100644 --- a/srs-admin/src/main/java/com/srs/web/controller/routine/RtEnlistmentReserveController.java +++ b/srs-admin/src/main/java/com/srs/web/controller/routine/RtEnlistmentReserveController.java @@ -1,9 +1,11 @@ package com.srs.web.controller.routine; import java.util.List; +import java.util.stream.Collectors; import javax.servlet.http.HttpServletResponse; import com.srs.dormitory.domain.DmsOutsideAccommodationApply; +import com.srs.routine.domain.dto.RtEnlistmentReserveExportDto; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -56,10 +58,72 @@ public class RtEnlistmentReserveController extends BaseController { @PostMapping("/export") @ApiOperation("导出应征入伍保留学籍申请列表") public void export(HttpServletResponse response, RtEnlistmentReserve rtEnlistmentReserve) { - List list = rtEnlistmentReserveService.selectRtEnlistmentReserveList(rtEnlistmentReserve); - ExcelUtil util = new ExcelUtil(RtEnlistmentReserve.class); - util.exportExcel(response, list, "应征入伍保留学籍申请数据"); + // 1. 查询原始数据列表 + List originalList = rtEnlistmentReserveService.selectRtEnlistmentReserveList(rtEnlistmentReserve); + + // 2. 转换为导出DTO + 中文值转换 + List exportList = originalList.stream() + .map(this::convertToExportDto) + .collect(Collectors.toList()); + + // 3. 导出Excel(使用DTO的@Excel注解配置中文表头) + ExcelUtil util = new ExcelUtil<>(RtEnlistmentReserveExportDto.class); + util.exportExcel(response, exportList, "应征入伍保留学籍申请数据"); } + /** + * 原始实体转换为导出DTO,并处理值的中文转换 + */ + private RtEnlistmentReserveExportDto convertToExportDto(RtEnlistmentReserve source) { + RtEnlistmentReserveExportDto dto = new RtEnlistmentReserveExportDto(); + + // 1. 基础字段赋值(一一映射) + dto.setApplyNo(source.getApplyNo()); + dto.setTeacherName(source.getTeacherName()); + dto.setStudentName(source.getStudentName()); + dto.setNation(source.getNation()); + dto.setGrade(source.getGrade()); + dto.setStudentNo(source.getStudentNo()); + dto.setClassName(source.getClassName()); + dto.setMajor(source.getMajor()); + dto.setFamilyAddress(source.getFamilyAddress()); + dto.setParentPhone(source.getParentPhone()); + dto.setApplyReason(source.getApplyReason()); + dto.setReserveNo(source.getReserveNo()); + dto.setReserveStartDate(source.getReserveStartDate()); + dto.setReserveEndDate(source.getReserveEndDate()); +// dto.setApprovalNo(source.getApprovalNo()); + + // 2. 核心:0/1等值转换为中文 + // 性别转换(1-男 0-女) + if (source.getGender() != null) { + dto.setGender("1".equals(source.getGender()) ? "男" : "0".equals(source.getGender()) ? "女" : source.getGender()); + } + + // 申请状态转换(0-草稿,1=待辅导员审批...7=驳回) + if (source.getApplyStatus() != null) { + dto.setApplyStatus(convertApplyStatus(source.getApplyStatus())); + } + + return dto; + } + + /** + * 申请状态值转换为中文描述(适配String类型) + */ + private String convertApplyStatus(Long status) { + return switch (status.intValue()) { + case 0 -> "草稿"; + case 1 -> "待辅导员审批"; + case 2 -> "待学务审批"; + case 3 -> "待二级学院审批"; + case 4 -> "待学籍管理科审批"; + case 5 -> "待教务处主管领导审批"; + case 6 -> "审批通过"; + case 7 -> "驳回"; + default -> status.toString(); + }; + } + /** * 获取应征入伍保留学籍申请详细信息 diff --git a/srs-routine/src/main/java/com/srs/routine/domain/dto/RtEnlistmentReserveExportDto.java b/srs-routine/src/main/java/com/srs/routine/domain/dto/RtEnlistmentReserveExportDto.java new file mode 100644 index 0000000..8b75a8f --- /dev/null +++ b/srs-routine/src/main/java/com/srs/routine/domain/dto/RtEnlistmentReserveExportDto.java @@ -0,0 +1,130 @@ +package com.srs.routine.domain.dto; + + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.srs.common.annotation.Excel; +import lombok.Data; + + +import java.util.Date; + + +// 入伍申请导出专用DTO,只包含需要导出的字段 +@Data +public class RtEnlistmentReserveExportDto { + + /** + * 申请编号(规则:RY+年份+6位序号,如RY2024000001) + */ + @Excel(name = "申请编号") + private String applyNo; + + + /** + * 辅导员姓名 + */ + @Excel(name = "辅导员姓名") + private String teacherName; + + /** + * 姓名 + */ + @Excel(name = "学生姓名") + private String studentName; + + /** + * 性别(0-男 + */ + @Excel(name = "性别") + private String gender; + + /** + * 民族 + */ + @Excel(name = "民族") + private String nation; + + /** + * 年级 + */ + @Excel(name = "年级") + private String grade; + + /** + * 学号 + */ + @Excel(name = "学号") + private String studentNo; + + /** + * 班级 + */ + @Excel(name = "班级") + private String className; + + /** + * 专业名称 + */ + @Excel(name = "专业名称") + private String major; + + /** + * 家庭地址 + */ + @Excel(name = "家庭地址") + private String familyAddress; + + /** + * 家长联系电话 + */ + @Excel(name = "家长联系电话") + private String parentPhone; + + /** + * 申请理由(含入伍时间、服役期限) + */ + @Excel(name = "申请理由") + private String applyReason; + + /** + * 申请状态(0-草稿,1=待辅导员审批,2=待学务审批,3=待二级学院审批,4=待学籍管理科审批,5=待教务处主管领导审批,6=审批通过,7=驳回) + */ + @Excel(name = "申请状态") + private String applyStatus; + + /** + * 保留学籍编号(审批通过后生成) + */ + @Excel(name = "保留学籍编号") + private String reserveNo; + + /** + * 保留学籍开始日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "保留学籍开始日期" , width = 30, dateFormat = "yyyy-MM-dd") + private Date reserveStartDate; + + /** + * 保留学籍结束日期(入伍时间+服役期限) + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "保留学籍结束日期" , width = 30, dateFormat = "yyyy-MM-dd") + private Date reserveEndDate; + +// /** +// * 批文号 +// */ +// @Excel(name = "批文号") +// private String approvalNo; + +// @JsonFormat(pattern = "yyyy-MM-dd") +// private Date createTime; +// +// @JsonFormat(pattern = "yyyy-MM-dd") +// private Date updateTime; + + + +} + From b4b2dd078ac6aa6093e1b450e617c523bb1543fb Mon Sep 17 00:00:00 2001 From: "962704835@qq.com" Date: Thu, 19 Mar 2026 19:41:53 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E5=85=A5=E4=BC=8D=E7=94=B3=E8=AF=B7-?= =?UTF-8?q?=E6=81=A2=E5=A4=8D=E8=A2=AB=E8=A6=86=E7=9B=96=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../routine/domain/RtEnlistmentReserve.java | 8 ++++++ .../mapper/RtEnlistmentReserveMapper.java | 8 ++++++ .../impl/RtEnlistmentReserveServiceImpl.java | 26 +++++++++---------- .../RtEnlistmentReserveAttachMapper.xml | 1 + .../routine/RtEnlistmentReserveMapper.xml | 16 +++++++++++- 5 files changed, 45 insertions(+), 14 deletions(-) diff --git a/srs-routine/src/main/java/com/srs/routine/domain/RtEnlistmentReserve.java b/srs-routine/src/main/java/com/srs/routine/domain/RtEnlistmentReserve.java index 49e6ec0..8673cf6 100644 --- a/srs-routine/src/main/java/com/srs/routine/domain/RtEnlistmentReserve.java +++ b/srs-routine/src/main/java/com/srs/routine/domain/RtEnlistmentReserve.java @@ -216,6 +216,14 @@ private static final long serialVersionUID=1L; @Excel(name = "流程部署编号") private String deployId; + /** + * 学院名称 + */ + @ApiModelProperty("学院名称") + @TableField("dept_name") + @Excel(name = "学院名称") + private String deptName; + /** * 入伍保留学籍申请表-审核记录 */ diff --git a/srs-routine/src/main/java/com/srs/routine/mapper/RtEnlistmentReserveMapper.java b/srs-routine/src/main/java/com/srs/routine/mapper/RtEnlistmentReserveMapper.java index 129e91b..bc8e630 100644 --- a/srs-routine/src/main/java/com/srs/routine/mapper/RtEnlistmentReserveMapper.java +++ b/srs-routine/src/main/java/com/srs/routine/mapper/RtEnlistmentReserveMapper.java @@ -31,6 +31,7 @@ public interface RtEnlistmentReserveMapper extends BaseMapper 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()); diff --git a/srs-routine/src/main/resources/mapper/routine/RtEnlistmentReserveAttachMapper.xml b/srs-routine/src/main/resources/mapper/routine/RtEnlistmentReserveAttachMapper.xml index 370f133..e342bb2 100644 --- a/srs-routine/src/main/resources/mapper/routine/RtEnlistmentReserveAttachMapper.xml +++ b/srs-routine/src/main/resources/mapper/routine/RtEnlistmentReserveAttachMapper.xml @@ -46,6 +46,7 @@ + + @@ -160,7 +162,9 @@ and approval_no = #{approvalNo} and affix_id = #{affixId} and deploy_id = #{deployId} + and dept_name like concat('%', #{deptName}, '%') + order by id desc + + +