Commit cc6e1098 authored by congzhao's avatar congzhao

[建机]电子合同开发 合同签约流程改造

parent 1de72cde
......@@ -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
......
<?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>
......@@ -19,8 +19,10 @@
</bm:operation>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select t.ele_flow_id
FROM con_contract t
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) t
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
......@@ -35,15 +37,17 @@
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') and t.contract_id = ${@contract_id};
commit;
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="ele_flow_id"/>
<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-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月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.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>
......@@ -5,97 +5,6 @@
<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,
cr.ec_sign_type,
decode(cr.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((SELECT cs.esign_type
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),
'CE',
'合同签约',
'ET',
'提前结清') contract_status_n,
(select ci.brand_id
from con_contract_lease_item ci
where ci.contract_id = t1.contract_id
and ci.equipment_type = 'MAIN') brand_id,
NVL((SELECT a.description
FROM hls_car_brands_vl a
WHERE a.brand_id =
(select ci.brand_id
from con_contract_lease_item ci
where ci.contract_id = t1.contract_id
and ci.equipment_type = 'MAIN')),
'日立') brand_id_n,
(select ci.modelcd
from con_contract_lease_item ci
where ci.contract_id = t1.contract_id
and ci.equipment_type = 'MAIN') modelcd, --机型
(SELECT i.machine_number
FROM con_contract_lease_item i
WHERE i.contract_id = t1.contract_id
AND i.equipment_type = 'MAIN') machine_number, --机号
t1.lease_times, --期数
(NVL(t1.down_payment, 0) + NVL(t1.residual_value, 0) +
NVL(t1.total_rental, 0)) total_sign,
(SELECT cs.sign_url
from con_contract_ele_signer cs
where cs.contract_id = t1.contract_id
and ((${@account_type} = 'AG' and
cs.id_no =
(select hm.social_code
from hls_bp_master hm
where t1.bp_id_tenant = hm.bp_id)) 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, con_contract_change_req cr
where t1.contract_id = cr.contract_id
and cr.ec_sign_type in ('INITIATE', 'SIGNING')
and cr.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})))
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}))
or (${@account_type} = 'AG' and exists (select 1 from con_contract_bp cb where cb.contract_id = t1.contract_id and cb.bp_category = 'GUARANTOR' and cb.bp_class = 'ORG' 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}))
)
UNION ALL
select t1.contract_id,
t1.contract_number,
t1.contract_status,
t1.bp_id_tenant,
......@@ -151,17 +60,24 @@ select *
t1.lease_times, --期数
(NVL(t1.down_payment, 0) + NVL(t1.residual_value, 0) +
NVL(t1.total_rental, 0)) total_sign,
(SELECT cs.sign_url
from con_contract_ele_signer cs
where cs.contract_id = t1.contract_id
and ((${@account_type} = 'AG' and
cs.id_no =
(select hm.social_code
from hls_bp_master hm
where t1.bp_id_tenant = hm.bp_id)) or
(${@account_type} != 'AG' and
cs.id_no = ${@id_no}))
and rownum = 1) sign_url,
(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
......@@ -172,20 +88,32 @@ select *
where t1.data_class = 'NORMAL'
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})))
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}))
or (${@account_type} = 'AG' and exists (select 1 from con_contract_bp cb where cb.contract_id = t1.contract_id and cb.bp_category = 'GUARANTOR' and cb.bp_class = 'ORG' 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
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}))) 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})) or
(${@account_type} = 'AG' and exists
(select 1
from con_contract_bp cb
where cb.contract_id = t1.contract_id
and cb.bp_category = 'GUARANTOR'
and cb.bp_class = 'ORG'
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>
......
......@@ -24,7 +24,7 @@
<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 and c.data_class = 'NORMAL') contract_number,
(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,
......
......@@ -13,18 +13,11 @@
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select * from (select c.contract_id, c.ele_flow_id
from con_contract c
where c.sign_type = 'ELE_SIGN'
and nvl(c.ele_file_dl_flag,'N') = 'N'
and c.data_class = 'NORMAL'
and c.flow_status = 2
union all
select cr.contract_id, cr.ele_flow_id
from con_contract_change_req cr
where cr.sign_type = 'ELE_SIGN'
and nvl(cr.ele_file_dl_flag, 'N') = 'N'
and cr.flow_status = 2) t1
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) t1
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
......@@ -43,13 +36,9 @@
<bm:operation name="execute">
<bm:update-sql><![CDATA[
BEGIN
update con_contract c
set c.ele_file_dl_flag = 'Y'
where c.ele_flow_id =${@flow_id}
and c.contract_id =${@contract_id};
update con_contract_change_req cr
set cr.ele_file_dl_flag = 'Y'
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}
and cr.contract_id =${@contract_id};
COMMIT;
......
<?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>
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
UPDATE CON_CONTRACT c
SET c.ele_flow_id = ${@flow_id},
c.ec_sign_type = 'INITIATE',
c.sign_contract_status = 'SIGNING',
c.last_updated_by = nvl(${/session/@user_id},1),
c.last_update_date = sysdate
WHERE c.contract_id = ${@contract_id};
END;
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>
BEGIN
UPDATE CON_CONTRACT c
SET c.ec_sign_type = 'INITIATE',
c.sign_contract_status = 'SIGNING',
c.last_updated_by = nvl(${/session/@user_id},1),
c.last_update_date = sysdate
WHERE c.contract_id = ${@contract_id};
end;
</bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
......@@ -27,6 +27,7 @@
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')
......@@ -37,6 +38,7 @@
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'))
......
......@@ -11,12 +11,12 @@
cs.last_update_date = sysdate
WHERE cs.contract_id = ${@contract_id}
AND cs.id_no = ${@id_no}
AND cs.esign_type = 'CE';
AND cs.esign_type = ${@esign_type};
update con_contract cc
set cc.ec_sign_type = 'SIGNING',
cc.last_update_date = sysdate
where cc.ele_flow_id = ${@flow_id}
where cc.contract_id = ${@contract_id}
and cc.ec_sign_type != 'SIGNED';
END;
]]></bm:update-sql>
......@@ -27,11 +27,14 @@
update con_contract cc
set cc.ec_sign_type = 'SIGNED',
cc.sign_contract_status = 'SIGN',
cc.flow_status = ${@flow_status},
cc.end_time = to_date(${@end_time},'yyyy-mm-dd HH24:MI:SS'),
cc.last_update_date = sysdate
where cc.ele_flow_id = ${@flow_id}
and cc.contract_id = ${@contract_id};
where cc.contract_id = ${@contract_id};
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',
......
......@@ -22,10 +22,10 @@
and cc.templet_id = ct.templet_id
and fm.table_pk_value in
(select t.content_id
from con_contract_content t,con_ele_signer_file cf
from con_contract_content t
where t.contract_id = ${@contract_id}
and t.templet_id = cf.templet_id
and cf.templet_code != 'SETTLE_ADVANCE_OEC')
and t.clause_usage != 'AGENT_CONTRACT'
and t.clause_usage != 'CHANGE_REQ')
order by ct.order_seq
]]></bm:query-sql>
</bm:operation>
......
......@@ -30,8 +30,7 @@
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,
where cc.contract_id = cs.contract_id) contract_number,
cs.contract_id,
cs.bp_id,
cs.bp_name,
......
......@@ -22,10 +22,9 @@
and cc.templet_id = ct.templet_id
and fm.table_pk_value in
(select t.content_id
from con_contract_content t,con_ele_signer_file cf
from con_contract_content t
where t.contract_id = ${@contract_id}
and t.templet_id = cf.templet_id
and cf.templet_code = 'SETTLE_ADVANCE_OEC')
and t.clause_usage = 'CHANGE_REQ')
order by ct.order_seq
]]></bm:query-sql>
</bm:operation>
......
......@@ -48,14 +48,27 @@ select fa.file_name,fa.file_path,fa.attachment_id
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 (((select cr.id_type from con_contract_ele_signer cr where cr.id_no = ${@id_no} and rownum = 1) = 'IdCard'
and ((((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) != 'AGENT' or
(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) is null)
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 (select cr.id_type from con_contract_ele_signer cr where cr.id_no = ${@id_no} and rownum = 1) = 'license'))
or (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) = 'AGENT'))
and pi.cdd_list_id =
(select cc.cdd_list_id
from con_contract cc
......
......@@ -9,43 +9,50 @@
<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 = ${@contract_id}
and (((select cr.id_type
from con_contract_ele_signer cr
where cr.id_no = ${@id_no}
and rownum = 1) = 'IdCard' 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
(select cr.id_type
from con_contract_ele_signer cr
where cr.id_no = ${@id_no}
and rownum = 1) = 'license'))
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 ((((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) != 'AGENT' or
(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) is null) 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
(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) = 'AGENT'))
order by ct.order_seq
]]></bm:query-sql>
</bm:operation>
......
......@@ -5,7 +5,7 @@
importPackage(java.io);
importPackage(Packages.com.hand.elecon.httpost);
var up_file_token_url = 'http://hlsapp.hand-china.com/hl_dr_dev/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password=admin'; //文件上传获取token的地址
var up_file_token_url = info_query('UP_FILE_TOKEN_URL').code_value;
//系统参数获取
function info_query(parameter_code) {
var info = new Object();
......@@ -23,9 +23,15 @@
var sign_cancel_map = sign_cancel_bm.queryAsMap({
contract_id:$ctx.parameter.contract_id
});
var flow_Id = sign_cancel_map.getChildren()[0].ele_flow_id;
var 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 = {
flowId:flow_Id
revokeFlows:revoke_flows
}
//调用中台取消流程
var info = info_query('HL_SIGN_FLOW_CANCEL');
......@@ -47,14 +53,31 @@
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){
sign_cancel_bm.execute({
contract_id:$ctx.parameter.contract_id
})
var revokeFlows = result_ob.revokeFlows;
var all_revoke_flag = 'Y';
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';
}
}
if(all_revoke_flag == 'Y'){
sign_cancel_bm.execute({
contract_id:$ctx.parameter.contract_id
});
}else{
raise_app_error('取消签约未完成,请再次发起取消签约!');
}
}
]]></s:server-script>
</a:init-procedure>
......
......@@ -303,17 +303,18 @@
var req_record = $(req_ds_id).getAt(0);
var req_status = req_record.get('req_status');
var contract_id = req_record.get('contract_id');
if (req_status != 'NEW') {
var change_req_id = req_record.get('change_req_id');
/* if (req_status != 'NEW') {
Leaf.showMessage('${l:PROMPT}', '只有新建状态的才能发起电子签约');
return;
}
}*/
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认发起电子签约?', function () {
$('${/parameter/@layout_code}_user_button3').disable();
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url:$('${/parameter/@layout_code}_ele_operator_verify_link_id').getUrl(),
para:{
contract_id:contract_id,
contract_id:change_req_id,
esign_type:'ET'
},
scope:this,
......@@ -323,7 +324,7 @@
Leaf.request({
url: $('${/parameter/@layout_code}_con_ele_terminate_create_link_id').getUrl(),
para: {
contract_id: contract_id
contract_id: change_req_id
},
success: function(res) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
......@@ -343,7 +344,7 @@
Leaf.request({
url: $('${/parameter/@layout_code}_con_ele_terminate_create_link_id').getUrl(),
para: {
contract_id: contract_id
contract_id: change_req_id
},
success: function(res) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
......
......@@ -5,7 +5,7 @@
importPackage(java.io);
importPackage(Packages.com.hand.elecon.httpost);
var up_file_token_url = 'http://hlsapp.hand-china.com/hl_dr_dev/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password=admin'; //文件上传获取token的地址
var up_file_token_url = info_query('UP_FILE_TOKEN_URL').code_value;
//系统参数获取
function info_query(parameter_code) {
......
......@@ -10,7 +10,7 @@
/* 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;
var data = "action:" + $ctx.parameter.action + ",flowId:" + $ctx.parameter.flowId + ",signResult:" + $ctx.parameter.signResult + ",flowStatus:" + $ctx.parameter.flowStatus;
var logs_bm = $bm('wx.WX100.con_ele_savelogs');
logs_bm.insert({
contract_id:contract_no,
......@@ -19,15 +19,9 @@
jsonResult:data.toString(),
tokenResult:null
});
var signer_status_update_bm;
if ($ctx.parameter.esignType == 'CE'){
signer_status_update_bm= $bm('wx.WX100.con_ele_signer_status_update');
}else if ($ctx.parameter.esignType == 'ET') {
signer_status_update_bm = $bm('wx.WX100.con_et_signer_status_update');
}
//个人签署完成
if ($ctx.parameter.action == 'SIGN_FLOW_UPDATE' && $ctx.parameter.signResult == '2'){
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;
......@@ -37,7 +31,8 @@
flow_id:$ctx.parameter.flowId,
id_no:idNos_list[i].idNo,
sign_time:$ctx.parameter.signTime,
sign_result:$ctx.parameter.signResult
sign_result:$ctx.parameter.signResult,
esign_type:$ctx.parameter.esignType
});
}
$ctx.parameter.return_status = '0';
......
......@@ -11,7 +11,7 @@
importPackage(Packages.org.apache.commons.io);
importPackage(Packages.com.hand.elecon.httpost);
var up_file_token_url = 'http://hlsapp.hand-china.com/hl_dr_dev/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password=admin'; //文件上传获取token的地址
var up_file_token_url = info_query('UP_FILE_TOKEN_URL').code_value;
function copyFile(fOld, fNew) {
var fis = new java.io.FileInputStream(fOld);
......@@ -284,10 +284,11 @@
raise_app_error(result_ob.message.toString());
}else if(result_ob.code == 0){
var flow_id = result_ob.flowId;
var flow_update_bm = $bm('wx.WX100.con_et_flow_update');
var flow_update_bm = $bm('wx.WX100.con_ele_flow_update');
flow_update_bm.update({
contract_id:$ctx.parameter.contract_id,
flow_id:flow_id
contract_id: $ctx.parameter.contract_id,
flow_id: flow_id,
esign_type: 'ET'
})
var sign_url_list = result_ob.signUrlList;
var ele_con_info_bm = $bm('wx.WX100.con_ele_con_info_update');
......
......@@ -14,7 +14,7 @@
importPackage(Packages.org.apache.commons.io);
importPackage(Packages.com.hand.elecon.httpost);
var up_file_token_url = 'http://hlsapp.hand-china.com/hl_dr_dev/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password=admin'; //文件上传获取token的地址
var up_file_token_url = info_query('UP_FILE_TOKEN_URL').code_value;
//系统参数获取
function info_query(parameter_code) {
var info = new Object();
......
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