From aa3246d2cccf7d1e0881cbefca7fdfba4ecf1d3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=81=92=E6=88=90?= <962704835@qq.com> Date: Fri, 7 Nov 2025 12:20:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=94=E5=BE=81=E5=85=A5=E4=BC=8D=E4=BF=9D?= =?UTF-8?q?=E7=95=99=E5=AD=A6=E7=B1=8D=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../routine/domain/RtEnlistmentReserve.java | 12 +- .../impl/RtEnlistmentReserveServiceImpl.java | 103 +++++++++++++++++- 2 files changed, 111 insertions(+), 4 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 7a51595..168780c 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 @@ -133,9 +133,9 @@ private static final long serialVersionUID=1L; /** * 申请状态(0-草稿 */ - @ApiModelProperty("申请状态(0-草稿") + @ApiModelProperty("申请状态(0-草稿 1-审批中 2-通过 3-驳回)") @TableField("apply_status") - @Excel(name = "申请状态" , readConverterExp = "申请状态(0-草稿") + @Excel(name = "申请状态" , readConverterExp = "申请状态(0-草稿 1-审批中 2-通过 3-驳回)") private Long applyStatus; /** @@ -179,5 +179,13 @@ private static final long serialVersionUID=1L; @Excel(name = "批文号") private String approvalNo; + @ApiModelProperty("申请日期") + @TableField("create_time") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date createTime; + @ApiModelProperty("更新日期") + @TableField("update_time") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date updateTime; } 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 7aae0b9..0b3b070 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 @@ -1,7 +1,20 @@ package com.srs.routine.service.impl; +import java.util.HashMap; import java.util.List; +import java.util.Map; + +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.utils.DateUtils; +import com.srs.common.utils.SecurityUtils; +import com.srs.flowable.service.IFlowDefinitionService; +import lombok.extern.slf4j.Slf4j; +import com.srs.routine.mapper.RtStuLeaveApplicationMapper; +import org.flowable.engine.IdentityService; +import org.flowable.engine.TaskService; +import org.flowable.task.api.Task; import org.springframework.beans.factory.annotation.Autowired; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; @@ -20,6 +33,18 @@ public class RtEnlistmentReserveServiceImpl extends ServiceImpl variables = new HashMap<>(); + variables.put("applyNo", rtEnlistmentReserve.getApplyNo().toString()); +// variables.put("applyNo", rtEnlistmentReserve.getReserveNo()); + variables.put("stuId", rtEnlistmentReserve.getStudentId()); + TeacherVo counselorInfo = rtStuLeaveApplicationMapper.getCounselorInfo(rtEnlistmentReserve.getStudentId()); + // 把辅导员的userId放到approval中 + variables.put("approval", counselorInfo.getUserId()); + variables.put("deptId", counselorInfo.getDeptId()); + + //flow_m4npextk:28:257686 flow_m4npextk:31:755004 + AjaxResult ajaxResult = flowDefinitionService.startProcessInstanceById("flow_r064jfpz:3:1027504", variables); + String code = ajaxResult.get("code").toString(); + if (code.equals("200")) { + + System.out.println("流程启动成功"); + + Object obj = ajaxResult.get("data"); + ProcessResultDto dto = (ProcessResultDto) obj; + + // 操作工作流 + // 设置当前用户 + identityService.setAuthenticatedUserId(SecurityUtils.getUserId().toString()); + // 查询待办任务列表 + List tasks = taskService.createTaskQuery() + .processInstanceId(dto.getProcessInstanceId()) + .taskAssignee(SecurityUtils.getUserId().toString()) + .active() + .list(); + // 保存审核结果到任务变量中 + variables.put("approved", true); + // 完成待办任务列表 + for (Task task : tasks) { + String taskId = task.getId(); + String leaveId = taskService.getVariable(taskId, "enlistmentReserveId").toString(); + if (leaveId.equals(rtEnlistmentReserve.getId().toString())) { + taskService.complete(task.getId(), variables); + } + } + + // todo 企业微信推送消息 + + + return dto; + } else { + return null; + } + } + /** * 批量删除应征入伍保留学籍申请 *