Commit 50fbc82f authored by liyuan.chen's avatar liyuan.chen

[feat]合同变更文本,收款导入的匹配

parent ad586c05
Pipeline #6829 canceled with stages
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: gaoyang
$Date: 2013-4-15 下午01:13:07
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:s="leaf.plugin.script" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="csh_transaction_bp_temp" needAccessControl="false">
<bm:fields>
<bm:field name="bp_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_ID" prompt="HLS_BP_MASTER_V.BP_ID"/>
<bm:field name="bp_code" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="80" forDisplay="true" forQuery="true" physicalName="BP_CODE" prompt="HLS.BP_TITLE"/>
<bm:field name="bp_name" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="160" forDisplay="true" forQuery="true" physicalName="BP_NAME" prompt="HLS.BP_NAME_SHORT"/>
<bm:field name="bp_category" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_CATEGORY"/>
<bm:field name="bp_category_name" expression= "(SELECT h.description FROM hls_bp_category h where h.bp_category = t1.bp_category )" prompt="商业伙伴类型"/>
</bm:fields>
<bm:features>
<f:standard-who/>
<s:bm-script><![CDATA[
var cx = Packages.leaf.javascript.Context.getCurrentContext();
Packages.leaf.plugin.script.engine.ScriptImportor.defineExternScript(cx, this, $ctx.getData(), "aut_authority_bm_validate.js");
]]></s:bm-script>
</bm:features>
<bm:query-fields>
<bm:query-field field="bp_id" queryOperator="="/>
<bm:query-field field="bp_code" queryOperator="like"/>
<bm:query-field field="bp_name" queryExpression="t1.bp_name like &apos;%&apos;||${@bp_name}||&apos;%&apos;"/>
<!-- <bm:query-field field="bp_category" queryOperator="="/> -->
<bm:query-field field="bp_category" queryExpression="(t1.bp_category = ${@bp_category} or exists(select 1 from hls_bp_master_role br where br.bp_id = t1.bp_id and br.bp_category = ${@bp_category} and br.bp_type = ${@bp_category}))"/>
<bm:query-field name = "bp_category_name" queryExpression="(t1.bp_category_name like &apos;%&apos;||${@bp_category_name}||&apos;%&apos;)"/>
<!-- <bm:query-field name="contract_bp_flag" queryExpression="(exists (select 1 from con_contract_bp b where b.contract_id in (${:@contract_id}) and b.bp_id = t1.bp_id and b.bp_category in (&apos;VENDER&apos;,&apos;TENANT&apos;,&apos;TENANT_SEC&apos;) )or nvl(${@contract_bp_flag},&apos;N&apos;) != &apos;Y&apos; )"/> -->
</bm:query-fields>
<bm:data-filters>
<bm:data-filter name="query" expression="(t1.temp_id = ${@temp_id})"/>
</bm:data-filters>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: gaoyang
$Date: 2013-9-27 上午09:52:30
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
hl_con_contract_content_pkg.content_create_for_change(
p_contract_id =>${@contract_id},
p_content_id =>${@content_id},
p_user_id =>${/session/@user_id},
p_templet_usage =>${@templet_usage},
p_content_type =>${@content_type},
p_ccr_document_type => ${@ccr_document_type}
);
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: gaoyang
$Date: 2013-9-10 下午02:50:18
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1" baseTable="CON_CONTRACT_CONTENT_V">
<bm:fields>
<bm:field name="content_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTENT_ID" prompt="CON_CONTRACT_CONTENT_V.CONTENT_ID"/>
<bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID" prompt="CON_CONTRACT_CONTENT_V.CONTRACT_ID"/>
<bm:field name="con_contract_bp_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CON_CONTRACT_BP_ID" prompt="CON_CONTRACT_CONTENT_V.CON_CONTRACT_BP_ID"/>
<bm:field name="mortgage_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="MORTGAGE_ID" prompt="CON_CONTRACT_CONTENT_V.MORTGAGE_ID"/>
<bm:field name="content_number" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="CONTENT_NUMBER" prompt="文本编号"/>
<bm:field name="content_print_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTENT_PRINT_FLAG" prompt="CON_CONTRACT_CONTENT_V.CONTENT_PRINT_FLAG"/>
<bm:field name="content_print_flag_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTENT_PRINT_FLAG_NAME" prompt="CON_CONTRACT_CONTENT_V.CONTENT_PRINT_FLAG_NAME"/>
<bm:field name="bp_category" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_CATEGORY" prompt="CON_CONTRACT_CONTENT_V.BP_CATEGORY"/>
<bm:field name="bp_category_desc" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" physicalName="BP_CATEGORY_DESC" prompt="商业伙伴类别"/>
<bm:field name="bp_class" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_CLASS" prompt="CON_CONTRACT_CONTENT_V.BP_CLASS"/>
<bm:field name="bp_class_desc" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" physicalName="BP_CLASS_DESC" prompt="合同类型"/>
<bm:field name="bp_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_ID" prompt="CON_CONTRACT_CONTENT_V.BP_ID"/>
<bm:field name="bp_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_NAME" prompt="CON_CONTRACT_CONTENT_V.BP_NAME"/>
<bm:field name="available_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="AVAILABLE_FLAG" prompt="CON_CONTRACT_CONTENT_V.AVAILABLE_FLAG"/>
<bm:field name="employee_id_witness_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EMPLOYEE_ID_WITNESS_NAME" prompt="CON_CONTRACT_CONTENT_V.EMPLOYEE_ID_WITNESS_NAME"/>
<bm:field name="sign_date" databaseType="DATE" datatype="java.util.Date" physicalName="SIGN_DATE" prompt="CON_CONTRACT_CONTENT_V.SIGN_DATE"/>
<bm:field name="sign_place" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SIGN_PLACE" prompt="CON_CONTRACT_CONTENT_V.SIGN_PLACE"/>
<bm:field name="signer_opposite_side" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SIGNER_OPPOSITE_SIDE" prompt="CON_CONTRACT_CONTENT_V.SIGNER_OPPOSITE_SIDE"/>
<bm:field name="notary" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="NOTARY" prompt="CON_CONTRACT_CONTENT_V.NOTARY"/>
<bm:field name="templet_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TEMPLET_ID" prompt="CON_CONTRACT_CONTENT_V.TEMPLET_ID"/>
<bm:field name="templet_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TEMPLET_CODE" prompt="CON_CONTRACT_CONTENT_V.TEMPLET_CODE"/>
<bm:field name="templet_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TEMPLET_NAME" prompt="CON_CONTRACT_CONTENT_V.TEMPLET_NAME"/>
<bm:field name="templet_usage" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TEMPLET_USAGE" prompt="CON_CONTRACT_CONTENT_V.TEMPLET_USAGE"/>
<bm:field name="clause_usage" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CLAUSE_USAGE" prompt="CON_CONTRACT_CONTENT_V.CLAUSE_USAGE"/>
<bm:field name="clause_usage_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CLAUSE_USAGE_NAME" prompt="CON_CONTRACT_CONTENT_V.CLAUSE_USAGE_NAME"/>
<bm:field name="ref_v01" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V01" prompt="CON_CONTRACT_CONTENT.REF_V01"/>
<bm:field name="ref_v02" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V02" prompt="CON_CONTRACT_CONTENT.REF_V02"/>
<bm:field name="ref_v03" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V03" prompt="CON_CONTRACT_CONTENT.REF_V03"/>
<bm:field name="ref_v04" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V04" prompt="CON_CONTRACT_CONTENT.REF_V04"/>
<bm:field name="ref_v05" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V05" prompt="CON_CONTRACT_CONTENT.REF_V05"/>
<bm:field name="ref_n01" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N01" prompt="CON_CONTRACT_CONTENT.REF_N01"/>
<bm:field name="ref_n02" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N02" prompt="CON_CONTRACT_CONTENT.REF_N02"/>
<bm:field name="ref_n03" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N03" prompt="CON_CONTRACT_CONTENT.REF_N03"/>
<bm:field name="ref_n04" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N04" prompt="CON_CONTRACT_CONTENT.REF_N04"/>
<bm:field name="ref_n05" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N05" prompt="CON_CONTRACT_CONTENT.REF_N05"/>
<bm:field name="ref_d01" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D01" prompt="CON_CONTRACT_CONTENT.REF_D01"/>
<bm:field name="ref_d02" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D02" prompt="CON_CONTRACT_CONTENT.REF_D02"/>
<bm:field name="ref_d03" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D03" prompt="CON_CONTRACT_CONTENT.REF_D03"/>
<bm:field name="ref_d04" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D04" prompt="CON_CONTRACT_CONTENT.REF_D04"/>
<bm:field name="ref_d05" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D05" prompt="CON_CONTRACT_CONTENT.REF_D05"/>
<bm:field name="status" databaseType="VARCHAR2" datatype="java.lang.String" />
<bm:field name="status_desc" databaseType="VARCHAR2" datatype="java.lang.String" />
<bm:field name="download_flag" databaseType="VARCHAR2" datatype="java.lang.String" />
<bm:field name="print_date" databaseType="DATE" datatype="java.util.Date" />
<bm:field name="agent_content_flag" databaseType="VARCHAR2" datatype="java.lang.String" />
<bm:field name="agent_content_flag_name" databaseType="VARCHAR2" datatype="java.lang.String" />
<bm:field name="download_content_flag" databaseType="VARCHAR2" datatype="java.lang.String" />
<bm:field name="download_content_flag_name" databaseType="VARCHAR2" datatype="java.lang.String" />
<!-- <bm:field name="couple_guarantee_flag" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="attach_count" expression="(select count(1) from fnd_atm_attachment_multi m where m.table_name = &apos;CON_CONTRACT_CONTENT_WORKFLOW&apos; and m.table_pk_value = to_char(t1.content_id))" forInsert="false" forUpdate="false"/>
<bm:field name="file_exists_flag" expression="(select &apos;Y&apos; from fnd_atm_attachment_multi m1 where m1.table_name = &apos;CON_CONTRACT_CONTENT&apos; and m1.table_pk_value = t1.content_id)"/> -->
</bm:fields>
<bm:features>
<f:standard-who/>
</bm:features>
<!--<bm:query-fields>
<bm:query-field field="content_number" queryOperator="like"/>
</bm:query-fields>-->
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT * FROM(
SELECT
t1.content_id,
t1.contract_id,
t1.con_contract_bp_id,
t1.mortgage_id,
t1.content_number,
t1.content_print_flag,
t1.content_print_flag_name,
t1.bp_category,
t1.bp_category_desc,
t1.bp_class,
t1.bp_class_desc,
t1.bp_id,
t1.bp_name,
t1.available_flag,
t1.employee_id_witness_name,
t1.sign_date,
t1.sign_place,
t1.signer_opposite_side,
t1.notary,
t1.templet_id,
t1.templet_code,
t1.templet_name,
t1.templet_usage,
t1.clause_usage,
t1.clause_usage_name,
t1.ref_v01,
t1.ref_v02,
t1.ref_v03,
t1.ref_v04,
t1.ref_v05,
t1.ref_n01,
t1.ref_n02,
t1.ref_n03,
t1.ref_n04,
t1.ref_n05,
t1.ref_d01,
t1.ref_d02,
t1.ref_d03,
t1.ref_d04,
t1.ref_d05,
t1.couple_guarantee_flag,
(SELECT
COUNT(1)
FROM
fnd_atm_attachment_multi m
WHERE
m.table_name = 'CON_CONTRACT_CONTENT_WORKFLOW' AND
m.table_pk_value = TO_CHAR(t1.content_id)
) AS attach_count,
(SELECT
'Y'
FROM
fnd_atm_attachment_multi m1
WHERE
m1.table_name = 'CON_CONTRACT_CONTENT' AND
m1.table_pk_value = t1.content_id
) AS file_exists_flag,
CASE
WHEN (SELECT COUNT(*)
FROM con_contract_signature s
WHERE s.content_id = t1.content_id
AND s.status = 2) >= 1 THEN
'2'
WHEN (SELECT COUNT(*)
FROM con_contract_signature s
WHERE s.content_id = t1.content_id
AND s.status = 3) >= 1 THEN
'3'
WHEN (SELECT COUNT(*)
FROM con_contract_signature s
WHERE s.content_id = t1.content_id
AND s.status = 4) >= 1 THEN
'4'
WHEN (SELECT COUNT(*)
FROM con_contract_signature s
WHERE s.content_id = t1.content_id
AND s.status = 5) >= 1 THEN
'5'
ELSE
'1'
END AS status,
CASE
WHEN (SELECT COUNT(*)
FROM con_contract_signature s
WHERE s.content_id = t1.content_id
AND s.status = 2) >= 1 THEN
'部分签署'
WHEN (SELECT COUNT(*)
FROM con_contract_signature s
WHERE s.content_id = t1.content_id
AND s.status = 3) >= 1 THEN
'全部签署'
WHEN (SELECT COUNT(*)
FROM con_contract_signature s
WHERE s.content_id = t1.content_id
AND s.status = 4) >= 1 THEN
'已盖章'
WHEN (SELECT COUNT(*)
FROM con_contract_signature s
WHERE s.content_id = t1.content_id
AND s.status = 5) >= 1 THEN
'已拒绝'
ELSE
'未签署'
END AS status_desc,
(SELECT COUNT(*) FROM con_contract_signature s WHERE s.content_id = t1.content_id AND s.status = 4)download_flag,
t1.agent_content_flag,
t1.download_content_flag,
t1.agent_content_flag_name,
t1.download_content_flag_name,
t1.print_date
FROM
CON_CONTRACT_CONTENT_V t1
WHERE
t1.templet_usage in ('CON_SALE', 'CONTRACT')
)t
#WHERE_CLAUSE#
ORDER BY decode(t.bp_category,'TENANT',0,'GUARANTOR',1,'VENDER',2,'')
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t.contract_id=${@contract_id} and t.ref_v05 = ${@ccr_document_type}"/>
</bm:data-filters>
</bm:model>
......@@ -19,7 +19,7 @@
t1.payment_deduction
from con_contract t1
where
t1.contract_status in ('INCEPT','NEW','ETING','REPURSING')
t1.contract_status in ('INCEPT','NEW','ETING','REPURING')
and t1.data_class = 'NORMAL'
and t1.company_id in ((
select company_id
......
......@@ -455,7 +455,7 @@
</a:hBox>
</a:form>
<a:grid id="acr515_invoiceVatDs_grid" bindTarget="acr515_invoiceVatDs" marginWidth="80" navBar="true" height="300">
<a:grid id="acr515_invoiceVatDs_grid" bindTarget="acr515_invoiceVatDs" marginWidth="80" navBar="true" marginHeight="200">
<a:columns>
<a:column name="contract_number" width="120"/>
<a:column name="document_number" lock="true" width="120" renderer="acr512_document_number_render"/>
......
......@@ -138,7 +138,7 @@
if (name == 'bs_link') {
return '<a href="javascript:open_bs_Window(\'' + record.id + '\',\'' + record.ds.id + '\')">明细</a>';
}
if(record.get('contract_status') == 'TERMINATE'){
if(record.get('contract_status') == 'TERMINATE' || record.get('contract_status') == 'INCEPT' || record.get('contract_status') == 'TERMINATING'){
if(name == 'con_seal_link'){
return '<a href="javascript:open_seal_win(\'' + record.id + '\',\'' + record.ds.id + '\')">用印信息</a>';
}
......
<?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-query fetchAll="true" model="cont.CON500.con_contract_get_guid_file_name" rootPath="guid_file_name_path"/>
<a:model-query fetchAll="true" model="cont.CON500.con_contract_get_guid_file_name"
rootPath="guid_file_name_path"/>
<!--<a:model-query fetchAll="true" model="cont.CON500.con_doc_file_templet_get_atm" rootPath="file_templet_get_atm_path"/>-->
<s:server-script import="contract_print_path.js"><![CDATA[
importPackage(java.io);
......@@ -112,7 +113,7 @@
} catch (e) {
raise_app_error(e);
}
if (record_data.templet_code == 'FINANCE_LEASE_CONTRACT'||record_data.templet_code == 'BUSINESS_CONTRACT'||record_data.templet_code == 'BUSINESS_CONTRACT_XJ'||record_data.templet_code=='LEASE_EXCHANGE'||record_data.templet_code=='LEASE_EXCHANGE_GN'||record_data.templet_code=='FINANCE_LEASE_CONTRACT_EX'||record_data.templet_code=='BUSINESS_CONTRACT_GK') {
if (record_data.templet_code == 'FINANCE_LEASE_CONTRACT'||record_data.templet_code == 'FINANCE_LEASE_CONTRACT_A4'||record_data.templet_code == 'BUSINESS_CONTRACT'||record_data.templet_code == 'BUSINESS_CONTRACT_XJ'||record_data.templet_code=='LEASE_EXCHANGE'||record_data.templet_code=='LEASE_EXCHANGE_GN'||record_data.templet_code=='FINANCE_LEASE_CONTRACT_EX'||record_data.templet_code=='BUSINESS_CONTRACT_GK') {
// word转pdf
var pdf_file_path=datePath+guid_file_name_tables[0].guid_file_name + 'con_' + record_data.content_id;
......
......@@ -20,6 +20,8 @@
url="${/request/@context_path}/modules/cont/CON701/con_contract_et_print.lsc"/>
<a:link id="assignment_agreement_print_link"
url="${/request/@context_path}/modules/cont/CON732/hls_ccr_modify_assignment_agreement_print.lsc"/>
<a:link id="hls_crr_query_print_link_id"
url="${/request/@context_path}/modules/cont/CON732/hls_crr_query_print_word_detail.lview"/>
<script type="text/javascript"><![CDATA[
function open_contract_win(ds_id, record_id) {
var record = $(ds_id).findById(record_id);
......@@ -72,7 +74,64 @@
height: '400'
});
}
//选择事件(grid,attach,gridbox,table)
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_select'] = function (ds, record, bp_seq) {
if(record.get('req_status') != 'APPROVED' || record.get('ccr_document_type') == 'ACC_CHAG' || record.get('ccr_document_type') == 'CUT_CHAG'){
document.getElementById("${/parameter/@layout_code}_user_button3").style.display = "none";
}else{
document.getElementById("${/parameter/@layout_code}_user_button3").style.display = "";
}
};
/*//取消选择事件(grid,attach,gridbox,table)
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_unselect'] = function (ds, record, bp_seq) {
document.getElementById("CON734_user_button3").style.display = "";
};*/
//文本生成
window['${/parameter/@layout_code}_user_button3_layout_dynamic_click'] = function () {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
var prj_project_result_ds = $(ds_id);
var records = prj_project_result_ds.getSelected();
if (records.length != 1) {
Leaf.showMessage('${l:PROMPT}', '${l:HLS.SELECT_RECORD}');
return false;
}
var record = records[0];
var ccr_document_type = record.get('ccr_document_type');
//var req_status = record.get('req_status');
var contract_id = record.get('change_req_id');
new Leaf.Window({
id: 'open_print_detail_win',
params: {
contract_id: contract_id,
ccr_document_type: ccr_document_type,
document_category: record.get('document_category'),
business_type : record.get('business_type'),
content_type : 'NORMAL',
winid: 'open_print_detail_win'
},
url: $('hls_crr_query_print_link_id').getUrl(),
title: '${l:CON505.CON_CONTENT_PRINT}',
width: 1000,
height: 450
});
/*if (req_status != 'APPROVED') {
Leaf.showMessage('${l:PROMPT}', '只有审批通过的合同才能打印!');
return false;
}*/
// ACC_CHAG 回款账户变更 LEASE_CHAG 承租人变更 CUT_CHAG 租金计划变更
/*if (ccr_document_type == 'LEASE_CHAG') {
var templet_code = 'ASSIGNMENT_AGREEMENT';
var url = $('assignment_agreement_print_link').getUrl() + '?contract_id=' + contract_id + '&templet_code=' + templet_code;
window.open(url, '_self');
}
if(ccr_document_type == 'ACC_CHAG'){
}*/
};
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record) {
// if (name == 'contract_number' && value) {
// return '<a href="javascript:open_contract_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
......
<?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-query fetchAll="true" model="cont.CON500.con_contract_get_guid_file_name"
rootPath="guid_file_name_path"/>
<!--<a:model-query fetchAll="true" model="cont.CON500.con_doc_file_templet_get_atm" rootPath="file_templet_get_atm_path"/>-->
<s:server-script import="contract_print_path.js"><![CDATA[
importPackage(java.io);
importPackage(Packages.hls.plugin.docx4j);
importPackage(Packages.leaf.plugin.word2pdf);
importPackage(Packages.org.apache.commons.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 deleteFile(filePath) {
var file = new File(filePath);
if (file.exists()) {
file.delete();
}
}
//生成pdf
function wordToPdf(word_file_path,pdf_file_path) {
// word转pdf
var pdf_file_path_new = pdf_file_path + '.pdf';
var wordToPdf = new WordToPdf($instance('uncertain.ocm.IObjectRegistry'), "jacob-1.18-x64.dll");
wordToPdf.word2pdf(word_file_path, pdf_file_path_new);
//删除word文件
// deleteFile(word_file_path);
return pdf_file_path_new;
}
//生成pdf openoffice
function doc2pdf(word_file_path,pdf_file_path) {
// word转pdf
var pdf_file_path_new = pdf_file_path + '.pdf';
var wordToPdf = new doc2pdf2();
wordToPdf.doc2pdf2("C:/Program Files (x86)/OpenOffice 4",word_file_path, pdf_file_path_new);
//删除word文件
deleteFile(word_file_path);
return pdf_file_path_new;
}
//生成pdf
function AsposeWordToPDF(word_file_path,pdf_file_path) {
// word转pdf
var pdf_file_path_new = pdf_file_path + '.pdf';
var wordToPdf = new AsposeUtil();
wordToPdf.trans(word_file_path, pdf_file_path_new,"word");
//删除word文件
deleteFile(word_file_path);
return pdf_file_path_new;
}
//按日期创建目录
function getDatePath() {
set_parameter_file_path();
var file_path = $ctx.parameter.pdf_path; //file_path = c:/hls_test_files/content_files/
var now = new Date()
y = now.getFullYear()
m = now.getMonth() + 1
m = m < 10 ? "0" + m : m
var datePath = file_path + y + "/" + m + "/";
return datePath; //datePath = d:/hls_test_files/fileupload/2018/04/
}
//第一步生成合同文本
$bm('cont.CON732.con_contract_create_content').update({
contract_id: $ctx.parameter.contract_id,
ccr_document_type: $ctx.parameter.ccr_document_type,
content_type:'NORMAL'
});
var datePath = getDatePath();
FileUtils.forceMkdir(new File(datePath)); //根据日期创建目录
var from_file_data_map=$bm('cont.CON500.con_doc_file_templet_get_atm').queryAsMap({
contract_id:$ctx.parameter.contract_id,
batch_flag:$ctx.parameter.batch_flag
});
var from_file_data = from_file_data_map.getChildren();
for (var i = 0;i < from_file_data.length;i++) {
var to_file_path = $ctx.parameter.file_path;
var record_data = from_file_data[i];
if (record_data.file_exists_flag != 'Y') {
var to_file_name = record_data.to_file_name + '.' + record_data.file_type_code || 'doc';
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 + 'con' + record_data.content_id+ '.' + record_data.file_type_code || 'doc';
copyFile(from_file_path, to_file_path);
try {
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);
} catch (e) {
raise_app_error(e);
}
// if (record_data.templet_code == 'FINANCE_LEASE_CONTRACT'||record_data.templet_code == 'FINANCE_LEASE_CONTRACT_A4'||record_data.templet_code == 'BUSINESS_CONTRACT'||record_data.templet_code == 'BUSINESS_CONTRACT_XJ'||record_data.templet_code=='LEASE_EXCHANGE'||record_data.templet_code=='LEASE_EXCHANGE_GN'||record_data.templet_code=='FINANCE_LEASE_CONTRACT_EX'||record_data.templet_code=='BUSINESS_CONTRACT_GK') {
// word转pdf
var pdf_file_path=datePath+guid_file_name_tables[0].guid_file_name + 'con_' + record_data.content_id;
var outputfilepath = wordToPdf(to_file_path,pdf_file_path);
var outputfilename= record_data.to_file_name +'.pdf';
var pdf_file = new File(outputfilepath);
var file_size = 0;
if (pdf_file.exists()) {
file_size = pdf_file.length();
}
//保存文本名及路径
$bm('cont.CON500.con_file_content_copy_update').execute({
table_name: 'CON_CONTRACT_CONTENT',
content_id: record_data.content_id,
file_name: outputfilename.toString(),
file_path: outputfilepath.toString(),
file_size: file_size,
file_type_code: 'pdf',
mime_type: 'application/pdf',
user_id: $ctx.parameter.user_id
});
// }
// else{
// $bm('cont.CON500.con_file_content_copy_update').update({
// table_name: 'CON_CONTRACT_CONTENT',
// content_id: record_data.content_id,
// file_name: to_file_name.toString(),
// file_path: to_file_path.toString()
// });
// }
}
}
]]></s:server-script>
</a:init-procedure>
</a:service>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: gaoyang
$Date: 2013-9-10 下午01:51:25
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:s="leaf.plugin.script" xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
<a:init-procedure>
<s:server-script import="contract_print_path.js"><![CDATA[
set_parameter_file_path();
]]></s:server-script>
<a:model-query fetchAll="true" model="cont.CON500N.bgfl_get_contract_print_file_path" rootPath="contract_file_path"/>
</a:init-procedure>
<a:view>
<a:link id="con_contract_content_asset_detail_link_id" url="${/request/@context_path}/modules/cont/CON505/con_contract_content_asset_detail.lview"/>
<a:link id="con_contract_update_print_fin_link_id" url="${/request/@context_path}/modules/cont/CON500/con_contract_update_print_word.lview"/>
<a:link id="con_contract_create_content_link_id" model="cont.CON505.con_contract_create_content" modelaction="update"/>
<a:link id="con_contract_save_print_information_link_id" model="cont.CON505.con_contract_save_print_information" modelaction="update"/>
<a:link id="get_mapping_xml_svc_link_id" model="cont.CON505.con_contract_save_print_information" modelaction="execute"/>
<a:link id="con_contract_uploadfile" url="${/request/@context_path}/uploadFile.lview"/>
<a:link id="con_contract_content_bp_link" model="cont.CON505.con_contract_content_bp_for_lov" modelaction="query"/>
<a:link id="con543_con_batch_dl_link_id" url="${/request/@context_path}/modules/cont/CON505/con_atm_batch_dl.lsc"/>
<a:link id="con_doc_batch_create_link_id" url="${/request/@context_path}/modules/cont/CON732/hls_crr_doc_batch_create.lsc"/>
<script><![CDATA[
function hls_crr_print_detail_print(){
//lock_current_window();
Leaf.Masker.mask($('${/parameter/@winid}').wrap, '正在生成并打印文本,请稍等。。。');
var result_ds = $('hls_crr_print_detail_grid_ds');
// var records = result_ds.getAll();
// var total_count = 0;
// if ($('hls_crr_print_detail_grid_ds').getAll().length <= 0) {
// Leaf.showMessage('提示', '请先生成合同文本!');
// unlock_current_window();
// return;
// }
// for (var m = 0;m < records.length;m++) {
// if (records[m].get('file_exists_flag') != 'Y') {
// total_count = total_count + 1;
// }
// }
// alert('${/parameter/@file_path}');
var file_path = $('contract_file_path_ds').getAt(0).get('contract_file_path');
Leaf.request({
url: $('con_doc_batch_create_link_id').getUrl(),
para: {
contract_id: '${/parameter/@contract_id}',
file_path: '${/parameter/@file_path}',
ccr_document_type: '${/parameter/@ccr_document_type}',
batch_flag: 'Y'
},
success: function(res) {
result_ds.query(result_ds.currentPage);
unlock_current_window();
},
error: function() {
unlock_current_window();
},
failure: function() {
unlock_current_window();
},
scope: this
});
}
function lock_current_window() {
Leaf.Masker.mask($('${/parameter/@winid}').wrap, '${l:HLS.EXECUTING}');
}
function unlock_current_window() {
Leaf.Masker.unmask($('${/parameter/@winid}').wrap);
}
function con_print_detail_create() {
Leaf.Masker.mask($('${/parameter/@winid}').wrap, '${l:HLS.EXECUTING}');
Leaf.request({
url: $('con_contract_create_content_link_id').getUrl(),
para: {
contract_id: '${/parameter/@contract_id}',
content_type: '${/parameter/@content_type}'
/* templet_usage: 'CON_SALE'*/
},
success: function(res) {
var result_ds = $('hls_crr_print_detail_grid_ds');
result_ds.query(result_ds.currentPage);
unlock_current_window();
},
error: function() {
unlock_current_window();
},
failure: function() {
unlock_current_window();
},
scope: this
});
}
function on_result_load(ds) {
var records = ds.getAll();
for (var i = 0;i < records.length;i++) {
var record = records[i];
}
}
function update_attachment_renderer(value, record, name) {
var content_id = record.get('content_id');
return '<a href="javascript:downloadfile_link(' + content_id +')">下载</a>';
}
function downloadfile_link(content_id) {
var url = $('con543_con_batch_dl_link_id').getUrl() + '?content_id=' + content_id + '&contract_id=' + '${/parameter/@contract_id}' + '&content_type=' + '${/parameter/@content_type}';
window.open(url, '_self');
}
function con_download_zip() {
var url = $('con543_con_batch_dl_link_id').getUrl() + '?contract_id=' + '${/parameter/@contract_id}';
window.open(url, '_self');
}
function hls_crr_delete_print() {
$('hls_crr_print_detail_grid').remove();
}
function detail_upload_window(record_id) {
var url = $('con_contract_uploadfile').getUrl() + '?table_name=CON_CONTRACT_CONTENT_V&header_id=' + record_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'insurance_records_uploadFile_id',
width: 850,
height: 400
});
win.on('close', function() {
$('hls_crr_print_detail_grid_ds').query();
});
}
function attachment_upload(val, rec, name) {
return '<a href=javascript:detail_upload_window(' + rec.get('content_id') + ')>附件上传</a>';
}
window['con500_link_render'] = function(value, record, name) {
if (value != null) {
var link = '${/request/@context_path}/atm_download.lsc?attachment_id=';
var str = value.split(';;');
var url = '';
for (var i = 0;i < str.length;i++) {
var temp = str[i].split('--');
if (!Leaf.isEmpty(temp[0])) {
url = url + '<a href=' + link + temp[1] + ' ref="img">' + temp[0] + '</a>' + ',';
}
}
return url;
}
};
]]></script>
<a:dataSets>
<a:dataSet id="basic_clause_tmplet_usage_ds" lookupCode="CON_TMPLET_USAGE"/>
<a:dataSet id="contract_file_path_ds">
<a:datas dataSource="/model/contract_file_path"/>
</a:dataSet>
<a:dataSet id="hls_crr_print_detail_grid_ds" autoQuery="true" queryUrl="${/request/@context_path}/autocrud/cont.CON732.hls_crr_query_print_detail/query?contract_id=${/parameter/@contract_id}&amp;content_type=${/parameter/@content_type}&amp;ccr_document_type=${/parameter/@ccr_document_type}" selectable="true" submitUrl="${/request/@context_path}/modules/cont/CON505/con_contract_content_save.lsc">
<a:fields>
<a:field name="content_type" defaultValue="${/parameter/@content_type}"/>
<a:field name="bp_name" lovGridHeight="350" lovHeight="500" lovLabelWidth="100" lovService="cont.CON505.con_contract_content_bp_for_lov?contract_id=${/parameter/@contract_id}" lovWidth="550" required="true" title="HLS.BP_TITLE">
<a:mapping>
<a:map from="record_id" to="con_contract_bp_id"/>
<a:map from="bp_name" to="bp_name"/>
<a:map from="bp_category" to="bp_category"/>
<a:map from="bp_category_desc" to="bp_category_desc"/>
<a:map from="bp_class" to="bp_class"/>
<a:map from="bp_class_desc" to="bp_class_desc"/>
</a:mapping>
</a:field>
<a:field name="clause_usage_name" displayField="code_value_name" options="basic_clause_tmplet_usage_ds" required="true" returnField="clause_usage" valueField="code_value"/>
<a:field name="clause_usage"/>
<a:field name="templet_name" lovGridHeight="350" lovHeight="500" lovService="basic.con_clause_templet_for_lov" lovWidth="500" title="CON505.CON_CONTENT_TEMPLET_NAME">
<a:mapping>
<a:map from="templet_id" to="templet_id"/>
<a:map from="description" to="templet_name"/>
</a:mapping>
</a:field>
<a:field name="content_number"/>
<a:field name="available_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
<a:field name="print_date" datatype="java.util.DATE"/>
</a:fields>
<a:events>
<a:event name="load" handler="on_result_load"/>
</a:events>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar style="width:848px">
<!--<a:gridButton click="con_print_detail_create" text="CON505.CON_CONTENT_CREATE"/>-->
<a:gridButton id="hls_crr_print_btn" click="hls_crr_print_detail_print" text="生成文本"/>
<!-- <a:gridButton click="con_download_zip" text="PRJ702.THE_FILE_DOWNLOAD"/> -->
<a:gridButton click="hls_crr_delete_print" text="HLS.REMOVE"/>
</a:screenTopToolbar>
<a:grid id="hls_crr_print_detail_grid" bindTarget="hls_crr_print_detail_grid_ds" height="300" width="930" navBar="true">
<a:columns>
<a:column name="content_number" prompt="CON505.CON_CONTENT_NUMBER" width="160"/>
<!-- <a:column name="clause_usage_name" prompt="HLS.CONTRACT_USAGE"/> -->
<a:column name="ref_n05" align="right" prompt="打印份数" width="70"/>
<a:column name="print_date" prompt="生成日期" renderer="Leaf.formatDate" width="80"/>
<!-- <a:column name="bp_class_desc" prompt="HLS.BP_CLASS"/> -->
<!-- <a:column name="asset_detail" align="center" prompt="CON505.CON_CONTENT_ASSET_DETAIL" renderer="see_asset_detail_renderer"/> -->
<!-- <a:column name="templet_name" editor="print_detail_grid_lov_id" prompt="CON505.CON_CONTENT_TEMPLET_NAME"/> -->
<a:column name="bp_name" prompt="HLS.BP_NAME"/>
<a:column name="bp_category_desc" prompt="HLS.BP_CATEGORY"/>
<a:column name="content_print_flag_name" prompt="CON505.CON_CONTENT_STATUS" width="80"/>
<a:column name="attachment" align="center" prompt="HLS.ATTACHMENT" renderer="update_attachment_renderer" width="50"/>
<!-- <a:column align="center" prompt="附件上传" renderer="attachment_upload" width="80"/>
<a:column name="file_name" align="left" prompt="附件名" renderer="con500_link_render" width="220"/>-->
</a:columns>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>
\ No newline at end of file
......@@ -114,6 +114,14 @@
}
}
function indexchange_data(ds, record) {
if(record.get('exists_flag') == 'Y'){
var field = record.getField('bp_name');
field.setLovService('basic.csh_transaction_bp_temp_for_lov');
field.setLovPara('temp_id', record.get('temp_id'));
}
}
]]></script>
<a:dataSets>
......@@ -153,6 +161,7 @@
</a:fields>
<a:events>
<a:event name="update" handler="update_import_data"/>
<a:event name="indexchange" handler="indexchange_data" />
</a:events>
</a:dataSet>
</a:dataSets>
......
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