Commit 70751690 authored by stone's avatar stone

[feat]ifrs9报表功能的开发

parent e37ffd01
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select
csh_write_off_pkg.update_ifrs9_col_flag(
p_period_name =>${/parameter/@period_name},
p_user_id =>${/session/@user_id} ) flag
from dual
]]>
</bm:query-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="period_name" queryExpression="t1.period_day=${@period_name}"/>
<!-- <bm:query-field name="journal_date_to" queryExpression="to_char(t.journal_date,&apos;yyyy-mm-dd&apos;) &lt;= ${@journal_date_to}"/>-->
<!-- <bm:query-field name="bp_id_agent_level1" queryExpression="t.bp_id_agent_level1=${@bp_id_agent_level1}"/>-->
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select
csh_write_off_pkg.query_ifrs9_col_flag(p_period_name => ${/parameter/@period_name},
p_user_id => ${/session/@user_id}) flag
from dual
]]></bm:query-sql>
</bm:operation>
<bm:operation name="execute">
<bm:parameters>
<bm:parameter name="finish_flag" input="false" output="true" outputPath="@job_finish_flag"/>
</bm:parameters>
<bm:update-sql><![CDATA[
begin
contract_item_query_pkg.get_job_finish_flag(p_period_name =>${@period_name} ,
p_finish_flag => ${@finish_flag} ,
p_user_id =>${/session/@user_id} );
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="flag" databaseType="varchar2" datatype="java.lang.String"/>
</bm:fields>
</bm:model>
...@@ -3,59 +3,35 @@ ...@@ -3,59 +3,35 @@
<bm:operations> <bm:operations>
<bm:operation name="query"> <bm:operation name="query">
<bm:query-sql><![CDATA[ <bm:query-sql><![CDATA[
SELECT t1.bp_code, SELECT COUNT(*) job_run_flag
t1.bp_name, from sch_concurrent_job t
t1.contract_number, WHERE t.task_code='CALC_IFRS9_COL_JOB'
(t1.int_rate_display*100)||'%' int_rate_display, AND t.job_status='RUNNING'
t1.lease_start_date, AND instr(t.what,${/parameter/@period_name})>0
t1.contract_amount TOTAL_SIGN,
t1.pre_pay_amount DOWN_PAYMENT,
t1.contract_principal_amount HD_USER_COL_N11,
(csh_write_off_pkg.get_ifr_overdue_amount(p_contract_id => t1.ref_contract_id,
p_base_date => t1.base_date)) TOTAL_OVERDUE_AMOUNT,
(csh_write_off_pkg.get_overdue_day(p_contract_id => t1.ref_contract_id,
p_calc_date => t1.base_date,
p_user_id => 1))OVERDUE_MAX_DAYS,
nvl(( con_cashflow_monthly_pkg.get_unwrite_amount_column(p_session_id => -1,
p_due_date => t1.base_date,
p_contract_id =>t1.ref_contract_id )),0) RESIDUAL_CLAIMS,
t1.pay_date PAYDATE_1,
t1.pay_amount RESIDUAL_VALUE,
t1.industry_belonged INDUSTRY,
t1.lease_item_location LEASE_ITEM_LOCATION,
t1.base_date,
t1.created_by,
t1.creation_date,
t1.last_updated_by,
t1.last_update_date,
t1.ifrs_id,
t1.period_day period_name,
t1.ref_contract_id
FROM con_contract_ifrs9 t1
#WHERE_CLAUSE#
]]> ]]>
</bm:query-sql> </bm:query-sql>
</bm:operation> </bm:operation>
<bm:operation name="update"> <bm:operation name="update">
<bm:parameters>
<bm:parameter name="job_id" input="false" output="true" outputPath="@job_id"/>
</bm:parameters>
<bm:update-sql><![CDATA[ <bm:update-sql><![CDATA[
begin begin
csh_write_off_pkg.update_ifrs9_col( contract_item_query_pkg.calc_ifrs9_col_job(
p_period_name =>${@period_name}, p_period_name =>${@period_name},
p_job_id =>${@job_id},
p_user_id =>${/session/@user_id} p_user_id =>${/session/@user_id}
); );
end; end;
]]></bm:update-sql> ]]></bm:update-sql>
</bm:operation> </bm:operation>
<bm:operation name="execute"> <bm:operation name="execute">
<bm:update-sql><![CDATA[ <bm:update-sql><![CDATA[
select begin
csh_write_off_pkg.update_ifrs9_col_flag( csh_write_off_pkg.update_ifrs9_col_flag(
p_period_name =>${@period_name}, p_period_name =>${@period_name},
p_user_id =>${/session/@user_id} ) flag p_user_id =>${/session/@user_id});
from dual end;
]]></bm:update-sql> ]]></bm:update-sql>
</bm:operation> </bm:operation>
</bm:operations> </bm:operations>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" <a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true"
trace="true"> trace="true">
<!-- <a:init-procedure>-->
<!-- <a:model-query model="cont.CON3500.contract_ifrs9_report_flag_query" rootPath="status"/>-->
<!-- </a:init-procedure>-->
<a:init-procedure> <a:init-procedure>
<a:model-query model="cont.CON3500.contract_ifrs9_report_flag" rootPath="status"/> <a:model-query fetchAll="true" model="cont.CON3500.contract_ifrs9_report_flag_query" rootPath="/model/status"/>
<a:model-query fetchAll="true" model="cont.CON3500.contract_ifrs9_report_temp" rootPath="/model/job_status"/>
</a:init-procedure> </a:init-procedure>
<a:view> <a:view>
<link href="${/request/@context_path}/lib/bootstrap-3.3.7/css/bootstrap.css" rel="stylesheet" type="text/css"/> <link href="${/request/@context_path}/lib/bootstrap-3.3.7/css/bootstrap.css" rel="stylesheet" type="text/css"/>
...@@ -11,6 +15,10 @@ ...@@ -11,6 +15,10 @@
modelaction="update"/> modelaction="update"/>
<a:link id="save_ifrs9_report_link" model="cont.CON3500.contract_ifrs9_report_temp" <a:link id="save_ifrs9_report_link" model="cont.CON3500.contract_ifrs9_report_temp"
modelaction="update"/> modelaction="update"/>
<a:link id="get_job_finish_flag_link" model="cont.CON3500.contract_ifrs9_report_flag_query"
modelaction="execute"/>
<a:link id="update_ifrs9_report_link" model="cont.CON3500.contract_ifrs9_report_temp"
modelaction="execute"/>
<a:link id="${/parameter/@layout_code}con_contract_query_link" <a:link id="${/parameter/@layout_code}con_contract_query_link"
url="${/request/@context_path}/modules/cont/CON505/con_contract_modify.lview"/> url="${/request/@context_path}/modules/cont/CON505/con_contract_modify.lview"/>
<style> <style>
...@@ -24,15 +32,30 @@ ...@@ -24,15 +32,30 @@
Leaf.onReady(function(){ Leaf.onReady(function(){
//检查保存按钮 //检查保存按钮
var flag='${/model/status/record/@flag}'; var flag='${/model/status/record/@flag}';
var job_flag='${/model/job_status/record/@job_run_flag}';
console.log(flag);
if(flag=='Y'){ if(flag=='Y'){
$("${/parameter/@layout_code}_user_button1").disable(); $("${/parameter/@layout_code}_user_button1").disable();
$("${/parameter/@layout_code}_user_button2").disable(); $("${/parameter/@layout_code}_user_button2").disable();
}else{ $("${/parameter/@layout_code}_user_button3").disable();
}else if(job_flag>0){
$("${/parameter/@layout_code}_user_button1").disable();
$("${/parameter/@layout_code}_user_button2").disable();
var reminder=document.getElementsByClassName('screenTopToolbar');
for(var i=0;i<reminder.length;i=i+1){
var t=reminder[i];
t.insertAdjacentHTML('afterend', '<div class="alert alert-danger" id="reminder" role="alert" >job正在运行中,请尝试点击获取结果按钮获得结果!</div>');
}
}
else{
var reminder=document.getElementsByClassName('screenTopToolbar'); var reminder=document.getElementsByClassName('screenTopToolbar');
for(var i=0;i<reminder.length;i=i+1){ for(var i=0;i<reminder.length;i=i+1){
var t=reminder[i]; var t=reminder[i];
t.insertAdjacentHTML('afterend', '<div class="alert alert-danger" role="alert" >数据只能保存一次,请确认后保存</div>'); t.insertAdjacentHTML('afterend', '<div class="alert alert-danger" id="reminder" role="alert" >数据只能保存一次,请确认后保存</div>');
} }
} }
...@@ -41,10 +64,44 @@ ...@@ -41,10 +64,44 @@
$(ds_id).query(); $(ds_id).query();
}) })
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() { window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
//先删除之前的数据
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_ifrs9'); var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_ifrs9');
$(ds_id).setQueryUrl('${/request/@context_path}/autocrud/cont.CON3500.contract_ifrs9_report_temp/query');
$(ds_id).setQueryParameter('period_name','${/parameter/@period_name}'); var period_name="${/parameter/@period_name}";
$(ds_id).query(); Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('save_ifrs9_report_link').getUrl(),
para: {
period_name:period_name
},
success: function(result) {
$("${/parameter/@layout_code}_user_button1").disable();
$("${/parameter/@layout_code}_user_button2").disable();
// Leaf.SideBar.show({
// msg: '数据正在执行中...',
// duration: 2000
// });
// Leaf.Masker.unmask(Ext.getBody());
Leaf.Masker.unmask(Ext.getBody());
document.getElementById("reminder").innerText='数据正在更新中,请稍后(请更新成功后再进行导出操作)';
$(ds_id).removeAll();
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
//
// var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_ifrs9');
// $(ds_id).setQueryUrl('${/request/@context_path}/autocrud/cont.CON3500.contract_ifrs9_report_temp/query');
// $(ds_id).setQueryParameter('period_name','${/parameter/@period_name}');
// $(ds_id).query();
} }
//保存数据 //保存数据
...@@ -52,19 +109,52 @@ ...@@ -52,19 +109,52 @@
var period_name="${/parameter/@period_name}"; var period_name="${/parameter/@period_name}";
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}'); Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({ Leaf.request({
url: $('save_ifrs9_report_link').getUrl(), url: $('update_ifrs9_report_link').getUrl(),
para: { para: {
period_name:period_name period_name:period_name
}, },
success: function() { success: function() {
$("${/parameter/@layout_code}_user_button1").disable(); $("${/parameter/@layout_code}_user_button1").disable();
$("${/parameter/@layout_code}_user_button2").disable(); $("${/parameter/@layout_code}_user_button2").disable();
$("${/parameter/@layout_code}_user_button3").disable();
Leaf.SideBar.show({ Leaf.SideBar.show({
msg: '保存成功', msg: '保存成功',
duration: 2000 duration: 2000
}); });
Leaf.Masker.unmask(Ext.getBody()); Leaf.Masker.unmask(Ext.getBody());
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
//获取查询结果
window['${/parameter/@layout_code}_user_button3_layout_dynamic_click'] = function() {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_ifrs9');
$(ds_id).setQueryParameter("period_name",'${/parameter/@period_name}');
//查看job有没有返回结果
Leaf.Masker.mask(Ext.getBody());
Leaf.request({
url: $('get_job_finish_flag_link').getUrl(),
para: {
period_name:'${/parameter/@period_name}'
},
success: function(res) {
Leaf.Masker.unmask(Ext.getBody());
debugger;
console.log(res)
var job_finish_flag=res.result['job_finish_flag'];
if(job_finish_flag>0) {
$(ds_id).query(); $(ds_id).query();
$("${/parameter/@layout_code}_user_button1").enable();
$("${/parameter/@layout_code}_user_button2").enable();
document.getElementById("reminder").innerText='数据更新已经完成,可以进行保存以及导出操作!';
}
}, },
failure: function() { failure: function() {
Leaf.Masker.unmask(Ext.getBody()); Leaf.Masker.unmask(Ext.getBody());
...@@ -74,7 +164,10 @@ ...@@ -74,7 +164,10 @@
}, },
scope: this scope: this
}); });
} }
]]></script> ]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/> <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
......
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