mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-07-15 23:13:40 +08:00
fix #I9J6WS 增加加签逻辑
This commit is contained in:
parent
13ba107c73
commit
62e51584e6
@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Infrastructure;
|
using Infrastructure;
|
||||||
using OpenAuth.App.Interface;
|
using OpenAuth.App.Interface;
|
||||||
@ -14,25 +15,29 @@ namespace OpenAuth.App
|
|||||||
{
|
{
|
||||||
public void Add(AddApproverReq obj)
|
public void Add(AddApproverReq obj)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(obj.Id))
|
|
||||||
{
|
|
||||||
obj.Id = Guid.NewGuid().ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
var loginContext = _auth.GetCurrentUser();
|
var loginContext = _auth.GetCurrentUser();
|
||||||
if (loginContext == null)
|
if (loginContext == null)
|
||||||
{
|
{
|
||||||
throw new CommonException("登录已过期", Define.INVALID_TOKEN);
|
throw new CommonException("登录已过期", Define.INVALID_TOKEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
var addObj = obj.MapTo<FlowApprover>();
|
var objs =new List<FlowApprover>();
|
||||||
CaculateCascade(addObj);
|
foreach (var approver in obj.Approvers)
|
||||||
addObj.CreateDate = DateTime.Now;
|
{
|
||||||
addObj.CreateUserId = loginContext.User.Id;
|
var addobj = approver.MapTo<FlowApprover>();
|
||||||
addObj.CreateUserName = loginContext.User.Name;
|
if (string.IsNullOrEmpty(addobj.Id))
|
||||||
addObj.Name = addObj.Id;
|
{
|
||||||
|
addobj.Id = Guid.NewGuid().ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
CaculateCascade(addobj);
|
||||||
|
addobj.CreateDate = DateTime.Now;
|
||||||
|
addobj.CreateUserId = loginContext.User.Id;
|
||||||
|
addobj.CreateUserName = loginContext.User.Name;
|
||||||
|
addobj.Name = addobj.Id;
|
||||||
|
}
|
||||||
|
|
||||||
Repository.Insert(addObj);
|
Repository.InsertRange(objs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Update(AddApproverReq application)
|
public void Update(AddApproverReq application)
|
||||||
|
37
OpenAuth.App/FlowApproverApp/Request/AddApproverDtlReq.cs
Normal file
37
OpenAuth.App/FlowApproverApp/Request/AddApproverDtlReq.cs
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// This code was generated by a CodeSmith Template.
|
||||||
|
//
|
||||||
|
// DO NOT MODIFY contents of this file. Changes to this
|
||||||
|
// file will be lost if the code is regenerated.
|
||||||
|
// Author:Yubao Li
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OpenAuth.App.Request
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 加签人具体信息
|
||||||
|
/// </summary>
|
||||||
|
public class AddApproverDtlReq
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///Id
|
||||||
|
/// </summary>
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///加签人姓名
|
||||||
|
/// </summary>
|
||||||
|
public string ApproverName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///加签人ID
|
||||||
|
/// </summary>
|
||||||
|
public string ApproverId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///顺序号(当类型为0时)
|
||||||
|
/// </summary>
|
||||||
|
public int? OrderNo { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -6,6 +6,8 @@
|
|||||||
// Author:Yubao Li
|
// Author:Yubao Li
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace OpenAuth.App.Request
|
namespace OpenAuth.App.Request
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -13,30 +15,17 @@ namespace OpenAuth.App.Request
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class AddApproverReq
|
public class AddApproverReq
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
///Id
|
|
||||||
/// </summary>
|
|
||||||
public string Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///加签原因
|
///加签原因
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Reason { get; set; }
|
public string Reason { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///审批人
|
|
||||||
/// </summary>
|
|
||||||
public string ApproverName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///工作流实例Id
|
///工作流实例Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string InstanceId { get; set; }
|
public string InstanceId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///审批人ID
|
|
||||||
/// </summary>
|
|
||||||
public string ApproverId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///类型(0顺序,1并行且,2并行或)
|
///类型(0顺序,1并行且,2并行或)
|
||||||
@ -53,9 +42,6 @@ namespace OpenAuth.App.Request
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string ActivityId { get; set; }
|
public string ActivityId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
public List<AddApproverDtlReq> Approvers { get; set; }
|
||||||
///顺序号(当类型为0时)
|
|
||||||
/// </summary>
|
|
||||||
public int? OrderNo { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user