Commit b703295d authored by 18083's avatar 18083

收款excel导入附件替换及补充农行缺少文件

parent 49c0e461
package com.hand.hlcm;
import com.alibaba.fastjson.JSON;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import org.apache.http.util.EntityUtils;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* description
*
* @author lcl 2023/02/15 15:07
*/
public class HttpPostDocQuery {
public HttpPostDocQuery() {
}
public static String httpPostDocImport(String postUrl, String data, String token, String tokentype) {
HttpClient client = null;
String result="error";
try {
client = new DefaultHttpClient();
HttpPost post = new HttpPost(postUrl);
//设置超时时间
HttpParams params = client.getParams();
HttpConnectionParams.setConnectionTimeout(params, (int) 10 * 1000);
HttpConnectionParams.setSoTimeout(params, 10 * 1000);
post.setHeader("Content-Type", "application/json");
post.setHeader("Authorization", tokentype + " " + token);
post.setEntity(new StringEntity(data, "UTF-8"));
HttpResponse response = null;
response = client.execute(post);
HttpEntity entity = response.getEntity();
result = EntityUtils.toString(entity,"UTF-8");
// result = EntityUtils.toString(entity);
EntityUtils.consume(entity); //1. 关闭响应流
if (entity != null) {
InputStream instream = entity.getContent();
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(instream, "UTF-8"));
} catch (Exception e) {
e.printStackTrace();
} finally {
instream.close();
}
}
} catch (Exception e) {
e.printStackTrace();
} finally {
client.getConnectionManager().shutdown(); // 关闭连接.
}
return result;
}
public static void main(String[] args) throws Exception {
Map<String, Object> map = new HashMap<>();
map.put("startCreatedDate", "2023-12-13 00:00:00");
map.put("endCreatedDate", "2023-12-20 00:00:00");
List<String> list = new ArrayList<>();
list.add("receiptD");
map.put("documentTypeCodeList", list);
String json = JSON.toJSONString(map);
System.out.println("--------------------" + json);
String response = httpPostDocImport("http://apistage.huilianyi.com/gateway/e-archives/api/open/v1/documents/query?page=1&size=20", json, "e074ea49-ae7b-465b-a3e5-e051f5e0e088", "Bearer");
System.out.println(response);
}
}
......@@ -69,17 +69,17 @@
record.set('receipt_type', 'IMPORT');
record.set('bank_account_num', record.get('bank_num'));
// record.set('transaction_date', Leaf.formatDate(record.get('attribute_3')));
record.set('bank_slip_num', record.get('attribute_17'));
record.set('bank_slip_num', record.get('attribute_12'));
record.set('currency_code', 'CNY');
record.set('transaction_amount', record.get('attribute_3'));
record.set('transaction_amount', record.get('attribute_2'));
record.set('exchange_rate', 1);
record.set('bp_bank_account_num', record.get('attribute_11'));
record.set('bp_bank_account_name', record.get('attribute_12'));
record.set('opposite_band_na', record.get('attribute_8'));
record.set('description', record.get('attribute_14'));
record.set('ref_v05', record.get('attribute_15'));
record.set('bp_bank_account_num', record.get('attribute_5'));
record.set('bp_bank_account_name', record.get('attribute_6'));
record.set('opposite_band_na', record.get('attribute_7'));
record.set('description', record.get('attribute_13'));
record.set('ref_v05', record.get('attribute_8'));
record.set('bp_name', record.get('bp_name'));
record.set('bank_receipt_date', record.get('attribute_1'));
record.set('bank_receipt_date', record.get('transaction_date'));
record.set('write_off_flag', 'DISABLED');
record.set('paid_byother_flag_desc', record.get('paid_byother_flag_desc'));
record.set('guarantor_name_duty',record.get('guarantor_name_duty_desc'));
......@@ -91,6 +91,9 @@
if (record.get('collection_classes') == 'DEPOSIT') {
record.set('transaction_type', 'DEPOSIT');
} else if(record.get('collection_classes')=='OPERAT_DEPOSIT'){
record.set('transaction_type', 'DEPOSIT');
record.set('operat_flag', 'Y');
} else {
record.set('transaction_type', 'RECEIPT');
}
......@@ -469,23 +472,22 @@
<a:column name="error_message" editor="textArea_e" prompt="错误信息" width="180"/>
<a:column name="bank_num" prompt="账号" width="80"/>
<a:column name="currency_type" prompt="货币" width="80"/>
<a:column name="attribute_1" prompt="交易时间" renderer="Leaf.formatDate" width="80"/>
<!-- <a:column name="attribute_4" prompt="交易时间" width="80"/>-->
<a:column name="attribute_17" prompt="日志号" width="80"/>
<a:column name="attribute_11" prompt="对方账号" width="80"/>
<a:column name="attribute_12" prompt="对方账号户名" width="80"/>
<a:column name="attribute_8" prompt="对方银行名称" width="80"/>
<a:column name="transaction_date" prompt="交易时间" renderer="Leaf.formatDate" width="80"/>
<a:column name="attribute_12" prompt="日志号" width="80"/>
<a:column name="attribute_5" prompt="对方账号" width="80"/>
<a:column name="attribute_6" prompt="对方账号户名" width="80"/>
<a:column name="attribute_7" prompt="对方银行名称" width="80"/>
<a:column name="bp_name" prompt="收款对象" editor="grid_lov" width="120"/>
<a:column name="paid_byother_flag_desc" prompt="是否代付" editor="grid_cb"/>
<a:column name="attribute_3" prompt="收款金额" renderer="Leaf.formatMoney" align="right"
<a:column name="attribute_2" prompt="收款金额" renderer="Leaf.formatMoney" align="right"
width="80"/>
<a:column name="attribute_14" prompt="摘要" width="80"/>
<a:column name="attribute_13" prompt="摘要" width="80"/>
<a:column name="collection_classes_desc" prompt="款项分类" editor="grid_cb"/>
<a:column name="attribute_15" prompt="附言" width="80"/>
<a:column name="attribute_8" prompt="附言" width="80"/>
<a:column name="extra_nam" prompt="代理店简称" width="80" editor="grid_lov" />
<a:column name="bp_code" prompt="代理店简称code" hidden="true"/>
......
......@@ -65,15 +65,15 @@
record.set('receipt_type', 'IMPORT');
record.set('bank_account_num', record.get('bank_num'));
// record.set('transaction_date', Leaf.formatDate(record.get('attribute_3')));
record.set('bank_slip_num', record.get('attribute_17'));
record.set('bank_slip_num', record.get('attribute_12'));
record.set('currency_code', 'CNY');
record.set('transaction_amount', record.get('attribute_3'));
record.set('transaction_amount', record.get('attribute_2'));
record.set('exchange_rate', 1);
record.set('bp_bank_account_num', record.get('attribute_11'));
record.set('bp_bank_account_name', record.get('attribute_12'));
record.set('opposite_band_na', record.get('attribute_8'));
record.set('description', record.get('attribute_14'));
record.set('ref_v05', record.get('attribute_15'));
record.set('bp_bank_account_num', record.get('attribute_5'));
record.set('bp_bank_account_name', record.get('attribute_6'));
record.set('opposite_band_na', record.get('attribute_7'));
record.set('description', record.get('attribute_13'));
record.set('ref_v05', record.get('attribute_8'));
record.set('write_off_flag', 'DISABLED');
......@@ -470,23 +470,23 @@
<a:column name="error_message" editor="textArea_e" prompt="错误信息" width="180"/>
<a:column name="bank_num" prompt="账号" width="80"/>
<a:column name="currency_type" prompt="货币" width="80"/>
<a:column name="attribute_1" prompt="交易日期" renderer="Leaf.formatDate" width="80"/>
<a:column name="transaction_date" prompt="交易日期" renderer="Leaf.formatDate" width="80"/>
<!-- <a:column name="attribute_4" prompt="交易时间" width="80"/>-->
<a:column name="attribute_17" prompt="日志号" width="80"/>
<a:column name="attribute_11" prompt="对方账号" width="80"/>
<a:column name="attribute_12" prompt="对方账号户名" width="80"/>
<a:column name="attribute_8" prompt="对方银行名称" width="80"/>
<a:column name="attribute_12" prompt="日志号" width="80"/>
<a:column name="attribute_5" prompt="对方账号" width="80"/>
<a:column name="attribute_6" prompt="对方账号户名" width="80"/>
<a:column name="attribute_7" prompt="对方银行名称" width="80"/>
<a:column name="bp_name" prompt="收款对象" editor="grid_lov" width="120"/>
<a:column name="paid_byother_flag_desc" prompt="是否代付" editor="grid_cb"/>
<a:column name="attribute_3" prompt="收款金额" renderer="Leaf.formatMoney" align="right"
<a:column name="attribute_2" prompt="收款金额" renderer="Leaf.formatMoney" align="right"
width="80"/>
<a:column name="attribute_14" prompt="摘要" width="80"/>
<a:column name="attribute_13" prompt="摘要" width="80"/>
<a:column name="collection_classes_desc" prompt="款项分类" editor="grid_cb"/>
<a:column name="attribute_15" prompt="附言" width="80"/>
<a:column name="attribute_8" prompt="附言" width="80"/>
<a:column name="extra_nam" prompt="代理店简称" width="80" editor="grid_lov" />
<a:column name="bp_code" prompt="代理店简称code" hidden="true"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment