Commit 8bf1657c authored by congzhao's avatar congzhao

[建机]电子合同开发 问题调整以及经办人校验

parent 1cbd732a
......@@ -31,7 +31,7 @@
set c.ec_sign_type = 'NEW',
c.sign_contract_status = 'NEW',
c.last_update_date = sysdate,
c.last_updated_by = ${/session/@user_id}
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};
......
<?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>
......@@ -76,11 +76,14 @@ select *
where t1.data_class = 'NORMAL'
and t1.contract_id = cr.contract_id
and cr.ec_sign_type in ('INITIATE', 'SIGNING')
and t1.contract_id in
(select distinct cs.contract_id
from con_contract_ele_signer cs
where cs.id_no = ${@id_no}
and cs.id_type = ${@id_type})
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}))
)
UNION ALL
select t1.contract_id,
t1.contract_number,
......@@ -153,11 +156,15 @@ select *
from con_contract t1
where t1.data_class = 'NORMAL'
and t1.ec_sign_type in ('INITIATE', 'SIGNING')
and t1.contract_id in
(select distinct cs.contract_id
from con_contract_ele_signer cs
where cs.id_no = ${@id_no}
and cs.id_type = ${@id_type})) v
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}))
)
) v
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
......
......@@ -8,6 +8,7 @@
<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"/>
......@@ -21,6 +22,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,
cs.bp_id,
cs.bp_name,
cs.id_type,
......
......@@ -20,12 +20,33 @@
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
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.templet_code != 'SETTLE_ADVANCE_OEC')
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 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"?>
<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 faa.file_name, faa.file_path
FROM fnd_atm_attachment_multi m1, fnd_atm_attachment faa
WHERE m1.table_name = 'CON_CONTRACT'
AND m1.attachment_id = faa.attachment_id
AND m1.table_pk_value in
(select pc.check_id
from PRJ_CDD_ITEM_CHECK pc
where pc.cdd_item_id in
(select pi.cdd_item_id
from prj_cdd_item pi
where pi.cdd_item in ('CONTRACT','LEASE_ITEM_REQ','TN_GU_INFO','GUARANTEE_LETTER_OEC','CHECK_INFO','SPOUSE_COMMITMENT','PUR_CONTRACT','CASHFLOW_INFO','ITEM_TRAN_NOTICE','PAYMENT_REQ','MORT_CONTRACT','ET_TREATY')
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')))
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 (((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'))
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')
]]></bm:query-sql>
</bm:operation>
</bm:operations>
......
......@@ -9,21 +9,44 @@
<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 fm.table_pk_value in
(select t.content_id
from con_contract_content t,con_ele_signer_file cf,con_contract_ele_signer cs
where t.contract_id = ${@contract_id}
and t.templet_id = cf.templet_id
and cs.con_ele_signer_id = cf.con_ele_signer_id
and cs.id_no = ${@id_no}
and cs.id_type = ${@id_type})
order by ct.order_seq
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'))
order by ct.order_seq
]]></bm:query-sql>
</bm:operation>
</bm:operations>
......
<?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>
......@@ -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 = [
{
......
......@@ -62,31 +62,6 @@
scope: this
});
}
//生成电子签约合同文本 add by 24976
function con_ele_print_detail_print(){
Leaf.Masker.mask($('${/parameter/@winid}').wrap, '正在生成并打印合同文本,请稍等。。。');
var result_ds = $('con_contract_update_print_detail_line_ds');
var file_path = $('contract_file_path_ds').getAt(0).get('contract_file_path');
Leaf.request({
url: $('con_ele_doc_batch_create_link_id').getUrl(),
para: {
contract_id: '${/parameter/@contract_id}',
file_path: '${/parameter/@file_path}',
batch_flag: 'Y'
},
success: function(res) {
result_ds.query(result_ds.currentPage);
unlock_current_window();
},
error: function() {
unlock_current_window();
},
failure: function() {
unlock_current_window();
},
scope: this
});
}
function lock_current_window() {
Leaf.Masker.mask($('${/parameter/@winid}').wrap, '${l:HLS.EXECUTING}');
}
......@@ -225,7 +200,6 @@
<a:screenTopToolbar style="width:848px">
<!--<a:gridButton click="con_print_detail_create" text="CON505.CON_CONTENT_CREATE"/>-->
<a:gridButton id="con500_print_btn" click="con_print_detail_print" text="生成文本"/>
<a:gridButton id="con500_ele_print_btn" click="con_ele_print_detail_print" text="生成电子签约文本"/>
<!-- <a:gridButton click="con_download_zip" text="PRJ702.THE_FILE_DOWNLOAD"/> -->
<a:gridButton click="con500_delete_print" text="HLS.REMOVE"/>
</a:screenTopToolbar>
......
......@@ -18,6 +18,8 @@
url="${/request/@context_path}/downloadFile.lview"/>
<a:link id="${/parameter/@layout_code}_con_ele_terminate_create_link_id"
url="${/request/@context_path}/modules/wx/WX100/con_ele_terminate_create.lsc"/>
<a:link id="${/parameter/@layout_code}_ele_operator_verify_link_id"
url="${/request/@context_path}/modules/wx/WX100/wx_ele_verify_operator.lsc"/>
<script src="${/request/@context_path}/javascripts/lightbox.js" type="text/javascript"/>
<link href="${/request/@context_path}/css/lightbox.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript"><![CDATA[
......@@ -309,21 +311,60 @@
$('${/parameter/@layout_code}_user_button3').disable();
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('${/parameter/@layout_code}_con_ele_terminate_create_link_id').getUrl(),
para: {
contract_id: contract_id
},
success: function(res) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@winid}').close();
url:$('${/parameter/@layout_code}_ele_operator_verify_link_id').getUrl(),
para:{
contract_id:contract_id,
esign_type:'ET'
},
failure: function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
scope:this,
success: function (res) {
if(res.result.check_flag == 'Y'){
Leaf.showConfirm('${HLS.PROMPT}', '该企业下已存在其他经办人,如果发起签约,原账户将失效,请确认是否继续!', function () {
Leaf.request({
url: $('${/parameter/@layout_code}_con_ele_terminate_create_link_id').getUrl(),
para: {
contract_id: contract_id
},
success: function(res) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@winid}').close();
},
failure: function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
});
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}else{
Leaf.request({
url: $('${/parameter/@layout_code}_con_ele_terminate_create_link_id').getUrl(),
para: {
contract_id: contract_id
},
success: function(res) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@winid}').close();
},
failure: function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
}
},
error: function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
failure: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}
});
});
}
......
......@@ -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}';
......@@ -374,6 +376,27 @@
scope: this
});
}
//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']();
};
......
......@@ -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
});
// 简称校验
// debugger;
// var Pattern = /^[A-Za-z]+$/;
......
......@@ -4,6 +4,7 @@
<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;
......@@ -11,32 +12,20 @@
if (inputData == null){
contract_list_map = contract_list_bm.queryAsMap({
id_no:$ctx.parameter.idNo,
id_type:$ctx.parameter.IdType
id_type:$ctx.parameter.IdType,
account_type: $ctx.parameter.accountType
});
}else{
contract_list_map = contract_list_bm.queryAsMap({
id_no:$ctx.parameter.idNo,
id_type:$ctx.parameter.IdType,
account_type: $ctx.parameter.accountType,
contract_number:inputData
});
}
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,
unSignContracts: []
};
var unSignContracts = result.unSignContracts;
if (contract_list_details) {
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;
......@@ -53,8 +42,7 @@
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,
orderSeq: file_list_details[j].order_seq
fileName: file_list_details[j].file_name
});
}
unSignContracts.push({
......@@ -72,9 +60,28 @@
"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') {
......
......@@ -85,9 +85,9 @@
//依据合同文本签署人定义存储签署人信息
var ele_contract_signer_bm = $bm('wx.WX100.con_ele_contract_signer_save');
ele_contract_signer_bm.update({
/* 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,
......@@ -167,7 +167,6 @@
});
var ele_signer_data = ele_signer_map.getChildren();
var userInfoList = [];
println(ele_signer_data.length);
for (var k = 0 ; k < ele_signer_data.length;k++){
var signer_record_data = ele_signer_data[k];
if(signer_record_data.signer_category == 'TENANT_NP' || signer_record_data.signer_category == 'TENANT_SP' || signer_record_data.signer_category =='GUARANTOR_NP' || signer_record_data.signer_category =='GUARANTOR_SP'){
......@@ -286,7 +285,6 @@
} catch (e) {
raise_app_error('上传文件获取token失败,请联系技术人员检查!');
}
println(token_sign_result);
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);
......
......@@ -53,6 +53,14 @@
});
$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)
{
......
......@@ -85,9 +85,9 @@
//依据合同文本签署人定义存储签署人信息
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
});
});*/
//第一步生成提前结清文本
$bm('cont.CON732.con_et_content_create').update({
contract_id: $ctx.parameter.contract_id,
......@@ -169,7 +169,6 @@
});
var ele_signer_data = ele_signer_map.getChildren();
var userInfoList = [];
println(ele_signer_data.length);
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'){
......
<?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;
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;
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"?>
<!--
$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 = 'http://hlsapp.hand-china.com/hl_dr_dev/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password=admin'; //文件上传获取token的地址
//系统参数获取
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
});
}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
});
}
//合同经办人信息
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 agentName = ele_org_signer_data[0].bp_name;
var agentIdNo = ele_org_signer_data[0].id_no;
var mobile = ele_org_signer_data[0].mobile;
userInfoList.push({
"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'
});
var ele_org_signer_data = ele_org_signer_map.getChildren();
var agentName = ele_org_signer_data[0].bp_name;
var agentIdNo = ele_org_signer_data[0].id_no;
var mobile = ele_org_signer_data[0].mobile;
userInfoList.push({
"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 agentName = ele_org_signer_data[0].bp_name;
var agentIdNo = ele_org_signer_data[0].id_no;
var mobile = ele_org_signer_data[0].mobile;
userInfoList.push({
"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);
//var result = new HttpRequest().sendPost(httpUrl, JSON.stringify(signParam));
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
$bm('wx.WX100.rollback').update();
//raise_app_error('发起签约失败,请联系技术人员检查!');
raise_app_error(result_ob.message.toString());
}else if(result_ob.code == 0){
var verify_result = result_ob.result;
$ctx.parameter.check_flag = verify_result;
}
]]></s:server-script>
</a:init-procedure>
<a:service-output output="/parameter"/>
</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