Commit ffc37692 authored by congzhao's avatar congzhao

电子合同开发 11.18

parent 3f2098df
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<bm:field name="language" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LANGUAGE" prompt="CON_CLAUSE_TEMPLET.LANGUAGE"/> <bm:field name="language" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LANGUAGE" prompt="CON_CLAUSE_TEMPLET.LANGUAGE"/>
<bm:field name="language_name" expression="(select s.code_value_name from sys_code_values_v s where s.code = &apos;CON_LANGUAGE&apos; and s.code_value=t1.language)" forInsert="false" forUpdate="false" prompt="CON_CLAUSE_TEMPLET.TEMPLET_USAGE"/> <bm:field name="language_name" expression="(select s.code_value_name from sys_code_values_v s where s.code = &apos;CON_LANGUAGE&apos; and s.code_value=t1.language)" forInsert="false" forUpdate="false" prompt="CON_CLAUSE_TEMPLET.TEMPLET_USAGE"/>
<bm:field name="enabled_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENABLED_FLAG" prompt="CON_CLAUSE_TEMPLET.ENABLED_FLAG"/> <bm:field name="enabled_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENABLED_FLAG" prompt="CON_CLAUSE_TEMPLET.ENABLED_FLAG"/>
<bm:field name="ele_content_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ELE_CONTENT_FLAG" prompt="CON_CLAUSE_TEMPLET.ELE_CONTENT_FLAG"/>
<bm:field name="print_num"/> <bm:field name="print_num"/>
<bm:field name="version_date"/> <bm:field name="version_date"/>
<bm:field name="tax_type_rate" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TAX_TYPE_RATE"/> <bm:field name="tax_type_rate" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TAX_TYPE_RATE"/>
...@@ -40,6 +41,7 @@ ...@@ -40,6 +41,7 @@
<bm:query-field field="templet_usage" queryOperator="like"/> <bm:query-field field="templet_usage" queryOperator="like"/>
<bm:query-field field="approval_status" queryOperator="like"/> <bm:query-field field="approval_status" queryOperator="like"/>
<bm:query-field name="enabled_flag" queryExpression="(t1.enabled_flag = ${@enabled_flag} or ${@enabled_flag}=&apos;ALL&apos;)"/> <bm:query-field name="enabled_flag" queryExpression="(t1.enabled_flag = ${@enabled_flag} or ${@enabled_flag}=&apos;ALL&apos;)"/>
<bm:query-field name="ele_content_flag" queryExpression="(t1.ele_content_flag = ${@ele_content_flag} or ${@ele_content_flag}=&apos;ALL&apos;)"/>
</bm:query-fields> </bm:query-fields>
<e:exception-descriptor-config> <e:exception-descriptor-config>
<e:exception-descriptor exception="java.sql.SQLException" handleClass="leaf.database.SQLExceptionDescriptor"> <e:exception-descriptor exception="java.sql.SQLException" handleClass="leaf.database.SQLExceptionDescriptor">
......
...@@ -62,6 +62,7 @@ ...@@ -62,6 +62,7 @@
<bm:field name="first_contract_flag"/> <bm:field name="first_contract_flag"/>
<bm:field name="finance_type"/> <bm:field name="finance_type"/>
<bm:field name="secondary_lease"/> <bm:field name="secondary_lease"/>
<bm:field name="marital_status_flag"/>
<bm:field name="vender_id"/> <bm:field name="vender_id"/>
<bm:field name="vender_id_n" expression="(decode(vender_id,-100,'买断机',(select scv.bp_name from hls_bp_master scv where scv.enabled_flag=&apos;Y&apos; and scv.bp_id = t1.vender_id)))" forInsert="false" forUpdate="false"/> <bm:field name="vender_id_n" expression="(decode(vender_id,-100,'买断机',(select scv.bp_name from hls_bp_master scv where scv.enabled_flag=&apos;Y&apos; and scv.bp_id = t1.vender_id)))" forInsert="false" forUpdate="false"/>
......
...@@ -181,14 +181,15 @@ ...@@ -181,14 +181,15 @@
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 t1.print_date,
t1.order_seq
FROM FROM
CON_CONTRACT_CONTENT_V t1 CON_CONTRACT_CONTENT_V t1
WHERE WHERE
t1.templet_usage in ('CON_SALE', 'CONTRACT') t1.templet_usage in ('CON_SALE', 'CONTRACT')
)t )t
#WHERE_CLAUSE# #WHERE_CLAUSE#
ORDER BY decode(t.bp_category,'TENANT',0,'GUARANTOR',1,'VENDER',2,'') ORDER BY t.order_seq,decode(t.bp_category,'TENANT',0,'GUARANTOR',1,'VENDER',2,'')
]]></bm:query-sql> ]]></bm:query-sql>
</bm:operation> </bm:operation>
</bm:operations> </bm:operations>
......
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
${/parameter/@batch_flag}='Y' ${/parameter/@batch_flag}='Y'
) )
) )
order by t.order_seq
]]></bm:query-sql> ]]></bm:query-sql>
</bm:operation> </bm:operation>
</bm:operations> </bm:operations>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zc
$Date: 2020年11月6日 18点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.contract_ele_content_create(
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}
);
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zc
$Date: 2020年11月18日 14点02分
$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
con_contract_workflow_pkg.contract_sign_cancel(
p_contract_id =>${@contract_id},
p_user_id => ${/session/@user_id}
);
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select t.ele_flow_id
FROM con_contract t
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
begin
update con_contract c
set c.ec_sign_type = 'NEW',
c.sign_contract_status = 'NEW',
c.last_update_date = sysdate,
c.last_updated_by = ${/session/@user_id}
where c.contract_id = ${@contract_id};
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="ele_flow_id"/>
</bm:fields>
<bm:query-fields>
<bm:query-field name="contract_id" queryExpression="(t.contract_id = ${@contract_id})"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:o="leaf.database.local.oracle" xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1" baseTable="HLS_DOC_FILE_TEMPLET_SIGNER">
<bm:fields>
<bm:field name="templet_signer_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TEMPLET_SIGNER_ID" prompt="HLS_DOC_FILE_TEMPLET_SIGNER.TEMPLET_SIGNER_ID"/>
<bm:field name="templet_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TEMPLET_ID" prompt="HLS_DOC_FILE_TEMPLET_SIGNER.TEMPLET_ID"/>
<bm:field name="indentity_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INDENTITY_TYPE" prompt="HLS_DOC_FILE_TEMPLET_SIGNER.INDENTITY_TYPE"/>
<bm:field name="key_word" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="KEY_WORD" prompt="HLS_DOC_FILE_TEMPLET_SIGNER.KEY_WORD"/>
<bm:field name="auto_sign" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="AUTO_SIGN" prompt="HLS_DOC_FILE_TEMPLET_SIGNER.AUTO_SIGN"/>
<bm:field name="sign_order" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SIGN_ORDER" prompt="HLS_DOC_FILE_TEMPLET_SIGNER.SIGN_ORDER"/>
<bm:field name="sign_type" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SIGN_TYPE" prompt="HLS_DOC_FILE_TEMPLET_SIGNER.SIGN_TYPE"/>
<bm:field name="signer_category" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SIGNER_CATEGORY" prompt="HLS_DOC_FILE_TEMPLET_SIGNER.SIGNER_CATEGORY"/>
<bm:field name="enable_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENABLE_FLAG" prompt="HLS_DOC_FILE_TEMPLET_SIGNER.ENABLE_FLAG"/>
<!--
<bm:field name="signer_category_desc" expression="(select scv.code_value_name from HLS_DOC_FILE_TEMPLET_PARA tp, sys_code_values_v scv where tp.templet_para_id = t1.templet_para_id and scv.code = &apos;HL_SIGNER_CATEGORY&apos; and scv.code_value = tp.bookmark_type)" forInsert="false" forUpdate="false"/>
-->
</bm:fields>
<bm:features>
<o:sequence-pk/>
<f:standard-who/>
</bm:features>
<bm:primary-key>
<bm:pk-field name="templet_signer_id"/>
</bm:primary-key>
<!-- <bm:query-fields>
<bm:query-field field="templet_id" queryOperator="="/>
</bm:query-fields>-->
<bm:data-filters>
<bm:data-filter name="templet_id" enforceOperations="query" expression="t1.templet_id = ${@templet_id}"/>
</bm:data-filters>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select * from (select t1.contract_id,
t1.contract_number,
t1.contract_status,
t1.bp_id_tenant,
(select hm.bp_name
from hls_bp_master hm
where hm.bp_id = t1.bp_id_tenant) bp_id_tenant_n,
t1.ec_sign_type,
(SELECT v.code_value_name
FROM sys_code_values_v v
WHERE v.code = 'EC_SIGN_TYPE'
AND v.code_value = t1.ec_sign_type) AS ec_sign_type_n,
(select hm.id_card_no
from hls_bp_master hm
where hm.bp_id = t1.bp_id_tenant) id_card_no_tenant,
t1.bp_id_agent_level1,
(select hm.bp_name
from hls_bp_master hm
where hm.bp_id = t1.bp_id_agent_level1) bp_id_agent_level1_n,
(select hm.id_card_no_leg
from hls_bp_master hm
where hm.bp_id = t1.bp_id_agent_level1) id_card_no_agent,
(SELECT v.code_value_name
FROM sys_code_values_v v
WHERE v.code = 'CON500_CONTRACT_STATUS'
AND v.code_value = t1.contract_status) AS contract_status_n,
(select ci.brand_id
from con_contract_lease_item ci
where ci.contract_id = t1.contract_id
and ci.equipment_type = 'MAIN') brand_id,
NVL((SELECT a.description
FROM hls_car_brands_vl a
WHERE a.brand_id =
(select ci.brand_id
from con_contract_lease_item ci
where ci.contract_id = t1.contract_id
and ci.equipment_type = 'MAIN')),'日立') brand_id_n,
(select ci.modelcd
from con_contract_lease_item ci
where ci.contract_id = t1.contract_id
and ci.equipment_type = 'MAIN') modelcd, --机型
(SELECT i.machine_number
FROM con_contract_lease_item i
WHERE i.contract_id = t1.contract_id
AND i.equipment_type = 'MAIN') machine_number, --机号
t1.lease_times, --期数
(NVL(t1.down_payment, 0) + NVL(t1.residual_value, 0) +
NVL(t1.total_rental, 0)) total_sign,
(SELECT cs.sign_url
from con_contract_ele_signer cs
where cs.contract_id = t1.contract_id
and cs.id_no = ${@id_no}
and cs.id_type = ${@id_type}
and rownum = 1) sign_url
from con_contract t1
where t1.data_class = 'NORMAL'
and t1.ec_sign_type in ('INITIATE','SIGNING')
and t1.contract_id in (select distinct cs.contract_id
from con_contract_ele_signer cs
where cs.id_no = ${@id_no} and cs.id_type = ${@id_type})) v #WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="contract_id"/>
<bm:field name="contract_number"/>
<bm:field name="bp_id_tenant_n"/>
<bm:field name="bp_id_agent_level1_n"/>
<bm:field name="contract_status"/>
<bm:field name="contract_status_n"/>
<bm:field name="ec_sign_type"/>
<bm:field name="ec_sign_type_n"/>
<bm:field name="brand_id_n"/>
<bm:field name="modelcd"/>
<bm:field name="machine_number"/>
<bm:field name="lease_times"/>
<bm:field name="total_sign"/>
<bm:field name="sign_url"/>
</bm:fields>
<bm:query-fields>
<bm:query-field name="contract_number" queryExpression="v.contract_number = ${@contract_number}"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
BEGIN
wx_ele_contract_pkg.update_ele_con_info(p_contract_id => ${@contract_id},
p_id_no => ${@id_no},
p_sign_url => ${@sign_url},
p_user_id => nvl(${/session/@user_id},1)
);
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zc
$Date: 2020年11月9日 10点35分
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:fields>
<bm:field name="contract_id"/>
<bm:field name="bp_id"/>
<bm:field name="bp_name"/>
<bm:field name="id_type"/>
<bm:field name="id_no"/>
<bm:field name="mobile"/>
<bm:field name="signer_category"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select distinct t.* from (select
cs.contract_id,
cs.bp_id,
cs.bp_name,
cs.id_type,
cs.id_no,
cs.mobile,
hs.signer_category
from con_contract_ele_signer cs, hls_doc_file_templet_signer hs
where cs.templet_signer_id = hs.templet_signer_id) t
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="contract_id" queryExpression="t.contract_id= ${@contract_id}"/>
<bm:query-field name="signer_category" queryExpression="t.signer_category= ${@signer_category}"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zc
$Date: 2020年11月9日 10点35分
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:fields>
<bm:field name="con_ele_signer_id"/>
<bm:field name="contract_id"/>
<bm:field name="bp_id"/>
<bm:field name="bp_name"/>
<bm:field name="id_type"/>
<bm:field name="id_no"/>
<bm:field name="templet_signer_id"/>
<bm:field name="ec_sign_status"/>
<bm:field name="templet_id"/>
<bm:field name="indentity_type"/>
<bm:field name="key_word"/>
<bm:field name="auto_sign"/>
<bm:field name="sign_order"/>
<bm:field name="sign_type"/>
<bm:field name="signer_category"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select * from (select cs.con_ele_signer_id,
cs.contract_id,
cs.bp_id,
cs.bp_name,
cs.id_type,
cs.id_no,
cs.templet_signer_id,
cs.ec_sign_status,
hs.templet_id,
hs.indentity_type,
hs.key_word,
nvl(hs.auto_sign,'N') auto_sign,
hs.sign_order,
hs.sign_type,
hs.signer_category
from con_contract_ele_signer cs, hls_doc_file_templet_signer hs
where cs.templet_signer_id = hs.templet_signer_id) t
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
wx_ele_contract_pkg.ele_contract_signer_save(
p_contract_id =>${@contract_id},
p_user_id =>nvl(${/session/@user_id},1)
);
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="contract_id" queryExpression="t.contract_id= ${@contract_id}"/>
<bm:query-field name="signer_category" queryExpression="t.signer_category= ${@signer_category}"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
BEGIN
UPDATE CON_CONTRACT c
SET c.ele_flow_id = ${@flow_id},
c.ec_sign_type = 'INITIATE',
c.sign_contract_status = 'SIGNING',
c.last_updated_by = nvl(${/session/@user_id},1),
c.last_update_date = sysdate
WHERE c.contract_id = ${@contract_id};
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:fields>
<bm:field name="contract_id" databaseType="Number" datatype="java.lang.Double"/>
<bm:field name="httpurl" databaseType="CLOB" datatype="java.sql.Clob"/>
<bm:field name="jsonPut" databaseType="CLOB" datatype="java.sql.Clob"/>
<bm:field name="jsonResult" databaseType="CLOB" datatype="java.sql.Clob"/>
<bm:field name="tokenResult" databaseType="CLOB" datatype="java.sql.Clob"/>
</bm:fields>
<bm:operations>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
BEGIN
wx_ele_contract_pkg.hl_con_savelogs(p_contract_id => ${@contract_id},
p_httpurl => ${@httpurl},
p_jsonPut => ${@jsonPut},
p_jsonResult => ${@jsonResult},
p_token => ${@tokenResult}
);
COMMIT;
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zc
$Date: 2020年11月9日
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:fields>
<bm:field name="file_name"/>
<bm:field name="file_path"/>
<bm:field name="file_size"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select fa.file_name,fa.file_path,fa.file_size
from fnd_atm_attachment fa, fnd_atm_attachment_multi fm
where fa.attachment_id = fm.attachment_id
and fm.table_name = 'CON_CONTRACT_CONTENT'
and fm.table_pk_value in
(select t.content_id
from con_contract_content t,con_ele_signer_file cf
where t.contract_id = ${@contract_id}
and t.templet_id = cf.templet_id
and cf.con_ele_signer_id = ${@con_ele_signer_id})
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
BEGIN
UPDATE con_contract_ele_signer cs
SET cs.ec_sign_status = 'Y',
cs.sign_time = to_date(${sign_time},'yyyy-mm-dd HH:mm:ss'),
cs.sign_result = ${sign_result},
cs.last_update_date = sysdate
WHERE cs.contract_id =
(select c.contract_id
from con_contract c
where c.ele_flow_id = ${flow_id}
and c.data_class = 'NORMAL')
AND cs.id_no = ${id_no};
update con_contract cc
set cc.ec_sign_type = 'SIGNING',
cc.last_update_date = sysdate
where cc.ele_flow_id = ${flow_id};
END;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
BEGIN
update con_contract cc
set cc.ec_sign_type = 'SIGNED',
cc.sign_contract_status = 'SIGN',
cc.flow_status = ${flow_status},
cc.end_time = to_date(${end_time},'yyyy-mm-dd HH:mm:ss'),
cc.last_update_date = sysdate
where cc.ele_flow_id = ${flow_id};
insert into con_ele_signed_file_list
(signed_file_list_id,
flow_id,
file_id,
file_name,
file_download_url,
creation_date,
created_by,
last_updated_by,
last_update_date)
values
(CON_ELE_SIGNED_FILE_LIST_S.NEXTVAL,
${@flow_id},
${@file_id},
${@file_name},
${@file_download_url},
sysdate,
nvl(${/session/@user_id},1),
nvl(${/session/@user_id},1),
sysdate
);
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zc
$Date: 2020年11月11日
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:fields>
<bm:field name="file_name"/>
<bm:field name="file_path"/>
<bm:field name="file_size"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select fa.file_name,fa.file_path,fa.file_size
from fnd_atm_attachment fa, fnd_atm_attachment_multi fm
where fa.attachment_id = fm.attachment_id
and fm.table_name = 'CON_CONTRACT_CONTENT'
and fm.table_pk_value in
(select t.content_id
from con_contract_content t,con_ele_signer_file cf
where t.contract_id = ${@contract_id}
and t.templet_id = cf.templet_id)
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:fields>
<bm:field name="file_name"/>
<bm:field name="file_path"/>
<bm:field name="file_size"/>
<bm:field name="order_seq"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select fa.file_name,fa.file_path,fa.file_size,ct.order_seq
from fnd_atm_attachment fa, fnd_atm_attachment_multi fm,con_contract_content cc,con_clause_templet ct
where fa.attachment_id = fm.attachment_id
and fm.table_name = 'CON_CONTRACT_CONTENT'
and cc.content_id = fm.table_pk_value
and cc.templet_id = ct.templet_id
and fm.table_pk_value in
(select t.content_id
from con_contract_content t,con_ele_signer_file cf,con_contract_ele_signer cs
where t.contract_id = ${@contract_id}
and t.templet_id = cf.templet_id
and cs.con_ele_signer_id = cf.con_ele_signer_id
and cs.id_no = ${@id_no}
and cs.id_type = ${@id_type})
order by ct.order_seq
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
rollback;
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zc
$Date: 2020年11月12日 09点13分
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:e="leaf.service.exception" xmlns:o="leaf.database.local.oracle" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" needAccessControl="false">
<bm:fields>
<bm:field name="code_value" databaseType="VARCHAR2" datatype="java.lang.String"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select sys_parameter_pkg.value(p_parameter_code => ${@parameter_code}) code_value from dual
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
BEGIN
HL_SMS_SEND_PKG.wx_verify_code_sms(p_phone_number => ${@phone_number},p_user_id => nvl(${/session/@user_id},1), p_sms_id =>${@sms_id},p_verify_code => ${@verify_code});
COMMIT;
END;
]]></bm:update-sql>
<bm:parameters>
<bm:parameter name="sms_id" dataType="java.lang.Long" input="false" output="true" outputPath="/parameter/@sms_id"/>
<bm:parameter name="verify_code" dataType="java.lang.Long" input="false" output="true" outputPath="/parameter/@verify_code"/>
</bm:parameters>
</bm:operation>
</bm:operations>
</bm:model>
var override_queryfields = [
{
name : 'lease_start_date_from',
queryexpression : "t1.lease_start_date >= ${@lease_start_date_from}"
},
{
name : 'lease_start_date_to',
queryexpression : "t1.lease_start_date <=${@lease_start_date_to}"
},
{
name : 'contract_creation_date_from',
queryexpression : "t1.contract_creation_date >= trunc(to_date(${@contract_creation_date_from},'yyyy-mm-dd') )"
},
{
name : 'contract_creation_date_to',
queryexpression : "trunc(t1.contract_creation_date) <=to_date(${@contract_creation_date_to},'yyyy-mm-dd')"
},
{
name : 'agent_extra_nam',
queryexpression : "t1.agent_extra_nam like '%'||${@agent_extra_nam}||'%'"
},
{
name : 'contract_number',
queryexpression : "t1.contract_number like '%'||${@contract_number}||'%'"
},
{
field : 'contract_status',
queryoperator : "="
},
{
field : 'division',
queryoperator : "="
},
{
field : 'business_type',
queryoperator : "="
}
];
var add_datafilters=[
{
name:'bp_id_agent_level1',
expression : "(${/session/@user_id} = 1 or t1.bp_id_agent_level1 = decode((select su.bp_category from sys_user su where su.user_id =${/session/@user_id}),'AGENT',(select su.bp_id from sys_user su where su.user_id =${/session/@user_id}),'EMPLOYEE',t1.bp_id_agent_level1))"
}
];
override();
add_datafilter();
...@@ -824,7 +824,7 @@ ...@@ -824,7 +824,7 @@
para: { para: {
function_name: '%' + document.getElementById('sp-searchtext').value + '%', function_name: '%' + document.getElementById('sp-searchtext').value + '%',
enabled_flag: 'Y', enabled_flag: 'Y',
role_id: ${/session/@role_id} role_id: '${/session/@role_id}'
}, },
success: function (res) { success: function (res) {
if (res.result.record) { if (res.result.record) {
...@@ -1007,7 +1007,7 @@ ...@@ -1007,7 +1007,7 @@
url: $('BmLink_sys_user_query').getUrl(), url: $('BmLink_sys_user_query').getUrl(),
scope: this, scope: this,
para: { para: {
user_id: ${/session/@user_id} user_id: '${/session/@user_id}'
}, },
success: function (res) { success: function (res) {
if (res.success && res.result.record) { if (res.success && res.result.record) {
...@@ -1067,7 +1067,7 @@ ...@@ -1067,7 +1067,7 @@
closeable: true, closeable: true,
draggable: true, draggable: true,
params: { params: {
user_id:${/session/@user_id}, user_id:'${/session/@user_id}',
win_id: 'img_upload_window' win_id: 'img_upload_window'
}, },
height: 468, height: 468,
...@@ -1120,7 +1120,7 @@ ...@@ -1120,7 +1120,7 @@
url: $('BmLink_sys_user_update').getUrl(), url: $('BmLink_sys_user_update').getUrl(),
scope: this, scope: this,
para: { para: {
user_id: ${/session/@user_id}, user_id: '${/session/@user_id}',
email: $jq('[name="email"]').val(), email: $jq('[name="email"]').val(),
phone: $jq('[name="phone"]').val() phone: $jq('[name="phone"]').val()
}, },
...@@ -1417,7 +1417,7 @@ ...@@ -1417,7 +1417,7 @@
} }
function to_get_code() { function to_get_code() {
var userCodes = $('sys_role_ds').getAll(); var userCodes = $('sys_role_ds').getAll();
var roleId = ${/session/@role_id}; var roleId = '${/session/@role_id}';
var roleCode; var roleCode;
userCodes.forEach(function (value) { userCodes.forEach(function (value) {
value.data.role_id == roleId && (roleCode = value.data.role_code) value.data.role_id == roleId && (roleCode = value.data.role_code)
...@@ -1435,7 +1435,7 @@ ...@@ -1435,7 +1435,7 @@
if (res.success) { if (res.success) {
var userName = ''; var userName = '';
res.result.record.forEach(function (value) { res.result.record.forEach(function (value) {
if (value.user_id == ${/session/@user_id}) { if (value.user_id == '${/session/@user_id}') {
userName = value.user_name; userName = value.user_name;
} }
}); });
...@@ -1449,7 +1449,7 @@ ...@@ -1449,7 +1449,7 @@
var userDs = $('userDs').getAll(); var userDs = $('userDs').getAll();
var userName; var userName;
userDs.forEach(function (value) { userDs.forEach(function (value) {
value.data.userId == ${/session/@user_id} ? userName = value.data.user_name : userName = ''; value.data.userId == '${/session/@user_id}' ? userName = value.data.user_name : userName = '';
}); });
setUserName(); setUserName();
...@@ -2319,7 +2319,7 @@ ...@@ -2319,7 +2319,7 @@
Leaf.request({ Leaf.request({
url: $('').getUrl(), url: $('').getUrl(),
para: { para: {
role_id: ${/session/@role_id} role_id: '${/session/@role_id}'
}, },
scope: this, scope: this,
success: function (res) { success: function (res) {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
<a:dataSet id="hls_bp_class_ds" lookupCode="HLS211_BP_CLASS"/> <a:dataSet id="hls_bp_class_ds" lookupCode="HLS211_BP_CLASS"/>
<a:dataSet id="other_tmpt_clause_ds" lookupCode="CON202_CON_PRINT_OTHER_CONDITON"/> <a:dataSet id="other_tmpt_clause_ds" lookupCode="CON202_CON_PRINT_OTHER_CONDITON"/>
<a:dataSet id="district_ds" lookupCode="PRJ500N_DISTRICT_AREAS"/> <a:dataSet id="district_ds" lookupCode="PRJ500N_DISTRICT_AREAS"/>
<a:dataSet id="marital_status_flag_ds" lookupCode="EXIST_OR_NOT"/>
<a:dataSet id="clause_basinfo" autoCreate="true"> <a:dataSet id="clause_basinfo" autoCreate="true">
<a:fields> <a:fields>
<a:field name="template_code" defaultValue="${/parameter/@tmpt_code}" readOnly="true"/> <a:field name="template_code" defaultValue="${/parameter/@tmpt_code}" readOnly="true"/>
...@@ -34,6 +35,7 @@ ...@@ -34,6 +35,7 @@
<a:field name="withhold_way_n" displayField="code_value_name" options="con202_withway_ds" returnField="withhold_way" valueField="code_value"/> <a:field name="withhold_way_n" displayField="code_value_name" options="con202_withway_ds" returnField="withhold_way" valueField="code_value"/>
<a:field name="pay_method_n" displayField="code_value_name" options="pay_methods_ds" returnField="pay_method" valueField="code_value"/> <a:field name="pay_method_n" displayField="code_value_name" options="pay_methods_ds" returnField="pay_method" valueField="code_value"/>
<a:field name="secondary_lease_n" displayField="code_value_name" options="secondary_lease_ds" returnField="secondary_lease" valueField="code_value"/> <a:field name="secondary_lease_n" displayField="code_value_name" options="secondary_lease_ds" returnField="secondary_lease" valueField="code_value"/>
<a:field name="marital_status_flag_n" displayField="code_value_name" options="marital_status_flag_ds" returnField="marital_status_flag" valueField="code_value"/>
<a:field name="finance_type"/> <a:field name="finance_type"/>
<a:field name="finance_type_n" displayField="code_value_name" options="con202_finance_type" returnField="finance_type" valueField="code_value"/> <a:field name="finance_type_n" displayField="code_value_name" options="con202_finance_type" returnField="finance_type" valueField="code_value"/>
<a:field name="contract_number" lovGridHeight="360" lovHeight="540" lovService="basic.con_contract_for_lov" lovWidth="680"> <a:field name="contract_number" lovGridHeight="360" lovHeight="540" lovService="basic.con_contract_for_lov" lovWidth="680">
...@@ -133,6 +135,8 @@ ...@@ -133,6 +135,8 @@
<!-- <a:column name="car_brand_n" editor="lov" prompt="汽车品牌" width="100"/> --> <!-- <a:column name="car_brand_n" editor="lov" prompt="汽车品牌" width="100"/> -->
<a:column name="price_list_n" editor="lov" prompt="报价方案" width="120"/> <a:column name="price_list_n" editor="lov" prompt="报价方案" width="120"/>
<a:column name="first_contract_flag" editor="check" prompt="首个支付表标志" width="120"/> <a:column name="first_contract_flag" editor="check" prompt="首个支付表标志" width="120"/>
<!--add by 24976-->
<a:column name="marital_status_flag_n" editor="cb" prompt="有无配偶" width="100"/>
<a:column name="other_tmpt_clause_n" editor="cb" prompt="其他" width="100"/> <a:column name="other_tmpt_clause_n" editor="cb" prompt="其他" width="100"/>
</a:columns> </a:columns>
......
...@@ -102,6 +102,7 @@ ...@@ -102,6 +102,7 @@
<a:field name="templet_usage_name" displayField="code_value_name" options="con202_clause_templet_tmplet_usage_ds" returnField="templet_usage" valueField="code_value"/> <a:field name="templet_usage_name" displayField="code_value_name" options="con202_clause_templet_tmplet_usage_ds" returnField="templet_usage" valueField="code_value"/>
<a:field name="approval_status_name" displayField="code_value_name" options="con202_clause_templet_approval_status_ds" returnField="approval_status" valueField="code_value"/> <a:field name="approval_status_name" displayField="code_value_name" options="con202_clause_templet_approval_status_ds" returnField="approval_status" valueField="code_value"/>
<a:field name="enabled_flag_des" displayField="code_value_name" options="con202_clause_templet_enabled_status_ds" returnField="enabled_flag" valueField="code_value"/> <a:field name="enabled_flag_des" displayField="code_value_name" options="con202_clause_templet_enabled_status_ds" returnField="enabled_flag" valueField="code_value"/>
<a:field name="ele_content_flag_des" displayField="code_value_name" options="con202_clause_templet_enabled_status_ds" returnField="ele_content_flag" valueField="code_value"/>
</a:fields> </a:fields>
</a:dataSet> </a:dataSet>
<a:dataSet id="con202_clause_templet_result_ds" autoPageSize="true" autoQuery="true" model="cont.CON202.con_clause_templet" queryDataSet="con202_clause_templet_query_ds" selectable="true"> <a:dataSet id="con202_clause_templet_result_ds" autoPageSize="true" autoQuery="true" model="cont.CON202.con_clause_templet" queryDataSet="con202_clause_templet_query_ds" selectable="true">
...@@ -110,6 +111,7 @@ ...@@ -110,6 +111,7 @@
<a:field name="description" required="true"/> <a:field name="description" required="true"/>
<a:field name="templet_usage" required="true"/> <a:field name="templet_usage" required="true"/>
<a:field name="enabled_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/> <a:field name="enabled_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
<a:field name="ele_content_flag" checkedValue="Y" defaultValue="N" uncheckedValue="N"/>
<a:field name="language" defaultValue="CHINESE"/> <a:field name="language" defaultValue="CHINESE"/>
<a:field name="templet_usage_name" displayField="code_value_name" options="con202_clause_templet_tmplet_usage_ds" required="true" returnField="templet_usage" valueField="code_value"/> <a:field name="templet_usage_name" displayField="code_value_name" options="con202_clause_templet_tmplet_usage_ds" required="true" returnField="templet_usage" valueField="code_value"/>
<a:field name="language_name" displayField="code_value_name" options="con202_clause_templet_con_language_ds" required="true" returnField="language" valueField="code_value"/> <a:field name="language_name" displayField="code_value_name" options="con202_clause_templet_con_language_ds" required="true" returnField="language" valueField="code_value"/>
...@@ -143,6 +145,7 @@ ...@@ -143,6 +145,7 @@
<a:comboBox name="templet_usage_name" bindTarget="con202_clause_templet_query_ds" prompt="CON202.CON_CLAUSE_TEMPLET.TEMPLET_USAGE"/> <a:comboBox name="templet_usage_name" bindTarget="con202_clause_templet_query_ds" prompt="CON202.CON_CLAUSE_TEMPLET.TEMPLET_USAGE"/>
<a:comboBox name="approval_status_name" bindTarget="con202_clause_templet_query_ds" prompt="CON202.CON_CLAUSE_TEMPLET.APPROVAL_STATUS_NAME"/> <a:comboBox name="approval_status_name" bindTarget="con202_clause_templet_query_ds" prompt="CON202.CON_CLAUSE_TEMPLET.APPROVAL_STATUS_NAME"/>
<a:comboBox name="enabled_flag_des" bindTarget="con202_clause_templet_query_ds" prompt="CON202.CON_CLAUSE_TEMPLET.ENABLED_FLAG_DES"/> <a:comboBox name="enabled_flag_des" bindTarget="con202_clause_templet_query_ds" prompt="CON202.CON_CLAUSE_TEMPLET.ENABLED_FLAG_DES"/>
<a:comboBox name="ele_content_flag_des" bindTarget="con202_clause_templet_query_ds" prompt="电子签约合同文本"/>
</a:form> </a:form>
<a:grid id="con202_clause_templet_functionTreeGrid" bindTarget="con202_clause_templet_result_ds" marginHeight="130" marginWidth="50" navBar="true" width="800"> <a:grid id="con202_clause_templet_functionTreeGrid" bindTarget="con202_clause_templet_result_ds" marginHeight="130" marginWidth="50" navBar="true" width="800">
<a:columns> <a:columns>
...@@ -154,6 +157,8 @@ ...@@ -154,6 +157,8 @@
<a:column name="print_num" align="right" editor="con202_clause_templet_grid_nf" prompt="打印份数" width="50"/> <a:column name="print_num" align="right" editor="con202_clause_templet_grid_nf" prompt="打印份数" width="50"/>
<a:column name="con202_edit" prompt="CON202.EDIT" renderer="con202_clause_templet_grid_render" width="60"/> <a:column name="con202_edit" prompt="CON202.EDIT" renderer="con202_clause_templet_grid_render" width="60"/>
<a:column name="enabled_flag" editor="con202_clause_templet_grid_ck" prompt="HLS030.ENABLED_FLAG" width="40"/> <a:column name="enabled_flag" editor="con202_clause_templet_grid_ck" prompt="HLS030.ENABLED_FLAG" width="40"/>
<!--电子签约文本-->
<a:column name="ele_content_flag" editor="con202_clause_templet_grid_ck" prompt="电子签约合同文本" width="120"/>
<a:column name="language_name" editor="con202_clause_templet_grid_cb" prompt="CON202.LANGUAGE" width="60"/> <a:column name="language_name" editor="con202_clause_templet_grid_cb" prompt="CON202.LANGUAGE" width="60"/>
<a:column name="where_caluse" prompt="文本打印条件" renderer="where_caluse_renderer" width="100"/> <a:column name="where_caluse" prompt="文本打印条件" renderer="where_caluse_renderer" width="100"/>
<a:column name="version_date" editor="con202_clause_templet_grid_tf" prompt="版本号" width="100"/> <a:column name="version_date" editor="con202_clause_templet_grid_tf" prompt="版本号" width="100"/>
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<a:link id="con_contract_content_bp_link" model="cont.CON505.con_contract_content_bp_for_lov" modelaction="query"/> <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="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"/> <a:link id="con_doc_batch_create_link_id" url="${/request/@context_path}/modules/cont/CON500/con_doc_batch_create.lsc"/>
<a:link id="con_ele_doc_batch_create_link_id" url="${/request/@context_path}/modules/cont/CON500/con_ele_doc_batch_create.lsc"/>
<script><![CDATA[ <script><![CDATA[
function con_print_detail_print(){ function con_print_detail_print(){
//lock_current_window(); //lock_current_window();
...@@ -61,7 +62,31 @@ ...@@ -61,7 +62,31 @@
scope: this scope: this
}); });
} }
//生成电子签约合同文本 add by 24976
function con_ele_print_detail_print(){
Leaf.Masker.mask($('${/parameter/@winid}').wrap, '正在生成并打印合同文本,请稍等。。。');
var result_ds = $('con_contract_update_print_detail_line_ds');
var file_path = $('contract_file_path_ds').getAt(0).get('contract_file_path');
Leaf.request({
url: $('con_ele_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() { function lock_current_window() {
Leaf.Masker.mask($('${/parameter/@winid}').wrap, '${l:HLS.EXECUTING}'); Leaf.Masker.mask($('${/parameter/@winid}').wrap, '${l:HLS.EXECUTING}');
} }
...@@ -200,6 +225,7 @@ ...@@ -200,6 +225,7 @@
<a:screenTopToolbar style="width:848px"> <a:screenTopToolbar style="width:848px">
<!--<a:gridButton click="con_print_detail_create" text="CON505.CON_CONTENT_CREATE"/>--> <!--<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 id="con500_print_btn" click="con_print_detail_print" text="生成文本"/>
<a:gridButton id="con500_ele_print_btn" click="con_ele_print_detail_print" text="生成电子签约文本"/>
<!-- <a:gridButton click="con_download_zip" text="PRJ702.THE_FILE_DOWNLOAD"/> --> <!-- <a:gridButton click="con_download_zip" text="PRJ702.THE_FILE_DOWNLOAD"/> -->
<a:gridButton click="con500_delete_print" text="HLS.REMOVE"/> <a:gridButton click="con500_delete_print" text="HLS.REMOVE"/>
</a:screenTopToolbar> </a:screenTopToolbar>
......
<?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.CON505.con_ele_contract_create_content').update({
contract_id: $ctx.parameter.contract_id,
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:'Y'
});
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'||record_data.templet_code == 'REPURCHASE_DEBT_OFFSET'||record_data.templet_code == 'CON_CONTRACT_LEASE_BACK'||record_data.templet_code == 'CON_CONTRACT_MORTGAGE' ||record_data.templet_code == 'LEASE_CONTRACT_MASTER_OEC'||record_data.templet_code == 'LEASE_REQUEST_OEC') {
*/
// 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: zlf $Date: 2014-11-10 下午5:42:24 $Revision: 1.0 $Purpose: --><a:screen xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" customizationEnabled="true" dynamiccreateenabled="true" trace="true"> <a:init-procedure> <a:model-query fetchAll="true" model="cont.CON500.con_contract_get_guid_file_name" rootPath="file_name_path"/> <s:server-script import="contract_print_path.js"><![CDATA[ $ctx.parameter.file_path = con_print_path['con_print_path']; $ctx.parameter.tomcat_source = con_print_path['tomcat_source']; ]]> </s:server-script> <s:server-script import="con_print_path.js"><![CDATA[ set_parameter_file_path(); ]]> </s:server-script> </a:init-procedure> <a:view> <a:link id="wfl_readonly_pageLink_projectQueryScreen_update_project" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain_readonly.lview"/> <a:link id="${/parameter/@layout_code}_con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/> <a:link id="${/parameter/@layout_code}_con_contract_content_confirm_link_id" url="${/request/@context_path}/modules/cont/CON501N/con_contract_content_confirm.lview"/> <a:link id="contract_lease_item_query_link" url="${/request/@context_path}/modules/cont/CON505/con_lease_item_query.lview"/> <a:link id="contract_history_window_link" url="${/request/@context_path}/modules/cont/CON501N/con_document_history_query.lview"/> <a:link id="con505_hls_bp_master_query_link" url="${/request/@context_path}/modules/cont/CON505/hls_bp_master_query.lview"/> <a:link id="${/parameter/@layout_code}_prj500_cdd_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/> <a:link id="${/parameter/@layout_code}_prj500_cdd_downloadFile_id" url="${/request/@context_path}/downloadFile.lview"/> <!--打印使用--> <a:link id="${/parameter/@layout_code}_con505_contract_content_id" model="cont.CON505.con505_contract_content" modelaction="update"/> <a:link id="${/parameter/@layout_code}_creat_con_contract_content_link_id" model="cont.CON505.con505_contract_content" modelaction="execute"/> <a:link id="${/parameter/@layout_code}_file_copy_from_template_link_id" url="${/request/@context_path}/modules/cont/CON505/file_copy_from_template.lsc"/> <a:link id="${/parameter/@layout_code}_con_batch_dl_link_id" url="${/request/@context_path}/modules/cont/CON505/con_atm_batch_dl.lsc"/> <a:link id="${/parameter/@layout_code}_con_cashflow_wirte_off_detail_link" url="${/request/@context_path}/modules/cont/CON302N/con_cashflow_wirte_off_detail.lview"/> <a:link id="con_approval_link_id" model="cont.CON505.contract_approval" modelaction="update"/> <link href="${/request/@context_path}/css/lightbox.css" rel="stylesheet" type="text/css"/> <script src="${/request/@context_path}/javascripts/lightbox.js" type="text/javascript"/> <script type="text/javascript"><![CDATA[ Ext.ux.Lightbox.register('a[ref=img]', true); function lock_current_window() { Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}'); } function unlock_current_window() { Leaf.Masker.unmask(Ext.getBody()); } 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 contract_id = $(ds_id).getCurrentRecord().get('contract_id'); new Leaf.Window({ id: 'contract_history_window', url: $('contract_history_window_link').getUrl(), params: { contract_id: contract_id }, fullScreen: true }); }; // window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) { // if (name == 'car_detail') { // return '<a href="javascript:open_contract_window(\'' + record.id + '\',\'' + record.ds.id + '\')">' + config_record.get('prompt') + '</a>'; // } // return value; // }; window['${/parameter/@layout_code}_received_amount_detail'] = function (ds_id, id, name, query_only) { var url = $('${/parameter/@layout_code}_con_cashflow_wirte_off_detail_link').getUrl(); var record = $(ds_id).findById(id); if (record) { var win = new Leaf.Window({ id: 'con_cashflow_wirte_off_detail_window', url: url, params: { cashflow_id: record.get('cashflow_id'), winid: 'con_cashflow_wirte_off_detail_window' }, draggable: true, fullScreen: true }); } }; window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record, bp_seq) { var link_function = ''; window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record; if (name == 'project_number') { return '<a href="javascript:wfl_prj501_grid_update(\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>'; } else if (name == 'gps_attch') { link_function = '${/parameter/@layout_code}_ast_con_cdd4_attachtment_upload'; if (record.get('atm_num3') > 0) { return '<a style="color:red" href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } else { return '<a style="font-weight:bolder;font-size:1.2em" href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } } else if (name == 'description') { if (record.get('important_flag') == 'Y') { return '<font color="RED">' + value + '</font>'; } return value; } else if (name == 'bp_link' && record.get('bp_id') && record.get('record_id')) { link_function = '${/parameter/@layout_code}_open_bp_detail_window'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + config_record.get('prompt') + '</a>'; } else if (name == 'car_detail' && record.get('contract_lease_item_id')) { link_function = '${/parameter/@layout_code}_open_lease_item_detail_window'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + config_record.get('prompt') + '</a>'; } else if (name == 'attachment') { link_function = '${/parameter/@layout_code}_prj500_cdd_attachtment_upload'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } else if (name == 'attach_file_name' || name == 'attach_file_name_print' || name == 'attachment_new') { var content_type = record.get('content_type'); var content_id = record.get('content_id'); //电子合同 // if(content_type == '01'){ // var link = '${/request/@context_path}/modules/xxx/pdf_download.lsc?type=SIN&content_id=' + content_id; // var url = ''; // url = url + '<a href=' + link + '>' + '下载' + '</a>' + ','; // return url; // }else { 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])) { var file_name = temp[0].toUpperCase(); var file_suffix = temp[0].substr(temp[0].lastIndexOf('.') + 1).toUpperCase(); if (file_name.indexOf('.PDF') >= 0) { url = url + '<a href=javascript:view_pdf(\'' + temp[1] + '\')>' + temp[0] + '</a>' + ','; } else if (file_suffix == 'BMP' || file_suffix == 'JPG' || file_suffix == 'JPEG' || file_suffix == 'PNG' || file_suffix == 'GIF') { url = url + '<a href=' + link + temp[1] + ' ref="img">' + temp[0] + '</a>' + ','; } else { url = url + '<a href=' + link + temp[1] + '>' + temp[0] + '</a>' + ','; } } } return url; } //} } else if (name == 'received_amount') { link_function = '${/parameter/@layout_code}_received_amount_detail'; if (value) { return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + Leaf.formatMoney(value) + '</a>'; } return ''; } else if (name == 'attach_file_name_new') { link_function = '${/parameter/@layout_code}_prj500_cdd_attachtment_new_upload'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } }; function wfl_prj501_grid_update(record_id, ds_id) { var record = $(ds_id).findById(record_id); var param = {}; param['bp_class'] = record.get('bp_class'); param['project_id'] = record.get('project_id'); param['function_code'] = 'PRJ502D'; param['function_usage'] = 'QUERY'; param['url_title'] = '租赁申请查询'; hls_doc_get_layout_code('${/parameter/@layout_code}_con_contract_get_layout_code_link_id', param, 'wfl_readonly_pageLink_projectQueryScreen_update_project', record.ds.id, '${/parameter/@layout_code}'); } window['${/parameter/@layout_code}_ast_con_cdd4_attachtment_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); // if (record.get('con_contract_id')) { var url; if (query_only == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('contract_id'); } else { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('contract_id'); } var win = new Leaf.Window({ url: url, title: 'gps附件上传', id: '${/parameter/@layout_code}${/parameter/@tree_code}_ast_con_cdd4_attachtment_upload_id', width: 850, height: 400 }); // win.on('close', function(){ // $(ds_id).query(); // }); // } else { // Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); // } }; window['${/parameter/@layout_code}_open_lease_item_detail_window'] = function (id, name) { var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name]; var param = record.data; var contract_lease_item_id = record.get('contract_lease_item_id'); new Leaf.Window({ id: 'contract_lease_item_maintain_window', url: $('contract_lease_item_query_link').getUrl(), params: { contract_lease_item_id: contract_lease_item_id, winid: 'contract_lease_item_maintain_window' }, draggable: true, fullScreen: true }); }; window['${/parameter/@layout_code}_open_bp_detail_window'] = function (id, name) { var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name]; var param = {};//record.data; param['bp_id'] = record.get('bp_id'); param['cdd_list_id'] = record.get('cdd_list_id'); param['company_id'] = '${/session/company_id}'; param['document_id'] = record.get('bp_id'); param['document_category'] = 'BP'; param['bp_class'] = record.get('bp_class'); param['bp_category'] = record.get('bp_category'); if (record.get('bp_category') == 'AGENT') { param['function_code'] = 'HLS303_Q'; param['function_usage'] = 'QUERY'; } else { param['function_code'] = 'CON505H'; param['function_usage'] = 'QUERY'; } param['bp_type'] = record.get('bp_type'); param['download'] = 'Y'; param['url_title'] = '${l:HLS212.BP_MASTER_QUERY}'; hls_doc_get_layout_code('${/parameter/@layout_code}_con_contract_get_layout_code_link_id', param, 'con505_hls_bp_master_query_link', record.ds.id, '${/parameter/@layout_code}'); }; // function open_contract_window(record_id, ds_id) { // var record = $(ds_id).findById(record_id); // var param = record.data; // var contract_lease_item_id = record.get('contract_lease_item_id'); // new Leaf.Window({ // id: 'contract_lease_item_maintain_window', // url: $('contract_lease_item_maintain_link').getUrl(), // params: { // contract_lease_item_id: contract_lease_item_id // }, // fullScreen: true // }); // // param['function_code'] = 'CON501D'; // // param['function_usage'] = 'MODIFY'; // // param['maintain_type'] = 'UPDATE'; // // 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); // } window['${/parameter/@layout_code}_prj500_cdd_attachtment_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); if (record.get('check_id')) { var url; //add by lijingjing 2019-11-15 if (record.get('attachment_tab_group') == 'CREDIT_CHECK' && '${/parameter/@query_only}' == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else if (record.get('attachment_tab_group') == 'SIGN' && '${/parameter/@con_query_only}' == 'N') { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else if (record.get('attachment_tab_group') == 'SIGN' && '${/parameter/@con_query_only}' == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else if (query_only == 'Y' || '${/parameter/@download}' == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } var win = new Leaf.Window({ url: url, title: '${l:HLS.SUPPORTING_DOCUMENT}', id: '${/parameter/@layout_code}${/parameter/@tree_code}_prj500_cdd_uploadFile_screen_id', width: 850, height: 400 }); win.on('close', function () { record.ds.query(); }); } else { Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); } }; window['${/parameter/@layout_code}_prj500_cdd_attachtment_new_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); if (record.get('check_id')) { var url; //add by lijingjing 2019-11-15 if (query_only == 'Y' || '${/parameter/@download}' == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('check_id'); } else { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('check_id'); } var win = new Leaf.Window({ url: url, title: '${l:HLS.SUPPORTING_DOCUMENT}', id: '${/parameter/@layout_code}${/parameter/@tree_code}_prj500_cdd_uploadFile_screen_id', width: 850, height: 400 }); win.on('close', function () { record.ds.query(); }); } else { Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); } }; window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function () { // var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var record = $(ds_id).getCurrentRecord(); var content_id; //alert($('${/parameter/@layout_code}_con505_contract_content_id').getUrl); Leaf.request({ url: $('${/parameter/@layout_code}_con505_contract_content_id').getUrl(), para: { content_id: content_id, contract_id: record.get('contract_id'), contract_bp_id: record.get('content_bp_pk'), clause_usage: 'GH_WITHHOLD_AGREE' }, success: function (rsc) { // //alert(rsc.result.content_id); Leaf.request({ url: $('${/parameter/@layout_code}_creat_con_contract_content_link_id').getUrl(), para: { content_id: rsc.result.content_id, file_path: '${/parameter/@file_path}' }, success: function () { Leaf.request({ url: $('${/parameter/@layout_code}_file_copy_from_template_link_id').getUrl(), para: { contract_id: record.get('contract_id'), content_id: rsc.result.content_id, file_path: '${/parameter/@file_path}', batch_flag: 'Y' }, success: function () { var url = $('${/parameter/@layout_code}_con_batch_dl_link_id').getUrl() + '?contract_id=' + record.get('contract_id') + '&content_id=' + rsc.result.content_id; window.open(url, '_self'); unlock_current_window(); } }); unlock_current_window(); }, error: function () { unlock_current_window(); }, failure: function () { unlock_current_window(); }, scope: this }); }, error: function () { unlock_current_window(); }, failure: function () { unlock_current_window(); }, 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'); var record = $(ds_id).getCurrentRecord(); var direct_debit_bank_id = record.get('direct_debit_bank_id'); var dd_bank_account_name = record.get('dd_bank_account_name'); var dd_bank_account_num = record.get('dd_bank_account_num'); if (!Ext.isEmpty(record.get('contract_number'))) { new Leaf.Window({ id: '${/parameter/@layout_code}_con_contract_content_confirm_win_id', params: { action: 'VIEW', contract_id: record.get('contract_id'), company_id: record.get('company_id'), document_category: record.get('document_category'), business_type: record.get('business_type'), winid: '${/parameter/@layout_code}_con_contract_content_confirm_win_id' }, url: $('${/parameter/@layout_code}_con_contract_content_confirm_link_id').getUrl(), title: '合同查看', width: 1300, height: 550 }); } else { Leaf.showErrorMessage('错误', '请先点击保存生成合同编号!'); } }; var change_flag = 'N'; //工作流中合同文本生成按钮 //基本信息tab页 新增必输字段的校验 add by liukang 20160328 window['${/parameter/@layout_code}_print_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var con_lease_item_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_lease_item'); var record = $(ds_id).getCurrentRecord(); var con_lease_record = $(con_lease_item_id).getCurrentRecord(); var direct_debit_bank_id = record.get('direct_debit_bank_id'); var dd_bank_account_name = record.get('dd_bank_account_name'); var dd_bank_account_num = record.get('dd_bank_account_num'); var color_of_apprearance = con_lease_record.get('color_of_apprearance'); var item_frame_number = con_lease_record.get('item_frame_number'); var item_engine_number = con_lease_record.get('item_engine_number'); var license_number = con_lease_record.get('license_number'); /* if (Ext.isEmpty(direct_debit_bank_id)) { Leaf.showMessage('${l:HLS.PROMPT}', '请先填写数据并保存!'); } else */ if (!Ext.isEmpty(record.get('contract_number'))) { var win = new Leaf.Window({ id: '${/parameter/@layout_code}_con_contract_content_confirm_win_id', params: { contract_id: record.get('contract_id'), company_id: record.get('company_id'), document_category: record.get('document_category'), business_type: record.get('business_type'), winid: '${/parameter/@layout_code}_con_contract_content_confirm_win_id', change_flag: change_flag, contract_name: record.get('contract_name'), contract_number: record.get('contract_number') }, url: $('${/parameter/@layout_code}_con_contract_content_confirm_link_id').getUrl(), title: '合同文本生成', width: 1300, height: 550 }); //在关闭页面之后,刷新一下ds win.on('close', function () { if (ds_id) { $(ds_id).query(); } }); } else { Leaf.showErrorMessage('错误', '请先点击保存生成合同编号!'); } }; //add by zhuxianfei 20180207 function view_pdf(attachment_id) { Leaf.request({ url: '${/request/@context_path}/autocrud/fnd.fnd_atm_attachment/query', para: { attachment_id: attachment_id }, success: function (res) { var path = res.result.record.file_path; path = path.substr(path.indexOf('hls_attachment')); var tomcat_source = '${/parameter/@tomcat_source}'; var source_path = 'http://' + window.location.host + '/' + tomcat_source + '/' + path + '?type=pdf'; var oWin = window.open(source_path); }, scope: this }); } window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function (ds, qpara, bp_seq) { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_bs_score'); if (ds.id == ds_id) { qpara.contract_id = '${/parameter/@contract_id}'; //$(ds_id).setQueryParameter('contract_id', '${/parameter/@contract_id}'); } }; window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function (ds, record, config_records, bp_seq) { debugger; var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); if (ds_id == ds.id && ds_id) { //业务类型回租时,默认只读“首付款抵扣”选项 if (record.get('business_type') == 'LEASEBACK' && '${/parameter/@function_usage}' == 'MODIFY') { //document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_ENTRUSTED_AMOUNT_prompt').style.display = 'block'; // document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_ENTRUSTED_AMOUNT').style.display = 'block'; record.getField('entrusted_amount').setRequired(true); } else if (record.get('business_type') == 'LEASE') { document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_ENTRUSTED_AMOUNT_prompt').style.display = 'none'; document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_ENTRUSTED_AMOUNT').style.display = 'none'; } } }; /*保存前调用校验*/ window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) { debugger; var check_flag = true; var contract_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var con_record = $(contract_ds_id).getAt(0); if (contract_ds_id == ds.id&&$(contract_ds_id).validate()) { if (con_record.get('business_type') == 'LEASEBACK') { //“保存”按钮增加校验:若所填写小于0或大于设备款价格,点击按钮校验提示:“委托付款金额有误,请重新填写!” if (con_record.get('entrusted_amount') < 0 || con_record.get('entrusted_amount') > minus(con_record.get('lease_item_amount'),con_record.get('down_payment'))) { Leaf.showMessage('${HLS.PROMPT}', '委托付款金额有误,请重新填写!'); return false; } } } else { check_flag = false; } return check_flag; }; window['${/parameter/@layout_code}_submit_approval_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var record = $(ds_id).getCurrentRecord(); var contract_id = record.get('contract_id'); if (record.dirty == true) { Leaf.showMessage('${l:PROMPT}', '${l:HLS.EXECUTE_AFTER_SAVE}'); return; } // if(record.get('contract_status')!='NEW'){ // $L.showErrorMessage("错误",'只能新建状态的合同才能发起签约!'); // return; // } if ($(ds_id).validate()) { Leaf.showConfirm('${HLS.PROMPT}', '确认要提交工作流吗?', function () { window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); Leaf.request({ url: $('con_approval_link_id').getUrl(), para: { contract_id: contract_id }, scope: this, success: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); $('${/parameter/@winid}').close(); }, failure: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, error: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); } }); }); } }; if ('${/parameter/@source_type}' == 'WFL') { zjwfl5110_ApproveChecker_add('zjwfl5110_submit', function (type) { var con_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); if (type == 'agree') { if ($(con_ds_id).validate()) { if ($(con_ds_id).isModified()) { Leaf.showMessage('${HLS.PROMPT}', '请先保存'); return false; } //提交先保存 return true; } else { return false; } } else return true; }); } Leaf.onReady(function () { var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'T_INVOICE_INFO', 'con_contract_bp'); if (ds_id) { $(ds_id).setQueryUrl('${/request/@context_path}/autocrud/prj.PRJ501N.con_contract_bp/query'); $(ds_id).setQueryParameter('contract_id', '${/parameter/@contract_id}'); $(ds_id).query(); } }) ]]></script> <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/> </a:view></a:screen> <?xml version="1.0" encoding="UTF-8"?><!-- $Author: zlf $Date: 2014-11-10 下午5:42:24 $Revision: 1.0 $Purpose: --><a:screen xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" customizationEnabled="true" dynamiccreateenabled="true" trace="true"> <a:init-procedure> <a:model-query fetchAll="true" model="cont.CON500.con_contract_get_guid_file_name" rootPath="file_name_path"/> <s:server-script import="contract_print_path.js"><![CDATA[ $ctx.parameter.file_path = con_print_path['con_print_path']; $ctx.parameter.tomcat_source = con_print_path['tomcat_source']; ]]> </s:server-script> <s:server-script import="con_print_path.js"><![CDATA[ set_parameter_file_path(); ]]> </s:server-script> </a:init-procedure> <a:view> <a:link id="wfl_readonly_pageLink_projectQueryScreen_update_project" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain_readonly.lview"/> <a:link id="${/parameter/@layout_code}_con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/> <a:link id="${/parameter/@layout_code}_con_contract_content_confirm_link_id" url="${/request/@context_path}/modules/cont/CON501N/con_contract_content_confirm.lview"/> <a:link id="contract_lease_item_query_link" url="${/request/@context_path}/modules/cont/CON505/con_lease_item_query.lview"/> <a:link id="contract_history_window_link" url="${/request/@context_path}/modules/cont/CON501N/con_document_history_query.lview"/> <a:link id="con505_hls_bp_master_query_link" url="${/request/@context_path}/modules/cont/CON505/hls_bp_master_query.lview"/> <a:link id="${/parameter/@layout_code}_prj500_cdd_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/> <a:link id="${/parameter/@layout_code}_prj500_cdd_downloadFile_id" url="${/request/@context_path}/downloadFile.lview"/> <!--打印使用--> <a:link id="${/parameter/@layout_code}_con505_contract_content_id" model="cont.CON505.con505_contract_content" modelaction="update"/> <a:link id="${/parameter/@layout_code}_creat_con_contract_content_link_id" model="cont.CON505.con505_contract_content" modelaction="execute"/> <a:link id="${/parameter/@layout_code}_file_copy_from_template_link_id" url="${/request/@context_path}/modules/cont/CON505/file_copy_from_template.lsc"/> <a:link id="${/parameter/@layout_code}_con_batch_dl_link_id" url="${/request/@context_path}/modules/cont/CON505/con_atm_batch_dl.lsc"/> <a:link id="${/parameter/@layout_code}_con_cashflow_wirte_off_detail_link" url="${/request/@context_path}/modules/cont/CON302N/con_cashflow_wirte_off_detail.lview"/> <a:link id="con_approval_link_id" model="cont.CON505.contract_approval" modelaction="update"/> <a:link id="con_sign_cancel_link_id" model="cont.CON505.contract_sign_cancel" modelaction="update"/> <a:link id="${/parameter/@layout_code}_con_ele_content_create_link_id" url="${/request/@context_path}/modules/wx/WX100/con_ele_content_create.lsc"/> <a:link id="${/parameter/@layout_code}_con_ele_sign_cancel_link_id" url="${/request/@context_path}/modules/cont/CON505/con_ele_sign_cancel.lsc"/> <link href="${/request/@context_path}/css/lightbox.css" rel="stylesheet" type="text/css"/> <script src="${/request/@context_path}/javascripts/lightbox.js" type="text/javascript"/> <script type="text/javascript"><![CDATA[ Ext.ux.Lightbox.register('a[ref=img]', true); function lock_current_window() { Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}'); } function unlock_current_window() { Leaf.Masker.unmask(Ext.getBody()); } 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 contract_id = $(ds_id).getCurrentRecord().get('contract_id'); new Leaf.Window({ id: 'contract_history_window', url: $('contract_history_window_link').getUrl(), params: { contract_id: contract_id }, fullScreen: true }); }; // window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) { // if (name == 'car_detail') { // return '<a href="javascript:open_contract_window(\'' + record.id + '\',\'' + record.ds.id + '\')">' + config_record.get('prompt') + '</a>'; // } // return value; // }; window['${/parameter/@layout_code}_received_amount_detail'] = function (ds_id, id, name, query_only) { var url = $('${/parameter/@layout_code}_con_cashflow_wirte_off_detail_link').getUrl(); var record = $(ds_id).findById(id); if (record) { var win = new Leaf.Window({ id: 'con_cashflow_wirte_off_detail_window', url: url, params: { cashflow_id: record.get('cashflow_id'), winid: 'con_cashflow_wirte_off_detail_window' }, draggable: true, fullScreen: true }); } }; window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record, bp_seq) { var link_function = ''; window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record; if (name == 'project_number') { return '<a href="javascript:wfl_prj501_grid_update(\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>'; } else if (name == 'gps_attch') { link_function = '${/parameter/@layout_code}_ast_con_cdd4_attachtment_upload'; if (record.get('atm_num3') > 0) { return '<a style="color:red" href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } else { return '<a style="font-weight:bolder;font-size:1.2em" href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } } else if (name == 'description') { if (record.get('important_flag') == 'Y') { return '<font color="RED">' + value + '</font>'; } return value; } else if (name == 'bp_link' && record.get('bp_id') && record.get('record_id')) { link_function = '${/parameter/@layout_code}_open_bp_detail_window'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + config_record.get('prompt') + '</a>'; } else if (name == 'car_detail' && record.get('contract_lease_item_id')) { link_function = '${/parameter/@layout_code}_open_lease_item_detail_window'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + config_record.get('prompt') + '</a>'; } else if (name == 'attachment') { link_function = '${/parameter/@layout_code}_prj500_cdd_attachtment_upload'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } else if (name == 'attach_file_name' || name == 'attach_file_name_print' || name == 'attachment_new') { var content_type = record.get('content_type'); var content_id = record.get('content_id'); //电子合同 // if(content_type == '01'){ // var link = '${/request/@context_path}/modules/xxx/pdf_download.lsc?type=SIN&content_id=' + content_id; // var url = ''; // url = url + '<a href=' + link + '>' + '下载' + '</a>' + ','; // return url; // }else { 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])) { var file_name = temp[0].toUpperCase(); var file_suffix = temp[0].substr(temp[0].lastIndexOf('.') + 1).toUpperCase(); if (file_name.indexOf('.PDF') >= 0) { url = url + '<a href=javascript:view_pdf(\'' + temp[1] + '\')>' + temp[0] + '</a>' + ','; } else if (file_suffix == 'BMP' || file_suffix == 'JPG' || file_suffix == 'JPEG' || file_suffix == 'PNG' || file_suffix == 'GIF') { url = url + '<a href=' + link + temp[1] + ' ref="img">' + temp[0] + '</a>' + ','; } else { url = url + '<a href=' + link + temp[1] + '>' + temp[0] + '</a>' + ','; } } } return url; } //} } else if (name == 'received_amount') { link_function = '${/parameter/@layout_code}_received_amount_detail'; if (value) { return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + Leaf.formatMoney(value) + '</a>'; } return ''; } else if (name == 'attach_file_name_new') { link_function = '${/parameter/@layout_code}_prj500_cdd_attachtment_new_upload'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } }; function wfl_prj501_grid_update(record_id, ds_id) { var record = $(ds_id).findById(record_id); var param = {}; param['bp_class'] = record.get('bp_class'); param['project_id'] = record.get('project_id'); param['function_code'] = 'PRJ502D'; param['function_usage'] = 'QUERY'; param['url_title'] = '租赁申请查询'; hls_doc_get_layout_code('${/parameter/@layout_code}_con_contract_get_layout_code_link_id', param, 'wfl_readonly_pageLink_projectQueryScreen_update_project', record.ds.id, '${/parameter/@layout_code}'); } window['${/parameter/@layout_code}_ast_con_cdd4_attachtment_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); // if (record.get('con_contract_id')) { var url; if (query_only == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('contract_id'); } else { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('contract_id'); } var win = new Leaf.Window({ url: url, title: 'gps附件上传', id: '${/parameter/@layout_code}${/parameter/@tree_code}_ast_con_cdd4_attachtment_upload_id', width: 850, height: 400 }); // win.on('close', function(){ // $(ds_id).query(); // }); // } else { // Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); // } }; window['${/parameter/@layout_code}_open_lease_item_detail_window'] = function (id, name) { var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name]; var param = record.data; var contract_lease_item_id = record.get('contract_lease_item_id'); new Leaf.Window({ id: 'contract_lease_item_maintain_window', url: $('contract_lease_item_query_link').getUrl(), params: { contract_lease_item_id: contract_lease_item_id, winid: 'contract_lease_item_maintain_window' }, draggable: true, fullScreen: true }); }; window['${/parameter/@layout_code}_open_bp_detail_window'] = function (id, name) { var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name]; var param = {};//record.data; param['bp_id'] = record.get('bp_id'); param['cdd_list_id'] = record.get('cdd_list_id'); param['company_id'] = '${/session/company_id}'; param['document_id'] = record.get('bp_id'); param['document_category'] = 'BP'; param['bp_class'] = record.get('bp_class'); param['bp_category'] = record.get('bp_category'); if (record.get('bp_category') == 'AGENT') { param['function_code'] = 'HLS303_Q'; param['function_usage'] = 'QUERY'; } else { param['function_code'] = 'CON505H'; param['function_usage'] = 'QUERY'; } param['bp_type'] = record.get('bp_type'); param['download'] = 'Y'; param['url_title'] = '${l:HLS212.BP_MASTER_QUERY}'; hls_doc_get_layout_code('${/parameter/@layout_code}_con_contract_get_layout_code_link_id', param, 'con505_hls_bp_master_query_link', record.ds.id, '${/parameter/@layout_code}'); }; // function open_contract_window(record_id, ds_id) { // var record = $(ds_id).findById(record_id); // var param = record.data; // var contract_lease_item_id = record.get('contract_lease_item_id'); // new Leaf.Window({ // id: 'contract_lease_item_maintain_window', // url: $('contract_lease_item_maintain_link').getUrl(), // params: { // contract_lease_item_id: contract_lease_item_id // }, // fullScreen: true // }); // // param['function_code'] = 'CON501D'; // // param['function_usage'] = 'MODIFY'; // // param['maintain_type'] = 'UPDATE'; // // 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); // } window['${/parameter/@layout_code}_prj500_cdd_attachtment_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); if (record.get('check_id')) { var url; //add by lijingjing 2019-11-15 if (record.get('attachment_tab_group') == 'CREDIT_CHECK' && '${/parameter/@query_only}' == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else if (record.get('attachment_tab_group') == 'SIGN' && '${/parameter/@con_query_only}' == 'N') { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else if (record.get('attachment_tab_group') == 'SIGN' && '${/parameter/@con_query_only}' == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else if (query_only == 'Y' || '${/parameter/@download}' == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } var win = new Leaf.Window({ url: url, title: '${l:HLS.SUPPORTING_DOCUMENT}', id: '${/parameter/@layout_code}${/parameter/@tree_code}_prj500_cdd_uploadFile_screen_id', width: 850, height: 400 }); win.on('close', function () { record.ds.query(); }); } else { Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); } }; window['${/parameter/@layout_code}_prj500_cdd_attachtment_new_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); if (record.get('check_id')) { var url; //add by lijingjing 2019-11-15 if (query_only == 'Y' || '${/parameter/@download}' == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('check_id'); } else { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('check_id'); } var win = new Leaf.Window({ url: url, title: '${l:HLS.SUPPORTING_DOCUMENT}', id: '${/parameter/@layout_code}${/parameter/@tree_code}_prj500_cdd_uploadFile_screen_id', width: 850, height: 400 }); win.on('close', function () { record.ds.query(); }); } else { Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); } }; window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function () { // var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var record = $(ds_id).getCurrentRecord(); var content_id; //alert($('${/parameter/@layout_code}_con505_contract_content_id').getUrl); Leaf.request({ url: $('${/parameter/@layout_code}_con505_contract_content_id').getUrl(), para: { content_id: content_id, contract_id: record.get('contract_id'), contract_bp_id: record.get('content_bp_pk'), clause_usage: 'GH_WITHHOLD_AGREE' }, success: function (rsc) { // //alert(rsc.result.content_id); Leaf.request({ url: $('${/parameter/@layout_code}_creat_con_contract_content_link_id').getUrl(), para: { content_id: rsc.result.content_id, file_path: '${/parameter/@file_path}' }, success: function () { Leaf.request({ url: $('${/parameter/@layout_code}_file_copy_from_template_link_id').getUrl(), para: { contract_id: record.get('contract_id'), content_id: rsc.result.content_id, file_path: '${/parameter/@file_path}', batch_flag: 'Y' }, success: function () { var url = $('${/parameter/@layout_code}_con_batch_dl_link_id').getUrl() + '?contract_id=' + record.get('contract_id') + '&content_id=' + rsc.result.content_id; window.open(url, '_self'); unlock_current_window(); } }); unlock_current_window(); }, error: function () { unlock_current_window(); }, failure: function () { unlock_current_window(); }, scope: this }); }, error: function () { unlock_current_window(); }, failure: function () { unlock_current_window(); }, 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'); var record = $(ds_id).getCurrentRecord(); var direct_debit_bank_id = record.get('direct_debit_bank_id'); var dd_bank_account_name = record.get('dd_bank_account_name'); var dd_bank_account_num = record.get('dd_bank_account_num'); if (!Ext.isEmpty(record.get('contract_number'))) { new Leaf.Window({ id: '${/parameter/@layout_code}_con_contract_content_confirm_win_id', params: { action: 'VIEW', contract_id: record.get('contract_id'), company_id: record.get('company_id'), document_category: record.get('document_category'), business_type: record.get('business_type'), winid: '${/parameter/@layout_code}_con_contract_content_confirm_win_id' }, url: $('${/parameter/@layout_code}_con_contract_content_confirm_link_id').getUrl(), title: '合同查看', width: 1300, height: 550 }); } else { Leaf.showErrorMessage('错误', '请先点击保存生成合同编号!'); } }; var change_flag = 'N'; //工作流中合同文本生成按钮 //基本信息tab页 新增必输字段的校验 add by liukang 20160328 window['${/parameter/@layout_code}_print_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var con_lease_item_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_lease_item'); var record = $(ds_id).getCurrentRecord(); var con_lease_record = $(con_lease_item_id).getCurrentRecord(); var direct_debit_bank_id = record.get('direct_debit_bank_id'); var dd_bank_account_name = record.get('dd_bank_account_name'); var dd_bank_account_num = record.get('dd_bank_account_num'); var color_of_apprearance = con_lease_record.get('color_of_apprearance'); var item_frame_number = con_lease_record.get('item_frame_number'); var item_engine_number = con_lease_record.get('item_engine_number'); var license_number = con_lease_record.get('license_number'); /* if (Ext.isEmpty(direct_debit_bank_id)) { Leaf.showMessage('${l:HLS.PROMPT}', '请先填写数据并保存!'); } else */ if (!Ext.isEmpty(record.get('contract_number'))) { var win = new Leaf.Window({ id: '${/parameter/@layout_code}_con_contract_content_confirm_win_id', params: { contract_id: record.get('contract_id'), company_id: record.get('company_id'), document_category: record.get('document_category'), business_type: record.get('business_type'), winid: '${/parameter/@layout_code}_con_contract_content_confirm_win_id', change_flag: change_flag, contract_name: record.get('contract_name'), contract_number: record.get('contract_number') }, url: $('${/parameter/@layout_code}_con_contract_content_confirm_link_id').getUrl(), title: '合同文本生成', width: 1300, height: 550 }); //在关闭页面之后,刷新一下ds win.on('close', function () { if (ds_id) { $(ds_id).query(); } }); } else { Leaf.showErrorMessage('错误', '请先点击保存生成合同编号!'); } }; //add by zhuxianfei 20180207 function view_pdf(attachment_id) { Leaf.request({ url: '${/request/@context_path}/autocrud/fnd.fnd_atm_attachment/query', para: { attachment_id: attachment_id }, success: function (res) { var path = res.result.record.file_path; path = path.substr(path.indexOf('hls_attachment')); var tomcat_source = '${/parameter/@tomcat_source}'; var source_path = 'http://' + window.location.host + '/' + tomcat_source + '/' + path + '?type=pdf'; var oWin = window.open(source_path); }, scope: this }); } window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function (ds, qpara, bp_seq) { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_bs_score'); if (ds.id == ds_id) { qpara.contract_id = '${/parameter/@contract_id}'; //$(ds_id).setQueryParameter('contract_id', '${/parameter/@contract_id}'); } }; window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function (ds, record, config_records, bp_seq) { debugger; var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); if (ds_id == ds.id && ds_id) { //业务类型回租时,默认只读“首付款抵扣”选项 if (record.get('business_type') == 'LEASEBACK' && '${/parameter/@function_usage}' == 'MODIFY') { //document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_ENTRUSTED_AMOUNT_prompt').style.display = 'block'; // document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_ENTRUSTED_AMOUNT').style.display = 'block'; record.getField('entrusted_amount').setRequired(true); } else if (record.get('business_type') == 'LEASE') { document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_ENTRUSTED_AMOUNT_prompt').style.display = 'none'; document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_ENTRUSTED_AMOUNT').style.display = 'none'; } } }; //更新时调用 window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); if (ds_id == ds.id && ds_id) { var record = $(ds_id).getCurrentRecord(); var bp_tenant_class = record.get('bp_class'); if (name == 'sign_type_n') { if(value == '纸质签约'){ record.getField('signer_n').setReadOnly(true); record.getField('signer_n').setRequired(false); record.set('signer_n',''); }else if (value == '电子签约' && bp_tenant_class == 'ORG'){ record.getField('signer_n').setReadOnly(false); record.getField('signer_n').setRequired(true); record.set('ec_sign_type','NEW'); record.set('sign_contract_status','NEW'); }else if(value == '电子签约' && bp_tenant_class == 'NP'){ record.getField('signer_n').setReadOnly(true); record.set('ec_sign_type','NEW'); record.set('sign_contract_status','NEW'); } } } }; /*保存前调用校验*/ window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) { debugger; var check_flag = true; var contract_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var con_record = $(contract_ds_id).getAt(0); if (contract_ds_id == ds.id&&$(contract_ds_id).validate()) { if (con_record.get('business_type') == 'LEASEBACK') { //“保存”按钮增加校验:若所填写小于0或大于设备款价格,点击按钮校验提示:“委托付款金额有误,请重新填写!” if (con_record.get('entrusted_amount') < 0 || con_record.get('entrusted_amount') > minus(con_record.get('lease_item_amount'),con_record.get('down_payment'))) { Leaf.showMessage('${HLS.PROMPT}', '委托付款金额有误,请重新填写!'); return false; } } } else { check_flag = false; } return check_flag; }; //取消签约按钮 add by 24976 window['${/parameter/@layout_code}_user_button4_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var record = $(ds_id).getCurrentRecord(); var contract_id = record.get('contract_id'); var sign_contract_status = record.get('sign_contract_status'); var ec_sign_type = record.get('ec_sign_type'); if (sign_contract_status != 'SIGNING') { Leaf.showMessage('${l:PROMPT}', '只有签约中的合同可以取消签约'); return; } if (sign_contract_status == 'SIGNING' && ec_sign_type == null){ Leaf.showConfirm('${HLS.PROMPT}', '确认要取消签约吗?', function () { window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); Leaf.request({ url: $('con_sign_cancel_link_id').getUrl(), para: { contract_id: contract_id }, scope: this, success: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); $('${/parameter/@winid}').close(); }, failure: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, error: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); } }); }); }else if(ec_sign_type != 'SIGNED' && ec_sign_type != 'REVOKE' && ec_sign_type != null && sign_contract_status == 'SIGNING'){ Leaf.showConfirm('${HLS.PROMPT}', '确认取消电子签约吗?', function () { window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); Leaf.request({ url: $('${/parameter/@layout_code}_con_ele_sign_cancel_link_id').getUrl(), para: { contract_id: contract_id }, scope: this, success: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); $('${/parameter/@winid}').close(); }, failure: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, error: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); } }); }); } }; window['${/parameter/@layout_code}_submit_approval_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var record = $(ds_id).getCurrentRecord(); var contract_id = record.get('contract_id'); //add by 24976 var sign_type = record.get('sign_type'); var contract_inception_date = record.get('contract_inception_date'); if (record.dirty == true) { Leaf.showMessage('${l:PROMPT}', '${l:HLS.EXECUTE_AFTER_SAVE}'); return; } // if(record.get('contract_status')!='NEW'){ // $L.showErrorMessage("错误",'只能新建状态的合同才能发起签约!'); // return; // } if ($(ds_id).validate()) { if (sign_type == 'ELE_SIGN'){ Leaf.showConfirm('${HLS.PROMPT}', '确认要发起电子签约吗?', function () { window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); //校验起租日 var date = new Date(); date.setTime(date.getTime()); if (contract_inception_date < date) { Leaf.showMessage('${l:PROMPT}', '起租日小于当前时间,不允许发起电子签约!'); window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); return; } Leaf.request({ url: $('${/parameter/@layout_code}_con_ele_content_create_link_id').getUrl(), para: { contract_id: contract_id }, scope: this, success: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); $('${/parameter/@winid}').close(); }, failure: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, error: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); } }); }); } else if (sign_type == 'PAPER_SIGN'){ Leaf.showConfirm('${HLS.PROMPT}', '确认要提交工作流吗?', function () { window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); Leaf.request({ url: $('con_approval_link_id').getUrl(), para: { contract_id: contract_id }, scope: this, success: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); $('${/parameter/@winid}').close(); }, failure: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, error: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); } }); }); } } }; if ('${/parameter/@source_type}' == 'WFL') { zjwfl5110_ApproveChecker_add('zjwfl5110_submit', function (type) { var con_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); if (type == 'agree') { if ($(con_ds_id).validate()) { if ($(con_ds_id).isModified()) { Leaf.showMessage('${HLS.PROMPT}', '请先保存'); return false; } //提交先保存 return true; } else { return false; } } else return true; }); } Leaf.onReady(function () { var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'T_INVOICE_INFO', 'con_contract_bp'); if (ds_id) { $(ds_id).setQueryUrl('${/request/@context_path}/autocrud/prj.PRJ501N.con_contract_bp/query'); $(ds_id).setQueryParameter('contract_id', '${/parameter/@contract_id}'); $(ds_id).query(); } }) ]]></script> <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/> </a:view></a:screen>
\ No newline at end of file \ No newline at end of file
......
<?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>
<s:server-script><![CDATA[
importPackage(java.io);
importPackage(Packages.com.hand.elecon.httpost);
var up_file_token_url = 'http://hlsapp.hand-china.com/hl_dr_dev/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password=admin'; //文件上传获取token的地址
//系统参数获取
function info_query(parameter_code) {
var info = new Object();
var data = null;
var parameter_map = $bm('wx.WX100.sys_parameter_value').queryAsMap({
parameter_code:parameter_code
});
var data = parameter_map.getChildren();
info.code_value = data[0].code_value;
return info;
}
//获取电子签署的flow_id
var sign_cancel_bm = $bm('cont.CON505.contract_sign_cancel');
var sign_cancel_map = sign_cancel_bm.queryAsMap({
contract_id:$ctx.parameter.contract_id
});
var flow_Id = sign_cancel_map.getChildren()[0].ele_flow_id;
var revokeParam = {
flowId:flow_Id
}
//调用中台取消流程
var info = info_query('HL_SIGN_FLOW_CANCEL');
var httpUrl = info.code_value;
var logs_bm = $bm('wx.WX100.con_ele_savelogs');
try {
var token_sign_result = EleFileUpHttpPost.post(up_file_token_url, null, null);
} catch (e) {
raise_app_error('上传文件获取token失败,请联系技术人员检查!');
}
var token_sign_result_ob = JSON.parse(token_sign_result);
var access_sign_token = token_sign_result_ob.access_token;
var result = EleFileUpHttpPost.post(httpUrl, JSON.stringify(revokeParam), access_sign_token);
logs_bm.insert({
contract_id:$ctx.parameter.contract_id,
httpurl:httpUrl,
jsonPut:JSON.stringify(revokeParam),
jsonResult:result,
tokenResult:token_sign_result
});
var result_ob = JSON.parse(result); //根据返回参数形式再定
if (result_ob.code != 0) {
//rollback
$bm('wx.WX100.rollback').update();
raise_app_error('取消签约失败,请联系技术人员检查!');
}else if(result_ob.code == 0){
sign_cancel_bm.execute({
contract_id:$ctx.parameter.contract_id
})
}
]]></s:server-script>
</a:init-procedure>
</a:service>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zc
$Date: 2020年11月17日 17点57分
$Revision: 1.0
$Purpose: 电子合同监控页面
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true"
trace="true">
<a:init-procedure>
<a:model-query model="cont.CON620.get_sys_role" rootPath="role_info"/>
</a:init-procedure>
<a:view>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
modelaction="update"/>
<a:link id="car_modify_link_readonly" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain.lview"/>
<a:link id="${/parameter/@layout_code}con_contract_query_link"
url="${/request/@context_path}/modules/cont/CON3200/con_re_incept_modify.lview"/>
<script type="text/javascript"><![CDATA[
function open_contract_win(ds_id, record_id) {
var record = $(ds_id).findById(record_id);
var param = record.data;
param['function_usage'] = 'QUERY';
param['function_code'] = 'CON3200Q';
param['maintain_type'] = 'QUERY';
param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, '${/parameter/@layout_code}con_contract_query_link', ds_id);
}
function open_project_Window(record_id, ds_id) {
var record = $(ds_id).findById(record_id);
//项目类layout_code
maintain_type = 'READONLY';
param = record.data;
param['document_id'] = record.get('project_id');
param['function_code'] = 'PRJ501_WFL';
param['function_usage'] = 'QUERY';
param['maintain_type'] = maintain_type;
param['url_title'] = '${l:HLS.PROJECT_MAITAIN}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'car_modify_link_readonly', ds_id);
}
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>';
}
if (name == 'project_number' && value) {
return '<a href="javascript:open_project_Window(\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>';
}
return value;
};
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 grid_id = ds_id.replace('ds', 'layout_grid_id');
$(grid_id)._export();
};
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
</a:screen>
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<a:screen xmlns:a="http://www.leaf-framework.org/application"> <a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:view> <a:view>
<a:link id="hls810_param_link_link" url="${/request/@context_path}/modules/hls/HLS810/hls_doc_file_tmp_para_link.lview"/> <a:link id="hls810_param_link_link" url="${/request/@context_path}/modules/hls/HLS810/hls_doc_file_tmp_para_link.lview"/>
<a:link id="hls810_templet_signer_link" url="${/request/@context_path}/modules/hls/HLS810/hls_doc_file_templet_signer.lview"/>
<a:link id="hls810_atm_link" url="${/request/@context_path}/uploadFile.lview"/> <a:link id="hls810_atm_link" url="${/request/@context_path}/uploadFile.lview"/>
<script type="text/javascript"><![CDATA[ <script type="text/javascript"><![CDATA[
function hls810_add() { function hls810_add() {
...@@ -66,6 +67,23 @@ ...@@ -66,6 +67,23 @@
width: 830 width: 830
}); });
} }
//模板签署人链接 add by 24976
function hls810_templet_signer_link_rener(value,record,name){
var tmpt_id = record.get('templet_id');
if(!record.isNew){
return '<a href="javascript:hls810_signer_jump(\''+tmpt_id+'\')">签署人</a>';
}
}
function hls810_signer_jump(templet_id){
var url = $('hls810_templet_signer_link').getUrl()+'?templet_id='+templet_id;
wd = new Leaf.Window({
id: 'hls810_templet_signer_link_screen',
url: url,
title: '签署人参数',
height: 500,
width: 830
});
}
function hls810_plugin_render(value,record,name){ function hls810_plugin_render(value,record,name){
var tmpt_id = record.get('templet_id'); var tmpt_id = record.get('templet_id');
if(!record.isNew){ if(!record.isNew){
...@@ -152,6 +170,7 @@ ...@@ -152,6 +170,7 @@
<a:column name="note" editor="textArea_ed" prompt="说明" width="200"/> <a:column name="note" editor="textArea_ed" prompt="说明" width="200"/>
<a:column name="enabled_flag" editor="checkbox_ed" prompt="启用" width="50"/> <a:column name="enabled_flag" editor="checkbox_ed" prompt="启用" width="50"/>
<a:column name="param_link" align="center" prompt="参数集" renderer="hls810_param_link_rener"/> <a:column name="param_link" align="center" prompt="参数集" renderer="hls810_param_link_rener"/>
<a:column name="templet_signer_link" align="center" prompt="签署人" renderer="hls810_templet_signer_link_rener"/>
<a:column name="pwd" align="center" editor="hls810_pwd_ed" prompt="密码" renderer="setPassword"/> <a:column name="pwd" align="center" editor="hls810_pwd_ed" prompt="密码" renderer="setPassword"/>
<a:column name="main_flag" editor="checkbox_ed" prompt="宏菱" width="150"/> <a:column name="main_flag" editor="checkbox_ed" prompt="宏菱" width="150"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:init-procedure/>
<a:view>
<script type="text/javascript"><![CDATA[
function hls810_signer_add(){
$('hls810_signer_result_gd').showEditorByRecord($('hls810_signer_result_ds').create());
}
function hls810_signer_del(){
$('hls810_signer_result_gd').remove();
}
function hls810_signer_save(){
$('hls810_signer_result_ds').submit();
}
]]></script>
<a:dataSets>
<a:dataSet id="signer_category_ds" lookupCode="HL_SIGNER_CATEGORY"/>
<a:dataSet id="indentity_type_ds" lookupCode="HL_INDENTITY_TYPE"/>
<a:dataSet id="sign_type_ds" lookupCode="HL_SIGN_TYPE"/>
<a:dataSet id="hls810_signer_query_ds" autoCreate="true">
<a:fields>
<a:field name="templet_id" defaultValue="${/parameter/@templet_id}"/>
</a:fields>
</a:dataSet>
<a:dataSet id="hls810_signer_result_ds" autoQuery="true" model="hls.HLS810.hls_doc_file_templet_signer" queryDataSet="hls810_signer_query_ds" queryUrl="${/request/@context_path}/autocrud/hls.HLS810.hls_doc_file_templet_signer/query?templet_id=${/parameter/@templet_id}" selectable="true">
<a:fields>
<a:field name="templet_id" defaultValue="${/parameter/@templet_id}"/>
<a:field name="enable_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
<a:field name="auto_sign" checkedValue="Y" defaultValue="N" uncheckedValue="N"/>
<a:field name="signer_category_desc" displayField="code_value_name" options="signer_category_ds" returnField="signer_category" valueField="code_value"/>
<a:field name="indentity_type_desc" displayField="code_value_name" options="indentity_type_ds" returnField="indentity_type" valueField="code_value"/>
<a:field name="sign_type_desc" displayField="code_value_name" options="sign_type_ds" returnField="sign_type" valueField="code_value"/>
</a:fields>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:gridButton click="hls810_signer_add" text="新增"/>
<a:gridButton click="hls810_signer_del" text="删除"/>
<a:gridButton click="hls810_signer_save" text="HLS.SAVE"/>
</a:screenTopToolbar>
<a:grid id="hls810_signer_result_gd" bindTarget="hls810_signer_result_ds" height="320" navBar="true" width="790">
<a:columns>
<a:column name="signer_category_desc" align="center" editor="hls810_signer_combox" prompt="签署对象"/>
<a:column name="indentity_type_desc" align="center" editor="hls810_signer_combox" prompt="签署人签约类别"/>
<a:column name="key_word" align="center" editor="text_ed" prompt="关键字"/>
<a:column name="auto_sign" editor="hls810_signer_checked" prompt="是否自动签署" width="50"/>
<a:column name="sign_order" align="center" editor="text_ed" prompt="签署顺序"/>
<a:column name="sign_type_desc" align="center" editor="hls810_signer_combox" prompt="签署类型"/>
<a:column name="enable_flag" editor="hls810_signer_checked" prompt="启用" width="50"/>
</a:columns>
<a:editors>
<a:textField id="text_ed"/>
<a:checkBox id="hls810_signer_checked"/>
<a:comboBox id="hls810_signer_combox"/>
</a:editors>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:ns1="leaf.application.action" xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<s:server-script import="app/app_login_check.js"><![CDATA[
function con_contract_query() {
var contract_list_details;
try {
var contract_list_bm = $bm('wx.WX100.con_contract_query');
var contract_list_map;
var inputData = $ctx.parameter.inputData;
if (inputData == null){
contract_list_map = contract_list_bm.queryAsMap({
id_no:$ctx.parameter.idNo,
id_type:$ctx.parameter.IdType
});
}else{
contract_list_map = contract_list_bm.queryAsMap({
id_no:$ctx.parameter.idNo,
id_type:$ctx.parameter.IdType,
contract_number:$ctx.parameter.contract_number
});
}
contract_list_details = contract_list_map.getChildren();
$ctx.parameter.return_status = '0';
$ctx.parameter.return_message = '执行成功';
} catch (e) {
$ctx.success = "true";
$ctx.parameter.return_status = '1';
$ctx.parameter.return_message = String(e);
}
//返回结果
var result = {
code: $ctx.parameter.return_status,
message: $ctx.parameter.return_message,
unSignContracts: []
};
var unSignContracts = result.unSignContracts;
if (contract_list_details) {
for (var i = 0;i < contract_list_details.length;i++) {
var contract_list_detail = contract_list_details[i];
var contract_id = contract_list_detail.contract_id;
var ec_sign_type = contract_list_detail.ec_sign_type;
if(ec_sign_type == 'NEW'||ec_sign_type == 'INITIATE' ||ec_sign_type == 'SIGNING') {
var signFiles = [];
//未完成签署附件信息表查询
var file_list_bm = $bm('wx.WX100.con_file_list_query');
var file_list_map = file_list_bm.queryAsMap({
contract_id: contract_id,
id_no: $ctx.parameter.idNo,
id_type: $ctx.parameter.IdType
});
var file_list_details = file_list_map.getChildren();
for (var j = 0; j < file_list_details.length; j++) {
signFiles.push({
fileName: file_list_details[j].file_name,
orderSeq: file_list_details[j].order_seq
});
}
unSignContracts.push({
"contractNumber": contract_list_detail.contract_number,
"telentName": contract_list_detail.bp_id_tenant_n,
"agentName": contract_list_detail.bp_id_agent_level1_n,
"serialNo": contract_list_detail.machine_number,
"contractStatus": contract_list_detail.contract_status_n,
"esignStatus": contract_list_detail.ec_sign_type_n,
"brand": contract_list_detail.brand_id_n,
"modelNo": contract_list_detail.modelcd,
"totalTimes": contract_list_detail.lease_times,
"signAmt": contract_list_detail.total_sign,
"signUrl":contract_list_detail.sign_url,
"signFiles": signFiles
});
}
}
}
$ctx.parameter.json = JSON.stringify(result);
}
if ($ctx.parameter.return_status != 'E' && $ctx.parameter.return_status != 'TIMEOUT') {
con_contract_query();
}
]]></s:server-script>
</a:init-procedure>
<a:service-output output="/parameter/@json"/>
</a:service>
<?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);
importPackage(Packages.com.hand.elecon.httpost);
var up_file_token_url = 'http://hlsapp.hand-china.com/hl_dr_dev/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password=admin'; //文件上传获取token的地址
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.19-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;
}
//按日期创建目录
function getDatePath() {
set_parameter_file_path();
//var file_path = $ctx.parameter.pdf_path; //file_path = c:/hls_test_files/content_files/
var file_path = 'd:/hl_test_files/content_files/'; //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/
}
//系统参数获取
function info_query(parameter_code) {
var info = new Object();
var data = null;
var parameter_map = $bm('wx.WX100.sys_parameter_value').queryAsMap({
parameter_code:parameter_code
});
var data = parameter_map.getChildren();
info.code_value = data[0].code_value;
return info;
}
//依据合同文本签署人定义存储签署人信息
var ele_contract_signer_bm = $bm('wx.WX100.con_ele_contract_signer_save');
ele_contract_signer_bm.update({
contract_id: $ctx.parameter.contract_id
});
//第一步生成合同文本
$bm('cont.CON505.con_ele_contract_create_content').update({
contract_id: $ctx.parameter.contract_id,
content_type: 'NORMAL'
});
var datePath = getDatePath();
FileUtils.forceMkdir(new File(datePath)); //根据日期创建目录
$ctx.parameter.batch_flag = 'Y';
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();
//所有文件
var conFileList = [];
//签署人
var signer = [];
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);
}
// 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
});
}
}
//文件列表
var con_ele_unsigned_file_bm = $bm('wx.WX100.con_ele_unsigned_file_query');
var con_ele_unsigned_file_map = con_ele_unsigned_file_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id
});
var con_ele_unsigned_file_data = con_ele_unsigned_file_map.getChildren();
for (var n = 0; n < con_ele_unsigned_file_data.length; n++){
conFileList.push({
"fileUrl": con_ele_unsigned_file_data[n].file_path,
"fileName": con_ele_unsigned_file_data[n].file_name,
"fileSize": con_ele_unsigned_file_data[n].file_size
});
}
//合同签署人信息
var ele_signer_bm = $bm('wx.WX100.con_ele_contract_signer_query');
var ele_signer_map = ele_signer_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id
});
var ele_signer_data = ele_signer_map.getChildren();
var userInfoList = [];
println(ele_signer_data.length);
for (var k = 0 ; k < ele_signer_data.length;k++){
var signer_record_data = ele_signer_data[k];
if(signer_record_data.signer_category == 'TENANT_NP' || signer_record_data.signer_category == 'TENANT_SP' || signer_record_data.signer_category =='GUARANTOR_NP' || signer_record_data.signer_category =='GUARANTOR_SP'){
userInfoList.push({
"idNo":signer_record_data.id_no,
"name":signer_record_data.bp_name,
"mobile":signer_record_data.mobile
});
}else if (signer_record_data.signer_category == 'TENANT_ORG_SEAL'){
var ele_org_signer_map = ele_signer_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id,
signer_category:'TENANT_ORG_SIGN'
});
var ele_org_signer_data = ele_org_signer_map.getChildren();
var agentName = ele_org_signer_data[0].bp_name;
var agentIdNo = ele_org_signer_data[0].id_no;
var mobile = ele_org_signer_data[0].mobile;
userInfoList.push({
"idNo":signer_record_data.id_no,
"name":signer_record_data.bp_name,
"agentIdNo":agentIdNo,
"agentName":agentName,
"mobile":mobile,
"legalName":agentName,
"legalIdNo":agentIdNo,
"agentType":"2"
});
}else if(signer_record_data.signer_category == 'GUARANTOR_ORG_SEAL'){
var ele_org_signer_map = ele_signer_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id,
signer_category:'GUARANTOR_ORG_SIGN'
});
var ele_org_signer_data = ele_org_signer_map.getChildren();
var agentName = ele_org_signer_data[0].bp_name;
var agentIdNo = ele_org_signer_data[0].id_no;
var mobile = ele_org_signer_data[0].mobile;
userInfoList.push({
"idNo":signer_record_data.id_no,
"name":signer_record_data.bp_name,
"agentIdNo":agentIdNo,
"agentName":agentName,
"mobile":mobile,
"legalName":agentName,
"legalIdNo":agentIdNo,
"agentType":"1"
});
}else if(signer_record_data.signer_category == 'AGENCY_STORE_SEAL'){
var ele_org_signer_map = ele_signer_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id,
signer_category:'AGENCY_STORE_SIGN'
});
var ele_org_signer_data = ele_org_signer_map.getChildren();
var agentName = ele_org_signer_data[0].bp_name;
var agentIdNo = ele_org_signer_data[0].id_no;
var mobile = ele_org_signer_data[0].mobile;
userInfoList.push({
"idNo":signer_record_data.id_no,
"name":signer_record_data.bp_name,
"agentIdNo":agentIdNo,
"agentName":agentName,
"mobile":mobile,
"legalName":agentName,
"legalIdNo":agentIdNo,
"agentType":"1"
});
}
}
var ele_contract_signer_map = ele_contract_signer_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id
});
var ele_contract_signer_data = ele_contract_signer_map.getChildren();
for (var k = 0 ; k < ele_contract_signer_data.length;k++){
var signerFileList = [];
var signer_record_data = ele_contract_signer_data[k];
var con_ele_signer_id = signer_record_data.con_ele_signer_id;
var ele_signer_file_bm = $bm('wx.WX100.con_ele_signer_file_query');
var ele_signer_file_map = ele_signer_file_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id,
con_ele_signer_id:con_ele_signer_id
});
var ele_signer_file_data = ele_signer_file_map.getChildren();
if (ele_signer_file_data.length == 0){continue};
for (var h = 0; h < ele_signer_file_data.length; h++){
signerFileList.push({
"fileName":ele_signer_file_data[h].file_name,
"fileUrl":ele_signer_file_data[h].file_path,
"fileSize":ele_signer_file_data[h].file_size
});
}
signer.push({
"idNo":signer_record_data.id_no,
"idType":signer_record_data.id_type,
"accountType":signer_record_data.signer_category,
"signOrder":signer_record_data.sign_order,
"key":signer_record_data.key_word,
"autoExecute":signer_record_data.auto_sign,
"signType":signer_record_data.sign_type,
"signerFileList":signerFileList
})
}
//调用中台签署流程
var info = info_query('HL_SIGN_FLOW_CREATE');
var httpUrl = info.code_value;
var signParam = {
contractNo:$ctx.parameter.contract_id,
userInfo:userInfoList,
conFileList:conFileList,
signer:signer
}
var logs_bm = $bm('wx.WX100.con_ele_savelogs');
try {
var token_sign_result = EleFileUpHttpPost.post(up_file_token_url, null, null);
} catch (e) {
raise_app_error('上传文件获取token失败,请联系技术人员检查!');
}
println(token_sign_result);
var token_sign_result_ob = JSON.parse(token_sign_result);
var access_sign_token = token_sign_result_ob.access_token;
var result = EleFileUpHttpPost.post(httpUrl, JSON.stringify(signParam), access_sign_token);
//var result = new HttpRequest().sendPost(httpUrl, JSON.stringify(signParam));
logs_bm.insert({
contract_id:$ctx.parameter.contract_id,
httpurl:httpUrl,
jsonPut:JSON.stringify(signParam),
jsonResult:result,
tokenResult:token_sign_result
});
var result_ob = JSON.parse(result); //根据返回参数形式再定
if (result_ob.code != 0) {
//rollback
$bm('wx.WX100.rollback').update();
raise_app_error('发起签约失败,请联系技术人员检查!');
}else if(result_ob.code == 0){
var flow_id = result_ob.flowId;
var flow_update_bm = $bm('wx.WX100.con_ele_flow_update');
flow_update_bm.update({
contract_id:$ctx.parameter.contract_id,
flow_id:flow_id
})
var sign_url_list = result_ob.signUrlList;
var ele_con_info_bm = $bm('wx.WX100.con_ele_con_info_update');
for(var i = 0 ; i < sign_url_list.length; i++){
ele_con_info_bm.update({
contract_id:$ctx.parameter.contract_id,
id_no:sign_url_list[i].idNo,
sign_url:sign_url_list[i].signUrl
})
}
}
]]></s:server-script>
</a:init-procedure>
</a:service>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:ns1="leaf.application.action" xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<s:server-script><![CDATA[
importPackage(java.io);
importPackage(Packages.java.util);
function con_sign_status_update() {
try {
var signer_status_update_bm = $bm('wx.WX100.con_ele_signer_status_update');
//个人签署完成
if ($ctx.parameter.action == 'SIGN_FLOW_UPDATE'){
signer_status_update_bm.update({
flow_id:$ctx.parameter.flowId,
id_no:$ctx.parameter.idNo,
sign_time:$ctx.parameter.signTime,
sign_result:$ctx.parameter.signResult
});
$ctx.parameter.return_status = '0';
$ctx.parameter.return_message = '修改成功';
}
//合同签署完成
else if($ctx.parameter.action == 'SIGN_FLOW_FINISH'){
var docsList = $ctx.parameter.docsList;
for (var i = 0; i < conFileList.length ; i++){
signer_status_update_bm.insert({
flow_id:$ctx.parameter.flowId,
flow_status:$ctx.parameter.flowStatus,
end_time:$ctx.parameter.endTime,
file_id:docsList[i].fileId,
file_name:docsList[i].fileName,
file_download_url:docsList[i].fileUrl
});
}
$ctx.parameter.return_status = '0';
$ctx.parameter.return_message = '修改成功';
}
}catch(e)
{
$ctx.success = "true";
$ctx.parameter.return_status = '1';
$ctx.parameter.return_message = $ctx.get('/error/@message') || String(e);
}
var result = {
code: $ctx.parameter.return_status,
message: $ctx.parameter.return_message
};
$ctx.parameter.json = JSON.stringify(result);
}
con_sign_status_update();
]]></s:server-script>
<p:echo/>
</a:init-procedure>
<a:service-output output="/parameter/@json"/>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:ns1="leaf.application.action" xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<s:server-script><![CDATA[
importPackage(Packages.deron_sms_interface);
function send_sms() {
try {
if($ctx.parameter.mobile){
//step1 配置信息
var sms_server_bm = $bm('sys.SYS403.sys_sms_server');
var sms_server_result = sms_server_bm.queryAsMap({});
var sms_server_records = sms_server_result.getChildren();
var server_url = sms_server_records[0].server_url;
var CorpID = sms_server_records[0].serviceid;
var Pwd = sms_server_records[0].password;
// step2 生成短信
var verify_code_sms_bm = $bm('wx.WX100.wx_verify_code_sms');
verify_code_sms_bm.insert({
phone_number: $ctx.parameter.mobile
});
var sms_list_bm = $bm('sys.SYS401.sys_sms_list');
if ($ctx.parameter.sms_id) {
var sms_list_result = sms_list_bm.queryAsMap({
sms_id: $ctx.parameter.sms_id
});
var sms_list_records = sms_list_result.getChildren();
}
for (var i = 0;i < sms_list_records.length;i++) {
var Phones = sms_list_records[i].phone_number;
var content = sms_list_records[i].text;
var sms_id = sms_list_records[i].sms_id;
try {
var sms = new SendSms();
var result = sms.doSend(server_url, CorpID, Pwd, content, Phones);
var req_response = result.toString();
// req_response = parseInt(req_response);
/* var json_result = {
"sendflag": result
};
$ctx.parameter.json = JSON.stringify(json_result);*/
} catch (e) {
println("抛出异常:" + e);
}
// 发送短信后,逻辑处理
$bm('nt.sys_sms_list').update({
sms_id: sms_id,
req_response: req_response
});
}
$ctx.parameter.return_status = '0';
$ctx.parameter.return_message = '执行成功';
}
} catch (e) {
$ctx.success = "true";
$ctx.parameter.return_status = '1';
$ctx.parameter.return_message = String(e);
}
var result = {
code: $ctx.parameter.return_status,
message: $ctx.parameter.return_message,
data:{}
};
var data = result.data;
data["mobile"] = $ctx.parameter.mobile;
data["verifyCode"] = $ctx.parameter.verify_code.toString();
$ctx.parameter.json = JSON.stringify(result);
}
send_sms();
]]></s:server-script>
</a:init-procedure>
<a:service-output output="/parameter/@json"/>
</a:service>
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