Commit ffc37692 authored by congzhao's avatar congzhao

电子合同开发 11.18

parent 3f2098df
......@@ -18,6 +18,7 @@
<bm:field name="language" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LANGUAGE" prompt="CON_CLAUSE_TEMPLET.LANGUAGE"/>
<bm:field name="language_name" expression="(select s.code_value_name from sys_code_values_v s where s.code = &apos;CON_LANGUAGE&apos; and s.code_value=t1.language)" forInsert="false" forUpdate="false" prompt="CON_CLAUSE_TEMPLET.TEMPLET_USAGE"/>
<bm:field name="enabled_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENABLED_FLAG" prompt="CON_CLAUSE_TEMPLET.ENABLED_FLAG"/>
<bm:field name="ele_content_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ELE_CONTENT_FLAG" prompt="CON_CLAUSE_TEMPLET.ELE_CONTENT_FLAG"/>
<bm:field name="print_num"/>
<bm:field name="version_date"/>
<bm:field name="tax_type_rate" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TAX_TYPE_RATE"/>
......@@ -40,6 +41,7 @@
<bm:query-field field="templet_usage" queryOperator="like"/>
<bm:query-field field="approval_status" queryOperator="like"/>
<bm:query-field name="enabled_flag" queryExpression="(t1.enabled_flag = ${@enabled_flag} or ${@enabled_flag}=&apos;ALL&apos;)"/>
<bm:query-field name="ele_content_flag" queryExpression="(t1.ele_content_flag = ${@ele_content_flag} or ${@ele_content_flag}=&apos;ALL&apos;)"/>
</bm:query-fields>
<e:exception-descriptor-config>
<e:exception-descriptor exception="java.sql.SQLException" handleClass="leaf.database.SQLExceptionDescriptor">
......
......@@ -62,6 +62,7 @@
<bm:field name="first_contract_flag"/>
<bm:field name="finance_type"/>
<bm:field name="secondary_lease"/>
<bm:field name="marital_status_flag"/>
<bm:field name="vender_id"/>
<bm:field name="vender_id_n" expression="(decode(vender_id,-100,'买断机',(select scv.bp_name from hls_bp_master scv where scv.enabled_flag=&apos;Y&apos; and scv.bp_id = t1.vender_id)))" forInsert="false" forUpdate="false"/>
......
......@@ -181,14 +181,15 @@
t1.download_content_flag,
t1.agent_content_flag_name,
t1.download_content_flag_name,
t1.print_date
t1.print_date,
t1.order_seq
FROM
CON_CONTRACT_CONTENT_V t1
WHERE
t1.templet_usage in ('CON_SALE', 'CONTRACT')
)t
#WHERE_CLAUSE#
ORDER BY decode(t.bp_category,'TENANT',0,'GUARANTOR',1,'VENDER',2,'')
ORDER BY t.order_seq,decode(t.bp_category,'TENANT',0,'GUARANTOR',1,'VENDER',2,'')
]]></bm:query-sql>
</bm:operation>
</bm:operations>
......
......@@ -59,6 +59,7 @@
${/parameter/@batch_flag}='Y'
)
)
order by t.order_seq
]]></bm:query-sql>
</bm:operation>
</bm:operations>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zc
$Date: 2020年11月6日 18点30分
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
hl_con_contract_content_pkg.contract_ele_content_create(
p_contract_id =>${@contract_id},
p_content_id =>${@content_id},
p_user_id =>${/session/@user_id},
p_templet_usage =>${@templet_usage},
p_content_type =>${@content_type}
);
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zc
$Date: 2020年11月18日 14点02分
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
con_contract_workflow_pkg.contract_sign_cancel(
p_contract_id =>${@contract_id},
p_user_id => ${/session/@user_id}
);
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select t.ele_flow_id
FROM con_contract t
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
begin
update con_contract c
set c.ec_sign_type = 'NEW',
c.sign_contract_status = 'NEW',
c.last_update_date = sysdate,
c.last_updated_by = ${/session/@user_id}
where c.contract_id = ${@contract_id};
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="ele_flow_id"/>
</bm:fields>
<bm:query-fields>
<bm:query-field name="contract_id" queryExpression="(t.contract_id = ${@contract_id})"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:o="leaf.database.local.oracle" xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1" baseTable="HLS_DOC_FILE_TEMPLET_SIGNER">
<bm:fields>
<bm:field name="templet_signer_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TEMPLET_SIGNER_ID" prompt="HLS_DOC_FILE_TEMPLET_SIGNER.TEMPLET_SIGNER_ID"/>
<bm:field name="templet_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TEMPLET_ID" prompt="HLS_DOC_FILE_TEMPLET_SIGNER.TEMPLET_ID"/>
<bm:field name="indentity_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INDENTITY_TYPE" prompt="HLS_DOC_FILE_TEMPLET_SIGNER.INDENTITY_TYPE"/>
<bm:field name="key_word" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="KEY_WORD" prompt="HLS_DOC_FILE_TEMPLET_SIGNER.KEY_WORD"/>
<bm:field name="auto_sign" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="AUTO_SIGN" prompt="HLS_DOC_FILE_TEMPLET_SIGNER.AUTO_SIGN"/>
<bm:field name="sign_order" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SIGN_ORDER" prompt="HLS_DOC_FILE_TEMPLET_SIGNER.SIGN_ORDER"/>
<bm:field name="sign_type" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SIGN_TYPE" prompt="HLS_DOC_FILE_TEMPLET_SIGNER.SIGN_TYPE"/>
<bm:field name="signer_category" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SIGNER_CATEGORY" prompt="HLS_DOC_FILE_TEMPLET_SIGNER.SIGNER_CATEGORY"/>
<bm:field name="enable_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENABLE_FLAG" prompt="HLS_DOC_FILE_TEMPLET_SIGNER.ENABLE_FLAG"/>
<!--
<bm:field name="signer_category_desc" expression="(select scv.code_value_name from HLS_DOC_FILE_TEMPLET_PARA tp, sys_code_values_v scv where tp.templet_para_id = t1.templet_para_id and scv.code = &apos;HL_SIGNER_CATEGORY&apos; and scv.code_value = tp.bookmark_type)" forInsert="false" forUpdate="false"/>
-->
</bm:fields>
<bm:features>
<o:sequence-pk/>
<f:standard-who/>
</bm:features>
<bm:primary-key>
<bm:pk-field name="templet_signer_id"/>
</bm:primary-key>
<!-- <bm:query-fields>
<bm:query-field field="templet_id" queryOperator="="/>
</bm:query-fields>-->
<bm:data-filters>
<bm:data-filter name="templet_id" enforceOperations="query" expression="t1.templet_id = ${@templet_id}"/>
</bm:data-filters>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select * from (select t1.contract_id,
t1.contract_number,
t1.contract_status,
t1.bp_id_tenant,
(select hm.bp_name
from hls_bp_master hm
where hm.bp_id = t1.bp_id_tenant) bp_id_tenant_n,
t1.ec_sign_type,
(SELECT v.code_value_name
FROM sys_code_values_v v
WHERE v.code = 'EC_SIGN_TYPE'
AND v.code_value = t1.ec_sign_type) 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,
(SELECT v.code_value_name
FROM sys_code_values_v v
WHERE v.code = 'CON500_CONTRACT_STATUS'
AND v.code_value = t1.contract_status) AS 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 cs.id_no = ${@id_no}
and cs.id_type = ${@id_type}
and rownum = 1) sign_url
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 #WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="contract_id"/>
<bm:field name="contract_number"/>
<bm:field name="bp_id_tenant_n"/>
<bm:field name="bp_id_agent_level1_n"/>
<bm:field name="contract_status"/>
<bm:field name="contract_status_n"/>
<bm:field name="ec_sign_type"/>
<bm:field name="ec_sign_type_n"/>
<bm:field name="brand_id_n"/>
<bm:field name="modelcd"/>
<bm:field name="machine_number"/>
<bm:field name="lease_times"/>
<bm:field name="total_sign"/>
<bm:field name="sign_url"/>
</bm:fields>
<bm:query-fields>
<bm:query-field name="contract_number" queryExpression="v.contract_number = ${@contract_number}"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
BEGIN
wx_ele_contract_pkg.update_ele_con_info(p_contract_id => ${@contract_id},
p_id_no => ${@id_no},
p_sign_url => ${@sign_url},
p_user_id => nvl(${/session/@user_id},1)
);
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zc
$Date: 2020年11月9日 10点35分
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:fields>
<bm:field name="contract_id"/>
<bm:field name="bp_id"/>
<bm:field name="bp_name"/>
<bm:field name="id_type"/>
<bm:field name="id_no"/>
<bm:field name="mobile"/>
<bm:field name="signer_category"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select distinct t.* from (select
cs.contract_id,
cs.bp_id,
cs.bp_name,
cs.id_type,
cs.id_no,
cs.mobile,
hs.signer_category
from con_contract_ele_signer cs, hls_doc_file_templet_signer hs
where cs.templet_signer_id = hs.templet_signer_id) t
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="contract_id" queryExpression="t.contract_id= ${@contract_id}"/>
<bm:query-field name="signer_category" queryExpression="t.signer_category= ${@signer_category}"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zc
$Date: 2020年11月9日 10点35分
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:fields>
<bm:field name="con_ele_signer_id"/>
<bm:field name="contract_id"/>
<bm:field name="bp_id"/>
<bm:field name="bp_name"/>
<bm:field name="id_type"/>
<bm:field name="id_no"/>
<bm:field name="templet_signer_id"/>
<bm:field name="ec_sign_status"/>
<bm:field name="templet_id"/>
<bm:field name="indentity_type"/>
<bm:field name="key_word"/>
<bm:field name="auto_sign"/>
<bm:field name="sign_order"/>
<bm:field name="sign_type"/>
<bm:field name="signer_category"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select * from (select cs.con_ele_signer_id,
cs.contract_id,
cs.bp_id,
cs.bp_name,
cs.id_type,
cs.id_no,
cs.templet_signer_id,
cs.ec_sign_status,
hs.templet_id,
hs.indentity_type,
hs.key_word,
nvl(hs.auto_sign,'N') auto_sign,
hs.sign_order,
hs.sign_type,
hs.signer_category
from con_contract_ele_signer cs, hls_doc_file_templet_signer hs
where cs.templet_signer_id = hs.templet_signer_id) t
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
wx_ele_contract_pkg.ele_contract_signer_save(
p_contract_id =>${@contract_id},
p_user_id =>nvl(${/session/@user_id},1)
);
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="contract_id" queryExpression="t.contract_id= ${@contract_id}"/>
<bm:query-field name="signer_category" queryExpression="t.signer_category= ${@signer_category}"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<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 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;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:fields>
<bm:field name="contract_id" databaseType="Number" datatype="java.lang.Double"/>
<bm:field name="httpurl" databaseType="CLOB" datatype="java.sql.Clob"/>
<bm:field name="jsonPut" databaseType="CLOB" datatype="java.sql.Clob"/>
<bm:field name="jsonResult" databaseType="CLOB" datatype="java.sql.Clob"/>
<bm:field name="tokenResult" databaseType="CLOB" datatype="java.sql.Clob"/>
</bm:fields>
<bm:operations>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
BEGIN
wx_ele_contract_pkg.hl_con_savelogs(p_contract_id => ${@contract_id},
p_httpurl => ${@httpurl},
p_jsonPut => ${@jsonPut},
p_jsonResult => ${@jsonResult},
p_token => ${@tokenResult}
);
COMMIT;
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zc
$Date: 2020年11月9日
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:fields>
<bm:field name="file_name"/>
<bm:field name="file_path"/>
<bm:field name="file_size"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select fa.file_name,fa.file_path,fa.file_size
from fnd_atm_attachment fa, fnd_atm_attachment_multi fm
where fa.attachment_id = fm.attachment_id
and fm.table_name = 'CON_CONTRACT_CONTENT'
and fm.table_pk_value in
(select t.content_id
from con_contract_content t,con_ele_signer_file cf
where t.contract_id = ${@contract_id}
and t.templet_id = cf.templet_id
and cf.con_ele_signer_id = ${@con_ele_signer_id})
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="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 HH:mm:ss'),
cs.sign_result = ${sign_result},
cs.last_update_date = sysdate
WHERE cs.contract_id =
(select c.contract_id
from con_contract c
where c.ele_flow_id = ${flow_id}
and c.data_class = 'NORMAL')
AND cs.id_no = ${id_no};
update con_contract cc
set cc.ec_sign_type = 'SIGNING',
cc.last_update_date = sysdate
where cc.ele_flow_id = ${flow_id};
END;
]]></bm:update-sql>
</bm:operation>
<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.flow_status = ${flow_status},
cc.end_time = to_date(${end_time},'yyyy-mm-dd HH:mm:ss'),
cc.last_update_date = sysdate
where cc.ele_flow_id = ${flow_id};
insert into con_ele_signed_file_list
(signed_file_list_id,
flow_id,
file_id,
file_name,
file_download_url,
creation_date,
created_by,
last_updated_by,
last_update_date)
values
(CON_ELE_SIGNED_FILE_LIST_S.NEXTVAL,
${@flow_id},
${@file_id},
${@file_name},
${@file_download_url},
sysdate,
nvl(${/session/@user_id},1),
nvl(${/session/@user_id},1),
sysdate
);
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zc
$Date: 2020年11月11日
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:fields>
<bm:field name="file_name"/>
<bm:field name="file_path"/>
<bm:field name="file_size"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select fa.file_name,fa.file_path,fa.file_size
from fnd_atm_attachment fa, fnd_atm_attachment_multi fm
where fa.attachment_id = fm.attachment_id
and fm.table_name = 'CON_CONTRACT_CONTENT'
and fm.table_pk_value in
(select t.content_id
from con_contract_content t,con_ele_signer_file cf
where t.contract_id = ${@contract_id}
and t.templet_id = cf.templet_id)
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:fields>
<bm:field name="file_name"/>
<bm:field name="file_path"/>
<bm:field name="file_size"/>
<bm:field name="order_seq"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select fa.file_name,fa.file_path,fa.file_size,ct.order_seq
from fnd_atm_attachment fa, fnd_atm_attachment_multi fm,con_contract_content cc,con_clause_templet ct
where fa.attachment_id = fm.attachment_id
and fm.table_name = 'CON_CONTRACT_CONTENT'
and cc.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
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
rollback;
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zc
$Date: 2020年11月12日 09点13分
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:e="leaf.service.exception" xmlns:o="leaf.database.local.oracle" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" needAccessControl="false">
<bm:fields>
<bm:field name="code_value" databaseType="VARCHAR2" datatype="java.lang.String"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select sys_parameter_pkg.value(p_parameter_code => ${@parameter_code}) code_value from dual
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
BEGIN
HL_SMS_SEND_PKG.wx_verify_code_sms(p_phone_number => ${@phone_number},p_user_id => nvl(${/session/@user_id},1), p_sms_id =>${@sms_id},p_verify_code => ${@verify_code});
COMMIT;
END;
]]></bm:update-sql>
<bm:parameters>
<bm:parameter name="sms_id" dataType="java.lang.Long" input="false" output="true" outputPath="/parameter/@sms_id"/>
<bm:parameter name="verify_code" dataType="java.lang.Long" input="false" output="true" outputPath="/parameter/@verify_code"/>
</bm:parameters>
</bm:operation>
</bm:operations>
</bm:model>
var override_queryfields = [
{
name : 'lease_start_date_from',
queryexpression : "t1.lease_start_date >= ${@lease_start_date_from}"
},
{
name : 'lease_start_date_to',
queryexpression : "t1.lease_start_date <=${@lease_start_date_to}"
},
{
name : 'contract_creation_date_from',
queryexpression : "t1.contract_creation_date >= trunc(to_date(${@contract_creation_date_from},'yyyy-mm-dd') )"
},
{
name : 'contract_creation_date_to',
queryexpression : "trunc(t1.contract_creation_date) <=to_date(${@contract_creation_date_to},'yyyy-mm-dd')"
},
{
name : 'agent_extra_nam',
queryexpression : "t1.agent_extra_nam like '%'||${@agent_extra_nam}||'%'"
},
{
name : 'contract_number',
queryexpression : "t1.contract_number like '%'||${@contract_number}||'%'"
},
{
field : 'contract_status',
queryoperator : "="
},
{
field : 'division',
queryoperator : "="
},
{
field : 'business_type',
queryoperator : "="
}
];
var add_datafilters=[
{
name:'bp_id_agent_level1',
expression : "(${/session/@user_id} = 1 or t1.bp_id_agent_level1 = decode((select su.bp_category from sys_user su where su.user_id =${/session/@user_id}),'AGENT',(select su.bp_id from sys_user su where su.user_id =${/session/@user_id}),'EMPLOYEE',t1.bp_id_agent_level1))"
}
];
override();
add_datafilter();
......@@ -824,7 +824,7 @@
para: {
function_name: '%' + document.getElementById('sp-searchtext').value + '%',
enabled_flag: 'Y',
role_id: ${/session/@role_id}
role_id: '${/session/@role_id}'
},
success: function (res) {
if (res.result.record) {
......@@ -1007,7 +1007,7 @@
url: $('BmLink_sys_user_query').getUrl(),
scope: this,
para: {
user_id: ${/session/@user_id}
user_id: '${/session/@user_id}'
},
success: function (res) {
if (res.success && res.result.record) {
......@@ -1067,7 +1067,7 @@
closeable: true,
draggable: true,
params: {
user_id:${/session/@user_id},
user_id:'${/session/@user_id}',
win_id: 'img_upload_window'
},
height: 468,
......@@ -1120,7 +1120,7 @@
url: $('BmLink_sys_user_update').getUrl(),
scope: this,
para: {
user_id: ${/session/@user_id},
user_id: '${/session/@user_id}',
email: $jq('[name="email"]').val(),
phone: $jq('[name="phone"]').val()
},
......@@ -1417,7 +1417,7 @@
}
function to_get_code() {
var userCodes = $('sys_role_ds').getAll();
var roleId = ${/session/@role_id};
var roleId = '${/session/@role_id}';
var roleCode;
userCodes.forEach(function (value) {
value.data.role_id == roleId && (roleCode = value.data.role_code)
......@@ -1435,7 +1435,7 @@
if (res.success) {
var userName = '';
res.result.record.forEach(function (value) {
if (value.user_id == ${/session/@user_id}) {
if (value.user_id == '${/session/@user_id}') {
userName = value.user_name;
}
});
......@@ -1449,7 +1449,7 @@
var userDs = $('userDs').getAll();
var userName;
userDs.forEach(function (value) {
value.data.userId == ${/session/@user_id} ? userName = value.data.user_name : userName = '';
value.data.userId == '${/session/@user_id}' ? userName = value.data.user_name : userName = '';
});
setUserName();
......@@ -2319,7 +2319,7 @@
Leaf.request({
url: $('').getUrl(),
para: {
role_id: ${/session/@role_id}
role_id: '${/session/@role_id}'
},
scope: this,
success: function (res) {
......
......@@ -23,6 +23,7 @@
<a:dataSet id="hls_bp_class_ds" lookupCode="HLS211_BP_CLASS"/>
<a:dataSet id="other_tmpt_clause_ds" lookupCode="CON202_CON_PRINT_OTHER_CONDITON"/>
<a:dataSet id="district_ds" lookupCode="PRJ500N_DISTRICT_AREAS"/>
<a:dataSet id="marital_status_flag_ds" lookupCode="EXIST_OR_NOT"/>
<a:dataSet id="clause_basinfo" autoCreate="true">
<a:fields>
<a:field name="template_code" defaultValue="${/parameter/@tmpt_code}" readOnly="true"/>
......@@ -34,6 +35,7 @@
<a:field name="withhold_way_n" displayField="code_value_name" options="con202_withway_ds" returnField="withhold_way" valueField="code_value"/>
<a:field name="pay_method_n" displayField="code_value_name" options="pay_methods_ds" returnField="pay_method" valueField="code_value"/>
<a:field name="secondary_lease_n" displayField="code_value_name" options="secondary_lease_ds" returnField="secondary_lease" valueField="code_value"/>
<a:field name="marital_status_flag_n" displayField="code_value_name" options="marital_status_flag_ds" returnField="marital_status_flag" valueField="code_value"/>
<a:field name="finance_type"/>
<a:field name="finance_type_n" displayField="code_value_name" options="con202_finance_type" returnField="finance_type" valueField="code_value"/>
<a:field name="contract_number" lovGridHeight="360" lovHeight="540" lovService="basic.con_contract_for_lov" lovWidth="680">
......@@ -133,6 +135,8 @@
<!-- <a:column name="car_brand_n" editor="lov" prompt="汽车品牌" width="100"/> -->
<a:column name="price_list_n" editor="lov" prompt="报价方案" width="120"/>
<a:column name="first_contract_flag" editor="check" prompt="首个支付表标志" width="120"/>
<!--add by 24976-->
<a:column name="marital_status_flag_n" editor="cb" prompt="有无配偶" width="100"/>
<a:column name="other_tmpt_clause_n" editor="cb" prompt="其他" width="100"/>
</a:columns>
......
......@@ -102,6 +102,7 @@
<a:field name="templet_usage_name" displayField="code_value_name" options="con202_clause_templet_tmplet_usage_ds" returnField="templet_usage" valueField="code_value"/>
<a:field name="approval_status_name" displayField="code_value_name" options="con202_clause_templet_approval_status_ds" returnField="approval_status" valueField="code_value"/>
<a:field name="enabled_flag_des" displayField="code_value_name" options="con202_clause_templet_enabled_status_ds" returnField="enabled_flag" valueField="code_value"/>
<a:field name="ele_content_flag_des" displayField="code_value_name" options="con202_clause_templet_enabled_status_ds" returnField="ele_content_flag" valueField="code_value"/>
</a:fields>
</a:dataSet>
<a:dataSet id="con202_clause_templet_result_ds" autoPageSize="true" autoQuery="true" model="cont.CON202.con_clause_templet" queryDataSet="con202_clause_templet_query_ds" selectable="true">
......@@ -110,6 +111,7 @@
<a:field name="description" required="true"/>
<a:field name="templet_usage" required="true"/>
<a:field name="enabled_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
<a:field name="ele_content_flag" checkedValue="Y" defaultValue="N" uncheckedValue="N"/>
<a:field name="language" defaultValue="CHINESE"/>
<a:field name="templet_usage_name" displayField="code_value_name" options="con202_clause_templet_tmplet_usage_ds" required="true" returnField="templet_usage" valueField="code_value"/>
<a:field name="language_name" displayField="code_value_name" options="con202_clause_templet_con_language_ds" required="true" returnField="language" valueField="code_value"/>
......@@ -143,6 +145,7 @@
<a:comboBox name="templet_usage_name" bindTarget="con202_clause_templet_query_ds" prompt="CON202.CON_CLAUSE_TEMPLET.TEMPLET_USAGE"/>
<a:comboBox name="approval_status_name" bindTarget="con202_clause_templet_query_ds" prompt="CON202.CON_CLAUSE_TEMPLET.APPROVAL_STATUS_NAME"/>
<a:comboBox name="enabled_flag_des" bindTarget="con202_clause_templet_query_ds" prompt="CON202.CON_CLAUSE_TEMPLET.ENABLED_FLAG_DES"/>
<a:comboBox name="ele_content_flag_des" bindTarget="con202_clause_templet_query_ds" prompt="电子签约合同文本"/>
</a:form>
<a:grid id="con202_clause_templet_functionTreeGrid" bindTarget="con202_clause_templet_result_ds" marginHeight="130" marginWidth="50" navBar="true" width="800">
<a:columns>
......@@ -154,6 +157,8 @@
<a:column name="print_num" align="right" editor="con202_clause_templet_grid_nf" prompt="打印份数" width="50"/>
<a:column name="con202_edit" prompt="CON202.EDIT" renderer="con202_clause_templet_grid_render" width="60"/>
<a:column name="enabled_flag" editor="con202_clause_templet_grid_ck" prompt="HLS030.ENABLED_FLAG" width="40"/>
<!--电子签约文本-->
<a:column name="ele_content_flag" editor="con202_clause_templet_grid_ck" prompt="电子签约合同文本" width="120"/>
<a:column name="language_name" editor="con202_clause_templet_grid_cb" prompt="CON202.LANGUAGE" width="60"/>
<a:column name="where_caluse" prompt="文本打印条件" renderer="where_caluse_renderer" width="100"/>
<a:column name="version_date" editor="con202_clause_templet_grid_tf" prompt="版本号" width="100"/>
......
......@@ -22,6 +22,7 @@
<a:link id="con_contract_content_bp_link" model="cont.CON505.con_contract_content_bp_for_lov" modelaction="query"/>
<a:link id="con543_con_batch_dl_link_id" url="${/request/@context_path}/modules/cont/CON505/con_atm_batch_dl.lsc"/>
<a:link id="con_doc_batch_create_link_id" url="${/request/@context_path}/modules/cont/CON500/con_doc_batch_create.lsc"/>
<a:link id="con_ele_doc_batch_create_link_id" url="${/request/@context_path}/modules/cont/CON500/con_ele_doc_batch_create.lsc"/>
<script><![CDATA[
function con_print_detail_print(){
//lock_current_window();
......@@ -61,7 +62,31 @@
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}');
}
......@@ -200,6 +225,7 @@
<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>
......
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<a:model-query fetchAll="true" model="cont.CON500.con_contract_get_guid_file_name"
rootPath="guid_file_name_path"/>
<!--<a:model-query fetchAll="true" model="cont.CON500.con_doc_file_templet_get_atm" rootPath="file_templet_get_atm_path"/>-->
<s:server-script import="contract_print_path.js"><![CDATA[
importPackage(java.io);
importPackage(Packages.hls.plugin.docx4j);
importPackage(Packages.leaf.plugin.word2pdf);
importPackage(Packages.org.apache.commons.io);
function copyFile(fOld, fNew) {
var fis = new java.io.FileInputStream(fOld);
var fos = new java.io.FileOutputStream(fNew);
var b = new java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024 * 4);
var len = -1;
while ((len = fis.read(b)) != -1) {
fos.write(b, 0, len);
}
fis.close();
fos.close();
}
//删除文件
function deleteFile(filePath) {
var file = new File(filePath);
if (file.exists()) {
file.delete();
}
}
//生成pdf
function wordToPdf(word_file_path,pdf_file_path) {
// word转pdf
var pdf_file_path_new = pdf_file_path + '.pdf';
var wordToPdf = new WordToPdf($instance('uncertain.ocm.IObjectRegistry'), "jacob-1.18-x64.dll");
wordToPdf.word2pdf(word_file_path, pdf_file_path_new);
//删除word文件
// deleteFile(word_file_path);
return pdf_file_path_new;
}
//生成pdf openoffice
function doc2pdf(word_file_path,pdf_file_path) {
// word转pdf
var pdf_file_path_new = pdf_file_path + '.pdf';
var wordToPdf = new doc2pdf2();
wordToPdf.doc2pdf2("C:/Program Files (x86)/OpenOffice 4",word_file_path, pdf_file_path_new);
//删除word文件
deleteFile(word_file_path);
return pdf_file_path_new;
}
//生成pdf
function AsposeWordToPDF(word_file_path,pdf_file_path) {
// word转pdf
var pdf_file_path_new = pdf_file_path + '.pdf';
var wordToPdf = new AsposeUtil();
wordToPdf.trans(word_file_path, pdf_file_path_new,"word");
//删除word文件
deleteFile(word_file_path);
return pdf_file_path_new;
}
//按日期创建目录
function getDatePath() {
set_parameter_file_path();
var file_path = $ctx.parameter.pdf_path; //file_path = c:/hls_test_files/content_files/
var now = new Date()
y = now.getFullYear()
m = now.getMonth() + 1
m = m < 10 ? "0" + m : m
var datePath = file_path + y + "/" + m + "/";
return datePath; //datePath = d:/hls_test_files/fileupload/2018/04/
}
//第一步生成合同文本
$bm('cont.CON505.con_ele_contract_create_content').update({
contract_id: $ctx.parameter.contract_id,
content_type:'NORMAL'
});
var datePath = getDatePath();
FileUtils.forceMkdir(new File(datePath)); //根据日期创建目录
var from_file_data_map=$bm('cont.CON500.con_doc_file_templet_get_atm').queryAsMap({
contract_id:$ctx.parameter.contract_id,
batch_flag:'Y'
});
var from_file_data = from_file_data_map.getChildren();
for (var i = 0;i < from_file_data.length;i++) {
var to_file_path = $ctx.parameter.file_path;
var record_data = from_file_data[i];
if (record_data.file_exists_flag != 'Y') {
var to_file_name = record_data.to_file_name + '.' + record_data.file_type_code || 'doc';
var from_file_path = record_data.file_path;
var guid_file_name_path = $bm('cont.CON500.con_contract_get_guid_file_name').queryAsMap();
var guid_file_name_tables = guid_file_name_path.getChildren();
to_file_path = to_file_path + guid_file_name_tables[0].guid_file_name + 'con' + record_data.content_id+ '.' + record_data.file_type_code || 'doc';
copyFile(from_file_path, to_file_path);
try {
var brwt = new BookmarksReplaceWithText($instance('leaf.database.service.IDatabaseServiceFactory'), $instance('uncertain.ocm.IObjectRegistry'), $ctx.getData());
brwt.replaceBookmarkFromContent(to_file_path.toString(), record_data.content_id);
} catch (e) {
raise_app_error(e);
}
/*
if (record_data.templet_code == 'FINANCE_LEASE_CONTRACT'||record_data.templet_code == 'FINANCE_LEASE_CONTRACT_A4'||record_data.templet_code == 'BUSINESS_CONTRACT'||record_data.templet_code == 'BUSINESS_CONTRACT_XJ'||record_data.templet_code=='LEASE_EXCHANGE'||record_data.templet_code=='LEASE_EXCHANGE_GN'||record_data.templet_code=='FINANCE_LEASE_CONTRACT_EX'||record_data.templet_code=='BUSINESS_CONTRACT_GK'||record_data.templet_code == 'REPURCHASE_DEBT_OFFSET'||record_data.templet_code == 'CON_CONTRACT_LEASE_BACK'||record_data.templet_code == 'CON_CONTRACT_MORTGAGE' ||record_data.templet_code == 'LEASE_CONTRACT_MASTER_OEC'||record_data.templet_code == 'LEASE_REQUEST_OEC') {
*/
// word转pdf
var pdf_file_path=datePath+guid_file_name_tables[0].guid_file_name + 'con_' + record_data.content_id;
var outputfilepath = wordToPdf(to_file_path,pdf_file_path);
var outputfilename= record_data.to_file_name +'.pdf';
var pdf_file = new File(outputfilepath);
var file_size = 0;
if (pdf_file.exists()) {
file_size = pdf_file.length();
}
//保存文本名及路径
$bm('cont.CON500.con_file_content_copy_update').execute({
table_name: 'CON_CONTRACT_CONTENT',
content_id: record_data.content_id,
file_name: outputfilename.toString(),
file_path: outputfilepath.toString(),
file_size: file_size,
file_type_code: 'pdf',
mime_type: 'application/pdf',
user_id: $ctx.parameter.user_id
});
//}
/* else{
$bm('cont.CON500.con_file_content_copy_update').update({
table_name: 'CON_CONTRACT_CONTENT',
content_id: record_data.content_id,
file_name: to_file_name.toString(),
file_path: to_file_path.toString()
});
}*/
}
}
]]></s:server-script>
</a:init-procedure>
</a:service>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<s:server-script><![CDATA[
importPackage(java.io);
importPackage(Packages.com.hand.elecon.httpost);
var up_file_token_url = '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;
}
//获取电子签署的flow_id
var sign_cancel_bm = $bm('cont.CON505.contract_sign_cancel');
var sign_cancel_map = sign_cancel_bm.queryAsMap({
contract_id:$ctx.parameter.contract_id
});
var flow_Id = sign_cancel_map.getChildren()[0].ele_flow_id;
var revokeParam = {
flowId:flow_Id
}
//调用中台取消流程
var info = info_query('HL_SIGN_FLOW_CANCEL');
var httpUrl = info.code_value;
var logs_bm = $bm('wx.WX100.con_ele_savelogs');
try {
var token_sign_result = EleFileUpHttpPost.post(up_file_token_url, null, null);
} catch (e) {
raise_app_error('上传文件获取token失败,请联系技术人员检查!');
}
var token_sign_result_ob = JSON.parse(token_sign_result);
var access_sign_token = token_sign_result_ob.access_token;
var result = EleFileUpHttpPost.post(httpUrl, JSON.stringify(revokeParam), access_sign_token);
logs_bm.insert({
contract_id:$ctx.parameter.contract_id,
httpurl:httpUrl,
jsonPut:JSON.stringify(revokeParam),
jsonResult:result,
tokenResult:token_sign_result
});
var result_ob = JSON.parse(result); //根据返回参数形式再定
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
})
}
]]></s:server-script>
</a:init-procedure>
</a:service>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zc
$Date: 2020年11月17日 17点57分
$Revision: 1.0
$Purpose: 电子合同监控页面
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true"
trace="true">
<a:init-procedure>
<a:model-query model="cont.CON620.get_sys_role" rootPath="role_info"/>
</a:init-procedure>
<a:view>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
modelaction="update"/>
<a:link id="car_modify_link_readonly" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain.lview"/>
<a:link id="${/parameter/@layout_code}con_contract_query_link"
url="${/request/@context_path}/modules/cont/CON3200/con_re_incept_modify.lview"/>
<script type="text/javascript"><![CDATA[
function open_contract_win(ds_id, record_id) {
var record = $(ds_id).findById(record_id);
var param = record.data;
param['function_usage'] = 'QUERY';
param['function_code'] = 'CON3200Q';
param['maintain_type'] = 'QUERY';
param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, '${/parameter/@layout_code}con_contract_query_link', ds_id);
}
function open_project_Window(record_id, ds_id) {
var record = $(ds_id).findById(record_id);
//项目类layout_code
maintain_type = 'READONLY';
param = record.data;
param['document_id'] = record.get('project_id');
param['function_code'] = 'PRJ501_WFL';
param['function_usage'] = 'QUERY';
param['maintain_type'] = maintain_type;
param['url_title'] = '${l:HLS.PROJECT_MAITAIN}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'car_modify_link_readonly', ds_id);
}
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record) {
if (name == 'contract_number' && value) {
return '<a href="javascript:open_contract_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
}
if (name == 'project_number' && value) {
return '<a href="javascript:open_project_Window(\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>';
}
return value;
};
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
var grid_id = ds_id.replace('ds', 'layout_grid_id');
$(grid_id)._export();
};
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
</a:screen>
......@@ -8,15 +8,16 @@
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:view>
<a:link id="hls810_param_link_link" url="${/request/@context_path}/modules/hls/HLS810/hls_doc_file_tmp_para_link.lview"/>
<a:link id="hls810_templet_signer_link" url="${/request/@context_path}/modules/hls/HLS810/hls_doc_file_templet_signer.lview"/>
<a:link id="hls810_atm_link" url="${/request/@context_path}/uploadFile.lview"/>
<script type="text/javascript"><![CDATA[
function hls810_add() {
var ds = $('hls_doc_file_temp_ds');
var record = ds.create(ds.currentIndex);
$('hls_doc_file_temp_ds_id').showEditorByRecord(record);
}
function hls810_delete() {
var ds = $('hls_doc_file_temp_ds');
var records = ds.getSelected();
......@@ -25,17 +26,17 @@
ds.remove(records);
});
}
}
function hls810_save() {
var ds = $('hls_doc_file_temp_ds');
if (ds.validate()) {
ds.submit();
}
}
function editor_check(record, name) {
if (record.isNew) {
if(name=='templet_code' )
......@@ -45,7 +46,7 @@
}
return '' ;
}
function hls810_query(){
$('hls_doc_file_temp_ds').query();
}
......@@ -66,6 +67,23 @@
width: 830
});
}
//模板签署人链接 add by 24976
function hls810_templet_signer_link_rener(value,record,name){
var tmpt_id = record.get('templet_id');
if(!record.isNew){
return '<a href="javascript:hls810_signer_jump(\''+tmpt_id+'\')">签署人</a>';
}
}
function hls810_signer_jump(templet_id){
var url = $('hls810_templet_signer_link').getUrl()+'?templet_id='+templet_id;
wd = new Leaf.Window({
id: 'hls810_templet_signer_link_screen',
url: url,
title: '签署人参数',
height: 500,
width: 830
});
}
function hls810_plugin_render(value,record,name){
var tmpt_id = record.get('templet_id');
if(!record.isNew){
......@@ -152,6 +170,7 @@
<a:column name="note" editor="textArea_ed" prompt="说明" width="200"/>
<a:column name="enabled_flag" editor="checkbox_ed" prompt="启用" width="50"/>
<a:column name="param_link" align="center" prompt="参数集" renderer="hls810_param_link_rener"/>
<a:column name="templet_signer_link" align="center" prompt="签署人" renderer="hls810_templet_signer_link_rener"/>
<a:column name="pwd" align="center" editor="hls810_pwd_ed" prompt="密码" renderer="setPassword"/>
<a:column name="main_flag" editor="checkbox_ed" prompt="宏菱" width="150"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:init-procedure/>
<a:view>
<script type="text/javascript"><![CDATA[
function hls810_signer_add(){
$('hls810_signer_result_gd').showEditorByRecord($('hls810_signer_result_ds').create());
}
function hls810_signer_del(){
$('hls810_signer_result_gd').remove();
}
function hls810_signer_save(){
$('hls810_signer_result_ds').submit();
}
]]></script>
<a:dataSets>
<a:dataSet id="signer_category_ds" lookupCode="HL_SIGNER_CATEGORY"/>
<a:dataSet id="indentity_type_ds" lookupCode="HL_INDENTITY_TYPE"/>
<a:dataSet id="sign_type_ds" lookupCode="HL_SIGN_TYPE"/>
<a:dataSet id="hls810_signer_query_ds" autoCreate="true">
<a:fields>
<a:field name="templet_id" defaultValue="${/parameter/@templet_id}"/>
</a:fields>
</a:dataSet>
<a:dataSet id="hls810_signer_result_ds" autoQuery="true" model="hls.HLS810.hls_doc_file_templet_signer" queryDataSet="hls810_signer_query_ds" queryUrl="${/request/@context_path}/autocrud/hls.HLS810.hls_doc_file_templet_signer/query?templet_id=${/parameter/@templet_id}" selectable="true">
<a:fields>
<a:field name="templet_id" defaultValue="${/parameter/@templet_id}"/>
<a:field name="enable_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
<a:field name="auto_sign" checkedValue="Y" defaultValue="N" uncheckedValue="N"/>
<a:field name="signer_category_desc" displayField="code_value_name" options="signer_category_ds" returnField="signer_category" valueField="code_value"/>
<a:field name="indentity_type_desc" displayField="code_value_name" options="indentity_type_ds" returnField="indentity_type" valueField="code_value"/>
<a:field name="sign_type_desc" displayField="code_value_name" options="sign_type_ds" returnField="sign_type" valueField="code_value"/>
</a:fields>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:gridButton click="hls810_signer_add" text="新增"/>
<a:gridButton click="hls810_signer_del" text="删除"/>
<a:gridButton click="hls810_signer_save" text="HLS.SAVE"/>
</a:screenTopToolbar>
<a:grid id="hls810_signer_result_gd" bindTarget="hls810_signer_result_ds" height="320" navBar="true" width="790">
<a:columns>
<a:column name="signer_category_desc" align="center" editor="hls810_signer_combox" prompt="签署对象"/>
<a:column name="indentity_type_desc" align="center" editor="hls810_signer_combox" prompt="签署人签约类别"/>
<a:column name="key_word" align="center" editor="text_ed" prompt="关键字"/>
<a:column name="auto_sign" editor="hls810_signer_checked" prompt="是否自动签署" width="50"/>
<a:column name="sign_order" align="center" editor="text_ed" prompt="签署顺序"/>
<a:column name="sign_type_desc" align="center" editor="hls810_signer_combox" prompt="签署类型"/>
<a:column name="enable_flag" editor="hls810_signer_checked" prompt="启用" width="50"/>
</a:columns>
<a:editors>
<a:textField id="text_ed"/>
<a:checkBox id="hls810_signer_checked"/>
<a:comboBox id="hls810_signer_combox"/>
</a:editors>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:ns1="leaf.application.action" xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<s:server-script import="app/app_login_check.js"><![CDATA[
function con_contract_query() {
var contract_list_details;
try {
var contract_list_bm = $bm('wx.WX100.con_contract_query');
var contract_list_map;
var inputData = $ctx.parameter.inputData;
if (inputData == null){
contract_list_map = contract_list_bm.queryAsMap({
id_no:$ctx.parameter.idNo,
id_type:$ctx.parameter.IdType
});
}else{
contract_list_map = contract_list_bm.queryAsMap({
id_no:$ctx.parameter.idNo,
id_type:$ctx.parameter.IdType,
contract_number:$ctx.parameter.contract_number
});
}
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) {
for (var i = 0;i < contract_list_details.length;i++) {
var contract_list_detail = contract_list_details[i];
var contract_id = contract_list_detail.contract_id;
var ec_sign_type = contract_list_detail.ec_sign_type;
if(ec_sign_type == 'NEW'||ec_sign_type == 'INITIATE' ||ec_sign_type == 'SIGNING') {
var signFiles = [];
//未完成签署附件信息表查询
var file_list_bm = $bm('wx.WX100.con_file_list_query');
var file_list_map = file_list_bm.queryAsMap({
contract_id: contract_id,
id_no: $ctx.parameter.idNo,
id_type: $ctx.parameter.IdType
});
var file_list_details = file_list_map.getChildren();
for (var j = 0; j < file_list_details.length; j++) {
signFiles.push({
fileName: file_list_details[j].file_name,
orderSeq: file_list_details[j].order_seq
});
}
unSignContracts.push({
"contractNumber": contract_list_detail.contract_number,
"telentName": contract_list_detail.bp_id_tenant_n,
"agentName": contract_list_detail.bp_id_agent_level1_n,
"serialNo": contract_list_detail.machine_number,
"contractStatus": contract_list_detail.contract_status_n,
"esignStatus": contract_list_detail.ec_sign_type_n,
"brand": contract_list_detail.brand_id_n,
"modelNo": contract_list_detail.modelcd,
"totalTimes": contract_list_detail.lease_times,
"signAmt": contract_list_detail.total_sign,
"signUrl":contract_list_detail.sign_url,
"signFiles": signFiles
});
}
}
}
$ctx.parameter.json = JSON.stringify(result);
}
if ($ctx.parameter.return_status != 'E' && $ctx.parameter.return_status != 'TIMEOUT') {
con_contract_query();
}
]]></s:server-script>
</a:init-procedure>
<a:service-output output="/parameter/@json"/>
</a:service>
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:ns1="leaf.application.action" xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<s:server-script><![CDATA[
importPackage(java.io);
importPackage(Packages.java.util);
function con_sign_status_update() {
try {
var signer_status_update_bm = $bm('wx.WX100.con_ele_signer_status_update');
//个人签署完成
if ($ctx.parameter.action == 'SIGN_FLOW_UPDATE'){
signer_status_update_bm.update({
flow_id:$ctx.parameter.flowId,
id_no:$ctx.parameter.idNo,
sign_time:$ctx.parameter.signTime,
sign_result:$ctx.parameter.signResult
});
$ctx.parameter.return_status = '0';
$ctx.parameter.return_message = '修改成功';
}
//合同签署完成
else if($ctx.parameter.action == 'SIGN_FLOW_FINISH'){
var docsList = $ctx.parameter.docsList;
for (var i = 0; i < conFileList.length ; i++){
signer_status_update_bm.insert({
flow_id:$ctx.parameter.flowId,
flow_status:$ctx.parameter.flowStatus,
end_time:$ctx.parameter.endTime,
file_id:docsList[i].fileId,
file_name:docsList[i].fileName,
file_download_url:docsList[i].fileUrl
});
}
$ctx.parameter.return_status = '0';
$ctx.parameter.return_message = '修改成功';
}
}catch(e)
{
$ctx.success = "true";
$ctx.parameter.return_status = '1';
$ctx.parameter.return_message = $ctx.get('/error/@message') || String(e);
}
var result = {
code: $ctx.parameter.return_status,
message: $ctx.parameter.return_message
};
$ctx.parameter.json = JSON.stringify(result);
}
con_sign_status_update();
]]></s:server-script>
<p:echo/>
</a:init-procedure>
<a:service-output output="/parameter/@json"/>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:ns1="leaf.application.action" xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<s:server-script><![CDATA[
importPackage(Packages.deron_sms_interface);
function send_sms() {
try {
if($ctx.parameter.mobile){
//step1 配置信息
var sms_server_bm = $bm('sys.SYS403.sys_sms_server');
var sms_server_result = sms_server_bm.queryAsMap({});
var sms_server_records = sms_server_result.getChildren();
var server_url = sms_server_records[0].server_url;
var CorpID = sms_server_records[0].serviceid;
var Pwd = sms_server_records[0].password;
// step2 生成短信
var verify_code_sms_bm = $bm('wx.WX100.wx_verify_code_sms');
verify_code_sms_bm.insert({
phone_number: $ctx.parameter.mobile
});
var sms_list_bm = $bm('sys.SYS401.sys_sms_list');
if ($ctx.parameter.sms_id) {
var sms_list_result = sms_list_bm.queryAsMap({
sms_id: $ctx.parameter.sms_id
});
var sms_list_records = sms_list_result.getChildren();
}
for (var i = 0;i < sms_list_records.length;i++) {
var Phones = sms_list_records[i].phone_number;
var content = sms_list_records[i].text;
var sms_id = sms_list_records[i].sms_id;
try {
var sms = new SendSms();
var result = sms.doSend(server_url, CorpID, Pwd, content, Phones);
var req_response = result.toString();
// req_response = parseInt(req_response);
/* var json_result = {
"sendflag": result
};
$ctx.parameter.json = JSON.stringify(json_result);*/
} catch (e) {
println("抛出异常:" + e);
}
// 发送短信后,逻辑处理
$bm('nt.sys_sms_list').update({
sms_id: sms_id,
req_response: req_response
});
}
$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,
data:{}
};
var data = result.data;
data["mobile"] = $ctx.parameter.mobile;
data["verifyCode"] = $ctx.parameter.verify_code.toString();
$ctx.parameter.json = JSON.stringify(result);
}
send_sms();
]]></s:server-script>
</a:init-procedure>
<a:service-output output="/parameter/@json"/>
</a:service>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment