Commit 875f6227 authored by 陆正友's avatar 陆正友

农行回单匹配规则调整 及git完善

parent 0babb53a
......@@ -19,6 +19,7 @@
<bm:field name="bp_class" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_CLASS"/>
<bm:field name="bp_class_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_CLASS_NAME"/>
<bm:field name="enabled_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENABLED_FLAG"/>
<bm:field name="extra_nam" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXTRA_NAM"/>
<!--<bm:field name="id_card_no" displayWidth="200" forDisplay="true" prompt="身份证"/>-->
</bm:fields>
<bm:features>
......
......@@ -16,6 +16,7 @@
p_payer_number =>${@payer_number},
p_bank_name =>${@bank_name},
p_beneficiary_name =>${@beneficiary_name},
p_bp_id =>${@bp_id},
p_total_amount =>${@total_amount},
p_import_itfc_id =>${@import_itfc_id});
......
......@@ -28,7 +28,8 @@
p_response_json => ${@response_json},
p_return_page_size => ${@return_page_size},
p_page_size => ${@page_size},
p_user_id =>${/session/@user_id}
p_user_id =>${/session/@user_id},
p_slip_batch_id => ${@slip_batch_id}
);
END;
]]>
......
......@@ -6,6 +6,7 @@
SELECT *
FROM hlcm_ele_abc_bank_slip_bacth b
WHERE b.start_date = TO_DATE('${:@parameter_code}', 'YYYY-MM-DD')
ORDER BY b.slip_batch_id desc
]]></bm:query-sql>
</bm:operation>
</bm:operations>
......
......@@ -15,7 +15,6 @@
<a:link id="csh_abc_import_transaction_link"
url="${/request/@context_path}/modules/csh/CSH1400/csh_abc_import_transaction.lsc"/>
<script type="text/javascript"><![CDATA[
Leaf.onReady(function () {
//只开放按钮权限给债权内勤
var role_code = '${/model/role_code/record/@role_code}';
......@@ -30,7 +29,6 @@
}
});
function returnAbc() {
// 刷新页面
$("OcrQueryDs").query();
......@@ -48,13 +46,15 @@
$("AbcBankDs").query();
}
// 背景渲染农行回单
// var record = $('OcrQueryDs').getSelected();
// var record = $('AbcBankDs').getSelected();
function change_background_color(record) {
if (record.get('re_flag') == 'Y') {
return 'background-color:#DC143C;'
}
}
// 字段渲染农行回单
function checkOcrRender(value, record, name) {
if (record.get('re_flag') == 'Y' && !Ext.isEmpty(value)) {
......@@ -87,18 +87,14 @@
return '<font color="black">' + value + '</font>'
}
}
}
}
// 保存按钮
function agricultural_bank_save() {
var orc_save = $('AbcBankDs').getSelected();
var orc_save = $('AbcBankDs').getAll();
var param = {};
var saveOrc = [];
if (orc_save.length <= 0) {
Leaf.showMessage('提示', '请至少选择一条数据!');
} else {
for (var i = 0; i < orc_save.length; i++) {
var lineOrc = {};
lineOrc['receipt_no'] = orc_save[i].get('receipt_no');
......@@ -113,6 +109,7 @@
lineOrc['bank_name'] = orc_save[i].get('bank_name');
lineOrc['beneficiary_name'] = orc_save[i].get('beneficiary_name');
lineOrc['total_amount'] = orc_save[i].get('total_amount');
lineOrc['bp_id'] = orc_save[i].get('bp_id');
saveOrc.push(lineOrc);
}
param['AbcOrc'] = saveOrc;
......@@ -130,17 +127,12 @@
},
scope: this
});
}
// }
}
// function btn001_renderer_button_authority_detail(value, record, name) {
// if (record.isNew==true){
// return Leaf.showMessage('提示', '请至少选择一条数据!');
// }
// }
// 提交按钮
function agricultural_bank_submit(ro) {
function agricultural_bank_submit() {
var orc_save = $('AbcBankDs').getSelected();
var abc_save = $('OcrQueryDs').getSelected();
var param = {};
......@@ -176,8 +168,8 @@
recode = orc_save[i];
}
param['AbcOrc'] = saveOrc;
if (recode.get('re_flag') == 'N') {
Leaf.showConfirm('特别注意', '日志号, <font color="red">' + recode.get('receipt_no') + '</font>,的单据未匹配到对应回单数据,是否确认提交?', function () {
if(recode.get('re_flag')=='N'){
Leaf.showConfirm('特别注意', '日志号, <font color="red">'+recode.get('receipt_no')+'</font>,的单据未匹配到对应回单数据,是否确认提交?', function () {
Leaf.request({
url: $('csh_abc_import_transaction_link').getUrl(),
para: {
......@@ -195,7 +187,7 @@
scope: this
});
});
} else {
}else {
Leaf.request({
url: $('csh_abc_import_transaction_link').getUrl(),
para: {
......@@ -208,12 +200,14 @@
});
$('AbcBankDs').query();
$("OcrQueryDs").query();
// returnBack();
//returnBack();
},
scope: this
});
}
}
if (abc_save.length > 0) {
Leaf.showMessage('提示', '农行回单OCR页面的单据无法提交!');
}
......@@ -231,7 +225,12 @@
width: 430,
height: 390
});
// win.on('close', function () {
// debugger
// var createWin = $('agricultural_bank_import');
// createWin.close();
// returnAbc();
// });
}
......@@ -274,9 +273,12 @@
lovService="basic.hls_bp_master_v_for_agent_lov" lovWidth="550" title="HLS.BP_TITLE">
<a:mapping>
<a:map from="bp_name" to="beneficiary_name"/>
<a:map from="bp_id" to="bp_id"/>
<a:map from="extra_nam" to="extra_nam"/>
</a:mapping>
</a:field>
</a:fields>
</a:dataSet>
......@@ -307,24 +309,18 @@
<a:tabs>
<a:tab prompt="OCR数据" width="110">
<a:grid id="ocr" bindTarget="OcrQueryDs" marginHeight="200" marginWidth="80" navBar="true"
rowRenderer="change_background_color">
<a:grid id="ocr" bindTarget="OcrQueryDs" marginHeight="200" marginWidth="80" navBar="true" rowRenderer="change_background_color">
<a:columns>
<a:column name="bank_num" prompt="收款账号" width="150" align="center"
renderer="checkOcrRender"/>
<a:column name="bank_num" prompt="收款账号" width="150" align="center" renderer="checkOcrRender"/>
<a:column name="bank_receipt_date" prompt="交易时间" width="100" align="center"
renderer="checkOcrRender"/>
<a:column name="receipt_no" prompt="回单编号" width="80" align="left"/>
<a:column name="payer_number" prompt="付款方账号" width="100" align="center"
renderer="checkOcrRender"/>
<a:column name="payer_name" prompt="付款方户名" width="100" align="left"
renderer="checkOcrRender"/>
<a:column name="payer_bank" prompt="付款方开户行" width="100" align="left"
renderer="checkOcrRender"/>
<a:column name="payer_number" prompt="付款方账号" width="100" align="center" renderer="checkOcrRender"/>
<a:column name="payer_name" prompt="付款方户名" width="100" align="left" renderer="checkOcrRender"/>
<a:column name="payer_bank" prompt="付款方开户行" width="100" align="left" renderer="checkOcrRender"/>
<a:column name="bp_name" prompt="收款对象" width="100" align="left"/>
<a:column name="paid_byother_flag_desc" prompt="是否代付" width="70" align="center"/>
<a:column name="total_amount" prompt="金额" width="100" align="right"
renderer="checkOcrRender"/>
<a:column name="total_amount" prompt="金额" width="100" align="right" renderer="checkOcrRender"/>
<a:column name="zy" prompt="摘要" width="80" align="center"/>
<a:column name="collection_classes_desc" prompt="款项分类" width="90" align="center"/>
<a:column name="remark" prompt="附言" width="80" align="center"/>
......@@ -334,7 +330,7 @@
</a:columns>
</a:grid>
</a:tab>
<a:tab prompt="农行回单" width="110">
<a:tab prompt="农行导入" width="110">
<a:grid id="abc_bank" bindTarget="AbcBankDs" marginHeight="200" marginWidth="80"
rowRenderer="change_background_color" navBar="true">
<a:columns>
......@@ -343,15 +339,13 @@
<a:column name="bank_receipt_date" prompt="交易时间" width="100"
renderer="checkOcrRender" align="center"/>
<a:column name="receipt_no" prompt="日志号" width="80" align="left"/>
<a:column name="payer_number" prompt="对方账号" width="100" align="center"
renderer="checkOcrRender"/>
<a:column name="payer_number" prompt="对方账号" width="100" align="center" renderer="checkOcrRender"/>
<a:column name="payer_name" prompt="对方账号户名" width="100" align="left"
renderer="checkOcrRender"
required="true"/>
renderer="checkOcrRender"/>
<a:column name="bank_name" prompt="对方银行名称" width="100" align="left"
renderer="checkOcrRender"/>
<a:column name="beneficiary_name" prompt="收款对象" width="100" editor="grid_lov"
align="left"/>
<a:column name="beneficiary_name" prompt="收款对象" width="100" editor="grid_lov" align="left" required="true"/>
<a:column name="bp_id" prompt="收款对象" />
<a:column name="paid_byother_flag_desc" prompt="是否代付" width="70" editor="grid_cb"
required="true"
align="center"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script"
trace="true">
trace="true">
<a:init-procedure>
<s:server-script import="token_record.js;bank_import.js"><![CDATA[
<s:server-script import="token_record.js"><![CDATA[
importPackage(java.io);
importPackage(java.util);
importPackage(Packages.com.hand.hlcm);
var logger = $logger('server-script');
// 获取当前日期
var currentDate = new Date();
// 设置开始时间为明天的凌晨整点(目标时区为UTC)
var startdate_n = new Date(Date.UTC(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate()
importPackage(java.util);
importPackage(Packages.com.hand.hlcm);
importPackage(Packages.com.hand.hl);
var logger = $logger('server-script');
// 获取当前日期
var currentDate = new Date();
// 设置开始时间为明天的凌晨整点
var startdate_n = new Date(Date.UTC(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate()
, 0, 0, 0));
// 设置结束时间为后天的凌晨整点(目标时区为UTC)
var enddate_n = new Date(Date.UTC(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate() +
// 设置结束时间为后天的凌晨整点
var enddate_n = new Date(Date.UTC(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate() +
1, 0, 0, 0));
// 格式化日期为字符串
var startdate = startdate_n.toISOString().slice(0, 19).replace('T', ' ');
var enddate = enddate_n.toISOString().slice(0, 19).replace('T', ' ');
// 提取开始时间的日期部分
var starttime = startdate_n.toISOString().slice(0, 10);
// 格式化日期为字符串
var startdate = startdate_n.toISOString().slice(0, 19).replace('T', ' ');
var enddate = enddate_n.toISOString().slice(0, 19).replace('T', ' ');
//var startdate = '2023-12-13 00:00:00';
//var enddate = '2023-12-20 00:00:00';
// 提取开始时间的日期部分
var starttime = startdate_n.toISOString().slice(0, 10);
//var starttime = '2023-12-13';
var att_import_bank_bm=$bm('efile.EFILE1100.att_import_bank');
var att_import_bank_trx_bm=$bm('efile.EFILE1100.att_import_bank_trx');
var init_page_number=20; //每次请求当前页条数
var att_import_bank_bm=$bm('efile.EFILE1100.att_import_bank');
var att_import_bank_trx_bm=$bm('efile.EFILE1100.att_import_bank_trx');
var init_page_number=20; //每次请求当前页条数
try {
try {
var sys_url_bm = $bm('cont.CON4000.get_sys_url');
var parameter_code = 'TOKEN_POSTURL';
var SysposturlQuery = sys_url_bm.queryAsMap({
......@@ -108,15 +111,13 @@
var doc = "http://apistage.huilianyi.com/gateway/e-archives/api/open/v1/documents/query?page=" + page +
"&size="+size;
var docUrl = doc.toString();
let p_user_id;
var userid = p_user_id;
att_import_bank_bm.insert({
'start_date' : startdate,
'end_date' : enddate,
'request_json' : request_files,
'page_number' : page_number,
'request_url' : docUrl,
'p_user_id': userid
'request_url' : docUrl
})
......@@ -129,14 +130,16 @@
var record = response_json_list.getChildren();
logger.info(typeof (record));
// var data = new com.hand.hlcm.HttpPostDocQuery();
var data_result_n = httpPostDocImportBank(docUrl,files,access_token,token_type);
var doc_import=new com.hand.hlcm.HttpPostDocQuery();
var data_result_n = doc_import.httpPostDocImport(docUrl,files,access_token,token_type);
var json_data = JSON.parse(data_result_n);
var statusCode = json_data.statusCode;
var message = json_data.message;
var total = json_data.total;
var result=json_data.result;
// var result_list=JSON.stringify(result);
var result_list = result.length;
var return_page_size = JSON.stringify(result_list);
......@@ -145,41 +148,36 @@
'message' : message,
'response_json' : data_result_n,
'return_page_size' : return_page_size,
'page_size' : size
'page_size' : size,
'slip_batch_id' : record[0].SLIP_BATCH_ID
})
for (var i = 0; i < result_list;i++) {
for (var i = 0; i < result_list; i++) {
var docFormFieldValueVOList = result[i].docFormFieldValueVOList;
if(result[i].docFormFieldValueVOList[2].fieldValue=='中国农业银行'
&& result[i].docFormFieldValueVOList[2].fieldValue != null){
var receipt_no = docFormFieldValueVOList[0].fieldValue;
var modified_receipt_no = receipt_no.substring(4, 13);
var fieldValueMap = {};
// 构建字段映射
for (var j = 0; j < docFormFieldValueVOList.length; j++) {
var fieldCode = docFormFieldValueVOList[j].fieldCode;
var fieldValue = docFormFieldValueVOList[j].fieldValue;
fieldValueMap[fieldCode] = fieldValue;
}
if (fieldValueMap['BENEFICIARY_ACCOUNT'] == '216084872610001') {
att_import_bank_trx_bm.insert({
'doc_code' : docFormFieldValueVOList[0].fieldValue,//单据编号
'receipt_no' : modified_receipt_no,//银行流水号
'bank_name' : docFormFieldValueVOList[2].fieldValue,//回单银行名称
'beneficiary_name' : docFormFieldValueVOList[3].fieldValue,//收款方户名
'bank_num' : docFormFieldValueVOList[4].fieldValue,//收款方账号
'beneficiary_bank' : docFormFieldValueVOList[5].fieldValue,//收款方银行
'payer_name' : docFormFieldValueVOList[6].fieldValue,//付款方户名
'payer_number' : docFormFieldValueVOList[7].fieldValue,//付款方账号
'payer_bank' : docFormFieldValueVOList[8].fieldValue,//付款方银行
'bank_receipt_date' : docFormFieldValueVOList[9].fieldValue,//回单日期
'total_amount' : docFormFieldValueVOList[10].fieldValue,//金额
'purpose' : docFormFieldValueVOList[11].fieldValue,//用途
'remark' : docFormFieldValueVOList[12].fieldValue,//备注
'zy' : docFormFieldValueVOList[13].fieldValue,//摘要
'business_type' :docFormFieldValueVOList[14].fieldValue,//业务类型
'contract1' : docFormFieldValueVOList[15].fieldValue,//合同号
'gl_code' : docFormFieldValueVOList[16].fieldValue,//营业系统凭证号
'agencycode' : docFormFieldValueVOList[17].fieldValue,//代理店编号
'client' : docFormFieldValueVOList[18].fieldValue,//客户
'preprocess_code' :docFormFieldValueVOList[19].fieldValue,//SBO凭证号
'agency' : docFormFieldValueVOList[20].fieldValue,//代理店
'blcode' : docFormFieldValueVOList[21].fieldValue,//保理号
'slip_batch_id' : record[0].SLIP_BATCH_ID,
})
'bank_receipt_date': fieldValueMap['BANK_RECEIPT_DATE'],//回单时间
'total_amount': fieldValueMap['TOTAL_AMOUNT'],//收入金额
'payer_bank': fieldValueMap['PAYER_BANK'],//付款方银行
'payer_number': fieldValueMap['PAYER_ACCOUNT'],//付款方账户
'payer_name': fieldValueMap['PAYER_NAME'],//付款方户名
'zy': fieldValueMap['ZY'],//摘要
'receipt_no': fieldValueMap['DOC_CODE'].substring(4, 13),//回单编号
'beneficiary_bank': fieldValueMap['BENEFICIARY_BANK'],//收款方银行
'bank_num': fieldValueMap['BENEFICIARY_ACCOUNT'],//收款方账户
'beneficiary_name': fieldValueMap['BENEFICIARY_NAME'],//收款方户名
//'receipt_no': fieldValueMap['RECEIPT_NO'].substring(4, 13),
'slip_batch_id': record[0].SLIP_BATCH_ID,
});
}
}
} else {
......@@ -263,8 +261,8 @@
var record = response_json_list.getChildren();
logger.info(typeof (record));
// var data = new com.hand.hlcm.HttpPostDocQuery();
var data_result_n = httpPostDocImportBank(docUrl,files,access_token,token_type);
var doc_import=new com.hand.hlcm.HttpPostDocQuery();
var data_result_n = doc_import.httpPostDocImport(docUrl,files,access_token,token_type);
var json_data = JSON.parse(data_result_n);
var statusCode = json_data.statusCode;
var message = json_data.message;
......@@ -279,49 +277,46 @@
'message' : message,
'response_json' : data_result_n,
'return_page_size' : return_page_size,
'page_size' : size
'page_size' : size,
'slip_batch_id' : record[0].SLIP_BATCH_ID,
})
for (var i = 0; i < result_list;i++) {
var docFormFieldValueVOList = result[i].docFormFieldValueVOList;
if(result[i].docFormFieldValueVOList[2].fieldValue=='中国农业银行'
&& result[i].docFormFieldValueVOList[2].fieldValue != null){
var receipt_no = docFormFieldValueVOList[0].fieldValue;
var modified_receipt_no = receipt_no.substring(4, 13);
var fieldValueMap = {};
logger.info(docFormFieldValueVOList);
// 构建字段映射
for (var j = 0; j < docFormFieldValueVOList.length; j++) {
var fieldCode = docFormFieldValueVOList[j].fieldCode;
var fieldValue = docFormFieldValueVOList[j].fieldValue;
fieldValueMap[fieldCode] = fieldValue;
}
if (fieldValueMap['BENEFICIARY_ACCOUNT'] == '216084872610001') {
att_import_bank_trx_bm.insert({
'doc_code' : docFormFieldValueVOList[0].fieldValue,//单据编号
'receipt_no' : modified_receipt_no,//银行流水号
'bank_name' : docFormFieldValueVOList[2].fieldValue,//回单银行名称
'beneficiary_name' : docFormFieldValueVOList[3].fieldValue,//收款方户名
'bank_num' : docFormFieldValueVOList[4].fieldValue,//收款方账号
'beneficiary_bank' : docFormFieldValueVOList[5].fieldValue,//收款方银行
'payer_name' : docFormFieldValueVOList[6].fieldValue,//付款方户名
'payer_number' : docFormFieldValueVOList[7].fieldValue,//付款方账号
'payer_bank' : docFormFieldValueVOList[8].fieldValue,//付款方银行
'bank_receipt_date' : docFormFieldValueVOList[9].fieldValue,//回单日期
'total_amount' : docFormFieldValueVOList[10].fieldValue,//金额
'purpose' : docFormFieldValueVOList[11].fieldValue,//用途
'remark' : docFormFieldValueVOList[12].fieldValue,//备注
'zy' : docFormFieldValueVOList[13].fieldValue,//摘要
'business_type' :docFormFieldValueVOList[14].fieldValue,//业务类型
'contract1' : docFormFieldValueVOList[15].fieldValue,//合同号
'gl_code' : docFormFieldValueVOList[16].fieldValue,//营业系统凭证号
'agencycode' : docFormFieldValueVOList[17].fieldValue,//代理店编号
'client' : docFormFieldValueVOList[18].fieldValue,//客户
'preprocess_code' :docFormFieldValueVOList[19].fieldValue,//SBO凭证号
'agency' : docFormFieldValueVOList[20].fieldValue,//代理店
'blcode' : docFormFieldValueVOList[21].fieldValue,//保理号
'slip_batch_id' : record[0].SLIP_BATCH_ID,
})
'bank_receipt_date': fieldValueMap['BANK_RECEIPT_DATE'],//回单时间
'total_amount': fieldValueMap['TOTAL_AMOUNT'],//收入金额
'payer_bank': fieldValueMap['PAYER_BANK'],//付款方银行
'payer_number': fieldValueMap['PAYER_ACCOUNT'],//付款方账户
'payer_name': fieldValueMap['PAYER_NAME'],//付款方户名
'zy': fieldValueMap['ZY'],//摘要
'receipt_no': fieldValueMap['DOC_CODE'].substring(4, 13),//回单编号
'beneficiary_bank': fieldValueMap['BENEFICIARY_BANK'],//收款方银行
'bank_num': fieldValueMap['BENEFICIARY_ACCOUNT'],//收款方账户
'beneficiary_name': fieldValueMap['BENEFICIARY_NAME'],//收款方户名
//'receipt_no': fieldValueMap['RECEIPT_NO'].substring(4, 13),
'slip_batch_id': record[0].SLIP_BATCH_ID,
});
}
}
}
} catch (e) {
}catch (e) {
println('e:' + e);
}
]]>
</s:server-script>
</a:init-procedure>
<a:service-output output="/parameter"/>
}
]]>
</s:server-script>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
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