Commit 6500bfae authored by chenzhuo's avatar chenzhuo

保证金划转复核审批

parent 2f6470bb
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: 26887cz
$Date: 2021-08-23 下午04:23:02
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
csh_deposit_transfer_pkg.csh_deposit_transfer_execute(
p_user_id =>${/session/@user_id},
p_contemp_id =>${@contemp_id},
p_review_type =>${@review_type},
p_batch_id =>${../../@batch_id}
);
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
begin
csh_deposit_transfer_pkg.create_deposit_transfer_record(
p_user_id =>${/session/@user_id},
p_role_id =>${/session/@role_id},
p_review_act =>${@review_act},
p_batch_id =>${@batch_id}
);
end;
]]></bm:update-sql>
<bm:parameters>
<bm:parameter name="batch_id" dataType="java.lang.Long" input="true" output="true" outputPath="/parameter/@batch_id"/>
</bm:parameters>
</bm:operation>
</bm:operations>
</bm:model>
......@@ -18,7 +18,8 @@
p_deposit_amount=>${@deposit_amount},
p_deposit_trans_type=>${@deposit_trans_type},
p_company_id=>${/session/@company_id},
p_user_id=>${/session/@user_id}
p_user_id=>${/session/@user_id},
p_source_trans_type=>${@source_trans_type}
);
end;
]]></bm:update-sql>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: 26887cz
$Date: 2021年8月2日15:40:53
$Revision: 1.0
$Purpose: 保证金划转复核
-->
<bm:model xmlns:o="leaf.database.local.oracle" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select * from (select ct.contemp_id,
ct.batch_id,
ct.bp_id,
ct.source_contract_id,
ct.contract_id,
ct.source_trans_type,
(select t.contract_number from con_contract t
where t.contract_id = ct.contract_id
and t.data_class = 'NORMAL'
and rownum = 1) contract_number,
ct.deposit_trans_type,
(SELECT sc.code_value_name
FROM sys_code_values_v sc
WHERE sc.code = 'DEPOSIT_TRANS_TYPE'
AND sc.code_value = ct.deposit_trans_type) deposit_trans_type_desc,
to_char(ct.je_date,'yyyy-MM-dd') je_date,
ct.deposit_amount,
ct.deposit_info,
cc.bp_id_agent_level1,
(SELECT t.bp_name
FROM hls_bp_master t
WHERE t.bp_id = cc.bp_id_agent_level1) bp_id_agent_level1_n,
cc.bp_id_tenant,
(SELECT bpv.bp_name
FROM hls_bp_master bpv
WHERE bpv.bp_id = cc.bp_id_tenant) bp_name
from csh_transaction_contemp ct, con_contract cc
where ct.contract_id = cc.contract_id
and cc.data_class = 'NORMAL') t1
#WHERE_CLAUSE#
order by t1.je_date desc
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t1.batch_id=${@batch_id} "/>
</bm:data-filters>
</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="execute">
<bm:update-sql><![CDATA[
begin
csh_deposit_transfer_pkg.check_sbo_num(
p_document_id =>${@document_id},
p_user_id =>${/session/@user_id}
);
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select *
from (select v.source_contract_id,
v.batch_id,
v.trans_review_status,
to_char(v.je_date,'yyyy-MM-dd') je_date,
v.source_trans_type,
(SELECT sc.code_value_name
FROM sys_code_values_v sc
WHERE sc.code = 'DEPOSIT_TRANS_TYPE'
AND sc.code_value = v.source_trans_type) deposit_trans_type_n,
(SELECT sc.code_value_name
FROM sys_code_values_v sc
WHERE sc.code = 'TRANS_REVIEW_STATUS'
AND sc.code_value = v.trans_review_status) trans_review_status_n,
cc.contract_number,
cc.contract_name,
cc.bp_id_agent_level1,
(SELECT t.bp_name
FROM hls_bp_master t
WHERE t.bp_id = cc.bp_id_agent_level1) bp_name,
cc.bp_id_tenant,
(SELECT bpv.bp_name
FROM hls_bp_master bpv
WHERE bpv.bp_id = cc.bp_id_tenant) bp_id_telnet_n,
(select sum((nvl(tt.transaction_amount, 0) -
nvl(tt.write_off_amount, 0) -
nvl(tt.returned_amount, 0)))
from csh_transaction tt
where tt.transaction_type = 'DEPOSIT'
and tt.ref_contract_id is not null
and tt.transaction_amount > 0
and tt.deposit_trans_type is not null
and tt.deposit_trans_type = v.source_trans_type
and tt.ref_contract_id = v.source_contract_id
and tt.bp_id = v.bp_id
group by tt.ref_contract_id, tt.deposit_trans_type, tt.bp_id) unwrite_off_amount,
nvl((hlcm_cux_deposit_pkg.get_transaction_status_new(p_contract_id => v.source_contract_id,
p_user_id => 1)),
'正常') approve_status
from con_contract cc,
(select distinct ct.batch_id,
ct.source_contract_id,
ct.bp_id,
ct.trans_review_status,
ct.source_trans_type,
ct.je_date
from csh_transaction_contemp ct
where nvl(ct.trans_review_status, 'NEW') <> 'NEW'
and ct.batch_id is not null
) v
where cc.contract_id = v.source_contract_id
and cc.data_class = 'NORMAL') t1
#WHERE_CLAUSE#
order by t1.trans_review_status,t1.je_date desc
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="contract_number" queryExpression="t1.contract_number like &apos;%&apos;||${@contract_number}||&apos;%&apos;"/>
<bm:query-field name="bp_name_n" queryExpression="t1.bp_name = ${@bp_name_n}"/>
<bm:query-field name="bp_id_telnet_n" queryExpression="t1.bp_id_telnet_n =${@bp_id_telnet_n}"/>
<bm:query-field name="deposit_trans_type" queryExpression="t1.source_trans_type = ${@deposit_trans_type}"/>
<bm:query-field name="trans_review_status" queryExpression="t1.trans_review_status =${@trans_review_status}"/>
<bm:query-field name="no_status" queryExpression="t1.trans_review_status != ${@no_status}"/>
</bm:query-fields>
</bm:model>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: 26887cz
$Date: 2021年8月2日15:40:53
$Revision: 1.0
$Purpose: 保证金划转复核
-->
<bm:model xmlns:o="leaf.database.local.oracle" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="CSH_TRANSACTION_CONTEMP">
<bm:fields>
<bm:field name="contemp_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTEMP_ID"/>
<bm:field name="bp_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_ID"/>
<bm:field name="batch_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BATCH_ID"/>
<bm:field name="source_contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SOURCE_CONTRACT_ID"/>
<bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID"/>
<bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NUMBER" forInsert="false" forUpdate="false"/>
<bm:field name="je_date" databaseType="DATE" datatype="java.util.Date" physicalName="JE_DATE"/>
<bm:field name="deposit_trans_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DEPOSIT_TRANS_TYPE"/>
<bm:field name="deposit_trans_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DEPOSIT_TRANS_TYPE_DESC" forInsert="false" forUpdate="false"/>
<bm:field name="source_trans_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SOURCE_TRANS_TYPE"/>
<bm:field name="deposit_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="DEPOSIT_AMOUNT"/>
<bm:field name="deposit_info" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DEPOSIT_INFO"/>
<bm:field name="bp_id_agent_level1" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_ID_AGENT_LEVEL1" forInsert="false" forUpdate="false"/>
<bm:field name="bp_id_agent_level1_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_ID_AGENT_LEVEL1_N" forInsert="false" forUpdate="false"/>
<bm:field name="bp_id_tenant" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_ID_TENANT" forInsert="false" forUpdate="false"/>
<bm:field name="bp_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_NAME" forInsert="false" forUpdate="false"/>
<bm:field name="file_num" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FILE_NUM" forInsert="false" forUpdate="false"/>
</bm:fields>
<bm:features>
<f:standard-who/>
<o:sequence-pk/>
</bm:features>
<bm:primary-key>
<bm:pk-field name="contemp_id"/>
</bm:primary-key>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select * from (select ct.contemp_id,
ct.bp_id,
ct.batch_id,
ct.source_trans_type,
ct.source_contract_id,
ct.contract_id,
(select t.contract_number from con_contract t
where t.contract_id = ct.contract_id
and t.data_class = 'NORMAL'
and rownum = 1) contract_number,
ct.deposit_trans_type,
(SELECT sc.code_value_name
FROM sys_code_values_v sc
WHERE sc.code = 'DEPOSIT_TRANS_TYPE'
AND sc.code_value = ct.deposit_trans_type) deposit_trans_type_desc,
ct.je_date,
ct.deposit_amount,
ct.deposit_info,
cc.bp_id_agent_level1,
(SELECT t.bp_name
FROM hls_bp_master t
WHERE t.bp_id = cc.bp_id_agent_level1) bp_id_agent_level1_n,
cc.bp_id_tenant,
(SELECT bpv.bp_name
FROM hls_bp_master bpv
WHERE bpv.bp_id = cc.bp_id_tenant) bp_name,
(select count(1)
from fnd_atm_attachment_multi fm
where fm.table_name = 'CSH_TRANSACTION_CONTEMP'
and fm.table_pk_value = ct.contemp_id) file_num
from csh_transaction_contemp ct, con_contract cc
where ct.contract_id = cc.contract_id
and ct.trans_review_status = 'NEW'
and cc.data_class = 'NORMAL') t1
#WHERE_CLAUSE#
order by t1.contemp_id
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t1.source_contract_id=${@source_contract_id} "/>
<bm:data-filter enforceOperations="query" expression="t1.bp_id=${@bp_id} "/>
</bm:data-filters>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<a:model-update model="hls.HLS811.hls_doc_file_templet_get_atm"/>
<s:server-script import="con_print_path.js"><![CDATA[
importPackage(Packages.hls.plugin.docx4j);
importPackage(Packages.com.hand.hls.hlcm.util);
importPackage(java.io);
function copyFile(fOld, fNew) {
var fis = new java.io.FileInputStream(fOld);
var fos = new java.io.FileOutputStream(fNew);
var b = new java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024 * 4);
var len = -1;
while ((len = fis.read(b)) != -1) {
fos.write(b, 0, len);
}
fis.close();
fos.close();
}
function transfer(file_path, os) {
println(file_path);
var fis = new FileInputStream(file_path);
var b = new java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024 * 64);
var len = -1;
while ((len = fis.read(b)) != -1) {
os.write(b, 0, len);
}
fis.close();
}
function download_file(file_name, file_path) {
$ctx["__request_type__"] = 'file'; //to indicate this request is not a JSON_REQUEST
var resp = $ctx['_instance.javax.servlet.http.HttpServletResponse'];
resp.setHeader("Pragma", "No-cache");
resp.setHeader("Cache-Control", "no-cache, must-revalidate");
resp.setDateHeader("Expires", 0);
resp.setContentType("application/x-msdownload");
resp.setHeader("Content-disposition", "attachment; filename=" + encodeURI(file_name, 'UTF-8'));
var os = resp.getOutputStream();
transfer(file_path, os);
os.flush();
}
var attachment_batch_dl = $bm('hls.HLS811.hls_doc_file_templet_get_atm');
var result = attachment_batch_dl.queryAsMap({
document_id: $ctx.parameter.document_id,
document_table: $ctx.parameter.document_table,
batch_flag: $ctx.parameter.batch_flag,
content_id: $ctx.parameter.content_id
});
var from_file_data = result.getChildren();
for (var i = 0;i < from_file_data.length;i++) {
if (!$ctx.parameter.file_path) {
set_parameter_file_path();
}
var to_file_path = $ctx.parameter.file_path;
var record_data = from_file_data[i];
// var to_file_name = record_data.to_file_name;
var to_file_name = $ctx.parameter.file_name+'.docx';
var from_file_path = record_data.file_path;
var guid_file_name_path = $bm('cont.CON500.con_contract_get_guid_file_name').queryAsMap();
var guid_file_name_tables = guid_file_name_path.getChildren();
to_file_path = to_file_path + guid_file_name_tables[0].guid_file_name + 'doc' + record_data.content_id;
copyFile(from_file_path, to_file_path);
$bm('hls.HLS811.hls_file_content_copy_update').update({
table_name: 'HLS_DOC_FILE_CONTENT',
content_id: record_data.content_id,
file_name: to_file_name.toString(),
file_path: to_file_path.toString(),
source_type: $ctx.parameter.source_type
});
try {
$bm('csh.CSH501.csh_transaction_return_print').update({
document_id: $ctx.parameter.document_id,
document_table: $ctx.parameter.document_table
});
var brwt = new BookmarksReplaceWithText($instance('leaf.database.service.IDatabaseServiceFactory'), $instance('uncertain.ocm.IObjectRegistry'), $ctx.getData());
brwt.replaceBookmarkFromContent(to_file_path.toString(), record_data.content_id.toString(), 'COMMON');
var resp = $ctx['_instance.javax.servlet.http.HttpServletResponse'];
HlsFileUtil.downloadFile(encodeURI(to_file_path,'utf-8'),encodeURI(to_file_name,'utf-8'),resp);
// download_file(encodeURI(to_file_name,'utf-8'), to_file_path);
// print(to_file_name);
} catch (e) {
raise_app_error(e);
}
}
]]></s:server-script>
</a:init-procedure>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" trace="true">
<a:init-procedure>
<a:model-execute model="cus_deposit.CUS_DEPOSIT102.csh_deposit_transfer_batch" trace="true"/>
<batch-apply sourcePath="/parameter/details">
<a:model-update model="cus_deposit.CUS_DEPOSIT102.csh_deposit_transfer_batch" trace="true"/>
</batch-apply>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: 26887cz
$Date: 2021-08-03 上午11:10:33
$Revision: 1.0
$Purpose:保证金划转复核
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
<a:init-procedure>
<a:model-query defaultWhereClause="t1.role_id=${/session/@role_id}" fetchAll="true"
model="cont.CON733.query_roles_info" rootPath="role_code"/>
</a:init-procedure>
<a:view>
<a:link id="csh_transaction_detail_link" url="${/request/@context_path}/modules/cus_deposit/CUS_DEPOSIT102/csh_transfer_review_detail.lview"/>
<script type="text/javascript"><![CDATA[
//锁表
function lock_current_window() {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
}
//解锁
function unlock_current_window() {
Leaf.Masker.unmask(Ext.getBody());
}
function cus100_deposit_transfer_reset() {
$('csh_deposit_review_maintain_query_ds').reset();
}
function cus100_deposit_transfer_query(){
$('deposit_review_maintain_result_ds').query();
}
function cus100_deposit_transfer(){
var ds_id = 'deposit_review_maintain_result_ds';
var ds = $(ds_id);
var record = ds.getSelected()[0];
var url = $('csh_transaction_detail_link').getUrl();
new Leaf.Window({
id: 'csh_transaction_detail_transfer_link_winid',
params: {
winId: 'csh_transaction_detail_transfer_link_winid',
contract_id:record.get('source_contract_id'),
batch_id:record.get('batch_id'),
bp_id_agent_level1:record.get('bp_id'),
deposit_trans_type:record.get('deposit_trans_type'),
deposit_trans_type_desc:record.get('deposit_trans_type_n'),
role_code : '${/model/role_code/record/@role_code}'
},
url: url,
title: '保证金划转复核',
fullScreen: true
}).on('close',function(){
cus100_deposit_transfer_query();
});
}
Leaf.onReady(function () {
var role_code = '${/model/role_code/record/@role_code}';
var query_redord = $('csh_deposit_review_maintain_query_ds').getCurrentRecord();
if (role_code == '0002') {
$('deposit_review_maintain_result_ds').setQueryParameter('no_status','REVIEWING');
//$('deposit_review_maintain_result_ds').setQueryParameter('trans_review_status','REVIEWING1');
query_redord.set('trans_review_status','REVIEWING1');
query_redord.set('trans_review_status_desc','复审中');
} else if (role_code == '0003') {
$('deposit_review_maintain_result_ds').setQueryParameter('no_status','REVIEWING1');
//$('deposit_review_maintain_result_ds').setQueryParameter('trans_review_status','REVIEWING');
query_redord.set('trans_review_status','REVIEWING');
query_redord.set('trans_review_status_desc','初审中');
}
$('deposit_review_maintain_result_ds').query();
});
]]></script>
<a:dataSets>
<a:dataSet id="DEPOSIT_TRANS_TYPE_DS" lookupCode="DEPOSIT_TRANS_TYPE"/>
<a:dataSet id="TRANS_REVIEW_STATUS_DS" lookupCode="TRANS_REVIEW_STATUS"/>
<a:dataSet id="csh_deposit_review_maintain_query_ds" autoCreate="true">
<a:fields>
<a:field name="deposit_trans_type"/>
<a:field name="contract_number"/>
<a:field name="bp_name_n"/>
<a:field name="bp_id_telnet_n"/>
<a:field name="deposit_trans_type_desc" options="DEPOSIT_TRANS_TYPE_DS"
returnField="deposit_trans_type" displayField="code_value_name" valueField="code_value"/>
<a:field name="trans_review_status_desc" options="TRANS_REVIEW_STATUS_DS"
returnField="trans_review_status" displayField="code_value_name" valueField="code_value"/>
<a:field name="trans_review_status"/>
</a:fields>
</a:dataSet>
<a:dataSet id="deposit_review_maintain_result_ds" autoPageSize="true" autoQuery="false" model="cus_deposit.CUS_DEPOSIT102.csh_transaction_review_execute" queryDataSet="csh_deposit_review_maintain_query_ds" selectable="true" selectionModel="single">
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:gridButton click="cus100_deposit_transfer" text="划转审批" id="cus100_deposit_transfer_id"/>
<a:gridButton click="cus100_deposit_transfer_query" text="HLS.QUERY" id="cus100_deposit_transfer_query_id"/>
<a:gridButton click="cus100_deposit_transfer_reset" text="HLS.RESET"/>
</a:screenTopToolbar>
<a:form labelWidth="120" marginWidth="80"
title="查询条件" style="margin-left:20px" column="3">
<a:textField name="contract_number" prompt="合同编号" bindTarget="csh_deposit_review_maintain_query_ds"/>
<a:textField name="bp_name_n" prompt="代理店" bindTarget="csh_deposit_review_maintain_query_ds"/>
<a:textField name="bp_id_telnet_n" prompt="承租人" bindTarget="csh_deposit_review_maintain_query_ds"/>
<a:comboBox name="deposit_trans_type_desc" prompt="保证金类型" bindTarget="csh_deposit_review_maintain_query_ds"/>
<a:comboBox name="trans_review_status_desc" prompt="复核状态" bindTarget="csh_deposit_review_maintain_query_ds"/>
</a:form>
<a:fieldSet labelWidth="150" style="margin-left:20px">
<a:grid id="csh_transaction_receipt_maintain_grid_ds" bindTarget="deposit_review_maintain_result_ds" marginHeight="165" marginWidth="100" navBar="true" >
<a:columns>
<a:column name="bp_name" prompt="代理店" align="center" width="200"/>
<a:column name="bp_id_telnet_n" prompt="承租人" align="center" width="120"/>
<a:column name="contract_number" prompt="合同编号" align="center"/>
<a:column name="contract_name" prompt="合同名称" align="center" width="200"/>
<a:column name="deposit_trans_type_n" prompt="保证金类型" width="110" align="center"/>
<a:column name="unwrite_off_amount" prompt="剩余可用金额" width="110" renderer="Leaf.formatMoney" align="right" />
<a:column name="approve_status" prompt="合同状态" width="80" align="center"/>
<a:column name="trans_review_status_n" prompt="复核状态" width="80" align="center"/>
<a:column name="je_date" prompt="申请时间" width="140" align="center"/>
</a:columns>
</a:grid>
</a:fieldSet>
</a:screenBody>
</a:view>
</a:screen>
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