Bitzsoft.Integrations.ContractLifecycle 1.0.2

dotnet add package Bitzsoft.Integrations.ContractLifecycle --version 1.0.2
                    
NuGet\Install-Package Bitzsoft.Integrations.ContractLifecycle -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Bitzsoft.Integrations.ContractLifecycle" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bitzsoft.Integrations.ContractLifecycle" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Bitzsoft.Integrations.ContractLifecycle" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Bitzsoft.Integrations.ContractLifecycle --version 1.0.2
                    
#r "nuget: Bitzsoft.Integrations.ContractLifecycle, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Bitzsoft.Integrations.ContractLifecycle@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Bitzsoft.Integrations.ContractLifecycle&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Bitzsoft.Integrations.ContractLifecycle&version=1.0.2
                    
Install as a Cake Tool

Bitzsoft.Integrations.ContractLifecycle

电子合同全生命周期管理抽象层 — 统一接口定义、基础模型与结果包装。

屏蔽法大大、契约锁等供应商差异,提供一致的合同创建、查询、提交、审批、驳回、归档、取消与列表 API。

功能特性

  • 统一供应商接口 IContractService:8 个异步方法覆盖合同从草稿到归档的全生命周期
  • 统一结果包装 ContractLifecycleResult:携带成功标志与错误信息
  • 统一异常 ContractLifecycleException:封装供应商标识、错误码与请求 ID
  • 统一模型设计:集合返回 List<T>,覆盖签署人、模板、金额与正文内容

安装

dotnet add package Bitzsoft.Integrations.ContractLifecycle
<PackageReference Include="Bitzsoft.Integrations.ContractLifecycle" Version="1.0.0" />

接口

IContractService

统一的电子合同全生命周期管理供应商接口。

方法 返回类型 说明
ProviderName string 供应商标识(如 FadadaQiyuesuo
CreateContractAsync Task<ContractInfo> 创建合同,返回合同信息
GetContractAsync Task<ContractInfo> 查询单个合同详情
SubmitContractAsync Task<ContractLifecycleResult> 提交合同,进入签署流程
ApproveContractAsync Task<ContractLifecycleResult> 审批通过合同(可附意见)
RejectContractAsync Task<ContractLifecycleResult> 驳回合同(可附原因)
ArchiveContractAsync Task<ContractLifecycleResult> 归档合同
CancelContractAsync Task<ContractLifecycleResult> 取消合同(可附原因)
ListContractsAsync Task<List<ContractInfo>> 分页查询合同列表

核心模型

关键字段 说明
CreateContractRequest TitleTemplateIdSignersContentAmountMetadata 创建合同请求
ListContractsRequest StatusStartDateEndDatePageIndexPageSize 合同列表查询参数
ContractInfo ContractIdTitleStatusCreatorCreatedAtSignersTemplateIdAmountContent 合同信息
ContractSigner NameEmailPhoneRoleCompanyName 合同签署人
ContractLifecycleResult SuccessErrorMessage 操作结果
ContractLifecycleException 统一异常(继承 IntegrationException

枚举

枚举 说明
ContractStatus 合同状态:Draft / Pending / Signing / Completed / Rejected / Cancelled / Archived
ContractSignerRole 签署人角色:Signer / Approver / Cc

使用示例

抽象层本身只定义接口与模型,具体实现由各供应商包提供。以下示例假设已注册某个供应商实现:

public class ContractService(IContractService contract)
{
    public async Task<string> CreateAsync(string title, decimal amount)
    {
        var info = await contract.CreateContractAsync(new CreateContractRequest
        {
            Title = title,
            Amount = amount,
            Signers =
            [
                new() { Name = "张三", Email = "zhangsan@example.com", Role = ContractSignerRole.Signer }
            ]
        });

        await contract.SubmitContractAsync(info.ContractId);
        return info.ContractId;
    }

    public Task<ContractLifecycleResult> RejectAsync(string contractId, string reason)
        => contract.RejectContractAsync(contractId, reason);
}

多供应商解析

同一应用注册多个供应商时,通过 IIntegrationProviderResolver<IContractService> 按供应商 ID 解析:

var resolver = serviceProvider.GetRequiredService<IIntegrationProviderResolver<IContractService>>();
var fadada = resolver.GetRequired("Fadada");
var info = await fadada.CreateContractAsync(request);

依赖

相关包

供应商 包名
统一抽象 Bitzsoft.Integrations.ContractLifecycle
法大大 Bitzsoft.Integrations.ContractLifecycle.Fadada
契约锁 Bitzsoft.Integrations.ContractLifecycle.Qiyuesuo
聚合包 Bitzsoft.Integrations.ContractLifecycle.All
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Bitzsoft.Integrations.ContractLifecycle:

Package Downloads
Bitzsoft.Integrations.ContractLifecycle.Qiyuesuo

契约锁电子合同 CLM 实现 — AppToken + AppSecret MD5 签名头鉴权 + HttpClient,实现 IContractService 统一接口,支持合同创建/查询/提交/审批/驳回/归档/取消/列表查询

Bitzsoft.Integrations.ContractLifecycle.Fadada

法大大电子合同 CLM 实现 — AppId + AppSecret 换取 Bearer Token 鉴权 + HttpClient,实现 IContractService 统一接口,支持合同创建/查询/提交/审批/驳回/归档/取消/列表查询

Bitzsoft.Integrations.ContractLifecycle.All

电子合同 CLM 聚合包 — 包含法大大 / 契约锁全部实现

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 185 8/29/2026
1.0.1 224 8/3/2026
1.0.0 207 8/2/2026