diff --git a/blade-third-party-api/blade-hcs-api/pom.xml b/blade-third-party-api/blade-hcs-api/pom.xml new file mode 100644 index 00000000..f5885238 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/pom.xml @@ -0,0 +1,38 @@ + + + 4.0.0 + + org.springblade + blade-third-party-api + ${revision} + + + blade-hcs-api + ${project.artifactId} + jar + BladeX 合同合规系统(HCS)API 契约模块 + + + + org.springblade + blade-starter-redis + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.2.5 + + + + diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/config/HcsFeignClientConfig.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/config/HcsFeignClientConfig.java new file mode 100644 index 00000000..bf241369 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/config/HcsFeignClientConfig.java @@ -0,0 +1,75 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 客户端配置 + *

+ * 仅通过 {@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 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); + } +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/config/HcsProperties.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/config/HcsProperties.java new file mode 100644 index 00000000..a753f6b4 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/config/HcsProperties.java @@ -0,0 +1,255 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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)配置类 + *

+ * 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 templateMapping = new HashMap<>(); + /** + * TMS 结算方式 -> 付款|收款(fdSettlementType,§9-U3 字典映射待联调) + */ + private Map settlementTypeMapping = new HashMap<>(); + /** + * TMS 币种码 -> HCS 币种名称(照金蝶 RMB->CNY 映射惯例) + */ + private Map 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 invoiceTypeMapping = new HashMap<>(); + /** + * TMS 币种码 -> HCS 币种 fdId(经 C103-12 币种表缓存取值,§9-U3 待联调后配置) + */ + private Map currencyIdMapping = new HashMap<>(); + /** + * 开票登记款项性质默认值(fdFundNature) + */ + private String fundNatureDefault = "progress"; + } + + @Data + public static class ReceiptBill { + /** + * TMS 发票类型 -> HCS 收票发票类型字典值(§9-U3 待联调后配置) + */ + private Map invoiceTypeMapping = new HashMap<>(); + } + + @Data + public static class Attachment { + /** + * 附件转传总开关 + */ + private boolean transferEnabled = true; + /** + * TMS 文件服务下载基址(拉取附件流用) + */ + private String fileDownloadBase = ""; + } +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/config/ThirdPartyHcsAutoConfiguration.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/config/ThirdPartyHcsAutoConfiguration.java new file mode 100644 index 00000000..1331c36a --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/config/ThirdPartyHcsAutoConfiguration.java @@ -0,0 +1,41 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 { +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/constant/HcsConstant.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/constant/HcsConstant.java new file mode 100644 index 00000000..a8fd786c --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/constant/HcsConstant.java @@ -0,0 +1,79 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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"; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsAttachmentDownloadDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsAttachmentDownloadDTO.java new file mode 100644 index 00000000..95c56a68 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsAttachmentDownloadDTO.java @@ -0,0 +1,50 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsAttachmentRefDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsAttachmentRefDTO.java new file mode 100644 index 00000000..65a5d05e --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsAttachmentRefDTO.java @@ -0,0 +1,70 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsAttachmentVO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsAttachmentVO.java new file mode 100644 index 00000000..6b8db430 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsAttachmentVO.java @@ -0,0 +1,50 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsBpmOperationDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsBpmOperationDTO.java new file mode 100644 index 00000000..50512898 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsBpmOperationDTO.java @@ -0,0 +1,54 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsCategoryVO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsCategoryVO.java new file mode 100644 index 00000000..a477400e --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsCategoryVO.java @@ -0,0 +1,62 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsContractDetailQueryDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsContractDetailQueryDTO.java new file mode 100644 index 00000000..6075cf10 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsContractDetailQueryDTO.java @@ -0,0 +1,56 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 二选一) + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsContractDraftDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsContractDraftDTO.java new file mode 100644 index 00000000..8f0f98a6 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsContractDraftDTO.java @@ -0,0 +1,66 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsContractDraftVO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsContractDraftVO.java new file mode 100644 index 00000000..60d815e9 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsContractDraftVO.java @@ -0,0 +1,50 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsContractFieldJsonDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsContractFieldJsonDTO.java new file mode 100644 index 00000000..702bcbea --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsContractFieldJsonDTO.java @@ -0,0 +1,57 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 更新共用) + *

+ * §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 xformFields; + /** + * 签署方(相对方)列表 + */ + private List signer; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsContractVO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsContractVO.java new file mode 100644 index 00000000..f3285515 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsContractVO.java @@ -0,0 +1,62 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsCreditCheckDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsCreditCheckDTO.java new file mode 100644 index 00000000..c014ed49 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsCreditCheckDTO.java @@ -0,0 +1,55 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsCreditCheckVO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsCreditCheckVO.java new file mode 100644 index 00000000..51f2e437 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsCreditCheckVO.java @@ -0,0 +1,69 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 项目/合同额度校验出参 + *

+ * 注意:超额时外层 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsCurrencyVO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsCurrencyVO.java new file mode 100644 index 00000000..09d2a3fe --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsCurrencyVO.java @@ -0,0 +1,78 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsExeplanStageDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsExeplanStageDTO.java new file mode 100644 index 00000000..1f6246c3 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsExeplanStageDTO.java @@ -0,0 +1,93 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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) + *

+ * 新增行可不带 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsExeplanStageVO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsExeplanStageVO.java new file mode 100644 index 00000000..325b6081 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsExeplanStageVO.java @@ -0,0 +1,97 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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(新) 履约规则同步出参-变更阶段行 + *

+ * 合规返回的阶段 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsExeplanSyncDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsExeplanSyncDTO.java new file mode 100644 index 00000000..d8946967 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsExeplanSyncDTO.java @@ -0,0 +1,74 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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(新) 合同履约规则同步入参(支持整批增删改) + *

+ * 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 fdStages; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsExeplanVO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsExeplanVO.java new file mode 100644 index 00000000..973ff964 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsExeplanVO.java @@ -0,0 +1,55 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 fdChangeStages; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsFormSaveVO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsFormSaveVO.java new file mode 100644 index 00000000..ae17ae93 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsFormSaveVO.java @@ -0,0 +1,58 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsIdVO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsIdVO.java new file mode 100644 index 00000000..1f51c6aa --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsIdVO.java @@ -0,0 +1,50 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsInvoiceRegAddDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsInvoiceRegAddDTO.java new file mode 100644 index 00000000..e1d90bf1 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsInvoiceRegAddDTO.java @@ -0,0 +1,103 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 新增开票登记入参 + *

+ * 校验: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 fdAttIds; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsInvoiceRegUpdateDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsInvoiceRegUpdateDTO.java new file mode 100644 index 00000000..44465dfb --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsInvoiceRegUpdateDTO.java @@ -0,0 +1,53 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 更新开票登记入参(金蝶开票完成后回填票据日期/状态) + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsInvoiceRegVO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsInvoiceRegVO.java new file mode 100644 index 00000000..202e8fc9 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsInvoiceRegVO.java @@ -0,0 +1,127 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsMechanismsDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsMechanismsDTO.java new file mode 100644 index 00000000..b2c1fc8c --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsMechanismsDTO.java @@ -0,0 +1,51 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 attachment; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsPageQueryDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsPageQueryDTO.java new file mode 100644 index 00000000..15a2a201 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsPageQueryDTO.java @@ -0,0 +1,75 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 分页与查询约定,各查询接口通用) + *

+ * 注意: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 columns; + /** + * 查询条件,空对象表示无条件;支持操作符,如 {"fdName": {"$contains": "xx"}}(包含匹配) + */ + private Map conditions; + /** + * 分页偏移量(必填,从 0 开始) + */ + private Integer offset; + /** + * 每页条数(必填) + */ + private Integer pageSize; + /** + * 排序条件,如 {"fdCreateTime": "desc"} + */ + private Map sorts; + /** + * 当前操作人(C102-3 项目立项查询需携带,其余查询接口按需) + */ + private HcsUserRefVO curUser; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsPageVO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsPageVO.java new file mode 100644 index 00000000..14b4cbbb --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsPageVO.java @@ -0,0 +1,62 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 数据行类型 + * @author Chill + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class HcsPageVO implements Serializable { + @Serial + private static final long serialVersionUID = 1L; + /** + * 数据列表 + */ + private List content; + /** + * 分页偏移量(从 0 开始) + */ + private Integer offset; + /** + * 每页条数 + */ + private Integer pageSize; + /** + * 总条数 + */ + private Integer totalSize; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsPerfRecordFormDataDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsPerfRecordFormDataDTO.java new file mode 100644 index 00000000..16f41bbe --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsPerfRecordFormDataDTO.java @@ -0,0 +1,66 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsPerfRecordPropsDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsPerfRecordPropsDTO.java new file mode 100644 index 00000000..799bb389 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsPerfRecordPropsDTO.java @@ -0,0 +1,110 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 业务字段(字段名按接口文档下划线原样传值) + *

+ * 注意: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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsPerfRecordSaveDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsPerfRecordSaveDTO.java new file mode 100644 index 00000000..362d8539 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsPerfRecordSaveDTO.java @@ -0,0 +1,61 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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) + *

+ * 更新时 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsProjectAddDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsProjectAddDTO.java new file mode 100644 index 00000000..090c421c --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsProjectAddDTO.java @@ -0,0 +1,66 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsProjectFormDataDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsProjectFormDataDTO.java new file mode 100644 index 00000000..b635d2f8 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsProjectFormDataDTO.java @@ -0,0 +1,54 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsProjectPropsDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsProjectPropsDTO.java new file mode 100644 index 00000000..e63ed1b4 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsProjectPropsDTO.java @@ -0,0 +1,149 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsProjectUpdateDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsProjectUpdateDTO.java new file mode 100644 index 00000000..f830a2e6 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsProjectUpdateDTO.java @@ -0,0 +1,50 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 项目立项更新入参 + *

+ * 入参结构与新建一致(去掉 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsProjectVO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsProjectVO.java new file mode 100644 index 00000000..edfc4f41 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsProjectVO.java @@ -0,0 +1,60 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 项目立项查询出参行 + *

+ * 注意:本接口入参 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsReceiptBillFormDataDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsReceiptBillFormDataDTO.java new file mode 100644 index 00000000..50fea9bd --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsReceiptBillFormDataDTO.java @@ -0,0 +1,54 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsReceiptBillPropsDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsReceiptBillPropsDTO.java new file mode 100644 index 00000000..2f5c6256 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsReceiptBillPropsDTO.java @@ -0,0 +1,105 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 业务字段(字段名按接口文档下划线原样传值) + *

+ * §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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsReceiptBillSaveDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsReceiptBillSaveDTO.java new file mode 100644 index 00000000..830b7edf --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsReceiptBillSaveDTO.java @@ -0,0 +1,67 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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) + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsRefVO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsRefVO.java new file mode 100644 index 00000000..92cd5185 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsRefVO.java @@ -0,0 +1,66 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + } +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsResult.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsResult.java new file mode 100644 index 00000000..50645b9a --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsResult.java @@ -0,0 +1,78 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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)统一返回结果 + *

+ * 业务成败以 success 字段为准(code 仅为成功/错误 messageKey)。 + * 结算付款特批(C106-3/4)与收票单(C109-1/2)的 data 内层又包一层同结构包装, + * 取业务数据用 data.data,即 {@code HcsResult>}。 + * + * @param 响应数据类型 + * @author Chill + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class HcsResult 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); + } +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsRiskQueryDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsRiskQueryDTO.java new file mode 100644 index 00000000..d5ed92c2 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsRiskQueryDTO.java @@ -0,0 +1,50 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsRiskVO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsRiskVO.java new file mode 100644 index 00000000..8a88b2c7 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsRiskVO.java @@ -0,0 +1,62 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsSaveOptionDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsSaveOptionDTO.java new file mode 100644 index 00000000..f39bbaba --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsSaveOptionDTO.java @@ -0,0 +1,50 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsSignerDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsSignerDTO.java new file mode 100644 index 00000000..4badd703 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsSignerDTO.java @@ -0,0 +1,64 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 签署方(相对方)入参项 + *

+ * §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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsSpecPayFormDataDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsSpecPayFormDataDTO.java new file mode 100644 index 00000000..74415c31 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsSpecPayFormDataDTO.java @@ -0,0 +1,58 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsSpecPayPropsDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsSpecPayPropsDTO.java new file mode 100644 index 00000000..d2ddbce8 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsSpecPayPropsDTO.java @@ -0,0 +1,148 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsSpecPaySaveDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsSpecPaySaveDTO.java new file mode 100644 index 00000000..a184785d --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsSpecPaySaveDTO.java @@ -0,0 +1,66 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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) + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsTemplateVO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsTemplateVO.java new file mode 100644 index 00000000..c0270741 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsTemplateVO.java @@ -0,0 +1,93 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + } +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsTokenVO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsTokenVO.java new file mode 100644 index 00000000..211bd6df --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsTokenVO.java @@ -0,0 +1,63 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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) + *

+ * 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsUserRefVO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsUserRefVO.java new file mode 100644 index 00000000..ffb482a2 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsUserRefVO.java @@ -0,0 +1,66 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + } +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsXformFieldDTO.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsXformFieldDTO.java new file mode 100644 index 00000000..6f0d71c2 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/dto/HcsXformFieldDTO.java @@ -0,0 +1,64 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 模板字段项(按"字段名+值"逐项传模板字段) + *

+ * 金额/日期等值均以字符串传递;时间字段需带 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; +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/exception/HcsException.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/exception/HcsException.java new file mode 100644 index 00000000..03091db3 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/exception/HcsException.java @@ -0,0 +1,42 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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); + } +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/feign/IHcsClient.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/feign/IHcsClient.java new file mode 100644 index 00000000..7b4a0eb7 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/feign/IHcsClient.java @@ -0,0 +1,338 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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) + *

+ * 除附件上传(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 getToken(@RequestParam("appKey") String appKey, @RequestParam("appSecret") String appSecret); + + /** + * C102-1 项目立项新建 + * + * @param param 请求参数 + * @return 项目 fdId / fdXFormId / docViewUrl + */ + @PostMapping(PROJECT_ADD_URL) + HcsResult projectAdd(@RequestBody HcsProjectAddDTO param); + + /** + * C102-2 项目立项更新(响应无 data,以 success 判断) + * + * @param param 请求参数(formData.fdId 必填) + * @return 统一出参 + */ + @PostMapping(PROJECT_UPDATE_URL) + HcsResult projectUpdate(@RequestBody HcsProjectUpdateDTO param); + + /** + * C102-3 项目立项查询(columns/sorts 用下划线字段名,出参驼峰) + * + * @param param 分页查询参数 + * @return 项目立项分页数据 + */ + @PostMapping(PROJECT_LIST_URL) + HcsResult> projectList(@RequestBody HcsPageQueryDTO param); + + /** + * C101-1 客商获取相对方风险等级 + * + * @param param 请求参数 + * @return 相对方风险信息 + */ + @PostMapping(RELATIVE_RISK_URL) + HcsResult getRelativeRisk(@RequestBody HcsRiskQueryDTO param); + + /** + * C103-1 合同发起传输(合同新建) + * + * @param param 请求参数 + * @return 合同 fdContractId(必须持久化) + */ + @PostMapping(CONTRACT_DRAFT_URL) + HcsResult contractDraft(@RequestBody HcsContractDraftDTO param); + + /** + * C103-11 合同信息更新(入参同发起,响应无 data,§9-U5 定位已有合同方式待联调) + * + * @param param 请求参数 + * @return 统一出参 + */ + @PostMapping(CONTRACT_UPDATE_URL) + HcsResult contractUpdate(@RequestBody HcsContractDraftDTO param); + + /** + * C103-3 合同信息列表(判重与对账回查,§9-U4 查询能力联调确认) + * + * @param param 分页查询参数 + * @return 合同分页数据 + */ + @PostMapping(CONTRACT_LIST_URL) + HcsResult> contractList(@RequestBody HcsPageQueryDTO param); + + /** + * C103-4 合同详情(fdId 与 fdNumber 二选一) + *

+ * TODO 待联调确认:出参 data 结构 v4 未定义,暂以对象承接,联调后补充(设计文档 §5.9) + * + * @param param 请求参数 + * @return 合同详情(结构待联调确认) + */ + @PostMapping(CONTRACT_DETAIL_URL) + HcsResult contractDetail(@RequestBody HcsContractDetailQueryDTO param); + + /** + * C103-9(新) 合同履约规则同步(行级增删改,与废弃旧接口同路径不同入参,务必用本新版结构) + * + * @param param 请求参数 + * @return fdExeplanId 与变更阶段 fdId(均须持久化) + */ + @PostMapping(EXEPLAN_ADD_URL) + HcsResult exeplanAdd(@RequestBody HcsExeplanSyncDTO param); + + /** + * C103-6 合同模板列表获取(fdTemplateId 供合同发起使用) + * + * @param param 分页查询参数 + * @return 合同模板分页数据 + */ + @PostMapping(TEMPLATE_LIST_URL) + HcsResult> templateList(@RequestBody HcsPageQueryDTO param); + + /** + * C103-7 合同分类列表查询 + * + * @param param 分页查询参数 + * @return 合同分类分页数据 + */ + @PostMapping(CATEGORY_LIST_URL) + HcsResult> categoryList(@RequestBody HcsPageQueryDTO param); + + /** + * C103-12 合同币种列表查询(开票登记 fdCurrencyId、履约计划币种取自本接口) + * + * @param param 分页查询参数 + * @return 币种分页数据 + */ + @PostMapping(CURRENCY_LIST_URL) + HcsResult> 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 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 contractCreditCheck(@RequestBody HcsCreditCheckDTO param); + + /** + * C106-3 结算付款特批流程发起(业务数据在双层嵌套 data.data) + * + * @param param 请求参数 + * @return data.data.{fdId, fdXFormId, docViewUrl}(fdId 为特批流程ID,更新必传) + */ + @PostMapping(SPEC_PAY_ADD_URL) + HcsResult> addSpecApplyPay(@RequestBody HcsSpecPaySaveDTO param); + + /** + * C106-4 结算付款特批流程更新(顶层 fdId 必填,内层无业务数据,以内层 success 判断) + * + * @param param 请求参数 + * @return 双层出参 + */ + @PostMapping(SPEC_PAY_UPDATE_URL) + HcsResult> updateSpecApplyPay(@RequestBody HcsSpecPaySaveDTO param); + + /** + * C108-1 履约记录新建 + * + * @param param 请求参数 + * @return 履约记录 fdId(必须持久化) + */ + @PostMapping(PERF_RECORD_ADD_URL) + HcsResult perfRecordAdd(@RequestBody HcsPerfRecordSaveDTO param); + + /** + * C108-2 履约记录更新(formData.fdId 必填,响应无 data,success=true 即成功) + * + * @param param 请求参数 + * @return 统一出参 + */ + @PostMapping(PERF_RECORD_UPDATE_URL) + HcsResult perfRecordUpdate(@RequestBody HcsPerfRecordSaveDTO param); + + /** + * C109-1 收票单新建(业务数据在双层嵌套 data.data) + * + * @param param 请求参数 + * @return data.data.{fdId, fdXFormId, docViewUrl}(fdId 为收票单主键,更新必传) + */ + @PostMapping(RECEIPT_BILL_ADD_URL) + HcsResult> addReceiveBill(@RequestBody HcsReceiptBillSaveDTO param); + + /** + * C109-2 收票单更新(顶层 fdId 必填,只传变更字段,文档状态无需传递) + * + * @param param 请求参数 + * @return 双层出参 + */ + @PostMapping(RECEIPT_BILL_UPDATE_URL) + HcsResult> updateReceiveBill(@RequestBody HcsReceiptBillSaveDTO param); + + /** + * C111-1 查询开票登记列表(判重与对账回查,§9-U4 查询能力联调确认) + * + * @param param 分页查询参数 + * @return 开票登记分页数据 + */ + @PostMapping(INVOICE_REG_LIST_URL) + HcsResult> invoiceRegistrationList(@RequestBody HcsPageQueryDTO param); + + /** + * C111-2 新增开票登记 + * + * @param param 请求参数 + * @return 开票登记 fdId(必须持久化) + */ + @PostMapping(INVOICE_REG_ADD_URL) + HcsResult invoiceRegistrationAdd(@RequestBody HcsInvoiceRegAddDTO param); + + /** + * C111-3 更新开票登记(fdId 必填,金蝶开票完成后回填票据日期/状态) + * + * @param param 请求参数 + * @return 开票登记 fdId + */ + @PostMapping(INVOICE_REG_UPDATE_URL) + HcsResult invoiceRegistrationUpdate(@RequestBody HcsInvoiceRegUpdateDTO param); +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/interceptor/HcsAuthInterceptor.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/interceptor/HcsAuthInterceptor.java new file mode 100644 index 00000000..ade05035 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/interceptor/HcsAuthInterceptor.java @@ -0,0 +1,99 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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,两种实现并存、切换不改代码) + *

    + *
  • oauth2(默认):GET /authapi/getToken 取令牌后,把 access_token 追加到业务请求 URL;
  • + *
  • basic:注入 Authorization: Basic base64(user:password) 请求头。
  • + *
+ * 取令牌请求本身不追加 access_token(路径守卫 + 空令牌守卫双重防护)。 + * + * @author Chill + */ +@Slf4j +@RequiredArgsConstructor +public class HcsAuthInterceptor implements RequestInterceptor { + + private final HcsProperties properties; + + /** + * 惰性持有令牌服务,打破 Feign 客户端与令牌服务的构造期循环依赖 + */ + private final ObjectProvider 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); + } +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/token/HcsTokenService.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/token/HcsTokenService.java new file mode 100644 index 00000000..fddfca29 --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/token/HcsTokenService.java @@ -0,0 +1,140 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 惯例) + *

+ * 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 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 毫秒数设置提前失效时间 + *

+ * 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)); + } +} diff --git a/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/util/HcsPageUtil.java b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/util/HcsPageUtil.java new file mode 100644 index 00000000..7039edeb --- /dev/null +++ b/blade-third-party-api/blade-hcs-api/src/main/java/org/springblade/hcs/util/HcsPageUtil.java @@ -0,0 +1,102 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 惯例) + *

+ * HCS 分页以 offset(从 0 开始)+ pageSize 位移,适用于所有返回 {@link HcsPageVO} 的查询接口 + * (C102-3 项目立项查询、C103-3 合同列表、C103-6/7/12 主数据列表、C111-1 开票登记列表等): + *

{@code
+ * List rows = HcsPageUtil.queryAllPages(offset -> {
+ * 	query.setOffset(offset);
+ * 	query.setPageSize(pageSize);
+ * 	return hcsClient.projectList(query).getData();
+ * });
+ * }
+ * + * @author Chill + */ +public class HcsPageUtil { + + /** + * 分页查询默认最大页数保护,防止 HCS 侧 totalSize 异常时死循环 + */ + public static final int DEFAULT_MAX_PAGES = 50; + + private HcsPageUtil() { + } + + /** + * HCS 分页查询通用翻页,自动翻页汇总全量数据行(默认最大页数保护) + * + * @param pageFetcher 偏移量 -> 分页结果,lambda 内负责设置 offset(必要时含页大小)并调用接口 + * @param 数据行类型 + * @return 全量数据行 + */ + public static List queryAllPages(IntFunction> pageFetcher) { + return queryAllPages(pageFetcher, DEFAULT_MAX_PAGES); + } + + /** + * HCS 分页查询通用翻页,自动翻页汇总全量数据行 + *

+ * 终止条件:返回页为空、数据行为空、数据行不满一页(按返回 pageSize 判断)、已取满 totalSize、超出最大页数保护 + * + * @param pageFetcher 偏移量 -> 分页结果,lambda 内负责设置 offset(必要时含页大小)并调用接口 + * @param maxPages 最大页数保护 + * @param 数据行类型 + * @return 全量数据行 + */ + public static List queryAllPages(IntFunction> pageFetcher, int maxPages) { + List rows = new ArrayList<>(); + int offset = 0; + for (int pageNo = 1; pageNo <= maxPages; pageNo++) { + HcsPageVO 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; + } +} diff --git a/blade-third-party-api/pom.xml b/blade-third-party-api/pom.xml index d0a0b444..4b2ed3c0 100644 --- a/blade-third-party-api/pom.xml +++ b/blade-third-party-api/pom.xml @@ -20,6 +20,7 @@ blade-track-api blade-wechat-api blade-bfi-api + blade-hcs-api pom BladeX 第三方API集合 diff --git a/doc/nacos/third-party-api.yaml b/doc/nacos/third-party-api.yaml index d5f1b4de..2345de68 100644 --- a/doc/nacos/third-party-api.yaml +++ b/doc/nacos/third-party-api.yaml @@ -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:} diff --git a/doc/sql/transport/blade_hcs_sync_fields_20260927.sql b/doc/sql/transport/blade_hcs_sync_fields_20260927.sql new file mode 100644 index 00000000..02d53bd9 --- /dev/null +++ b/doc/sql/transport/blade_hcs_sync_fields_20260927.sql @@ -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;