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 @@
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT t1.bp_code,
t1.bp_name,
t1.contract_number,
(t1.int_rate_display*100)||'%' int_rate_display,
t1.lease_start_date,
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#
SELECT COUNT(*) job_run_flag
from sch_concurrent_job t
WHERE t.task_code='CALC_IFRS9_COL_JOB'
AND t.job_status='RUNNING'
AND instr(t.what,${/parameter/@period_name})>0
]]>
</bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:parameters>
<bm:parameter name="job_id" input="false" output="true" outputPath="@job_id"/>
</bm:parameters>
<bm:update-sql><![CDATA[
begin
csh_write_off_pkg.update_ifrs9_col(
contract_item_query_pkg.calc_ifrs9_col_job(
p_period_name =>${@period_name},
p_job_id =>${@job_id},
p_user_id =>${/session/@user_id}
);
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
select
csh_write_off_pkg.update_ifrs9_col_flag(
begin
csh_write_off_pkg.update_ifrs9_col_flag(
p_period_name =>${@period_name},
p_user_id =>${/session/@user_id} ) flag
from dual
p_user_id =>${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
......
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="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: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:view>
<link href="${/request/@context_path}/lib/bootstrap-3.3.7/css/bootstrap.css" rel="stylesheet" type="text/css"/>
......@@ -11,6 +15,10 @@
modelaction="update"/>
<a:link id="save_ifrs9_report_link" model="cont.CON3500.contract_ifrs9_report_temp"
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"
url="${/request/@context_path}/modules/cont/CON505/con_contract_modify.lview"/>
<style>
......@@ -24,15 +32,30 @@
Leaf.onReady(function(){
//检查保存按钮
var flag='${/model/status/record/@flag}';
var job_flag='${/model/job_status/record/@job_run_flag}';
console.log(flag);
if(flag=='Y'){
$("${/parameter/@layout_code}_user_button1").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" role="alert" >数据只能保存一次,请确认后保存</div>');
t.insertAdjacentHTML('afterend', '<div class="alert alert-danger" id="reminder" role="alert" >job正在运行中,请尝试点击获取结果按钮获得结果!</div>');
}
}
else{
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" >数据只能保存一次,请确认后保存</div>');
}
}
......@@ -41,10 +64,44 @@
$(ds_id).query();
})
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');
$(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();
var period_name="${/parameter/@period_name}";
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,19 @@
var period_name="${/parameter/@period_name}";
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('save_ifrs9_report_link').getUrl(),
url: $('update_ifrs9_report_link').getUrl(),
para: {
period_name:period_name
},
success: function() {
$("${/parameter/@layout_code}_user_button1").disable();
$("${/parameter/@layout_code}_user_button2").disable();
$("${/parameter/@layout_code}_user_button3").disable();
Leaf.SideBar.show({
msg: '保存成功',
duration: 2000
});
Leaf.Masker.unmask(Ext.getBody());
$(ds_id).query();
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
......@@ -75,6 +132,42 @@
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();
$("${/parameter/@layout_code}_user_button1").enable();
$("${/parameter/@layout_code}_user_button2").enable();
document.getElementById("reminder").innerText='数据更新已经完成,可以进行保存以及导出操作!';
}
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
]]></script>
<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