Commit 56a37a0d authored by gzj34291's avatar gzj34291

Merge remote-tracking branch 'origin/remote_dev' into remote_dev

parents 18dceb94 faad2325
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<select id="selectCashflowList" parameterType="integer" resultType="java.util.LinkedHashMap"> <select id="selectCashflowList" parameterType="integer" resultType="java.util.LinkedHashMap">
Select Select
contract_id, contract_id,
cashflow_id, cashflow_id,
write_off_id, write_off_id,
...@@ -806,35 +806,20 @@ ...@@ -806,35 +806,20 @@
nvl(cc2.write_off_flag, 'NOT') != nvl(cc2.write_off_flag, 'NOT') !=
'NOT')) 'NOT'))
And rownum = 1)) due_date, And rownum = 1)) due_date,
nvl(t1.due_amount, nvl(t1.due_amount,
(Select cc2.due_amount (Select cc2.due_amount
From con_contract_cashflow cc2 From con_contract_cashflow cc2
Where cc2.contract_id = t2.contract_id Where cc2.contract_id = t2.contract_id
And cc2.times = t2.times And cc2.times = t2.times
And cc2.cf_item Not In (0, 9) And cc2.cf_item Not In (0, 9)
And ((cc2.cf_direction = 'INFLOW' And And ((cc2.cf_direction = 'INFLOW' And
cc2.cf_status = 'RELEASE') Or cc2.cf_status = 'RELEASE') Or
(t2.contract_status In (t2.contract_status In
('REPURING', 'REPUR') And ('REPURING', 'REPUR') And
cc2.cf_direction = 'NONCASH' And cc2.cf_direction = 'NONCASH' And
cc2.cf_status = 'BLOCK' And cc2.cf_status = 'BLOCK' And
nvl(cc2.write_off_flag, 'NOT') != nvl(cc2.write_off_flag, 'NOT') != 'NOT'))
'NOT')) And rownum = 1) ) As due_amount,
And rownum = 1) -
nvl((Select nvl(Sum(cc2.received_amount), 0)
From con_contract_cashflow cc2
Where cc2.contract_id = t2.contract_id
And cc2.times = t2.times
And cc2.cf_item Not In (0, 9)
And ((cc2.cf_direction = 'INFLOW' And
cc2.cf_status = 'RELEASE') Or
(t2.contract_status In
('REPURING', 'REPUR') And
cc2.cf_direction = 'NONCASH' And
cc2.cf_status = 'BLOCK' And
nvl(cc2.write_off_flag, 'NOT') !=
'NOT'))),
0)) As due_amount,
nvl(t1.transaction_date, t2.transaction_date) transaction_date, nvl(t1.transaction_date, t2.transaction_date) transaction_date,
nvl(t1.write_off_date, t2.write_off_date) write_off_date, nvl(t1.write_off_date, t2.write_off_date) write_off_date,
nvl(t1.received_amount, 0) As received_amount, nvl(t1.received_amount, 0) As received_amount,
...@@ -1102,10 +1087,10 @@ ...@@ -1102,10 +1087,10 @@
And nvl(cc2.received_amount, 0) != 0), And nvl(cc2.received_amount, 0) != 0),
-1)))) -1))))
Order By times, Order By times,
--cf_item,
--due_amount Desc, --due_amount Desc,
transaction_date, transaction_date,
write_off_date, write_off_date,
cf_item,
write_off_id) write_off_id)
</select> </select>
......
<?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: trd
$Date: 2023-2-7 下午2:36:27
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="E_ARCHIVES_DEFINE_DATA" defaultOrderBy="cloumn_code"
<bm:fields>
<bm:field name="base_archive_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BASE_ARCHIVE_ID" />
<bm:field name="sture_data_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="STURE_DATA_ID" />
<bm:field name="cloumn_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CLOUMN_CODE" />
<bm:field name="cloumn_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CLOUMN_NAME" />
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select t1.base_archive_id,
t1.sture_data_id,
t1.cloumn_code,
t1.cloumn_name
from E_ARCHIVES_DEFINE_DATA t1
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
elec_wfl_pkg.cloumn_code_update(
p_sql_type =>'INSERT',
p_sture_data_id => ${@sture_data_id},
p_base_archive_id => ${@base_archive_id},
p_cloumn_code => ${@cloumn_code},
p_cloumn_name => ${@cloumn_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.cloumn_code_update(
p_sql_type =>'UPDATE',
p_sture_data_id => ${@sture_data_id},
p_base_archive_id => ${@base_archive_id},
p_cloumn_code => ${@cloumn_code},
p_cloumn_name => ${@cloumn_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.cloumn_code_delete(
p_sture_data_id => ${@sture_data_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: 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:
-->
<ns1:model xmlns:ns1="http://www.leaf-framework.org/schema/bm" alias="t1" defaultOrderBy="workflow_id desc" extend="zjwfl.zj_wfl_workflow">
<ns1:fields>
<ns1:field name="workflow_id" databaseType="NUMBER" datatype="java.lang.Long"/>
<ns1:field name="workflow_code" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" prompt="流程代码"/>
<ns1:field name="workflow_desc" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" prompt="流程描述"/>
<ns1:field name="workflow_type_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="WORKFLOW_TYPE_ID"/>
<ns1:field name="sub_category"/>
<ns1:field name="enabled_flag"/>
</ns1:fields>
<ns1:query-fields>
<ns1:query-field field="workflow_code" queryOperator="like"/>
<ns1:query-field field="workflow_desc" queryOperator="like"/>
<ns1:query-field field="sub_category" queryExpression="t1.sub_category = ${/parameter/@sub_category}"/>
<ns1:query-field field="workflow_type_id" queryExpression="t1.workflow_type_id = ${/parameter/@workflow_type_id}"/>
</ns1:query-fields>
<ns1:data-filters>
<ns1:data-filter enforceOperations="query" expression="t1.enabled_flag = &apos;Y&apos;"/>
</ns1:data-filters>
</ns1: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,
t.workflow_id,
(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_workflow_id => ${@workflow_id},
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,
t1.e_archives_id,
(SELECT DISTINCT zwi.workflow_id
FROM zj_wfl_workflow_instance zwi,
zj_wfl_workflow zww
WHERE zww.workflow_id = zwi.workflow_id
AND zwi.instance_id = t1.document_id) workflow_id,
(SELECT e.je_check_flag
FROM e_archives_define e
WHERE e.base_archive_code = t1.base_archive_code
AND e.workflow_id = (SELECT DISTINCT zwi.workflow_id
FROM zj_wfl_workflow_instance zwi,
zj_wfl_workflow zww
WHERE zww.workflow_id = zwi.workflow_id
AND zwi.instance_id = t1.document_id)) je_check_flag,
(SELECT e.base_archive_id
FROM e_archives_define e
WHERE e.base_archive_code = t1.base_archive_code
AND e.workflow_id = (SELECT DISTINCT zwi.workflow_id
FROM zj_wfl_workflow_instance zwi,
zj_wfl_workflow zww
WHERE zww.workflow_id = zwi.workflow_id
AND zwi.instance_id = t1.document_id)) base_archive_id,
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 t1.creation_date>=sysdate-30)
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="e_archives_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="E_ARCHIVES_ID" />
<bm:field name="workflow_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="WORKFLOW_ID" />
<bm:field name="je_check_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="JE_CHECK_FLAG"/>
<bm:field name="base_archive_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BASE_ARCHIVE_ID" />
<bm:field name="monthly_closed_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="MONTHLY_CLOSED_FLAG"/>
<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,
t1.e_archives_id,
(SELECT DISTINCT zwi.workflow_id
FROM zj_wfl_workflow_instance zwi,
zj_wfl_workflow zww
WHERE zww.workflow_id = zwi.workflow_id
AND zwi.instance_id = t1.document_id) workflow_id,
(SELECT e.je_check_flag
FROM e_archives_define e
WHERE e.base_archive_code = t1.base_archive_code
AND e.workflow_id = (SELECT DISTINCT zwi.workflow_id
FROM zj_wfl_workflow_instance zwi,
zj_wfl_workflow zww
WHERE zww.workflow_id = zwi.workflow_id
AND zwi.instance_id = t1.document_id)) je_check_flag,
(SELECT e.base_archive_id
FROM e_archives_define e
WHERE e.base_archive_code = t1.base_archive_code
AND e.workflow_id = (SELECT DISTINCT zwi.workflow_id
FROM zj_wfl_workflow_instance zwi,
zj_wfl_workflow zww
WHERE zww.workflow_id = zwi.workflow_id
AND zwi.instance_id = t1.document_id)) base_archive_id,
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 = nvl(t1.suppl_trans_flag,'N')) suppl_trans_flag_desc,
t1.hly_req_number AS post_batch_num,
t1.suppl_trans_flag,
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="original_archive_no" queryExpression="t1.original_archive_no =${@original_archive_no}"/>
<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:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" >
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select elec_wfl_pkg.get_sql_value(p_e_archives_id =>${@e_archives_id},
p_instance_id =>${@document_id},
p_sql_type =>'JE_DATA_JSON',
p_workflow_id =>${@workflow_id},
p_user_id =>${/session/@user_id}) je_data_json from dual
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="je_data_json"/>
</bm:fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2022-12-22 下午1:05:40
$Revision: 1.0
$Purpose: 批量刪除
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="delete">
<bm:update-sql><![CDATA[
BEGIN
hls_journal_import_pkg.delete_hls_journal_import( p_journal_header_id =>${@journal_header_id}, p_user_id =>${/session/@user_id} );
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: lixi
$Date: 2011-8-1 上午10:21:39
$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 fnd_interface_headers_s.nextval header_id from dual
]]></bm:query-sql>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
BEGIN
hls_journal_import_pkg.reverse_hls_journal_import( p_journal_header_id =>${@journal_header_id}, p_user_id =>${/session/@user_id} );
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2022-12-6 下午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 * from (
select t1.journal_header_id,
t1.journal_submit_batch_id,
t1.journal_num,
t1.error_message,
t1.total_amount_dr,
t1.total_amount_cr,
(select c.company_short_name
from fnd_companies_vl c
where c.company_id = t1.je_company_id) js_company_short_name,
t1.period_name,
to_char(t1.journal_date,'yyyy-mm-dd') journal_date,
t1.currency_code,
(SELECT gc.currency_name
FROM gld_currency_v gc
WHERE gc.currency_code = t1.currency_code) currency_desc,
t1.total_amount_fuc_dr,
(SELECT d.je_transaction_desc
FROM gld_je_transaction d
WHERE d.je_transaction_code = t1.je_transaction_code) je_transaction_desc,
t1.description,
(SELECT COUNT(1)
FROM hls_journal_detail_imp t
WHERE t.journal_header_id = t1.journal_header_id) je_detail_count,
t1.wfl_status,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'HLS536_WFL_STATUS'
and v.code_value = t1.wfl_status) wfl_status_n,
t1.reversed_flag,
t1.reverse_wfl_status,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'HLS536_WFL_STATUS_REVERSE'
and v.code_value = t1.reverse_wfl_status) reverse_wfl_status_n,
t1.journal_type,
(select t.post_gl_status
from hls_journal_header t
where t.journal_header_imp_id = t1.journal_header_id
) post_gl_status
FROM hls_journal_header_imp t1
where 1=1
AND EXISTS (SELECT 1
FROM exp_emp_assign_e_v t
WHERE t.user_id = ${/session/@user_id}
AND t.position_code IN ('014'))
and t1.journal_type in('COST_IMPORT','GLOBAL_TEMPLATE')
union
select t1.journal_header_id,
t1.journal_submit_batch_id,
t1.journal_num,
t1.error_message,
t1.total_amount_dr,
t1.total_amount_cr,
(select c.company_short_name
from fnd_companies_vl c
where c.company_id = t1.je_company_id) js_company_short_name,
t1.period_name,
to_char(t1.journal_date,'yyyy-mm-dd') journal_date,
t1.currency_code,
(SELECT gc.currency_name
FROM gld_currency_v gc
WHERE gc.currency_code = t1.currency_code) currency_desc,
t1.total_amount_fuc_dr,
(SELECT d.je_transaction_desc
FROM gld_je_transaction d
WHERE d.je_transaction_code = t1.je_transaction_code) je_transaction_desc,
t1.description,
(SELECT COUNT(1)
FROM hls_journal_detail_imp t
WHERE t.journal_header_id = t1.journal_header_id) je_detail_count,
t1.wfl_status,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'HLS536_WFL_STATUS'
and v.code_value = t1.wfl_status) wfl_status_n,
t1.reversed_flag,
t1.reverse_wfl_status,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'HLS536_WFL_STATUS_REVERSE'
and v.code_value = t1.reverse_wfl_status) reverse_wfl_status_n,
t1.journal_type,
(select t.post_gl_status
from hls_journal_header t
where t.journal_header_imp_id = t1.journal_header_id
) post_gl_status
FROM hls_journal_header_imp t1
where 1=1
AND EXISTS (SELECT 1
FROM exp_emp_assign_e_v t
WHERE t.user_id = ${/session/@user_id}
AND t.position_code IN ('012'))
and t1.journal_type in('FUND_POOL','FINANCIAL_TEMPLATE')
union
select t1.journal_header_id,
t1.journal_submit_batch_id,
t1.journal_num,
t1.error_message,
t1.total_amount_dr,
t1.total_amount_cr,
(select c.company_short_name
from fnd_companies_vl c
where c.company_id = t1.je_company_id) js_company_short_name,
t1.period_name,
to_char(t1.journal_date,'yyyy-mm-dd') journal_date,
t1.currency_code,
(SELECT gc.currency_name
FROM gld_currency_v gc
WHERE gc.currency_code = t1.currency_code) currency_desc,
t1.total_amount_fuc_dr,
(SELECT d.je_transaction_desc
FROM gld_je_transaction d
WHERE d.je_transaction_code = t1.je_transaction_code) je_transaction_desc,
t1.description,
(SELECT COUNT(1)
FROM hls_journal_detail_imp t
WHERE t.journal_header_id = t1.journal_header_id) je_detail_count,
t1.wfl_status,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'HLS536_WFL_STATUS'
and v.code_value = t1.wfl_status) wfl_status_n,
t1.reversed_flag,
t1.reverse_wfl_status,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'HLS536_WFL_STATUS_REVERSE'
and v.code_value = t1.reverse_wfl_status) reverse_wfl_status_n,
t1.journal_type,
(select t.post_gl_status
from hls_journal_header t
where t.journal_header_imp_id = t1.journal_header_id
) post_gl_status
FROM hls_journal_header_imp t1
where 1=1
AND EXISTS (SELECT 1
FROM exp_emp_assign_e_v t
WHERE t.user_id = ${/session/@user_id}
AND t.position_code IN ('026'))
and t1.journal_type in('GENERAL_SALARIES','BPO_SALARIES')
union
select t1.journal_header_id,
t1.journal_submit_batch_id,
t1.journal_num,
t1.error_message,
t1.total_amount_dr,
t1.total_amount_cr,
(select c.company_short_name
from fnd_companies_vl c
where c.company_id = t1.je_company_id) js_company_short_name,
t1.period_name,
to_char(t1.journal_date,'yyyy-mm-dd') journal_date,
t1.currency_code,
(SELECT gc.currency_name
FROM gld_currency_v gc
WHERE gc.currency_code = t1.currency_code) currency_desc,
t1.total_amount_fuc_dr,
(SELECT d.je_transaction_desc
FROM gld_je_transaction d
WHERE d.je_transaction_code = t1.je_transaction_code) je_transaction_desc,
t1.description,
(SELECT COUNT(1)
FROM hls_journal_detail_imp t
WHERE t.journal_header_id = t1.journal_header_id) je_detail_count,
t1.wfl_status,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'HLS536_WFL_STATUS'
and v.code_value = t1.wfl_status) wfl_status_n,
t1.reversed_flag,
t1.reverse_wfl_status,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'HLS536_WFL_STATUS_REVERSE'
and v.code_value = t1.reverse_wfl_status) reverse_wfl_status_n,
t1.journal_type,
(select t.post_gl_status
from hls_journal_header t
where t.journal_header_imp_id = t1.journal_header_id
) post_gl_status
FROM hls_journal_header_imp t1
where 1=1
AND EXISTS (SELECT 1
FROM exp_emp_assign_e_v t
WHERE t.user_id = ${/session/@user_id}
AND t.position_code IN ('017') or ${/session/@user_id} = 10418
)
and t1.journal_type in('GENERAL_SALARIES','BPO_SALARIES','COST_IMPORT','FUND_POOL','GLOBAL_TEMPLATE','FINANCIAL_TEMPLATE')
) t1
#WHERE_CLAUSE#
order by t1.journal_header_id desc
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="journal_num" queryExpression="t1.journal_num like ${@journal_num}"/>
<bm:query-field name="journal_date_from" queryExpression="to_date(t1.journal_date,'yyyy-mm-dd') &gt;= to_date(${@journal_date_from},'yyyy-mm-dd')"/>
<bm:query-field name="journal_date_to" queryExpression="to_date(t1.journal_date,'yyyy-mm-dd') &lt;= to_date(${@journal_date_to},'yyyy-mm-dd')"/>
<bm:query-field name="total_amount_dr_from" datatype="java.lang.Double" queryExpression="nvl(t1.total_amount_dr,t1.total_amount_cr) &gt;= ${@total_amount_dr_from}"/>
<bm:query-field name="total_amount_dr_to" datatype="java.lang.Double" queryExpression="nvl(t1.total_amount_dr,t1.total_amount_cr) &lt;= ${@total_amount_dr_to}"/>
<bm:query-field name="description" queryExpression="t1.description like ${@description}"/>
<bm:query-field name="wfl_status" queryExpression="t1.wfl_status=${@wfl_status}"/>
<bm:query-field name="reverse_wfl_status" queryExpression="t1.reverse_wfl_status=${@reverse_wfl_status}"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2022-12-6 下午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 t1.journal_header_id,
t1.journal_submit_batch_id,
t1.journal_num,
t1.error_message,
t1.total_amount_dr,
t1.total_amount_cr,
(select c.company_short_name
from fnd_companies_vl c
where c.company_id = t1.je_company_id) js_company_short_name,
t1.period_name,
to_char(t1.journal_date,'yyyy-mm-dd') journal_date,
t1.currency_code,
(SELECT gc.currency_name
FROM gld_currency_v gc
WHERE gc.currency_code = t1.currency_code) currency_desc,
t1.total_amount_fuc_dr,
(SELECT d.je_transaction_desc
FROM gld_je_transaction d
WHERE d.je_transaction_code = t1.je_transaction_code) je_transaction_desc,
t1.description,
(SELECT COUNT(1)
FROM hls_journal_detail_imp t
WHERE t.journal_header_id = t1.journal_header_id) je_detail_count,
t1.wfl_status,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'HLS536_WFL_STATUS'
and v.code_value = t1.wfl_status) wfl_status_n,
t1.reversed_flag,
t1.reverse_wfl_status,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'HLS536_WFL_STATUS_REVERSE'
and v.code_value = t1.reverse_wfl_status) reverse_wfl_status_n,
t1.journal_type,
(select t.post_gl_status
from hls_journal_header t
where t.journal_header_imp_id = t1.journal_header_id
) post_gl_status
FROM hls_journal_header_imp t1
#WHERE_CLAUSE#
order by t1.journal_header_id desc
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:data-filters>
<bm:data-filter name="query" expression="t1.reversed_journal_header_id is null "/>
</bm:data-filters>
<bm:query-fields>
<bm:query-field name="journal_num" queryExpression="t1.journal_num like ${@journal_num}"/>
<bm:query-field name="journal_date_from" queryExpression="to_date(t1.journal_date,'yyyy-mm-dd') &gt;= to_date(${@journal_date_from},'yyyy-mm-dd')"/>
<bm:query-field name="journal_date_to" queryExpression="to_date(t1.journal_date,'yyyy-mm-dd') &lt;= to_date(${@journal_date_to},'yyyy-mm-dd')"/>
<bm:query-field name="total_amount_dr_from" datatype="java.lang.Double" queryExpression="nvl(t1.total_amount_dr,t1.total_amount_cr) &gt;= ${@total_amount_dr_from}"/>
<bm:query-field name="total_amount_dr_to" datatype="java.lang.Double" queryExpression="nvl(t1.total_amount_dr,t1.total_amount_cr) &lt;= ${@total_amount_dr_to}"/>
<bm:query-field name="journal_submit_batch_id" queryExpression="t1.journal_submit_batch_id = ${@journal_submit_batch_id}"/>
<bm:query-field name="description" queryExpression="t1.description like ${@description}"/>
<bm:query-field name="wfl_status" queryExpression="t1.wfl_status=${@wfl_status}"/>
<bm:query-field name="reverse_wfl_status" queryExpression="t1.reverse_wfl_status=${@reverse_wfl_status}"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2022-12-6 下午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 t1.journal_header_id,
t1.journal_submit_batch_id,
t1.journal_reverse_batch_id,
t1.journal_num,
t1.error_message,
t1.total_amount_dr,
t1.total_amount_cr,
(select c.company_short_name
from fnd_companies_vl c
where c.company_id = t1.je_company_id) js_company_short_name,
t1.period_name,
to_char(t1.journal_date,'yyyy-mm-dd') journal_date,
t1.currency_code,
(SELECT gc.currency_name
FROM gld_currency_v gc
WHERE gc.currency_code = t1.currency_code) currency_desc,
t1.total_amount_fuc_dr,
(SELECT d.je_transaction_desc
FROM gld_je_transaction d
WHERE d.je_transaction_code = t1.je_transaction_code) je_transaction_desc,
t1.description,
(SELECT COUNT(1)
FROM hls_journal_detail_imp t
WHERE t.journal_header_id = t1.journal_header_id) je_detail_count,
t1.wfl_status,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'HLS536_WFL_STATUS'
and v.code_value = t1.wfl_status) wfl_status_n,
t1.reverse_wfl_status,
(select v.code_value_name value_name
from sys_code_values_v v
where v.code = 'HLS536_WFL_STATUS_REVERSE'
and v.code_value = t1.reverse_wfl_status) reverse_wfl_status_n,
t1.journal_type,
(select t.post_gl_status
from hls_journal_header t
where t.journal_header_imp_id = t1.journal_header_id) post_gl_status
FROM hls_journal_header_imp t1
#WHERE_CLAUSE#
order by t1.journal_header_id desc
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="journal_num" queryExpression="t1.journal_num like ${@journal_num}"/>
<bm:query-field name="journal_date_from" queryExpression="to_date(t1.journal_date,'yyyy-mm-dd') &gt;= to_date(${@journal_date_from},'yyyy-mm-dd')"/>
<bm:query-field name="journal_date_to" queryExpression="to_date(t1.journal_date,'yyyy-mm-dd') &lt;= to_date(${@journal_date_to},'yyyy-mm-dd')"/>
<bm:query-field name="total_amount_dr_from" datatype="java.lang.Double" queryExpression="nvl(t1.total_amount_dr,t1.total_amount_cr) &gt;= ${@total_amount_dr_from}"/>
<bm:query-field name="total_amount_dr_to" datatype="java.lang.Double" queryExpression="nvl(t1.total_amount_dr,t1.total_amount_cr) &lt;= ${@total_amount_dr_to}"/>
<bm:query-field name="journal_reverse_batch_id" queryExpression="t1.journal_reverse_batch_id = ${@journal_submit_batch_id}"/>
<bm:query-field name="description" queryExpression="t1.description like ${@description}"/>
<bm:query-field name="wfl_status" queryExpression="t1.wfl_status=${@wfl_status}"/>
</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="query">
<bm:query-sql><![CDATA[
Select ep.position_code
From exp_employees e, exp_employee_assigns ea, exp_org_position ep
Where e.employee_id = ea.employee_id
And ea.position_id = ep.position_id
And nvl(e.enabled_flag, 'N') = 'Y'
And nvl(ea.enabled_flag, 'N') = 'Y'
And nvl(ep.enabled_flag, 'N') = 'Y'
And nvl(ea.primary_position_flag, 'N') = 'Y'
And e.employee_id = (Select t.employee_id
From sys_user t
Where t.user_id = ${/session/@user_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="execute">
<bm:update-sql><![CDATA[
BEGIN
hls_journal_import_pkg.insert_hls_journal_tmp(p_user_id => ${/session/@user_id},
p_header_id => ${/model/header/record/@header_id},
p_company_id => ${/session/@company_id},
p_template_type=>${@template_type}
);
END;
]]></bm:update-sql>
<bm:parameters>
<bm:parameter inputPath="/session/@user_id"/>
<bm:parameter inputPath="/session/@session_id"/>
<bm:parameter inputPath="/session/@template_type"/>
</bm:parameters>
</bm:operation>
<bm:operation name="update" >
<bm:update-sql><![CDATA[
BEGIN
hls_journal_import_pkg.init_journal_atm(p_document_number =>${@document_number},
p_file_path =>${@file_path},
p_file_name =>${@file_name},
p_file_length =>${@file_length},
p_user_id =>${/session/@user_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:operations>
<bm:operation name="insert">
<bm:parameters>
<bm:parameter name="journal_submit_batch_id" output="true" outputPath="@journal_submit_batch_id"/>
</bm:parameters>
<bm:update-sql>
<![CDATA[
declare
v_journal_submit_batch_id hls_journal_submit_batch.journal_submit_batch_id%TYPE := hls_journal_submit_batch_s.nextval;
begin
${@journal_submit_batch_id} := v_journal_submit_batch_id;
insert into hls_journal_submit_batch
(journal_submit_batch_id,
instance_id,
wfl_status,
wfl_type,
created_by,
creation_date,
last_updated_by,
last_update_date)
values
(v_journal_submit_batch_id,
null,
'NEW',
'',
${/session/@user_id},
sysdate,
${/session/@user_id},
sysdate
);
end;
]]>
</bm:update-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql>
<![CDATA[
begin
update hls_journal_header_imp hjhi
set hjhi.reverse_wfl_status = 'APPROVING',
hjhi.journal_reverse_batch_id = ${/parameter/@journal_submit_batch_id},
hjhi.last_updated_by = ${/session/@user_id},
hjhi.last_update_date = sysdate
where hjhi.journal_header_id = ${@journal_header_id};
end;
]]>
</bm:update-sql>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql>
<![CDATA[
begin
hls_journal_import_pkg.submit_hls_journal_reverse(
p_journal_submit_batch_id => ${/parameter/@journal_submit_batch_id},
p_user_id => ${/session/@user_id},
p_company_id => ${/session/@company_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:operations>
<bm:operation name="insert">
<bm:parameters>
<bm:parameter name="journal_submit_batch_id" output="true" outputPath="@journal_submit_batch_id"/>
</bm:parameters>
<bm:update-sql>
<![CDATA[
declare
v_journal_submit_batch_id hls_journal_submit_batch.journal_submit_batch_id%TYPE := hls_journal_submit_batch_s.nextval;
begin
${@journal_submit_batch_id} := v_journal_submit_batch_id;
insert into hls_journal_submit_batch
(journal_submit_batch_id,
instance_id,
wfl_status,
wfl_type,
created_by,
creation_date,
last_updated_by,
last_update_date)
values
(v_journal_submit_batch_id,
null,
null,
${@wfl_type},
${/session/@user_id},
sysdate,
${/session/@user_id},
sysdate
);
end;
]]>
</bm:update-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql>
<![CDATA[
update hls_journal_header_imp hjhi
set
hjhi.journal_submit_batch_id = ${/parameter/@journal_submit_batch_id},
hjhi.last_updated_by = ${/session/@user_id},
hjhi.last_update_date = sysdate
where hjhi.journal_header_id = ${@journal_header_id}
]]>
</bm:update-sql>
<!--<bm:parameters>
<bm:parameter inputPath="/session/@session_id"/>
</bm:parameters>-->
</bm:operation>
<bm:operation name="execute">
<bm:update-sql>
<![CDATA[
begin
hls_journal_import_pkg.submit_hls_journal_tmp(
p_journal_submit_batch_id => ${/parameter/@journal_submit_batch_id},
p_user_id => ${/session/@user_id},
p_company_id => ${/session/@company_id}
);
end;
]]>
</bm:update-sql>
<!--<bm:parameters>
<bm:parameter inputPath="/session/@session_id"/>
</bm:parameters>-->
</bm:operation>
</bm:operations>
</bm:model>
...@@ -320,6 +320,11 @@ SELECT h.period_year, ...@@ -320,6 +320,11 @@ SELECT h.period_year,
where g.account_id = d.account_id where g.account_id = d.account_id
and g.account_code in ('6041001000')) and g.account_code in ('6041001000'))
and rownum = 1) and rownum = 1)
when ghd.je_template_code in('HL_REPURCHASE_VAT') then
(select -1*round(cc.ccr_due_amount-cc.ccr_due_amount/(1+DECODE(CC.BUSINESS_TYPE, 'LEASEBACK', 0.06, 0.13))*DECODE(CC.BUSINESS_TYPE, 'LEASEBACK', 0.06, 0.13),2)
from con_contract cc
WHERE cc.contract_number = l.reference3
and cc.data_class = 'NORMAL')
else else
(select nvl(d.amount_dr,d.amount_cr) (select nvl(d.amount_dr,d.amount_cr)
from hls_journal_detail d from hls_journal_detail d
...@@ -344,6 +349,11 @@ SELECT h.period_year, ...@@ -344,6 +349,11 @@ SELECT h.period_year,
where g.account_id = d.account_id where g.account_id = d.account_id
and g.account_code in ('6041001000')) and g.account_code in ('6041001000'))
and rownum = 1) and rownum = 1)
when ghd.je_template_code in('HL_REPURCHASE_VAT') then
(select -1*round(cc.ccr_due_amount-cc.ccr_due_amount/(1+DECODE(CC.BUSINESS_TYPE, 'LEASEBACK', 0.06, 0.13))*DECODE(CC.BUSINESS_TYPE, 'LEASEBACK', 0.06, 0.13),2)
from con_contract cc
WHERE cc.contract_number = l.reference3
and cc.data_class = 'NORMAL')
else else
(select nvl(d.amount_dr,d.amount_cr) (select nvl(d.amount_dr,d.amount_cr)
from hls_journal_detail d from hls_journal_detail d
...@@ -387,6 +397,7 @@ SELECT h.period_year, ...@@ -387,6 +397,7 @@ SELECT h.period_year,
'HL_CSH_CONSOLIDATION_DALAY' or 'HL_CSH_CONSOLIDATION_DALAY' or
ghd.je_template_code in ghd.je_template_code in
('HL_GLD_BALANCE_REPURCHASE','HL_GLD_BALANCE_REPURCHASE_LB','HL_RECEIVABLES_AGENT_REPUR_LB','HL_RECEIVABLES_AGENT_REPUR','HL_GLD_BALANCE_PENALTY','HL_PENALTY_R_ET','HL_PENALTY_R_ET_LB') ('HL_GLD_BALANCE_REPURCHASE','HL_GLD_BALANCE_REPURCHASE_LB','HL_RECEIVABLES_AGENT_REPUR_LB','HL_RECEIVABLES_AGENT_REPUR','HL_GLD_BALANCE_PENALTY','HL_PENALTY_R_ET','HL_PENALTY_R_ET_LB')
or( ghd.je_template_code in('HL_REPURCHASE_VAT') and l.line_description like '%违约金销项税' )
) )
and not exists (SELECT 1 and not exists (SELECT 1
FROM acr_invoice_hd hi, acr_invoice_ln li FROM acr_invoice_hd hi, acr_invoice_ln li
......
...@@ -348,6 +348,12 @@ SELECT h.period_year, ...@@ -348,6 +348,12 @@ SELECT h.period_year,
where g.account_id = d.account_id where g.account_id = d.account_id
and g.account_code in ('6041001000')) and g.account_code in ('6041001000'))
and rownum = 1) and rownum = 1)
when ghd.je_template_code in('HL_REPURCHASE_VAT') then
(select
-1*round(cc.ccr_due_amount-cc.ccr_due_amount/(1+DECODE(CC.BUSINESS_TYPE, 'LEASEBACK', 0.06, 0.13))*DECODE(CC.BUSINESS_TYPE, 'LEASEBACK', 0.06, 0.13),2)
from con_contract cc
WHERE cc.contract_number = l.reference3
and cc.data_class = 'NORMAL')
else else
(select nvl(d.amount_dr,d.amount_cr) (select nvl(d.amount_dr,d.amount_cr)
from hls_journal_detail d from hls_journal_detail d
...@@ -372,6 +378,11 @@ SELECT h.period_year, ...@@ -372,6 +378,11 @@ SELECT h.period_year,
where g.account_id = d.account_id where g.account_id = d.account_id
and g.account_code in ('6041001000')) and g.account_code in ('6041001000'))
and rownum = 1) and rownum = 1)
when ghd.je_template_code in('HL_REPURCHASE_VAT') then
(select -1*round(cc.ccr_due_amount-cc.ccr_due_amount/(1+DECODE(CC.BUSINESS_TYPE, 'LEASEBACK', 0.06, 0.13))*DECODE(CC.BUSINESS_TYPE, 'LEASEBACK', 0.06, 0.13),2)
from con_contract cc
WHERE cc.contract_number = l.reference3
and cc.data_class = 'NORMAL')
else else
(select nvl(d.amount_dr,d.amount_cr) (select nvl(d.amount_dr,d.amount_cr)
from hls_journal_detail d from hls_journal_detail d
...@@ -402,7 +413,11 @@ SELECT h.period_year, ...@@ -402,7 +413,11 @@ SELECT h.period_year,
and cc.data_class = 'NORMAL') vat_rate, and cc.data_class = 'NORMAL') vat_rate,
h.je_transaction_code, h.je_transaction_code,
l.cashflow_id, l.cashflow_id,
'N' fixed_data_flag case when ghd.je_template_code in('HL_REPURCHASE_VAT') then
'Y'
else
'N'
end fixed_data_flag
FROM hls_journal_header h, hls_journal_detail l, gld_accounts ga,gld_je_template_hds ghd FROM hls_journal_header h, hls_journal_detail l, gld_accounts ga,gld_je_template_hds ghd
WHERE h.journal_header_id = l.journal_header_id WHERE h.journal_header_id = l.journal_header_id
and h.je_template_hd_id=ghd.je_template_hd_id and h.je_template_hd_id=ghd.je_template_hd_id
...@@ -416,6 +431,7 @@ SELECT h.period_year, ...@@ -416,6 +431,7 @@ SELECT h.period_year,
'HL_CSH_CONSOLIDATION_DALAY' or 'HL_CSH_CONSOLIDATION_DALAY' or
ghd.je_template_code in ghd.je_template_code in
('HL_GLD_BALANCE_REPURCHASE','HL_GLD_BALANCE_REPURCHASE_LB','HL_RECEIVABLES_AGENT_REPUR_LB','HL_RECEIVABLES_AGENT_REPUR','HL_GLD_BALANCE_PENALTY','HL_PENALTY_R_ET','HL_PENALTY_R_ET_LB') ('HL_GLD_BALANCE_REPURCHASE','HL_GLD_BALANCE_REPURCHASE_LB','HL_RECEIVABLES_AGENT_REPUR_LB','HL_RECEIVABLES_AGENT_REPUR','HL_GLD_BALANCE_PENALTY','HL_PENALTY_R_ET','HL_PENALTY_R_ET_LB')
or( ghd.je_template_code in('HL_REPURCHASE_VAT') and l.line_description like '%违约金销项税' )
) )
and ((trunc(h.journal_date) <= and ((trunc(h.journal_date) <=
trunc(to_date('2020-01-31', 'yyyy-mm-dd')) and trunc(to_date('2020-01-31', 'yyyy-mm-dd')) and
......
<?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>
...@@ -55,6 +55,23 @@ ...@@ -55,6 +55,23 @@
<bm:query-field name="approve_user_code" queryExpression="t1.approve_user_code like ${@approve_user_code}"/> <bm:query-field name="approve_user_code" queryExpression="t1.approve_user_code like ${@approve_user_code}"/>
</bm:query-fields> </bm:query-fields>
<bm:data-filters> <bm:data-filters>
<bm:data-filter name="query" expression="( (${/session/@role_id} = (select role_id from sys_role where role_code = '0006') and t1.workflow_code in (&apos;CONTRACT_INCEPT_WFL&apos;, &apos;DCFL_CSH_PAYMENT_REQ&apos;)) or (${/session/@role_id} in (select role_id from sys_role where role_code in ('0012', '0013', '0014')) and t1.workflow_code in (&apos;DCFL_CSH_PAYMENT_REQ&apos;, &apos;DEPOSIT_RETURN&apos;)) or (${/session/@role_id} = (select role_id from sys_role where role_code = '0005') and t1.workflow_code in (&apos;PROJECT_WFL&apos;)) or (${/session/@role_id} = (select role_id from sys_role where role_code = '0008') and t1.workflow_code in (&apos;CON_ET_WFL&apos;,&apos;TENANT_CHANGE_WFL&apos;,&apos;CON_BUYBACK_WFL&apos;,&apos;DEPOSIT_RETURN&apos;,&apos;WFL_FEE_REMIT&apos;)) or (${/session/@role_id} not in (select role_id from sys_role where role_code in('0005', '0006', '0008', '0012', '0013', '0014')) and 1 = 1))"/> <!--<bm:data-filter name="query" expression="( (${/session/@role_id} = (select role_id from sys_role where role_code = '0006') and t1.workflow_code in (&apos;CONTRACT_INCEPT_WFL&apos;, &apos;DCFL_CSH_PAYMENT_REQ&apos;)) or (${/session/@role_id} in (select role_id from sys_role where role_code in ('0012', '0013', '0014')) and t1.workflow_code in (&apos;DCFL_CSH_PAYMENT_REQ&apos;, &apos;DEPOSIT_RETURN&apos;)) or (${/session/@role_id} = (select role_id from sys_role where role_code = '0005') and t1.workflow_code in (&apos;PROJECT_WFL&apos;)) or (${/session/@role_id} = (select role_id from sys_role where role_code = '0008') and t1.workflow_code in (&apos;CON_ET_WFL&apos;,&apos;TENANT_CHANGE_WFL&apos;,&apos;CON_BUYBACK_WFL&apos;,&apos;DEPOSIT_RETURN&apos;,&apos;WFL_FEE_REMIT&apos;)) or (${/session/@role_id} not in (select role_id from sys_role where role_code in('0005', '0006', '0008', '0012', '0013', '0014')) and 1 = 1))"/>-->
<bm:data-filter name="query" expression="( (${/session/@role_id} = (select role_id from sys_role where role_code = '0006') and t1.workflow_code in (&apos;CONTRACT_INCEPT_WFL&apos;, &apos;DCFL_CSH_PAYMENT_REQ&apos;)) or (${/session/@role_id} in (select role_id from sys_role where role_code in ('0012', '0013', '0014')) and t1.workflow_code in (&apos;DCFL_CSH_PAYMENT_REQ&apos;, &apos;DEPOSIT_RETURN&apos;)) or (${/session/@role_id} = (select role_id from sys_role where role_code = '0005') and t1.workflow_code in (&apos;PROJECT_WFL&apos;)) or (${/session/@role_id} = (select role_id from sys_role where role_code = '0008') and t1.workflow_code in (&apos;CON_ET_WFL&apos;,&apos;TENANT_CHANGE_WFL&apos;,&apos;CON_BUYBACK_WFL&apos;,&apos;DEPOSIT_RETURN&apos;)) or (${/session/@role_id} not in (select role_id from sys_role where role_code in('0005', '0006', '0008', '0012', '0013', '0014')) and 1 = 1)
or( ((t1.SUBMITTED_BY = ${/session/@user_id}) or (
(${/session/@user_id}
in (Select t.user_id
From zj_wfl_instance_node_recipient t
Where t.instance_id = t1.instance_id
And t.record_type = 'APPROVER')
and t1.instance_status = 1)
or
(${/session/@user_id}
in (Select t.user_id
From zj_wfl_instance_node_rcpt_ht t
Where t.instance_id = t1.instance_id
And t.record_type = 'APPROVER')
and t1.instance_status in (-1000,-1,10))
) ) and t1.workflow_code in('HLS_JOURNAL_WFL','HLS_JOURNAL_REVERSE_WFL')))"/>
</bm:data-filters> </bm:data-filters>
</bm:model> </bm:model>
...@@ -175,6 +175,7 @@ var enableLayoutConfig = { ...@@ -175,6 +175,7 @@ var enableLayoutConfig = {
'modules/cont/CON762/con_contract_finish_query.lview':true, 'modules/cont/CON762/con_contract_finish_query.lview':true,
'modules/csh/CSH540/agent_deposit_return.lview':true, 'modules/csh/CSH540/agent_deposit_return.lview':true,
'modules/hls/HLS530/manual_journal_create.lview':true, 'modules/hls/HLS530/manual_journal_create.lview':true,
'modules/hls/HLS536/hls_journal_import_create.lview':true,
'modules/csh/CSH541/agent_deposit_details.lview':true, 'modules/csh/CSH541/agent_deposit_details.lview':true,
'modules/hls/HLS535/hls_sap_process_resend.lview':true, 'modules/hls/HLS535/hls_sap_process_resend.lview':true,
'modules/prj/PRJ500/prj_project_create_entrance.lview':true, 'modules/prj/PRJ500/prj_project_create_entrance.lview':true,
......
<?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"><![CDATA[
try {
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 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;
if (is_valid == 'true') {
var SystokenQuery = token_savelogs_bm.queryAsMap();
var access_token = SystokenQuery.getChildren()[0].access_token;
} else {
println("=======有效期外======");
var data = httpPostGetToken(posturl, token_appid, token_appsecret);
println(data);
var json = JSON.parse(data);
var access_token = json.access_token;
var status = json.status;
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"?>
<!--
$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="suppl_trans_flag" />
<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_desc" 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:field name="post_message" readOnly="true" />
</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_desc" 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_desc" align="center" width="120" prompt="是否补传"/>
<a:column name="post_status" align="center" width="120" prompt="传输状态"/>
<a:column name="post_message" align="center" editor="textarea_id" width="180" prompt="传输结果"/>
<a:column name="post_batch_num" align="center" width="120" prompt="传输批次号"/>
</a:columns>
<a:editors>
<a:textField id="text_ed"/>
<a:textArea id="textarea_id"/>
<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-10 下午2:03:31
$Revision: 1.0
$Purpose: 附件列表
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" customizationEnabled="true" trace="true">
<a:init-procedure>
<s:server-script><![CDATA[
function newMap(name) {
return new CompositeMap("a", 'http://www.aurora-framework.org/application',
name);
}
var para = $ctx.current_parameter || $ctx.parameter;
var sql_content;
var query_validation_sql_bm = $bm('efile.EFILE1030.efile_pool_att_para_sql');
var config_map = query_validation_sql_bm.queryAsMap(para);
var config_map_detail = config_map.getChildren();
if (config_map_detail.length != 0) {
sql_content = config_map_detail[0].sql_content;
para.sql_content = sql_content;
}
//println(sql_content);
var dataSet_id='att_json_ds';
var obj = JSON.parse(sql_content).attachmentList;
var config = $config();
var dataSets = CompositeUtil.findChild(config, 'dataSets');
var dataSet = CompositeUtil.findChild(dataSets, 'dataSet', 'id', dataSet_id);
if (!dataSet) {
dataSet = newMap("dataSet");
dataSet.id = dataSet_id;
dataSet.autocreate = 'true';
dataSets.addChild(dataSet.getData());
var datas = newMap("datas");
dataSet.addChild(datas.getData());
}
// dataSets.addChild(dataSet.getData());
// dataSet.id = 'att_json_ds';
// dataSet.autocreate = 'true';
// dataSets.addChild(dataSet.getData());
// var datas = newMap("datas");
// dataSet.addChild(datas.getData());
for (var k in obj) {
// if (obj[k] instanceof Object) {
var datasRecord = newMap("record");
datasRecord.code_value = obj[k].fileURL;
datasRecord.code_value_name = obj[k].fileName;
datasRecord.action_type = obj[k].attachTypeCode;
datas.addChild(datasRecord.getData());
//println(datasRecord.code_value+":"+datasRecord.code_value_name);
//} else {
// println("2222"+obj[k].fieldCode);
//}
}
]]></s:server-script>
</a:init-procedure>
<a:view>
<script type="text/javascript"><![CDATA[
]]></script>
<a:dataSets>
</a:dataSets>
<a:screenBody>
<a:grid id="att_para_ds_id" bindTarget="att_json_ds" height="180" width="760" navBar="true">
<a:columns>
<a:column name="action_type" prompt="附件类型" width="150"/>
<a:column name="code_value" prompt="附件地址" width="400"/>
<a:column name="code_value_name" prompt="附件名称" width="200"/>
</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" xmlns:s="leaf.plugin.script" customizationEnabled="true" trace="true">
<a:init-procedure>
<s:server-script><![CDATA[
function newMap(name) {
return new CompositeMap("a", 'http://www.aurora-framework.org/application',
name);
}
var para = $ctx.current_parameter || $ctx.parameter;
var sql_content;
var query_validation_sql_bm = $bm('efile.EFILE1030.efile_pool_para_sql');
var config_map = query_validation_sql_bm.queryAsMap(para);
var config_map_detail = config_map.getChildren();
if (config_map_detail.length != 0) {
sql_content = config_map_detail[0].sql_content;
para.sql_content = sql_content;
}
//println(sql_content);
var dataSet_id='post_stur_json_ds';
var obj = JSON.parse(sql_content).fieldValueList;
var config = $config();
var dataSets = CompositeUtil.findChild(config, 'dataSets');
var dataSet = CompositeUtil.findChild(dataSets, 'dataSet', 'id', dataSet_id);
if (!dataSet) {
dataSet = newMap("dataSet");
dataSet.id = dataSet_id;
dataSet.autocreate = 'true';
dataSets.addChild(dataSet.getData());
var datas = newMap("datas");
dataSet.addChild(datas.getData());
}
//var dataSet = newMap("dataSet");
// dataSets.addChild(dataSet.getData());
//dataSet.id = 'post_stur_json_ds';
// dataSet.autocreate = 'true';
// dataSets.addChild(dataSet.getData());
// var datas = newMap("datas");
// dataSet.addChild(datas.getData());
for (var k in obj) {
// if (obj[k] instanceof Object) {
var datasRecord = newMap("record");
datasRecord.code_value = obj[k].fieldCode;
datasRecord.code_value_name = obj[k].value;
datas.addChild(datasRecord.getData());
//println(datasRecord.code_value+":"+datasRecord.code_value_name);
//} else {
// println("2222"+obj[k].fieldCode);
//}
}
]]></s:server-script>
</a:init-procedure>
<a:view>
<script type="text/javascript"><![CDATA[
]]></script>
<a:dataSets >
</a:dataSets>
<a:screenBody>
<a:grid id="post_stru_para_ds_id" bindTarget="post_stur_json_ds" marginHeight="200" width="355" navBar="true">
<a:columns>
<a:column name="code_value" prompt="字段代码" width="150"/>
<a:column name="code_value_name" prompt="值内容" width="200"/>
</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 documentTypeCode = $ctx.parameter.documentTypeCode;
var file_path = $ctx.parameter.file_path;
var primaryField = $ctx.parameter.primaryField;
var file=new File(file_path);
var map = {
"documentTypeCode" : documentTypeCode,
"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 je_data_json_bm=$bm('efile.EFILE1040.efile_journal_clob_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 je_data_json_data = je_data_json_bm.queryAsMap({
e_archives_id: batch_data[i].e_archives_id,
document_id: batch_data[i].document_id,
workflow_id: batch_data[i].workflow_id
});
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='CF';
var ruleOID='';
var securityLevelCode='';
var fieldValueList=fieldValueList_data.getChildren()[0].fieldValueList;
var je_json_data=je_data_json_data.getChildren()[0].je_data_json;
logger.info(je_json_data);
//var je_json_data='[{"fieldCode":"PREPROCESS_CODE","value":"111"},{"fieldCode":"GL_CODE_ARRAY","value":"222"}]';
var je_json_data_result=JSON.parse(je_json_data);
logger.info(je_json_data_result[0].fieldCode);
var je_json_data1=je_json_data_result[0];
var je_json_data2=je_json_data_result[1];
var attlist=[];
var filelist=[];
if(fieldValueList.length==8){
filelist='[]';
}else{
fieldValueList=fieldValueList.substring(17);
fieldValueList=JSON.parse(fieldValueList);
if(batch_data[i].je_check_flag=='Y'){
fieldValueList.push(je_json_data1);
fieldValueList.push(je_json_data2);
}
fieldValueList=JSON.stringify(fieldValueList);
filelist.push(fieldValueList);
}
var attachmentList = fieldValueList_data.getChildren()[0].attachmentList;
attachmentList=attachmentList.replace('\s+', '');
if(attachmentList.length==8){
var fils = '{'
+'"companyCode": "'+companyCode
+'",'
+'"documentTypeCode": "'+documentTypeCode
+'",'
+'"originalNumber": "'+originalNumber
+'",'
+'"primaryField": "'+primaryField
+'",'
+'"isPaper": "'+isPaper
+'",'
+'"documentSource": "'+documentSource
+'",'
+'"ruleOID": "'+ruleOID
+'",'
+'"securityLevelCode": "'+securityLevelCode
+'",'
+'"fieldValueList": '+filelist
+'}';
fils=JSON.parse(fils);
doc_data.push(fils);
}else{
attachmentList=attachmentList.substring(17);
logger.info(attachmentList);
attachmentList=JSON.parse(attachmentList);
attachmentList=JSON.stringify(attachmentList);
attlist.push(attachmentList);
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 je_data_json_data = je_data_json_bm.queryAsMap({
e_archives_id: req_date[i].e_archives_id,
document_id: req_date[i].document_id,
workflow_id: req_date[i].workflow_id
});
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='CF';
var ruleOID='';
var securityLevelCode='';
var fieldValueList=fieldValueList_data.getChildren()[0].fieldValueList;
var je_json_data=je_data_json_data.getChildren()[0].je_data_json;
//var je_json_data='[{"fieldCode":"PREPROCESS_CODE","value":"111"},{"fieldCode":"GL_CODE_ARRAY","value":"222"}]';
var je_json_data_result=JSON.parse(je_json_data);
var je_json_data1=je_json_data_result[0];
var je_json_data2=je_json_data_result[1];
var attlist=[];
var filelist=[];
if(fieldValueList.length==8){
filelist='[]';
}else{
fieldValueList=fieldValueList.substring(17);
fieldValueList=JSON.parse(fieldValueList);
if(req_date[i].je_check_flag=='Y'){
fieldValueList.push(je_json_data1);
fieldValueList.push(je_json_data2);
}
fieldValueList=JSON.stringify(fieldValueList);
filelist.push(fieldValueList);
logger.info(filelist);
}
var attachmentList = fieldValueList_data.getChildren()[0].attachmentList;
attachmentList=attachmentList.replace('\s+', '');
if(attachmentList.length==8){
var fils = '{'
+'"companyCode": "'+companyCode
+'",'
+'"documentTypeCode": "'+documentTypeCode
+'",'
+'"originalNumber": "'+originalNumber
+'",'
+'"primaryField": "'+primaryField
+'",'
+'"isPaper": "'+isPaper
+'",'
+'"documentSource": "'+documentSource
+'",'
+'"ruleOID": "'+ruleOID
+'",'
+'"securityLevelCode": "'+securityLevelCode
+'",'
+'"fieldValueList": '+filelist
+'}';
fils=JSON.parse(fils);
doc_data.push(fils);
}else{
attachmentList=attachmentList.substring(17);
logger.info(attachmentList);
attachmentList=JSON.parse(attachmentList);
attachmentList=JSON.stringify(attachmentList);
attlist.push(attachmentList);
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:p="uncertain.proc" trace="true">
<a:init-procedure>
<p:echo></p:echo>
<a:model-insert model="hls.HLS536.submit_hls_journal_reverse" trace="true"/>
<a:batch-apply sourcepath="/parameter/details">
<a:model-update model="hls.HLS536.submit_hls_journal_reverse" trace="true"/>
</a:batch-apply>
<a:model-execute model="hls.HLS536.submit_hls_journal_reverse" trace="true"/>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" trace="true">
<a:init-procedure>
<!--lsc文件在日志中打印参数信息-->
<p:echo></p:echo>
<a:model-insert model="hls.HLS536.submit_hls_journal_tmp" trace="true"/>
<a:batch-apply sourcepath="/parameter/details">
<!--只要是 record 里面没有 被 改变 的 数字字段 ,没有 改变还是 数字类型的,但是 改变后 传到 后端是 String 类型 的 了 -->
<a:model-update model="hls.HLS536.submit_hls_journal_tmp" trace="true"/>
</a:batch-apply>
<a:model-execute model="hls.HLS536.submit_hls_journal_tmp" trace="true"/>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2022-11-9 上午10:30:00
$Revision: 1.0
$Purpose: 导入凭证模板修改
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" dynamiccreateenabled="true" trace="true">
<a:init-procedure><![CDATA[
]]></a:init-procedure>
<a:view>
<a:link id="get_period_name_id" model="csh.CSH511.csh_transaction_get_period_name" modelaction="query"/>
<a:link id="get_new_journal_num_link_id" model="hls.HLS530.get_new_journal_number" modelaction="update"/>
<a:link id="get_document_type_id" model="csh.CSH511.get_document_type" modelaction="update"/>
<script><![CDATA[
Leaf.onReady(function() {
if ('${/parameter/@maintain_type}' == 'READONLY') {
const btn_dom = document.getElementById('${/parameter/@layout_code}' + '_save');
btn_dom.remove();
}
});
window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function(ds, record) {
var journal_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_journal_header_imp');
var detail_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'JE_LN', 'hls_journal_detail_imp');
var journal_record = $(journal_ds_id).getAt(0);
var je_records = $(detail_ds_id).getAll();
var sum_dr = 0;
var sum_cr = 0;
for (var i=0;i<je_records.length;i++){
var je_record = je_records[i];
if(!isNaN(je_record.get('amount_dr'))){
sum_dr = (Number(sum_dr) + Number(je_record.get('amount_dr'))).toFixed(2);
}
if(!isNaN(je_record.get('amount_cr'))){
sum_cr = (Number(sum_cr) + Number(je_record.get('amount_cr'))).toFixed(2);
}
}
var check_flag = false;
if((sum_dr != sum_cr)&&(sum_dr != 0)){
Leaf.showMessage('提示','借贷总额必须相等');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}else{
journal_record.set('total_amount_dr', sum_dr);
journal_record.set('total_amount_cr', sum_dr);
journal_record.set('total_amount_fuc_dr', sum_dr);
journal_record.set('total_amount_fuc_cr', sum_dr);
if (journal_record.get('journal_num')) {
return true;
}
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('get_new_journal_num_link_id').getUrl(),
para: {
document_category: '${/parameter/@document_category}',
document_type: record.get('document_type')
},
success: function(res) {
var document_number = res.result.document_number;
journal_record.set('journal_num', document_number);
check_flag = true;
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
failure: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
sync: true,
scope: this
});
return check_flag;
}
};
window['${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'] = function(ds, record, res, bp_seq) {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
var detail1_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'JE_LN_REF1', 'hls_journal_detail_imp');
var header_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'JE_HD', 'hls_journal_header_imp');
$(detail1_ds_id).query();
var header_ds_record = $(header_ds_id).getAt(0);
var document_type = header_ds_record.get('document_type');
var journal_num = header_ds_record.get('journal_num');
if (!header_ds_record.get('post_gl_status')){
header_ds_record.set('post_gl_status', 'N');
}
header_ds_record.set('reversed_flag', 'N');
// if (name = 'document_type') {
// Leaf.request({
// url: $('get_document_type_id').getUrl(),
// para: {
// document_type: document_type,
// //journal_header_id: '${/parameter/@journal_header_id}',
// journal_num: journal_num
// },
// success: periodname,
// scope: this
// });
// }
};
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) {
if(name=='journal_date'){
var journal_date = record.get('journal_date');
journal_date = Leaf.formatDate(journal_date);
Leaf.request({
url: $('get_period_name_id').getUrl(),
para: {
p_date: journal_date
},
success: periodname,
scope: this
});
}else if(name=='amount_dr'){
record.set('amount_fuc_dr',value);
}else if(name=='amount_cr'){
record.set('amount_fuc_cr',value);
}
};
function periodname(res) {
var journal_ds_id1 = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_journal_header_imp');
var journal_record1 = $(journal_ds_id1).getAt(0);
if (res) {
var period_name = res.result.record.period_name;
var period_year = res.result.record.period_year;
var period_num = res.result.record.period_name.substring(5, 7);
var internal_period_num = res.result.record.internal_period_num;
var period_set_code = res.result.record.period_set_code;
journal_record1.set('period_name', period_name);
journal_record1.set('period_year', period_year);
journal_record1.set('period_num', period_num);
journal_record1.set('internal_period_num', internal_period_num);
journal_record1.set('period_set_code', period_set_code);
}
}
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function(ds, record, config_records, bp_seq) {
var bp_info_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_journal_header_imp');
if( Ext.isEmpty(record.get('journal_header_id'))){
record.set('je_company_id', 1);
record.set('je_company_id_n', '宏菱租赁');
record.set('currency_code', 'CNY');
record.set('currency_code_n', '人民币');
//record.set('je_transaction_code', 'MANUAL');
//record.set('je_transaction_code_n', '手工生成');
//record.set('post_gl_status', 'N');
if(!record.get('post_gl_status')){
record.set('post_gl_status', 'N');
}
record.set('exchange_rate', 1);
record.set('reversed_flag', 'N');
record.set('source_table', 'hls_journal_header_imp');
record.set('company_id', 1);
}
};
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2012-12-6 上午11:18:39
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
<a:init-procedure>
</a:init-procedure>
<a:view>
<a:link id="hls_journal_import_create_link_id" url="${/request/@context_path}/modules/hls/HLS536/hls_journal_import_create.lview"/>
<a:link id="welcome_link_id" url="${/request/@context_path}/welcome.lview"/>
<a:link id="hls_journal_con_contract_update_link_id" url="${/request/@context_path}/modules/cont/CON500/con_contract_update.lview"/>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:screen-include screen="modules/hls/hls_common_javascript.lview"/>
<!--<a:link id="hls_journal_import_link" url="${/request/@context_path}/modules/hls/HLS536/hls_journal_import_handle.lview"/>-->
<a:link id="hls_journal_import_link" url="${/request/@context_path}/modules/hls/HLS536/hls_journal_import_upload.lview"/>
<a:link id="hls_journal_submit_link_id" url="${/request/@context_path}/modules/hls/HLS536/batch_hls_journal_tmp.lsc"/>
<a:link id="hls_journal_reverse_link_id" url="${/request/@context_path}/modules/hls/HLS536/batch_hls_journal_reverse.lsc"/>
<a:link id="hls_journal_import_delete_link" model="hls.HLS536.hls_journal_import_delete"
modelaction="batch_update"/>
<a:link id="hls_journal_import_reverse_link" model="hls.HLS536.hls_journal_import_head_id"
modelaction="batch_update"/>
<a:link id="journal_attachment_uploadFile_id" url="${/request/@context_path}/downloadFile.lview"/>
<script><![CDATA[
Leaf.onReady(function() {
if ('${/session/@user_id}'!=10418 && '${/session/@user_id}'!=1) {
$('reverse_btn_id').hide();
$('reverse_submit_btn_id').hide();
}
});
//查询按钮
function hls536_journal_query() {
$('hls_journal_header_result_ds').query();
}
//重置按钮
function hls536_journal_reset() {
$('hls_journal_header_query').reset();
}
//退出按钮
function hls536_journal_exit() {
location.href = $('welcome_link_id').getUrl();
parent.shMenu('show');
}
function hls536_journal_import(){
new Leaf.Window({
id: 'hls_journal_import_handle_winid',
url: $('hls_journal_import_link').getUrl(),
title: '凭证模板导入',
width: 420,
height: 320
});
}
//删除凭证
function hls536_journal_delete(){
var records = $('hls_journal_header_result_ds').getSelected();
if(records.length == 0){
Leaf.showMessage('${l:PROMPT}', '请至少选择一条记录!');
return ;
}
var datas = [];
for (var i = 0; i < records.length; i++) {
if ((records[i].get('reversed_flag') == 'N'&&(records[i].get('wfl_status') == 'APPROVING' || records[i].get('wfl_status') == 'APPROVED'))||(records[i].get('reversed_flag') == 'R'&&(records[i].get('reverse_wfl_status') == 'APPROVING' || records[i].get('reverse_wfl_status') == 'APPROVED'))){
Leaf.showMessage('提示', '只有新建和拒绝状态的单据才能刪除!');
return;
}
var obj = {};
obj['journal_header_id'] = records[i].get('journal_header_id');
obj['_status'] = 'delete';
datas[i] = obj;
}
Leaf.request({
url: $('hls_journal_import_delete_link').getUrl(),
para: datas,
success: function () {
Leaf.SideBar.show({
msg: '操作成功',
duration: 2000
});
$('hls_journal_header_result_ds').query();
},
scope: this
});
}
// 提交审批
// 可以批量提交,批量提交审批的数据在一个工作流里面,有一个批次表 存 batch_id,这里要把批量提交的数据 update batch_id
function hls536_journal_send() {
var ds_id = 'hls_journal_header_result_ds';
var records = $(ds_id).getSelected();
if(records.length == 0){
Leaf.showMessage('${l:PROMPT}', '未选择!');
return ;
}
//审批中、审批通过的单据不可提交审批
for (let i = 0; i < records.length; i++) {
var record = records[i];
if (record.get('wfl_status') == 'APPROVING' || record.get('wfl_status') == 'APPROVED') {
Leaf.showMessage('提示', '审批中、审批通过的凭证不可提交审批!');
return;
}
if (!Ext.isEmpty(record.get('error_message'))){
Leaf.showMessage('提示', '凭证导入存在报错信息,不允许提交审批!');
return;
}
}
var journal_header_imp_list = [];
var journal_type_list = [];
//同一个模板的凭证才能批量提交
for (let i = 0; i < records.length; i++) {
var record = records[i];
//凭证模板类型
var journal_type = record.get('journal_type');
record.set('_status','update')
journal_header_imp_list.push(record.data);
journal_type_list.push(journal_type);
}
//普通工资和 BPO工资 共用一个 工资工作流,所以可以一起提交审批
var equal_flag = journal_type_list.every(val => val === journal_type_list[0]);
var is_salaries = journal_type_list.every(val => val === 'GENERAL_SALARIES' || val === 'BPO_SALARIES');
var check_flag = false;
if ((!equal_flag && is_salaries) || equal_flag){
check_flag = true;
}
if (!check_flag){
Leaf.showMessage('${l:PROMPT}', '同一个模板的凭证才能批量提交!');
return ;
}
var param = {};
param['details'] = journal_header_imp_list;
//判断要走哪个工作流
if (!equal_flag && is_salaries){
param['wfl_type'] = 'SALARIES';
}
if (equal_flag){
var journal_type = records[0].get('journal_type');
param['wfl_type'] = journal_type;
}
//当属于工资工作模板工作流的单条或多条凭证被提交时,wfl_type也要为 SALARIES
if(is_salaries){
param['wfl_type'] = 'SALARIES';
}
if ($(ds_id).validate()) {
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认提交审批?', function () {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
//先生成批次表数据,再update这几条数据的状态,最后提交工作流
Leaf.request({
url: $('hls_journal_submit_link_id').getUrl(),
para: param,
success: function (res) {
Leaf.Masker.unmask(Ext.getBody());
Leaf.showMessage('提示', '提交审批成功!');
// 审批成功后查询gird
hls536_journal_query();
},
failure: function () {
Leaf.Masker.unmask(Ext.getBody());
},
error: function () {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}, null);
}
}
//生成反冲数据,生成后数据可编辑
function hls536_journal_reverse(){
debugger;
var records = $('hls_journal_header_result_ds').getSelected();
if(records.length == 0){
Leaf.showMessage('${l:PROMPT}', '请至少选择一条记录!');
return ;
}
var datas = [];
for (var i = 0; i < records.length; i++) {
if (records[i].get('wfl_status') != 'APPROVED') {
Leaf.showMessage('提示', '凭证没有审批通过不能进行反冲,请检查!');
return;
}
if (records[i].get('reversed_flag') == 'R') {
Leaf.showMessage('提示', '存在已经反冲的凭证,请检查!');
return;
}
var obj = {};
obj['journal_header_id'] = records[i].get('journal_header_id');
obj['_status'] = 'execute';
datas[i] = obj;
}
Leaf.request({
url: $('hls_journal_import_reverse_link').getUrl(),
para: datas,
success: function () {
Leaf.SideBar.show({
msg: '操作成功',
duration: 2000
});
$('hls_journal_header_result_ds').query();
},
scope: this
});
}
//反冲提交流程
function hls536_journal_reverse_submit(){
var records = $('hls_journal_header_result_ds').getSelected();
if(records.length == 0){
Leaf.showMessage('${l:PROMPT}', '请至少选择一条记录!');
return ;
}
//凭证传输状态不为Y的不能进行反冲
for (var i = 0; i < records.length; i++) {
if (records[i].get('wfl_status') != 'APPROVED') {
Leaf.showMessage('提示', '凭证没有审批通过不能提交反冲审批,请检查!');
return;
}
if (records[i].get('reversed_flag') != 'R') {
Leaf.showMessage('提示', '非反冲数据不能提交反冲审批,请检查!');
return;
}
if (records[i].get('reversed_flag') == 'R' && (records[i].get('reverse_wfl_status') == 'APPROVING'||records[i].get('reverse_wfl_status') == 'APPROVED')) {
Leaf.showMessage('提示', '反冲审批中或审批通过的单据不能提交审批,请检查!');
return;
}
}
var journal_header_imp_list = [];
for (var i = 0; i < records.length; i++) {
var record = records[i];
record.set('_status','update')
journal_header_imp_list.push(record.data);
}
var param = {};
param['details'] = journal_header_imp_list;
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认提交审批?', function () {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
//先生成批次表数据,再update这几条数据的状态,最后提交工作流
Leaf.request({
url: $('hls_journal_reverse_link_id').getUrl(),
para: param,
success: function (res) {
Leaf.Masker.unmask(Ext.getBody());
Leaf.showMessage('提示', '提交审批成功!');
// 审批成功后查询gird
hls536_journal_query();
},
failure: function () {
Leaf.Masker.unmask(Ext.getBody());
},
error: function () {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}, null);
}
function hls536_link_dynamic(reocrd_id, journal_header_id) {
//增加逻辑:审批中、审批通过的只读;新建、审批拒绝的可编辑
var record = $('hls_journal_header_result_ds').findById(reocrd_id);
//if (record.get('wfl_status') == 'APPROVING' || record.get('wfl_status') == 'APPROVED'){
if((record.get('reversed_flag')=='N' && record.get('wfl_status') !='APPROVING' && record.get('wfl_status') != 'APPROVED') ||(record.get('reversed_flag')=='R' && record.get('reverse_wfl_status') != 'APPROVING' && record.get('reverse_wfl_status') != 'APPROVED')){
var maintain_type = 'UPDATE';
var param = record.data;
param['currency'] = param['currency_code'];
param['function_code'] = 'HLS536';
param['document_id'] = journal_header_id;
param['document_category'] = 'JE';
param['function_usage'] = 'MODIFY';
param['maintain_type'] = maintain_type;
param['url_title'] = '${l:HLS530.JOURNAL_LINE_MODIFY}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'hls_journal_import_create_link_id');
//}else if (record.get('wfl_status') == 'APPROVING' || record.get('wfl_status') == 'APPROVED'){
}else{
var maintain_type = 'READONLY';
var param = record.data;
param['currency'] = param['currency_code'];
param['function_code'] = 'HLS536';
param['document_id'] = journal_header_id;
param['document_category'] = 'JE';
param['function_usage'] = 'QUERY';
param['query_only'] = 'Y';
param['maintain_type'] = maintain_type;
param['url_title'] = '${l:HLS530.JOURNAL_LINE_MODIFY}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'hls_journal_import_create_link_id');
}
}
function hls536_journal_num_render(value, record, name) {
return '<a href="javascript:hls536_link_dynamic(' + record.id + ',' + record.get('journal_header_id') + ');">' + value + '</a>';
}
function receipt_attachment_upload(val,rec,name){
return '<a href=javascript:open_upload_window('+rec.get('journal_header_id')+')>附件</a>';
}
function open_upload_window(record_id){
var url = $('journal_attachment_uploadFile_id').getUrl() + '?table_name=HLS_JOURNAL_HEADER_IMP&header_id=' + record_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'attachment_uploadFile_id',
width: 850,
height: 400
});
win.on('close', function() {
hls536_journal_query();
});
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
<a:dataSet id="hls536_wfl_status_ds" lookupCode="HLS536_WFL_STATUS"/>
<a:dataSet id="hls536_reverse_wfl_status_ds" lookupCode="HLS536_WFL_STATUS_REVERSE"/>
<a:dataSet id="hls_journal_header_query">
<a:fields>
<a:field name="journal_num"/>
<a:field name="journal_date_from"/>
<a:field name="journal_date_to"/>
<a:field name="total_amount_dr_from"/>
<a:field name="total_amount_dr_to"/>
<a:field name="description"/>
<a:field name="wfl_status_n" displayField="code_value_name" options="hls536_wfl_status_ds" returnField="wfl_status" valueField="code_value"/>
<a:field name="wfl_status" />
<a:field name="reverse_wfl_status_n" displayField="code_value_name" options="hls536_reverse_wfl_status_ds" returnField="reverse_wfl_status" valueField="code_value"/>
<a:field name="reverse_wfl_status" />
</a:fields>
</a:dataSet>
<a:dataSet id="hls_journal_header_result_ds" autoPageSize="true" autoQuery="true" model="hls.HLS536.hls_journal_import_header" queryDataSet="hls_journal_header_query" selectable="true">
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:toolbarButton click="hls536_journal_exit" text="HLS.EXIT"/>
<a:toolbarButton click="hls536_journal_reset" text="HLS.RESET"/>
<a:toolbarButton click="hls536_journal_query" text="HLS.QUERY"/>
<a:toolbarButton click="hls536_journal_import" text="导入凭证模板"/>
<a:toolbarButton click="hls536_journal_delete" text="删除凭证"/>
<a:toolbarButton click="hls536_journal_send" text="提交审批"/>
<a:toolbarButton id="reverse_btn_id" click="hls536_journal_reverse" text="生成反冲"/>
<a:toolbarButton id="reverse_submit_btn_id" click="hls536_journal_reverse_submit" text="提交反冲"/>
</a:screenTopToolbar>
<a:form column="5" labelSeparator=" " labelWidth="100" marginWidth="40" title="HAP_QUERY_TITLE">
<a:textField name="journal_num" bindTarget="hls_journal_header_query" prompt="凭证编号"/>
<a:datePicker name="journal_date_from" bindTarget="hls_journal_header_query" prompt="凭证日期从"/>
<a:datePicker name="journal_date_to" bindTarget="hls_journal_header_query" prompt="凭证日期到"/>
<a:numberField name="total_amount_dr_from" allowFormat="true" bindTarget="hls_journal_header_query" prompt="金额从"/>
<a:numberField name="total_amount_dr_to" allowFormat="true" bindTarget="hls_journal_header_query" prompt="金额到"/>
<a:textField name="description" bindTarget="hls_journal_header_query" prompt="凭证摘要"/>
<a:comboBox name="wfl_status_n" bindTarget="hls_journal_header_query" prompt="凭证导入状态"/>
<a:comboBox name="reverse_wfl_status_n" bindTarget="hls_journal_header_query" prompt="凭证反冲状态"/>
</a:form>
<a:grid id="hls_journal_headers_grid" bindTarget="hls_journal_header_result_ds" marginHeight="250" marginWidth="40" navBar="true">
<a:columns>
<a:column name="journal_num" lock="true" prompt="凭证编号" renderer="hls536_journal_num_render" width="120"/>
<a:column name="js_company_short_name" prompt="记账公司" width="90"/>
<a:column name="period_name" align="center" prompt="期间" width="80"/>
<a:column name="journal_date" align="center" prompt="凭证日期" renderer="Leaf.formatDate" width="90"/>
<a:column name="currency_desc" align="center" prompt="币种" width="80"/>
<a:column name="total_amount_fuc_dr" align="right" prompt="金额" renderer="Leaf.formatMoney" width="120"/>
<a:column name="description" prompt="凭证摘要" width="220"/>
<a:column name="je_detail_count" prompt="凭证行数量" width="50"/>
<a:column name="wfl_status_n" prompt="凭证导入状态" width="100"/>
<a:column name="reverse_wfl_status_n" prompt="凭证反冲状态" width="100"/>
<a:column name="error_message" prompt="错误信息" width="150"/>
<a:column name="attachment_file" prompt="附件" width="120" renderer="receipt_attachment_upload" align="center"/>
</a:columns>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2012-12-6 上午11:18:39
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
<a:init-procedure>
</a:init-procedure>
<a:view>
<a:link id="hls_journal_import_create_link_id" url="${/request/@context_path}/modules/hls/HLS536/hls_journal_import_create.lview"/>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="journal_attachment_uploadFile_id" url="${/request/@context_path}/downloadFile.lview"/>
<a:screen-include screen="modules/hls/hls_common_javascript.lview"/>
<script><![CDATA[
Leaf.onReady(function () {
$('hls_journal_header_result_ds').setQueryParameter('journal_submit_batch_id','${/parameter/@journal_submit_batch_id}');
})
//查询按钮
function hls536_journal_query() {
$('hls_journal_header_result_ds').setQueryParameter('journal_submit_batch_id','${/parameter/@journal_submit_batch_id}');
$('hls_journal_header_result_ds').query();
}
//重置按钮
function hls536_journal_reset() {
$('hls_journal_header_query').reset();
}
// 审批流程中,叶唯吟节点可编辑页面
function hls536_link_dynamic(reocrd_id, journal_header_id) {
var record = $('hls_journal_header_result_ds').findById(reocrd_id);
var param = record.data;
param['currency'] = param['currency_code'];
param['function_code'] = 'HLS536';
param['document_id'] = journal_header_id;
param['document_category'] = 'JE';
var edit_flag = '${/parameter/@edit_flag}';
if(edit_flag == 'Y' ){
param['function_usage'] = 'MODIFY';
param['maintain_type'] = 'UPDATE';
}else {
param['function_usage'] = 'QUERY';
param['maintain_type'] = 'READONLY';
}
param['url_title'] = '${l:HLS530.JOURNAL_LINE_MODIFY}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'hls_journal_import_create_link_id');
}
function hls536_journal_num_render(value, record, name) {
return '<a href="javascript:hls536_link_dynamic(' + record.id + ',' + record.get('journal_header_id') + ');">' + value + '</a>';
}
function receipt_attachment_upload(val,rec,name){
return '<a href=javascript:open_upload_window('+rec.get('journal_header_id')+')>附件</a>';
}
function open_upload_window(record_id){
var url = $('journal_attachment_uploadFile_id').getUrl() + '?table_name=HLS_JOURNAL_HEADER_IMP&header_id=' + record_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'attachment_uploadFile_id',
width: 850,
height: 400
});
win.on('close', function() {
hls536_journal_query();
});
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
<a:dataSet id="hls536_wfl_status_ds" lookupCode="HLS536_WFL_STATUS"/>
<a:dataSet id="hls_journal_header_query">
<a:fields>
<a:field name="journal_num"/>
<a:field name="journal_date_from"/>
<a:field name="journal_date_to"/>
<a:field name="total_amount_dr_from"/>
<a:field name="total_amount_dr_to"/>
<a:field name="description"/>
<a:field name="wfl_status_n" displayField="code_value_name" options="hls536_wfl_status_ds" returnField="wfl_status" valueField="code_value"/>
<a:field name="wfl_status" />
</a:fields>
</a:dataSet>
<a:dataSet id="hls_journal_header_result_ds" autoPageSize="true" autoQuery="true" model="hls.HLS536.hls_journal_import_reverse_wfl" queryDataSet="hls_journal_header_query" selectable="true" queryUrl="${/request/@context_path}/autocrud/hls.HLS536.hls_journal_import_reverse_wfl/query?journal_reverse_batch_id=${/parameter/@journal_submit_batch_id}">
>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:toolbarButton click="hls536_journal_query" text="HLS.QUERY"/>
<a:toolbarButton click="hls536_journal_reset" text="HLS.RESET"/>
</a:screenTopToolbar>
<a:form column="5" labelSeparator=" " labelWidth="100" marginWidth="40" title="HAP_QUERY_TITLE">
<a:textField name="journal_num" bindTarget="hls_journal_header_query" prompt="凭证编号"/>
<a:datePicker name="journal_date_from" bindTarget="hls_journal_header_query" prompt="凭证日期从"/>
<a:datePicker name="journal_date_to" bindTarget="hls_journal_header_query" prompt="凭证日期到"/>
<a:numberField name="total_amount_dr_from" allowFormat="true" bindTarget="hls_journal_header_query" prompt="金额从"/>
<a:numberField name="total_amount_dr_to" allowFormat="true" bindTarget="hls_journal_header_query" prompt="金额到"/>
<a:textField name="description" bindTarget="hls_journal_header_query" prompt="凭证摘要"/>
<a:comboBox name="wfl_status_n" bindTarget="hls_journal_header_query" prompt="凭证导入状态"/>
</a:form>
<a:grid id="hls_journal_headers_grid" bindTarget="hls_journal_header_result_ds" marginHeight="250" marginWidth="40" navBar="true">
<a:columns>
<a:column name="journal_num" lock="true" prompt="凭证编号" renderer="hls536_journal_num_render" width="120"/>
<a:column name="js_company_short_name" prompt="记账公司" width="90"/>
<a:column name="period_name" align="center" prompt="期间" width="80"/>
<a:column name="journal_date" align="center" prompt="凭证日期" renderer="Leaf.formatDate" width="90"/>
<a:column name="currency_desc" align="center" prompt="币种" width="80"/>
<a:column name="total_amount_fuc_dr" align="right" prompt="金额" renderer="Leaf.formatMoney" width="120"/>
<a:column name="description" prompt="凭证摘要" width="220"/>
<a:column name="je_detail_count" prompt="凭证行数量" width="50"/>
<!--<a:column name="wfl_status_n" prompt="凭证导入状态" width="100"/>-->
<a:column name="reverse_wfl_status_n" prompt="凭证反冲状态" width="100"/>
<!--<a:column name="error_message" prompt="错误信息" width="150"/>-->
<!--<a:column name="attachment_file" prompt="附件" width="120" renderer="receipt_attachment_upload" align="center"/>-->
</a:columns>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">-->
<a:screen xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure >
<!--<a:model-execute model="hls.HLS536.delete_hls_journal_tmp"/>-->
<a:model-query model="hls.HLS536.hls_journal_import_head_id" rootPath="header"/>
<a:import-excel header_id="${/model/header/record/@header_id}" attribute5="D:\u01\hls_journal,fnd_interface_headers,${/model/header/record/@header_id}" separator="," status_field="/parameter/@ImportSuccess" template_code="HLS_JOURNAL_IMPORT" user_id="${/session/@user_id}" />
<!--<a:import-excel header_id="${/session/@session_id}" attribute5="D:\u01,fnd_interface_headers,${/session/@session_id}" separator="," status_field="/parameter/@ImportSuccess" template_code="HLS_JOURNAL_IMPORT" user_id="${/session/@user_id}" />-->
<a:model-execute model="hls.HLS536.insert_hls_journal_tmp"/>
</a:init-procedure>
<a:view>
<a:link id="hls_journal_entrance_import_link" url="${/request/@context_path}/modules/hls/HLS536/hls_journal_import_entrance.lview"/>
<script type="text/javascript"><![CDATA[
window.location.href = $('hls_journal_entrance_import_link').getUrl();
]]></script>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--<a:screen xmlns:a="http://www.leaf-framework.org/application">-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
<a:init-procedure>
<a:model-query fetchAll="true" model="hls.HLS536.hls_journal_position_query" rootPath="hls536_position_code"/>
</a:init-procedure>
<a:view>
<script type="text/javascript"><![CDATA[
function saveClick() {
if (!$('template_ds').validate()) {
return;
}
var templatetype = $('template_ds').getAt(0).get('template_type');
if (document.getElementById('importFile').value) {
var fileName = document.getElementById('importFile').value;
var fileType = fileName.substr(fileName.lastIndexOf("."));
fileType = fileType.toLowerCase();
if (fileType != '.xls'&&fileType != '.xlsx') {
alert('请选择正确的导入文件!请使用xls或者xlsx后缀的文件');
} else {
doSubmit(templatetype);
//document.getElementById('importForm').submit();
}
}
}
function doSubmit(templatetype) {
var form = document.getElementById('importForm');
var url = '${/request/@context_path}/modules/hls/HLS536/hls_journal_import_trans_upload.lview?_csrf=${/session/@_csrf.token}&template_type='+templatetype;
form.action = url;
form.submit();
}
]]></script>
<a:dataSets>
<a:dataSet id="template_type_desc_ds" autoCreate="true">
<a:datas>
<a:record code_value="GENERAL_SALARIES" code_value_name="普通工资导入模板"/>
<a:record code_value="BPO_SALARIES" code_value_name="BPO工资导入模板"/>
<a:record code_value="COST_IMPORT" code_value_name="成本导入模板"/>
<a:record code_value="FUND_POOL" code_value_name="资金池导入模板"/>
<a:record code_value="GLOBAL_TEMPLATE" code_value_name="通用模板"/>
<a:record code_value="FINANCIAL_TEMPLATE" code_value_name="财务模板"/>
</a:datas>
</a:dataSet>
<a:dataSet id="template_type_desc_ds1" autoCreate="true">
<a:datas>
<a:record code_value="GENERAL_SALARIES" code_value_name="普通工资导入模板"/>
<a:record code_value="BPO_SALARIES" code_value_name="BPO工资导入模板"/>
</a:datas>
</a:dataSet>
<a:dataSet id="template_type_desc_ds2" autoCreate="true">
<a:datas>
<a:record code_value="COST_IMPORT" code_value_name="成本导入模板"/>
<a:record code_value="GLOBAL_TEMPLATE" code_value_name="通用模板"/>
</a:datas>
</a:dataSet>
<a:dataSet id="template_type_desc_ds3" autoCreate="true">
<a:datas>
<a:record code_value="FUND_POOL" code_value_name="资金池导入模板"/>
<a:record code_value="FINANCIAL_TEMPLATE" code_value_name="财务模板"/>
</a:datas>
</a:dataSet>
<a:switch test="/model/hls536_position_code/record/@position_code">
<a:case value="026">
<a:dataSet id="template_ds" autoCreate="true">
<a:fields>
<a:field name="template_type_desc" displayField="code_value_name" options="template_type_desc_ds1"
returnField="template_type" valueField="code_value" required="true"/>
<a:field name="template_type"/>
</a:fields>
</a:dataSet>
</a:case>
<a:case value="014">
<a:dataSet id="template_ds" autoCreate="true">
<a:fields>
<a:field name="template_type_desc" displayField="code_value_name" options="template_type_desc_ds2"
returnField="template_type" valueField="code_value" required="true"/>
<a:field name="template_type"/>
</a:fields>
</a:dataSet>
</a:case>
<a:case value="012">
<a:dataSet id="template_ds" autoCreate="true">
<a:fields>
<a:field name="template_type_desc" displayField="code_value_name" options="template_type_desc_ds3"
returnField="template_type" valueField="code_value" required="true"/>
<a:field name="template_type"/>
</a:fields>
</a:dataSet>
</a:case>
<a:case value="017">
<a:dataSet id="template_ds" autoCreate="true">
<a:fields>
<a:field name="template_type_desc" displayField="code_value_name" options="template_type_desc_ds"
returnField="template_type" valueField="code_value" required="true"/>
<a:field name="template_type"/>
</a:fields>
</a:dataSet>
</a:case>
</a:switch>
<a:dataSet id="label_ds" autoCreate="true">
<a:fields>
<a:field name="label2" defaultValue="1、 严格按照导入模板整理数据,检查必输事项是否缺少数据。"/>
<a:field name="label3" defaultValue="2、 关闭Excel文件后,方可进行产品主数据导入。"/>
<a:field name="label4" defaultValue="3、 本导入程序只支持Office Excel。"/>
<a:field name="label5" defaultValue="仔细阅读上述事项,并检查确认无误。"/>
<a:field name="label6" defaultValue="导入完毕后,请在系统内核实数据是否导入成功。"/>
</a:fields>
</a:dataSet>
</a:dataSets>
<a:fieldSet style="margin-left:10px;margin-top:10px;" title="导入注意事项" width="400">
<a:label name="label2" bindTarget="label_ds" style="margin-left:10px;" width="380"/>
<a:label name="label3" bindTarget="label_ds" style="margin-left:10px;" width="380"/>
<a:label name="label4" bindTarget="label_ds" style="margin-left:10px;" width="380"/>
<a:label name="label5" bindTarget="label_ds" style="color:#055A78;font-weight:bold;margin-left:10px;" width="380"/>
<a:label name="label6" bindTarget="label_ds" style="color:#055A78;font-weight:bold;margin-left:10px;" width="380"/>
</a:fieldSet>
<a:fieldSet style="margin-left:10px;margin-top:10px;" title="选择模板" width="400">
<a:comboBox name="template_type_desc" bindTarget="template_ds" prompt="模板类型"/>
</a:fieldSet>
<a:fieldSet style="margin-left:10px;margin-top:10px;" title="导入文件" width="400">
<form name="upload" id="importForm" action="hls_journal_import_trans_upload.lview?session_id=${/parameter/@session_id}&amp;template_type=${/parameter/@template_type}&amp;parent_ds_id=${/parameter/@parent_ds_id}&amp;_csrf=${/session/@_csrf.token}" enctype="multipart/form-data" method="post">
<label style="margin-left:10px;margin-top:10px;"><![CDATA[请选择文件:]]></label>
<input name="CONTENT" id="importFile" style="margin-bottom:4px;width:160px;height:22px;" type="file"/>
<input onclick="saveClick()" style="margin-left:10px;margin-top:10px;width:60px;" type="button" value="导入"/>
</form>
</a:fieldSet>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2012-12-6 上午11:18:39
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
<a:init-procedure>
</a:init-procedure>
<a:view>
<a:link id="hls_journal_import_create_link_id" url="${/request/@context_path}/modules/hls/HLS536/hls_journal_import_create.lview"/>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="journal_attachment_uploadFile_id" url="${/request/@context_path}/downloadFile.lview"/>
<a:screen-include screen="modules/hls/hls_common_javascript.lview"/>
<script><![CDATA[
Leaf.onReady(function () {
$('hls_journal_header_result_ds').setQueryParameter('journal_submit_batch_id','${/parameter/@journal_submit_batch_id}');
})
//查询按钮
function hls536_journal_query() {
$('hls_journal_header_result_ds').setQueryParameter('journal_submit_batch_id','${/parameter/@journal_submit_batch_id}');
$('hls_journal_header_result_ds').query();
}
//重置按钮
function hls536_journal_reset() {
$('hls_journal_header_query').reset();
}
// 审批流程中,叶唯吟节点可编辑页面
function hls536_link_dynamic(reocrd_id, journal_header_id) {
var record = $('hls_journal_header_result_ds').findById(reocrd_id);
var param = record.data;
param['currency'] = param['currency_code'];
param['function_code'] = 'HLS536';
param['document_id'] = journal_header_id;
param['document_category'] = 'JE';
var edit_flag = '${/parameter/@edit_flag}';
if(edit_flag == 'Y' ){
param['function_usage'] = 'MODIFY';
param['maintain_type'] = 'UPDATE';
}else {
param['function_usage'] = 'QUERY';
param['maintain_type'] = 'READONLY';
}
param['url_title'] = '${l:HLS530.JOURNAL_LINE_MODIFY}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'hls_journal_import_create_link_id');
}
function hls536_journal_num_render(value, record, name) {
return '<a href="javascript:hls536_link_dynamic(' + record.id + ',' + record.get('journal_header_id') + ');">' + value + '</a>';
}
function receipt_attachment_upload(val,rec,name){
return '<a href=javascript:open_upload_window('+rec.get('journal_header_id')+')>附件</a>';
}
function open_upload_window(record_id){
var url = $('journal_attachment_uploadFile_id').getUrl() + '?table_name=HLS_JOURNAL_HEADER_IMP&header_id=' + record_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'attachment_uploadFile_id',
width: 850,
height: 400
});
win.on('close', function() {
hls536_journal_query();
});
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
<a:dataSet id="hls536_wfl_status_ds" lookupCode="HLS536_WFL_STATUS"/>
<a:dataSet id="hls536_reverse_wfl_status_ds" lookupCode="HLS536_WFL_STATUS_REVERSE"/>
<a:dataSet id="hls_journal_header_query">
<a:fields>
<a:field name="journal_num"/>
<a:field name="journal_date_from"/>
<a:field name="journal_date_to"/>
<a:field name="total_amount_dr_from"/>
<a:field name="total_amount_dr_to"/>
<a:field name="description"/>
<a:field name="wfl_status_n" displayField="code_value_name" options="hls536_wfl_status_ds" returnField="wfl_status" valueField="code_value"/>
<a:field name="wfl_status" />
<a:field name="reverse_wfl_status_n" displayField="code_value_name" options="hls536_reverse_wfl_status_ds" returnField="reverse_wfl_status" valueField="code_value"/>
<a:field name="reverse_wfl_status" />
</a:fields>
</a:dataSet>
<a:dataSet id="hls_journal_header_result_ds" autoPageSize="true" autoQuery="true" model="hls.HLS536.hls_journal_import_header_wfl" queryDataSet="hls_journal_header_query" selectable="true">
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:toolbarButton click="hls536_journal_query" text="HLS.QUERY"/>
<a:toolbarButton click="hls536_journal_reset" text="HLS.RESET"/>
</a:screenTopToolbar>
<a:form column="5" labelSeparator=" " labelWidth="100" marginWidth="40" title="HAP_QUERY_TITLE">
<a:textField name="journal_num" bindTarget="hls_journal_header_query" prompt="凭证编号"/>
<a:datePicker name="journal_date_from" bindTarget="hls_journal_header_query" prompt="凭证日期从"/>
<a:datePicker name="journal_date_to" bindTarget="hls_journal_header_query" prompt="凭证日期到"/>
<a:numberField name="total_amount_dr_from" allowFormat="true" bindTarget="hls_journal_header_query" prompt="金额从"/>
<a:numberField name="total_amount_dr_to" allowFormat="true" bindTarget="hls_journal_header_query" prompt="金额到"/>
<a:textField name="description" bindTarget="hls_journal_header_query" prompt="凭证摘要"/>
<a:comboBox name="wfl_status_n" bindTarget="hls_journal_header_query" prompt="凭证导入状态"/>
<a:comboBox name="reverse_wfl_status_n" bindTarget="hls_journal_header_query" prompt="凭证反冲状态"/>
</a:form>
<a:grid id="hls_journal_headers_grid" bindTarget="hls_journal_header_result_ds" marginHeight="250" marginWidth="40" navBar="true">
<a:columns>
<a:column name="journal_num" lock="true" prompt="凭证编号" renderer="hls536_journal_num_render" width="120"/>
<a:column name="js_company_short_name" prompt="记账公司" width="90"/>
<a:column name="period_name" align="center" prompt="期间" width="80"/>
<a:column name="journal_date" align="center" prompt="凭证日期" renderer="Leaf.formatDate" width="90"/>
<a:column name="currency_desc" align="center" prompt="币种" width="80"/>
<a:column name="total_amount_fuc_dr" align="right" prompt="金额" renderer="Leaf.formatMoney" width="120"/>
<a:column name="description" prompt="凭证摘要" width="220"/>
<a:column name="je_detail_count" prompt="凭证行数量" width="50"/>
<a:column name="wfl_status_n" prompt="凭证导入状态" width="100"/>
<a:column name="reverse_wfl_status_n" prompt="凭证反冲状态" width="100"/>
<a:column name="error_message" prompt="错误信息" width="150"/>
<a:column name="attachment_file" prompt="附件" width="120" renderer="receipt_attachment_upload" align="center"/>
</a:columns>
</a:grid>
</a:screenBody>
</a:view>
</a:screen>
<?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