Commit dc3bac9b authored by 陆正友's avatar 陆正友

农行修改--job改按钮功能

parent bb985bb0
......@@ -2,6 +2,15 @@
<bm:model xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT *
FROM hlcm_ele_abc_bank_slip_bacth b
WHERE b.start_date = TO_DATE('${:@parameter_code}', 'YYYY-MM-DD')
and b.slip_batch_id = nvl(${@batch_id},0)
ORDER BY b.slip_batch_id desc
]]></bm:query-sql>
</bm:operation>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
......
......@@ -14,6 +14,8 @@
url="${/request/@context_path}/modules/csh/CSH1400/csh_abc_import_save.lsc"/>
<a:link id="csh_abc_import_transaction_link"
url="${/request/@context_path}/modules/csh/CSH1400/csh_abc_import_transaction.lsc"/>
<a:link id="ocr_query_link_id"
url="${/request/@context_path}/modules/efile/EFILE1100/efile_doc_import_new.lsc"/>
<script type="text/javascript"><![CDATA[
Leaf.onReady(function () {
//只开放按钮权限给债权内勤
......@@ -22,10 +24,12 @@
$('agricultural_bank_save_id').enable(); // 启用按钮
$('agricultural_bank_import_id').enable(); // 启用按钮
$('agricultural_bank_submit_id').enable(); // 启用按钮
$('query_ocr').enable(); // 启用按钮
} else {
$('agricultural_bank_save_id').disable(); // 禁用按钮
$('agricultural_bank_import_id').disable(); // 禁用按钮
$('agricultural_bank_submit_id').disable(); // 禁用按钮
$('query_ocr').disable(); // 禁用按钮
}
});
......@@ -227,6 +231,30 @@
});
}
//获取OCR数据
function query_ocr(){
Leaf.Masker.mask(Ext.getBody(), '获取OCR数据中');
var ocr_query_link ='ocr_query_link_id';
Leaf.request({
url: $(ocr_query_link ).getUrl(),
success: function(res) {
Leaf.Masker.unmask(Ext.getBody());
Leaf.SideBar.show({
msg:'获取数据'+res.result.page_number+'页'+'共'+res.result.total+'条',
duration: 10000
})
$("OcrQueryDs").query();
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
]]></script>
......@@ -284,6 +312,7 @@
<a:screenTitle/>
<a:gridButton id="Ocr_Bank_Query" click="agricultural_bank_query" text="HLS.QUERY"/>
<a:gridButton id="agricultural_bank_save_id" click="agricultural_bank_save" text="保存"/>
<a:gridButton id="query_ocr" click="query_ocr" text="获取数据"/>
<a:gridButton id="agricultural_bank_import_id" click="agricultural_bank_import" text="收款导入"/>
<a:gridButton id="agricultural_bank_submit_id" click="agricultural_bank_submit" text="提交"/>
</a:screenTopToolbar>
......
<?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"><![CDATA[
<s:server-script import="token_record.js"><![CDATA[
importPackage(java.io);
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()
importPackage(java.util);
importPackage(Packages.com.hand.hlcm);
importPackage(Packages.com.hand.hl);
var logger = $logger('server-script');
function query_next_query(batch_id){
send_query(batch_id);
}
function send_query (batch_id){
// 获取当前日期
var currentDate = new Date();
// 设置开始时间为明天的凌晨整点
var startdate_n = new Date(Date.UTC(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate()
, 0, 0, 0));
// 设置结束时间为后天的凌晨整点
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 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 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=100; //每次请求当前页条数
try {
try {
var sys_url_bm = $bm('cont.CON4000.get_sys_url');
var parameter_code = 'TOKEN_POSTURL';
var SysposturlQuery = sys_url_bm.queryAsMap({
......@@ -64,10 +69,11 @@ try {
});
var token_type = tokenTypeyQuery.getChildren()[0].parameter_value;
var bank_list_bm = $bm('efile.EFILE1100.get_bank_list');
var bank_list_bm = $bm('efile.EFILE1100.att_import_bank');
var parameter_code = starttime;
var response_json_list = bank_list_bm.queryAsMap({
parameter_code: parameter_code
parameter_code: parameter_code,
batch_id : batch_id
});
var list =response_json_list.getChildren().length;
var record = response_json_list.getChildren();
......@@ -120,7 +126,6 @@ try {
'request_url' : docUrl
})
var bank_list_bm = $bm('efile.EFILE1100.get_bank_list');
var parameter_code = starttime;
var response_json_list = bank_list_bm.queryAsMap({
......@@ -130,7 +135,6 @@ try {
var record = response_json_list.getChildren();
logger.info(typeof (record));
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);
......@@ -138,6 +142,9 @@ try {
var message = json_data.message;
var total = json_data.total;
$ctx.parameter.page_number = page_number;
$ctx.parameter.total = total;
var result=json_data.result;
// var result_list=JSON.stringify(result);
var result_list = result.length;
......@@ -268,6 +275,9 @@ try {
var message = json_data.message;
var total = json_data.total;
$ctx.parameter.page_number = page_number;
$ctx.parameter.total = total;
var result=json_data.result;
var result_list = result.length;
var return_page_size = JSON.stringify(result_list);
......@@ -312,11 +322,27 @@ try {
}
}
}
}catch (e) {
}catch (e) {
println('e:' + e);
}
]]>
</s:server-script>
</a:init-procedure>
<a:service-output output="/parameter"/>
}
if (total/100>page_number){
var batch_id = record[0].SLIP_BATCH_ID;
logger.info('19981988');
logger.info(batch_id);
logger.info('19981988');
query_next_query(batch_id);
}
}
function main(){
send_query();
}
main();
]]>
</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