Commit f1338bb8 authored by congzhao's avatar congzhao

[建机]电子合同开发 签署流程校验调整

parent 2e82e7d5
......@@ -20,6 +20,8 @@
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
......
......@@ -87,8 +87,8 @@ select *
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, hls_bp_master hb
where ccb.bp_id = hb.bp_id
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
......
......@@ -24,12 +24,6 @@
<bm:operation name="insert">
<bm:update-sql><![CDATA[
BEGIN
update con_contract cc
set cc.ec_sign_type = 'SIGNED',
cc.sign_contract_status = 'SIGN',
cc.last_update_date = sysdate
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'),
......@@ -41,6 +35,19 @@
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,
......
......@@ -20,6 +20,8 @@
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
......
<?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 = 'ET';
update con_contract_change_req cc
set cc.ec_sign_type = 'SIGNING',
cc.last_update_date = sysdate
where cc.ele_flow_id = ${@flow_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_change_req cc
set cc.ec_sign_type = 'SIGNED',
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};
update con_contract_ele_signer cs
set cs.ec_sign_status = 'Y',
cs.last_update_date = sysdate
where cs.contract_id = ${@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>
......@@ -20,6 +20,8 @@
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
......
......@@ -154,6 +154,36 @@
});
}
}
//获取token信息
var logs_bm = $bm('wx.WX100.con_ele_savelogs');
try {
var token_sign_result = EleFileUpHttpPost.post(up_file_token_url, null, null);
} catch (e) {
raise_app_error('上传文件获取token失败,请联系技术人员检查!');
}
var token_sign_result_ob = JSON.parse(token_sign_result);
var access_sign_token = token_sign_result_ob.access_token;
//校验签署人
var info = info_query('HL_ELE_ACCOUNT_CREATE_PATH');
var httpUrl = info.code_value;
var Param = {
userInfo: userInfoList
}
var result = EleFileUpHttpPost.post(httpUrl, JSON.stringify(Param), access_sign_token);
//var result = new HttpRequest().sendPost(httpUrl, JSON.stringify(signParam));
logs_bm.insert({
contract_id: $ctx.parameter.contract_id,
httpurl: httpUrl,
jsonPut: JSON.stringify(Param),
jsonResult: result,
tokenResult: token_sign_result
});
var result_ob = JSON.parse(result); //根据返回参数形式再定
if (result_ob.code != 0) {
//rollback
$bm('wx.WX100.rollback').update();
raise_app_error(result_ob.message.toString());
}
var ele_contract_signer_map = ele_contract_signer_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id
});
......@@ -199,14 +229,6 @@
conFileList:conFileList,
signer:signer
}
var logs_bm = $bm('wx.WX100.con_ele_savelogs');
try {
var token_sign_result = EleFileUpHttpPost.post(up_file_token_url, null, null);
} catch (e) {
raise_app_error('上传文件获取token失败,请联系技术人员检查!');
}
var token_sign_result_ob = JSON.parse(token_sign_result);
var access_sign_token = token_sign_result_ob.access_token;
var result = EleFileUpHttpPost.post(httpUrl, JSON.stringify(signParam), access_sign_token);
//var result = new HttpRequest().sendPost(httpUrl, JSON.stringify(signParam));
logs_bm.insert({
......
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