提交内容:定时任务

备注:定时推送单据至BIP
提交人:邹江涛
This commit is contained in:
zoujiangtao 2024-12-10 17:23:04 +08:00
parent c3a86a2605
commit 525c2028e1
2 changed files with 2 additions and 1 deletions

View File

@ -458,7 +458,7 @@ public class ApiService {
} }
in.close(); in.close();
// 替换 \n 为实际的换行符 // 替换 \n 为实际的换行符
formattedContent = content.toString().replace("\\n", "\n").replace("\\", ""); formattedContent = content.toString().replace("\\n", "\n");
} else { } else {
formattedContent = "响应失败"; formattedContent = "响应失败";
} }

View File

@ -92,6 +92,7 @@ public class PushTaskPlugin extends AbstractTask implements Plugin {
String finalBillName = billName; String finalBillName = billName;
dynamicObjects.forEach(dynamicObject -> { dynamicObjects.forEach(dynamicObject -> {
String responseBody = ApiService.paymentSlipsJson(dynamicObject, "BIP"); String responseBody = ApiService.paymentSlipsJson(dynamicObject, "BIP");
logger.info("推送 → {} → 开始\n推送单据编号{}\n接口响应数据{}", finalBillName, dynamicObject.getString("billno"), responseBody);
if (!responseBody.contains("失败")) { if (!responseBody.contains("失败")) {
JSONObject jsonObject = JSON.parseObject(responseBody); JSONObject jsonObject = JSON.parseObject(responseBody);
String code = jsonObject.getString("code"); String code = jsonObject.getString("code");