Commit cabbe26e authored by 18083's avatar 18083

建机电子档案开发

parent 468e9ac8
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2023年2月7日 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="is_valid" databaseType="VARCHAR2" datatype="java.lang.String"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select token_post_pkg.check_token_valid is_valid from dual
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zhangxing5129
$Date: 2014-7-14 下午03:09:37
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:o="leaf.database.local.oracle" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT t.access_token
FROM (SELECT v.record_id, v.access_token
FROM token_record_info v
where v.start_time <= sysdate
and v.over_time >= sysdate
order by v.record_id desc) t
where rownum = 1
]]></bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
token_post_pkg.insert_token_recode(p_system_source =>${@system_source},
p_expires_in =>${@expires_in},
p_access_token =>${@access_token},
p_user_id => ${/session/@user_id}
);
end;]]></bm:update-sql>
</bm:operation>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
insert into token_response_logs
(
log_id,
response_json,
status,
created_by,
creation_date,
last_updated_by,
last_update_date
) values
(token_response_logs_s.nextval,
${@json},
${@status},
${/session/@user_id},
sysdate,
${/session/@user_id},
sysdate
);
commit;
end;]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="access_token"/>
</bm:fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: luochenglong
$Date: 2023-02-07 早上 11:03:31
$Revision: 1.0
$Purpose: 电子档案类型定义bm
-->
<bm:model xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1" baseTable="E_ARCHIVES_DEFINE" defaultOrderBy="base_archive_code">
<bm:fields>
<bm:field name="base_archive_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BASE_ARCHIVE_ID" />
<bm:field name="base_archive_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BASE_ARCHIVE_CODE" />
<bm:field name="archive_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ARCHIVE_TYPE" />
<bm:field name="post_stru_data_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="POST_STRU_DATA_FLAG" />
<bm:field name="stru_data_sql" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="STRU_DATA_SQL" />
<bm:field name="is_workflow" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="IS_WORKFLOW" />
<bm:field name="workflow_id" databaseType="NUMBER" datatype="java.lang.String" physicalName="WORKFLOW_ID" />
<bm:field name="post_atm_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="POST_ATM_FLAG" />
<bm:field name="atm_sql" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ATM_SQL" />
<bm:field name="je_check_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="JE_CHECK_FLAG" />
<bm:field name="je_source_sql" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="JE_SOURCE_SQL" />
<bm:field name="workflow_desc" forInsert="false" expression="(SELECT c.workflow_desc FROM zj_wfl_workflow c where c.workflow_id= t1.workflow_id)" forUpdate="false"/>
<bm:field name="archive_type_desc" forInsert="false" expression="(SELECT c.code_value_name FROM sys_code_values_v c where c.code=&apos;DATA_CLASSIFICATION&apos; and c.code_value = t1.archive_type)" forUpdate="false" />
<bm:field name="is_workflow_desc" forInsert="false" expression="(SELECT c.code_value_name FROM sys_code_values_v c where c.code=&apos;YES_NO&apos; and c.code_value = t1.is_workflow)" forUpdate="false" />
<bm:field name="post_stru_data_flag_desc" forInsert="false" expression="(SELECT c.code_value_name FROM sys_code_values_v c where c.code=&apos;YES_NO&apos; and c.code_value = t1.post_stru_data_flag)" forUpdate="false"/>
<bm:field name="post_atm_flag_desc" forInsert="false" expression="(SELECT c.code_value_name FROM sys_code_values_v c where c.code=&apos;YES_NO&apos; and c.code_value = t1.post_atm_flag)" forUpdate="false" />
<bm:field name="je_check_flag_desc" forInsert="false" expression="(SELECT c.code_value_name FROM sys_code_values_v c where c.code=&apos;YES_NO&apos; and c.code_value = t1.je_check_flag)" forUpdate="false"/>
</bm:fields>
<bm:operations>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
elec_wfl_pkg.elec_type_update(
p_sql_type =>'INSERT',
p_base_archive_id => ${@base_archive_id},
p_base_archive_code => ${@base_archive_code},
p_archive_type => ${@archive_type},
p_post_stru_data_flag => ${@post_stru_data_flag},
p_stru_data_sql => ${@stru_data_sql},
p_is_workflow => ${@is_workflow},
p_workflow_id => ${@workflow_id},
p_post_atm_flag => ${@post_atm_flag},
p_atm_sql => ${@atm_sql},
p_je_check_flag => ${@je_check_flag},
p_je_source_sql => ${@je_source_sql},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
elec_wfl_pkg.elec_type_update(
p_sql_type => 'UPDATE',
p_base_archive_id => ${@base_archive_id},
p_base_archive_code => ${@base_archive_code},
p_archive_type => ${@archive_type},
p_post_stru_data_flag => ${@post_stru_data_flag},
p_stru_data_sql => ${@stru_data_sql},
p_is_workflow => ${@is_workflow},
p_workflow_id => ${@workflow_id},
p_post_atm_flag => ${@post_atm_flag},
p_atm_sql => ${@atm_sql},
p_je_check_flag => ${@je_check_flag},
p_je_source_sql => ${@je_source_sql},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="delete">
<bm:update-sql><![CDATA[
begin
elec_wfl_pkg.elec_type_delete(
p_base_archive_id => ${@base_archive_id},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field field="archive_type" queryExpression="t1.archive_type =${@archive_type}"/>
<bm:query-field field="is_workflow" queryExpression="t1.is_workflow =${@is_workflow}"/>
<bm:query-field field="post_atm_flag" queryExpression="t1.post_atm_flag =${@post_atm_flag}"/>
<bm:query-field field="je_check_flag" queryExpression="t1.je_check_flag =${@je_check_flag}"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: luochenglong
$Date: 2023-02-07 下午3:03:31
$Revision: 1.0
$Purpose: 凭证模板bm
-->
<bm:model xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1" baseTable="E_ARCHIVES_DEFINE_JE" defaultOrderBy="je_template_code">
<bm:fields>
<bm:field name="base_archive_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BASE_ARCHIVE_ID" />
<bm:field name="je_id" databaseType="NUMBER" datatype="java.lang.String" physicalName="JE_ID" />
<bm:field name="je_template_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="JE_TEMPLATE_CODE" />
<bm:field name="je_template_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="JE_TEMPLATE_NAME" />
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select t1.base_archive_id,
t1.je_id,
t1.je_template_code,
t1.je_template_name
from E_ARCHIVES_DEFINE_JE t1
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
elec_wfl_pkg.je_template_update(
p_sql_type =>'INSERT',
p_je_id => ${@je_id},
p_base_archive_id => ${@base_archive_id},
p_je_template_code => ${@je_template_code},
p_je_template_name => ${@je_template_name},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
elec_wfl_pkg.je_template_update(
p_sql_type =>'UPDATE',
p_je_id => ${@je_id},
p_base_archive_id => ${@base_archive_id},
p_je_template_code => ${@je_template_code},
p_je_template_name => ${@je_template_name},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="delete">
<bm:update-sql><![CDATA[
begin
elec_wfl_pkg.je_template_delete(
p_je_id => ${@je_id},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:data-filters>
<bm:data-filter name="base_archive_id" enforceOperations="query" expression="base_archive_id=${@base_archive_id}"/>
</bm:data-filters>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2023-2-7 下午2:36:27
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select
t.e_archives_id,
t.base_archive_code,
t.archive_type,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'ELEC_FILE_TYPE'
and v.code_value = t.archive_type) archive_type_desc,
t.document_id,
t.document_number,
t.document_info,
t.done_flag,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'DONE_FLAG_STATUS'
and v.code_value = t.done_flag) done_flag_desc,
t.error_message,
to_char(t.last_update_date,'yyyy-mm-dd') last_update_date
from hl_e_archives_post_list t
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="archive_type" queryExpression="t.archive_type like ${@archive_type}"/>
<bm:query-field name="done_flag" queryExpression="t.done_flag=${@done_flag}"/>
<bm:query-field name="document_id" queryExpression="t.document_id=${@document_id}"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2023-2-7 下午2:36:27
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
elec_wfl_pkg.efile_generate_pool(p_e_archives_id => ${@e_archives_id},
p_base_archive_code => ${@base_archive_code},
p_archive_type => ${@archive_type},
p_document_id => ${@document_id},
p_document_number => ${@document_number},
p_document_info => ${@document_info},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: luochenglong
$Date: 2023-02-10 早上 11:03:31
$Revision: 1.0
$Purpose: 电子档案池bm
-->
<bm:model xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" >
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT
fam.table_name,
fam.table_pk_value,
fam.record_id,
faa.attachment_id,
faa.file_name,
faa.file_type_code,
faa.file_path
FROM
fnd_atm_attachment_multi fam,
fnd_atm_attachment faa
WHERE
faa.rowid =${@rowid} AND
fam.attachment_id = faa.attachment_id
]]></bm:query-sql>
<bm:parameters>
<bm:parameter name="rowid"/>
</bm:parameters>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="table_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TABLE_NAME" required="true"/>
<bm:field name="table_pk_value" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TABLE_PK_VALUE" required="true"/>
<bm:field name="record_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="RECORD_ID" required="true"/>
<bm:field name="attachment_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="ATTACHMENT_ID" required="true"/>
<bm:field name="file_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_NAME"/>
<bm:field name="file_type_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_TYPE_CODE"/>
<bm:field name="file_path" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_PATH"/>
</bm:fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: luochenglong
$Date: 2023-02-10 早上 11:03:31
$Revision: 1.0
$Purpose: 电子档案池bm
-->
<bm:model xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" >
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select * from (SELECT t1.pool_id,
t1.primary_field,
t1.internal_period_num,
t1.base_archive_code,
t1.archive_type,
t1.document_id,
t1.document_number,
t1.document_info,
t1.post_status,
(SELECT c.code_value_name FROM sys_code_values_v c where c.code='DATA_CLASSIFICATION' and c.code_value = t1.archive_type) archive_type_desc,
(SELECT c.code_value_name FROM sys_code_values_v c where c.code='YES_NO' and c.code_value = 'Y') suppl_trans_flag, t1.hly_req_number as post_batch_num,
t1.post_message
FROM hl_e_archives_pool t1
where t1.creation_date>=sysdate-30)
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="pool_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="POOL_ID" />
<bm:field name="primary_field" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PRIMARY_ID" />
<bm:field name="internal_period_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INTERNAL_PERIOD_NUM"/>
<bm:field name="base_archive_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BASE_ARCHIVE_CODE" />
<bm:field name="archive_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ARCHIVE_TYPE"/>
<bm:field name="document_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DOCUMENT_ID"/>
<bm:field name="document_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_NUMBER"/>
<bm:field name="post_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_NUMBER"/>
<bm:field name="document_info" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="POST_STATUS"/>
<bm:field name="post_message" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="POST_MESSAGE"/>
</bm:fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: luochenglong
$Date: 2023-02-10 早上 11:03:31
$Revision: 1.0
$Purpose: 电子档案池bm
-->
<bm:model xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" >
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT t1.pool_id,
t1.primary_field,
t1.internal_period_num,
t1.base_archive_code,
t1.archive_type,
t1.document_id,
t1.document_number,
t1.document_info,
t1.post_status,
nvl((select gps.monthly_closed_flag from gld_periods gp,gld_period_status gps where replace(gp.period_name,'-','')=t1.internal_period_num and gps.company_id = ${/session/@company_id} and gp.internal_period_num=gps.internal_period_num and gps.period_set_code=gp.period_set_code),'N') monthly_closed_flag ,
(SELECT c.code_value_name FROM sys_code_values_v c where c.code='DATA_CLASSIFICATION' and c.code_value = t1.archive_type) archive_type_desc,
(SELECT c.code_value_name FROM sys_code_values_v c where c.code='YES_NO' and c.code_value = 'Y') suppl_trans_flag,
t1.hly_req_number as post_batch_num,
t1.post_message
FROM hl_e_archives_pool t1
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
elec_wfl_pkg.elec_type_update(
p_sql_type =>'INSERT',
p_base_archive_id => ${@base_archive_id},
p_base_archive_code => ${@base_archive_code},
p_archive_type => ${@archive_type},
p_post_stru_data_flag => ${@post_stru_data_flag},
p_stru_data_sql => ${@stru_data_sql},
p_is_workflow => ${@is_workflow},
p_workflow_id => ${@workflow_id},
p_post_atm_flag => ${@post_atm_flag},
p_atm_sql => ${@atm_sql},
p_je_check_flag => ${@je_check_flag},
p_je_source_sql => ${@je_source_sql},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
elec_wfl_pkg.elec_type_update(
p_sql_type => 'UPDATE',
p_base_archive_id => ${@base_archive_id},
p_base_archive_code => ${@base_archive_code},
p_archive_type => ${@archive_type},
p_post_stru_data_flag => ${@post_stru_data_flag},
p_stru_data_sql => ${@stru_data_sql},
p_is_workflow => ${@is_workflow},
p_workflow_id => ${@workflow_id},
p_post_atm_flag => ${@post_atm_flag},
p_atm_sql => ${@atm_sql},
p_je_check_flag => ${@je_check_flag},
p_je_source_sql => ${@je_source_sql},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="delete">
<bm:update-sql><![CDATA[
begin
elec_wfl_pkg.elec_type_delete(
p_base_archive_id => ${@base_archive_id},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="internal_period_num" queryExpression="t1.internal_period_num =${@internal_period_num}"/>
<bm:query-field name="archive_type_desc" queryExpression="t1.archive_type_desc =${@archive_type_desc}"/>
<bm:query-field name="primary_field" queryExpression="t1.primary_field =${@primary_field}"/>
<bm:query-field name="document_info" queryExpression="t1.document_info =${@document_info}"/>
<bm:query-field name="post_status" queryExpression="t1.post_status =${@post_status}"/>
<bm:query-field name="post_batch_num" queryExpression="t1.post_batch_num =${@post_batch_num}"/>
<bm:query-field name="suppl_trans_flag" queryExpression="t1.suppl_trans_flag =${@suppl_trans_flag}"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: luochenglong
$Date: 2023-02-10 早上 11:03:31
$Revision: 1.0
$Purpose: 电子档案池bm
-->
<bm:model xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" >
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select '{'||pt.atm_data_json||'}' sql_content
from hl_e_archives_pool_data pt
where pt.pool_id = ${@pool_id}
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="sql_content" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SQL"/>
</bm:fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: luochenglong
$Date: 2023-02-10 早上 11:03:31
$Revision: 1.0
$Purpose: 电子档案池bm
-->
<bm:model xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" >
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select '{'||pt.stru_data_json||'}' sql_content
from hl_e_archives_pool_data pt
where pt.pool_id = ${@pool_id}
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="sql_content" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SQL"/>
</bm:fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: luochenglong
$Date: 2023-02-10 早上 11:03:31
$Revision: 1.0
$Purpose: 电子档案池bm
-->
<bm:model xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" >
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT t1.pool_id,
t1.primary_field,
t1.internal_period_num,
t1.base_archive_code,
t1.archive_type,
t1.document_id,
t1.document_number,
t1.document_info,
t1.post_status,
(SELECT c.code_value_name FROM sys_code_values_v c where c.code='DATA_CLASSIFICATION' and c.code_value = t1.archive_type) archive_type_desc,
(SELECT c.code_value_name FROM sys_code_values_v c where c.code='YES_NO' and c.code_value = 'Y') suppl_trans_flag,
(SELECT c.code_value_name FROM sys_code_values_v c where c.code='POST_STATUS_DESC' and c.code_value =t1.post_status) post_status_desc,
t1.hly_req_number as post_batch_num,
t1.post_message
FROM hl_e_archives_pool t1
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
elec_wfl_pkg.att_upload_return(
p_primary_field =>${@primary_field},
p_status =>${@status},
p_message =>${@message},
p_attachmentoid =>${@attachmentoid},
p_hly_fileurl =>${@hly_fileurl},
p_user_id =>${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
elec_wfl_pkg.elec_type_update(
p_sql_type => 'UPDATE',
p_base_archive_id => ${@base_archive_id},
p_base_archive_code => ${@base_archive_code},
p_archive_type => ${@archive_type},
p_post_stru_data_flag => ${@post_stru_data_flag},
p_stru_data_sql => ${@stru_data_sql},
p_is_workflow => ${@is_workflow},
p_workflow_id => ${@workflow_id},
p_post_atm_flag => ${@post_atm_flag},
p_atm_sql => ${@atm_sql},
p_je_check_flag => ${@je_check_flag},
p_je_source_sql => ${@je_source_sql},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="delete">
<bm:update-sql><![CDATA[
begin
elec_wfl_pkg.elec_type_delete(
p_base_archive_id => ${@base_archive_id},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="internal_period_num" queryExpression="t1.internal_period_num =${@internal_period_num}"/>
<bm:query-field name="archive_type_desc" queryExpression="t1.archive_type_desc =${@archive_type_desc}"/>
<bm:query-field name="primary_field" queryExpression="t1.primary_field =${@primary_field}"/>
<bm:query-field name="document_info" queryExpression="t1.document_info like ${@document_info}"/>
<bm:query-field name="post_status_desc" queryExpression="t1.post_status_desc =${@post_status_desc}"/>
<bm:query-field name="post_batch_num" queryExpression="t1.post_batch_num =${@post_batch_num}"/>
<bm:query-field name="suppl_trans_flag" queryExpression="t1.suppl_trans_flag =${@suppl_trans_flag}"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: luochenglong
$Date: 2023-02-10 早上 11:03:31
$Revision: 1.0
$Purpose: 电子档案池bm
-->
<bm:model xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" >
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT t1.pool_id,
t1.primary_field,
t1.internal_period_num,
t1.base_archive_code,
t1.archive_type,
t1.document_id,
t1.document_number,
t1.document_info,
t1.post_status,
(SELECT c.code_value_name FROM sys_code_values_v c where c.code='DATA_CLASSIFICATION' and c.code_value = t1.archive_type) archive_type_desc,
(SELECT c.code_value_name FROM sys_code_values_v c where c.code='YES_NO' and c.code_value = 'Y') suppl_trans_flag,
(SELECT c.code_value_name FROM sys_code_values_v c where c.code='POST_STATUS_DESC' and c.code_value =t1.post_status) post_status_desc,
t1.hly_req_number as post_batch_num,
t1.post_message
FROM hl_e_archives_pool t1
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
elec_wfl_pkg.doc_import_return(
p_primary_field =>${@primary_field},
p_post_status =>${@post_status},
p_post_message =>${@post_message},
p_hly_req_number =>${@hly_req_number},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
elec_wfl_pkg.elec_type_update(
p_sql_type => 'UPDATE',
p_base_archive_id => ${@base_archive_id},
p_base_archive_code => ${@base_archive_code},
p_archive_type => ${@archive_type},
p_post_stru_data_flag => ${@post_stru_data_flag},
p_stru_data_sql => ${@stru_data_sql},
p_is_workflow => ${@is_workflow},
p_workflow_id => ${@workflow_id},
p_post_atm_flag => ${@post_atm_flag},
p_atm_sql => ${@atm_sql},
p_je_check_flag => ${@je_check_flag},
p_je_source_sql => ${@je_source_sql},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="delete">
<bm:update-sql><![CDATA[
begin
elec_wfl_pkg.elec_type_delete(
p_base_archive_id => ${@base_archive_id},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="internal_period_num" queryExpression="t1.internal_period_num =${@internal_period_num}"/>
<bm:query-field name="archive_type_desc" queryExpression="t1.archive_type_desc =${@archive_type_desc}"/>
<bm:query-field name="primary_field" queryExpression="t1.primary_field =${@primary_field}"/>
<bm:query-field name="document_info" queryExpression="t1.document_info like ${@document_info}"/>
<bm:query-field name="post_status_desc" queryExpression="t1.post_status_desc =${@post_status_desc}"/>
<bm:query-field name="post_batch_num" queryExpression="t1.post_batch_num =${@post_batch_num}"/>
<bm:query-field name="suppl_trans_flag" queryExpression="t1.suppl_trans_flag =${@suppl_trans_flag}"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: luochenglong
$Date: 2023-02-10 早上 11:03:31
$Revision: 1.0
$Purpose: 电子档案池bm
-->
<bm:model xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" >
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select pt.atm_data_json attachmentList,pt.stru_data_json as fieldValueList
from hl_e_archives_pool_data pt
where pt.pool_id = ${@pool_id}
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="fieldValueList"/>
<bm:field name="attachmentList"/>
</bm:fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
BEGIN
wfl_instance_pdf_pkg.create_wfl_instance_content(p_instance_id => ${@instance_id},
p_user_id => nvl(${/session/@user_id},${@user_id}));
commit;
END;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
BEGIN
wfl_instance_pdf_pkg.insert_fnd_atm(
p_table_name =>${@table_name},
p_table_pk_value =>${@instance_id},
p_file_name =>${@file_name},
p_file_path =>${@file_path},
p_user_id =>nvl(${/session/@user_id},${@user_id}),
p_file_size =>${@file_size}
);
END;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT
faa.file_name,
faa.file_path,
faa.file_type_code,
'建机审批流版式文件-' ||decode(z.workflow_id,-1,substr(z.instance_desc,instr(z.instance_desc,'-',1)+1),(select w.workflow_desc from zj_wfl_workflow w where w.workflow_id=z.workflow_id)) || '-' || z.instance_id || '.docx' to_file_name,
lt.pwd,
fc.document_id,
fc.content_id
FROM
fnd_atm_attachment faa,
fnd_atm_attachment_multi m,
hls_doc_file_templet lt,
con_clause_templet t,
hls_doc_file_content fc,
zj_wfl_workflow_instance z
WHERE
faa.attachment_id = m.attachment_id AND
m.table_name = 'HLS_DOC_FILE_TEMPLET' AND
m.table_pk_value = lt.templet_id AND
lt.templet_id = t.doc_template_id AND
t.doc_plugin_flag = 'Y' AND
t.templet_id = fc.templet_Id AND
fc.document_id = z.instance_id AND
fc.document_table = 'ZJ_WFL_WORKFLOW_INSTANCE' and
z.instance_id = ${@instance_id}
]]></bm:query-sql>
</bm:operation>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
wfl_instance_pdf_pkg.save_pdf_atm(p_instance_id =>${@instance_id},
p_table_name =>${@table_name});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="file_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_NAME"/>
<bm:field name="file_path" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_PATH"/>
<bm:field name="file_type_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_TYPE_CODE"/>
<bm:field name="to_file_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TO_FILE_NAME"/>
<bm:field name="pwd" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PWD"/>
<bm:field name="document_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DOCUMENT_ID"/>
<bm:field name="content_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTENT_ID"/>
</bm:fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: luochenglong
$Date: 2023-02-07 下午2:03:31
$Revision: 1.0
$Purpose: 结构化字段定义
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:view>
<a:link id="cloumn_code_save_link" model="efile.EFILE1010.cloumn_code_query" modelaction="batch_update"/>
<a:link id="cloumn_code_delete_link" model="efile.EFILE1010.cloumn_code_query" modelaction="batch_update"/>
<script type="text/javascript"><![CDATA[
function cloumn_code_add() {
var ds = $('cloumn_para_ds');
var record = ds.create(ds.currentIndex);
$('cloumn_para_ds_id').showEditorByRecord(record);
}
function cloumn_code_delete() {
debugger;
var ds = $('cloumn_para_ds');
var records = ds.getSelected();
if(records.length<=0){
Leaf.showMessage('提示','请勾选数据进行删除!');
return ;
}
var paras = [];
var detail_mask = Ext.getBody();
for(var n=0;n<records.length;n++){
records[n].set('_status', 'delete');
paras.push(records[n].data);
}
if (records.length != 0) {
Leaf.showConfirm('${l:HLS.PROMPT}', '${l:HLS030.CONFIRM_DELETE}', function() {
Leaf.Masker.mask(detail_mask, '${l:HLS.EXECUTING}');
Leaf.request({
url: $('cloumn_code_delete_link').getUrl(),
para: paras,
success: function(res) {
Leaf.showMessage('提示','删除成功',function(){
ds.query();
});
Leaf.Masker.unmask(detail_mask);
},
failure: function() {
Leaf.Masker.unmask(detail_mask);
},
error: function() {
Leaf.Masker.unmask(detail_mask);
},
scope: this
});
});
}
}
function cloumn_code_save() {
debugger;
var ds = $('cloumn_para_ds');
var records=ds.getAll();
var paras = [];
var detail_masks = Ext.getBody();
var base_archive_id='${/parameter/@record_id}';
console.log(base_archive_id);
for(var n=0;n<records.length;n++){
if(records[n].isNew){
records[n].set('_status', 'insert');
}else{
records[n].set('_status', 'update');
}
records[n].set('base_archive_id', base_archive_id);
paras.push(records[n].data);
}
console.log(paras);
if (ds.validate()) {
Leaf.Masker.mask(detail_mask, '${l:HLS.EXECUTING}');
Leaf.request({
url: $('cloumn_code_save_link').getUrl(),
para: paras,
success: function(res) {
Leaf.showMessage('提示','保存成功',function(){
ds.query();
});
Leaf.Masker.unmask(detail_mask);
},
failure: function() {
Leaf.Masker.unmask(detail_mask);
},
error: function() {
Leaf.Masker.unmask(detail_mask);
},
scope: this
});
}
}
function update_checklength(ds, record, name, value, oldvalue) {
}
]]></script>
<a:dataSets>
<a:dataSet id="cloumn_para_ds" autoQuery="true" model="efile.EFILE1010.cloumn_code_query" queryUrl="${/request/@context_path}/autocrud/efile.EFILE1010.cloumn_code_query/query?base_archive_id=${/parameter/@record_id}" queryDataSet="for_query_ds" selectable="true">
<a:fields>
<a:field name="cloumn_code" />
<a:field name="cloumn_name" />
<a:field name="base_archive_id" />
</a:fields>
<a:events>
<a:event name="update" handler="update_checklength"/>
</a:events>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:gridButton click="cloumn_code_add" text="新增"/>
<a:gridButton click="cloumn_code_delete" text="删除"/>-
<a:gridButton click="cloumn_code_save" text="HLS.SAVE"/>
</a:screenTopToolbar>
<a:grid id="cloumn_para_ds_id" bindTarget="cloumn_para_ds" height="300" width="380" navBar="true">
<a:columns>
<a:column name="cloumn_code" editor="elec_text_ed" prompt="结构化字段code" width="170"/>
<a:column name="cloumn_name" editor="elec_text_ed" prompt="结构化字段描述" width="170"/>
</a:columns>
<a:editors>
<a:textField id="elec_text_ed"/>
<a:textField id="elec_text_ed_up" typeCase="upper"/>
<a:checkBox id="elec_checkbox_ed"/>
<a:lov id="elec_conBasicClauseParaDs_grid_lov"/>
<a:comboBox id="cloumn_code_comed"/>
</a:editors>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: luochenglong
$Date: 2023-02-09 早上 10:03:31
$Revision: 1.0
$Purpose: 附件取值SQL
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:view>
<script type="text/javascript"><![CDATA[
function okbtn() {
var record = $('para_lov_ds').getAt(0);
$('${/parameter/@lovid}').commit(record);
}
function returnok() {
$('${/parameter/@lovid}').win.close();
}
]]></script>
<a:dataSets>
<a:dataSet id="para_lov_ds" autoCreate="true">
<a:fields>
<a:field name="lov_sql"/>
</a:fields>
</a:dataSet>
</a:dataSets>
<script type="text/javascript"><![CDATA[
function initSql(){
var sql=$('efile_type_ds').getCurrentRecord().get('atm_sql');
$('para_lov_ds').getAt(0).set('lov_sql',sql);
}
initSql();
]]></script>
<a:screenBody>
<a:form column="1" style="margin-top:10px;margin-left:10px;">
<a:textArea name="lov_sql" bindTarget="para_lov_ds" height="320" width="500"/>
</a:form>
<a:hBox style="margin-left:10px;margin-bottom:20px;">
<a:button id="okbtnid" click="okbtn" text="PROMPT.OK"/>
<a:button click="returnok" text="PROMPT.RETURN"/>
</a:hBox>
</a:screenBody>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: luochenglong
$Date: 2023-02-09 早上 10:05:31
$Revision: 1.0
$Purpose: 凭证模板取值SQL
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:view>
<script type="text/javascript"><![CDATA[
function okbtn() {
var record = $('para_lov_ds').getAt(0);
$('${/parameter/@lovid}').commit(record);
}
function returnok() {
$('${/parameter/@lovid}').win.close();
}
]]></script>
<a:dataSets>
<a:dataSet id="para_lov_ds" autoCreate="true">
<a:fields>
<a:field name="lov_sql"/>
</a:fields>
</a:dataSet>
</a:dataSets>
<script type="text/javascript"><![CDATA[
function initSql(){
var sql=$('efile_type_ds').getCurrentRecord().get('je_source_sql');
$('para_lov_ds').getAt(0).set('lov_sql',sql);
}
initSql();
]]></script>
<a:screenBody>
<a:form column="1" style="margin-top:10px;margin-left:10px;">
<a:textArea name="lov_sql" bindTarget="para_lov_ds" height="320" width="500"/>
</a:form>
<a:hBox style="margin-left:10px;margin-bottom:20px;">
<a:button id="okbtnid" click="okbtn" text="PROMPT.OK"/>
<a:button click="returnok" text="PROMPT.RETURN"/>
</a:hBox>
</a:screenBody>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: luochenglong
$Date: 2023-02-09 早上 10:15:31
$Revision: 1.0
$Purpose: 结构化数据取值SQL
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:view>
<script type="text/javascript"><![CDATA[
function okbtn() {
var record = $('para_lov_ds').getAt(0);
$('${/parameter/@lovid}').commit(record);
}
function returnok() {
$('${/parameter/@lovid}').win.close();
}
]]></script>
<a:dataSets>
<a:dataSet id="para_lov_ds" autoCreate="true">
<a:fields>
<a:field name="lov_sql"/>
</a:fields>
</a:dataSet>
</a:dataSets>
<script type="text/javascript"><![CDATA[
function initSql(){
var sql=$('efile_type_ds').getCurrentRecord().get('stru_data_sql');
$('para_lov_ds').getAt(0).set('lov_sql',sql);
}
initSql();
]]></script>
<a:screenBody>
<a:form column="1" style="margin-top:10px;margin-left:10px;">
<a:textArea name="lov_sql" bindTarget="para_lov_ds" height="320" width="500"/>
</a:form>
<a:hBox style="margin-left:10px;margin-bottom:20px;">
<a:button id="okbtnid" click="okbtn" text="PROMPT.OK"/>
<a:button click="returnok" text="PROMPT.RETURN"/>
</a:hBox>
</a:screenBody>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: luochenglong
$Date: 2023-02-07 早上10:03:31
$Revision: 1.0
$Purpose:电子档案类型定义
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:view>
<a:link id="cloumn_code_link_id" url="${/request/@context_path}/modules/efile/EFILE1010/cloumn_define.lview"/>
<a:link id="je_template_link_id" url="${/request/@context_path}/modules/efile/EFILE1010/voucher_ass_template.lview"/>
<a:link id="elec_file_save_link" model="efile.EFILE1010.elec_file_type" modelaction="batch_update"/>
<a:link id="elec_file_delete_link" model="efile.EFILE1010.elec_file_type" modelaction="batch_update"/>
<script type="text/javascript"><![CDATA[
function efile_type_add() {
var ds = $('efile_type_ds');
var record = ds.create(ds.currentIndex);
$('efile_type_ds_id').showEditorByRecord(record);
}
function efile_type_delete() {
var ds = $('efile_type_ds');
var records = ds.getSelected();
if (records.length != 0) {
Leaf.showConfirm('${l:HLS.PROMPT}', '${l:HLS030.CONFIRM_DELETE}', function() {
ds.remove(records);
});
}
}
function efile_type_save() {
var ds = $('efile_type_ds');
var records=ds.getAll();
var paras = [];
var detail_mask = Ext.getBody();
for(var n=0;n<records.length;n++){
if(records[n].isNew){
records[n].set('_status', 'insert');
}else{
records[n].set('_status', 'update');
}
paras.push(records[n].data);
}
if (ds.validate()) {
Leaf.Masker.mask(detail_mask, '${l:HLS.EXECUTING}');
Leaf.request({
url: $('elec_file_save_link').getUrl(),
para: paras,
success: function(res) {
Leaf.showMessage('提示','保存成功',function(){
ds.query();
});
Leaf.Masker.unmask(detail_mask);
},
failure: function() {
Leaf.Masker.unmask(detail_mask);
},
error: function() {
Leaf.Masker.unmask(detail_mask);
},
scope: this
});
}
}
function efile_type_exit() {
}
function efile_type_query() {
$('efile_type_ds').query();
}
function hls_doc_table_list_renderer(value, record, name) {
if(name=='cloumn_name'){
return '<a href="javascript:efile_type_cloumn_list(\'' + record.get('base_archive_id') + '\')">结构化字段</a>';
}
if(name=='je_template_code'){
return '<a href="javascript:efile_type_template_list(\'' + record.get('base_archive_id') + '\')">关联凭证模板</a>';
}
}
function efile_type_cloumn_list(record_id) {
var record = $('efile_type_ds').findById(record_id);
var url = $('cloumn_code_link_id').getUrl();
if (!Leaf.isEmpty(record_id)) {
var win = new Leaf.Window({
id: 'cloumn_code_id_winid',
url: url,
params: {
record_id: record_id
},
height: 350,
width: 420
});
}
}
function efile_type_template_list(record_id) {
var record = $('efile_type_ds').findById(record_id);
var url = $('je_template_link_id').getUrl();
if (!Leaf.isEmpty(record_id)) {
var win = new Leaf.Window({
id: 'je_template_id_winid',
url: url,
params: {
record_id: record_id
},
height: 350,
width: 420
});
}
}
function checklength(ds, record, name, value, oldvalue) {
}
]]></script>
<a:dataSets>
<a:dataSet id="efile_type_bookmark_type_ds" lookupCode="BOOKMARK_TYPE"/>
<a:dataSet id="enable_flag_ds" lookupCode="ENABLED_STATUS"/>
<a:dataSet id="yes_no_ds" lookupCode="YES_NO"/>
<a:dataSet id="underline_ds" lookupCode="UNDERLINE"/>
<a:dataSet id="data_cf_ds" lookupCode="DATA_CLASSIFICATION"/>
<a:dataSet id="for_query_ds" autoCreate="true">
<a:fields>
<a:field name="archive_type" />
<a:field name="is_workflow" />
<a:field name="post_atm_flag" />
<a:field name="je_check_flag" />
<a:field name="archive_type_desc" displayField="code_value_name" options="data_cf_ds" returnField="archive_type" valueField="code_value"/>
<a:field name="is_workflow_desc" displayField="code_value_name" options="yes_no_ds" returnField="is_workflow" valueField="code_value"/>
<a:field name="post_atm_flag_desc" displayField="code_value_name" options="yes_no_ds" returnField="post_atm_flag" valueField="code_value"/>
<a:field name="je_check_flag_desc" displayField="code_value_name" options="yes_no_ds" returnField="je_check_flag" valueField="code_value"/>
</a:fields>
</a:dataSet>
<a:dataSet id="efile_type_ds" autoQuery="true" model="efile.EFILE1010.elec_file_type" queryDataSet="for_query_ds" selectable="true">
<a:fields>
<a:field name="archive_type_desc" displayField="code_value_name" options="data_cf_ds" returnField="archive_type" valueField="code_value"/>
<a:field name="is_workflow_desc" displayField="code_value_name" options="yes_no_ds" returnField="is_workflow" valueField="code_value"/>
<a:field name="post_stru_data_flag_desc" displayField="code_value_name" options="yes_no_ds" returnField="post_stru_data_flag" valueField="code_value"/>
<a:field name="post_atm_flag_desc" displayField="code_value_name" options="yes_no_ds" returnField="post_atm_flag" valueField="code_value"/>
<a:field name="je_check_flag_desc" displayField="code_value_name" options="yes_no_ds" returnField="je_check_flag" valueField="code_value"/>
<a:field name="workflow_desc" />
<a:field name="cloumn_name" />
<a:field name="workflow_code" />
<a:field name="workflow_id" />
<a:field name="workflow_desc" lovGridHeight="300" lovHeight="450" lovService="efile.EFILE1010.zj_wfl_workflow_lov" lovWidth="550" title="工作流类型">
<a:mapping>
<a:map from="workflow_id" to="workflow_id"/>
<a:map from="workflow_code" to="workflow_code"/>
<a:map from="workflow_desc" to="workflow_desc"/>
</a:mapping>
</a:field>
<a:field name="je_source_sql" lovHeight="430" lovUrl="${/request/@context_path}/modules/efile/EFILE1010/efile_je_source_sql_lov.lview" lovWidth="580" title="凭证取值SQL">
<a:mapping>
<a:map from="lov_sql" to="je_source_sql"/>
</a:mapping>
</a:field>
<a:field name="stru_data_sql" lovHeight="430" lovUrl="${/request/@context_path}/modules/efile/EFILE1010/efile_stu_data_sql_lov.lview" lovWidth="580" title="结构化数据取值sql">
<a:mapping>
<a:map from="lov_sql" to="stru_data_sql"/>
</a:mapping>
</a:field>
<a:field name="atm_sql" lovHeight="430" lovUrl="${/request/@context_path}/modules/efile/EFILE1010/efile_atm_sql_lov.lview" lovWidth="580" title="附件取值sql">
<a:mapping>
<a:map from="lov_sql" to="atm_sql"/>
</a:mapping>
</a:field>
<a:field name="base_archive_id" />
<a:field name="base_archive_code" required="true" />
<a:field name="je_template_code" />
<a:field name="archive_type" />
<a:field name="is_workflow" />
<a:field name="post_stru_data_flag" />
<a:field name="post_atm_flag" />
<a:field name="je_check_flag" />
</a:fields>
<a:events>
<a:event name="update" handler="checklength"/>
</a:events>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<!--<a:screenTitle/>-->
<a:gridButton click="efile_type_exit" text="退出"/>
<!-- <a:gridButton click="efile_type_add" text="新增"/>
<a:gridButton click="efile_type_delete" text="删除"/>-->
<a:gridButton click="efile_type_query" text="HLS.QUERY"/>
<a:gridButton click="efile_type_save" text="HLS.SAVE"/>
</a:screenTopToolbar>
<a:form column="4" marginWidth="30" labelWidth="150" title="查询条件">
<a:comboBox name="archive_type_desc" bindTarget="for_query_ds" prompt="资料分类"/>
<a:comboBox name="is_workflow_desc" bindTarget="for_query_ds" prompt="是否关联工作流"/>
<a:comboBox name="post_atm_flag_desc" bindTarget="for_query_ds" prompt="是否传递附件"/>
<a:comboBox name="je_check_flag_desc" bindTarget="for_query_ds" prompt="是否需要传递凭证号"/>
</a:form>
<a:grid id="efile_type_ds_id" bindTarget="efile_type_ds" marginHeight="200" marginWidth="30" navBar="true">
<a:toolBar>
<a:button type="add"/>
<a:button type="delete"/>
<!-- <a:button type="save"/>-->
</a:toolBar>
<a:columns>
<a:column name="base_archive_code" editor="text_ed" prompt="资料编码" width="120"/>
<a:column name="archive_type_desc" editor="efile_type_comed" prompt="资料分类" width="120"/>
<a:column name="is_workflow_desc" editor="efile_type_comed" prompt="是否关联工作流" width="120"/>
<a:column name="workflow_desc" editor="conBasicClauseParaDs_grid_lov" prompt="工作流描述" width="130"/>
<a:column name="post_stru_data_flag_desc" editor="efile_type_comed" prompt="是否传递结构化数据" width="150"/>
<a:column name="cloumn_name" align="center" prompt="结构化字段" renderer="hls_doc_table_list_renderer"/>
<a:column name="stru_data_sql" align="center" editor="conBasicClauseParaDs_grid_lov" width="300" prompt="结构化数据取值sql"/>
<a:column name="post_atm_flag_desc" align="center" editor="efile_type_comed" width="120" prompt="是否传递附件"/>
<a:column name="atm_sql" align="center" editor="conBasicClauseParaDs_grid_lov" width="330" prompt="附件取值sql"/>
<a:column name="je_template_code" align="center" width="100" renderer="hls_doc_table_list_renderer" prompt="关联凭证模板"/>
<a:column name="je_check_flag_desc" align="center" editor="efile_type_comed" width="150" prompt="是否需要传输凭证号"/>
<a:column name="je_source_sql" editor="conBasicClauseParaDs_grid_lov" prompt="凭证取值SQL" width="330"/>
</a:columns>
<a:editors>
<a:textField id="text_ed"/>
<a:textField id="text_ed_up" typeCase="upper"/>
<a:checkBox id="checkbox_ed"/>
<a:lov id="conBasicClauseParaDs_grid_lov"/>
<a:comboBox id="efile_type_comed"/>
</a:editors>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: luochenglong
$Date: 2023-02-07 下午3:03:31
$Revision: 1.0
$Purpose: 凭证模板定义
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:view>
<a:link id="je_template_save_link" model="efile.EFILE1010.je_template_query" modelaction="batch_update"/>
<a:link id="je_template_delete_link" model="efile.EFILE1010.je_template_query" modelaction="batch_update"/>
<script type="text/javascript"><![CDATA[
function je_template_add() {
var ds = $('je_template_ds');
var record = ds.create(ds.currentIndex);
$('je_template_ds_id').showEditorByRecord(record);
}
function je_template_delete() {
var ds = $('je_template_ds');
var records = ds.getSelected();
if(records.length<=0){
Leaf.showMessage('提示','请勾选数据进行删除!');
return;
}
var paras = [];
var detail_mask = Ext.getBody();
for(var n=0;n<records.length;n++){
records[n].set('_status', 'delete');
paras.push(records[n].data);
}
if (records.length != 0) {
Leaf.showConfirm('${l:HLS.PROMPT}', '${l:HLS030.CONFIRM_DELETE}', function() {
Leaf.Masker.mask(detail_mask, '${l:HLS.EXECUTING}');
Leaf.request({
url: $('je_template_delete_link').getUrl(),
para: paras,
success: function(res) {
Leaf.showMessage('提示','删除成功',function(){
ds.query();
});
Leaf.Masker.unmask(detail_mask);
},
failure: function() {
Leaf.Masker.unmask(detail_mask);
},
error: function() {
Leaf.Masker.unmask(detail_mask);
},
scope: this
});
});
}
}
function je_template_save() {
var ds = $('je_template_ds');
var records=ds.getAll();
var paras = [];
var detail_mask = Ext.getBody();
var base_archive_id='${/parameter/@record_id}';
for(var n=0;n<records.length;n++){
if(records[n].isNew){
records[n].set('_status', 'insert');
}else{
records[n].set('_status', 'update');
}
records[n].set('base_archive_id', base_archive_id);
paras.push(records[n].data);
}
if (ds.validate()) {
Leaf.Masker.mask(detail_mask, '${l:HLS.EXECUTING}');
Leaf.request({
url: $('je_template_save_link').getUrl(),
para: paras,
success: function(res) {
Leaf.showMessage('提示','保存成功',function(){
ds.query();
});
Leaf.Masker.unmask(detail_mask);
},
failure: function() {
Leaf.Masker.unmask(detail_mask);
},
error: function() {
Leaf.Masker.unmask(detail_mask);
},
scope: this
});
}
}
function je_template_update(ds, record, name, value, oldvalue) {
}
]]></script>
<a:dataSets>
<a:dataSet id="je_template_ds" autoQuery="true" model="efile.EFILE1010.je_template_query" queryUrl="${/request/@context_path}/autocrud/efile.EFILE1010.je_template_query/query?base_archive_id=${/parameter/@record_id}" queryDataSet="for_query_ds" selectable="true">
<a:fields>
<a:field name="je_template_code" lovGridHeight="450" lovHeight="600" lovService="gld.GLD104.gld_je_transaction_for_lov" lovWidth="550" lovpagesize="30" required="true" title="GLD104.GLD_JE_TRANSACTION.JE_TRANSACTION_DESC">
<a:mapping>
<a:map from="je_transaction_desc" to="je_template_name"/>
<a:map from="je_transaction_code" to="je_template_code"/>
</a:mapping>
</a:field>
<a:field name="je_template_name" />
</a:fields>
<a:events>
<a:event name="update" handler="je_template_update"/>
</a:events>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:gridButton click="je_template_add" text="新增"/>
<a:gridButton click="je_template_delete" text="删除"/>
<a:gridButton click="je_template_save" text="HLS.SAVE"/>
</a:screenTopToolbar>
<a:grid id="je_template_ds_id" bindTarget="je_template_ds" height="300" width="380" navBar="true">
<a:columns>
<a:column name="je_template_code" editor="voucherconBasicClauseParaDs_grid_lov" prompt="凭证模板代码" width="170"/>
<a:column name="je_template_name" editor="voucher_text_ed" prompt="凭证模板描述" width="170"/>
</a:columns>
<a:editors>
<a:textField id="voucher_text_ed"/>
<a:textField id="voucher_text_ed_up" typeCase="upper"/>
<a:checkBox id="voucher_checkbox_ed"/>
<a:lov id="voucherconBasicClauseParaDs_grid_lov"/>
<a:comboBox id="je_template_comed"/>
</a:editors>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2023-2-7 下午1:37:08
$Revision: 1.0
$Purpose: 待生成电子档案清单
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:view>
<a:link id="efile1020_generated_save_link" url="${/request/@context_path}/modules/efile/EFILE1020/efile_generated_save_selected.lsc"/>
<script type="text/javascript"><![CDATA[
function efile1020_query(){
$('archives_pool_list_ds').query();
}
//重置按钮
function efile1020_reset() {
$('archives_post_list_query').reset();
}
function efile1020_generated(){
var datas = [];
var records = $('archives_pool_list_ds').getSelected();
for (var i=0;i<records.length;i++){
var record = records[i];
datas.push(record.data);
}
var param = {};
param['details'] = datas;
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认生成电子档案?', function () {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('efile1020_generated_save_link').getUrl(),
para: datas,
success: function (res) {
Leaf.SideBar.show({
msg: '生成成功',
duration: 2000
});
Leaf.Masker.unmask(Ext.getBody());
$('archives_pool_list_ds').query();
},
failure: function () {
Leaf.Masker.unmask(Ext.getBody());
},
error: function () {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}, null);
}
]]></script>
<a:dataSets>
<a:dataSet id="archive_type_ds" lookupCode="ELEC_FILE_TYPE"/>
<a:dataSet id="done_flag_ds" lookupCode="DONE_FLAG_STATUS"/>
<a:dataSet id="archives_post_list_query" autoCreate="true">
<a:fields>
<a:field name="document_id"/>
<a:field name="archive_type"/>
<a:field name="archive_type_desc" displayField="code_value_name" options="archive_type_ds" returnField="archive_type" valueField="code_value"/>
<a:field name="done_flag"/>
<a:field name="done_flag_desc" displayField="code_value_name" options="done_flag_ds" returnField="done_flag" valueField="code_value"/>
</a:fields>
</a:dataSet>
<a:dataSet id="archives_pool_list_ds" autoQuery="true" model="efile.EFILE1020.archives_post_list" queryDataSet="archives_post_list_query" selectable="true">
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:gridButton click="efile1020_query" text="HLS.QUERY"/>
<a:gridButton click="efile1020_reset" text="HLS.RESET"/>
<a:gridButton click="efile1020_generated" text="生成电子档案"/>
</a:screenTopToolbar>
<a:form column="4" marginWidth="200" title="查询条件">
<a:comboBox name="archive_type_desc" bindTarget="archives_post_list_query" prompt="资料类型"/>
<a:textField name="document_id" bindTarget="archives_post_list_query" prompt="资料来源"/>
<a:comboBox name="done_flag_desc" bindTarget="archives_post_list_query" prompt="生成状态"/>
</a:form>
<a:grid id="archives_pool_list_ds_id" bindTarget="archives_pool_list_ds" marginHeight="200" marginWidth="200" navBar="true">
<a:columns>
<a:column name="archive_type_desc" prompt="资料类型" width="150"/>
<a:column name="document_id" prompt="资料来源" width="150"/>
<a:column name="done_flag_desc" prompt="生成状态" width="100"/>
<a:column name="error_message" prompt="日志" width="150"/>
<a:column name="last_update_date" renderer="Leaf.formatDate" prompt="最后更新时间" width="150"/>
</a:columns>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<batch-apply sourcepath="/parameter">
<a:model-insert model="efile.EFILE1020.efile_generated_selected"/>
</batch-apply>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<a:service 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="att_downloadUtil.js"><![CDATA[
importPackage(java.util.zip);
importPackage(java.io);
importPackage(java.net);
var logger = $logger('server-script');
$ctx["__request_type__"] = 'file';
var resp = $ctx['_instance.javax.servlet.http.HttpServletResponse'];
resp.setHeader("Pragma", "No-cache");
resp.setHeader("Cache-Control", "no-cache, must-revalidate");
var rowid = $ctx.parameter.rowid;
var attachment_queryBm = $bm('efile.EFILE1030.att_download');
var attachment_data = attachment_queryBm.queryAsMap({
rowid:rowid
});
if(rowid){
var filename = attachment_data.getChildren()[0].file_name;
var filepath= attachment_data.getChildren()[0].file_path;
resp.setHeader("Content-Disposition",
"attachment; filename=\"" + java.net.URLEncoder.encode(filename, "UTF-8"));
resp.setDateHeader("Expires", 0);
resp.setContentType("application/x-msdownload");
attDownloadUtil(resp,filepath,filename);
}
]]></s:server-script>
</a:init-procedure>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: luochenglong
$Date: 2023-02-10 早上10:03:31
$Revision: 1.0
$Purpose:电子档池定义
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:view>
<a:link id="att_link_id" url="${/request/@context_path}/modules/efile/EFILE1030/efile_att_json_lov.lview"/>
<a:link id="post_stru_link_id" url="${/request/@context_path}/modules/efile/EFILE1030/efile_post_stru_json_lov.lview"/>
<a:link id="doc_post_link" url="${/request/@context_path}/modules/efile/EFILE1040/efile_doc_import.svc"/>
<script type="text/javascript"><![CDATA[
function efile_archive_pool_batch_trans() {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('doc_post_link').getUrl(),
para: {
batch_flag :'Y'
},
success: function() {
Leaf.Masker.unmask(Ext.getBody());
Leaf.showMessage('提示','传输成功',function(){
$('efile_archive_pool_ds').query();
});
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
function efile_archive_pool_manual_trans() {
var record = $('efile_archive_pool_ds').getSelected();
if (record.length==0){
Leaf.showMessage('提示','请选择传输数据!');
return;
}
for (var i = 0; i < record.length; i++) {
if(record[i].get('monthly_closed_flag')=='N'){
Leaf.showMessage('提示','资料期间对应的会计期间必须是关账状态!');
return;
}
}
var records = new Array();
for (i = 0;i < record.length;i++) {
records.push(record[i].data);
/* if (record[i].get('upload_ftp_flag') == 'Y') {
Aurora.showMessage('提示','已上传批次不能重复上传!');
return;
}*/
}
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('doc_post_link').getUrl(),
para: records,
success: function() {
Leaf.Masker.unmask(Ext.getBody());
Leaf.showMessage('提示','传输成功',function(){
$('efile_archive_pool_ds').query();
});
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
function efile_archive_pool_reset() {
}
function efile_archive_pool_query() {
$('efile_archive_pool_ds').query();
}
function att_update_renderer(value, record, name) {
if(name=='att'){
return '<a href="javascript:efile_archive_att_list(\'' + record.get('pool_id') + '\')">附件</a>';
}
if(name=='post_stru_data'){
return '<a href="javascript:efile_archive_post_stru_data_list(\'' + record.get('pool_id') + '\')">结构化数据</a>';
}
}
function efile_archive_att_list(record_id) {
var record = $('efile_archive_pool_ds').findById(record_id);
var url = $('att_link_id').getUrl();
if (!Leaf.isEmpty(record_id)) {
var win = new Leaf.Window({
id: 'att_id_winid',
url: url,
params: {
record_id: record_id
},
height: 350,
width: 700
});
}
}
function efile_archive_post_stru_data_list(record_id) {
var record = $('efile_archive_pool_ds').findById(record_id);
var url = $('post_stru_link_id').getUrl();
if (!Leaf.isEmpty(record_id)) {
var win = new Leaf.Window({
id: 'post_stru_id_winid',
url: url,
params: {
record_id: record_id
},
height: 350,
width: 700
});
}
}
function checklength(ds, record, name, value, oldvalue) {
}
]]></script>
<a:dataSets>
<a:dataSet id="yes_no_ds" lookupCode="YES_NO"/>
<a:dataSet id="data_cf_ds" lookupCode="DATA_CLASSIFICATION"/>
<a:dataSet id="post_status_ds" lookupCode="POST_STATUS_DESC"/>
<a:dataSet id="for_query_ds" autoCreate="true">
<a:fields>
<a:field name="internal_period_num" />
<a:field name="post_batch_num" />
<a:field name="primary_field" />
<a:field name="document_info" />
<a:field name="post_status" />
<a:field name="archive_type" />
<a:field name="archive_type_desc" displayField="code_value_name" options="data_cf_ds" returnField="archive_type" valueField="code_value"/>
<a:field name="suppl_trans_flag" displayField="code_value_name" options="yes_no_ds" returnField="suppl_trans_flag" valueField="code_value"/>
<a:field name="post_status_desc" displayField="code_value_name" options="post_status_ds" returnField="post_status" valueField="code_value"/>
</a:fields>
</a:dataSet>
<a:dataSet id="efile_archive_pool_ds" model="efile.EFILE1030.e_archive_pool_query" queryDataSet="for_query_ds" selectable="true">
<a:fields>
<a:field name="monthly_closed_flag" />
</a:fields>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<!--<a:screenTitle/>-->
<a:gridButton click="efile_archive_pool_query" text="HLS.QUERY"/>
<a:gridButton click="efile_archive_pool_reset" text="重置"/>
<a:gridButton click="efile_archive_pool_batch_trans" text="启动批量传输"/>
<a:gridButton click="efile_archive_pool_manual_trans" text="手动传输"/>
</a:screenTopToolbar>
<a:form column="4" marginWidth="30" title="查询条件">
<a:textField name="internal_period_num" bindTarget="for_query_ds" prompt="资料期间"/>
<a:comboBox name="archive_type_desc" bindTarget="for_query_ds" prompt="资料类型"/>
<a:textField name="primary_field" bindTarget="for_query_ds" prompt="主键"/>
<a:comboBox name="suppl_trans_flag" bindTarget="for_query_ds" prompt="是否补传"/>
<a:textField name="document_info" bindTarget="for_query_ds" prompt="原始资料号"/>
<a:comboBox name="post_status_desc" bindTarget="for_query_ds" prompt="传输状态"/>
<a:textField name="post_batch_num" bindTarget="for_query_ds" prompt="传输批次号"/>
</a:form>
<a:grid id="efile_archive_pool_ds_id" bindTarget="efile_archive_pool_ds" marginHeight="200" marginWidth="30" navBar="true">
<a:columns>
<a:column name="primary_field" prompt="主键" width="320"/>
<a:column name="internal_period_num" prompt="资料期间" width="120"/>
<a:column name="archive_type_desc" prompt="资料类型" width="120"/>
<a:column name="document_info" prompt="原始资料号" width="300"/>
<a:column name="post_stru_data" prompt="结构化数据" renderer="att_update_renderer" width="110"/>
<a:column name="att" align="center" prompt="附件" renderer="att_update_renderer"/>
<a:column name="suppl_trans_flag" align="center" width="120" prompt="是否补传"/>
<a:column name="post_status" align="center" width="120" prompt="传输状态"/>
<a:column name="post_message" align="center" width="180" prompt="传输结果"/>
<a:column name="post_batch_num" align="center" width="120" prompt="传输批次号"/>
</a:columns>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: luochenglong
$Date: 2023-02-10 下午2:03:31
$Revision: 1.0
$Purpose: 附件列表
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:view>
<script type="text/javascript"><![CDATA[
]]></script>
<a:dataSets>
<a:dataSet id="att_json_ds" selectable="true">
<a:fields>
<a:field name="att_type" />
<a:field name="att_address" />
<a:field name="att_name" />
</a:fields>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:grid id="att_para_ds_id" bindTarget="att_json_ds" marginHeight="200" marginWidth="200" navBar="true">
<a:columns>
<a:column name="att_type" prompt="附件类型" width="150"/>
<a:column name="att_address" prompt="附件地址" width="150"/>
<a:column name="att_name" prompt="附件名称" width="150"/>
</a:columns>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: luochenglong
$Date: 2023-02-10 下午2:03:31
$Revision: 1.0
$Purpose: 结构化数据列表
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:view>
<script type="text/javascript"><![CDATA[
]]></script>
<a:dataSets>
<a:dataSet id="post_stur_json_ds" selectable="true">
<a:fields>
<a:field name="att_type" />
<a:field name="att_address" />
<a:field name="att_name" />
</a:fields>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:grid id="post_stru_para_ds_id" bindTarget="post_stur_json_ds" marginHeight="200" marginWidth="200" navBar="true">
<a:columns>
<a:column name="filed_code" prompt="字段代码" width="150"/>
<a:column name="filed_desc" prompt="字段描述" width="150"/>
<a:column name="value_content" prompt="值内容" width="150"/>
</a:columns>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<a:service 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="token_record.js;att_upload.js"><![CDATA[
try {
var logger = $logger('server-script');
logger.info('------');
var req_date = $ctx.parameter.getChildren();
var sys_url_bm = $bm('cont.CON4000.get_sys_url');
var parameter_code = 'TOKEN_POSTURL';
var SysposturlQuery = sys_url_bm.queryAsMap({
parameter_code: parameter_code
});
var posturl = SysposturlQuery.getChildren()[0].parameter_value;
var parameter_code = 'TOKEN_APPID';
var SysappidQuery = sys_url_bm.queryAsMap({
parameter_code: parameter_code
});
var token_appid = SysappidQuery.getChildren()[0].parameter_value;
var parameter_code = 'TOKEN_APPSECRET';
var SysappsecretQuery = sys_url_bm.queryAsMap({
parameter_code: parameter_code
});
var parameter_code = 'ATT_UPLOAD_POSTURL';
var attUrlQuery = sys_url_bm.queryAsMap({
parameter_code: parameter_code
});
var attUrl = attUrlQuery.getChildren()[0].parameter_value;
var parameter_code = 'TOKEN_TYPE';
var tokenTypeyQuery = sys_url_bm.queryAsMap({
parameter_code: parameter_code
});
var token_type = tokenTypeyQuery.getChildren()[0].parameter_value;
var token_appsecret = SysappsecretQuery.getChildren()[0].parameter_value;
var token_savelogs_bm = $bm('efile.EFILE1000.efile_get_token');
//token是否在有效期内,在有效期内直接获取表中的token
var check_token_valid_bm = $bm('efile.EFILE1000.check_token_valid');
var checkTokenQuery = check_token_valid_bm.queryAsMap();
var is_valid = checkTokenQuery.getChildren()[0].is_valid;
var primaryField='CF-4252CE7A665C4562BF8E8AC3AD79BF1D';
var file=new File('D:\\aurora_reference.pdf');
logger.info(primaryField);
var map = {
"documentTypeCode" : "workflow_QC02",
"primaryField": primaryField,
"documentSource":"CF",
"companyCode":"HL"
}
var att_recordBm=$bm('efile.EFILE1040.att_upload_return');
if (is_valid == 'true') {
var SystokenQuery = token_savelogs_bm.queryAsMap();
var access_token = SystokenQuery.getChildren()[0].access_token;
var data=httpPostAttUpload(attUrl,map,file,access_token,token_type);
var json = JSON.parse(data);
var result=JSON.stringify(json.result);
result=JSON.parse(result)
att_recordBm.insert({
'primary_field': primaryField,
'status': json.statusCode,
'message': json.message,
'attachmentoid': result.attachmentOID,
'hly_fileurl': result.fileURL
})
logger.info(data);
} else {
println("=======有效期外======");
var data = httpPostGetToken(posturl, token_appid, token_appsecret);
var json = JSON.parse(data);
var access_token = json.access_token;
var status = json.status;
if (access_token) {
var data_att=httpPostAttUpload(attUrl,map,file,access_token,token_type);
var json = JSON.parse(data_att);
var result=JSON.stringify(json.result);
result=JSON.parse(result)
att_recordBm.insert({
'primary_field': primaryField,
'status': json.statusCode,
'message': json.message,
'attachmentoid': result.attachmentOID,
'hly_fileurl': result.fileURL
})
logger.info(data_att);
token_savelogs_bm.insert({
'json': data,
'status': 'success'
})
token_savelogs_bm.update({
'system_source': 'hlcm',
'expires_in': json.expires_in,
'access_token': access_token
})
}
if (status) {
var token_savelogs_bm = $bm('efile.EFILE1000.token_savelogs');
token_savelogs_bm.insert({
'json': json,
'status': 'fail'
});
}
}
} catch (e) {
println('e:' + e);
}
]]></s:server-script>
</a:init-procedure>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<a:service 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="token_record.js;doc_import.js"><![CDATA[
try {
var logger = $logger('server-script');
var req_date = $ctx.parameter.getChildren();
var batch_flag=$ctx.parameter.batch_flag;
var sys_url_bm = $bm('cont.CON4000.get_sys_url');
var parameter_code = 'TOKEN_POSTURL';
var SysposturlQuery = sys_url_bm.queryAsMap({
parameter_code: parameter_code
});
var batch_databm=$bm('efile.EFILE1030.e_archive_pool_batch_query');
var batch_data=batch_databm.queryAsMap().getChildren();
var posturl = SysposturlQuery.getChildren()[0].parameter_value;
var parameter_code = 'TOKEN_APPID';
var SysappidQuery = sys_url_bm.queryAsMap({
parameter_code: parameter_code
});
var token_appid = SysappidQuery.getChildren()[0].parameter_value;
var parameter_code = 'TOKEN_APPSECRET';
var SysappsecretQuery = sys_url_bm.queryAsMap({
parameter_code: parameter_code
});
var parameter_code = 'DOC_REQUESTURL';
var docUrlQuery = sys_url_bm.queryAsMap({
parameter_code: parameter_code
});
var docUrl = docUrlQuery.getChildren()[0].parameter_value;
var parameter_code = 'TOKEN_TYPE';
var tokenTypeyQuery = sys_url_bm.queryAsMap({
parameter_code: parameter_code
});
var token_type = tokenTypeyQuery.getChildren()[0].parameter_value;
var token_appsecret = SysappsecretQuery.getChildren()[0].parameter_value;
var token_savelogs_bm = $bm('efile.EFILE1000.efile_get_token');
//token是否在有效期内,在有效期内直接获取表中的token
var check_token_valid_bm = $bm('efile.EFILE1000.check_token_valid');
var checkTokenQuery = check_token_valid_bm.queryAsMap();
var is_valid = checkTokenQuery.getChildren()[0].is_valid;
var fieldValueList_bm=$bm('efile.EFILE1040.efile_doc_import_query');
var record=[];
var doc_data=[];
var batch_num=0;
if(batch_flag=='Y'){
for(var i=0;i<batch_data.length;i++){
var fieldValueList_data = fieldValueList_bm.queryAsMap({
pool_id: batch_data[i].pool_id
});
var fieldValueList=fieldValueList_data.getChildren()[0].fieldValueList;
var attlist=[];
var filelist=[];
if(fieldValueList.length==8){
filelist='[]';
}else{
fieldValueList=fieldValueList.substring(17);
fieldValueList=JSON.parse(fieldValueList);
fieldValueList=JSON.stringify(fieldValueList);
filelist.push(fieldValueList);
}
var attachmentList = fieldValueList_data.getChildren()[0].attachmentList;
attachmentList=attachmentList.replace('\s+', '');
if(attachmentList.length==8){
attlist='[]';
}else{
attachmentList=attachmentList.substring(17);
logger.info(attachmentList);
attachmentList=JSON.parse(attachmentList);
attachmentList=JSON.stringify(attachmentList);
attlist.push(attachmentList);
}
var companyCode='HL';
var documentTypeCode=batch_data[i].base_archive_code;
var originalNumber=batch_data[i].document_info;
var primaryField=batch_data[i].primary_field;
var isPaper='true';
var documentSource='CM';
var ruleOID='';
var securityLevelCode='';
var fils = '{'
+'"companyCode": "'+companyCode
+'",'
+'"documentTypeCode": "'+documentTypeCode
+'",'
+'"originalNumber": "'+originalNumber
+'",'
+'"primaryField": "'+primaryField
+'",'
+'"isPaper": "'+isPaper
+'",'
+'"documentSource": "'+documentSource
+'",'
+'"ruleOID": "'+ruleOID
+'",'
+'"securityLevelCode": "'+securityLevelCode
+'",'
+'"attachmentList": '+attlist
+','
+'"fieldValueList": '+filelist
+'}';
fils=JSON.parse(fils);
doc_data.push(fils);
if(doc_data.length==100||batch_data.length==i+1){
batch_num++;
if (is_valid == 'true') {
var SystokenQuery = token_savelogs_bm.queryAsMap();
var access_token = SystokenQuery.getChildren()[0].access_token;
var doc_data=JSON.stringify(doc_data);
doc_data=doc_data.replace(/[\'\\\\/\b\f\n\r\t]/g, '');
logger.info(doc_data);
var data = httpPostDocImport(docUrl,doc_data,access_token, token_type);
var json_data = JSON.parse(data);
var statusCode =json_data.statusCode;
var message =json_data.message;
var result=json_data.result;
var doc_import_return_bm = $bm('efile.EFILE1040.doc_import_return');
for(var i=0;i<result.length;i++){
doc_import_return_bm.insert({
'primary_field': result[i].primaryField,
'post_status': message,
'post_message': result[i].failedMessage,
'hly_req_number': batch_num
})
}
logger.info(data);
} else {
println("=======有效期外======");
var data = httpPostGetToken(posturl, token_appid, token_appsecret);
var json = JSON.parse(data);
var access_token = json.access_token;
var status = json.status;
logger.info(access_token);
var doc_data=JSON.stringify(doc_data);
doc_data=doc_data.replace(/[\'\\\\/\b\f\n\r\t]/g, '');
logger.info(doc_data);
var data_result = httpPostDocImport(docUrl,doc_data,access_token, token_type);
logger.info(data_result);
var json_data = JSON.parse(data_result);
logger.info(json_data);
var statusCode =json_data.statusCode;
var message =json_data.message;
var result=json_data.result;
var doc_import_return_bm = $bm('efile.EFILE1040.doc_import_return');
for(var i=0;i<result.length;i++){
if(result[i].primaryField){
doc_import_return_bm.insert({
'primary_field': result[i].primaryField,
'post_status': message,
'post_message': result[i].failedMessage,
'hly_req_number': batch_num
})
}
}
if (access_token) {
token_savelogs_bm.insert({
'json': data,
'status': 'success'
})
token_savelogs_bm.update({
'system_source': 'hlcm',
'expires_in': json.expires_in,
'access_token': access_token
})
}
if (status) {
var token_savelogs_bm = $bm('efile.EFILE1000.token_savelogs');
token_savelogs_bm.insert({
'json': json,
'status': 'fail'
});
}
}
doc_data=[];
}
}
}else{
for(var i=0;i<req_date.length;i++){
var fieldValueList_data = fieldValueList_bm.queryAsMap({
pool_id: req_date[i].pool_id
});
var fieldValueList=fieldValueList_data.getChildren()[0].fieldValueList;
var attlist=[];
var filelist=[];
if(fieldValueList.length==8){
filelist='[]';
}else{
fieldValueList=fieldValueList.substring(17);
fieldValueList=JSON.parse(fieldValueList);
fieldValueList=JSON.stringify(fieldValueList);
filelist.push(fieldValueList);
}
var attachmentList = fieldValueList_data.getChildren()[0].attachmentList;
attachmentList=attachmentList.replace('\s+', '');
if(attachmentList.length==8){
attlist='[]';
}else{
attachmentList=attachmentList.substring(17);
logger.info(attachmentList);
attachmentList=JSON.parse(attachmentList);
attachmentList=JSON.stringify(attachmentList);
attlist.push(attachmentList);
}
var companyCode='HL';
var documentTypeCode=req_date[i].base_archive_code;
var originalNumber=req_date[i].document_info;
var primaryField=req_date[i].primary_field;
var isPaper='true';
var documentSource='CM';
var ruleOID='';
var securityLevelCode='';
var fils = '{'
+'"companyCode": "'+companyCode
+'",'
+'"documentTypeCode": "'+documentTypeCode
+'",'
+'"originalNumber": "'+originalNumber
+'",'
+'"primaryField": "'+primaryField
+'",'
+'"isPaper": "'+isPaper
+'",'
+'"documentSource": "'+documentSource
+'",'
+'"ruleOID": "'+ruleOID
+'",'
+'"securityLevelCode": "'+securityLevelCode
+'",'
+'"attachmentList": '+attlist
+','
+'"fieldValueList": '+filelist
+'}';
fils=JSON.parse(fils);
doc_data.push(fils);
}
if (is_valid == 'true') {
var SystokenQuery = token_savelogs_bm.queryAsMap();
var access_token = SystokenQuery.getChildren()[0].access_token;
var doc_data=JSON.stringify(doc_data);
doc_data=doc_data.replace(/[\'\\\\/\b\f\n\r\t]/g, '');
logger.info(doc_data);
var data = httpPostDocImport(docUrl,doc_data,access_token, token_type);
var json_data = JSON.parse(data);
var statusCode =json_data.statusCode;
var message =json_data.message;
var result=json_data.result;
var doc_import_return_bm = $bm('efile.EFILE1040.doc_import_return');
for(var i=0;i<result.length;i++){
doc_import_return_bm.insert({
'primary_field': result[i].primaryField,
'post_status': message,
'post_message': result[i].failedMessage,
'hly_req_number': "1"
})
}
logger.info(data);
} else {
println("=======有效期外======");
var data = httpPostGetToken(posturl, token_appid, token_appsecret);
var json = JSON.parse(data);
var access_token = json.access_token;
var status = json.status;
logger.info(access_token);
var doc_data=JSON.stringify(doc_data);
doc_data=doc_data.replace(/[\'\\\\/\b\f\n\r\t]/g, '');
logger.info(doc_data);
var data_result = httpPostDocImport(docUrl,doc_data,access_token, token_type);
logger.info(data_result);
var json_data = JSON.parse(data_result);
logger.info(json_data);
var statusCode =json_data.statusCode;
var message =json_data.message;
var result=json_data.result;
var doc_import_return_bm = $bm('efile.EFILE1040.doc_import_return');
for(var i=0;i<result.length;i++){
if(result[i].primaryField){
doc_import_return_bm.insert({
'primary_field': result[i].primaryField,
'post_status': message,
'post_message': result[i].failedMessage,
'hly_req_number': '1'
})
}
}
if (access_token) {
token_savelogs_bm.insert({
'json': data,
'status': 'success'
})
token_savelogs_bm.update({
'system_source': 'hlcm',
'expires_in': json.expires_in,
'access_token': access_token
})
}
if (status) {
var token_savelogs_bm = $bm('efile.EFILE1000.token_savelogs');
token_savelogs_bm.insert({
'json': json,
'status': 'fail'
});
}
}
}
} catch (e) {
println('e:' + e);
}
]]></s:server-script>
</a:init-procedure>
</a:service>
<?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="con_print_path.js"><![CDATA[
set_parameter_file_path();
]]></s:server-script>
<s:server-script><![CDATA[
importPackage(java.io);
importPackage(Packages.hls.plugin.docx4j);
importPackage(Packages.leaf.plugin.word2pdf);
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 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 ;}
}
var logger = $logger('server-script');
var instance_id = $ctx.parameter.instance_id;
var user_id=$ctx.parameter.user_id;
$bm('zjwfl.ZJWFL1060.wfl_instance_pdf').update({
instance_id: instance_id,
user_id :user_id
});
var file_templet_get_atm_path = $bm('zjwfl.ZJWFL1060.wfl_instance_pdf').queryAsMap({
instance_id: instance_id,
user_id :user_id
});
var from_file_data = file_templet_get_atm_path.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];
var to_file_name = record_data.to_file_name ;
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 + 'wfl' + record_data.content_id;
copyFile(from_file_path, to_file_path);
//放入实例id方便表单参数取值
$ctx.current_parameter.document_id = instance_id;
$ctx.current_parameter.user_id = user_id;
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,'COMMON');
} catch (e) {
raise_app_error(e);
}
word_to_pdf_sign(record_data.content_id,to_file_path.toString());
//得到生成的pdf文件的大小
var file_size=get_file_length(to_file_path.toString() + '.pdf');
//关联附件表
$bm('zjwfl.ZJWFL1060.wfl_instance_pdf').execute({
table_name: 'ZJ_WFL_WORKFLOW_INSTANCE',
instance_id: instance_id,
file_name: to_file_name.toString(),
file_path: to_file_path.toString(),
file_size: file_size,
user_id :user_id
});
var attachment_update = $bm('zjwfl.ZJWFL1060.wfl_instance_pdf');
//更新转换的pdf附件,其附件表的字段
//这里的附件关联表是工作流监控表
attachment_update.insert({
instance_id: instance_id,
table_name: 'ZJ_WFL_WORKFLOW_INSTANCE'
});
}
function word_to_pdf_sign(content_id,file_path) {
importPackage(Packages.com.hl.signatures);
importPackage(Packages.java.io);
importPackage(Packages.java.util);
var outputfilepath = file_path + '.pdf'; // 由于wordToPdf转换后pdf文件已经带有.pdf
var wordToPdf = new WordToPdf($instance('uncertain.ocm.IObjectRegistry'), "jacob-1.19-x64.dll");
wordToPdf.word2pdf(file_path, outputfilepath);
}
]]></s:server-script>
</a:init-procedure>
</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