feat: 新增桂物合同合规系统(HCS)接入P0骨架(blade-hcs-api模块:Feign/认证拦截器/令牌服务/24接口DTO/分页工具,附Nacos配置段与业务表统一字段组SQL)

This commit is contained in:
刘泉佳
2026-09-27 22:22:36 +08:00
parent 50573e7263
commit a739211d6f
62 changed files with 4928 additions and 0 deletions
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springblade</groupId>
<artifactId>blade-third-party-api</artifactId>
<version>${revision}</version>
</parent>
<artifactId>blade-hcs-api</artifactId>
<name>${project.artifactId}</name>
<packaging>jar</packaging>
<description>BladeX 合同合规系统(HCS)API 契约模块</description>
<dependencies>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-starter-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
</plugin>
</plugins>
</build>
</project>
@@ -0,0 +1,75 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.config;
import feign.Request;
import feign.RequestInterceptor;
import org.springblade.hcs.interceptor.HcsAuthInterceptor;
import org.springblade.hcs.token.HcsTokenService;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.context.annotation.Bean;
import java.util.concurrent.TimeUnit;
/**
* 合同合规系统(HCS)Feign 客户端配置
* <p>
* 仅通过 {@link org.springframework.cloud.openfeign.FeignClient#configuration} 引用,避免拦截器全局生效。
* 按 D7 约定不配置 Retryer:写接口重试会造成 HCS 重复建单,重试职责归扫描任务(hcs_retry_count 补偿)。
*
* @author Chill
*/
public class HcsFeignClientConfig {
@Bean
public RequestInterceptor bladeFeignRequestInterceptor() {
// 空实现覆盖全局 BladeFeignRequestInterceptor,防止其覆盖 HCS 的认证凭据
return template -> {
};
}
/**
* HCS 认证拦截器。以 ObjectProvider 惰性持有令牌服务,
* 避免 Feign 客户端构建(需拦截器)与令牌服务(依赖 Feign 客户端取令牌)之间的构造期循环依赖
*/
@Bean
public RequestInterceptor hcsAuthInterceptor(HcsProperties properties, ObjectProvider<HcsTokenService> tokenServiceProvider) {
return new HcsAuthInterceptor(properties, tokenServiceProvider);
}
@Bean
public feign.Logger.Level feignLoggerLevel() {
return feign.Logger.Level.FULL;
}
/**
* 超时:connect 10s / read 60s(照 BfiFeignClientConfig,D7)
*/
@Bean
public Request.Options options() {
return new Request.Options(10, TimeUnit.SECONDS, 60, TimeUnit.SECONDS, true);
}
}
@@ -0,0 +1,255 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.config;
import lombok.Data;
import org.springblade.hcs.constant.HcsConstant;
import org.springframework.boot.context.properties.ConfigurationProperties;
import java.util.HashMap;
import java.util.Map;
/**
* 合同合规系统(HCS)配置类
* <p>
* Nacos 配置段见 third-party-api.yaml 的 thirdParty.hcs 节点:
* 注解前缀按 Spring Boot 规范使用横线小写形式 third-party.hcs(照 BfiProperties 惯例),
* YAML 中的驼峰键 thirdParty.hcs.* 经宽松绑定归一后等价生效。
*
* @author Chill
*/
@Data
@ConfigurationProperties(prefix = "third-party.hcs")
public class HcsProperties {
/**
* 合同合规系统(HCS)接口基础地址,直连可配(网关/iPaaS 部署时改此处,代码不感知)
*/
private String baseUrl;
/**
* 认证方式:oauth2(默认,URL 追加 access_token)| basic(Authorization 请求头),切换不改代码
*/
private String authType = HcsConstant.AUTH_TYPE_OAUTH2;
/**
* OAuth2 应用 appKey
*/
private String appKey;
/**
* OAuth2 应用 appSecret
*/
private String appSecret;
/**
* Basic 认证用户名
*/
private String basicUsername;
/**
* Basic 认证密码
*/
private String basicPassword;
/**
* 来源系统标识(fd_sources,D14 约定值 TMS)
*/
private String srcSystem = "TMS";
/**
* 推送任务配置(扫描首推/补偿)
*/
private Push push = new Push();
/**
* 项目立项(C102)配置
*/
private Project project = new Project();
/**
* 合同(C103)配置
*/
private Contract contract = new Contract();
/**
* 履约规则(C103-9)配置
*/
private ExeStage exeStage = new ExeStage();
/**
* 客商风险校验(C101-1)配置
*/
private Risk risk = new Risk();
/**
* 额度校验(C106-1)配置
*/
private Credit credit = new Credit();
/**
* 结算付款特批(C106-3/4)配置
*/
private SpecPay specPay = new SpecPay();
/**
* 开票登记(C111)配置
*/
private Invoice invoice = new Invoice();
/**
* 收票单(C109)配置
*/
private ReceiptBill receiptBill = new ReceiptBill();
/**
* 附件转传(C103-2)配置
*/
private Attachment attachment = new Attachment();
@Data
public static class Push {
/**
* 推送任务总开关(默认关,灰度打开)
*/
private boolean syncEnabled = false;
/**
* 扫描调度 cron,默认每 5 分钟
*/
private String cron = "0 */5 * * * ?";
/**
* 每类单据单轮扫描批量
*/
private int batchSize = 50;
/**
* 推送失败自动重试上限,超限仅人工重推
*/
private int maxRetry = 5;
}
@Data
public static class Project {
/**
* 立项 bpmOperation.templateCode(环境相关值,§9-U9,待合规方提供)
*/
private String templateCode = "";
}
@Data
public static class Contract {
/**
* TMS 合同类别 -> HCS 模板ID(fdTemplateId,§9-U7 待合规方提供模板清单)
*/
private Map<String, String> templateMapping = new HashMap<>();
/**
* TMS 结算方式 -> 付款|收款(fdSettlementType,§9-U3 字典映射待联调)
*/
private Map<String, String> settlementTypeMapping = new HashMap<>();
/**
* TMS 币种码 -> HCS 币种名称(照金蝶 RMB->CNY 映射惯例)
*/
private Map<String, String> currencyNameMapping = new HashMap<>(Map.of("RMB", "人民币"));
/**
* 合同 fdSepcailContract 固定 false(D15,配置项预留)
*/
private boolean specialContractEnabled = false;
/**
* 合同推送前是否强制客商风险校验
*/
private boolean requireRiskCheck = true;
}
@Data
public static class ExeStage {
/**
* 履约规则金额类型默认值(fdFundType)
*/
private String fundType = "byAmount";
}
@Data
public static class Risk {
/**
* 合同推送前风险校验开关
*/
private boolean checkOnContract = true;
/**
* 付款提交前风险校验开关
*/
private boolean checkOnPayment = true;
/**
* 黑名单是否阻断(合同置 failed / 付款提交拦截)
*/
private boolean blockBlacklist = true;
}
@Data
public static class Credit {
/**
* 付款提交校验是否要求合同已推送合规(hcs_fd_id 存在)
*/
private boolean requireContractSynced = true;
}
@Data
public static class SpecPay {
/**
* 特批单据状态(fd_doc_status,示例 10,§9-U3 待联调)
*/
private String docStatus = "10";
/**
* 付款用途字典值(fd_payment_purpose,§9-U3 待联调后配置)
*/
private String paymentPurpose = "";
/**
* 付款性质字典值(fd_payment_nature,§9-U3 待联调后配置)
*/
private String paymentNature = "";
/**
* 付款类型字典值(fd_payment_type,§9-U3 待联调后配置)
*/
private String paymentType = "";
}
@Data
public static class Invoice {
/**
* TMS 发票类型 -> HCS 发票类型字典值(§9-U3 待联调后配置)
*/
private Map<String, String> invoiceTypeMapping = new HashMap<>();
/**
* TMS 币种码 -> HCS 币种 fdId(经 C103-12 币种表缓存取值,§9-U3 待联调后配置)
*/
private Map<String, String> currencyIdMapping = new HashMap<>();
/**
* 开票登记款项性质默认值(fdFundNature)
*/
private String fundNatureDefault = "progress";
}
@Data
public static class ReceiptBill {
/**
* TMS 发票类型 -> HCS 收票发票类型字典值(§9-U3 待联调后配置)
*/
private Map<String, String> invoiceTypeMapping = new HashMap<>();
}
@Data
public static class Attachment {
/**
* 附件转传总开关
*/
private boolean transferEnabled = true;
/**
* TMS 文件服务下载基址(拉取附件流用)
*/
private String fileDownloadBase = "";
}
}
@@ -0,0 +1,41 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.config;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
/**
* 第三方API 合同合规系统(HCS)配置类
*
* @author Chill
*/
@ComponentScan("org.springblade.hcs")
@EnableConfigurationProperties(HcsProperties.class)
@Configuration
public class ThirdPartyHcsAutoConfiguration {
}
@@ -0,0 +1,79 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.constant;
/**
* 合同合规系统(HCS)常量类
*
* @author Chill
*/
public class HcsConstant {
/**
* 接口调用成功 messageKey(统一出参 code,业务成败以 success 字段为准)
*/
public static final String SUCCESS_CODE = "return.optSuccess";
/**
* 认证方式:OAuth2(默认,URL 追加 access_token)
*/
public static final String AUTH_TYPE_OAUTH2 = "oauth2";
/**
* 认证方式:Basic(Authorization 请求头)
*/
public static final String AUTH_TYPE_BASIC = "basic";
/**
* 网关认证请求头名称
*/
public static final String HEADER_AUTHORIZATION = "Authorization";
/**
* Basic 认证请求头前缀
*/
public static final String HEADER_BASIC_PREFIX = "Basic ";
/**
* OAuth2 access_token 追加到业务请求 URL 的参数名
*/
public static final String QUERY_ACCESS_TOKEN = "access_token";
/**
* HCS access_token 缓存 key(照 BFI 令牌缓存命名惯例)
*/
public static final String HCS_TOKEN_CACHE_KEY = "blade:third:hcs:token";
/**
* token 提前失效缓冲时长(毫秒),防止刚好过期(照 BFI 120s 缓冲)
*/
public static final long TOKEN_EXPIRE_BUFFER_MILLIS = 120_000L;
/**
* getToken 接口默认路径片段,拦截器据此跳过令牌追加(避免给取令牌请求再带 access_token)
*/
public static final String GET_TOKEN_PATH = "/authapi/getToken";
}
@@ -0,0 +1,50 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)C103-5 附件下载入参(对账/排查备用)
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsAttachmentDownloadDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 附件ID
*/
private String fdId;
}
@@ -0,0 +1,70 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)附件引用项(附件先经 C103-2 上传取得 fdId,再经 mechanisms.attachment[] 引用)
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsAttachmentRefDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 附件ID(附件上传接口返回)
*/
private String fdId;
/**
* 附件名称(不含扩展名)
*/
private String fdFileName;
/**
* 附件扩展名
*/
private String fdFileExtName;
/**
* 附件完整文件名
*/
private String fullName;
/**
* 附件绑定的表单字段 key:特批 fd_spc_approval_attach、履约记录 fd_plan_att、收票单 fd_attach
*/
private String fdEntityKey;
/**
* 绑定类型:仅发起类接口传 ADD,更新类接口不传
*/
private String fdBindType;
}
@@ -0,0 +1,50 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)C103-2 附件上传出参
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsAttachmentVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 附件ID(调用方必须持久化/缓存映射,供各业务接口引用)
*/
private String fdId;
}
@@ -0,0 +1,54 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)C102-1 项目立项新建 流程操作入参
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsBpmOperationDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 操作类型:固定 drafter_submit(以起草人身份直接提交流程)
*/
private String operationType;
/**
* 立项表单模板编码(环境相关值,配置 thirdParty.hcs.project.template-code,§9-U9)
*/
private String templateCode;
}
@@ -0,0 +1,62 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)C103-7 合同分类列表出参行(fdParent 可组装分类树)
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsCategoryVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 分类ID
*/
private String fdId;
/**
* 分类名称(查询条件 fdName.$contains)
*/
private String fdName;
/**
* 上级分类
*/
private HcsRefVO fdParent;
/**
* 状态:enable / disable
*/
private String fdStatus;
}
@@ -0,0 +1,56 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)C103-4 合同详情入参(fdId 与 fdNumber 二选一)
* <p>
* TODO 待联调确认:出参 data 结构 v4 未定义,对账功能联调后以实际返回为准(设计文档 §5.9)。
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsContractDetailQueryDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 合同ID
*/
private String fdId;
/**
* 合同编号
*/
private String fdNumber;
}
@@ -0,0 +1,66 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)C103-1 合同发起入参(C103-11 合同更新入参结构相同,复用本 DTO)
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsContractDraftDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 合同模板ID(C103-6 模板列表获取,配置 template-mapping,§9-U7)
*/
private String fdTemplateId;
/**
* 外部系统标识(fd_sources,约定值 TMS,配置 thirdParty.hcs.src-system)
*/
private String fdOuterSystem;
/**
* 操作人登录名
*/
private String fdLoginName;
/**
* 保存类型:submit(提交)
*/
private String saveType;
/**
* 合同字段(模板字段 + 签署方)
*/
private HcsContractFieldJsonDTO fdFieldJson;
}
@@ -0,0 +1,50 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)C103-1 合同发起出参(fdContractId 必须持久化,用于合同更新、履约规则同步、额度校验等)
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsContractDraftVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 合同ID(回填 TMS blade_contract_manage.hcs_fd_id)
*/
private String fdContractId;
}
@@ -0,0 +1,57 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.List;
/**
* 合同合规系统(HCS)C103-1 合同发起 fdFieldJson 节点(C103-1 新建 / C103-11 更新共用)
* <p>
* §9-U8 待联调确认:v4 未定义合同附件传递字段,附件挂载方式待合规方确认后补充。
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsContractFieldJsonDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 模板字段值列表
*/
private List<HcsXformFieldDTO> xformFields;
/**
* 签署方(相对方)列表
*/
private List<HcsSignerDTO> signer;
}
@@ -0,0 +1,62 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)C103-3 合同信息列表出参行(判重与对账回查,按 columns 返回)
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsContractVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 合同ID
*/
private String fdId;
/**
* 合同标题(判重条件 fdNumber 关联核对)
*/
private String fdSubject;
/**
* 合同编号(判重条件,§9-U4 查询能力联调确认)
*/
private String fdNumber;
/**
* 合同分类层级ID
*/
private String fdCateHierarchyId;
}
@@ -0,0 +1,55 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 合同合规系统(HCS)C106-1 项目/合同额度校验入参
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsCreditCheckDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 合同ID(必填,HCS 合同ID blade_contract_manage.hcs_fd_id)
*/
private String fdContractId;
/**
* 申请金额(必填,元)
*/
private BigDecimal fdApplyAmount;
}
@@ -0,0 +1,69 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 合同合规系统(HCS)C106-1 项目/合同额度校验出参
* <p>
* 注意:超额时外层 success 仍为 true,必须以 fdIsCredit 为准;超额不拦截提交,转入特批链路(D15/R2-Q2)。
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsCreditCheckVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 额度是否通过:true 通过 / false 超额(必看字段)
*/
private Boolean fdIsCredit;
/**
* 合同ID
*/
private String fdContractId;
/**
* 合同金额
*/
private BigDecimal fdContractAmount;
/**
* 已付金额
*/
private BigDecimal fdPayedAmount;
/**
* 超额原因说明(回填 hcs_credit_msg)
*/
private String fdMessage;
}
@@ -0,0 +1,78 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)C103-12 合同币种列表出参行(开票登记 fdCurrencyId、履约计划币种取自本接口)
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsCurrencyVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 币种ID(currency-id-mapping 目标值)
*/
private String fdId;
/**
* 币种中文名(查询条件 fdCName.$contains)
*/
private String fdCName;
/**
* 币种简称
*/
private String fdSName;
/**
* 币种英文名(如 CNY)
*/
private String fdEName;
/**
* 币种编码
*/
private String fdNumber;
/**
* 币种符号
*/
private String fdSymbol;
/**
* 状态:enable / disable
*/
private String fdStatus;
/**
* 是否本位币
*/
private Boolean fdIsStandardCurrency;
}
@@ -0,0 +1,93 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 合同合规系统(HCS)C103-9(新) 履约规则同步 行级操作项(数据源 blade_contract_exe_stage,ADR-0002)
* <p>
* 新增行可不带 fdId;更新/删除行必须带 fdId(合规阶段ID,回填自首次同步返回)。
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsExeplanStageDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 阶段项ID(行级 update/delete 必传,取 blade_contract_exe_stage.hcs_stage_fd_id)
*/
private String fdId;
/**
* 行级操作:add / update / delete
*/
private String fdEopExeplanOperateType;
/**
* 履约类型:payment=付款 / collection=收款
*/
private String fdPerformType;
/**
* 款项性质:prepayment=预付款 / progress=进度款 / acceptance=验收款 / retention=质保金
*/
private String fdFundNature;
/**
* 开票规则(如 payFirst)
*/
private String fdInvoiceRule;
/**
* 账期
*/
private Integer fdInvoiceCycle;
/**
* 计划金额(元)
*/
private BigDecimal fdFundAmount;
/**
* 资金日期(毫秒时间戳)
*/
private Long fdFundDate;
/**
* 金额类型(默认 byAmount 按金额,配置 thirdParty.hcs.exe-stage.fund-type)
*/
private String fdFundType;
/**
* 是否完成
*/
private Boolean fdIsFinish;
/**
* 扩展内容 JSON 字符串(固定 "{}")
*/
private String fdExtendContent;
}
@@ -0,0 +1,97 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 合同合规系统(HCS)C103-9(新) 履约规则同步出参-变更阶段行
* <p>
* 合规返回的阶段 fdId 必须持久化(回填 blade_contract_exe_stage.hcs_stage_fd_id),后续行更新/删除全靠它。
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsExeplanStageVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 阶段项ID(必须持久化)
*/
private String fdId;
/**
* 阶段唯一标识
*/
private String fdUniqueId;
/**
* 计划金额
*/
private BigDecimal fdPlanFundAmount;
/**
* 实际金额
*/
private BigDecimal fdActualFundAmount;
/**
* 履约类型:payment / collection
*/
private String fdPerformType;
/**
* 款项性质
*/
private String fdFundNature;
/**
* 开票规则
*/
private String fdInvoiceRule;
/**
* 账期
*/
private Integer fdInvoiceCycle;
/**
* 计划金额
*/
private BigDecimal fdFundAmount;
/**
* 资金日期(毫秒时间戳)
*/
private Long fdFundDate;
/**
* 金额类型
*/
private String fdFundType;
/**
* 扩展内容 JSON 字符串
*/
private String fdExtendContent;
}
@@ -0,0 +1,74 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.List;
/**
* 合同合规系统(HCS)C103-9(新) 合同履约规则同步入参(支持整批增删改)
* <p>
* fdContractId 传 HCS 合同ID(blade_contract_manage.hcs_fd_id,非 TMS 主键);
* fdExeplanId 已同步过则传(首次同步返回后持久化到 blade_contract_manage.hcs_exeplan_id)。
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsExeplanSyncDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 合同ID(HCS 合同ID)
*/
private String fdContractId;
/**
* 外部系统标识(fd_sources,约定值 TMS)
*/
private String fdOuterSystem;
/**
* 操作人登录名
*/
private String fdLoginName;
/**
* 计划整体操作类型(如 add,随场景)
*/
private String fdEopExeplanOperateType;
/**
* 履约计划ID(已同步过则传)
*/
private String fdExeplanId;
/**
* 行级操作列表
*/
private List<HcsExeplanStageDTO> fdStages;
}
@@ -0,0 +1,55 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.List;
/**
* 合同合规系统(HCS)C103-9(新) 履约规则同步出参(fdExeplanId 与变更阶段 fdId 均须持久化)
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsExeplanVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 履约计划ID(回填 blade_contract_manage.hcs_exeplan_id)
*/
private String fdExeplanId;
/**
* 本次变更的阶段列表(按行回填 hcs_stage_fd_id)
*/
private List<HcsExeplanStageVO> fdChangeStages;
}
@@ -0,0 +1,58 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)流程单据新建返回结果(C102-1 项目立项、C106-3 特批发起、C108-1 履约记录新建、C109-1 收票单新建出参)
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsFormSaveVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 单据主键ID(调用方必须持久化,供后续更新使用)
*/
private String fdId;
/**
* 表单模板ID
*/
private String fdXFormId;
/**
* 单据查看页面路径
*/
private String docViewUrl;
}
@@ -0,0 +1,50 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)单据ID返回结果(新建类接口出参 data 仅含 fdId 的场景:C103-2/C111-2/C111-3 等)
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsIdVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 单据ID(调用方必须持久化,供后续更新/删除/关联使用)
*/
private String fdId;
}
@@ -0,0 +1,103 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* 合同合规系统(HCS)C111-2 新增开票登记入参
* <p>
* 校验:fdContractNumber(须在合规本地存在)与 fdCurrencyId 必填;
* 附件通过 fdAttIds(C103-2 附件上传返回的ID数组)引用。
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsInvoiceRegAddDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 单据编号(开票申请单号,同租户唯一,判重候选键)
*/
private String fdNumber;
/**
* 登记日期(毫秒时间戳)
*/
private Long fdRegisterDate;
/**
* 合同编号(必填,经应收结算链路回溯,§9-U10)
*/
private String fdContractNumber;
/**
* 发票类型(字典映射 invoice-type-mapping,§9-U3)
*/
private String fdInvoiceType;
/**
* 结算币种ID(必填,currency-id-mapping,§9-U3)
*/
private String fdCurrencyId;
/**
* 开票方(销方 issuerName)
*/
private String fdInvoiceParty;
/**
* 款项性质(默认 progress,配置 invoice.fund-nature-default)
*/
private String fdFundNature;
/**
* 开票金额(含税)
*/
private BigDecimal fdInvoiceAmount;
/**
* 备注
*/
private String fdRemark;
/**
* 状态:0=已开票,1=已作废(新增固定 0)
*/
private Integer fdStatus;
/**
* 第三方创建人编码(申请人工号)
*/
private String fdThirdCreatorCode;
/**
* 第三方创建部门编码(申请部门编码)
*/
private String fdThirdCreatorDeptCode;
/**
* 附件ID列表(C103-2 附件上传返回)
*/
private List<String> fdAttIds;
}
@@ -0,0 +1,53 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* 合同合规系统(HCS)C111-3 更新开票登记入参(金蝶开票完成后回填票据日期/状态)
* <p>
* fdId 必填(C111-2 新增返回,持久化于 hcs_fd_id),其余可选;作废传 fdStatus=1。
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsInvoiceRegUpdateDTO extends HcsInvoiceRegAddDTO {
@Serial
private static final long serialVersionUID = 1L;
/**
* 开票登记ID(必填,C111-2 新增返回,持久化于 hcs_fd_id)
*/
private String fdId;
}
@@ -0,0 +1,127 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 合同合规系统(HCS)C111-1 查询开票登记列表出参行(判重条件 fdNumber,§9-U4 查询能力联调确认)
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsInvoiceRegVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
private String fdId;
/**
* 单据编号(TMS 开票申请单号)
*/
private String fdNumber;
/**
* 登记日期(毫秒时间戳)
*/
private Long fdRegisterDate;
/**
* 票据日期(毫秒时间戳,金蝶开票完成后回填)
*/
private Long fdBillDate;
/**
* 合同
*/
private HcsRefVO fdContract;
/**
* 合同编号
*/
private String fdContractNumber;
/**
* 发票类型
*/
private String fdInvoiceType;
/**
* 结算币种(币种ID)
*/
private String fdCurrencyId;
/**
* 开票方
*/
private String fdInvoiceParty;
/**
* 款项性质(prepayment/progress/acceptance/retention)
*/
private String fdFundNature;
/**
* 开票金额(含税)
*/
private BigDecimal fdInvoiceAmount;
/**
* 备注
*/
private String fdRemark;
/**
* 状态:0=已开票,1=已作废
*/
private Integer fdStatus;
/**
* 数据来源(如 erp)
*/
private String fdDataSource;
/**
* 创建人
*/
private HcsRefVO fdCreator;
/**
* 创建人部门
*/
private HcsRefVO fdCreatorDept;
/**
* 创建时间(毫秒时间戳)
*/
private Long fdCreateTime;
/**
* 第三方创建人编码
*/
private String fdThirdCreatorCode;
/**
* 第三方创建部门编码
*/
private String fdThirdCreatorDeptCode;
/**
* 发起主体(合同关联的发起主体名称)
*/
private String fdInitiator;
}
@@ -0,0 +1,51 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.List;
/**
* 合同合规系统(HCS)附件挂载容器(C106 特批 / C108 履约记录 / C109 收票单的 mechanisms 节点)
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsMechanismsDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 附件列表(fdId 来自 C103-2 附件上传接口)
*/
private List<HcsAttachmentRefDTO> attachment;
}
@@ -0,0 +1,75 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* 合同合规系统(HCS)通用分页查询入参(§1.5 分页与查询约定,各查询接口通用)
* <p>
* 注意:C102-3 项目立项查询的 columns/sorts 用下划线字段名(fd_id/fd_num/fd_pro_name/fd_create_time),
* 其余查询接口出入参均为驼峰;出参 content 均为驼峰字段。
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsPageQueryDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 查询返回的字段列表(视接口必填)
*/
private List<String> columns;
/**
* 查询条件,空对象表示无条件;支持操作符,如 {"fdName": {"$contains": "xx"}}(包含匹配)
*/
private Map<String, Object> conditions;
/**
* 分页偏移量(必填,从 0 开始)
*/
private Integer offset;
/**
* 每页条数(必填)
*/
private Integer pageSize;
/**
* 排序条件,如 {"fdCreateTime": "desc"}
*/
private Map<String, Object> sorts;
/**
* 当前操作人(C102-3 项目立项查询需携带,其余查询接口按需)
*/
private HcsUserRefVO curUser;
}
@@ -0,0 +1,62 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.List;
/**
* 合同合规系统(HCS)分页查询返回结果(位于统一出参 data 内)
*
* @param <T> 数据行类型
* @author Chill
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsPageVO<T> implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 数据列表
*/
private List<T> content;
/**
* 分页偏移量(从 0 开始)
*/
private Integer offset;
/**
* 每页条数
*/
private Integer pageSize;
/**
* 总条数
*/
private Integer totalSize;
}
@@ -0,0 +1,66 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)C108-1/C108-2 履约记录 formData 节点
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsPerfRecordFormDataDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 履约记录ID(C108-2 更新必填,取 C108-1 新建返回的 data.fdId)
*/
private String fdId;
/**
* 履约记录业务字段
*/
private HcsPerfRecordPropsDTO dynamicProps;
/**
* 单据主题
*/
private String fdDocSubject;
/**
* 单据状态(示例 10)
*/
private String fdDocStatus;
/**
* 表单模板ID(环境值,§9-U9)
*/
private String fdXformId;
}
@@ -0,0 +1,110 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)C108-1/C108-2 履约记录 dynamicProps 业务字段(字段名按接口文档下划线原样传值)
* <p>
* 注意:fd_paln_type 为接口文档原文拼写(plan 的笔误,必须沿用原拼写,否则字段无法识别);
* 金额字段为字符串传值。
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsPerfRecordPropsDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 申请金额(字符串传值)
*/
@JsonProperty("fd_apply_amount")
private String fdApplyAmount;
/**
* 实际金额(字符串传值,实际付款推进时更新)
*/
@JsonProperty("fd_fact_amount")
private String fdFactAmount;
/**
* 申请编号
*/
@JsonProperty("fd_apply_no")
private String fdApplyNo;
/**
* 计划日期(毫秒时间戳)
*/
@JsonProperty("fd_plan_date")
private Long fdPlanDate;
/**
* 计划类型(原文拼写 fd_paln_type,paymentType)
*/
@JsonProperty("fd_paln_type")
private String fdPalnType;
/**
* 性质(款项性质,取关联履约规则行/结算性质)
*/
@JsonProperty("fd_property")
private String fdProperty;
/**
* 版本ID
*/
@JsonProperty("fd_version")
private String fdVersion;
/**
* 表单模板ID(环境值 fd_xform_id,§9-U9)
*/
@JsonProperty("fd_xform_id")
private String fdXformId;
/**
* 来源履约计划项ID(关联履约阶段 hcs_stage_fd_id,无关联则不传)
*/
@JsonProperty("fd_id")
private String fdId;
/**
* 合同ID(HCS 合同ID)
*/
@JsonProperty("fd_contract_id")
private String fdContractId;
/**
* 附件不可下载
*/
@JsonProperty("fd_att_no_download")
private Boolean fdAttNoDownload;
/**
* 草稿不可编辑打印
*/
@JsonProperty("fd_draft_no_edit_prints")
private Boolean fdDraftNoEditPrints;
}
@@ -0,0 +1,61 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)C108-1 履约记录新建入参(C108-2 更新入参结构相同,复用本 DTO)
* <p>
* 更新时 formData.fdId 必填(新增返回的ID,持久化于 hcs_perf_fd_id),另可传 dynamicProps.fd_contract_id 指定合同;
* 更新响应无 data,以 success 判断结果。附件经 mechanisms.attachment[] 绑定,fdEntityKey=fd_plan_att。
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsPerfRecordSaveDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 当前操作人 {fdLoginName}(必填)
*/
private HcsUserRefVO curUser;
/**
* 履约记录表单数据
*/
private HcsPerfRecordFormDataDTO formData;
/**
* 附件挂载
*/
private HcsMechanismsDTO mechanisms;
}
@@ -0,0 +1,66 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)C102-1 项目立项新建入参
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsProjectAddDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 流程操作(operationType=drafter_submit、templateCode 环境值)
*/
private HcsBpmOperationDTO bpmOperation;
/**
* 是否校验权限(接口调用传 false)
*/
private Boolean checkAuth;
/**
* 当前操作人 {fdLoginName}
*/
private HcsUserRefVO curUser;
/**
* 项目表单数据
*/
private HcsProjectFormDataDTO formData;
/**
* 保存选项(saveDraft=false 直接提交)
*/
private HcsSaveOptionDTO saveOption;
}
@@ -0,0 +1,54 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)项目立项 formData 节点(C102-1 新建 / C102-2 更新共用;更新时 fdId 必填)
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsProjectFormDataDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 项目立项单ID(C102-1 新建返回,C102-2 更新必填)
*/
private String fdId;
/**
* 项目业务字段
*/
private HcsProjectPropsDTO dynamicProps;
}
@@ -0,0 +1,149 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* 合同合规系统(HCS)项目立项 dynamicProps 业务字段(C102-1 新建 / C102-2 更新共用,字段名按接口文档下划线原样传值)
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsProjectPropsDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 项目名称
*/
@JsonProperty("fd_pro_name")
private String fdProName;
/**
* 项目简称
*/
@JsonProperty("fd_pro_simple_name")
private String fdProSimpleName;
/**
* 创建单位 {fdId, fdName}(HCS 组织 fdId 与 TMS 不同源,先传名称,§9-U2)
*/
@JsonProperty("fd_creator_unit")
private HcsRefVO fdCreatorUnit;
/**
* 项目负责人 {fdLoginName}
*/
@JsonProperty("fd_head")
private HcsUserRefVO fdHead;
/**
* 结算类型(字典值,映射配置待联调,§9-U3)
*/
@JsonProperty("fd_settlement_type")
private String fdSettlementType;
/**
* 计划保证金(TMS 万元 × 10000 转元,变更映射语义联调确认)
*/
@JsonProperty("fd_pro_plan_deposit")
private BigDecimal fdProPlanDeposit;
/**
* 是否自营项目(一期默认 "1",联调确认)
*/
@JsonProperty("fd_is_self_pro")
private String fdIsSelfPro;
/**
* 项目收入目标(一期不传,联调确认)
*/
@JsonProperty("fd_pro_income_goal")
private BigDecimal fdProIncomeGoal;
/**
* 承接部门 {fdId, fdName}(先传名称,§9-U2)
*/
@JsonProperty("fd_taker_dept")
private HcsRefVO fdTakerDept;
/**
* 承接人 {fdLoginName}
*/
@JsonProperty("fd_taker")
private HcsUserRefVO fdTaker;
/**
* 付款额度(TMS 万元 × 10000 转元)
*/
@JsonProperty("fd_pay_limit")
private BigDecimal fdPayLimit;
/**
* 开票额度(TMS 万元 × 10000 转元)
*/
@JsonProperty("fd_out_invoice_limit")
private BigDecimal fdOutInvoiceLimit;
/**
* 项目建设内容
*/
@JsonProperty("fd_pro_content")
private String fdProContent;
/**
* 是否可用(固定 true)
*/
@JsonProperty("fd_is_available")
private Boolean fdIsAvailable;
/**
* 项目编号(必填,判重候选键)
*/
@JsonProperty("fd_num")
private String fdNum;
/**
* 可用单位列表 [{fdId, fdName}](同创建单位先传名称)
*/
@JsonProperty("fd_avail_units")
private List<HcsRefVO> fdAvailUnits;
/**
* 金蝶同步状态(固定 "1")
*/
@JsonProperty("fd_kingdee_sync_status")
private String fdKingdeeSyncStatus;
/**
* 来源标识(fd_sources,约定值 TMS,配置 thirdParty.hcs.src-system,D14)
*/
@JsonProperty("fd_sources")
private String fdSources;
/**
* 来源系统主键 ID(存 TMS 业务单据主键,D14)
*/
@JsonProperty("fd_kingdee_id")
private String fdKingdeeId;
/**
* 创建人 {fdLoginName}
*/
@JsonProperty("fd_creator")
private HcsUserRefVO fdCreator;
}
@@ -0,0 +1,50 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* 合同合规系统(HCS)C102-2 项目立项更新入参
* <p>
* 入参结构与新建一致(去掉 bpmOperation/saveOption),formData.fdId 必填(新建返回的项目ID);
* 响应无 data,以 success 判断结果。
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsProjectUpdateDTO extends HcsProjectAddDTO {
@Serial
private static final long serialVersionUID = 1L;
}
@@ -0,0 +1,60 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)C102-3 项目立项查询出参行
* <p>
* 注意:本接口入参 columns/sorts 用下划线字段名(fd_id/fd_num/fd_pro_name),出参 content 为驼峰。
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsProjectVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 项目立项单ID
*/
private String fdId;
/**
* 项目编号(判重条件 fd_num)
*/
private String fdNum;
/**
* 项目名称
*/
private String fdProName;
}
@@ -0,0 +1,54 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)C109-1/C109-2 收票单 formData 节点(更新时文档状态无需传递)
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsReceiptBillFormDataDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 收票单业务字段
*/
private HcsReceiptBillPropsDTO dynamicProps;
/**
* 单据主题(更新接口不传)
*/
private String fdDocSubject;
}
@@ -0,0 +1,105 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 合同合规系统(HCS)C109-1/C109-2 收票单 dynamicProps 业务字段(字段名按接口文档下划线原样传值)
* <p>
* §9-U11 待联调确认:fd_ap_bill_src_subject 关联结算付款单的编号体系(应付单号键)。
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsReceiptBillPropsDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 发票号码
*/
@JsonProperty("fd_invoice_code")
private String fdInvoiceCode;
/**
* 开票/收票日期(YYYY-MM-DD 字符串,非毫秒时间戳)
*/
@JsonProperty("fd_bill_date")
private String fdBillDate;
/**
* 开票方(销方,供应商名称或编号)
*/
@JsonProperty("fd_invoicer")
private String fdInvoicer;
/**
* 收票方(购方,收票单位名称或编号)
*/
@JsonProperty("fd_buyer")
private String fdBuyer;
/**
* 价税合计金额
*/
@JsonProperty("fd_invoice_amt_tax_incl")
private BigDecimal fdInvoiceAmtTaxIncl;
/**
* 税率(小数,如 0.13,TMS 13 ÷ 100)
*/
@JsonProperty("fd_tax_rate")
private BigDecimal fdTaxRate;
/**
* 发票类型(字典值,配置 receipt-bill.invoice-type-mapping,§9-U3)
*/
@JsonProperty("fd_invoice_type")
private String fdInvoiceType;
/**
* 合同主题(或合同编号/ID,应付结算链路回溯或人工补录,D13)
*/
@JsonProperty("fd_contract_subject")
private String fdContractSubject;
/**
* 合同编号(应付结算链路回溯或人工补录,D13)
*/
@JsonProperty("fd_contract_no")
private String fdContractNo;
/**
* 关联结算付款单主题(或编号/ID,收票认领应付单号,§9-U11)
*/
@JsonProperty("fd_ap_bill_src_subject")
private String fdApBillSrcSubject;
/**
* 备注
*/
@JsonProperty("fd_remark")
private String fdRemark;
}
@@ -0,0 +1,67 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)C109-1 收票单新建入参(C109-2 更新入参结构相同,复用本 DTO)
* <p>
* fdId 为收票单主键:新建不传;更新必填(新建返回 data.data.fdId,持久化于 hcs_fd_id),
* 更新一般只传变更字段、文档状态无需传递。
* 新建成功返回双层嵌套 data.data.{fdId, fdXFormId, docViewUrl}。
* 附件(发票扫描件)经 mechanisms.attachment[] 绑定:fdEntityKey=fd_attach、发起带 fdBindType=ADD。
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsReceiptBillSaveDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 收票单主键(新建不传,更新必填)
*/
private String fdId;
/**
* 操作人登录名(必填)
*/
private String fdLoginName;
/**
* 收票单表单数据
*/
private HcsReceiptBillFormDataDTO formData;
/**
* 附件挂载
*/
private HcsMechanismsDTO mechanisms;
}
@@ -0,0 +1,66 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)引用对象(组织/部门/合同等统一 {fdId, fdName} 引用)
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsRefVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 引用记录ID
*/
private String fdId;
/**
* 引用记录名称
*/
private String fdName;
/**
* 仅按名称引用(HCS 组织 fdId 与 TMS 不同源,§9-U2,先传名称)
*
* @param fdName 名称
* @return 引用对象
*/
public static HcsRefVO ofName(String fdName) {
HcsRefVO ref = new HcsRefVO();
ref.setFdName(fdName);
return ref;
}
}
@@ -0,0 +1,78 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)统一返回结果
* <p>
* 业务成败以 success 字段为准(code 仅为成功/错误 messageKey)。
* 结算付款特批(C106-3/4)与收票单(C109-1/2)的 data 内层又包一层同结构包装,
* 取业务数据用 data.data,即 {@code HcsResult<HcsResult<T>>}。
*
* @param <T> 响应数据类型
* @author Chill
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsResult<T> implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 是否成功(必看字段,业务成败以此为准)
*/
private Boolean success;
/**
* 成功/错误的 messageKey,成功为 return.optSuccess
*/
private String code;
/**
* 成功/错误的提示信息
*/
private String msg;
/**
* 返回数据对象,结构以各接口为准
*/
private T data;
/**
* 链路追踪 ID,排查问题时提供给合同合规系统
*/
private String traceId;
/**
* 是否调用成功
*
* @return true-成功
*/
public boolean isSuccess() {
return Boolean.TRUE.equals(success);
}
}
@@ -0,0 +1,50 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)C101-1 客商获取相对方风险等级入参
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsRiskQueryDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 客商编号(必填;用客商哪个编码待联调确认,§9-U6)
*/
private String fdNumber;
}
@@ -0,0 +1,62 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)C101-1 客商获取相对方风险等级出参(结果留痕 blade_hcs_check_log 与合同 hcs_risk_* 字段)
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsRiskVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 相对方ID
*/
private String fdId;
/**
* 客商编号
*/
private String fdNumber;
/**
* 黑名单状态(示例 no)
*/
private String fdBlackStatus;
/**
* 风险等级(示例 "1")
*/
private String fdRiskLevel;
}
@@ -0,0 +1,50 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)C102-1 项目立项新建 保存选项入参
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsSaveOptionDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* false 直接提交,true 仅存草稿(TMS 推送固定 false)
*/
private Boolean saveDraft;
}
@@ -0,0 +1,64 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)C103-1 合同发起 signer 签署方(相对方)入参项
* <p>
* §9-U6 待联调确认:fdNumber(相对方编号体系)与 fdType(inner/外部)判定规则。
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsSignerDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 相对方名称(TMS 甲乙方名称)
*/
private String fdName;
/**
* 相对方编号(按名称反查 CustomerArchive 编码,反查不到留空,§9-U6)
*/
private String fdNumber;
/**
* 单位类型:inner 表示内部单位(判定规则联调确认,§9-U6)
*/
private String fdType;
/**
* 签署地位:甲 / 乙
*/
private String fdStanding;
}
@@ -0,0 +1,58 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)C106-3/C106-4 结算付款特批 formData 节点
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsSpecPayFormDataDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 特批业务字段
*/
private HcsSpecPayPropsDTO dynamicProps;
/**
* 表单层单据主题
*/
private String fdDocSubject;
/**
* 表单层单据状态(配置 spec-pay.doc-status,示例 10)
*/
private String fdDocStatus;
}
@@ -0,0 +1,148 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 合同合规系统(HCS)C106-3/C106-4 结算付款特批 dynamicProps 业务字段(字段名按接口文档下划线原样传值)
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsSpecPayPropsDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 合同(必填,传 HCS 合同ID,非名称)
*/
@JsonProperty("fd_contract_name")
private String fdContractName;
/**
* 合同编号
*/
@JsonProperty("fd_contract_no")
private String fdContractNo;
/**
* 收款账户名
*/
@JsonProperty("fd_receive_account_name")
private String fdReceiveAccountName;
/**
* 收款账号
*/
@JsonProperty("fd_receive_account")
private String fdReceiveAccount;
/**
* 开户行
*/
@JsonProperty("fd_bank_name")
private String fdBankName;
/**
* 收款人
*/
@JsonProperty("fd_payee")
private String fdPayee;
/**
* 付款人
*/
@JsonProperty("fd_payer")
private String fdPayer;
/**
* 付款金额
*/
@JsonProperty("fd_pay_amount")
private BigDecimal fdPayAmount;
/**
* 合计金额
*/
@JsonProperty("fd_total_amount")
private BigDecimal fdTotalAmount;
/**
* 结算币种(名称,如"人民币",映射配置 currency-name-mapping)
*/
@JsonProperty("fd_settle_currency")
private String fdSettleCurrency;
/**
* 付款用途(字典值,配置 spec-pay.payment-purpose,§9-U3)
*/
@JsonProperty("fd_payment_purpose")
private String fdPaymentPurpose;
/**
* 付款性质(字典值,配置 spec-pay.payment-nature,§9-U3)
*/
@JsonProperty("fd_payment_nature")
private String fdPaymentNature;
/**
* 付款类型(字典值,配置 spec-pay.payment-type,§9-U3)
*/
@JsonProperty("fd_payment_type")
private String fdPaymentType;
/**
* 单据编号(TMS 付款单号,来源付款单标识)
*/
@JsonProperty("fd_doc_no")
private String fdDocNo;
/**
* 单据主题("结算付款特批-" + 付款单号)
*/
@JsonProperty("fd_doc_subject")
private String fdDocSubject;
/**
* 单据状态(配置 spec-pay.doc-status,示例 10)
*/
@JsonProperty("fd_doc_status")
private String fdDocStatus;
/**
* 事由
*/
@JsonProperty("fd_reason")
private String fdReason;
/**
* 补充说明
*/
@JsonProperty("fd_supplement_note")
private String fdSupplementNote;
/**
* 来源付款单ID(存 TMS 付款申请主键,D14)
*/
@JsonProperty("fd_id")
private String fdId;
/**
* 特批附件字段标识(固定 fd_spc_approval_attach)
*/
@JsonProperty("fd_spc_approval_attach")
private String fdSpcApprovalAttach;
}
@@ -0,0 +1,66 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)C106-3 结算付款特批流程发起入参(C106-4 更新入参结构相同,复用本 DTO)
* <p>
* fdId 为结算付款流程ID:发起不传;更新必填(发起返回 data.data.fdId,持久化于 hcs_spec_fd_id)。
* 附件经 mechanisms.attachment[] 绑定:发起时带 fdBindType=ADD,更新时不带。
* 发起成功返回双层嵌套 data.data.{fdId, fdXFormId, docViewUrl};更新内层无业务数据,以内层 success 判断。
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsSpecPaySaveDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 结算付款流程ID(发起不传,更新必填)
*/
private String fdId;
/**
* 操作人登录名(必填)
*/
private String fdLoginName;
/**
* 特批表单数据
*/
private HcsSpecPayFormDataDTO formData;
/**
* 附件挂载
*/
private HcsMechanismsDTO mechanisms;
}
@@ -0,0 +1,93 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)C103-6 合同模板列表出参行(fdTemplateId 供 C103-1 合同发起使用)
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsTemplateVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 模板ID
*/
private String fdId;
/**
* 模板名称
*/
private String fdName;
/**
* 模板状态(如 draft)
*/
private String fdStatus;
/**
* 合同性质(如 standard)
*/
private String fdContractCharacter;
/**
* 创建时间(毫秒时间戳)
*/
private Long fdCreateTime;
/**
* 创建人
*/
private HcsRefVO fdCreator;
/**
* 创建部门
*/
private HcsRefVO fdCreatorDept;
/**
* 模板扩展属性(含中文名)
*/
private HcsTemplatePropsVO dynamicProps;
/**
* 合同模板扩展属性
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public static class HcsTemplatePropsVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 模板中文名(template-mapping 校验用)
*/
private String fdNameCn;
}
}
@@ -0,0 +1,63 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)OAuth2 取令牌返回结果(GET /authapi/getToken)
* <p>
* TODO 待联调确认:v4 文档未给出本接口响应字段示例,字段名按通用 OAuth2 惯例预置,
* 联调时以实际返回为准(设计文档 §3.2)。
*
* @author Chill
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsTokenVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 访问令牌,调用业务接口时追加到 URL 参数 access_token
*/
@JsonProperty("access_token")
private String accessToken;
/**
* 令牌类型
*/
@JsonProperty("token_type")
private String tokenType;
/**
* 令牌有效期(毫秒)
*/
@JsonProperty("expires_in")
private Long expiresIn;
}
@@ -0,0 +1,66 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)人员引用对象(人员引用可只传 {fdLoginName},§9-U2 登录名同源性待联调确认)
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsUserRefVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 用户名(可为空)
*/
private String fdName;
/**
* 登录名
*/
private String fdLoginName;
/**
* 仅按登录名引用
*
* @param fdLoginName 登录名
* @return 人员引用对象
*/
public static HcsUserRefVO ofLoginName(String fdLoginName) {
HcsUserRefVO ref = new HcsUserRefVO();
ref.setFdLoginName(fdLoginName);
return ref;
}
}
@@ -0,0 +1,64 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 合同合规系统(HCS)C103-1 合同发起 xformFields 模板字段项(按"字段名+值"逐项传模板字段)
* <p>
* 金额/日期等值均以字符串传递;时间字段需带 fdType=timestamp(如 SIGN_DATE、fdEstimateStartTime)。
*
* @author Chill
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HcsXformFieldDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 模板字段名(如 fdNumber、fdSubject、fdAmount、SIGN_DATE)
*/
private String name;
/**
* 模板字段标签(字段中文名,如"合同编号")
*/
private String label;
/**
* 字段值(字符串传值)
*/
private String value;
/**
* 字段类型标记:时间字段传 timestamp
*/
private String fdType;
}
@@ -0,0 +1,42 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.exception;
/**
* 合同合规系统(HCS)接口异常
*
* @author Chill
*/
public class HcsException extends RuntimeException {
public HcsException(String message) {
super(message);
}
public HcsException(String message, Throwable cause) {
super(message, cause);
}
}
@@ -0,0 +1,338 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.feign;
import feign.Response;
import org.springblade.hcs.config.HcsFeignClientConfig;
import org.springblade.hcs.dto.HcsAttachmentDownloadDTO;
import org.springblade.hcs.dto.HcsAttachmentVO;
import org.springblade.hcs.dto.HcsCategoryVO;
import org.springblade.hcs.dto.HcsContractDetailQueryDTO;
import org.springblade.hcs.dto.HcsContractDraftDTO;
import org.springblade.hcs.dto.HcsContractDraftVO;
import org.springblade.hcs.dto.HcsContractVO;
import org.springblade.hcs.dto.HcsCreditCheckDTO;
import org.springblade.hcs.dto.HcsCreditCheckVO;
import org.springblade.hcs.dto.HcsCurrencyVO;
import org.springblade.hcs.dto.HcsExeplanSyncDTO;
import org.springblade.hcs.dto.HcsExeplanVO;
import org.springblade.hcs.dto.HcsFormSaveVO;
import org.springblade.hcs.dto.HcsIdVO;
import org.springblade.hcs.dto.HcsInvoiceRegAddDTO;
import org.springblade.hcs.dto.HcsInvoiceRegUpdateDTO;
import org.springblade.hcs.dto.HcsInvoiceRegVO;
import org.springblade.hcs.dto.HcsPageQueryDTO;
import org.springblade.hcs.dto.HcsPageVO;
import org.springblade.hcs.dto.HcsPerfRecordSaveDTO;
import org.springblade.hcs.dto.HcsProjectAddDTO;
import org.springblade.hcs.dto.HcsProjectUpdateDTO;
import org.springblade.hcs.dto.HcsProjectVO;
import org.springblade.hcs.dto.HcsReceiptBillSaveDTO;
import org.springblade.hcs.dto.HcsResult;
import org.springblade.hcs.dto.HcsRiskQueryDTO;
import org.springblade.hcs.dto.HcsRiskVO;
import org.springblade.hcs.dto.HcsSpecPaySaveDTO;
import org.springblade.hcs.dto.HcsTemplateVO;
import org.springblade.hcs.dto.HcsTokenVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;
/**
* 合同合规系统(HCS)接口(一期 24 个业务接口 + OAuth2 取令牌,D4)
* <p>
* 除附件上传(multipart/form-data)、附件下载(文件流)外均为 POST + application/json(UTF-8)。
* 业务成败以统一出参 {@link HcsResult#isSuccess()} 为准;
* C106-3/4、C109-1/2 的业务数据在双层嵌套 data.data 中。
*
* @author Chill
*/
@FeignClient(name = "HCS", url = "${thirdParty.hcs.baseUrl}", configuration = HcsFeignClientConfig.class)
public interface IHcsClient {
String GET_TOKEN_URL = "${thirdParty.hcs.getTokenUrl:/authapi/getToken}";
String PROJECT_ADD_URL = "${thirdParty.hcs.projectAddUrl:/openapi/sys-modeling/apis/data/km-project1/V1/projectApproval/add}";
String PROJECT_UPDATE_URL = "${thirdParty.hcs.projectUpdateUrl:/openapi/sys-modeling/apis/data/km-project1/V1/projectApproval/update}";
String PROJECT_LIST_URL = "${thirdParty.hcs.projectListUrl:/openapi/sys-modeling/apis/data/km-project1/V1/projectApproval/list}";
String RELATIVE_RISK_URL = "${thirdParty.hcs.relativeRiskUrl:/openapi/eop-base/eopBaseRelativeOpen/getRelativeRisk}";
String CONTRACT_DRAFT_URL = "${thirdParty.hcs.contractDraftUrl:/openapi/eop-cdraft/eopCdraftMainOpen/draft}";
String CONTRACT_UPDATE_URL = "${thirdParty.hcs.contractUpdateUrl:/openapi/eop-cdraft/eopCdraftMainOpen/updateDraft}";
String CONTRACT_LIST_URL = "${thirdParty.hcs.contractListUrl:/openapi/eop-data/eopDataContractOpen/list}";
String CONTRACT_DETAIL_URL = "${thirdParty.hcs.contractDetailUrl:/openapi/eop-data/eopDataContractOpen/detail}";
String EXEPLAN_ADD_URL = "${thirdParty.hcs.exeplanAddUrl:/openapi/eop-exeplan/eopExeplanMainOpen/add}";
String TEMPLATE_LIST_URL = "${thirdParty.hcs.templateListUrl:/openapi/eop-cdraft/eopCdraftTemplateOpen/list}";
String CATEGORY_LIST_URL = "${thirdParty.hcs.categoryListUrl:/openapi/eop-base/eopBaseContractCategoryOpen/list}";
String CURRENCY_LIST_URL = "${thirdParty.hcs.currencyListUrl:/openapi/eop-base/eopBaseCurrencyOpen/list}";
String ATTACHMENT_UPLOAD_URL = "${thirdParty.hcs.attachmentUploadUrl:/openapi/sys-attach/fileStream/upload}";
String ATTACHMENT_DOWNLOAD_URL = "${thirdParty.hcs.attachmentDownloadUrl:/openapi/sys-attach/fileStream/download}";
String CREDIT_CHECK_URL = "${thirdParty.hcs.creditCheckUrl:/openapi/eop-cdraft/lcode/ext-cdraft/extEopCdraftMainOpen/contractCreditCheck}";
String SPEC_PAY_ADD_URL = "${thirdParty.hcs.specPayAddUrl:/openapi/sys-modeling/lcode/ext-pay-receive/extPayReceiveOpenService/addSpecApplyPay}";
String SPEC_PAY_UPDATE_URL = "${thirdParty.hcs.specPayUpdateUrl:/openapi/sys-modeling/lcode/ext-pay-receive/extPayReceiveOpenService/updateSpecApplyPay}";
String PERF_RECORD_ADD_URL = "${thirdParty.hcs.perfRecordAddUrl:/openapi/sys-modeling/apis/data/km-pay-receive/V1/dataSync/add}";
String PERF_RECORD_UPDATE_URL = "${thirdParty.hcs.perfRecordUpdateUrl:/openapi/sys-modeling/apis/data/km-pay-receive/V1/dataSync/update}";
String RECEIPT_BILL_ADD_URL = "${thirdParty.hcs.receiptBillAddUrl:/openapi/sys-modeling/lcode/ext-invoice-receive/extInvoiceReceiveOpenService/addReceiveBill}";
String RECEIPT_BILL_UPDATE_URL = "${thirdParty.hcs.receiptBillUpdateUrl:/openapi/sys-modeling/lcode/ext-invoice-receive/extInvoiceReceiveOpenService/updateReceiveBill}";
String INVOICE_REG_LIST_URL = "${thirdParty.hcs.invoiceRegListUrl:/openapi/eop-data/eopDataInvoiceRegistrationOpen/list}";
String INVOICE_REG_ADD_URL = "${thirdParty.hcs.invoiceRegAddUrl:/openapi/eop-data/eopDataInvoiceRegistrationOpen/add}";
String INVOICE_REG_UPDATE_URL = "${thirdParty.hcs.invoiceRegUpdateUrl:/openapi/eop-data/eopDataInvoiceRegistrationOpen/update}";
/**
* OAuth2 获取令牌(appKey/appSecret 走 URL 参数,D2)
*
* @param appKey 应用 appKey
* @param appSecret 应用 appSecret
* @return 令牌信息
*/
@GetMapping(GET_TOKEN_URL)
HcsResult<HcsTokenVO> getToken(@RequestParam("appKey") String appKey, @RequestParam("appSecret") String appSecret);
/**
* C102-1 项目立项新建
*
* @param param 请求参数
* @return 项目 fdId / fdXFormId / docViewUrl
*/
@PostMapping(PROJECT_ADD_URL)
HcsResult<HcsFormSaveVO> projectAdd(@RequestBody HcsProjectAddDTO param);
/**
* C102-2 项目立项更新(响应无 data,以 success 判断)
*
* @param param 请求参数(formData.fdId 必填)
* @return 统一出参
*/
@PostMapping(PROJECT_UPDATE_URL)
HcsResult<Void> projectUpdate(@RequestBody HcsProjectUpdateDTO param);
/**
* C102-3 项目立项查询(columns/sorts 用下划线字段名,出参驼峰)
*
* @param param 分页查询参数
* @return 项目立项分页数据
*/
@PostMapping(PROJECT_LIST_URL)
HcsResult<HcsPageVO<HcsProjectVO>> projectList(@RequestBody HcsPageQueryDTO param);
/**
* C101-1 客商获取相对方风险等级
*
* @param param 请求参数
* @return 相对方风险信息
*/
@PostMapping(RELATIVE_RISK_URL)
HcsResult<HcsRiskVO> getRelativeRisk(@RequestBody HcsRiskQueryDTO param);
/**
* C103-1 合同发起传输(合同新建)
*
* @param param 请求参数
* @return 合同 fdContractId(必须持久化)
*/
@PostMapping(CONTRACT_DRAFT_URL)
HcsResult<HcsContractDraftVO> contractDraft(@RequestBody HcsContractDraftDTO param);
/**
* C103-11 合同信息更新(入参同发起,响应无 data,§9-U5 定位已有合同方式待联调)
*
* @param param 请求参数
* @return 统一出参
*/
@PostMapping(CONTRACT_UPDATE_URL)
HcsResult<Void> contractUpdate(@RequestBody HcsContractDraftDTO param);
/**
* C103-3 合同信息列表(判重与对账回查,§9-U4 查询能力联调确认)
*
* @param param 分页查询参数
* @return 合同分页数据
*/
@PostMapping(CONTRACT_LIST_URL)
HcsResult<HcsPageVO<HcsContractVO>> contractList(@RequestBody HcsPageQueryDTO param);
/**
* C103-4 合同详情(fdId 与 fdNumber 二选一)
* <p>
* TODO 待联调确认:出参 data 结构 v4 未定义,暂以对象承接,联调后补充(设计文档 §5.9)
*
* @param param 请求参数
* @return 合同详情(结构待联调确认)
*/
@PostMapping(CONTRACT_DETAIL_URL)
HcsResult<Object> contractDetail(@RequestBody HcsContractDetailQueryDTO param);
/**
* C103-9(新) 合同履约规则同步(行级增删改,与废弃旧接口同路径不同入参,务必用本新版结构)
*
* @param param 请求参数
* @return fdExeplanId 与变更阶段 fdId(均须持久化)
*/
@PostMapping(EXEPLAN_ADD_URL)
HcsResult<HcsExeplanVO> exeplanAdd(@RequestBody HcsExeplanSyncDTO param);
/**
* C103-6 合同模板列表获取(fdTemplateId 供合同发起使用)
*
* @param param 分页查询参数
* @return 合同模板分页数据
*/
@PostMapping(TEMPLATE_LIST_URL)
HcsResult<HcsPageVO<HcsTemplateVO>> templateList(@RequestBody HcsPageQueryDTO param);
/**
* C103-7 合同分类列表查询
*
* @param param 分页查询参数
* @return 合同分类分页数据
*/
@PostMapping(CATEGORY_LIST_URL)
HcsResult<HcsPageVO<HcsCategoryVO>> categoryList(@RequestBody HcsPageQueryDTO param);
/**
* C103-12 合同币种列表查询(开票登记 fdCurrencyId、履约计划币种取自本接口)
*
* @param param 分页查询参数
* @return 币种分页数据
*/
@PostMapping(CURRENCY_LIST_URL)
HcsResult<HcsPageVO<HcsCurrencyVO>> currencyList(@RequestBody HcsPageQueryDTO param);
/**
* C103-2 合同附件上传(multipart/form-data,返回附件 fdId 供各业务接口引用)
*
* @param fdFile 附件文件
* @param fdAnonymous 是否匿名(true/false)
* @param fdLoginName 操作人登录名
* @return 附件 fdId
*/
@PostMapping(value = ATTACHMENT_UPLOAD_URL, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
HcsResult<HcsAttachmentVO> uploadAttachment(@RequestPart("fdFile") MultipartFile fdFile,
@RequestParam(value = "fdAnonymous", required = false) String fdAnonymous,
@RequestParam(value = "fdLoginName", required = false) String fdLoginName);
/**
* C103-5 合同附件下载(对账/排查备用,返回文件流,非 JSON 包装)
*
* @param param 请求参数
* @return 文件流响应
*/
@PostMapping(ATTACHMENT_DOWNLOAD_URL)
Response downloadAttachment(@RequestBody HcsAttachmentDownloadDTO param);
/**
* C106-1 项目/合同额度校验(超额时 success 仍为 true,必须以 data.fdIsCredit 为准)
*
* @param param 请求参数
* @return 额度校验结果
*/
@PostMapping(CREDIT_CHECK_URL)
HcsResult<HcsCreditCheckVO> contractCreditCheck(@RequestBody HcsCreditCheckDTO param);
/**
* C106-3 结算付款特批流程发起(业务数据在双层嵌套 data.data)
*
* @param param 请求参数
* @return data.data.{fdId, fdXFormId, docViewUrl}(fdId 为特批流程ID,更新必传)
*/
@PostMapping(SPEC_PAY_ADD_URL)
HcsResult<HcsResult<HcsFormSaveVO>> addSpecApplyPay(@RequestBody HcsSpecPaySaveDTO param);
/**
* C106-4 结算付款特批流程更新(顶层 fdId 必填,内层无业务数据,以内层 success 判断)
*
* @param param 请求参数
* @return 双层出参
*/
@PostMapping(SPEC_PAY_UPDATE_URL)
HcsResult<HcsResult<Void>> updateSpecApplyPay(@RequestBody HcsSpecPaySaveDTO param);
/**
* C108-1 履约记录新建
*
* @param param 请求参数
* @return 履约记录 fdId(必须持久化)
*/
@PostMapping(PERF_RECORD_ADD_URL)
HcsResult<HcsFormSaveVO> perfRecordAdd(@RequestBody HcsPerfRecordSaveDTO param);
/**
* C108-2 履约记录更新(formData.fdId 必填,响应无 data,success=true 即成功)
*
* @param param 请求参数
* @return 统一出参
*/
@PostMapping(PERF_RECORD_UPDATE_URL)
HcsResult<Void> perfRecordUpdate(@RequestBody HcsPerfRecordSaveDTO param);
/**
* C109-1 收票单新建(业务数据在双层嵌套 data.data)
*
* @param param 请求参数
* @return data.data.{fdId, fdXFormId, docViewUrl}(fdId 为收票单主键,更新必传)
*/
@PostMapping(RECEIPT_BILL_ADD_URL)
HcsResult<HcsResult<HcsFormSaveVO>> addReceiveBill(@RequestBody HcsReceiptBillSaveDTO param);
/**
* C109-2 收票单更新(顶层 fdId 必填,只传变更字段,文档状态无需传递)
*
* @param param 请求参数
* @return 双层出参
*/
@PostMapping(RECEIPT_BILL_UPDATE_URL)
HcsResult<HcsResult<Void>> updateReceiveBill(@RequestBody HcsReceiptBillSaveDTO param);
/**
* C111-1 查询开票登记列表(判重与对账回查,§9-U4 查询能力联调确认)
*
* @param param 分页查询参数
* @return 开票登记分页数据
*/
@PostMapping(INVOICE_REG_LIST_URL)
HcsResult<HcsPageVO<HcsInvoiceRegVO>> invoiceRegistrationList(@RequestBody HcsPageQueryDTO param);
/**
* C111-2 新增开票登记
*
* @param param 请求参数
* @return 开票登记 fdId(必须持久化)
*/
@PostMapping(INVOICE_REG_ADD_URL)
HcsResult<HcsIdVO> invoiceRegistrationAdd(@RequestBody HcsInvoiceRegAddDTO param);
/**
* C111-3 更新开票登记(fdId 必填,金蝶开票完成后回填票据日期/状态)
*
* @param param 请求参数
* @return 开票登记 fdId
*/
@PostMapping(INVOICE_REG_UPDATE_URL)
HcsResult<HcsIdVO> invoiceRegistrationUpdate(@RequestBody HcsInvoiceRegUpdateDTO param);
}
@@ -0,0 +1,99 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.interceptor;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.hcs.config.HcsProperties;
import org.springblade.hcs.constant.HcsConstant;
import org.springblade.hcs.token.HcsTokenService;
import org.springframework.beans.factory.ObjectProvider;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
/**
* 合同合规系统(HCS)请求拦截器,按配置的认证方式注入凭据(D2,两种实现并存、切换不改代码)
* <ul>
* <li>oauth2(默认):GET /authapi/getToken 取令牌后,把 access_token 追加到业务请求 URL;</li>
* <li>basic:注入 Authorization: Basic base64(user:password) 请求头。</li>
* </ul>
* 取令牌请求本身不追加 access_token(路径守卫 + 空令牌守卫双重防护)。
*
* @author Chill
*/
@Slf4j
@RequiredArgsConstructor
public class HcsAuthInterceptor implements RequestInterceptor {
private final HcsProperties properties;
/**
* 惰性持有令牌服务,打破 Feign 客户端与令牌服务的构造期循环依赖
*/
private final ObjectProvider<HcsTokenService> tokenServiceProvider;
@Override
public void apply(RequestTemplate template) {
if (HcsConstant.AUTH_TYPE_BASIC.equals(properties.getAuthType())) {
applyBasicAuth(template);
return;
}
applyOAuth2Token(template);
}
/**
* Basic 认证:注入 Authorization 请求头(凭据走 Nacos + 环境变量注入)
*/
private void applyBasicAuth(RequestTemplate template) {
if (StringUtil.isBlank(properties.getBasicUsername()) || StringUtil.isBlank(properties.getBasicPassword())) {
log.warn("HCS Basic 认证凭据未配置(thirdParty.hcs.basic-username/basic-password),请求 {} 将无认证头", template.path());
return;
}
String credentials = properties.getBasicUsername() + ":" + properties.getBasicPassword();
String encoded = Base64.getEncoder().encodeToString(credentials.getBytes(StandardCharsets.UTF_8));
template.header(HcsConstant.HEADER_AUTHORIZATION, HcsConstant.HEADER_BASIC_PREFIX + encoded);
}
/**
* OAuth2 认证:业务请求 URL 追加 access_token 参数
*/
private void applyOAuth2Token(RequestTemplate template) {
// 取令牌请求本身不再追加 access_token
if (template.path() != null && template.path().contains(HcsConstant.GET_TOKEN_PATH)) {
return;
}
String accessToken = tokenServiceProvider.getObject().getAccessToken();
if (StringUtil.isBlank(accessToken)) {
log.warn("HCS access_token 为空,请求 {} 未追加令牌参数", template.path());
return;
}
template.query(HcsConstant.QUERY_ACCESS_TOKEN, accessToken);
}
}
@@ -0,0 +1,140 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.token;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.hcs.config.HcsProperties;
import org.springblade.hcs.constant.HcsConstant;
import org.springblade.hcs.dto.HcsResult;
import org.springblade.hcs.dto.HcsTokenVO;
import org.springblade.hcs.exception.HcsException;
import org.springblade.hcs.feign.IHcsClient;
import org.springframework.stereotype.Service;
import java.time.Duration;
import java.util.Objects;
/**
* 合同合规系统(HCS)OAuth2 令牌服务(D2,照 BfiServiceImpl 惯例)
* <p>
* GET /authapi/getToken(appKey/appSecret)→ access_token 存 Redis
* (key {@link HcsConstant#HCS_TOKEN_CACHE_KEY},过期前留 120s 缓冲)。
* 业务调用统一经 {@link #getAccessToken()} 取缓存令牌;
* 401 时调用 {@link #refreshAccessToken()} 强制刷新一次后重放(D7,重试职责归扫描任务,此处仅刷新令牌)。
* auth-type=basic 时不走本服务,由拦截器注入 Basic 认证头。
*
* @author Chill
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class HcsTokenService {
private final HcsProperties properties;
private final IHcsClient client;
private final BladeRedis bladeRedis;
/**
* 获取访问令牌:Redis 命中直接返回,未命中远端取令牌并缓存
*
* @return access_token
*/
public String getAccessToken() {
String token = bladeRedis.get(HcsConstant.HCS_TOKEN_CACHE_KEY);
if (StringUtil.isNotBlank(token)) {
return token;
}
return requestToken();
}
/**
* 强制刷新访问令牌(401 时调用一次并重放请求)
*
* @return 新 access_token
*/
public String refreshAccessToken() {
log.info("强制刷新HCS令牌,清除本地缓存");
bladeRedis.del(HcsConstant.HCS_TOKEN_CACHE_KEY);
return requestToken();
}
/**
* 远端取令牌并缓存
*
* @return access_token
*/
private String requestToken() {
if (StringUtil.isBlank(properties.getAppKey()) || StringUtil.isBlank(properties.getAppSecret())) {
throw new HcsException("获取HCS令牌失败,appKey/appSecret 未配置(thirdParty.hcs.app-key/app-secret)");
}
long start = System.currentTimeMillis();
log.info("调用HCS接口 获取令牌开始");
HcsResult<HcsTokenVO> result = client.getToken(properties.getAppKey(), properties.getAppSecret());
log.info("调用HCS接口 获取令牌结束 耗时:{}ms,success:{}", System.currentTimeMillis() - start, result.isSuccess());
if (result == null || !result.isSuccess()) {
log.error("调用HCS接口 获取令牌失败响应:{}", result == null ? "无响应" : String.format("code=%s, msg=%s, traceId=%s",
result.getCode(), result.getMsg(), result.getTraceId()));
throw new HcsException("调用HCS接口获取令牌异常 " + (result == null ? "响应为空" : result.getMsg()));
}
HcsTokenVO tokenVO = result.getData();
if (tokenVO == null || StringUtil.isBlank(tokenVO.getAccessToken())) {
log.error("调用HCS接口 获取令牌返回数据为空");
throw new HcsException("调用HCS接口获取令牌异常,返回数据为空");
}
cacheToken(tokenVO);
return tokenVO.getAccessToken();
}
/**
* 缓存令牌,按 expires_in 毫秒数设置提前失效时间
* <p>
* TODO 待联调确认:v4 未给出 getToken 响应字段示例,expires_in 字段名与单位以实际返回为准(设计文档 §3.2)
*
* @param tokenVO 令牌信息
*/
private void cacheToken(HcsTokenVO tokenVO) {
if (tokenVO.getExpiresIn() == null || tokenVO.getExpiresIn() <= HcsConstant.TOKEN_EXPIRE_BUFFER_MILLIS) {
log.warn("HCS令牌未返回有效期或有效期不足缓冲时长,本次不缓存");
return;
}
// 过期时间 - 缓冲时长,防止刚好过期
long expireMillis = tokenVO.getExpiresIn() - HcsConstant.TOKEN_EXPIRE_BUFFER_MILLIS;
bladeRedis.getValueOps().setIfAbsent(HcsConstant.HCS_TOKEN_CACHE_KEY, tokenVO.getAccessToken(), Duration.ofMillis(expireMillis));
log.info("HCS令牌已缓存,有效期 {}ms(含 {}ms 提前失效缓冲)", expireMillis, HcsConstant.TOKEN_EXPIRE_BUFFER_MILLIS);
}
/**
* 令牌缓存是否命中(诊断用)
*
* @return true-缓存存在
*/
public boolean isTokenCached() {
return StringUtil.isNotBlank(Objects.toString(bladeRedis.get(HcsConstant.HCS_TOKEN_CACHE_KEY), null));
}
}
@@ -0,0 +1,102 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.hcs.util;
import org.springblade.core.tool.utils.Func;
import org.springblade.hcs.dto.HcsPageVO;
import java.util.ArrayList;
import java.util.List;
import java.util.function.IntFunction;
/**
* 合同合规系统(HCS)分页查询通用翻页工具(照 BfiUtil 惯例)
* <p>
* HCS 分页以 offset(从 0 开始)+ pageSize 位移,适用于所有返回 {@link HcsPageVO} 的查询接口
* (C102-3 项目立项查询、C103-3 合同列表、C103-6/7/12 主数据列表、C111-1 开票登记列表等):
* <pre>{@code
* List<HcsProjectVO> rows = HcsPageUtil.queryAllPages(offset -> {
* query.setOffset(offset);
* query.setPageSize(pageSize);
* return hcsClient.projectList(query).getData();
* });
* }</pre>
*
* @author Chill
*/
public class HcsPageUtil {
/**
* 分页查询默认最大页数保护,防止 HCS 侧 totalSize 异常时死循环
*/
public static final int DEFAULT_MAX_PAGES = 50;
private HcsPageUtil() {
}
/**
* HCS 分页查询通用翻页,自动翻页汇总全量数据行(默认最大页数保护)
*
* @param pageFetcher 偏移量 -> 分页结果,lambda 内负责设置 offset(必要时含页大小)并调用接口
* @param <T> 数据行类型
* @return 全量数据行
*/
public static <T> List<T> queryAllPages(IntFunction<HcsPageVO<T>> pageFetcher) {
return queryAllPages(pageFetcher, DEFAULT_MAX_PAGES);
}
/**
* HCS 分页查询通用翻页,自动翻页汇总全量数据行
* <p>
* 终止条件:返回页为空、数据行为空、数据行不满一页(按返回 pageSize 判断)、已取满 totalSize、超出最大页数保护
*
* @param pageFetcher 偏移量 -> 分页结果,lambda 内负责设置 offset(必要时含页大小)并调用接口
* @param maxPages 最大页数保护
* @param <T> 数据行类型
* @return 全量数据行
*/
public static <T> List<T> queryAllPages(IntFunction<HcsPageVO<T>> pageFetcher, int maxPages) {
List<T> rows = new ArrayList<>();
int offset = 0;
for (int pageNo = 1; pageNo <= maxPages; pageNo++) {
HcsPageVO<T> page = pageFetcher.apply(offset);
if (page == null || Func.isEmpty(page.getContent())) {
break;
}
rows.addAll(page.getContent());
// 已取满总数时无需继续翻页
if (page.getTotalSize() != null && rows.size() >= page.getTotalSize()) {
break;
}
// 末页数据不满一页时无需继续翻页(返回 pageSize 为空时依赖 totalSize 与最大页数保护)
if (page.getPageSize() != null && page.getContent().size() < page.getPageSize()) {
break;
}
offset += page.getContent().size();
}
return rows;
}
}
+1
View File
@@ -20,6 +20,7 @@
<module>blade-track-api</module>
<module>blade-wechat-api</module>
<module>blade-bfi-api</module>
<module>blade-hcs-api</module>
</modules>
<packaging>pom</packaging>
<description>BladeX 第三方API集合</description>
+80
View File
@@ -64,3 +64,83 @@ thirdParty:
syncEnabled: ${BFI_PAY_RESULT_SYNC_ENABLED:false}
# 调度 cron,默认每10分钟
cron: ${BFI_PAY_RESULT_CRON:0 */10 * * * ?}
hcs:
# 合同合规系统(HCS)开放接口地址,直连可配(网关/iPaaS 部署时改此处,代码不感知)
base-url: ${HCS_BASE_URL:http://127.0.0.1:8050}
# 认证方式:oauth2(默认,URL 追加 access_token)| basic(Authorization 请求头),切换不改代码
auth-type: ${HCS_AUTH_TYPE:oauth2}
# OAuth2 应用 appKey
app-key: ${HCS_APP_KEY:}
# OAuth2 应用 appSecret,敏感值通过环境变量注入
app-secret: ${HCS_APP_SECRET:}
# Basic 认证用户名/密码(auth-type=basic 时生效)
basic-username: ${HCS_BASIC_USER:}
basic-password: ${HCS_BASIC_PASSWORD:}
# 来源系统标识(fd_sources,约定值 TMS)
src-system: ${HCS_SRC_SYSTEM:TMS}
# 推送任务(扫描首推/补偿,P1 接线)
push:
# 总开关(默认关,灰度打开)
sync-enabled: ${HCS_PUSH_SYNC_ENABLED:false}
# 扫描调度 cron,默认每5分钟
cron: ${HCS_PUSH_CRON:0 */5 * * * ?}
# 每类单据单轮扫描批量
batch-size: ${HCS_PUSH_BATCH_SIZE:50}
# 推送失败自动重试上限,超限仅人工重推
max-retry: ${HCS_PUSH_MAX_RETRY:5}
# 项目立项(C102)
project:
# 立项 bpmOperation.templateCode(环境相关值,§9-U9 待合规方提供)
template-code: ${HCS_PROJECT_TEMPLATE_CODE:}
# 合同(C103-1/11)
contract:
# TMS 合同类别 -> HCS 模板ID(§9-U7 待合规方提供模板清单)
template-mapping: {}
# TMS 结算方式 -> 付款|收款(§9-U3 字典映射待联调)
settlement-type-mapping: {}
# TMS 币种码 -> HCS 币种名称(照金蝶 RMB->CNY 映射惯例)
currency-name-mapping: {"RMB": "人民币"}
# 合同 fdSepcailContract 固定 false(D15,配置项预留)
special-contract-enabled: ${HCS_CONTRACT_SPECIAL_ENABLED:false}
# 合同推送前是否强制客商风险校验
require-risk-check: ${HCS_CONTRACT_REQUIRE_RISK_CHECK:true}
# 履约规则(C103-9)
exe-stage:
# 金额类型默认值(fdFundType)
fund-type: ${HCS_EXE_STAGE_FUND_TYPE:byAmount}
# 客商风险校验(C101-1)
risk:
check-on-contract: ${HCS_RISK_CHECK_ON_CONTRACT:true}
check-on-payment: ${HCS_RISK_CHECK_ON_PAYMENT:true}
# 黑名单是否阻断(合同置 failed / 付款提交拦截)
block-blacklist: ${HCS_RISK_BLOCK_BLACKLIST:true}
# 额度校验(C106-1)
credit:
# 付款提交校验是否要求合同已推送合规
require-contract-synced: ${HCS_CREDIT_REQUIRE_CONTRACT_SYNCED:true}
# 结算付款特批(C106-3/4)
spec-pay:
# 单据状态(示例 10)
doc-status: ${HCS_SPEC_PAY_DOC_STATUS:10}
# 付款用途/性质/类型字典值(§9-U3 待联调后配置)
payment-purpose: ${HCS_SPEC_PAY_PAYMENT_PURPOSE:}
payment-nature: ${HCS_SPEC_PAY_PAYMENT_NATURE:}
payment-type: ${HCS_SPEC_PAY_PAYMENT_TYPE:}
# 开票登记(C111)
invoice:
# TMS 发票类型 -> HCS 发票类型字典值(§9-U3 待联调后配置)
invoice-type-mapping: {"electronic_normal": "", "electronic_special": ""}
# TMS 币种码 -> HCS 币种 fdId(经 C103-12 币种表缓存取值,§9-U3 待联调后配置)
currency-id-mapping: {"RMB": ""}
# 款项性质默认值(fdFundNature)
fund-nature-default: ${HCS_INVOICE_FUND_NATURE_DEFAULT:progress}
# 收票单(C109)
receipt-bill:
# TMS 发票类型 -> HCS 收票发票类型字典值(§9-U3 待联调后配置)
invoice-type-mapping: {}
# 附件转传(C103-2)
attachment:
# 附件转传总开关
transfer-enabled: ${HCS_ATTACHMENT_TRANSFER_ENABLED:true}
# TMS 文件服务下载基址(拉取附件流用)
file-download-base: ${HCS_ATTACHMENT_FILE_DOWNLOAD_BASE:}
@@ -0,0 +1,191 @@
-- 桂物合同合规系统(HCS)接入:业务表统一集成字段组(设计文档 §4,P0)。
-- blade_project_apply / blade_contract_manage / blade_payment_application /
-- blade_invoice_application / blade_invoice_receipt 统一追加 hcs_* 五列;
-- 后续阶段按 §8 排期再追加各场景扩展字段(履约计划ID、风险留痕、特批字段组等)。
-- 通过 information_schema 判断字段是否存在,可重复执行。
SET @db_name = DATABASE();
-- ==================== blade_project_apply(C102 立项回填) ====================
SET @sql = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = @db_name AND table_name = 'blade_project_apply' AND column_name = 'hcs_fd_id'),
'SELECT 1',
'ALTER TABLE blade_project_apply ADD COLUMN hcs_fd_id varchar(64) DEFAULT NULL COMMENT ''合规系统单据ID(fdId/fdContractId)'''
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = @db_name AND table_name = 'blade_project_apply' AND column_name = 'hcs_sync_status'),
'SELECT 1',
'ALTER TABLE blade_project_apply ADD COLUMN hcs_sync_status varchar(16) DEFAULT ''unsynced'' COMMENT ''同步状态 unsynced/synced/failed'''
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = @db_name AND table_name = 'blade_project_apply' AND column_name = 'hcs_retry_count'),
'SELECT 1',
'ALTER TABLE blade_project_apply ADD COLUMN hcs_retry_count int DEFAULT 0 COMMENT ''推送失败重试次数'''
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = @db_name AND table_name = 'blade_project_apply' AND column_name = 'hcs_sync_time'),
'SELECT 1',
'ALTER TABLE blade_project_apply ADD COLUMN hcs_sync_time datetime DEFAULT NULL COMMENT ''最近同步时间'''
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = @db_name AND table_name = 'blade_project_apply' AND column_name = 'hcs_sync_msg'),
'SELECT 1',
'ALTER TABLE blade_project_apply ADD COLUMN hcs_sync_msg varchar(512) DEFAULT NULL COMMENT ''最近同步结果信息/失败原因'''
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
-- ==================== blade_contract_manage(C103 合同回填) ====================
SET @sql = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = @db_name AND table_name = 'blade_contract_manage' AND column_name = 'hcs_fd_id'),
'SELECT 1',
'ALTER TABLE blade_contract_manage ADD COLUMN hcs_fd_id varchar(64) DEFAULT NULL COMMENT ''合规系统单据ID(fdId/fdContractId)'''
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = @db_name AND table_name = 'blade_contract_manage' AND column_name = 'hcs_sync_status'),
'SELECT 1',
'ALTER TABLE blade_contract_manage ADD COLUMN hcs_sync_status varchar(16) DEFAULT ''unsynced'' COMMENT ''同步状态 unsynced/synced/failed'''
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = @db_name AND table_name = 'blade_contract_manage' AND column_name = 'hcs_retry_count'),
'SELECT 1',
'ALTER TABLE blade_contract_manage ADD COLUMN hcs_retry_count int DEFAULT 0 COMMENT ''推送失败重试次数'''
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = @db_name AND table_name = 'blade_contract_manage' AND column_name = 'hcs_sync_time'),
'SELECT 1',
'ALTER TABLE blade_contract_manage ADD COLUMN hcs_sync_time datetime DEFAULT NULL COMMENT ''最近同步时间'''
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = @db_name AND table_name = 'blade_contract_manage' AND column_name = 'hcs_sync_msg'),
'SELECT 1',
'ALTER TABLE blade_contract_manage ADD COLUMN hcs_sync_msg varchar(512) DEFAULT NULL COMMENT ''最近同步结果信息/失败原因'''
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
-- ==================== blade_payment_application(C106 额度/特批、C108 履约记录) ====================
SET @sql = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = @db_name AND table_name = 'blade_payment_application' AND column_name = 'hcs_fd_id'),
'SELECT 1',
'ALTER TABLE blade_payment_application ADD COLUMN hcs_fd_id varchar(64) DEFAULT NULL COMMENT ''合规系统单据ID(fdId/fdContractId)'''
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = @db_name AND table_name = 'blade_payment_application' AND column_name = 'hcs_sync_status'),
'SELECT 1',
'ALTER TABLE blade_payment_application ADD COLUMN hcs_sync_status varchar(16) DEFAULT ''unsynced'' COMMENT ''同步状态 unsynced/synced/failed'''
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = @db_name AND table_name = 'blade_payment_application' AND column_name = 'hcs_retry_count'),
'SELECT 1',
'ALTER TABLE blade_payment_application ADD COLUMN hcs_retry_count int DEFAULT 0 COMMENT ''推送失败重试次数'''
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = @db_name AND table_name = 'blade_payment_application' AND column_name = 'hcs_sync_time'),
'SELECT 1',
'ALTER TABLE blade_payment_application ADD COLUMN hcs_sync_time datetime DEFAULT NULL COMMENT ''最近同步时间'''
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = @db_name AND table_name = 'blade_payment_application' AND column_name = 'hcs_sync_msg'),
'SELECT 1',
'ALTER TABLE blade_payment_application ADD COLUMN hcs_sync_msg varchar(512) DEFAULT NULL COMMENT ''最近同步结果信息/失败原因'''
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
-- ==================== blade_invoice_application(C111 开票登记回填) ====================
SET @sql = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = @db_name AND table_name = 'blade_invoice_application' AND column_name = 'hcs_fd_id'),
'SELECT 1',
'ALTER TABLE blade_invoice_application ADD COLUMN hcs_fd_id varchar(64) DEFAULT NULL COMMENT ''合规系统单据ID(fdId/fdContractId)'''
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = @db_name AND table_name = 'blade_invoice_application' AND column_name = 'hcs_sync_status'),
'SELECT 1',
'ALTER TABLE blade_invoice_application ADD COLUMN hcs_sync_status varchar(16) DEFAULT ''unsynced'' COMMENT ''同步状态 unsynced/synced/failed'''
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = @db_name AND table_name = 'blade_invoice_application' AND column_name = 'hcs_retry_count'),
'SELECT 1',
'ALTER TABLE blade_invoice_application ADD COLUMN hcs_retry_count int DEFAULT 0 COMMENT ''推送失败重试次数'''
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = @db_name AND table_name = 'blade_invoice_application' AND column_name = 'hcs_sync_time'),
'SELECT 1',
'ALTER TABLE blade_invoice_application ADD COLUMN hcs_sync_time datetime DEFAULT NULL COMMENT ''最近同步时间'''
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = @db_name AND table_name = 'blade_invoice_application' AND column_name = 'hcs_sync_msg'),
'SELECT 1',
'ALTER TABLE blade_invoice_application ADD COLUMN hcs_sync_msg varchar(512) DEFAULT NULL COMMENT ''最近同步结果信息/失败原因'''
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
-- ==================== blade_invoice_receipt(C109 收票单回填) ====================
SET @sql = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = @db_name AND table_name = 'blade_invoice_receipt' AND column_name = 'hcs_fd_id'),
'SELECT 1',
'ALTER TABLE blade_invoice_receipt ADD COLUMN hcs_fd_id varchar(64) DEFAULT NULL COMMENT ''合规系统单据ID(fdId/fdContractId)'''
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = @db_name AND table_name = 'blade_invoice_receipt' AND column_name = 'hcs_sync_status'),
'SELECT 1',
'ALTER TABLE blade_invoice_receipt ADD COLUMN hcs_sync_status varchar(16) DEFAULT ''unsynced'' COMMENT ''同步状态 unsynced/synced/failed'''
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = @db_name AND table_name = 'blade_invoice_receipt' AND column_name = 'hcs_retry_count'),
'SELECT 1',
'ALTER TABLE blade_invoice_receipt ADD COLUMN hcs_retry_count int DEFAULT 0 COMMENT ''推送失败重试次数'''
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = @db_name AND table_name = 'blade_invoice_receipt' AND column_name = 'hcs_sync_time'),
'SELECT 1',
'ALTER TABLE blade_invoice_receipt ADD COLUMN hcs_sync_time datetime DEFAULT NULL COMMENT ''最近同步时间'''
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = @db_name AND table_name = 'blade_invoice_receipt' AND column_name = 'hcs_sync_msg'),
'SELECT 1',
'ALTER TABLE blade_invoice_receipt ADD COLUMN hcs_sync_msg varchar(512) DEFAULT NULL COMMENT ''最近同步结果信息/失败原因'''
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;