diff --git a/OpenAuth.App/WorkflowEngineApp.cs b/OpenAuth.App/WorkflowEngineApp.cs index d06954b..14c490f 100644 --- a/OpenAuth.App/WorkflowEngineApp.cs +++ b/OpenAuth.App/WorkflowEngineApp.cs @@ -254,15 +254,16 @@ public class WorkflowEngineApp : SqlSugarBaseApp((w, n) => new JoinQueryInfos( JoinType.Inner, w.NodeId == n.NodeId)) .Where((w, n) => w.Status == "Draft" + // todo 角色得改_auditDeptRoleIds && _auditDeptRoleIds.Contains(n.RoleId) - && (w.HandlerId == null || w.HandlerId == 0) - && w.HandlerName != "") + && (w.HandlerId == null || w.HandlerId == 0)) .OrderByDescending((w, n) => w.ReceiveTime); // 分页查询 @@ -294,7 +295,7 @@ public class WorkflowEngineApp : SqlSugarBaseApp + /// 保存拟办 + /// + /// + /// + /// + public object SaveDraft(InitiateFlowRequestDto requestDto) + { + var user = _auth.GetCurrentUser().User; + var illegalConstructionAssessment = new IllegalConstructionAssessment + { + Id = requestDto.BusinessNo, + Title = requestDto.Title, + BusinessNumber = requestDto.BusinessNo, + Attachments = requestDto.Attachments != null ? SaveAttachments(requestDto.Attachments) : string.Empty, + AcceptanceTime = DateTime.Now, + Status = "Draft", + CreateTime = DateTime.Now, + CreateUser = user.Name, + UpdateTime = DateTime.Now, + }; + _sqlSugar.Insertable(illegalConstructionAssessment).ExecuteCommand(); + return true; + } } \ No newline at end of file diff --git a/OpenAuth.WebApi/Controllers/ServerController/CustomWorkflowController.cs b/OpenAuth.WebApi/Controllers/ServerController/CustomWorkflowController.cs index 382ed56..bfc19af 100644 --- a/OpenAuth.WebApi/Controllers/ServerController/CustomWorkflowController.cs +++ b/OpenAuth.WebApi/Controllers/ServerController/CustomWorkflowController.cs @@ -29,7 +29,7 @@ public class WorkflowController : ControllerBase #region 一、流程操作接口 /// - /// 发起流程(区县提交) + /// 发起流程(区县提交) 拟办需要重新提交 /// /// 发起流程请求参数 /// 流程实例ID @@ -89,7 +89,29 @@ public class WorkflowController : ControllerBase #region 二、完整查询接口(拟办/待办/已办/未办结/已完成/全部事项) /// - /// 查询我的拟办(未认领/待分配事项) + /// 保存拟办(逻辑待完善) + /// + /// + [HttpPost] + public ActionResult> SaveDraft([FromBody] InitiateFlowRequestDto requestDto) + { + try + { + // 获取当前登录用户(实际项目中从Token/IAuth中解析) + var currentUser = _auth.GetCurrentUser().User; + if (currentUser == null) + return BadRequest(ApiResponseDto.Fail("未登录或登录过期")); + var result = _workflowEngineApp.SaveDraft(requestDto); + return Ok(ApiResponseDto.Success()); + } + catch (Exception ex) + { + return StatusCode(500, ApiResponseDto.Fail(ex.Message)); + } + } + + /// + /// 查询我的拟办(未完成) /// /// 分页查询参数 /// 分页拟办结果