提交内容:定时任务

备注:定时推送单据至BIP
提交人:邹江涛
This commit is contained in:
zoujiangtao 2024-12-16 10:37:29 +08:00
parent 525c2028e1
commit 7f7c6fcbf4
2 changed files with 20 additions and 5 deletions

View File

@ -418,10 +418,10 @@ public class ApiService {
* @return
*/
private static String pushBill(DynamicObject dataEntity, String requestBody) {
//响应数据
// 响应数据
String formattedContent;
try {
//域名
// 域名
String domainName = dataEntity.getString("shkd_domainname");
Map<String, Object> resultMap = ApiService.getBIPToken(domainName);
Object token = resultMap.get("token");
@ -460,7 +460,15 @@ public class ApiService {
// 替换 \n 为实际的换行符
formattedContent = content.toString().replace("\\n", "\n");
} else {
formattedContent = "响应失败";
// 读取错误流
BufferedReader errorReader = new BufferedReader(new InputStreamReader(connection.getErrorStream(), StandardCharsets.UTF_8));
String errorLine;
StringBuilder errorContent = new StringBuilder();
while ((errorLine = errorReader.readLine()) != null) {
errorContent.append(errorLine);
}
errorReader.close();
formattedContent = "响应失败: " + errorContent.toString();
}
} catch (Exception e) {
formattedContent = "请求失败," + e.getMessage();

View File

@ -58,7 +58,7 @@ public class PushTaskPlugin extends AbstractTask implements Plugin {
DynamicObject[] objects1 = BusinessDataServiceHelper.load("cas_paybill",
"id,billno,actpayamt,entry,entry.e_expenseitem,entry.e_remark,settletype,payeebanknum," +
"payeetype,payeenumber,payeracctbank,payeebank,payeebankname,paymenttype,org,bizdate,description," +
"shkd_pushstatus,shkd_businessnumber,shkd_businessid,shkd_businessname"
"shkd_pushstatus,shkd_businessnumber,shkd_businessid,shkd_businessname,billstatus"
, new QFilter("bizdate", QCP.large_equals, date).and("shkd_pushstatus", QCP.not_equals, "已推送").toArray());
dynamicObjects = Arrays.asList(objects1);
billName = "付款处理";
@ -68,7 +68,7 @@ public class PushTaskPlugin extends AbstractTask implements Plugin {
DynamicObject[] objects2 = BusinessDataServiceHelper.load("cas_recbill",
"id,billno,entry,entry.e_expenseitem,settletype,entry.e_remark,receivingtype," +
"payertype,org,bizdate,accountbank,payernumber,actrecamt,txt_description,shkd_pushstatus," +
"shkd_businessnumber,shkd_businessid,shkd_businessname"
"shkd_businessnumber,shkd_businessid,shkd_businessname,billstatus"
, new QFilter("bizdate", QCP.large_equals, date).and("shkd_pushstatus", QCP.not_equals, "已推送").toArray());
dynamicObjects = Arrays.asList(objects2);
billName = "收款处理";
@ -83,6 +83,13 @@ public class PushTaskPlugin extends AbstractTask implements Plugin {
dynamicObjects = Arrays.asList(objects3);
billName = "银行收付处理";
break;
// 支付结果付款处理支付结果定时推送
case "cas_paybill_result":
DynamicObject[] objects4 = BusinessDataServiceHelper.load("cas_paybill",
"id,billno,actpayamt,entry,entry.e_expenseitem,entry.e_remark,settletype,payeebanknum," +
"payeetype,payeenumber,payeracctbank,payeebank,payeebankname,paymenttype,org,bizdate,description," +
"shkd_pushstatus,shkd_businessnumber,shkd_businessid,shkd_businessname,billstatus"
, new QFilter("bizdate", QCP.large_equals, date).and("shkd_pushstatus", QCP.not_equals, "已推送").toArray());
default:
return;
}