完善第三方签署
This commit is contained in:
+13
-2
@@ -6,7 +6,7 @@ namespace SimpleAdmin.Application;
|
||||
public interface IQiyuesuoClient : ITransient
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建包含个人签署方和企业自动盖章动作的合同草稿。
|
||||
/// 创建包含个人签署方和企业人工盖章动作的合同草稿。
|
||||
/// </summary>
|
||||
Task<QiyuesuoContractResult> CreateDraft(
|
||||
QiyuesuoCreateDraftInput input);
|
||||
@@ -29,6 +29,12 @@ public interface IQiyuesuoClient : ITransient
|
||||
Task<string> GetSignPageUrl(
|
||||
QiyuesuoSignPageInput input);
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前合同中指定文档的只读浏览页面地址。
|
||||
/// </summary>
|
||||
Task<string> GetViewPageUrl(
|
||||
QiyuesuoViewPageInput input);
|
||||
|
||||
/// <summary>
|
||||
/// 查询契约锁合同详情。
|
||||
/// </summary>
|
||||
@@ -39,10 +45,15 @@ public interface IQiyuesuoClient : ITransient
|
||||
/// </summary>
|
||||
Task Notice(string contractId);
|
||||
|
||||
/// <summary>
|
||||
/// 由后台管理员确认后执行企业盖章节点。
|
||||
/// </summary>
|
||||
Task CompanySign(QiyuesuoCompanySignInput input);
|
||||
|
||||
/// <summary>
|
||||
/// 作废尚未完成的合同流程。
|
||||
/// </summary>
|
||||
Task Invalid(string contractId, string reason);
|
||||
Task Invalid(string contractId, string sealId, string reason);
|
||||
|
||||
/// <summary>
|
||||
/// 下载单份签署完成的 PDF 文档。
|
||||
|
||||
+54
-7
@@ -103,9 +103,9 @@ public class QiyuesuoClient : IQiyuesuoClient
|
||||
new
|
||||
{
|
||||
type = "COMPANY",
|
||||
name = "企业自动盖章",
|
||||
name = "企业人工盖章",
|
||||
serialNo = 0,
|
||||
autoSign = true,
|
||||
autoSign = false,
|
||||
sealId = input.SealId,
|
||||
corpSealIds = new[] { sealId },
|
||||
actionNo = "company_seal"
|
||||
@@ -185,6 +185,33 @@ public class QiyuesuoClient : IQiyuesuoClient
|
||||
throw Oops.Bah("契约锁未返回员工签署页面地址");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<string> GetViewPageUrl(
|
||||
QiyuesuoViewPageInput input)
|
||||
{
|
||||
var result = await GetJsonElement(
|
||||
"/v2/contract/viewurl",
|
||||
new Dictionary<string, string>
|
||||
{
|
||||
["contractId"] = input.ContractId,
|
||||
["documentId"] = input.DocumentId,
|
||||
["tenantName"] = input.CompanyName,
|
||||
["downloadButton"] = "false",
|
||||
["printButton"] = "false"
|
||||
});
|
||||
|
||||
if (result.ValueKind == JsonValueKind.String)
|
||||
return result.GetString();
|
||||
if (TryGetString(result, "url", out var url)
|
||||
|| TryGetString(result, "viewUrl", out url)
|
||||
|| TryGetString(result, "pageUrl", out url))
|
||||
{
|
||||
return url;
|
||||
}
|
||||
|
||||
throw Oops.Bah("契约锁未返回合同浏览页面地址");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<QiyuesuoContractResult> GetContractDetail(string contractId)
|
||||
{
|
||||
@@ -212,14 +239,27 @@ public class QiyuesuoClient : IQiyuesuoClient
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task Invalid(string contractId, string reason)
|
||||
public async Task CompanySign(QiyuesuoCompanySignInput input)
|
||||
{
|
||||
await PostJsonElement(
|
||||
"/v2/contract/companysign",
|
||||
new
|
||||
{
|
||||
contractId = input.ContractId,
|
||||
tenantName = input.CompanyName,
|
||||
sealId = input.SealId
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task Invalid(string contractId, string sealId, string reason)
|
||||
{
|
||||
await PostJsonElement(
|
||||
"/v2/contract/invalid",
|
||||
new
|
||||
{
|
||||
contractId,
|
||||
sealId = _setting.SealId,
|
||||
sealId,
|
||||
reason,
|
||||
deleteDoc = false,
|
||||
autoSign = true
|
||||
@@ -318,6 +358,15 @@ public class QiyuesuoClient : IQiyuesuoClient
|
||||
private async Task<T> GetJson<T>(
|
||||
string path,
|
||||
Dictionary<string, string> query)
|
||||
{
|
||||
var result = await GetJsonElement(path, query);
|
||||
return result.Deserialize<T>(JsonOptions)
|
||||
?? throw Oops.Bah("契约锁返回数据为空");
|
||||
}
|
||||
|
||||
private async Task<JsonElement> GetJsonElement(
|
||||
string path,
|
||||
Dictionary<string, string> query)
|
||||
{
|
||||
ValidateSettings();
|
||||
using var request = new HttpRequestMessage(
|
||||
@@ -328,9 +377,7 @@ public class QiyuesuoClient : IQiyuesuoClient
|
||||
path,
|
||||
HttpMethod.Get,
|
||||
query);
|
||||
var result = await SendForJsonResult(request);
|
||||
return result.Deserialize<T>(JsonOptions)
|
||||
?? throw Oops.Bah("契约锁返回数据为空");
|
||||
return await SendForJsonResult(request);
|
||||
}
|
||||
|
||||
private async Task<byte[]> Download(
|
||||
|
||||
+43
-1
@@ -77,6 +77,12 @@ public class QiyuesuoStamperInput
|
||||
/// <summary>契约锁文档 Id。</summary>
|
||||
public string DocumentId { get; set; }
|
||||
|
||||
/// <summary>骑缝章覆盖的契约锁文档 Id,多个 Id 使用英文逗号分隔。</summary>
|
||||
public string DocumentIds { get; set; }
|
||||
|
||||
/// <summary>骑缝章位置指定方式。</summary>
|
||||
public string AcrossType { get; set; }
|
||||
|
||||
/// <summary>企业印章 Id。</summary>
|
||||
public string SealId { get; set; }
|
||||
|
||||
@@ -84,7 +90,13 @@ public class QiyuesuoStamperInput
|
||||
public string Keyword { get; set; }
|
||||
|
||||
/// <summary>同名关键字的序号,从 1 开始。</summary>
|
||||
public int KeywordIndex { get; set; } = 1;
|
||||
public int? KeywordIndex { get; set; }
|
||||
|
||||
/// <summary>相对关键字的横向偏移量;契约锁要求必传,不偏移时为 0。</summary>
|
||||
public decimal OffsetX { get; set; }
|
||||
|
||||
/// <summary>相对关键字的纵向偏移量;契约锁要求必传,不偏移时为 0。</summary>
|
||||
public decimal OffsetY { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -120,6 +132,36 @@ public class QiyuesuoSignPageInput
|
||||
public string CallbackPage { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取契约锁合同文档只读浏览页所需参数。
|
||||
/// </summary>
|
||||
public class QiyuesuoViewPageInput
|
||||
{
|
||||
/// <summary>契约锁合同流程 Id。</summary>
|
||||
public string ContractId { get; set; }
|
||||
|
||||
/// <summary>契约锁合同文档 Id。</summary>
|
||||
public string DocumentId { get; set; }
|
||||
|
||||
/// <summary>签署企业法定名称;集团模式下用于定位子公司。</summary>
|
||||
public string CompanyName { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 契约锁企业人工盖章所需参数。
|
||||
/// </summary>
|
||||
public class QiyuesuoCompanySignInput
|
||||
{
|
||||
/// <summary>契约锁合同流程 Id。</summary>
|
||||
public string ContractId { get; set; }
|
||||
|
||||
/// <summary>签署企业法定名称;集团模式下用于定位子公司。</summary>
|
||||
public string CompanyName { get; set; }
|
||||
|
||||
/// <summary>当前流程使用的企业印章 Id 快照。</summary>
|
||||
public string SealId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 契约锁合同返回对象。
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user