Commit a33c3bd9 authored by congzhao's avatar congzhao

Merge branch '建机电子合同开发' into develop

# Conflicts:
#	src/main/webapp/modules/cont/CON_ET001/con_early_termination_et_detail.lview
#	src/main/webapp/modules/hls/HLS213N/hls_bp_master_create.lview
#	src/main/webapp/modules/hls/HLS214N/hls_bp_master_req_modify.lview
parents a899b608 f1338bb8
...@@ -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,8 @@ ...@@ -62,6 +62,8 @@
<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="sp_sign_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,18 +181,19 @@ ...@@ -181,18 +181,19 @@
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>
<bm:data-filters> <bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t.contract_id=${@contract_id}"/> <bm:data-filter enforceOperations="query" expression="t.contract_id=${@contract_id} and exists (select 1 from con_clause_templet ct where ct.templet_id = t.templet_id and (ct.ele_content_flag = 'N' or ct.ele_content_flag is null))"/>
</bm:data-filters> </bm:data-filters>
</bm:model> </bm:model>
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
m.table_pk_value = lt.templet_id AND m.table_pk_value = lt.templet_id AND
lt.templet_id = t.doc_template_id AND lt.templet_id = t.doc_template_id AND
t.doc_plugin_flag = 'Y' AND t.doc_plugin_flag = 'Y' AND
t.templet_usage in ('CON_SALE', 'CONTRACT', 'CHANGE_REQ') and t.templet_usage in ('CON_SALE', 'CONTRACT', 'CHANGE_REQ','AGENT_CONTRACT') and
t.templet_id = cc.templet_id AND t.templet_id = cc.templet_id AND
( (
cc.content_id =${/parameter/@content_id} OR cc.content_id =${/parameter/@content_id} OR
...@@ -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
update CON_CONTRACT_ELE_FLOW cf
set cf.revoke_flag = 'Y',
cf.last_update_date = sysdate
where cf.contract_id = ${@contract_id}
and cf.ele_flow_id = ${@flow_id};
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 *
from (select cf.ele_flow_id, cf.contract_id
FROM CON_CONTRACT_ELE_FLOW cf
where cf.ele_flow_type in ('CE', 'AE')
and cf.revoke_flag is null
union all
select ce.ele_flow_id, ce.contract_id
from con_contract_ele_flow ce
where ce.ele_flow_type = 'ET'
and ce.revoke_flag is null
and ce.flow_status is null) 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 = nvl(${/session/@user_id},'1')
where c.contract_id = ${@contract_id};
delete from con_contract_ele_signer cs where cs.contract_id = ${@contract_id};
delete from CON_CONTRACT_ELE_FLOW t where t.ele_flow_type in ('CE','AE','ET') and t.contract_id = ${@contract_id};
commit;
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="ele_flow_id" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ELE_FLOW_ID"/>
<bm:field name="contract_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"?>
<!--
$Author:zc
$Date: 2020年11月19日 09点37分
$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_et_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},
p_ccr_document_type => ${@ccr_document_type}
);
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zc
$Date: 2020年11月27日
$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
hls_bp_master_pkg.first_add_signer_agent(p_bp_id => ${@bp_id}, p_user_id => ${/session/@user_id});
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</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"?>
<!--
$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,con_contract_ele_signer cs,con_contract_bp cb,hls_doc_file_templet_signer hs
where t.contract_id = ${@contract_id}
and t.templet_id = cf.templet_id
and t.clause_usage = 'AGENT_CONTRACT'
and cf.con_ele_signer_id = ${@con_ele_signer_id}
and cf.con_ele_signer_id = cs.con_ele_signer_id
and t.con_contract_bp_id = cb.record_id
and cb.bp_id = cs.bp_id
and cf.templet_code != 'SETTLE_ADVANCE_OEC'
and cs.templet_signer_id = hs.templet_signer_id
and hs.signer_category in ('GUARANTOR_NP','GUARANTOR_SP','GUARANTOR_ORG_SIGN','GUARANTOR_ORG_SEAL')
union all
select t.content_id
from con_contract_content t,con_ele_signer_file cf,con_contract_ele_signer cs,hls_doc_file_templet_signer hs
where t.contract_id = ${@contract_id}
and t.templet_id = cf.templet_id
and t.clause_usage = 'AGENT_CONTRACT'
and cf.con_ele_signer_id = ${@con_ele_signer_id}
and cf.con_ele_signer_id = cs.con_ele_signer_id
and cf.templet_code != 'SETTLE_ADVANCE_OEC'
and cs.templet_signer_id = hs.templet_signer_id
and hs.signer_category not in ('GUARANTOR_NP','GUARANTOR_SP','GUARANTOR_ORG_SIGN','GUARANTOR_ORG_SEAL'))
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<!-- (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}
and cf.templet_code != 'SETTLE_ADVANCE_OEC')-->
\ No newline at end of file
<?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,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 ct.ele_content_flag = 'Y'
and ct.enabled_flag = 'Y'
and ct.templet_usage = 'AGENT_CONTRACT'
and fm.table_pk_value in
(select t.content_id
from con_contract_content t
where t.contract_id = ${@contract_id}
and t.clause_usage != 'CHANGE_REQ')
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="query">
<bm:query-sql><![CDATA[
select decode(v.bp_count, 0, '1', '0') existsFlag
from ( select (select count(1)
from hls_bp_master h, hls_bp_master_signer hb
where h.social_code = ${@social_code}
and h.bp_name = ${@bp_name}
and hb.id_card = ${@agent_id_no}
and hb.name = ${@agent_name}
and h.bp_id = hb.bp_id
and h.enabled_flag = 'Y'
and h.bp_class = 'ORG') +
(select count(1)
from HLS_BP_MASTER t
where t.enabled_flag = 'Y'
and t.bp_class = 'ORG'
and t.bp_type = 'AGENT'
and t.social_code = ${@social_code}
and t.bp_name = ${@bp_name}
and t.id_card_no_ag = ${@agent_id_no}
and t.bp_name_ag = ${@agent_name}) bp_count from dual) v
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="existsFlag"/>
</bm:fields>
</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="times"/>
<bm:field name="due_year"/>
<bm:field name="due_date"/>
<bm:field name="cf_item"/>
<bm:field name="due_amount"/>
<bm:field name="received_amount"/>
<bm:field name="cf_status"/>
<bm:field name="cf_status_n"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select cc.times, --期数
to_char(cc.due_date, 'YYYY') due_year, --支付年
to_char(cc.due_date, 'MM-dd') due_date, --支付日期
(select h.description from hls_cashflow_item h
where h.cf_item = cc.cf_item
and h.enabled_flag = 'Y'
and rownum =1) cf_item, --项目
to_char(nvl(cc.due_amount, 0),
'FM9,999,999,999,990.00') due_amount, --应付金额
to_char(nvl(cc.due_amount, 0)-nvl(cc.received_amount, 0),
'FM9,999,999,999,990.00') received_amount, --已付金额
(case
when cc.write_off_flag = 'FULL' then
'PAID'
when cc.overdue_status = 'Y' then
'OVERDUE'
else
'TOPAY'
end) as cf_status,
(case
when cc.write_off_flag = 'FULL' then
'已支付'
when cc.overdue_status = 'Y' then
'已逾期'
else
'待支付'
end) as cf_status_n --支付状态
from con_contract_cashflow cc
where cc.contract_id = ${@contract_id}
and ((cc.cf_type = 1 and cc.cf_item in (1,200,250)) or (cc.cf_item = 11 and cc.cf_type =11)
or (cc.cf_item = 8 and cc.cf_type = 8) or (cc.cf_item = 9 and cc.cf_type = 9))
and cc.cf_direction = 'INFLOW'
and cc.cf_status = 'RELEASE'
order by cc.cf_item,cc.times
]]></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="query">
<bm:query-sql><![CDATA[
select *
from (select t1.contract_id,
t1.contract_number,
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,
(select hm.id_card_no
from hls_bp_master hm
where hm.bp_id = t1.bp_id_tenant) id_card_no_tenant,
(select hm.bp_class
from hls_bp_master hm
where hm.bp_id = t1.bp_id_tenant) bp_id_tenant_type,
t1.bp_id_agent_level1,
t1.sign_type,
(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 i.machine_number
FROM con_contract_lease_item i
WHERE i.contract_id = t1.contract_id
AND i.equipment_type = 'MAIN') machine_number, --机号
t1.contract_status,
(select v.code_value_name
from sys_code_values_v v
where v.code = decode(t1.sign_type,
'PAPER_SIGN',
'CON_PAPER_SIGN_STATUS',
'ELE_SIGN',
'CON_ELE_SIGN_STATUS')
and v.code_value = t1.contract_status
and v.code_enabled_flag = 'Y'
and v.code_value_enabled_flag = 'Y') AS contract_status_n,
(select ci.modelcd
from con_contract_lease_item ci
where ci.contract_id = t1.contract_id
and ci.equipment_type = 'MAIN') modelcd, --机型
to_char(t1.lease_start_date, 'yyyy-mm-dd') lease_start_date, --合同开始日期
(select to_char(ccc.due_date,'yyyy-MM-dd') from con_contract_cashflow ccc
where ccc.contract_id = t1.contract_id
and ((ccc.cf_item = 1 and ccc.cf_type in (1,200,250)) or (ccc.cf_item = 11 and ccc.cf_type =11)
or (ccc.cf_item = 8 and ccc.cf_type = 8) or (ccc.cf_item = 9 and ccc.cf_type = 9))
and ccc.cf_direction = 'INFLOW'
and ccc.cf_status = 'RELEASE'
and ccc.times = (select max(cc.times) from con_contract_cashflow cc where cc.contract_id = ccc.contract_id
and ((cc.cf_item = 1 and cc.cf_type in (1,200,250)) or (cc.cf_item = 11 and cc.cf_type =11)
or (cc.cf_item = 8 and cc.cf_type = 8) or (cc.cf_item = 9 and cc.cf_type = 9))
and cc.cf_direction = 'INFLOW'
and cc.cf_status = 'RELEASE')
and rownum =1) lease_end_date, --合同结束日期
(select to_char(cc.due_date, 'dd')
from con_contract_cashflow cc
where cc.contract_id = t1.contract_id
and cc.cf_item = 1
and cc.cf_direction = 'INFLOW'
and cc.cf_status = 'RELEASE'
and rownum = 1) due_day, --还款日
(NVL(t1.down_payment, 0) + NVL(t1.residual_value, 0) +
NVL(t1.total_rental, 0)) total_sign, --总金额
t1.bank_branch_num, --还款银行账号
t1.bank_account_name, --还款账户名称
(select ba.bank_full_name
from hls_bp_master_bank_account ba
where ba.bank_account_id = t1.bank_account_id) bank_full_name, --还款银行名称
t1.lease_times, --期数
(select to_char(sum(cc.due_amount), 'FM9,999,999,999,990.00')
from con_contract_cashflow cc
where cc.contract_id = t1.contract_id
and ((cc.cf_type = 1 and cc.cf_item in (1,200,250)) or (cc.cf_item = 11 and cc.cf_type =11)
or (cc.cf_item = 8 and cc.cf_type = 8) or (cc.cf_item = 9 and cc.cf_type = 9))
and cc.cf_direction = 'INFLOW'
and cc.cf_status = 'RELEASE') due_amount_all, --应还总额
(SELECT cs.sign_url
from con_contract_ele_signer cs
where cs.contract_id = t1.contract_id
and ((${@account_type} = 'AG' and
(cs.id_no =
(select hm.social_code
from hls_bp_master hm, con_contract_bp cb
where hm.bp_id = cb.bp_id
and cb.contract_id = t1.contract_id
and cb.id_card_no_leg = ${@id_no}) or
cs.id_no =
(select hm.social_code
from hls_bp_master hm, hls_bp_master_signer hs
where hm.bp_id = hs.bp_id
and hm.bp_id = t1.bp_id_tenant
and hs.id_card = ${@id_no}))) or
(${@account_type} != 'AG' and cs.id_no = ${@id_no}))
and rownum = 1) sign_url
from con_contract t1
where t1.data_class = 'NORMAL'
and t1.sign_contract_status = decode(t1.contract_status,'NEW','SIGN',t1.sign_contract_status)
and t1.contract_status in
(select v.code_value
from sys_code_values_v v
where v.code = decode(t1.sign_type,
'PAPER_SIGN',
'CON_PAPER_SIGN_STATUS',
'ELE_SIGN',
'CON_ELE_SIGN_STATUS')
and v.code_enabled_flag = 'Y'
and v.code_value_enabled_flag = 'Y')
and ((${@account_type} = 'PE' and exists
(select 1
from con_contract_bp ccb, hls_bp_master hb
where ccb.bp_id = hb.bp_id
and ccb.contract_id = t1.contract_id
and (ccb.bp_category in ('TENANT', 'GUARANTOR') and
(ccb.id_card_no = ${@id_no} or (ccb.id_no_sp = ${@id_no} and ccb.sp_sign_flag = 'Y'))))) or
(${@account_type} = 'AG' and exists
(select 1
from hls_bp_master_signer hs
where hs.hls_bp_signer_id = t1.signer
and hs.id_card = ${@id_no})
and exists (select 1 from hls_bp_master hbm
where hbm.bp_id = t1.bp_id_tenant
and hbm.social_code = ${@organization_id})
and exists (select 1 from con_contract_ele_signer cs
where cs.id_no = ${@id_no}
and cs.contract_id = t1.contract_id)) or
(${@account_type} = 'AG' and exists
(select 1
from hls_bp_master_signer hs,con_contract_change_req cr
where hs.hls_bp_signer_id = cr.signer
and cr.change_req_id = t1.contract_id
and hs.id_card = ${@id_no})
and exists (select 1 from con_contract_ele_signer cs
where cs.id_no = ${@id_no}
and cs.contract_id = t1.contract_id)
) or
(${@account_type} = 'AG' and exists
(select 1
from con_contract_bp cb,hls_bp_master hbm
where cb.contract_id = t1.contract_id
and cb.bp_category = 'GUARANTOR'
and cb.bp_class = 'ORG'
and cb.bp_id = hbm.bp_id
and hbm.social_code = ${@organization_id}
and cb.id_card_no_leg = ${@id_no})) or
(${@account_type} = 'LP' and exists
(select 1
from con_contract_bp cb, hls_bp_master hb
where cb.bp_id = hb.bp_id
and cb.contract_id = t1.contract_id
and hb.social_code = ${@id_no})))
) 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="sign_type"/>
<bm:field name="bp_id_tenant_type"/>
<bm:field name="bp_id_agent_level1_n"/>
<bm:field name="machine_number"/>
<bm:field name="contract_status"/>
<bm:field name="contract_status_n"/>
<bm:field name="modelcd"/>
<bm:field name="lease_start_date"/>
<bm:field name="lease_end_date"/>
<bm:field name="due_day"/>
<bm:field name="total_sign"/>
<bm:field name="bank_full_name"/>
<bm:field name="bank_account_name"/>
<bm:field name="bank_branch_num"/>
<bm:field name="lease_times"/>
<bm:field name="due_amount_all"/>
<bm:field name="sign_url"/>
</bm:fields>
<bm:query-fields>
<bm:query-field name="contract_number" queryExpression="v.contract_number like '%'||${@contract_number}||'%' "/>
<bm:query-field name="contract_status" queryExpression="v.contract_status_n = ${@contract_status}"/>
</bm:query-fields>
</bm:model>
\ No newline at end of file
<?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,
decode(t1.ec_sign_type,
'INITIATE',
'待签约',
'SIGNING',
'待签约') 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,
decode(t1.data_class,
'NORMAL',
'合同签约',
'CHANGE_REQ',
'提前结清') 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, --期数
t1.lease_start_date, --起租日
(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 ((${@account_type} = 'AG' and
(cs.id_no =
(select hm.social_code
from hls_bp_master hm, con_contract_bp cb
where hm.bp_id = cb.bp_id
and cb.contract_id = t1.contract_id
and cb.id_card_no_leg = ${@id_no}) or
cs.id_no =
(select hm.social_code
from hls_bp_master hm, hls_bp_master_signer hs
where hm.bp_id = hs.bp_id
and hm.bp_id = t1.bp_id_tenant
and hs.id_card = ${@id_no}))) or
(${@account_type} != 'AG' and cs.id_no = ${@id_no}))
and rownum = 1) sign_url,
(SELECT nvl(cs.ec_sign_status, 'N')
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) userSignStatus
from con_contract t1
where t1.data_class in ('NORMAL','CHANGE_REQ')
and t1.ec_sign_type in ('INITIATE', 'SIGNING')
and t1.sign_type = 'ELE_SIGN'
and exists (select 1 from con_contract_ele_flow cf where cf.contract_id = t1.contract_id)
and ((${@account_type} = 'PE' and exists
(select 1
from con_contract_bp ccb, con_contract_ele_signer cs
where ccb.bp_id = cs.bp_id
and ccb.contract_id = t1.contract_id
and ccb.bp_category in ('TENANT', 'GUARANTOR')
and (ccb.id_card_no = ${@id_no} or
(ccb.id_no_sp = ${@id_no} and ccb.sp_sign_flag = 'Y')))) or
(${@account_type} = 'AG' and exists
(select 1
from hls_bp_master_signer hs
where hs.hls_bp_signer_id = t1.signer
and hs.id_card = ${@id_no})
and exists (select 1 from hls_bp_master hbm
where hbm.bp_id = t1.bp_id_tenant
and hbm.social_code = ${@organization_id})
and exists (select 1 from con_contract_ele_signer cs
where cs.id_no = ${@id_no}
and cs.contract_id = t1.contract_id)) or
(${@account_type} = 'AG' and exists
(select 1
from hls_bp_master_signer hs,con_contract_change_req cr
where hs.hls_bp_signer_id = cr.signer
and cr.change_req_id = t1.contract_id
and hs.id_card = ${@id_no})
and exists (select 1 from hls_bp_master hbm
where hbm.bp_id = t1.bp_id_tenant
and hbm.social_code = ${@organization_id})
and exists (select 1 from con_contract_ele_signer cs
where cs.id_no = ${@id_no}
and cs.contract_id = t1.contract_id)
) or
(${@account_type} = 'AG' and exists
(select 1
from con_contract_bp cb,hls_bp_master hbm
where cb.contract_id = t1.contract_id
and cb.bp_category = 'GUARANTOR'
and cb.bp_class = 'ORG'
and cb.bp_id = hbm.bp_id
and hbm.social_code = ${@organization_id}
and cb.id_card_no_leg = ${@id_no})) or
(${@account_type} = 'LP' and exists
(select 1
from con_contract_bp cb, hls_bp_master hb
where cb.bp_id = hb.bp_id
and cb.contract_id = t1.contract_id
and hb.social_code = ${@id_no})))) 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="lease_start_date"/>
<bm:field name="total_sign"/>
<bm:field name="sign_url"/>
<bm:field name="userSignStatus"/>
</bm:fields>
<bm:query-fields>
<bm:query-field name="contract_number" queryExpression="v.contract_number like &apos;%&apos;||${@contract_number}||&apos;%&apos;"/>
</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="query">
<bm:query-sql><![CDATA[
select decode(v.con_num, 0, 'N', 'Y') statusFlag
from
(select (select count(1)
from con_contract t1
where t1.data_class in ('NORMAL','CHANGE_REQ')
and t1.ec_sign_type in ('INITIATE', 'SIGNING')
and t1.sign_type = 'ELE_SIGN'
and ((${@account_type} = 'PE' and exists
(select 1
from con_contract_bp ccb, hls_bp_master hb
where ccb.bp_id = hb.bp_id
and ccb.contract_id = t1.contract_id
and (ccb.bp_category in ('TENANT', 'GUARANTOR') and
(ccb.id_card_no = ${@id_no} or (ccb.id_no_sp = ${@id_no} and ccb.sp_sign_flag = 'Y'))))) or
(${@account_type} = 'AG' and exists
(select 1
from hls_bp_master_signer hs
where hs.hls_bp_signer_id = t1.signer
and hs.id_card = ${@id_no})
and exists (select 1 from hls_bp_master hbm
where hbm.bp_id = t1.bp_id_tenant
and hbm.social_code = ${@organization_id})
and exists (select 1 from con_contract_ele_signer cs
where cs.id_no = ${@id_no}
and cs.contract_id = t1.contract_id)) or
(${@account_type} = 'AG' and exists
(select 1
from hls_bp_master_signer hs,con_contract_change_req cr
where hs.hls_bp_signer_id = cr.signer
and cr.change_req_id = t1.contract_id
and hs.id_card = ${@id_no})
and exists (select 1 from con_contract_ele_signer cs
where cs.id_no = ${@id_no}
and cs.contract_id = t1.contract_id)
) or
(${@account_type} = 'AG' and exists
(select 1
from con_contract_bp cb,hls_bp_master hbm
where cb.contract_id = t1.contract_id
and cb.bp_category = 'GUARANTOR'
and cb.bp_class = 'ORG'
and cb.bp_id = hbm.bp_id
and hbm.social_code = ${@organization_id}
and cb.id_card_no_leg = ${@id_no})) or
(${@account_type} = 'LP' and exists
(select 1
from con_contract_bp cb, hls_bp_master hb
where cb.bp_id = hb.bp_id
and cb.contract_id = t1.contract_id
and hb.social_code = ${@id_no})))) con_num
from dual) v
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="statusFlag"/>
</bm: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="contract_id"/>
<bm:field name="contract_number"/>
<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:field name="esign_type"/>
<bm:field name="legal_person"/>
<bm:field name="id_card_no_leg"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select distinct t.* from (select
cs.contract_id,
(select c.contract_number from con_contract c where c.contract_id = cs.contract_id) contract_number,
cs.bp_id,
cs.bp_name,
cs.id_type,
cs.id_no,
cs.mobile,
hs.signer_category,
cs.esign_type,
(select nvl(hm.bp_name_leg,hm.legal_person)
from con_contract_bp cb, hls_bp_master hm
where cb.bp_id = hm.bp_id
and cb.contract_id = cs.contract_id
and hm.social_code = cs.id_no
and cb.bp_class = 'ORG') legal_person,
(select hm.id_card_no_leg
from con_contract_bp cb, hls_bp_master hm
where cb.bp_id = hm.bp_id
and cb.contract_id = cs.contract_id
and hm.social_code = cs.id_no
and cb.bp_class = 'ORG') id_card_no_leg
from con_contract_ele_signer cs, hls_doc_file_templet_signer hs,con_contract_content cc,con_clause_templet ct
where cs.templet_signer_id = hs.templet_signer_id
and ct.doc_template_id = hs.templet_id
and ct.templet_id = cc.templet_id
and cs.contract_id = cc.contract_id
and cc.clause_usage = 'AGENT_CONTRACT'
and not exists (select 1
from con_contract_bp cb
where cb.contract_id = cc.contract_id
and hs.signer_category = (cb.bp_category || '_SP')
and cb.sp_sign_flag = 'N'
and cb.id_no_sp = cs.id_no)) 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-field name="esign_type" queryExpression="t.esign_type= ${@esign_type}"/>
<bm:query-field name="id_no" queryExpression="t.id_no= ${@id_no}"/>
</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_esign_type => ${@esign_type},
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="contract_number"/>
<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:field name="esign_type"/>
<bm:field name="legal_person"/>
<bm:field name="id_card_no_leg"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select distinct t.* from (select
cs.contract_id,
(select c.contract_number from con_contract c where c.contract_id = cs.contract_id) contract_number,
cs.bp_id,
cs.bp_name,
cs.id_type,
cs.id_no,
cs.mobile,
hs.signer_category,
cs.esign_type,
(select nvl(hm.bp_name_leg,hm.legal_person)
from con_contract_bp cb, hls_bp_master hm
where cb.bp_id = hm.bp_id
and cb.contract_id = cs.contract_id
and hm.social_code = cs.id_no
and cb.bp_class = 'ORG') legal_person,
(select hm.id_card_no_leg
from con_contract_bp cb, hls_bp_master hm
where cb.bp_id = hm.bp_id
and cb.contract_id = cs.contract_id
and hm.social_code = cs.id_no
and cb.bp_class = 'ORG') id_card_no_leg
from con_contract_ele_signer cs, hls_doc_file_templet_signer hs,con_contract_content cc,con_clause_templet ct
where cs.templet_signer_id = hs.templet_signer_id
and ct.doc_template_id = hs.templet_id
and ct.templet_id = cc.templet_id
and cs.contract_id = cc.contract_id
and cc.clause_usage != 'AGENT_CONTRACT'
and not exists (select 1
from con_contract_bp cb
where cb.contract_id = cc.contract_id
and hs.signer_category = (cb.bp_category || '_SP')
and cb.sp_sign_flag = 'N'
and cb.id_no_sp = cs.id_no)) 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-field name="esign_type" queryExpression="t.esign_type= ${@esign_type}"/>
<bm:query-field name="id_no" queryExpression="t.id_no= ${@id_no}"/>
</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="contract_number"/>
<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,
(select cc.contract_number
from con_contract cc
where cc.contract_id = cs.contract_id
and cc.data_class = 'NORMAL') contract_number,
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
and cs.esign_type = 'CE'
and not exists (select 1
from con_contract_bp cb
where cb.contract_id = cs.contract_id
and cb.sp_sign_flag = 'N'
and hs.signer_category = (cb.bp_category || '_SP')
and cb.id_no_sp = cs.id_no)) 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"?>
<!--
$Author: zc
$Date: 2020年11月20日
$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="ele_flow_id"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select * from (
select c.contract_id, c.ele_flow_id
from con_contract_ele_flow c
where nvl(c.ele_file_dl_flag,'N') = 'N'
and (c.flow_status = 2 or c.flow_status is null)) t1
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
BEGIN
wx_ele_contract_pkg.init_con_atm(p_contract_id => ${@contract_id},
p_file_path => ${@file_url},
p_file_name => ${@file_name},
p_file_length => ${@file_size},
p_user_id => nvl(${/session/@user_id},1));
COMMIT;
END;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
BEGIN
update con_contract_ele_flow cr
set cr.ele_file_dl_flag = 'Y',
cr.last_update_date = sysdate
where cr.ele_flow_id =${@flow_id};
COMMIT;
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field field="contract_id" queryOperator="="/>
<bm:query-field field="ele_flow_id" queryOperator="="/>
</bm:query-fields>
</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="ce_num"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select count(cf.ele_flow_id) ce_num
from con_contract_ele_flow cf
where cf.contract_id = ${@contract_id}
and cf.ele_flow_type = 'CE'
and cf.ele_flow_id is not null
]]></bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
BEGIN
insert into con_contract_ele_flow
(con_ele_flow_id,
contract_id,
ele_flow_type,
ele_flow_id,
creation_date,
created_by,
last_updated_by,
last_update_date)
values
(CON_CONTRACT_ELE_FLOW_S.NEXTVAL,
${@contract_id},
${@esign_type},
${@flow_id},
sysdate,
nvl(${/session/@user_id},1),
nvl(${/session/@user_id},1),
sysdate);
END;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
BEGIN
UPDATE CON_CONTRACT c
SET c.ec_sign_type = 'INITIATE',
c.sign_contract_status = 'SIGNING',
c.sign_type = 'ELE_SIGN',
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="VARCHAR2" datatype="java.lang.String"/>
<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,con_contract_ele_signer cs,con_contract_bp cb,hls_doc_file_templet_signer hs
where t.contract_id = ${@contract_id}
and t.templet_id = cf.templet_id
and cf.con_ele_signer_id = ${@con_ele_signer_id}
and cf.con_ele_signer_id = cs.con_ele_signer_id
and t.con_contract_bp_id = cb.record_id
and cb.bp_id = cs.bp_id
and t.clause_usage != 'AGENT_CONTRACT'
and cf.templet_code != 'SETTLE_ADVANCE_OEC'
and cs.templet_signer_id = hs.templet_signer_id
and hs.signer_category in ('GUARANTOR_NP','GUARANTOR_SP','GUARANTOR_ORG_SIGN','GUARANTOR_ORG_SEAL')
union all
select t.content_id
from con_contract_content t,con_ele_signer_file cf,con_contract_ele_signer cs,hls_doc_file_templet_signer hs
where t.contract_id = ${@contract_id}
and t.templet_id = cf.templet_id
and cf.con_ele_signer_id = ${@con_ele_signer_id}
and cf.con_ele_signer_id = cs.con_ele_signer_id
and t.clause_usage != 'AGENT_CONTRACT'
and cf.templet_code != 'SETTLE_ADVANCE_OEC'
and cs.templet_signer_id = hs.templet_signer_id
and hs.signer_category not in ('GUARANTOR_NP','GUARANTOR_SP','GUARANTOR_ORG_SIGN','GUARANTOR_ORG_SEAL'))
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<!-- (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}
and cf.templet_code != 'SETTLE_ADVANCE_OEC')-->
\ No newline at end of file
<?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 HH24:MI:SS'),
cs.sign_result = ${@sign_result},
cs.last_update_date = sysdate
WHERE cs.contract_id = ${@contract_id}
AND cs.id_no = ${@id_no}
AND cs.esign_type = ${@esign_type};
update con_contract cc
set cc.ec_sign_type = 'SIGNING',
cc.last_update_date = sysdate
where cc.contract_id = ${@contract_id}
and cc.ec_sign_type != 'SIGNED';
END;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
BEGIN
update con_contract_ele_flow cf
set cf.flow_status = ${@flow_status},
cf.end_time = to_date(${@end_time},'yyyy-mm-dd HH24:MI:SS'),
cf.last_update_date = sysdate
where cf.ele_flow_id = ${@flow_id};
update con_contract_ele_signer cs
set cs.ec_sign_status = 'Y',
cs.last_update_date = sysdate
where cs.contract_id = ${@contract_id};
update con_contract cc
set cc.ec_sign_type = 'SIGNED',
cc.sign_contract_status = 'SIGN',
cc.last_update_date = sysdate
where cc.contract_id = ${@contract_id}
and cc.sign_type = 'ELE_SIGN'
and cc.ec_sign_type != 'NEW'
and not exists
(select 1
from con_contract_ele_flow ce
where (ce.flow_status != '2' or ce.flow_status is null)
and ce.contract_id = cc.contract_id);
wx_ele_contract_pkg.downloadEleFile(p_contract_id => ${@contract_id},
p_ele_flow_id => ${@flow_id},
p_user_id => 1,
p_company_id => 1);
COMMIT;
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,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 ct.ele_content_flag = 'Y'
and ct.enabled_flag = 'Y'
and fm.table_pk_value in
(select t.content_id
from con_contract_content t
where t.contract_id = ${@contract_id}
and t.clause_usage != 'AGENT_CONTRACT'
and t.clause_usage != 'CHANGE_REQ')
order by ct.order_seq
]]></bm:query-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="con_ele_signer_id"/>
<bm:field name="contract_number"/>
<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,
(select cc.contract_number
from con_contract cc
where cc.contract_id = cs.contract_id) contract_number,
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
and cs.esign_type = 'ET'
and not exists (select 1
from con_contract_bp cb
where cb.contract_id = cs.contract_id
and cb.sp_sign_flag = 'N'
and hs.signer_category = (cb.bp_category || '_SP')
and cb.id_no_sp = cs.id_no)) t
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
wx_ele_contract_pkg.et_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="delete">
<bm:update-sql><![CDATA[
BEGIN
DELETE FROM con_contract_ele_flow cf
WHERE cf.contract_id = ${@contract_id}
AND cf.ele_flow_type = 'ET';
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}
and cf.templet_code = 'SETTLE_ADVANCE_OEC')
]]></bm:query-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,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 ct.ele_content_flag = 'Y'
and ct.enabled_flag = 'Y'
and fm.table_pk_value in
(select t.content_id
from con_contract_content t
where t.contract_id = ${@contract_id}
and t.clause_usage = 'CHANGE_REQ')
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:fields>
<bm:field name="attachment_id"/>
<bm:field name="file_name"/>
<bm:field name="file_path"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select fa.file_name,fa.file_path,fa.attachment_id
from prj_cdd_item pi,PRJ_CDD_ITEM_CHECK pc,fnd_atm_attachment_multi fm,fnd_atm_attachment fa
where pc.cdd_item_id = pi.cdd_item_id
and fm.table_pk_value = pc.check_id
and fm.attachment_id = fa.attachment_id
and fm.table_name = 'CON_CONTRACT'
and pi.cdd_item in
(select decode(cf.templet_code,
'LEASE_CONTRACT_MASTER_OEC','CONTRACT',
'LEASE_REQUEST_OEC','LEASE_ITEM_REQ',
'LEASE_INFO_OEC','TN_GU_INFO',
'LEASE_SURE_PER_OEC','GUARANTEE_LETTER_OEC',
'LEASE_SURE_SEL_OEC','S_GUARANTEE_LETTER_OEC',
'LEASE_CHECK_OEC','CHECK_INFO',
'LEASE_SURE_PAR_OEC','SPOUSE_COMMITMENT',
'LEASE_SALE_RL_OEC','PUR_CONTRACT',
'LEASE_SALE_YL_OEC','PUR_CONTRACT',
'LEASE_SURE_BUS_OEC','GUARANTEE_LETTER_OEC',
'R_LEASE_CONTRACT_MASTER_OEC','CONTRACT',
'R_LEASE_REQUEST_OEC','LEASE_ITEM_REQ',
'R_LEASE_INFO_OEC','TN_GU_INFO',
'R_LEASE_SURE_PER_OEC','GUARANTEE_LETTER_OEC',
'R_LEASE_SURE_SEL_OEC','S_GUARANTEE_LETTER_OEC',
'R_LEASE_SURE_BUS_OEC','GUARANTEE_LETTER_OEC',
'R_LEASE_CHECK_OEC','CHECK_INFO',
'R_LEASE_SURE_PAR_OEC','SPOUSE_COMMITMENT',
'R_LEASE_SALE_OEC','PUR_CONTRACT',
'S_LEASE_CONTRACT_MASTER_B_OEC','CONTRACT',
'S_LEASE_PAY_OEC','CASHFLOW_INFO',
'S_LEASE_CHECK_OEC','CHECK_INFO',
'S_LEASE_SURE_PER_OEC','GUARANTEE_LETTER_OEC',
'S_LEASE_SURE_PAR_OEC','SPOUSE_COMMITMENT',
'S_LEASE_SURE_F_OEC','S_GUARANTEE_LETTER_OEC',
'S_LEASE_SURE_BUS_OEC','GUARANTEE_LETTER_OEC',
'S_LEASE_ORDER_OEC','ITEM_TRAN_NOTICE',
'S_LEASE_PAY_REQ_OEC','PAYMENT_REQ',
'S_LEASE_MOR_OEC','MORT_CONTRACT')
from con_ele_signer_file cf, con_contract_ele_signer cs
where cf.con_ele_signer_id = cs.con_ele_signer_id
and cs.contract_id = ${@contract_id}
and ((('AGENT' not in (select cb.bp_category
from con_contract_bp cb, hls_bp_master hm
where cb.bp_id = hm.bp_id
and hm.social_code = ${@id_no}
and cb.contract_id = cs.contract_id) or
not exists (select 1
from con_contract_bp cb, hls_bp_master hm
where cb.bp_id = hm.bp_id
and hm.social_code = ${@id_no}
and cb.contract_id = cs.contract_id))
and exists (select 1 from hls_doc_file_templet_signer hs,con_clause_templet ct,hls_doc_file_templet ht
where hs.templet_id = ht.templet_id
and ht.templet_code = ct.templet_code
and ct.templet_id = cf.templet_id
and hs.enable_flag = 'Y'
and hs.signer_category not in ('AGENCY_STORE_SEAL','AGENCY_STORE_SIGN','HONGLING_SEAL','HONGLING_SIGN')))
or 'AGENT' in (select cb.bp_category
from con_contract_bp cb, hls_bp_master hm
where cb.bp_id = hm.bp_id
and hm.social_code = ${@id_no}
and cb.contract_id = cs.contract_id)))
and pi.cdd_list_id =
(select cc.cdd_list_id
from con_contract cc
where cc.contract_id = ${@contract_id}
and cc.data_class = 'NORMAL')
order by pi.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: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.contract_id = ${@contract_id}
and cc.content_id = fm.table_pk_value
and cc.templet_id = ct.templet_id
and fm.table_pk_value = cc.content_id
and ct.templet_code in
(select cf.templet_code
from con_ele_signer_file cf, con_contract_ele_signer cs
where cf.con_ele_signer_id = cs.con_ele_signer_id
and cs.contract_id = cc.contract_id
and ((('AGENT' not in(select cb.bp_category
from con_contract_bp cb, hls_bp_master hm
where cb.bp_id = hm.bp_id
and hm.social_code = ${@id_no}
and cb.contract_id = cc.contract_id)or
not exists(select 1
from con_contract_bp cb, hls_bp_master hm
where cb.bp_id = hm.bp_id
and hm.social_code = ${@id_no}
and cb.contract_id = cc.contract_id)) and
exists (select 1
from hls_doc_file_templet_signer hs,
con_clause_templet ct,
hls_doc_file_templet ht
where hs.templet_id = ht.templet_id
and ht.templet_code = ct.templet_code
and ct.templet_id = cf.templet_id
and hs.enable_flag = 'Y'
and hs.signer_category not in
('AGENCY_STORE_SEAL',
'AGENCY_STORE_SIGN',
'HONGLING_SEAL',
'HONGLING_SIGN'))) or
'AGENT' in (select cb.bp_category
from con_contract_bp cb, hls_bp_master hm
where cb.bp_id = hm.bp_id
and hm.social_code = ${@id_no}
and cb.contract_id = cc.contract_id)))
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:fields>
<bm:field name="file_name"/>
<bm:field name="file_size"/>
<bm:field name="file_path"/>
<bm:field name="attachment_id"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select fa.file_name, fa.file_size, fa.file_path,fa.attachment_id from fnd_atm_attachment fa
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="attachment_id" queryExpression="fa.attachment_id= ${@attachment_id}"/>
</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="query">
<bm:query-sql><![CDATA[
select (case
when to_date(${@lease_start_date}, 'yyyy-MM-dd') <
trunc(sysdate) then
'N'
else
'Y'
end) lease_flag
from dual
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="lease_flag"/>
</bm: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 cc
set cc.ec_sign_type = 'SIGNED',
cc.sign_contract_status = 'SIGN',
cc.last_update_date = sysdate
where cc.contract_id =
(select cf.contract_id
from con_contract_ele_flow cf
where cf.ele_flow_id = ${@flow_id}
and cf.ele_flow_type in ('CE', 'ET'));
update con_contract_ele_flow cf
set cf.flow_status = ${@flow_status},
cf.last_update_date = sysdate
where cf.ele_flow_id = ${@flow_id};
update con_contract_ele_signer cs
set cs.ec_sign_status = 'Y',
cs.last_update_date = sysdate
where cs.contract_id =
(select cf.contract_id
from con_contract_ele_flow cf
where cf.ele_flow_id = ${@flow_id});
END;
]]></bm:update-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 = nvl(${/session/@user_id},'1')
where c.contract_id = (select cf.contract_id
from con_contract_ele_flow cf
where cf.ele_flow_id = ${@flow_id}
and cf.ele_flow_type in ('CE', 'ET'));
delete from con_contract_ele_signer cs where cs.contract_id =
(select cf.contract_id
from con_contract_ele_flow cf
where cf.ele_flow_id = ${@flow_id}
and cf.ele_flow_type in ('CE', 'ET'));
delete from CON_CONTRACT_ELE_FLOW t where t.ele_flow_id = ${@flow_id};
commit;
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: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
wx_ele_contract_pkg.send_email(p_user_id => nvl(${/session/@user_id},1),
p_mail_to => ${@mail_to},
p_id_no => ${@id_no},
p_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:operations>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
BEGIN
HL_SMS_SEND_PKG.send_mobile_validation_key(p_phone_number => ${@phone_number},
p_user_id => nvl(${/session/@user_id},1),
p_sms_id => ${@sms_id},
o_md5_check_id => ${@md5_check_id});
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="md5_check_id" dataType="java.lang.String" input="false" output="true" outputPath="/parameter/@md5_check_id"/>
</bm:parameters>
</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
HL_SMS_SEND_PKG.verify_mobile_validation_key(p_user_id => nvl(${/session/@user_id},1),
p_md5_check_id => ${@check_id},
p_validation_key => ${@validation_key},
o_check_flag => ${@check_flag},
o_check_result => ${@check_result});
COMMIT;
END;
]]></bm:update-sql>
<bm:parameters>
<bm:parameter name="check_flag" dataType="java.lang.String" input="false" output="true" outputPath="/parameter/@check_flag"/>
<bm:parameter name="check_result" dataType="java.lang.String" input="false" output="true" outputPath="/parameter/@check_result"/>
</bm:parameters>
</bm:operation>
</bm:operations>
</bm:model>
...@@ -12,7 +12,12 @@ var add_datafilters = [ ...@@ -12,7 +12,12 @@ var add_datafilters = [
{ {
name : 'authority', name : 'authority',
expression : "(exists (select 1 from aut_trx_user_authorize a1, aut_owner_user_authorize a2 where a1.trx_category = 'CONTRACT' and a1.trx_id = t1.contract_id and trunc(sysdate) between a1.start_date and nvl(a1.end_date, trunc(sysdate)) and a1.user_id = a2.owner_user_id and a1.trx_category = a2.trx_category and a2.authorized_user_id = ${/session/@user_id} and trunc(sysdate) between a2.start_date and nvl(a2.end_date, trunc(sysdate))))" expression : "(exists (select 1 from aut_trx_user_authorize a1, aut_owner_user_authorize a2 where a1.trx_category = 'CONTRACT' and a1.trx_id = t1.contract_id and trunc(sysdate) between a1.start_date and nvl(a1.end_date, trunc(sysdate)) and a1.user_id = a2.owner_user_id and a1.trx_category = a2.trx_category and a2.authorized_user_id = ${/session/@user_id} and trunc(sysdate) between a2.start_date and nvl(a2.end_date, trunc(sysdate))))"
},
{
name : 'sign_type',
expression : " (nvl(t1.sign_type,'PAPER_SIGN') = 'PAPER_SIGN' or (t1.sign_type = 'ELE_SIGN' and t1.ec_sign_type = 'SIGNED'))"
} }
]; ];
var override_queryfields = [ var override_queryfields = [
{ {
......
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 : 'authority',
expression : "(exists (select 1 from aut_trx_user_authorize a1, aut_owner_user_authorize a2 where a1.trx_category = 'CONTRACT' and a1.trx_id = t1.contract_id and trunc(sysdate) between a1.start_date and nvl(a1.end_date, trunc(sysdate)) and a1.user_id = a2.owner_user_id and a1.trx_category = a2.trx_category and a2.authorized_user_id = ${/session/@user_id} and trunc(sysdate) between a2.start_date and nvl(a2.end_date, trunc(sysdate))))"
}
];
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,8 @@ ...@@ -23,6 +23,8 @@
<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="sp_sign_flag_ds" lookupCode="YES_NO"/>
<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 +36,8 @@ ...@@ -34,6 +36,8 @@
<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="sp_sign_flag_n" displayField="code_value_name" options="sp_sign_flag_ds" returnField="sp_sign_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 +137,9 @@ ...@@ -133,6 +137,9 @@
<!-- <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="sp_sign_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,6 @@ ...@@ -61,7 +62,6 @@
scope: this 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}');
} }
......
...@@ -56,6 +56,8 @@ ...@@ -56,6 +56,8 @@
else{ else{
param['function_code'] = 'CON301'; param['function_code'] = 'CON301';
param['function_usage'] = 'QUERY'; param['function_usage'] = 'QUERY';
//add by 24976
param['sign_contract_status'] = record.get('sign_contract_status');
} }
param['winid'] = 'con_contract_modify_win_id'; param['winid'] = 'con_contract_modify_win_id';
param['url_title'] = '${l:CON301.CONTRACT_DETAIL}'; param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
......
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
} else if (name == 'attachment') { } else if (name == 'attachment') {
link_function = '${/parameter/@layout_code}_prj500_cdd_attachtment_upload'; 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>'; 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' ) { } else if (name == 'attach_file_name' || name == 'attach_file_name_print' || name == 'attachment_new') {
var content_type = record.get('content_type'); var content_type = record.get('content_type');
var content_id = record.get('content_id'); var content_id = record.get('content_id');
//电子合同 //电子合同
...@@ -180,6 +180,9 @@ ...@@ -180,6 +180,9 @@
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + Leaf.formatMoney(value) + '</a>'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + Leaf.formatMoney(value) + '</a>';
} }
return ''; 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>';
} }
}; };
...@@ -312,6 +315,32 @@ ...@@ -312,6 +315,32 @@
Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!');
} }
}; };
//add by 24976
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 () { 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 ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
......
<?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_agent_link_id" url="${/request/@context_path}/modules/wx/WX100/con_ele_agent_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"/> <a:link id="${/parameter/@layout_code}_ele_operator_verify_link_id" url="${/request/@context_path}/modules/wx/WX100/wx_ele_verify_operator.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>'; }else if (name == 'signer_attachment') { link_function = '${/parameter/@layout_code}_signer_attachtment_upload'; if(record.get('bp_class') == 'NP'){ return ''; }else { 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}_signer_attachtment_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); if (record.get('signer') && record.get('bp_class') == 'ORG' && record.get('sign_type_n') == '电子签约') { var url; url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=HLS_BP_MASTER_SIGNER&header_id=' + record.get('signer'); 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 }); } }; 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 }); } //加载时调用(grid,table,gridBox) add by 24976 window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function (ds, record, config_records, bp_seq) { var bp_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_BP_1', 'con_contract_bp'); if (ds.id == bp_ds_id) { //var bp_class = record.get('bp_class'); var marital_status = record.get('marital_status'); var sp_sign_flag_n = record.get('sp_sign_flag_n'); if (marital_status != 30 && marital_status != 40 && sp_sign_flag_n === undefined) { record.getField('sp_sign_flag').setReadOnly(true); record.getField('sp_sign_flag_n').setReadOnly(true); record.set('sp_sign_flag', '-'); record.set('sp_sign_flag_n', '-'); } if(sp_sign_flag_n == '-'){ record.getField('sp_sign_flag').setReadOnly(true); record.getField('sp_sign_flag_n').setReadOnly(true); } } }; 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'; } if(record.get('bp_class') == 'NP' || record.get('sign_type_n') == '纸质签约'){ record.getField('signer_n').setReadOnly(true); record.getField('signer_n').setRequired(false); record.set('signer_n',''); }else if ('${/parameter/@function_usage}' == 'MODIFY' && record.get('sign_type_n') == '电子签约' && record.get('bp_class') == 'ORG'){ record.getField('signer_n').setReadOnly(false); record.getField('signer_n').setRequired(true); } if (record.get('prj_delivery_address') != null && record.get('prj_delivery_address') != ''){ record.getField('delivery_address').setReadOnly(true); } if (record.get('prj_lease_item_location') != null && record.get('prj_lease_item_location') != ''){ record.getField('lease_item_location').setReadOnly(true); } } }; //更新时调用 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 sign_type = record.get('sign_type') || 'PAPER_SIGN'; if (sign_contract_status != 'SIGNING') { Leaf.showMessage('${l:PROMPT}', '只有签约中的合同可以取消签约'); return; } if (sign_contract_status == 'SIGNING' && sign_type == 'PAPER_SIGN'){ 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(sign_type == 'ELE_SIGN' && 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 (res) { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); if (res.result.message != null){ Leaf.showMessage('${l:HLS.PROMPT}', res.result.message) }else{ $('${/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 lease_start_date = record.get('lease_start_date'); var business_type = record.get('business_type'); var bp_class = record.get('bp_class'); var con_lease_item_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_lease_item'); var con_lease_record = $(con_lease_item_id).getCurrentRecord(); var bp_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_BP_1', 'con_contract_bp'); var machine_number = con_lease_record.get('machine_number'); var con_bp_record = $(bp_ds_id).getCurrentRecord(); if (record.dirty == true || con_lease_record.dirty == true || con_bp_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().format('yyyy-mm-dd'); //获取当前日期 var v_lease_start_date = lease_start_date.format('yyyy-mm-dd'); //页面中选择的时间日期 //date.setTime(date.getTime()); if (v_lease_start_date < date) { Leaf.showMessage('${l:PROMPT}', '起租日小于当前时间,不允许发起电子签约!'); window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); return; } if(business_type == 'LEASEBACK' && bp_class == 'NP'){ Leaf.showMessage('${l:PROMPT}', '此类业务尚未开放电子签约功能'); window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); return; } if (Ext.isEmpty(machine_number)) { Leaf.showMessage('${l:HLS.PROMPT}', '请先填写机号并保存!'); window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); return; } var con_bp_records = $(bp_ds_id).getAll(); for (var i = 0;i < con_bp_records.length;i++) { var sp_sign_flag = con_bp_records[i].get('sp_sign_flag'); var sp_sign_flag_n = con_bp_records[i].get('sp_sign_flag_n'); if (Ext.isEmpty(sp_sign_flag) || Ext.isEmpty(sp_sign_flag_n)) { Leaf.showMessage('${l:HLS.PROMPT}', '请先选择配偶是否签署并保存!'); window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); return; } } Leaf.request({ url:$('${/parameter/@layout_code}_ele_operator_verify_link_id').getUrl(), para:{ contract_id:contract_id, esign_type:'CE' }, scope:this, success: function (res) { if(res.result.check_flag == 'N'){ Leaf.showConfirm('${HLS.PROMPT}', res.result.result_message, function () { window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); Leaf.request({ url: $('${/parameter/@layout_code}_con_ele_content_create_link_id').getUrl(), para: { contract_id: contract_id }, scope: this, success: function () { Leaf.request({ url: $('${/parameter/@layout_code}_con_ele_agent_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'](); } }); }, failure: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, error: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); } }); }); window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }else{ window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); Leaf.request({ url: $('${/parameter/@layout_code}_con_ele_content_create_link_id').getUrl(), para: { contract_id: contract_id }, scope: this, success: function () { Leaf.request({ url: $('${/parameter/@layout_code}_con_ele_agent_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'](); } }); }, failure: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, error: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); } }); } }, error: function() { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, failure: 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(); } //add by 24976 if("${/parameter/@sign_contract_status}" == 'SIGNING'){ document.getElementById("${/parameter/@layout_code}_user_button4").style.display = ""; }else if("${/parameter/@sign_contract_status}" == 'SIGN'){ document.getElementById("${/parameter/@layout_code}_user_button4").style.display = "none"; } }) ]]></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 = info_query('UP_FILE_TOKEN_URL').code_value;
//系统参数获取
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 sign_cancel_data = sign_cancel_map.getChildren();
var revoke_flows = [];
for (var i = 0; i < sign_cancel_data.length;i++){
revoke_flows.push({
"flowId":sign_cancel_data[i].ele_flow_id
});
}
var revokeParam = {
revokeFlows:revoke_flows
}
//调用中台取消流程
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); //根据返回参数形式再定
var revoke_flag_update_bm = $bm('cont.CON505.contract_revoke_flag_update');
if (result_ob.code != 0) {
//rollback
$bm('wx.WX100.rollback').update();
raise_app_error('取消签约失败,请联系技术人员检查!');
}else if(result_ob.code == 0){
var revokeFlows = result_ob.revokeFlows;
var all_revoke_flag = 'Y';
var error_message;
var result;
for (var i = 0; i < revokeFlows.length; i++) {
if(revokeFlows[i].result == 0){
revoke_flag_update_bm.update({
contract_id:$ctx.parameter.contract_id,
flow_id:revokeFlows[i].flowId
});
}else{
all_revoke_flag = 'N';
result = revokeFlows[i].result;
error_message = revokeFlows[i].msg;
}
}
if(all_revoke_flag == 'Y'){
sign_cancel_bm.execute({
contract_id:$ctx.parameter.contract_id
});
}else{
if(result = '1437111'){
$ctx.parameter.message = '签约已完毕,不可取消';
}else{
$ctx.parameter.message = error_message;
}
}
}
]]></s:server-script>
</a:init-procedure>
<a:service-output output="/parameter"/>
</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>
...@@ -19,6 +19,12 @@ ...@@ -19,6 +19,12 @@
url="${/request/@context_path}/uploadFile.lview"/> url="${/request/@context_path}/uploadFile.lview"/>
<a:link id="${/parameter/@layout_code}_prj500_cdd_downloadFile_id" <a:link id="${/parameter/@layout_code}_prj500_cdd_downloadFile_id"
url="${/request/@context_path}/downloadFile.lview"/> url="${/request/@context_path}/downloadFile.lview"/>
<a:link id="${/parameter/@layout_code}_con_ele_terminate_create_link_id"
url="${/request/@context_path}/modules/wx/WX100/con_ele_terminate_create.lsc"/>
<a:link id="${/parameter/@layout_code}_ele_operator_verify_link_id"
url="${/request/@context_path}/modules/wx/WX100/wx_ele_verify_operator.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"/>
<a:link id="con_lease_org_print_link" <a:link id="con_lease_org_print_link"
url="${/request/@context_path}/modules/cont/CON_ET001/create_content_for_con_et.lsc"/> url="${/request/@context_path}/modules/cont/CON_ET001/create_content_for_con_et.lsc"/>
<script src="${/request/@context_path}/javascripts/lightbox.js" type="text/javascript"/> <script src="${/request/@context_path}/javascripts/lightbox.js" type="text/javascript"/>
...@@ -50,8 +56,15 @@ ...@@ -50,8 +56,15 @@
}); });
var calc_flag = 'N'; var calc_flag = 'N';
//新增和加载时调用form //新增和加载时调用form
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function (ds, record, config_records, bp_seq) { window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function(ds, record, config_records, bp_seq) {
var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_BASE_01', 'con_contract_change_req');
if (ds_id == ds.id && ds_id) {
if(record.get('bp_class') == 'NP'){
record.getField('signer_n').setReadOnly(true);
record.getField('signer_n').setRequired(false);
record.set('signer_n','');
}
}
}; };
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function (ds, record, name, value, old_value, bp_seq) { window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function (ds, record, name, value, old_value, bp_seq) {
...@@ -186,14 +199,33 @@ ...@@ -186,14 +199,33 @@
// $('${/parameter/@layout_code}_user_button3').disable(); // $('${/parameter/@layout_code}_user_button3').disable();
var req_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASE_01', 'con_contract_change_req'); var req_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASE_01', 'con_contract_change_req');
var req_record = $(req_ds_id).getAt(0); var req_record = $(req_ds_id).getAt(0);
var sign_type = req_record.get('sign_type');
var flow_count = req_record.get('flow_count');
// window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window'](); // window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
if (sign_type == 'ELE_SIGN' && flow_count > 0){
Leaf.showConfirm('${l:HLS.PROMPT}', '您发起的电子签署还未完成,如此时提交,将会转为纸质签署,请确认。', function (){
Leaf.request({
url: $('${/parameter/@layout_code}_con_ele_sign_cancel_link_id').getUrl(),
para: {
contract_id: ${/parameter/@change_req_id}
},
scope: this,
success: function (res) {
if (res.result.message != null){
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_submit_approval').enable();
$('${/parameter/@layout_code}_save').enable();
$('${/parameter/@layout_code}_user_button1').enable();
$('${/parameter/@layout_code}_user_button3').enable();
Leaf.showMessage('${l:HLS.PROMPT}', res.result.message);
}else{
Leaf.request({ Leaf.request({
url: $('con_et002_submit_link').getUrl(), url: $('con_et002_submit_link').getUrl(),
para: { para: {
change_req_id: ${/parameter/@change_req_id}, change_req_id: ${/parameter/@change_req_id},
layout_code: '${/parameter/@layout_code}' layout_code: '${/parameter/@layout_code}'
}, },
success: function (res) { success: function(res) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window'](); window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_submit_approval').enable(); $('${/parameter/@layout_code}_submit_approval').enable();
$('${/parameter/@layout_code}_save').enable(); $('${/parameter/@layout_code}_save').enable();
...@@ -220,6 +252,59 @@ ...@@ -220,6 +252,59 @@
}, },
scope: this scope: this
}); });
}
},
failure: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_submit_approval').enable();
$('${/parameter/@layout_code}_save').enable();
$('${/parameter/@layout_code}_user_button1').enable();
$('${/parameter/@layout_code}_user_button3').enable();
},
error: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_submit_approval').enable();
$('${/parameter/@layout_code}_save').enable();
$('${/parameter/@layout_code}_user_button1').enable();
$('${/parameter/@layout_code}_user_button3').enable();
}
});
});
}else{
Leaf.request({
url: $('con_et002_submit_link').getUrl(),
para: {
change_req_id: ${/parameter/@change_req_id},
layout_code: '${/parameter/@layout_code}'
},
success: function(res) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_submit_approval').enable();
$('${/parameter/@layout_code}_save').enable();
$('${/parameter/@layout_code}_user_button1').enable();
$('${/parameter/@layout_code}_user_button3').enable();
$('${/parameter/@winid}').close();
},
failure: function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_submit_approval').enable();
$('${/parameter/@layout_code}_save').enable();
$('${/parameter/@layout_code}_user_button1').enable();
$('${/parameter/@layout_code}_user_button3').enable();
},
error: function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_submit_approval').enable();
$('${/parameter/@layout_code}_save').enable();
$('${/parameter/@layout_code}_user_button1').enable();
$('${/parameter/@layout_code}_user_button3').enable();
},
scope: this
});
}
}, null, 300, 150); }, null, 300, 150);
} }
...@@ -293,16 +378,40 @@ ...@@ -293,16 +378,40 @@
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认取消变更?', function () { Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认取消变更?', function () {
$('${/parameter/@layout_code}_user_button3').disable(); //按钮不可用 $('${/parameter/@layout_code}_user_button3').disable(); //按钮不可用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window'](); window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('${/parameter/@layout_code}_con_ele_sign_cancel_link_id').getUrl(),
para: {
contract_id: ${/parameter/@change_req_id}
},
scope: this,
success: function (res) {
if (res.result.message != null){
$('${/parameter/@layout_code}_user_button3').enable(); //按钮启用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
Leaf.showMessage('${l:HLS.PROMPT}', res.result.message)
}else{
Leaf.request({ Leaf.request({
url: $('con_et002_cancel_link').getUrl(), url: $('con_et002_cancel_link').getUrl(),
para: { para: {
change_req_id: ${/parameter/@change_req_id} change_req_id: ${/parameter/@change_req_id}
}, },
success: function (res) { success: function(res) {
$('${/parameter/@layout_code}_user_button3').enable(); //按钮启用 $('${/parameter/@layout_code}_user_button3').enable(); //按钮启用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window'](); window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@winid}').close(); $('${/parameter/@winid}').close();
}, },
failure: function() {
$('${/parameter/@layout_code}_user_button3').enable(); //按钮启用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function() {
$('${/parameter/@layout_code}_user_button3').enable(); //按钮启用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
}
},
failure: function () { failure: function () {
$('${/parameter/@layout_code}_user_button3').enable(); //按钮启用 $('${/parameter/@layout_code}_user_button3').enable(); //按钮启用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window'](); window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
...@@ -310,11 +419,142 @@ ...@@ -310,11 +419,142 @@
error: function () { error: function () {
$('${/parameter/@layout_code}_user_button3').enable(); //按钮启用 $('${/parameter/@layout_code}_user_button3').enable(); //按钮启用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window'](); window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}
});
});
};
//提前结清发起电子签署 add by 24976
window['${/parameter/@layout_code}_user_button4_layout_dynamic_click'] = function() {
var req_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASE_01', 'con_contract_change_req');
var req_record = $(req_ds_id).getAt(0);
var req_status = req_record.get('req_status');
var contract_id = req_record.get('contract_id');
var change_req_id = req_record.get('change_req_id');
var signer = req_record.get('signer');
var bussiness_type = req_record.get('business_type');
var bp_tenant_class = req_record.get('bp_class');
/* if (req_status != 'NEW') {
Leaf.showMessage('${l:PROMPT}', '只有新建状态的才能发起电子签约');
return;
}*/
if(bussiness_type == 'LEASEBACK' && bp_tenant_class == 'NP'){
Leaf.showMessage('${l:PROMPT}', '业务类型为售后回租且是个人承租人的合同,不能发起电子签约');
return;
}
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认发起电子签约?', function () {
if (req_record.dirty == true) {
Leaf.showMessage('${l:PROMPT}', '${l:HLS.EXECUTE_AFTER_SAVE}');
return;
}
if (signer == null && bp_tenant_class == 'ORG') {
Leaf.showMessage('${l:PROMPT}', '发起电子签约时,签约人不能为空!');
return;
}else if(bp_tenant_class == 'NP'){
req_record.getField('signer_n').setReadOnly(true);
}
$('${/parameter/@layout_code}_user_button3').disable();
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url:$('${/parameter/@layout_code}_ele_operator_verify_link_id').getUrl(),
para:{
contract_id:change_req_id,
esign_type:'ET'
},
scope:this,
success: function (res) {
if(res.result.check_flag == 'N'){
Leaf.showConfirm('${HLS.PROMPT}', '该企业下已存在其他经办人,如果发起签约,原账户将失效,请确认是否继续!', function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('${/parameter/@layout_code}_con_ele_sign_cancel_link_id').getUrl(),
para: {
contract_id: change_req_id
},
scope: this,
success: function (res) {
if (res.result.message != null){
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
Leaf.showMessage('${l:HLS.PROMPT}', res.result.message)
}else{
Leaf.request({
url: $('${/parameter/@layout_code}_con_ele_terminate_create_link_id').getUrl(),
para: {
contract_id: change_req_id
},
success: function(res) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@winid}').close();
},
failure: function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}, },
scope: this scope: this
}); });
}
},
failure: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}
}); });
}; });
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}else{
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('${/parameter/@layout_code}_con_ele_sign_cancel_link_id').getUrl(),
para: {
contract_id: change_req_id
},
scope: this,
success: function (res) {
if (res.result.message != null){
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
Leaf.showMessage('${l:HLS.PROMPT}', res.result.message)
}else{
Leaf.request({
url: $('${/parameter/@layout_code}_con_ele_terminate_create_link_id').getUrl(),
para: {
contract_id: change_req_id
},
success: function(res) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@winid}').close();
},
failure: function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
}
},
failure: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}
});
}
},
error: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
failure: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}
});
});
}
window['${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function (ds, qpara, bp_seq) { window['${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function (ds, qpara, bp_seq) {
}; };
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
<script src="${/request/@context_path}/modules/prj/PRJ500N/javascripts/input_validator.js" <script src="${/request/@context_path}/modules/prj/PRJ500N/javascripts/input_validator.js"
type="text/javascript"/> type="text/javascript"/>
<a:link id="gh_nc_post_addcustomerinfo_link" model="hls.HLS213.hls_bp_master_nc_post" modelaction="execute"/> <a:link id="gh_nc_post_addcustomerinfo_link" model="hls.HLS213.hls_bp_master_nc_post" modelaction="execute"/>
<a:link id="${/parameter/@layout_code}_signer_create_link_id" model="hls.HLS213.hls_bp_master_signer_create_check"
modelaction="update"/>
<script type="text/javascript"><![CDATA[ <script type="text/javascript"><![CDATA[
Leaf.onReady(function () { Leaf.onReady(function () {
var unit_id = '${/model/user_agent_description/record/@unit_id}'; var unit_id = '${/model/user_agent_description/record/@unit_id}';
...@@ -386,6 +388,27 @@ ...@@ -386,6 +388,27 @@
} }
$(ds_id).setQueryParameter('bp_id', head_record.get('bp_id')); $(ds_id).setQueryParameter('bp_id', head_record.get('bp_id'));
$(ds_id).query(); $(ds_id).query();
//add by zc
var signer_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_signer');
if(head_record.get('bp_id')){
Leaf.request({
url: $('${/parameter/@layout_code}_signer_create_link_id').getUrl(),
para: {
bp_id: head_record.get('bp_id')
},
success: function (res) {
$(signer_ds_id).query();
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
failure: function (res) {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
}
window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}; };
...@@ -633,7 +656,32 @@ ...@@ -633,7 +656,32 @@
} }
} }
function upload_signer_file(id, name, query_only) {
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
if (record.get('hls_bp_signer_id')) {
var url;
if (query_only == 'Y') {
url = $('hls214N_cdd_downloadFile_id').getUrl() + '?table_name=HLS_BP_MASTER_SIGNER&header_id=' + record.get('hls_bp_signer_id');
} else {
url = $('hls214N_cdd_uploadFile_id').getUrl() + '?table_name=HLS_BP_MASTER_SIGNER&header_id=' + record.get('hls_bp_signer_id');
}
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: '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}_dynamic_link_renderer'] = function (value, record, name, config_record) { window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record) {
...@@ -672,6 +720,10 @@ ...@@ -672,6 +720,10 @@
return '<font color="RED">' + value + '</font>'; return '<font color="RED">' + value + '</font>';
} }
return value; return value;
}//签约人授权书附件
else if(name == 'signer_attachment'){
var signer_link_function = 'upload_signer_file';
return '<a href="javascript:window[\'' + signer_link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>';
} }
}; };
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
<a:link id="${/parameter/@layout_code}_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" <a:link id="${/parameter/@layout_code}_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
modelaction="update"/> modelaction="update"/>
<a:link id="hls214_bp_master_save_link_id" model="hls.HLS214.hls_bp_change_agent" modelaction="update"/> <a:link id="hls214_bp_master_save_link_id" model="hls.HLS214.hls_bp_change_agent" modelaction="update"/>
<a:link id="${/parameter/@layout_code}_signer_create_link_id" model="hls.HLS213.hls_bp_master_signer_create_check"
modelaction="update"/>
<!-- <a:link id="hls214_sap_eai_create_customer_link" url="${/request/@context_path}/modules/interface/INTERFACE_EAI/hls_sap_eai_CrCustomer.lsc"/>--> <!-- <a:link id="hls214_sap_eai_create_customer_link" url="${/request/@context_path}/modules/interface/INTERFACE_EAI/hls_sap_eai_CrCustomer.lsc"/>-->
<!-- <a:link id="hls214_sap_eai_create_vender_link" url="${/request/@context_path}/modules/interface/INTERFACE_EAI/hls_sap_eai_CrVender.lsc"/>--> <!-- <a:link id="hls214_sap_eai_create_vender_link" url="${/request/@context_path}/modules/interface/INTERFACE_EAI/hls_sap_eai_CrVender.lsc"/>-->
<!-- <script src="${/request/@context_path}/javascripts/identity_card_info_query.js"--> <!-- <script src="${/request/@context_path}/javascripts/identity_card_info_query.js"-->
...@@ -122,6 +124,30 @@ ...@@ -122,6 +124,30 @@
if (!(records == 'undefined' || records == null)) { if (!(records == 'undefined' || records == null)) {
$(ds_id).query(); $(ds_id).query();
} }
//add by zc
var signer_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_signer');
var record = $(bp_ds_id).getCurrentRecord();
bp_id = prj_check_bp_id(record);
if (!bp_id) {
return;
}
Leaf.request({
url: $('${/parameter/@layout_code}_signer_create_link_id').getUrl(),
para: {
bp_id: bp_id
},
success: function (res) {
$(signer_ds_id).query();
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
failure: function (res) {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
// 简称校验 // 简称校验
// //
// var Pattern = /^[A-Za-z]+$/; // var Pattern = /^[A-Za-z]+$/;
...@@ -576,7 +602,32 @@ ...@@ -576,7 +602,32 @@
} }
} }
function upload_signer_file(id, name, query_only) {
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
if (record.get('hls_bp_signer_id')) {
var url;
if (query_only == 'Y') {
url = $('hls214N_cdd_downloadFile_id').getUrl() + '?table_name=HLS_BP_MASTER_SIGNER&header_id=' + record.get('hls_bp_signer_id');
} else {
url = $('hls214N_cdd_uploadFile_id').getUrl() + '?table_name=HLS_BP_MASTER_SIGNER&header_id=' + record.get('hls_bp_signer_id');
}
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: '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}_dynamic_link_renderer'] = function (value, record, name, config_record) { window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record) {
// //
...@@ -615,6 +666,10 @@ ...@@ -615,6 +666,10 @@
return '<font color="RED">' + value + '</font>'; return '<font color="RED">' + value + '</font>';
} }
return value; return value;
} //签约人授权书附件
else if(name == 'signer_attachment'){
var signer_link_function = 'upload_signer_file';
return '<a href="javascript:window[\'' + signer_link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>';
} }
}; };
......
...@@ -634,7 +634,29 @@ ...@@ -634,7 +634,29 @@
} }
} }
function upload_signer_file(id, name, query_only) {
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
if (record.get('signer_req_id')) {
var url;
if (query_only == 'Y') {
url = $('hls214N_cdd_downloadFile_id').getUrl() + '?table_name=HLS_BP_MASTER_SIGNER_REQ&header_id=' + record.get('signer_req_id');
} else {
url = $('hls214N_cdd_uploadFile_id').getUrl() + '?table_name=HLS_BP_MASTER_SIGNER_REQ&header_id=' + record.get('signer_req_id');
}
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'prj500_cdd_uploadFile_screen_id',
width: 850,
height: 400
});
} else {
Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!');
}
}
//超链接渲染 //超链接渲染
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record) { window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record) {
...@@ -681,6 +703,14 @@ ...@@ -681,6 +703,14 @@
return '<font color="RED">' + value + '</font>'; return '<font color="RED">' + value + '</font>';
} }
return value; return value;
} //签约人授权书附件
else if(name == 'signer_attachment') {
var signer_link_function = 'upload_signer_file';
if ('${/parameter/@query_only}' == 'Y') {
return '<a href="javascript:window[\'' + signer_link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + '${/parameter/@query_only}' + '\');">' + '附件下载' + '</a>';
}else{
return '<a href="javascript:window[\'' + signer_link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>';
}
} }
}; };
......
...@@ -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_bp_master_query() {
var existsFlag_map;
var existsFlag;
try {
var existsFlag_query = $bm('wx.WX100.con_bp_master_query');
existsFlag_map = existsFlag_query.queryAsMap({
social_code:$ctx.parameter.idNo,
bp_name:$ctx.parameter.name,
agent_id_no:$ctx.parameter.agentIdNo,
agent_name:$ctx.parameter.agentName
});
var existsFlag_details = existsFlag_map.getChildren();
existsFlag = existsFlag_details[0].existsFlag;
$ctx.parameter.return_status = '0';
$ctx.parameter.return_message = '执行成功';
} catch (e) {
$ctx.success = "false";
$ctx.parameter.return_status = '1';
$ctx.parameter.return_message = String(e);
existsFlag = '1';
}
//返回结果
var result = {
code: $ctx.parameter.return_status,
message: $ctx.parameter.return_message,
existsFlag: existsFlag
};
$ctx.parameter.json = JSON.stringify(result);
}
if ($ctx.parameter.return_status != 'E' && $ctx.parameter.return_status != 'TIMEOUT') {
con_bp_master_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: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_list_query');
var contract_list_map;
var inputData = $ctx.parameter.inputData;
var contractStatus = $ctx.parameter.contractStatus;
if (inputData == null || inputData == ""){
if(contractStatus == null || contractStatus == ""){
contract_list_map = contract_list_bm.queryAsMap({
id_no:$ctx.parameter.idNo,
account_type:$ctx.parameter.accountType,
organization_id:$ctx.parameter.organizationId
});
}else{
contract_list_map = contract_list_bm.queryAsMap({
id_no:$ctx.parameter.idNo,
account_type:$ctx.parameter.accountType,
organization_id:$ctx.parameter.organizationId,
contract_status:contractStatus
});
}
}else{
if(contractStatus == null || contractStatus == ""){
contract_list_map = contract_list_bm.queryAsMap({
id_no:$ctx.parameter.idNo,
account_type:$ctx.parameter.accountType,
organization_id:$ctx.parameter.organizationId,
contract_number:inputData
});
}else{
contract_list_map = contract_list_bm.queryAsMap({
id_no:$ctx.parameter.idNo,
account_type:$ctx.parameter.accountType,
organization_id:$ctx.parameter.organizationId,
contract_number:inputData,
contract_status:contractStatus
});
}
}
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,
Contracts: []
};
var Contracts = result.Contracts;
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 cashflowList = [];
//合同现金流信息查询
var lease_items_bm = $bm('wx.WX100.con_cashflow_info');
var lease_details_map = lease_items_bm.queryAsMap({
contract_id: contract_id
});
var lease_details = lease_details_map.getChildren();
for (var j = 0; j < lease_details.length; j++) {
cashflowList.push({
time: lease_details[j].times,
dueYear: lease_details[j].due_year,
dueDate:lease_details[j].due_date,
cfItem:lease_details[j].cf_item,
dueAmt:lease_details[j].due_amount,
unDueAmt:lease_details[j].received_amount,
dueStatus:lease_details[j].cf_status_n
});
}
//合同附件信息查询
var docsList = [];
var file_list_bm = $bm('wx.WX100.con_file_download');
var file_list_map = file_list_bm.queryAsMap({
contract_id: contract_id,
id_no:$ctx.parameter.idNo
});
var file_list_details = file_list_map.getChildren();
for (var j = 0; j < file_list_details.length; j++) {
docsList.push({
fileName: file_list_details[j].file_name,
fileUrl: file_list_details[j].file_path,
attachmentId: file_list_details[j].attachment_id
});
}
Contracts.push({
"contractNo": contract_list_detail.contract_id,
"contractNumber": contract_list_detail.contract_number,
"telentName": contract_list_detail.bp_id_tenant_n,
"telentType":contract_list_detail.bp_id_tenant_type,
"agentName": contract_list_detail.bp_id_agent_level1_n,
"signType": contract_list_detail.sign_type,
"serialNo": contract_list_detail.machine_number,
"contractStatus": contract_list_detail.contract_status_n,
"modelNo":contract_list_detail.modelcd,
"firstDay":contract_list_detail.lease_start_date,
"endDay":contract_list_detail.lease_end_date,
"dueDay":contract_list_detail.due_day,
"signAmt": contract_list_detail.total_sign,
"bank":contract_list_detail.bank_full_name,
"bankName":contract_list_detail.bank_account_name,
"bankNum":contract_list_detail.bank_branch_num,
"dueAmountAll":contract_list_detail.due_amount_all,
"signUrl":contract_list_detail.sign_url,
"cashflowList":cashflowList,
"docsList": docsList
});
}
}
$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: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;
var all_status = 'Y';
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,
account_type: $ctx.parameter.accountType,
organization_id:$ctx.parameter.organizationId
});
}else{
contract_list_map = contract_list_bm.queryAsMap({
id_no:$ctx.parameter.idNo,
id_type:$ctx.parameter.IdType,
account_type: $ctx.parameter.accountType,
organization_id:$ctx.parameter.organizationId,
contract_number:inputData,
});
}
contract_list_details = contract_list_map.getChildren();
var 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
});
}
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,
"leaseStartDate":contract_list_detail.lease_start_date,
"signAmt": contract_list_detail.total_sign,
"signUrl":contract_list_detail.sign_url,
"userSignStatus":contract_list_detail.userSignStatus,
"signFiles": signFiles
});
var contract_list_detail = contract_list_details[i];
if (contract_list_detail.userSignStatus == 'N'){
all_status = 'N';
}
}
}
}
$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,
allConSignStatus:all_status,
unSignContracts: unSignContracts
};
$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: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_bp_master_query() {
var statusFlag_map;
var statusFlag;
try {
var statusFlag_query = $bm('wx.WX100.con_contract_status_query');
statusFlag_map = statusFlag_query.queryAsMap({
id_no:$ctx.parameter.idNo,
account_type:$ctx.parameter.accountType,
organization_id:$ctx.parameter.organizationId
});
var statusFlag_details = statusFlag_map.getChildren();
statusFlag = statusFlag_details[0].statusFlag;
$ctx.parameter.return_status = '0';
$ctx.parameter.return_message = '执行成功';
} catch (e) {
$ctx.success = "false";
$ctx.parameter.return_status = '1';
$ctx.parameter.return_message = String(e);
statusFlag = 'Y'
}
//返回结果
var result = {
code: $ctx.parameter.return_status,
message: $ctx.parameter.return_message,
statusFlag: statusFlag
};
$ctx.parameter.json = JSON.stringify(result);
}
if ($ctx.parameter.return_status != 'E' && $ctx.parameter.return_status != 'TIMEOUT') {
con_bp_master_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 = info_query('UP_FILE_TOKEN_URL').code_value;
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 info = info_query('HL_ELE_FILE_PATH');
var file_path = info.code_value;
//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 = [];
//文件列表
var con_ele_unsigned_file_bm = $bm('wx.WX100.con_agent_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.replace('X:','/mnt'),
"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_agent_contract_signer_query');
var ele_signer_map = ele_signer_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id,
esign_type:'CE'
});
var ele_signer_data = ele_signer_map.getChildren();
var userInfoList = [];
for (var k = 0 ; k < ele_signer_data.length;k++){
var signer_record_data = ele_signer_data[k];
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;
//法人
var legalName = signer_record_data.legal_person;
var legalIdNo = signer_record_data.id_card_no_leg;
userInfoList.push({
"idNo": signer_record_data.id_no,
"name": signer_record_data.bp_name,
"agentIdNo": agentIdNo,
"agentName": agentName,
"mobile": mobile,
"legalName": legalName,
"legalIdNo": legalIdNo,
"agentType": "2",
"signerCategory":signer_record_data.signer_category
});
}
}
//获取token信息
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 info = info_query('HL_ELE_ACCOUNT_CREATE_PATH');
var httpUrl = info.code_value;
var Param = {
userInfo: userInfoList
}
var result = EleFileUpHttpPost.post(httpUrl, JSON.stringify(Param), 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(Param),
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(result_ob.message.toString());
}
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();
var contract_number = ele_contract_signer_data[0].contract_number;
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_agent_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.replace('X:','/mnt'),
"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,
contractNumber:contract_number,
esignType:"AE",
userInfo:userInfoList,
conFileList:conFileList,
signer:signer
}
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('发起签约失败,请联系技术人员检查!');
raise_app_error(result_ob.message.toString());
}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,
esign_type: 'AE'
})
flow_update_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"?>
<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);
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 info = info_query('HL_ELE_FILE_PATH');
var file_path = info.code_value;
//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 up_file_token_url = info_query('UP_FILE_TOKEN_URL').code_value;
var flow_count_bm = $bm('wx.WX100.con_ele_flow_update');
var flow_count_map = flow_count_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id
});
var flow_count_data = flow_count_map.getChildren();
if(flow_count_data[0].ce_num == 0) {
//依据合同文本签署人定义存储签署人信息
var ele_contract_signer_bm = $bm('wx.WX100.con_ele_contract_signer_save');
/* //第一步生成合同文本
$bm('cont.CON505.con_ele_contract_create_content').update({
contract_id: $ctx.parameter.contract_id,
content_type: 'NORMAL'
});*/
//组装合同签署人信息报文
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,
esign_type: 'CE'
});
var ele_signer_data = ele_signer_map.getChildren();
var userInfoList = [];
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,
"signerCategory":signer_record_data.signer_category
});
} 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;
//法人
var legalName = signer_record_data.legal_person;
var legalIdNo = signer_record_data.id_card_no_leg;
if (agentIdNo == legalIdNo) {
userInfoList.push({
"idNo": signer_record_data.id_no,
"name": signer_record_data.bp_name,
"agentIdNo": agentIdNo,
"agentName": agentName,
"mobile": mobile,
"legalName": legalName,
"legalIdNo": legalIdNo,
"agentType": "1",
"signerCategory":signer_record_data.signer_category
});
} else {
userInfoList.push({
"idNo": signer_record_data.id_no,
"name": signer_record_data.bp_name,
"agentIdNo": agentIdNo,
"agentName": agentName,
"mobile": mobile,
"legalName": legalName,
"legalIdNo": legalIdNo,
"agentType": "2",
"signerCategory":signer_record_data.signer_category
});
}
} 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',
id_no:signer_record_data.id_card_no_leg
});
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",
"signerCategory":signer_record_data.signer_category
});
} 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;
//法人
var legalName = signer_record_data.legal_person;
var legalIdNo = signer_record_data.id_card_no_leg;
userInfoList.push({
"idNo": signer_record_data.id_no,
"name": signer_record_data.bp_name,
"agentIdNo": agentIdNo,
"agentName": agentName,
"mobile": mobile,
"legalName": legalName,
"legalIdNo": legalIdNo,
"agentType": "2",
"signerCategory":signer_record_data.signer_category
});
}
}
//获取token信息
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 info = info_query('HL_ELE_ACCOUNT_CREATE_PATH');
var httpUrl = info.code_value;
var Param = {
userInfo: userInfoList
}
var result = EleFileUpHttpPost.post(httpUrl, JSON.stringify(Param), 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(Param),
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(result_ob.message.toString());
}
//生成合同文本
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.replace('X:','/mnt'),
"fileName": con_ele_unsigned_file_data[n].file_name,
"fileSize": con_ele_unsigned_file_data[n].file_size
});
}
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();
var contract_number = ele_contract_signer_data[0].contract_number;
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.replace('X:','/mnt'),
"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,
contractNumber: contract_number,
esignType: "CE",
userInfo: userInfoList,
conFileList: conFileList,
signer: signer
}
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('发起签约失败,请联系技术人员检查!');
raise_app_error(result_ob.message.toString());
} 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,
esign_type: 'CE'
})
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,
esign_type: 'CE'
})
}
}
}
]]></s:server-script>
</a:init-procedure>
</a:service>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:s="leaf.plugin.script" xmlns:a="http://www.leaf-framework.org/application" trace="true">
<a:init-procedure>
<s:server-script><![CDATA[
importPackage(java.io);
importPackage(Packages.com.hand.elecon.httpost);
var up_file_token_url = info_query('UP_FILE_TOKEN_URL').code_value;
//系统参数获取
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;
}
function ele_file_download() {
try {
//文件列表
var con_ele_file_dl_bm = $bm('wx.WX100.con_ele_file_download');
var con_ele_file_dl_map;
if($ctx.parameter.p_contract_id && $ctx.parameter.p_ele_flow_id){
con_ele_file_dl_map = con_ele_file_dl_bm.queryAsMap({
contract_id: $ctx.parameter.p_contract_id,
ele_flow_id: $ctx.parameter.p_ele_flow_id
});
}else{
con_ele_file_dl_map = con_ele_file_dl_bm.queryAsMap();
}
var con_ele_file_dl_data = con_ele_file_dl_map.getChildren();
var flows_list = [];
for (var i = 0; i < con_ele_file_dl_data.length; i++) {
var flow_id = con_ele_file_dl_data[i].ele_flow_id;
flows_list.push({
flowId:flow_id
})
}
//调用中台下载文件接口
var info = info_query('HL_SIGN_FILE_DOWNLOAD');
var httpUrl = info.code_value;
var Param = {
flows: flows_list
}
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(Param), access_sign_token);
logs_bm.insert({
contract_id: $ctx.parameter.p_contract_id || '',
httpurl: httpUrl,
jsonPut: JSON.stringify(Param),
jsonResult: result,
tokenResult: token_sign_result
});
var result_ob = JSON.parse(result); //根据返回参数形式再定
if (result_ob.code == 0) {
var status_update_bm = $bm('wx.WX100.job_ele_sign_status_update');
var query_flows = result_ob.queryFlows;
for (var n = 0; n < query_flows.length; n++){
var flow_id = query_flows[n].flowId;
var flow_status = query_flows[n].flowStatus;
if(flow_status == 2){
var docs_list = query_flows[n].docsList;
status_update_bm.update({
flow_id:flow_id,
flow_status:flow_status
})
var con_num_map = con_ele_file_dl_bm.queryAsMap({
ele_flow_id: flow_id
});
var data = con_num_map.getChildren();
var v_con_id = data[0].contract_id;
for (var j = 0; j < docs_list.length; j++) {
con_ele_file_dl_bm.update({
contract_id: v_con_id,
file_name: docs_list[j].fileName,
file_url: docs_list[j].fileUrl.replace('/mnt','X:'),
file_size:docs_list[j].fileSize
})
}
con_ele_file_dl_bm.execute({
flow_id:flow_id
})
}else if(flow_status == 3 || flow_status == 7){
status_update_bm.execute({
flow_id:flow_id
})
}
}
}
$ctx.parameter.return_status = '0';
$ctx.parameter.return_message = '执行成功';
} catch (e) {
$ctx.success = "true";
$ctx.parameter.return_status = 'E';
$ctx.parameter.return_message = $ctx.get('/error/@message') || String(e);
$bm('wx.WX100.rollback').update();
//raise_app_error(e);
}
var result = {
result: $ctx.parameter.return_status,
message: $ctx.parameter.return_message
};
$ctx.parameter.json = JSON.stringify(result);
}
if ($ctx.parameter.return_status != 'E' && $ctx.parameter.return_status != 'TIMEOUT') {
ele_file_download();
}
]]></s:server-script>
</a:init-procedure>
<a:service-output/>
</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 data = $ctx.parameter.requestData;
var data_ob=JSON.parse(data);*/
var contract_no= $ctx.parameter.contractNo;
var data = "action:" + $ctx.parameter.action + ",flowId:" + $ctx.parameter.flowId + ",signResult:" + $ctx.parameter.signResult + ",flowStatus:" + $ctx.parameter.flowStatus
+ ",signTime:" + $ctx.parameter.signTime + ",esignType:" + $ctx.parameter.esignType;
var logs_bm = $bm('wx.WX100.con_ele_savelogs');
logs_bm.insert({
contract_id:contract_no,
httpurl:'回调接口',
jsonPut:null,
jsonResult:data.toString(),
tokenResult:null
});
var signer_status_update_bm = $bm('wx.WX100.con_ele_signer_status_update');
//个人签署完成 (代理店流程不处理个人签署完成)
if ($ctx.parameter.action == 'SIGN_FLOW_UPDATE' && $ctx.parameter.signResult == '2' && $ctx.parameter.esignType != 'AE'){
var idNos = $ctx.parameter.idNos;
var idNos_json = JSON.parse(idNos);
var idNos_list = idNos_json.idNoList;
for(var i = 0 ; i < idNos_list.length; i++){
signer_status_update_bm.update({
contract_id:contract_no,
flow_id:$ctx.parameter.flowId,
id_no:idNos_list[i].idNo,
sign_time:$ctx.parameter.signTime,
sign_result:$ctx.parameter.signResult,
esign_type:$ctx.parameter.esignType
});
}
$ctx.parameter.return_status = '0';
$ctx.parameter.return_message = '修改成功';
}
//合同签署完成
else if($ctx.parameter.action == 'SIGN_FLOW_FINISH' && $ctx.parameter.flowStatus == '2'){
signer_status_update_bm.insert({
contract_id:contract_no,
flow_id:$ctx.parameter.flowId,
flow_status:$ctx.parameter.flowStatus,
end_time:$ctx.parameter.endTime
});
$ctx.parameter.return_status = '0';
$ctx.parameter.return_message = '修改成功';
} else if($ctx.parameter.action == 'SIGN_FLOW_FINISH' && ($ctx.parameter.flowStatus == '5' || $ctx.parameter.flowStatus == '7')){
//拒签或者过期
var sign_cancel_bm = $bm('cont.CON505.contract_sign_cancel');
sign_cancel_bm.execute({
contract_id:contract_no
})
$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);
//$bm('wx.WX100.rollback').update();
}
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: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 = info_query('UP_FILE_TOKEN_URL').code_value;
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 info = info_query('HL_ELE_FILE_PATH');
var file_path = info.code_value;
//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_et_contract_signer_save');
ele_contract_signer_bm.update({
contract_id: $ctx.parameter.contract_id
});
/* //第一步生成提前结清文本
$bm('cont.CON732.con_et_content_create').update({
contract_id: $ctx.parameter.contract_id,
ccr_document_type: 'ET',
content_type:'NORMAL'
});*/
//组装签署人校验报文
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,
esign_type:'ET'
});
var ele_signer_data = ele_signer_map.getChildren();
var userInfoList = [];
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'){
userInfoList.push({
"idNo":signer_record_data.id_no,
"name":signer_record_data.bp_name,
"mobile":signer_record_data.mobile,
"signerCategory":signer_record_data.signer_category
});
}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;
//法人
var legalName = signer_record_data.legal_person;
var legalIdNo = signer_record_data.id_card_no_leg;
if (agentIdNo == legalIdNo){
userInfoList.push({
"idNo":signer_record_data.id_no,
"name":signer_record_data.bp_name,
"agentIdNo":agentIdNo,
"agentName":agentName,
"mobile":mobile,
"legalName":legalName,
"legalIdNo":legalIdNo,
"agentType":"1",
"signerCategory":signer_record_data.signer_category
});
}else{
userInfoList.push({
"idNo":signer_record_data.id_no,
"name":signer_record_data.bp_name,
"agentIdNo":agentIdNo,
"agentName":agentName,
"mobile":mobile,
"legalName":legalName,
"legalIdNo":legalIdNo,
"agentType":"2",
"signerCategory":signer_record_data.signer_category
});
}
}
}
//获取中台token
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 info = info_query('HL_ELE_ACCOUNT_CREATE_PATH');
var httpUrl = info.code_value;
var Param = {
userInfo:userInfoList
}
var result = EleFileUpHttpPost.post(httpUrl, JSON.stringify(Param), access_sign_token);
logs_bm.insert({
contract_id: $ctx.parameter.contract_id,
httpurl: httpUrl,
jsonPut: JSON.stringify(Param),
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(result_ob.message.toString());
}
//生成合同文本
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_et_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.replace('X:','/mnt'),
"fileName": con_ele_unsigned_file_data[n].file_name,
"fileSize": con_ele_unsigned_file_data[n].file_size
});
}
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();
var contract_number = ele_contract_signer_data[0].contract_number;
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_et_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.replace('X:','/mnt'),
"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,
contractNumber:contract_number,
esignType:"ET",
userInfo:userInfoList,
conFileList:conFileList,
signer:signer
}
var result = EleFileUpHttpPost.post(httpUrl, JSON.stringify(signParam), access_sign_token);
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('发起签约失败,请联系技术人员检查!');
raise_app_error(result_ob.message.toString());
}else if(result_ob.code == 0){
var flow_id = result_ob.flowId;
var flow_update_bm = $bm('wx.WX100.con_ele_flow_update');
var flow_del_bm = $bm('wx.WX100.con_et_flow_update');
flow_del_bm.delete({
contract_id: $ctx.parameter.contract_id
})
flow_update_bm.update({
contract_id: $ctx.parameter.contract_id,
flow_id: flow_id,
esign_type: 'ET'
})
flow_update_bm.execute({
contract_id: $ctx.parameter.contract_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,
esign_type:'ET'
})
}
}
]]></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 import="app/app_login_check.js"><![CDATA[
function get_current_time() {
var leaseFlag_map;
var leaseFlag;
try {
var leaseFlag_query = $bm('wx.WX100.get_current_time');
leaseFlag_map = leaseFlag_query.queryAsMap({
lease_start_date:$ctx.parameter.leaseStartDate
});
var existsFlag_details = leaseFlag_map.getChildren();
leaseFlag = existsFlag_details[0].lease_flag;
$ctx.parameter.return_status = '0';
$ctx.parameter.return_message = '执行成功';
} catch (e) {
$ctx.success = "false";
$ctx.parameter.return_status = '1';
$ctx.parameter.return_message = String(e);
leaseFlag = '';
}
//返回结果
var result = {
code: $ctx.parameter.return_status,
message: $ctx.parameter.return_message,
leaseFlag: leaseFlag
};
$ctx.parameter.json = JSON.stringify(result);
}
if ($ctx.parameter.return_status != 'E' && $ctx.parameter.return_status != 'TIMEOUT') {
get_current_time();
}
]]></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>
<s:server-script import="app/app_login_check.js"><![CDATA[
importPackage(java.io);
importPackage(java.util.zip);
//系统参数获取
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;
}
//@purpose 实现多个合同附件打包成一个压缩包下载
//打包文件路径
var file_dir = info_query('HL_ELE_PACKAGE_PATH').code_value;
//下载压缩包
function get_file_length(path){
var file=new File(String(path));
if (file.exists() && file.isFile()){
//println(f.length());
length=file.length();
return length;
} else{
return 0;
}
}
function writeFile(zos, fn, fp) {
var ze = new ZipEntry(fn);
//zos.setEncoding("UTF-8");//如果是org.apache.tools.zip需要追加字符集
zos.putNextEntry(ze);
var fis = new FileInputStream(fp);
var b = new java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024 * 64);
var len = -1;
while ((len = fis.read(b)) != -1) {
zos.write(b, 0, len);
}
fis.close();
}
function getdate() {
var now = new Date()
y = now.getFullYear()
m = now.getMonth() + 1
d = now.getDate()
m = m < 10 ? "0" + m : m
d = d < 10 ? "0" + d : d
return y + "" + m + "" + d
}
var file_name = null;
var file_url = null;
var file_size = null;
function wx_con_ele_atm_dl() {
try {
//将各个合同下的附件复制到指定的目标文件夹
if($ctx.parameter.type == 'ZIP') {
var con_info_bm = $bm('wx.WX100.con_ele_contract_signer_query');
var con_info = con_info_bm.queryAsMap({
contract_id: $ctx.parameter.atmId
});
var contract_number = con_info.getChildren()[0].contract_number;
//时间戳作为压缩文件夹名称
var date_str = getdate();
var doc_code = '合同签约附件';
var zip_filename = doc_code + '-'+ contract_number + '-' + date_str + ".zip";
var tranfer_dir= new File(String(file_dir));
if(!tranfer_dir.exists()){
tranfer_dir.mkdirs();//创建文件夹
}
var tranfer_file_path = file_dir + "/" + zip_filename;
var zipFile= new File(String(tranfer_file_path));
if(!zipFile.exists()){//如果文件夹不存在,创建年月文件夹
zipFile.createNewFile();
}
var zos = new ZipOutputStream(new FileOutputStream(zipFile));
var con_batch_dl = $bm('wx.WX100.con_file_download');
var result = con_batch_dl.queryAsMap({
contract_id: $ctx.parameter.atmId,
id_no: $ctx.parameter.idNo
});
var arr_con = result.getChildren();
for (var i = 0; i < arr_con.length; i++) {
var f = arr_con[i];
if (f.file_path ) {
writeFile(zos, f.file_name, f.file_path);
}
}
zos.close();
file_url = tranfer_file_path.toString().replace('X:','/mnt');
file_name = zip_filename;
file_size = get_file_length(tranfer_file_path);
} else if ($ctx.parameter.type == 'SIN' && $ctx.parameter.atmId) {
var fnd_atm_query_bm = $bm('wx.WX100.con_fnd_atm_query');
var result = fnd_atm_query_bm.queryAsMap({
attachment_id: $ctx.parameter.atmId
});
var result_data = result.getChildren()[0];
file_url = result_data.file_path.replace('X:','/mnt');
file_name = result_data.file_name;
file_size = result_data.file_size;
}
$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,
fileName:file_name,
fileUrl:file_url,
fileSize:file_size
};
$ctx.parameter.json = JSON.stringify(result);
}
if ($ctx.parameter.return_status != 'E' && $ctx.parameter.return_status != 'TIMEOUT') {
wx_con_ele_atm_dl();
}
]]></s:server-script>
</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 import="app/app_login_check.js"><![CDATA[
function send_email() {
try {
if($ctx.parameter.email && $ctx.parameter.contractNo && $ctx.parameter.idNo) {
var ele_file_email_bm = $bm('wx.WX100.wx_ele_file_email');
ele_file_email_bm.insert({
mail_to: $ctx.parameter.email,
contract_id:$ctx.parameter.contractNo,
id_no:$ctx.parameter.idNo
});
$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
};
$ctx.parameter.json = JSON.stringify(result);
}
send_email();
]]></s:server-script>
</a:init-procedure>
<a:service-output output="/parameter/@json"/>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zc
$Date: 2020年11月27日 09点35分
$Revision: 1.0
$Purpose:
-->
<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.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 = info_query('UP_FILE_TOKEN_URL').code_value;
//系统参数获取
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;
}
//依据合同文本签署人定义存储签署人信息
if ($ctx.parameter.esign_type == 'CE'){
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'
});
}else if($ctx.parameter.esign_type == 'ET'){
//依据提前结清合同文本签署人定义存储签署人信息
var ele_contract_signer_bm = $bm('wx.WX100.con_et_contract_signer_save');
ele_contract_signer_bm.update({
contract_id: $ctx.parameter.contract_id
});
//第一步生成提前结清文本
$bm('cont.CON732.con_et_content_create').update({
contract_id: $ctx.parameter.contract_id,
ccr_document_type: 'ET',
content_type:'NORMAL'
});
}
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,
esign_type:$ctx.parameter.esign_type
});
var ele_signer_data = ele_signer_map.getChildren();
//合同经办人信息
var userInfoList = [];
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_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 agentIdNo = ele_org_signer_data[0].id_no;
var mobile = ele_org_signer_data[0].mobile;
userInfoList.push({
"license":signer_record_data.id_no,
"idNo":agentIdNo
});
}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',
id_no:signer_record_data.id_card_no_leg
});
var ele_org_signer_data = ele_org_signer_map.getChildren();
var agentIdNo = ele_org_signer_data[0].id_no;
var mobile = ele_org_signer_data[0].mobile;
userInfoList.push({
"license":signer_record_data.id_no,
"idNo":agentIdNo
});
}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 agentIdNo = ele_org_signer_data[0].id_no;
var mobile = ele_org_signer_data[0].mobile;
userInfoList.push({
"license":signer_record_data.id_no,
"idNo":agentIdNo
});
}
}
//调用中台校验经办人
var info = info_query('HL_ELE_AGENT_CHECK_PATH');
var httpUrl = info.code_value;
var verifyParam = {
userInfo:userInfoList
}
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 post_result = EleFileUpHttpPost.post(httpUrl, JSON.stringify(verifyParam), access_sign_token);
logs_bm.insert({
contract_id:$ctx.parameter.contract_id,
httpurl:httpUrl,
jsonPut:JSON.stringify(verifyParam),
jsonResult:post_result,
tokenResult:token_sign_result
});
var result_ob = JSON.parse(post_result); //根据返回参数形式再定
if (result_ob.code != 0) {
//rollback
var result_message = result_ob.message;
$ctx.parameter.check_flag = 'N';
$ctx.parameter.result_message = result_message;
}
]]></s:server-script>
</a:init-procedure>
<a:service-output output="/parameter"/>
</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 import="app/app_login_check.js"><![CDATA[
importPackage(Packages.com.hand.hls.hlcm.emay);
function send_sms() {
try {
if($ctx.parameter.mobile) {
// 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');
var md5_check_id = $ctx.parameter.md5_check_id;
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 example = new Example();
var result = example.setSingleSms(content, Phones);
var req_response = result.toString();
} 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,
checkId:md5_check_id
};
$ctx.parameter.json = JSON.stringify(result);
}
send_sms();
]]></s:server-script>
</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 import="app/app_login_check.js"><![CDATA[
function verify_validation_code() {
try {
if($ctx.parameter.checkId && $ctx.parameter.validationKey){
var verify_code_sms_bm = $bm('wx.WX100.wx_verify_validation_code');
verify_code_sms_bm.update({
check_id:$ctx.parameter.checkId,
validation_key:$ctx.parameter.validationKey
});
$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,
checkFlag:$ctx.parameter.check_flag,
checkResult:$ctx.parameter.check_result
};
$ctx.parameter.json = JSON.stringify(result);
}
verify_validation_code();
]]></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