From b454bdc6e3aa25d78610cbb86bd5bbc5512785a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B3=89=E4=BD=B3?= <1107186916@qq.com> Date: Mon, 21 Sep 2026 19:14:38 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E9=87=91=E8=9D=B6=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E7=BC=96=E6=8E=92?= =?UTF-8?q?=E5=BA=94=E6=94=B6=E5=8B=BE=E7=A8=BD=E7=BA=A0=E5=81=8F=E4=B8=8E?= =?UTF-8?q?=E5=BC=80=E7=A5=A8=E7=BB=93=E6=9E=9C=E5=9B=9E=E5=86=99=E5=AD=90?= =?UTF-8?q?=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../task/PaymentKingdeeResultTask.java | 31 ++++++++++++++++--- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/task/PaymentKingdeeResultTask.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/task/PaymentKingdeeResultTask.java index e60548c9..669c18b2 100644 --- a/blade-service/blade-transport/src/main/java/org/springblade/transport/task/PaymentKingdeeResultTask.java +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/task/PaymentKingdeeResultTask.java @@ -21,17 +21,21 @@ package org.springblade.transport.task; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springblade.transport.service.IFormalSettlementService; +import org.springblade.transport.service.IInvoiceApplicationService; import org.springblade.transport.service.IPaymentApplicationService; import org.springframework.beans.factory.annotation.Value; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; /** - * 金蝶付款结果定时回写任务 + * 金蝶结果定时回写任务 *
- * 定时查询金蝶(星瀚)付款结果并更新付款信息与履约付款数据: - * A103-2 付款申请单查询回填金蝶单据编号与单据状态,A103-4 付款处理查询回填付款记录。 - * 业务逻辑收敛在 {@link IPaymentApplicationService#syncKingdeePaymentResult()},便于手动触发联调。 + * 定时查询金蝶(星瀚)结果并回写 TMS 单据,编排三个子流程(各自独立 try/catch,互不影响): + * ① A103-2/A103-4 付款结果:回填付款申请单据编号、单据状态与付款记录; + * ② A302-4 应收勾稽纠偏:应收结算单回填金蝶应收单编号、生成失败纠偏为已同步; + * ③ A303-5 开票结果回写:开票申请发票结果落库并推进开票完成。 + * 各子流程业务逻辑收敛在对应服务方法,便于手动触发联调。 *
* 调度配置(Nacos thirdParty.bfi.payResult.*):syncEnabled 开关、cron 表达式。 * @@ -43,22 +47,39 @@ import org.springframework.stereotype.Component; public class PaymentKingdeeResultTask { private final IPaymentApplicationService paymentApplicationService; + private final IFormalSettlementService formalSettlementService; + private final IInvoiceApplicationService invoiceApplicationService; /** 付款结果回写开关,默认开启 */ @Value("${thirdParty.bfi.payResult.syncEnabled:false}") private boolean syncEnabled; - /** 金蝶付款结果回写调度,默认每10分钟执行一次 */ + /** 金蝶结果回写调度,默认每10分钟执行一次 */ @Scheduled(cron = "${thirdParty.bfi.payResult.cron:0 */10 * * * ?}") public void syncKingdeePaymentResult() { if (!syncEnabled) { return; } + // ① A103-2/A103-4 付款结果回写 try { String summary = paymentApplicationService.syncKingdeePaymentResult(); log.info("定时回写金蝶付款结果:{}", summary); } catch (Exception exception) { log.error("定时回写金蝶付款结果异常", exception); } + // ② A302-4 应收勾稽纠偏 + try { + String summary = formalSettlementService.syncKingdeeArResult(); + log.info("定时勾稽金蝶应收单:{}", summary); + } catch (Exception exception) { + log.error("定时勾稽金蝶应收单异常", exception); + } + // ③ A303-5 开票结果回写 + try { + String summary = invoiceApplicationService.syncKingdeeInvoiceResult(); + log.info("定时回写金蝶开票结果:{}", summary); + } catch (Exception exception) { + log.error("定时回写金蝶开票结果异常", exception); + } } }