Commit 79559852 authored by lijingjing's avatar lijingjing

[feat]合同文本生成

parent bfebc603
create or replace package hl_con_contract_content_pkg is
PROCEDURE contract_content_create(p_contract_id NUMBER,
p_content_id out number,
p_user_id NUMBER,
p_templet_usage VARCHAR2 DEFAULT NULL,
p_content_type VARCHAR2 DEFAULT NULL);
end hl_con_contract_content_pkg;
/
create or replace package body hl_con_contract_content_pkg is
g_check_yes CONSTANT VARCHAR2(1) := 'Y';
g_check_no CONSTANT VARCHAR2(1) := 'N';
PROCEDURE con_contract_check(p_contract_id NUMBER,
p_user_id NUMBER,
p_con_rec OUT con_contract%ROWTYPE) IS
e_con_status_error EXCEPTION;
BEGIN
p_con_rec := con_contract_pkg.get_contract_rec(p_contract_id => p_contract_id,
p_user_id => p_user_id);
/*if p_con_rec.contract_status not in
('NEW', 'SIGN', 'INCEPT', 'PAID', 'APPROVING') then
raise e_con_status_error;
end if;*/
EXCEPTION
WHEN e_con_status_error THEN
sys_raise_app_error_pkg.raise_user_define_error(p_message_code => 'CON_CONTRACT_CONTENT_PKG.CON_STATUS_ERROR',
p_created_by => p_user_id,
p_package_name => 'con_contract_content_pkg',
p_procedure_function_name => 'con_contract_check');
raise_application_error(sys_raise_app_error_pkg.c_error_number,
sys_raise_app_error_pkg.g_err_line_id);
END;
--删除合同伙伴已被删除的打印文本
PROCEDURE delete_when_create_check(p_contract_id NUMBER,
p_user_id NUMBER) IS
v_cdd_list_id number;
BEGIN
DELETE FROM con_contract_content t WHERE t.contract_id = p_contract_id;
END;
FUNCTION contract_tmpt_check(p_contract_id NUMBER,
p_tmpt_id NUMBER,
p_user_id NUMBER,
p_bp_type VARCHAR2,
p_bp_class VARCHAR2,
p_bp_id NUMBER,
p_content_type VARCHAR2 DEFAULT NULL)
RETURN VARCHAR2 IS
v_count NUMBER;
v_exist NUMBER;
v_nationality VARCHAR2(30); --国籍
v_country_code VARCHAR2(30);
v_data_class VARCHAR2(30);
BEGIN
SELECT COUNT(*)
INTO v_count
FROM con_contract_tmpt_clause c
WHERE c.tmpt_id = p_tmpt_id;
IF v_count = 0 THEN
RETURN g_check_yes;
END IF;
/* BEGIN
SELECT nvl(fc.country_code, 'CHN')
INTO v_country_code
FROM hls_bp_master bm, fnd_country fc
WHERE bm.nationality = fc.country_id(+)
AND bm.bp_id = p_bp_id;
EXCEPTION
WHEN OTHERS THEN
v_country_code := 'CHN';
END;
IF v_country_code = 'CHN' THEN
v_nationality := 'inland';
ELSE
v_nationality := 'foreign';
END IF;*/
SELECT cc.data_class
INTO v_data_class
FROM con_contract cc
WHERE cc.contract_id = p_contract_id;
FOR cv IN (SELECT *
FROM con_contract_tmpt_clause c
WHERE c.tmpt_id = p_tmpt_id) LOOP
IF v_data_class = 'NORMAL' THEN
SELECT COUNT(*)
INTO v_exist
FROM con_contract ct,
con_contract_mortgage ccm,
con_contract_bp ccb --add by zhangyu 2015-07-20
WHERE ct.contract_id = p_contract_id
--add by zhangyu 2015-07-20
and ct.contract_id = ccb.contract_id
and ccm.contract_id(+) = ccb.contract_id
and ccm.bp_id_mortgagor(+) = ccb.bp_id
and ccb.bp_type = p_bp_type
and ccb.bp_class = p_bp_class
and ccb.bp_id = p_bp_id
--end
AND ct.data_class = 'NORMAL'
AND ct.business_type = nvl(cv.business_type, ct.business_type) --业务类型
/* AND ct.contract_id = nvl(cv.contract_id, ct.contract_id) --合同
AND ct.lease_organization =
nvl(cv.lease_organization, ct.lease_organization) --事业部
AND ct.lease_channel = nvl(cv.lease_channel, ct.lease_channel) --商业模式
AND ct.document_type = nvl(cv.document_type, ct.document_type) --单据类型
AND nvl(ct.price_list, '##') =
nvl(cv.price_list, nvl(ct.price_list, '##')) --报价方案
AND ct.division = nvl(cv.division, ct.division) --产品线
AND p_bp_type = nvl(cv.bp_category, p_bp_type)
AND p_bp_class = nvl(cv.bp_class, p_bp_class)
AND v_nationality = nvl(cv.other_tmpt_clause, v_nationality)
AND nvl(p_content_type, 'N') =
nvl(cv.content_type, nvl(p_content_type, 'N'))
AND nvl(cv.data_class, 'NORMAL') = ct.data_class
--add by zhangyu 2015-07-20
and nvl(ccm.mortgage_asset_detail, 'N') =
nvl(cv.mortgage_asset_detail,
nvl(ccm.mortgage_asset_detail, 'N'))
and decode(ct.down_payment, '0', 'N', null, 'N', 'Y') =
nvl(cv.down_payment_flag,
decode(ct.down_payment, '0', 'N', null, 'N', 'Y')) -- end */
/*AND ct.OTHER_TMPT_CLAUSE =
nvl(cv.other_tmpt_clause, ct.OTHER_TMPT_CLAUSE)*/
;
ELSE
SELECT COUNT(*)
INTO v_exist
FROM con_contract ct, con_contract_change_req cr
WHERE ct.contract_id = p_contract_id
--AND ct.data_class = 'NORMAL'
AND ct.business_type = nvl(cv.business_type, ct.business_type) --业务类型
AND ct.contract_id = nvl(cv.contract_id, ct.contract_id) --合同
AND ct.lease_organization =
nvl(cv.lease_organization, ct.lease_organization) --事业部
AND ct.lease_channel = nvl(cv.lease_channel, ct.lease_channel) --商业模式
AND ct.document_type = nvl(cv.document_type, ct.document_type) --单据类型
AND ct.price_list = nvl(cv.price_list, ct.price_list) --报价方案
AND ct.division = nvl(cv.division, ct.division) --产品线
AND p_bp_type = nvl(cv.bp_category, p_bp_type)
AND p_bp_class = nvl(cv.bp_class, p_bp_class)
AND v_nationality = nvl(cv.other_tmpt_clause, v_nationality)
AND nvl(p_content_type, 'N') =
nvl(cv.content_type, nvl(p_content_type, 'N'))
AND nvl(cv.data_class, 'NORMAL') = ct.data_class
AND cr.change_req_id = ct.contract_id
AND (cr.reschedule_flag = nvl(cv.reschedule_flag, 'A') OR
cr.et_flag = nvl(cv.et_flag, 'A') OR
cr.tenant_change_flag = nvl(cv.tenant_change_flag, 'A') OR
cr.bank_acc_change_flag = nvl(cv.bank_acc_change_flag, 'A') OR
cr.lease_item_change_flag =
nvl(cv.lease_item_change_flag, 'A') OR
cr.mortgage_change_flag = nvl(cv.mortgage_change_flag, 'A') OR
cr.guarantor_change_flag =
nvl(cv.guarantor_change_flag, 'A') OR
cr.contract_cancel_flag = nvl(cv.contract_cancel_flag, 'A') OR
cr.cashflow_change_flag = nvl(cv.cashflow_change_flag, 'A'))
/*AND ct.OTHER_TMPT_CLAUSE =
nvl(cv.other_tmpt_clause, ct.OTHER_TMPT_CLAUSE)*/
;
END IF;
IF v_exist = 0 THEN
NULL;
--RETURN g_check_no;
ELSE
RETURN g_check_yes;
END IF;
END LOOP;
RETURN g_check_no;
END contract_tmpt_check;
PROCEDURE insert_contract_content(p_content_id OUT con_contract_content.content_id%TYPE,
p_contract_id con_contract_content.contract_id%TYPE,
p_content_number con_contract_content.content_number%TYPE,
p_clause_usage con_contract_content.clause_usage%TYPE,
p_templet_id con_contract_content.templet_id%TYPE,
p_con_contract_bp_id con_contract_content.con_contract_bp_id%TYPE,
p_mortgage_id con_contract_content.mortgage_id%TYPE,
p_content_print_flag con_contract_content.content_print_flag%TYPE,
p_available_flag con_contract_content.available_flag%TYPE,
p_user_id con_contract_content.created_by%TYPE,
p_bp_id number default null) IS
BEGIN
SELECT con_contract_content_s.nextval INTO p_content_id FROM dual;
-- p_content_id := con_contract_content_s.nextval;
INSERT INTO con_contract_content
(content_id,
contract_id,
content_number,
clause_usage,
templet_id,
con_contract_bp_id,
mortgage_id,
content_print_flag,
available_flag,
creation_date,
created_by,
last_update_date,
last_updated_by)
VALUES
(p_content_id,
p_contract_id,
p_content_number,
p_clause_usage,
p_templet_id,
p_con_contract_bp_id,
p_mortgage_id,
p_content_print_flag,
p_available_flag,
SYSDATE,
p_user_id,
SYSDATE,
p_user_id);
END;
PROCEDURE contract_content_create(p_contract_id NUMBER,
p_content_id out number,
p_user_id NUMBER,
p_templet_usage VARCHAR2 DEFAULT NULL,
p_content_type VARCHAR2 DEFAULT NULL) IS
v_content_id NUMBER;
v_record_id NUMBER;
v_clause_usage con_contract_content.clause_usage%TYPE;
v_business_type con_contract.business_type%TYPE;
r_prj_rec prj_project%ROWTYPE;
r_con_rec con_contract%ROWTYPE;
e_clause_usage_null_error EXCEPTION;
v_contract_bp_id NUMBER;
v_tmpt_count NUMBER;
v_contract_number VARCHAR2(64);
v_lease_channel VARCHAR2(24);
v_cdd_list_id NUMBER;
v_exists NUMBER;
v_count_normal NUMBER;
v_source_con_id NUMBER;
v_need_rec_0 NUMBER;
r_con_clause_templet con_clause_templet%ROWTYPE;
BEGIN
con_contract_check(p_contract_id => p_contract_id,
p_user_id => p_user_id,
p_con_rec => r_con_rec);
/* r_prj_rec := prj_project_pkg.project_get_record(p_project_id => r_con_rec.project_id,
p_user_id => p_user_id);*/
----删除合同伙伴已被删除的打印文本
delete_when_create_check(p_contract_id => r_con_rec.contract_id,
p_user_id => p_user_id);
FOR cv IN (SELECT *
FROM con_clause_templet t
WHERE t.enabled_flag = 'Y'
and t.templet_usage =
nvl(p_templet_usage, t.templet_usage)--FOR TEST 20170628 BOBO
) LOOP
FOR c_cps IN (SELECT cb.record_id,
ct.contract_number,
cb.bp_id,
cb.bp_category, --modify by zhangyu 2015-08-20
cb.bp_type,
cb.bp_class
FROM con_contract ct, con_contract_bp cb --,
--hls_bp_master bm
WHERE ct.contract_id = p_contract_id
AND cb.contract_id = ct.contract_id
and cb.bp_category = 'TENANT'
--AND cb.bp_id = bm.bp_id(+)
) LOOP
IF contract_tmpt_check(p_contract_id,
cv.templet_id,
p_user_id,
c_cps.bp_category,
c_cps.bp_class,
c_cps.bp_id,
p_content_type) = g_check_yes THEN
SELECT COUNT(*)
INTO v_tmpt_count
FROM con_contract_content cc
WHERE cc.contract_id = p_contract_id
AND cc.templet_id = cv.templet_id
AND cc.con_contract_bp_id = c_cps.record_id;
IF v_tmpt_count = 0 THEN
insert_contract_content(p_content_id => v_content_id,
p_contract_id => p_contract_id,
p_content_number => cv.description,
p_clause_usage => cv.templet_usage,
p_templet_id => cv.templet_id,
p_con_contract_bp_id => c_cps.record_id,
p_mortgage_id => '',
p_content_print_flag => 'N',
p_available_flag => 'Y',
p_user_id => p_user_id
);
UPDATE con_contract_content ct
SET ct.ref_n05 = cv.print_num
-- ct.content_type = p_content_type,
-- ct.data_class = r_con_rec.data_class
WHERE ct.content_id = v_content_id;
END IF;
END IF;
END LOOP;
END LOOP;
hls_document_save_pkg.save_cdd_item_from_doc(p_document_category => 'CON_CONTRACT',
p_document_id => p_contract_id,
p_user_id => p_user_id,
p_cdd_list_id => r_con_rec.cdd_list_id);
EXCEPTION
WHEN e_clause_usage_null_error THEN
sys_raise_app_error_pkg.raise_user_define_error(p_message_code => 'CON_CONTRACT_CONTENT_PKG.CLAUSE_USAGE_NULL_ERROR',
p_created_by => p_user_id,
p_package_name => 'con_contract_content_pkg',
p_procedure_function_name => 'contract_content_create');
raise_application_error(sys_raise_app_error_pkg.c_error_number,
sys_raise_app_error_pkg.g_err_line_id);
END;
end hl_con_contract_content_pkg;
/
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<bm:field name="status" databaseType="VARCHAR2" datatype="java.lang.String" /> <bm:field name="status" databaseType="VARCHAR2" datatype="java.lang.String" />
<bm:field name="status_desc" 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="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" databaseType="VARCHAR2" datatype="java.lang.String" />
<bm:field name="agent_content_flag_name" 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" databaseType="VARCHAR2" datatype="java.lang.String" />
...@@ -180,7 +180,8 @@ ...@@ -180,7 +180,8 @@
t1.agent_content_flag, t1.agent_content_flag,
t1.download_content_flag, t1.download_content_flag,
t1.agent_content_flag_name, t1.agent_content_flag_name,
t1.download_content_flag_name t1.download_content_flag_name,
t1.print_date
FROM FROM
CON_CONTRACT_CONTENT_V t1 CON_CONTRACT_CONTENT_V t1
WHERE WHERE
...@@ -296,7 +297,8 @@ ...@@ -296,7 +297,8 @@
t1.agent_content_flag, t1.agent_content_flag,
t1.download_content_flag, t1.download_content_flag,
t1.agent_content_flag_name, t1.agent_content_flag_name,
t1.download_content_flag_name t1.download_content_flag_name,
t1.print_date
FROM FROM
CON_CONTRACT_CONTENT_V t1 CON_CONTRACT_CONTENT_V t1
WHERE WHERE
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
m.table_name = 'HLS_DOC_FILE_TEMPLET' AND m.table_name = 'HLS_DOC_FILE_TEMPLET' AND
m.table_pk_value = lt.templet_id AND m.table_pk_value = lt.templet_id AND
lt.templet_id = t.doc_template_id AND lt.templet_id = t.doc_template_id AND
t.doc_plugin_flag = 'Y' AND t.doc_plugin_flag = 'Y' AND
t.templet_id = cc.templet_id AND t.templet_id = cc.templet_id AND
( (
cc.content_id =${/parameter/@content_id} OR cc.content_id =${/parameter/@content_id} OR
......
...@@ -10,9 +10,12 @@ ...@@ -10,9 +10,12 @@
<bm:operation name="update"> <bm:operation name="update">
<bm:update-sql><![CDATA[ <bm:update-sql><![CDATA[
begin begin
con_contract_content_pkg.contract_content_create( hl_con_contract_content_pkg.contract_content_create(
p_contract_id =>${@contract_id}, p_contract_id =>${@contract_id},
p_user_id =>${/session/@user_id} p_content_id =>${@content_id},
p_user_id =>${/session/@user_id},
p_templet_usage =>${@templet_usage},
p_content_type =>${@content_type}
); );
end; end;
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: gaoyang
$Date: 2013-7-15 下午05:16:39
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:c="leaf.application.action" xmlns:s="leaf.plugin.script" xmlns:w="leaf.plugin.export.word" xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" customizationEnabled="true" 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_basic_clause_print" rootPath="con_basic_clause_path"/>
<a:model-query fetchAll="true" model="cont.CON500.con_contract_update_print" rootPath="contract_path"/>
<a:model-query defaultWhereClause="cf_direction = &apos;OUTFLOW&apos; and cf_item =0 and cf_type=0" fetchAll="true" model="cont.CON500.con_contract_cashflow_for_print" queryOrderBy="times" rootPath="contract_cashflow_path"/>
<a:model-query fetchAll="true" model="cont.CON500.con_contract_payment_terms_for_print" rootPath="contract_payment_terms_path"/>
<a:model-query fetchAll="true" model="cont.CON500.con_contract_lease_item_lv" rootPath="contract_lease_item_path"/>
<a:model-query defaultWhereClause="lease_item_id = ${/model/contract_lease_item_path/record/@lease_item_id}" fetchAll="true" model="cont.CON500.hls_lease_item_list_for_print" rootPath="contract_lease_item_list_path"/>
<a:model-query fetchAll="true" model="cont.CON500.con_contract_content_number" rootPath="contract_content_path"/>
<a:model-query fetchAll="true" model="cont.CON500.hls_fin_calculator_hd_for_print" rootPath="hls_fin_calculator_path"/>
<a:model-query fetchAll="true" model="hls.HLS211.hls_bp_master_bank_account" rootPath="con_contract_bp_path"/>
<a:model-query defaultWhereClause="calc_session_id = ${/model/hls_fin_calculator_path/record/@calc_session_id} and lease_mgt_fee is not null" fetchAll="true" model="cont.CON500.hls_fin_calculator_ln_for_print" rootPath="hls_fin_calculator_ln_path"/>
<a:model-query defaultWhereClause="calc_session_id = ${/model/hls_fin_calculator_path/record/@calc_session_id} and ln_user_col_n03 is not null" fetchAll="true" model="cont.CON500.hls_fin_calculator_ln_for_print" queryOrderBy="times" rootPath="hls_fin_calculator_ln_col_n03_path"/>
<a:model-query defaultWhereClause="calc_session_id = ${/model/hls_fin_calculator_path/record/@calc_session_id} and t1.times &gt;=1" fetchAll="true" model="cont.CON500.hls_fin_calculator_ln_for_print" rootPath="hls_fin_calculator_ln_tental_path"/>
<a:model-query fetchAll="true" model="cont.CON500.hls_bp_master_all_data_v_for_print" rootPath="hls_bp_master_path"/>
<a:model-query defaultWhereClause="bp_id = ${@bp_id}" fetchAll="true" model="cont.CON500.hls_bp_master_address_for_print" queryOrderBy="DECODE(address_type,&apos;DEFAULT_ADDRESS&apos;,0,length(address_type)) desc" rootPath="hls_bp_master_address_path"/>
<a:model-query defaultWhereClause="bp_id =${/model/contract_path/record/@bp_id_tenant}" fetchAll="true" model="cont.CON500.hls_bp_master_address_for_print" queryOrderBy="address_type desc" rootPath="hls_t_bp_master_address_path"/>
<a:model-query defaultWhereClause="bp_id =${/model/contract_lease_item_path/record/@vender_id}" fetchAll="true" model="cont.CON500.hls_bp_master_address_for_print" queryOrderBy="address_type desc" rootPath="hls_v_bp_master_address_path"/>
<a:model-query defaultWhereClause="bp_id = ${@bp_id} " fetchAll="true" model="cont.CON500.hls_bp_master_contact_info_for_print" rootPath="bp_master_contact_info_path"/>
<a:model-query defaultWhereClause="bp_id =${/model/contract_path/record/@bp_id_tenant}" fetchAll="true" model="cont.CON500.hls_bp_master_contact_info_for_print" rootPath="t_bp_master_contact_info_path"/>
<a:model-query defaultWhereClause="bp_id =${/model/contract_lease_item_path/record/@vender_id}" fetchAll="true" model="cont.CON500.hls_bp_master_contact_info_for_print" rootPath="v_bp_master_contact_info_path"/>
<a:model-query defaultWhereClause="bp_id = ${@bp_id} and ref_v01=&apos;Y&apos;" fetchAll="true" model="cont.CON500.hls_bp_master_contact_info_for_print" rootPath="bp_master_contact_info_ref_v01_path"/>
<a:model-query fetchAll="true" model="cont.CON500.prj_project_act_ctrler_in_i" rootPath="prj_project_act_ctrler_in_i_path"/>
<a:model-query fetchAll="true" model="cont.CON500.prj_project_act_ctrler_in_g" rootPath="prj_project_act_ctrler_in_g_path"/>
<a:model-query fetchAll="true" model="cont.CON500.prj_project_act_ctrler_in_h" rootPath="prj_project_act_ctrler_in_h_path"/>
<a:model-query model="cont.CON500.con_contract_rent_payment_hd_print" rootPath="contract_hd_rp"/>
<a:model-query model="cont.CON500.con_contract_rent_payment_ln_print" rootPath="contract_cashflow_rp"/>
<a:model-query fetchAll="true" model="cont.CON500.con_contract_lease_item_list_print" rootPath="con_lease_list_rp"/>
<a:model-query defaultWhereClause="t1.contract_id=${/parameter/@contract_id}" fetchAll="true" model="cont.CON500.con_contract_print" rootPath="con_contract_rp"/>
<a:model-query fetchAll="true" model="hls.HLS211.hls_bp_master" rootPath="bp_master_detail"/>
<a:model-query model="cont.CON500.con_content_header" rootPath="content_header"/>
<a:model-query defaultWhereClause="t1.mortgage_id=${/parameter/@mortgage_id} and t1.contract_id=${/parameter/@contract_id}" fetchAll="true" model="cont.CON500.prj_project_mortgage_print" rootPath="mortgage_detail"/>
<!-- <w:word-export name="${/model/guid_file_name_path/record/@guid_file_name}.doc" savePath="${/parameter/@file_path}" template="leaf.plugin.export.word/${/parameter/@templt_name}" type="word"> -->
<w:word-export name="${/model/guid_file_name_path/record/@guid_file_name}.doc" savePath="${/parameter/@file_path}" template="leaf.plugin.export.word/${/parameter/@templt_name}" type="word">
<w:replaces>
<w:replace name="content_number" path="/model/content_header/record/@content_number"/>
<w:replace name="version_date" path="/model/content_header/record/@version_date"/>
<w:replace name="couple_guarantee_flag" path="/parameter/@couple_guarantee_flag"/>
<w:replace name="fin_content_number" path="/model/contract_path/record/@fin_content_number"/>
<w:replace name="purchase_order_no" path="/model/contract_path/record/@purchase_order_no"/>
<w:replace name="pur_ord_no" path="/model/contract_path/record/@pur_ord_no"/>
<w:replace name="bp_name" path="/model/contract_path/record/@bp_name"/>
<w:replace name="bp_name_sp" path="/model/contract_path/record/@bp_name_sp"/>
<w:replace name="mobil_phone" path="/model/contract_path/record/@mobil_phone"/>
<w:replace name="default_address" path="/model/contract_path/record/@default_address"/>
<w:replace name="main_agency_address" path="/model/contract_path/record/@main_agency_address"/>
<w:replace name="full_name" path="/model/contract_path/record/@full_name"/>
<w:replace name="lease_item_amount" path="/model/contract_path/record/@lease_item_amount"/>
<w:replace name="lease_item_amount_rmb" path="/model/contract_path/record/@lease_item_amount_rmb"/>
<w:replace name="pay_times" path="/model/contract_path/record/@pay_times"/>
<w:replace name="lease_term" path="/model/hls_fin_calculator_path/record/@lease_term"/>
<w:replace name="lease_times" path="/model/hls_fin_calculator_path/record/@lease_times"/>
<w:replace name="annual_pay_times_n" path="/model/hls_fin_calculator_path/record/@annual_pay_times_n"/>
<w:replace name="finance_amount" path="/model/hls_fin_calculator_path/record/@finance_amount"/>
<w:replace name="finance_amount_rmb" path="/model/hls_fin_calculator_path/record/@finance_amount_rmb"/>
<w:replace name="deposit_ratio_n" path="/model/hls_fin_calculator_path/record/@deposit_ratio_n"/>
<w:replace name="deposit" path="/model/hls_fin_calculator_path/record/@deposit"/>
<w:replace name="deposit_rmb" path="/model/hls_fin_calculator_path/record/@deposit_rmb"/>
<w:replace name="currency_n" path="/model/hls_fin_calculator_path/record/@currency_n"/>
<w:replace name="currency_symbol" path="/model/hls_fin_calculator_path/record/@currency_symbol"/>
<w:replace name="deposit_deduction_n" path="/model/hls_fin_calculator_path/record/@deposit_deduction_n"/>
<w:replace name="pay_type_n" path="/model/hls_fin_calculator_path/record/@pay_type_n"/>
<w:replace name="lease_charge" path="/model/hls_fin_calculator_path/record/@lease_charge"/>
<w:replace name="lease_mgt_fee" path="/model/hls_fin_calculator_path/record/@lease_mgt_fee"/>
<w:replace name="total_rental" path="/model/hls_fin_calculator_path/record/@total_rental"/>
<w:replace name="notarial_fee" path="/model/hls_fin_calculator_path/record/@notarial_fee"/>
<w:replace name="residual_value" path="/model/hls_fin_calculator_path/record/@residual_value"/>
<w:replace name="lease_start_date" path="/model/hls_fin_calculator_path/record/@lease_start_date"/>
<w:replace name="lease_mgt_fee_times" path="/model/hls_fin_calculator_path/record/@lease_mgt_fee_times"/>
<w:replace name="lease_mgt_fee_first_time" path="/model/hls_fin_calculator_path/record/@lease_mgt_fee_first_time"/>
<w:replace name="lease_mgt_fee_first_time_rate" path="/model/hls_fin_calculator_path/record/@lease_mgt_fee_first_time_rate"/>
<w:replace name="invoice_title" path="/model/hls_bp_master_path/record/@invoice_title"/>
<w:replace name="tax_registry_num" path="/model/hls_bp_master_path/record/@tax_registry_num"/>
<w:replace name="invoice_bp_address_phone_num" path="/model/hls_bp_master_path/record/@invoice_bp_address_phone_num"/>
<w:replace name="invoice_bp_bank_account" path="/model/hls_bp_master_path/record/@invoice_bp_bank_account"/>
<w:replace name="lease_item_id_n" path="/model/contract_lease_item_path/record/@lease_item_id_n"/>
</w:replaces>
<w:sectLists>
<w:sectList id="con_basic_clause" model="/model/con_basic_clause_path"/>
</w:sectLists>
</w:word-export>
<s:server-script import="contract_print_path.js"><![CDATA[
println($ctx.parameter.file_name);
print_insert_fnd_atm('doc');
]]></s:server-script>
</a:init-procedure>
<a:view>
<script><![CDATA[
window.close();
]]></script>
</a:view>
</a:screen>
<?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/CON500/con_doc_batch_create.lsc"/>
<script><![CDATA[
function con_print_detail_print(){
lock_current_window();
var result_ds = $('con_contract_update_print_detail_line_ds');
var records = result_ds.getAll();
var total_count = 0;
if ($('con_contract_update_print_detail_line_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}',
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() {
lock_current_window();
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 = $('con_contract_update_print_detail_line_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 con500_delete_print() {
$('con_contract_update_print_detail_grid_1').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() {
$('con_contract_update_print_detail_line_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="con_contract_update_print_detail_header_ds" autoQuery="true" model="cont.CON500.con_contract" queryUrl="${/request/@context_path}/autocrud/cont.CON500.con_contract/query?contract_id=${/parameter/@contract_id}">
<a:fields>
<a:field name="contract_number" readOnly="true"/>
<a:field name="contract_name" readOnly="true"/>
<a:field name="bp_name" readOnly="true"/>
</a:fields>
</a:dataSet>
<a:dataSet id="con_contract_update_print_detail_line_ds" autoQuery="true" queryUrl="${/request/@context_path}/autocrud/cont.CON500.con_contract_content_v/query?contract_id=${/parameter/@contract_id}&amp;content_type=${/parameter/@content_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="con500_print_btn" click="con_print_detail_print" text="生成文本"/>
<!-- <a:gridButton click="con_download_zip" text="PRJ702.THE_FILE_DOWNLOAD"/> -->
<a:gridButton click="con500_delete_print" text="HLS.REMOVE"/>
</a:screenTopToolbar>
<a:form column="2" title="CON505.CON_CONTENT_PRINT" width="900">
<a:textField name="contract_number" bindTarget="con_contract_update_print_detail_header_ds" prompt="HLS.CONTRACT_NUMBER"/>
<a:textField name="contract_name" bindTarget="con_contract_update_print_detail_header_ds" prompt="HLS.CONTRACT_NAME" width="330"/>
</a:form>
<a:grid id="con_contract_update_print_detail_grid_1" bindTarget="con_contract_update_print_detail_line_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
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<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"/>
<a:link id="car_modify_special_link" url="${/request/@context_path}/modules/prj/PRJ500N/prj_project_create_special.lview"/> <a:link id="car_modify_special_link" url="${/request/@context_path}/modules/prj/PRJ500N/prj_project_create_special.lview"/>
<a:link id="con_contract_update_print_detail_link_id" url="${/request/@context_path}/modules/cont/CON311/con_contract_update_print_word_detail.lview"/>
<script type="text/javascript"><![CDATA[ <script type="text/javascript"><![CDATA[
function open_contract_win(ds_id, record_id) { function open_contract_win(ds_id, record_id) {
var record = $(ds_id).findById(record_id); var record = $(ds_id).findById(record_id);
...@@ -104,7 +105,7 @@ ...@@ -104,7 +105,7 @@
}); });
}; };
//合同文本打印 //合同文本打印
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'); var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
var records = $(ds_id).getSelected(); var records = $(ds_id).getSelected();
for (var i = 0;i < records.length;i++) { for (var i = 0;i < records.length;i++) {
...@@ -124,7 +125,31 @@ ...@@ -124,7 +125,31 @@
param['url_title'] = '${l:CON301.CONTRACT_DETAIL}'; param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_link', ds_id); hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_link', ds_id);
} }
}; };*/
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
var records = $(ds_id).getSelected();
if (records.length != 1) {
Leaf.showMessage('${l:PROMPT}','${l:HLS.SELECT_RECORD}');
return;
}
var record=records[0];
new Leaf.Window({
id: 'con_contract_update_print_detail_winid',
params: {
contract_id: record.get('contract_id'),
document_category:record.get('document_category'),
business_type :record.get('business_type'),
winid: 'con_contract_update_print_detail_winid',
content_type : 'NORMAL'
},
url: $('con_contract_update_print_detail_link_id').getUrl(),
title: '${l:CON505.CON_CONTENT_PRINT}',
width:1000,
height:450
});
}
]]></script> ]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=CONTRACT&amp;function_code=CON501"/> <a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=CONTRACT&amp;function_code=CON501"/>
<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"/>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
for (var i = 0;i < from_file_data.length;i++) { for (var i = 0;i < from_file_data.length;i++) {
var to_file_path = $ctx.parameter.file_path; var to_file_path = $ctx.parameter.file_path;
var record_data = from_file_data[i]; var record_data = from_file_data[i];
if (record_data.file_exists_flag != 'Y') { if (record_data.file_exists_flag != 'Y') {
var to_file_name = record_data.to_file_name + '.' + record_data.file_type_code || 'doc'; var to_file_name = record_data.to_file_name + '.' + record_data.file_type_code || 'doc';
var from_file_path = record_data.file_path; var from_file_path = record_data.file_path;
......
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