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 @@
<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="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="version_date"/>
<bm:field name="tax_type_rate" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TAX_TYPE_RATE"/>
......@@ -40,6 +41,7 @@
<bm:query-field field="templet_usage" 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="ele_content_flag" queryExpression="(t1.ele_content_flag = ${@ele_content_flag} or ${@ele_content_flag}=&apos;ALL&apos;)"/>
</bm:query-fields>
<e:exception-descriptor-config>
<e:exception-descriptor exception="java.sql.SQLException" handleClass="leaf.database.SQLExceptionDescriptor">
......
......@@ -62,6 +62,8 @@
<bm:field name="first_contract_flag"/>
<bm:field name="finance_type"/>
<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_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 @@
t1.download_content_flag,
t1.agent_content_flag_name,
t1.download_content_flag_name,
t1.print_date
t1.print_date,
t1.order_seq
FROM
CON_CONTRACT_CONTENT_V t1
WHERE
t1.templet_usage in ('CON_SALE', 'CONTRACT')
)t
#WHERE_CLAUSE#
ORDER BY decode(t.bp_category,'TENANT',0,'GUARANTOR',1,'VENDER',2,'')
ORDER BY t.order_seq,decode(t.bp_category,'TENANT',0,'GUARANTOR',1,'VENDER',2,'')
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t.contract_id=${@contract_id}"/>
<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:model>
......@@ -50,7 +50,7 @@
m.table_pk_value = lt.templet_id AND
lt.templet_id = t.doc_template_id 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
(
cc.content_id =${/parameter/@content_id} OR
......@@ -59,6 +59,7 @@
${/parameter/@batch_flag}='Y'
)
)
order by t.order_seq
]]></bm:query-sql>
</bm:operation>
</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 = [
{
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))))"
},
{
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 = [
{
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 @@
para: {
function_name: '%' + document.getElementById('sp-searchtext').value + '%',
enabled_flag: 'Y',
role_id: ${/session/@role_id}
role_id: '${/session/@role_id}'
},
success: function (res) {
if (res.result.record) {
......@@ -1007,7 +1007,7 @@
url: $('BmLink_sys_user_query').getUrl(),
scope: this,
para: {
user_id: ${/session/@user_id}
user_id: '${/session/@user_id}'
},
success: function (res) {
if (res.success && res.result.record) {
......@@ -1067,7 +1067,7 @@
closeable: true,
draggable: true,
params: {
user_id:${/session/@user_id},
user_id:'${/session/@user_id}',
win_id: 'img_upload_window'
},
height: 468,
......@@ -1120,7 +1120,7 @@
url: $('BmLink_sys_user_update').getUrl(),
scope: this,
para: {
user_id: ${/session/@user_id},
user_id: '${/session/@user_id}',
email: $jq('[name="email"]').val(),
phone: $jq('[name="phone"]').val()
},
......@@ -1417,7 +1417,7 @@
}
function to_get_code() {
var userCodes = $('sys_role_ds').getAll();
var roleId = ${/session/@role_id};
var roleId = '${/session/@role_id}';
var roleCode;
userCodes.forEach(function (value) {
value.data.role_id == roleId && (roleCode = value.data.role_code)
......@@ -1435,7 +1435,7 @@
if (res.success) {
var userName = '';
res.result.record.forEach(function (value) {
if (value.user_id == ${/session/@user_id}) {
if (value.user_id == '${/session/@user_id}') {
userName = value.user_name;
}
});
......@@ -1449,7 +1449,7 @@
var userDs = $('userDs').getAll();
var userName;
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();
......@@ -2319,7 +2319,7 @@
Leaf.request({
url: $('').getUrl(),
para: {
role_id: ${/session/@role_id}
role_id: '${/session/@role_id}'
},
scope: this,
success: function (res) {
......
......@@ -23,6 +23,8 @@
<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="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:fields>
<a:field name="template_code" defaultValue="${/parameter/@tmpt_code}" readOnly="true"/>
......@@ -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="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="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_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">
......@@ -133,6 +137,9 @@
<!-- <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="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:columns>
......
......@@ -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="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="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: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">
......@@ -110,6 +111,7 @@
<a:field name="description" required="true"/>
<a:field name="templet_usage" required="true"/>
<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="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"/>
......@@ -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="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="ele_content_flag_des" bindTarget="con202_clause_templet_query_ds" prompt="电子签约合同文本"/>
</a:form>
<a:grid id="con202_clause_templet_functionTreeGrid" bindTarget="con202_clause_templet_result_ds" marginHeight="130" marginWidth="50" navBar="true" width="800">
<a:columns>
......@@ -154,6 +157,8 @@
<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="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="where_caluse" prompt="文本打印条件" renderer="where_caluse_renderer" width="100"/>
<a:column name="version_date" editor="con202_clause_templet_grid_tf" prompt="版本号" width="100"/>
......
......@@ -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="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_ele_doc_batch_create_link_id" url="${/request/@context_path}/modules/cont/CON500/con_ele_doc_batch_create.lsc"/>
<script><![CDATA[
function con_print_detail_print(){
//lock_current_window();
......@@ -61,7 +62,6 @@
scope: this
});
}
function lock_current_window() {
Leaf.Masker.mask($('${/parameter/@winid}').wrap, '${l:HLS.EXECUTING}');
}
......
......@@ -56,6 +56,8 @@
else{
param['function_code'] = 'CON301';
param['function_usage'] = 'QUERY';
//add by 24976
param['sign_contract_status'] = record.get('sign_contract_status');
}
param['winid'] = 'con_contract_modify_win_id';
param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
......
......@@ -141,7 +141,7 @@
} 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' ) {
} 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');
//电子合同
......@@ -160,10 +160,10 @@
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') {
// 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>' + ',';
......@@ -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 '';
} 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 @@
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 () {
//
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
......@@ -469,13 +498,13 @@
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 == $(ds_id)) {
// var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_bs_score');
// if (ds == $(ds_id)) {
// qpara.contract_id = '${/parameter/@contract_id}';
// qpara.contract_id = '${/parameter/@contract_id}';
//$(ds_id).setQueryParameter('contract_id', '${/parameter/@contract_id}');
// }
//$(ds_id).setQueryParameter('contract_id', '${/parameter/@contract_id}');
// }
};
window['${/parameter/@layout_code}_submit_approval_layout_dynamic_click'] = function () {
......
<?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"?>
<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>
......@@ -20,6 +20,8 @@
<script src="${/request/@context_path}/modules/prj/PRJ500N/javascripts/input_validator.js"
type="text/javascript"/>
<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[
Leaf.onReady(function () {
var unit_id = '${/model/user_agent_description/record/@unit_id}';
......@@ -386,6 +388,27 @@
}
$(ds_id).setQueryParameter('bp_id', head_record.get('bp_id'));
$(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']();
};
......@@ -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) {
......@@ -672,6 +720,10 @@
return '<font color="RED">' + value + '</font>';
}
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 @@
<a:link id="${/parameter/@layout_code}_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
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_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"-->
......@@ -122,6 +124,30 @@
if (!(records == 'undefined' || records == null)) {
$(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]+$/;
......@@ -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) {
//
......@@ -615,6 +666,10 @@
return '<font color="RED">' + value + '</font>';
}
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 @@
}
}
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) {
......@@ -681,6 +703,14 @@
return '<font color="RED">' + value + '</font>';
}
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,15 +8,16 @@
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<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_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"/>
<script type="text/javascript"><![CDATA[
function hls810_add() {
var ds = $('hls_doc_file_temp_ds');
var record = ds.create(ds.currentIndex);
$('hls_doc_file_temp_ds_id').showEditorByRecord(record);
}
function hls810_delete() {
var ds = $('hls_doc_file_temp_ds');
var records = ds.getSelected();
......@@ -25,17 +26,17 @@
ds.remove(records);
});
}
}
function hls810_save() {
var ds = $('hls_doc_file_temp_ds');
if (ds.validate()) {
ds.submit();
}
}
function editor_check(record, name) {
if (record.isNew) {
if(name=='templet_code' )
......@@ -45,7 +46,7 @@
}
return '' ;
}
function hls810_query(){
$('hls_doc_file_temp_ds').query();
}
......@@ -66,6 +67,23 @@
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){
var tmpt_id = record.get('templet_id');
if(!record.isNew){
......@@ -152,6 +170,7 @@
<a:column name="note" editor="textArea_ed" prompt="说明" width="200"/>
<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="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="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>
This diff is collapsed.
<?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>
This diff is collapsed.
<?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>
This diff is collapsed.
<?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