Commit 1d93ef9d authored by congzhao's avatar congzhao

[建机]电子合同开发 配偶是否签署以及签署校验调整,下载文件调整

parent f053a568
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
<bm:field name="finance_type"/> <bm:field name="finance_type"/>
<bm:field name="secondary_lease"/> <bm:field name="secondary_lease"/>
<bm:field name="marital_status_flag"/> <bm:field name="marital_status_flag"/>
<bm:field name="sp_sign_flag"/>
<bm:field name="vender_id"/> <bm:field name="vender_id"/>
<bm:field name="vender_id_n" expression="(decode(vender_id,-100,'买断机',(select scv.bp_name from hls_bp_master scv where scv.enabled_flag=&apos;Y&apos; and scv.bp_id = t1.vender_id)))" forInsert="false" forUpdate="false"/> <bm:field name="vender_id_n" expression="(decode(vender_id,-100,'买断机',(select scv.bp_name from hls_bp_master scv where scv.enabled_flag=&apos;Y&apos; and scv.bp_id = t1.vender_id)))" forInsert="false" forUpdate="false"/>
......
...@@ -19,10 +19,17 @@ ...@@ -19,10 +19,17 @@
</bm:operation> </bm:operation>
<bm:operation name="query"> <bm:operation name="query">
<bm:query-sql><![CDATA[ <bm:query-sql><![CDATA[
select * from (select cf.ele_flow_id,cf.contract_id select *
FROM CON_CONTRACT_ELE_FLOW cf from (select cf.ele_flow_id, cf.contract_id
where cf.ele_flow_type in ('CE','AE') FROM CON_CONTRACT_ELE_FLOW cf
and cf.revoke_flag is null) t 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# #WHERE_CLAUSE#
]]></bm:query-sql> ]]></bm:query-sql>
</bm:operation> </bm:operation>
...@@ -37,7 +44,7 @@ ...@@ -37,7 +44,7 @@
where c.contract_id = ${@contract_id}; where c.contract_id = ${@contract_id};
delete from con_contract_ele_signer cs where cs.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}; delete from CON_CONTRACT_ELE_FLOW t where t.ele_flow_type in ('CE','AE','ET') and t.contract_id = ${@contract_id};
commit; commit;
end; end;
]]></bm:update-sql> ]]></bm:update-sql>
......
...@@ -92,7 +92,7 @@ select * ...@@ -92,7 +92,7 @@ select *
and ccb.contract_id = t1.contract_id and ccb.contract_id = t1.contract_id
and ccb.bp_category in ('TENANT', 'GUARANTOR') and ccb.bp_category in ('TENANT', 'GUARANTOR')
and (ccb.id_card_no = ${@id_no} or and (ccb.id_card_no = ${@id_no} or
ccb.id_no_sp = ${@id_no}))) or (ccb.id_no_sp = ${@id_no} and ccb.sp_sign_flag = 'Y')))) or
(${@account_type} = 'AG' and exists (${@account_type} = 'AG' and exists
(select 1 (select 1
from hls_bp_master_signer hs from hls_bp_master_signer hs
...@@ -110,6 +110,9 @@ select * ...@@ -110,6 +110,9 @@ select *
where hs.hls_bp_signer_id = cr.signer where hs.hls_bp_signer_id = cr.signer
and cr.change_req_id = t1.contract_id and cr.change_req_id = t1.contract_id
and hs.id_card = ${@id_no}) 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 and exists (select 1 from con_contract_ele_signer cs
where cs.id_no = ${@id_no} where cs.id_no = ${@id_no}
and cs.contract_id = t1.contract_id) and cs.contract_id = t1.contract_id)
......
...@@ -32,24 +32,30 @@ ...@@ -32,24 +32,30 @@
cs.mobile, cs.mobile,
hs.signer_category, hs.signer_category,
cs.esign_type, cs.esign_type,
(select hm.legal_person (select nvl(hm.bp_name_leg,hm.legal_person)
from con_contract_bp cb, hls_bp_master hm from con_contract_bp cb, hls_bp_master hm
where cb.bp_id = hm.bp_id where cb.bp_id = hm.bp_id
and cb.contract_id = cs.contract_id and cb.contract_id = cs.contract_id
and cb.bp_category = 'TENANT' and hm.social_code = cs.id_no
and cb.bp_class = 'ORG') legal_person, and cb.bp_class = 'ORG') legal_person,
(select hm.id_card_no_leg (select hm.id_card_no_leg
from con_contract_bp cb, hls_bp_master hm from con_contract_bp cb, hls_bp_master hm
where cb.bp_id = hm.bp_id where cb.bp_id = hm.bp_id
and cb.contract_id = cs.contract_id and cb.contract_id = cs.contract_id
and cb.bp_category = 'TENANT' and hm.social_code = cs.id_no
and cb.bp_class = 'ORG') id_card_no_leg 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 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 where cs.templet_signer_id = hs.templet_signer_id
and ct.doc_template_id = hs.templet_id and ct.doc_template_id = hs.templet_id
and ct.templet_id = cc.templet_id and ct.templet_id = cc.templet_id
and cs.contract_id = cc.contract_id and cs.contract_id = cc.contract_id
and cc.clause_usage = 'AGENT_CONTRACT') t 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# #WHERE_CLAUSE#
]]></bm:query-sql> ]]></bm:query-sql>
</bm:operation> </bm:operation>
...@@ -58,5 +64,6 @@ ...@@ -58,5 +64,6 @@
<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-field name="signer_category" queryExpression="t.signer_category= ${@signer_category}"/> <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="esign_type" queryExpression="t.esign_type= ${@esign_type}"/>
<bm:query-field name="id_no" queryExpression="t.id_no= ${@id_no}"/>
</bm:query-fields> </bm:query-fields>
</bm:model> </bm:model>
...@@ -32,24 +32,30 @@ ...@@ -32,24 +32,30 @@
cs.mobile, cs.mobile,
hs.signer_category, hs.signer_category,
cs.esign_type, cs.esign_type,
(select hm.legal_person (select nvl(hm.bp_name_leg,hm.legal_person)
from con_contract_bp cb, hls_bp_master hm from con_contract_bp cb, hls_bp_master hm
where cb.bp_id = hm.bp_id where cb.bp_id = hm.bp_id
and cb.contract_id = cs.contract_id and cb.contract_id = cs.contract_id
and cb.bp_category = 'TENANT' and hm.social_code = cs.id_no
and cb.bp_class = 'ORG') legal_person, and cb.bp_class = 'ORG') legal_person,
(select hm.id_card_no_leg (select hm.id_card_no_leg
from con_contract_bp cb, hls_bp_master hm from con_contract_bp cb, hls_bp_master hm
where cb.bp_id = hm.bp_id where cb.bp_id = hm.bp_id
and cb.contract_id = cs.contract_id and cb.contract_id = cs.contract_id
and cb.bp_category = 'TENANT' and hm.social_code = cs.id_no
and cb.bp_class = 'ORG') id_card_no_leg 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 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 where cs.templet_signer_id = hs.templet_signer_id
and ct.doc_template_id = hs.templet_id and ct.doc_template_id = hs.templet_id
and ct.templet_id = cc.templet_id and ct.templet_id = cc.templet_id
and cs.contract_id = cc.contract_id and cs.contract_id = cc.contract_id
and cc.clause_usage != 'AGENT_CONTRACT') t 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# #WHERE_CLAUSE#
]]></bm:query-sql> ]]></bm:query-sql>
</bm:operation> </bm:operation>
...@@ -58,5 +64,6 @@ ...@@ -58,5 +64,6 @@
<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-field name="signer_category" queryExpression="t.signer_category= ${@signer_category}"/> <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="esign_type" queryExpression="t.esign_type= ${@esign_type}"/>
<bm:query-field name="id_no" queryExpression="t.id_no= ${@id_no}"/>
</bm:query-fields> </bm:query-fields>
</bm:model> </bm:model>
...@@ -49,7 +49,13 @@ select * ...@@ -49,7 +49,13 @@ select *
hs.signer_category hs.signer_category
from con_contract_ele_signer cs, hls_doc_file_templet_signer hs from con_contract_ele_signer cs, hls_doc_file_templet_signer hs
where cs.templet_signer_id = hs.templet_signer_id where cs.templet_signer_id = hs.templet_signer_id
and cs.esign_type = 'CE') t 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# #WHERE_CLAUSE#
]]></bm:query-sql> ]]></bm:query-sql>
</bm:operation> </bm:operation>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
select c.contract_id, c.ele_flow_id select c.contract_id, c.ele_flow_id
from con_contract_ele_flow c from con_contract_ele_flow c
where nvl(c.ele_file_dl_flag,'N') = 'N' where nvl(c.ele_file_dl_flag,'N') = 'N'
and c.flow_status = 2) t1 and (c.flow_status = 2 or c.flow_status is null)) t1
#WHERE_CLAUSE# #WHERE_CLAUSE#
]]></bm:query-sql> ]]></bm:query-sql>
</bm:operation> </bm:operation>
...@@ -39,8 +39,7 @@ ...@@ -39,8 +39,7 @@
update con_contract_ele_flow cr update con_contract_ele_flow cr
set cr.ele_file_dl_flag = 'Y', set cr.ele_file_dl_flag = 'Y',
cr.last_update_date = sysdate cr.last_update_date = sysdate
where cr.ele_flow_id =${@flow_id} where cr.ele_flow_id =${@flow_id};
and cr.contract_id =${@contract_id};
COMMIT; COMMIT;
END; END;
]]></bm:update-sql> ]]></bm:update-sql>
......
...@@ -47,7 +47,13 @@ ...@@ -47,7 +47,13 @@
hs.signer_category hs.signer_category
from con_contract_ele_signer cs, hls_doc_file_templet_signer hs from con_contract_ele_signer cs, hls_doc_file_templet_signer hs
where cs.templet_signer_id = hs.templet_signer_id where cs.templet_signer_id = hs.templet_signer_id
and cs.esign_type = 'ET') t 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# #WHERE_CLAUSE#
]]></bm:query-sql> ]]></bm:query-sql>
</bm:operation> </bm:operation>
......
<?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>
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
<a:dataSet id="other_tmpt_clause_ds" lookupCode="CON202_CON_PRINT_OTHER_CONDITON"/> <a:dataSet id="other_tmpt_clause_ds" lookupCode="CON202_CON_PRINT_OTHER_CONDITON"/>
<a:dataSet id="district_ds" lookupCode="PRJ500N_DISTRICT_AREAS"/> <a:dataSet id="district_ds" lookupCode="PRJ500N_DISTRICT_AREAS"/>
<a:dataSet id="marital_status_flag_ds" lookupCode="EXIST_OR_NOT"/> <a:dataSet id="marital_status_flag_ds" lookupCode="EXIST_OR_NOT"/>
<a:dataSet id="sp_sign_flag_ds" lookupCode="YES_NO"/>
<a:dataSet id="clause_basinfo" autoCreate="true"> <a:dataSet id="clause_basinfo" autoCreate="true">
<a:fields> <a:fields>
<a:field name="template_code" defaultValue="${/parameter/@tmpt_code}" readOnly="true"/> <a:field name="template_code" defaultValue="${/parameter/@tmpt_code}" readOnly="true"/>
...@@ -36,6 +37,7 @@ ...@@ -36,6 +37,7 @@
<a:field name="pay_method_n" displayField="code_value_name" options="pay_methods_ds" returnField="pay_method" valueField="code_value"/> <a:field name="pay_method_n" displayField="code_value_name" options="pay_methods_ds" returnField="pay_method" valueField="code_value"/>
<a:field name="secondary_lease_n" displayField="code_value_name" options="secondary_lease_ds" returnField="secondary_lease" valueField="code_value"/> <a:field name="secondary_lease_n" displayField="code_value_name" options="secondary_lease_ds" returnField="secondary_lease" valueField="code_value"/>
<a:field name="marital_status_flag_n" displayField="code_value_name" options="marital_status_flag_ds" returnField="marital_status_flag" valueField="code_value"/> <a:field name="marital_status_flag_n" displayField="code_value_name" options="marital_status_flag_ds" returnField="marital_status_flag" valueField="code_value"/>
<a:field name="sp_sign_flag_n" displayField="code_value_name" options="sp_sign_flag_ds" returnField="sp_sign_flag" valueField="code_value"/>
<a:field name="finance_type"/> <a:field name="finance_type"/>
<a:field name="finance_type_n" displayField="code_value_name" options="con202_finance_type" returnField="finance_type" valueField="code_value"/> <a:field name="finance_type_n" displayField="code_value_name" options="con202_finance_type" returnField="finance_type" valueField="code_value"/>
<a:field name="contract_number" lovGridHeight="360" lovHeight="540" lovService="basic.con_contract_for_lov" lovWidth="680"> <a:field name="contract_number" lovGridHeight="360" lovHeight="540" lovService="basic.con_contract_for_lov" lovWidth="680">
...@@ -137,6 +139,7 @@ ...@@ -137,6 +139,7 @@
<a:column name="first_contract_flag" editor="check" prompt="首个支付表标志" width="120"/> <a:column name="first_contract_flag" editor="check" prompt="首个支付表标志" width="120"/>
<!--add by 24976--> <!--add by 24976-->
<a:column name="marital_status_flag_n" editor="cb" prompt="有无配偶" width="100"/> <a:column name="marital_status_flag_n" editor="cb" prompt="有无配偶" width="100"/>
<a:column name="sp_sign_flag_n" editor="cb" prompt="配偶是否签署" width="100"/>
<a:column name="other_tmpt_clause_n" editor="cb" prompt="其他" width="100"/> <a:column name="other_tmpt_clause_n" editor="cb" prompt="其他" width="100"/>
</a:columns> </a:columns>
......
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
}else if(result_ob.code == 0){ }else if(result_ob.code == 0){
var revokeFlows = result_ob.revokeFlows; var revokeFlows = result_ob.revokeFlows;
var all_revoke_flag = 'Y'; var all_revoke_flag = 'Y';
var error_message;
for (var i = 0; i < revokeFlows.length; i++) { for (var i = 0; i < revokeFlows.length; i++) {
if(revokeFlows[i].result == 0){ if(revokeFlows[i].result == 0){
revoke_flag_update_bm.update({ revoke_flag_update_bm.update({
...@@ -69,6 +70,7 @@ ...@@ -69,6 +70,7 @@
}); });
}else{ }else{
all_revoke_flag = 'N'; all_revoke_flag = 'N';
error_message = revokeFlows[i].msg;
} }
} }
if(all_revoke_flag == 'Y'){ if(all_revoke_flag == 'Y'){
...@@ -76,7 +78,7 @@ ...@@ -76,7 +78,7 @@
contract_id:$ctx.parameter.contract_id contract_id:$ctx.parameter.contract_id
}); });
}else{ }else{
$ctx.parameter.message = '取消签约未完成,请再次发起取消签约!'; $ctx.parameter.message = error_message;
} }
} }
]]></s:server-script> ]]></s:server-script>
......
...@@ -32,13 +32,18 @@ ...@@ -32,13 +32,18 @@
con_ele_file_dl_map = con_ele_file_dl_bm.queryAsMap(); con_ele_file_dl_map = con_ele_file_dl_bm.queryAsMap();
} }
var con_ele_file_dl_data = con_ele_file_dl_map.getChildren(); 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++) { for (var i = 0; i < con_ele_file_dl_data.length; i++) {
var flow_id = con_ele_file_dl_data[i].ele_flow_id; 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 info = info_query('HL_SIGN_FILE_DOWNLOAD');
var httpUrl = info.code_value; var httpUrl = info.code_value;
var Param = { var Param = {
flowId: flow_id flows: flows_list
} }
var logs_bm = $bm('wx.WX100.con_ele_savelogs'); var logs_bm = $bm('wx.WX100.con_ele_savelogs');
try { try {
...@@ -50,7 +55,7 @@ ...@@ -50,7 +55,7 @@
var access_sign_token = token_sign_result_ob.access_token; var access_sign_token = token_sign_result_ob.access_token;
var result = EleFileUpHttpPost.post(httpUrl, JSON.stringify(Param), access_sign_token); var result = EleFileUpHttpPost.post(httpUrl, JSON.stringify(Param), access_sign_token);
logs_bm.insert({ logs_bm.insert({
contract_id: con_ele_file_dl_data[i].contract_id, contract_id: $ctx.parameter.p_contract_id || '',
httpurl: httpUrl, httpurl: httpUrl,
jsonPut: JSON.stringify(Param), jsonPut: JSON.stringify(Param),
jsonResult: result, jsonResult: result,
...@@ -58,21 +63,40 @@ ...@@ -58,21 +63,40 @@
}); });
var result_ob = JSON.parse(result); //根据返回参数形式再定 var result_ob = JSON.parse(result); //根据返回参数形式再定
if (result_ob.code == 0) { if (result_ob.code == 0) {
var docs_list = result_ob.docsList; var status_update_bm = $bm('wx.WX100.job_ele_sign_status_update');
for (var j = 0; j < docs_list.length; j++) { var query_flows = result_ob.queryFlows;
con_ele_file_dl_bm.update({ for (var n = 0; n < query_flows.length; n++){
contract_id: con_ele_file_dl_data[i].contract_id, var flow_id = query_flows[n].flowId;
file_name: docs_list[j].fileName, var flow_status = query_flows[n].flowStatus;
file_url: docs_list[j].fileUrl.replace('/mnt','X:'), if(flow_status == 2){
file_size:docs_list[j].fileSize 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
})
}
} }
con_ele_file_dl_bm.execute({
contract_id: con_ele_file_dl_data[i].contract_id,
flow_id:flow_id
})
} }
}
$ctx.parameter.return_status = '0'; $ctx.parameter.return_status = '0';
$ctx.parameter.return_message = '执行成功'; $ctx.parameter.return_message = '执行成功';
} catch (e) { } catch (e) {
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
/* var data = $ctx.parameter.requestData; /* var data = $ctx.parameter.requestData;
var data_ob=JSON.parse(data);*/ var data_ob=JSON.parse(data);*/
var contract_no= $ctx.parameter.contractNo; var contract_no= $ctx.parameter.contractNo;
var data = "action:" + $ctx.parameter.action + ",flowId:" + $ctx.parameter.flowId + ",signResult:" + $ctx.parameter.signResult + ",flowStatus:" + $ctx.parameter.flowStatus; 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'); var logs_bm = $bm('wx.WX100.con_ele_savelogs');
logs_bm.insert({ logs_bm.insert({
contract_id:contract_no, contract_id:contract_no,
......
...@@ -85,15 +85,99 @@ ...@@ -85,15 +85,99 @@
//依据合同文本签署人定义存储签署人信息 //依据合同文本签署人定义存储签署人信息
var ele_contract_signer_bm = $bm('wx.WX100.con_et_contract_signer_save'); var ele_contract_signer_bm = $bm('wx.WX100.con_et_contract_signer_save');
/* ele_contract_signer_bm.update({ ele_contract_signer_bm.update({
contract_id: $ctx.parameter.contract_id contract_id: $ctx.parameter.contract_id
});*/ });
//第一步生成提前结清文本 /* //第一步生成提前结清文本
$bm('cont.CON732.con_et_content_create').update({ $bm('cont.CON732.con_et_content_create').update({
contract_id: $ctx.parameter.contract_id, contract_id: $ctx.parameter.contract_id,
ccr_document_type: 'ET', ccr_document_type: 'ET',
content_type:'NORMAL' content_type:'NORMAL'
});*/
//组装签署人校验报文
var ele_signer_bm = $bm('wx.WX100.con_ele_contract_signer_query');
var ele_signer_map = ele_signer_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id,
esign_type:'ET'
});
var ele_signer_data = ele_signer_map.getChildren();
var userInfoList = [];
for (var k = 0 ; k < ele_signer_data.length;k++){
var signer_record_data = ele_signer_data[k];
if(signer_record_data.signer_category == 'TENANT_NP' || signer_record_data.signer_category == 'TENANT_SP'){
userInfoList.push({
"idNo":signer_record_data.id_no,
"name":signer_record_data.bp_name,
"mobile":signer_record_data.mobile
});
}else if (signer_record_data.signer_category == 'TENANT_ORG_SEAL'){
var ele_org_signer_map = ele_signer_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id,
signer_category:'TENANT_ORG_SIGN'
});
var ele_org_signer_data = ele_org_signer_map.getChildren();
//经办人
var agentName = ele_org_signer_data[0].bp_name;
var agentIdNo = ele_org_signer_data[0].id_no;
var mobile = ele_org_signer_data[0].mobile;
//法人
var legalName = ele_org_signer_data[0].legal_person;
var legalIdNo = ele_org_signer_data[0].id_card_no_leg;
if (agentIdNo == legalIdNo){
userInfoList.push({
"idNo":signer_record_data.id_no,
"name":signer_record_data.bp_name,
"agentIdNo":agentIdNo,
"agentName":agentName,
"mobile":mobile,
"legalName":legalName,
"legalIdNo":legalIdNo,
"agentType":"1"
});
}else{
userInfoList.push({
"idNo":signer_record_data.id_no,
"name":signer_record_data.bp_name,
"agentIdNo":agentIdNo,
"agentName":agentName,
"mobile":mobile,
"legalName":legalName,
"legalIdNo":legalIdNo,
"agentType":"2"
});
}
}
}
//获取中台token
var logs_bm = $bm('wx.WX100.con_ele_savelogs');
try {
var token_sign_result = EleFileUpHttpPost.post(up_file_token_url, null, null);
} catch (e) {
raise_app_error('上传文件获取token失败,请联系技术人员检查!');
}
var token_sign_result_ob = JSON.parse(token_sign_result);
var access_sign_token = token_sign_result_ob.access_token;
//校验签署人
var info = info_query('HL_ELE_ACCOUNT_CREATE_PATH');
var httpUrl = info.code_value;
var Param = {
userInfo:userInfoList
}
var result = EleFileUpHttpPost.post(httpUrl, JSON.stringify(Param), access_sign_token);
logs_bm.insert({
contract_id: $ctx.parameter.contract_id,
httpurl: httpUrl,
jsonPut: JSON.stringify(Param),
jsonResult: result,
tokenResult: token_sign_result
}); });
var result_ob = JSON.parse(result); //根据返回参数形式再定
if (result_ob.code != 0) {
//rollback
$bm('wx.WX100.rollback').update();
raise_app_error(result_ob.message.toString());
}
//生成合同文本
var datePath = getDatePath(); var datePath = getDatePath();
FileUtils.forceMkdir(new File(datePath)); //根据日期创建目录 FileUtils.forceMkdir(new File(datePath)); //根据日期创建目录
$ctx.parameter.batch_flag = 'Y'; $ctx.parameter.batch_flag = 'Y';
...@@ -161,60 +245,6 @@ ...@@ -161,60 +245,6 @@
"fileSize": con_ele_unsigned_file_data[n].file_size "fileSize": con_ele_unsigned_file_data[n].file_size
}); });
} }
//合同签署人信息
var ele_signer_bm = $bm('wx.WX100.con_ele_contract_signer_query');
var ele_signer_map = ele_signer_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id,
esign_type:'ET'
});
var ele_signer_data = ele_signer_map.getChildren();
var userInfoList = [];
for (var k = 0 ; k < ele_signer_data.length;k++){
var signer_record_data = ele_signer_data[k];
if(signer_record_data.signer_category == 'TENANT_NP' || signer_record_data.signer_category == 'TENANT_SP'){
userInfoList.push({
"idNo":signer_record_data.id_no,
"name":signer_record_data.bp_name,
"mobile":signer_record_data.mobile
});
}else if (signer_record_data.signer_category == 'TENANT_ORG_SEAL'){
var ele_org_signer_map = ele_signer_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id,
signer_category:'TENANT_ORG_SIGN'
});
var ele_org_signer_data = ele_org_signer_map.getChildren();
//经办人
var agentName = ele_org_signer_data[0].bp_name;
var agentIdNo = ele_org_signer_data[0].id_no;
var mobile = ele_org_signer_data[0].mobile;
//法人
var legalName = ele_org_signer_data[0].legal_person;
var legalIdNo = ele_org_signer_data[0].id_card_no_leg;
if (agentIdNo == legalIdNo){
userInfoList.push({
"idNo":signer_record_data.id_no,
"name":signer_record_data.bp_name,
"agentIdNo":agentIdNo,
"agentName":agentName,
"mobile":mobile,
"legalName":legalName,
"legalIdNo":legalIdNo,
"agentType":"1"
});
}else{
userInfoList.push({
"idNo":signer_record_data.id_no,
"name":signer_record_data.bp_name,
"agentIdNo":agentIdNo,
"agentName":agentName,
"mobile":mobile,
"legalName":legalName,
"legalIdNo":legalIdNo,
"agentType":"2"
});
}
}
}
var ele_contract_signer_map = ele_contract_signer_bm.queryAsMap({ var ele_contract_signer_map = ele_contract_signer_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id contract_id: $ctx.parameter.contract_id
}); });
...@@ -260,14 +290,6 @@ ...@@ -260,14 +290,6 @@
conFileList:conFileList, conFileList:conFileList,
signer:signer signer:signer
} }
var logs_bm = $bm('wx.WX100.con_ele_savelogs');
try {
var token_sign_result = EleFileUpHttpPost.post(up_file_token_url, null, null);
} catch (e) {
raise_app_error('上传文件获取token失败,请联系技术人员检查!');
}
var token_sign_result_ob = JSON.parse(token_sign_result);
var access_sign_token = token_sign_result_ob.access_token;
var result = EleFileUpHttpPost.post(httpUrl, JSON.stringify(signParam), access_sign_token); var result = EleFileUpHttpPost.post(httpUrl, JSON.stringify(signParam), access_sign_token);
logs_bm.insert({ logs_bm.insert({
contract_id:$ctx.parameter.contract_id, contract_id:$ctx.parameter.contract_id,
......
...@@ -32,20 +32,31 @@ ...@@ -32,20 +32,31 @@
ele_contract_signer_bm.update({ ele_contract_signer_bm.update({
contract_id: $ctx.parameter.contract_id 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'){ }else if($ctx.parameter.esign_type == 'ET'){
//依据提前结清合同文本签署人定义存储签署人信息 //依据提前结清合同文本签署人定义存储签署人信息
var ele_contract_signer_bm = $bm('wx.WX100.con_et_contract_signer_save'); var ele_contract_signer_bm = $bm('wx.WX100.con_et_contract_signer_save');
ele_contract_signer_bm.update({ ele_contract_signer_bm.update({
contract_id: $ctx.parameter.contract_id 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_bm = $bm('wx.WX100.con_ele_contract_signer_query');
var ele_signer_map = ele_signer_bm.queryAsMap({ var ele_signer_map = ele_signer_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id, contract_id: $ctx.parameter.contract_id,
esign_type:$ctx.parameter.esign_type esign_type:$ctx.parameter.esign_type
}); });
var ele_signer_data = ele_signer_map.getChildren(); var ele_signer_data = ele_signer_map.getChildren();
//合同经办人信息
var userInfoList = []; var userInfoList = [];
for (var k = 0 ; k < ele_signer_data.length;k++){ for (var k = 0 ; k < ele_signer_data.length;k++){
var signer_record_data = ele_signer_data[k]; var signer_record_data = ele_signer_data[k];
...@@ -64,7 +75,8 @@ ...@@ -64,7 +75,8 @@
}else if(signer_record_data.signer_category == 'GUARANTOR_ORG_SEAL'){ }else if(signer_record_data.signer_category == 'GUARANTOR_ORG_SEAL'){
var ele_org_signer_map = ele_signer_bm.queryAsMap({ var ele_org_signer_map = ele_signer_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id, contract_id: $ctx.parameter.contract_id,
signer_category:'GUARANTOR_ORG_SIGN' 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 ele_org_signer_data = ele_org_signer_map.getChildren();
var agentIdNo = ele_org_signer_data[0].id_no; var agentIdNo = ele_org_signer_data[0].id_no;
...@@ -112,11 +124,9 @@ ...@@ -112,11 +124,9 @@
var result_ob = JSON.parse(post_result); //根据返回参数形式再定 var result_ob = JSON.parse(post_result); //根据返回参数形式再定
if (result_ob.code != 0) { if (result_ob.code != 0) {
//rollback //rollback
$bm('wx.WX100.rollback').update(); var result_message = result_ob.message;
raise_app_error(result_ob.message.toString()); $ctx.parameter.check_flag = 'N';
}else if(result_ob.code == 0){ $ctx.parameter.result_message = result_message;
var verify_result = result_ob.result;
$ctx.parameter.check_flag = verify_result;
} }
]]></s:server-script> ]]></s:server-script>
</a:init-procedure> </a:init-procedure>
......
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