From 8f30b77a480f8921bffe2bf176bf3479f5bcbedc Mon Sep 17 00:00:00 2001
From: wujianwei <wjw@11.com>
Date: 星期三, 01 四月 2026 16:38:34 +0800
Subject: [PATCH] 新增手动推送应付,应收账单
---
tms/src/main/java/com/ruoyi/tms/service/impl/TmsPayableFeeServiceImpl.java | 21 ++++++++++++++++++---
1 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/tms/src/main/java/com/ruoyi/tms/service/impl/TmsPayableFeeServiceImpl.java b/tms/src/main/java/com/ruoyi/tms/service/impl/TmsPayableFeeServiceImpl.java
index 494b08c..10cc569 100644
--- a/tms/src/main/java/com/ruoyi/tms/service/impl/TmsPayableFeeServiceImpl.java
+++ b/tms/src/main/java/com/ruoyi/tms/service/impl/TmsPayableFeeServiceImpl.java
@@ -20,6 +20,8 @@
import com.ruoyi.tms.mapper.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
+import org.springframework.core.task.AsyncTaskExecutor;
+import org.springframework.core.task.SimpleAsyncTaskExecutor;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
@@ -300,6 +302,7 @@
tmsApBill.setSettledAmount(BigDecimal.ZERO);
tmsApBill.setInvoiceStatus(0);
tmsApBill.setStatus(0);
+ tmsApBill.setPushStatus(0); // 鍒濆鎺ㄩ�佺姸鎬侊細鏈帹閫�
tmsApBill.setCreateBy(SecurityUtils.getUsername());
tmsApBillMapper.insertTmsApBill(tmsApBill);
@@ -328,8 +331,9 @@
}
//鍚戝閮ㄧ郴缁熸帹閫佹暟鎹�
- pushPayableToExternalSystem(tmsApBill, tmsPayableFeeList);
-
+ AsyncTaskExecutor executor = new SimpleAsyncTaskExecutor();
+ executor.execute(() -> pushPayableToExternalSystem(tmsApBill, tmsPayableFeeList));
+
return AjaxResult.success();
}
@@ -439,11 +443,22 @@
// 鍙戦�丄PI璇锋眰
ResponseEntity<String> response = restTemplate.exchange(apiUrl, HttpMethod.POST, entity, String.class);
logger.info("鎺ㄩ�佸簲浠樻暟鎹埌澶栭儴绯荤粺鎴愬姛锛屽搷搴�: {}", response.getBody());
+
+ // 鏇存柊鎺ㄩ�佺姸鎬佷负鎴愬姛
+ tmsApBill.setPushStatus(2);
+ tmsApBill.setPushTime(DateUtils.getNowDate());
+ tmsApBill.setPushFailReason(null);
+ tmsApBillMapper.updateTmsApBill(tmsApBill);
} catch (Exception e) {
logger.error("鎺ㄩ�佸簲浠樻暟鎹埌澶栭儴绯荤粺澶辫触锛岃处鍗旾D: {}, 渚涘簲鍟�: {}",
tmsApBill.getId(), tmsApBill.getServiceProviderName(), e);
logger.debug("鎺ㄩ�佸け璐ョ殑璇锋眰鏁版嵁: {}", JSON.toJSONString(requestBody));
- // 鎺ㄩ�佸け璐ヤ笉褰卞搷涓绘祦绋嬶紝璁板綍鏃ュ織鍗冲彲
+
+ // 鏇存柊鎺ㄩ�佺姸鎬佷负澶辫触
+ tmsApBill.setPushStatus(3);
+ tmsApBill.setPushTime(DateUtils.getNowDate());
+ tmsApBill.setPushFailReason(e.getMessage());
+ tmsApBillMapper.updateTmsApBill(tmsApBill);
}
}
--
Gitblit v1.8.0