Commit ffb0567f authored by niminmin's avatar niminmin

[feat]合同文本报表开发

parent 94517bd1
......@@ -185,125 +185,8 @@
FROM
CON_CONTRACT_CONTENT_V t1
WHERE
t1.templet_code !='GH_WITHHOLD_AGREE'
UNION ALL
SELECT
t1.content_id,
t1.contract_id,
t1.con_contract_bp_id,
t1.mortgage_id,
t1.content_number,
t1.content_print_flag,
t1.content_print_flag_name,
t1.bp_category,
t1.bp_category_desc,
t1.bp_class,
t1.bp_class_desc,
t1.bp_id,
t1.bp_name,
t1.available_flag,
t1.employee_id_witness_name,
t1.sign_date,
t1.sign_place,
t1.signer_opposite_side,
t1.notary,
t1.templet_id,
t1.templet_code,
t1.templet_name,
t1.templet_usage,
t1.clause_usage,
t1.clause_usage_name,
t1.ref_v01,
t1.ref_v02,
t1.ref_v03,
t1.ref_v04,
t1.ref_v05,
t1.ref_n01,
t1.ref_n02,
t1.ref_n03,
t1.ref_n04,
t1.ref_n05,
t1.ref_d01,
t1.ref_d02,
t1.ref_d03,
t1.ref_d04,
t1.ref_d05,
t1.couple_guarantee_flag,
(SELECT
COUNT(1)
FROM
fnd_atm_attachment_multi m
WHERE
m.table_name = 'CON_CONTRACT_CONTENT_WORKFLOW' AND
m.table_pk_value = TO_CHAR(t1.content_id)
) AS attach_count,
(SELECT
'Y'
FROM
fnd_atm_attachment_multi m1
WHERE
m1.table_name = 'CON_CONTRACT_CONTENT' AND
m1.table_pk_value = t1.content_id
) AS file_exists_flag,
CASE
WHEN (SELECT COUNT(*)
FROM con_contract_signature s
WHERE s.content_id = t1.content_id
AND s.status = 2) >= 1 THEN
'2'
WHEN (SELECT COUNT(*)
FROM con_contract_signature s
WHERE s.content_id = t1.content_id
AND s.status = 3) >= 1 THEN
'3'
WHEN (SELECT COUNT(*)
FROM con_contract_signature s
WHERE s.content_id = t1.content_id
AND s.status = 4) >= 1 THEN
'4'
WHEN (SELECT COUNT(*)
FROM con_contract_signature s
WHERE s.content_id = t1.content_id
AND s.status = 5) >= 1 THEN
'5'
ELSE
'1'
END AS status,
CASE
WHEN (SELECT COUNT(*)
FROM con_contract_signature s
WHERE s.content_id = t1.content_id
AND s.status = 2) >= 1 THEN
'部分签署'
WHEN (SELECT COUNT(*)
FROM con_contract_signature s
WHERE s.content_id = t1.content_id
AND s.status = 3) >= 1 THEN
'全部签署'
WHEN (SELECT COUNT(*)
FROM con_contract_signature s
WHERE s.content_id = t1.content_id
AND s.status = 4) >= 1 THEN
'已盖章'
WHEN (SELECT COUNT(*)
FROM con_contract_signature s
WHERE s.content_id = t1.content_id
AND s.status = 5) >= 1 THEN
'已拒绝'
ELSE
'未签署'
END AS status_desc,
(SELECT COUNT(*) FROM con_contract_signature s WHERE s.content_id = t1.content_id AND s.status = 4)download_flag,
t1.agent_content_flag,
t1.download_content_flag,
t1.agent_content_flag_name,
t1.download_content_flag_name,
t1.print_date
FROM
CON_CONTRACT_CONTENT_V t1
WHERE
t1.templet_code='GH_WITHHOLD_AGREE'
AND NVL(t1.withhold_way,'0') = 'SPD')t
t1.templet_usage in ('CON_SALE', 'CONTRACT')
)t
#WHERE_CLAUSE#
ORDER BY decode(t.bp_category,'TENANT',0,'GUARANTOR',1,'VENDER',2,'')
]]></bm:query-sql>
......
......@@ -49,6 +49,7 @@
m.table_pk_value = lt.templet_id AND
lt.templet_id = t.doc_template_id AND
t.doc_plugin_flag = 'Y' AND
t.templet_usage in ('CON_SALE', 'CONTRACT') and
t.templet_id = cc.templet_id AND
(
cc.content_id =${/parameter/@content_id} OR
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: gaoyang
$Date: 2015-6-10 下午03:17:55
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT
faa.file_name,
faa.file_path,
faa.file_type_code,
(select 'Y' from dual where exists (SELECT
1
FROM
fnd_atm_attachment_multi m1
WHERE
m1.table_name = 'CON_CONTRACT_CONTENT' AND
m1.table_pk_value = cc.content_id)
) file_exists_flag,
cc.content_number
||'-'
||cc.bp_name
||'-'
||
(SELECT
t.project_number
FROM
con_contract ct,
prj_project t
WHERE
t.project_id = ct.project_id AND
ct.contract_id = cc.contract_id
) to_file_name,
lt.pwd,
cc.content_id
FROM
fnd_atm_attachment faa,
fnd_atm_attachment_multi m,
hls_doc_file_templet lt,
con_clause_templet t,
con_contract_content_v cc
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.templet_code=${/parameter/@templet_code} and
t.doc_plugin_flag = 'Y' AND
t.templet_id = cc.templet_id AND
(
cc.content_id =${/parameter/@content_id} OR
(
cc.contract_id =${/parameter/@contract_id} AND
${/parameter/@batch_flag}='Y'
)
)
]]></bm:query-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="file_exists_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_EXISTS_FLAG"/>
<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="content_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTENT_ID"/>
</bm:fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: WangYu
$Date: 2014-4-25 上午09:30:21
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select t.*,
m.bp_name bp_id_agent_level1_n,
(select m.bp_code from hls_bp_master m where m.bp_id = t.bp_id) bp_code,
(select contract_number from con_contract where contract_id=t.contract_id) contract_number,
g.account_code account_id_n,
(select description_text from fnd_descriptions where description_id = g.description_id and language = 'ZHS' ) account_name
from con_cashflow_monthly_temp t,hls_bp_master m,gld_accounts g
where m.bp_id = t.agent_bp_id
and g.account_id = t.account_id
and t.session_id = ${/session/@session_id}
order by t.contract_id desc,g.account_code
]]></bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
con_cashflow_monthly_pkg.insert_con_cash_temp(
p_session_id =>${/session/@session_id},
p_due_date =>to_date(${@due_date},'yyyy-mm-dd'),
p_user_id =>${/session/@user_id},
p_bp_id =>${@bp_id},
p_overday1 =>${@overday1},
p_overday2 =>${@overday2},
p_overday3 =>${@overday3},
p_not_overday1 =>${@not_overday1},
p_not_overday2 =>${@not_overday2},
p_not_overday3 =>${@not_overday3},
p_not_overday4 =>${@not_overday4},
p_not_overday5 =>${@not_overday5},
p_not_overday6 =>${@not_overday6});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="contract_id"/>
<bm:field name="bp_code"/>
<bm:field name="contract_number"/>
<bm:field name="bp_id_agent_level1_n"/>
<bm:field name="account_id_n"/>
<bm:field name="account_name"/>
<bm:field name="unreceived_sum_amount"/>
<bm:field name="overdue_amount_1"/>
<bm:field name="overdue_amount_2"/>
<bm:field name="overdue_amount_3"/>
<bm:field name="overdue_amount_left"/>
<bm:field name="overdue_sum_amount"/>
<bm:field name="not_due_sum_amount"/>
<bm:field name="not_due_amount_1"/>
<bm:field name="not_due_amount_2"/>
<bm:field name="not_due_amount_3"/>
<bm:field name="not_due_amount_4"/>
<bm:field name="not_due_amount_5"/>
<bm:field name="not_due_amount_6"/>
<bm:field name="not_due_amount_left"/>
</bm:fields>
<!-- <bm:query-fields>-->
<!-- <bm:query-field field="bp_id_tenant_n" queryExpression="t1.bp_id_tenant_n = ${@bp_id_tenant_n}"/>-->
<!-- <bm:query-field field="account_name" queryExpression="t1.account_name = ${@account_name}"/>-->
<!-- <bm:query-field field="account_id_n" queryExpression="t1.account_id_n = ${@account_id_n}"/>-->
<!-- </bm:query-fields>-->
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: qwm
$Date: 2013-6-20 上午10:06:11
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:fields>
<bm:field name="account_id_n"/>
<bm:field name="account_name"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT
g.account_code account_id_n,
g.account_desc account_name,
g.account_id account_id
FROM
gld_accounts_v g #WHERE_CLAUSE#
WHERE
g.account_code IN ('1531000300', '1531000301', '1532000300') AND
g.ref_v01 IS NULL
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="account_id_n" queryOperator="="/>
<bm:query-field name="account_name" queryOperator="="/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
r<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
......
......@@ -36,6 +36,8 @@
m.table_pk_value = lt.templet_id AND
lt.templet_id = t.doc_template_id AND
t.doc_plugin_flag = 'Y' AND
t.templet_code=${/parameter/@templet_code}
and
pp.project_id = p.project_id AND
t.templet_id = pp.templet_id AND
(pp.content_id =${/parameter/@content_id} OR
......
......@@ -11,16 +11,16 @@ select to_number(to_char(add_months(sysdate, -1), 'YYYYMM')) value_code,
to_char(add_months(sysdate, -1), 'YYYY') || '年' ||
to_char(add_months(sysdate, -1), 'MM') || '月' value_name
from dual
union
select to_number(to_char(add_months(sysdate, -2), 'YYYYMM')) value_code,
to_char(add_months(sysdate, -2), 'YYYY') || '年' ||
to_char(add_months(sysdate, -2), 'MM') || '月' value_name
from dual
union
select to_number(to_char(add_months(sysdate, -3), 'YYYYMM')) value_code,
to_char(add_months(sysdate, -3), 'YYYY') || '年' ||
to_char(add_months(sysdate, -3), 'MM') || '月' value_name
from dual
--union
--select to_number(to_char(add_months(sysdate, -2), 'YYYYMM')) value_code,
-- to_char(add_months(sysdate, -2), 'YYYY') || '年' ||
-- to_char(add_months(sysdate, -2), 'MM') || '月' value_name
-- from dual
--union
--select to_number(to_char(add_months(sysdate, -3), 'YYYYMM')) value_code,
-- to_char(add_months(sysdate, -3), 'YYYY') || '年' ||
-- to_char(add_months(sysdate, -3), 'MM') || '月' value_name
-- from dual
order by value_code desc
]]></bm:query-sql>
</bm:operation>
......
<?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
v.code_value,
v.code_value_name
FROM
sys_code_values_v v
WHERE
v.code = ${@hn_industry_classification} AND -- IN ('WITHIN_GROUP', 'MARKETIZATION')
v.code_enabled_flag = 'Y' AND
v.code_value_enabled_flag = 'Y'
ORDER BY
v.code
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="code_value" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CODE_VALUE"/>
<bm:field name="code_value_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CODE_VALUE_NAME"/>
</bm: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
v.business_type,
v.description
FROM
hls_business_type_v v
WHERE
v.business_type IN
(SELECT cc.business_type FROM con_contract cc WHERE cc.data_class = 'NORMAL'
)
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="business_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BUSINESS_TYPE"/>
<bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DESCRIPTION"/>
</bm:fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT to_char(to_date(month||'01','YYYYMMDD'),'YYYY-MM-DD') AS DAY_1,
to_char(to_date(month||'01','YYYYMMDD') +1,'YYYY-MM-DD') AS DAY_2,
to_char(to_date(month||'01','YYYYMMDD') +2,'YYYY-MM-DD') AS DAY_3,
to_char(to_date(month||'01','YYYYMMDD') +3,'YYYY-MM-DD') AS DAY_4,
to_char(to_date(month||'01','YYYYMMDD') +4,'YYYY-MM-DD') AS DAY_5,
to_char(to_date(month||'01','YYYYMMDD') +5,'YYYY-MM-DD') AS DAY_6,
to_char(to_date(month||'01','YYYYMMDD') +6,'YYYY-MM-DD') AS DAY_7,
to_char(to_date(month||'01','YYYYMMDD') +7,'YYYY-MM-DD') AS DAY_8,
to_char(to_date(month||'01','YYYYMMDD') +8,'YYYY-MM-DD') AS DAY_9,
to_char(to_date(month||'01','YYYYMMDD') +9,'YYYY-MM-DD') AS DAY_10,
to_char(to_date(month||'01','YYYYMMDD') +10,'YYYY-MM-DD') AS DAY_11,
to_char(to_date(month||'01','YYYYMMDD') +11,'YYYY-MM-DD') AS DAY_12,
to_char(to_date(month||'01','YYYYMMDD') +12,'YYYY-MM-DD') AS DAY_13,
to_char(to_date(month||'01','YYYYMMDD') +13,'YYYY-MM-DD') AS DAY_14,
to_char(to_date(month||'01','YYYYMMDD') +14,'YYYY-MM-DD') AS DAY_15,
to_char(to_date(month||'01','YYYYMMDD') +15,'YYYY-MM-DD') AS DAY_16,
to_char(to_date(month||'01','YYYYMMDD') +16,'YYYY-MM-DD') AS DAY_17,
to_char(to_date(month||'01','YYYYMMDD') +17,'YYYY-MM-DD') AS DAY_18,
to_char(to_date(month||'01','YYYYMMDD') +18,'YYYY-MM-DD') AS DAY_19,
to_char(to_date(month||'01','YYYYMMDD') +19,'YYYY-MM-DD') AS DAY_20,
to_char(to_date(month||'01','YYYYMMDD') +20,'YYYY-MM-DD') AS DAY_21,
to_char(to_date(month||'01','YYYYMMDD') +21,'YYYY-MM-DD') AS DAY_22,
to_char(to_date(month||'01','YYYYMMDD') +22,'YYYY-MM-DD') AS DAY_23,
to_char(to_date(month||'01','YYYYMMDD') +23,'YYYY-MM-DD') AS DAY_24,
to_char(to_date(month||'01','YYYYMMDD') +24,'YYYY-MM-DD') AS DAY_25,
to_char(to_date(month||'01','YYYYMMDD') +25,'YYYY-MM-DD') AS DAY_26,
to_char(to_date(month||'01','YYYYMMDD') +26,'YYYY-MM-DD') AS DAY_27,
to_char(to_date(month||'01','YYYYMMDD') +27,'YYYY-MM-DD') AS DAY_28,
to_char(to_date(month||'01','YYYYMMDD') +28,'YYYY-MM-DD') AS DAY_29,
to_char(to_date(month||'01','YYYYMMDD') +29,'YYYY-MM-DD') AS DAY_30,
to_char(to_date(month||'01','YYYYMMDD') +30,'YYYY-MM-DD') AS DAY_31
FROM RPT5010_DAY_REPORT
where
month = ${@month}
and rownum=1
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:data-filters><![CDATA[
]]></bm:data-filters>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select to_number(to_char(sysdate, 'YYYYMM')) value_code,
to_char(sysdate, 'YYYY') || '-' || to_char(sysdate, 'MM') value_name
from dual
union
select to_number(to_char(add_months(sysdate, -1), 'YYYYMM')) value_code,
to_char(add_months(sysdate, -1), 'YYYY') || '-' ||
to_char(add_months(sysdate, -1), 'MM') value_name
from dual
order by value_code desc
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:data-filters><![CDATA[
]]></bm:data-filters>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select rpt_batch_s.nextval batch_id from dual
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:data-filters><![CDATA[
]]></bm:data-filters>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: wuts
$Date: 2018-12-21 上午10:43:21
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
rpt5010_not_write_off_pkg.calc_month_days(
p_month =>${@month},
p_user_id =>${/session/@user_id},
p_days => ${@days}
);
end;
]]></bm:update-sql>
<bm:parameters>
<bm:parameter name="days" dataType="java.lang.Long" input="true" output="true" outputPath="/parameter/@days"/>
</bm:parameters>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
begin
rpt5010_not_write_off_pkg.rpt5010_run_job(
p_user_id =>${/session/@user_id}
);
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
......@@ -57,19 +57,23 @@
window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function () {
var contract_id = '${/parameter/@document_id}';
var templet_code = 'CON_LEASE_CONFIRM';
var url=$('con_lease_confirm_print_link').getUrl() + '?contract_id=' + contract_id + '&templet_code=' + templet_code;
var url=$('con_lease_org_print_link').getUrl() + '?contract_id=' + contract_id + '&templet_code=' + templet_code;
// var url=$('con_lease_confirm_print_link').getUrl() + '?contract_id=' + contract_id + '&templet_code=' + templet_code;
window.open(url, '_self');
};
window['${/parameter/@layout_code}_user_button3_layout_dynamic_click'] = function () {
var contract_id = '${/parameter/@document_id}';
var templet_code = 'CON_LEASE';
var url=$('con_lease_print_link').getUrl() + '?contract_id=' + contract_id + '&templet_code=' + templet_code;
var url=$('con_lease_org_print_link').getUrl() + '?contract_id=' + contract_id + '&templet_code=' + templet_code;
//var url=$('con_lease_print_link').getUrl() + '?contract_id=' + contract_id + '&templet_code=' + templet_code;
window.open(url, '_self');
};
window['${/parameter/@layout_code}_user_button4_layout_dynamic_click'] = function () {
var contract_id = '${/parameter/@document_id}';
var templet_code = 'LEASE_RETURN';
window.open($('lease_return_print_link').getUrl() + '?contract_id=' + contract_id + '&templet_code=' + templet_code, "_self");
var url=$('con_lease_org_print_link').getUrl() + '?contract_id=' + contract_id + '&templet_code=' + templet_code;
//var url=$('lease_return_print_link').getUrl() + '?contract_id=' + contract_id + '&templet_code=' + templet_code;
window.open(url, '_self');
};
function view_pdf(attachment_id) {
......@@ -141,9 +145,7 @@
if (!Leaf.isEmpty(temp[0])) {
var file_name = temp[0].toUpperCase();
var file_suffix = temp[0].substr(temp[0].lastIndexOf('.') + 1).toUpperCase();
if (file_name.indexOf('.PDF') >= 0) {
url = url + '<a href=javascript:view_pdf(\'' + temp[1] + '\')>' + temp[0] + '</a>' + ',';
} else if (file_suffix == 'BMP' || file_suffix == 'JPG' || file_suffix == 'JPEG' || file_suffix == 'PNG' || file_suffix == 'GIF') {
if (file_suffix == 'BMP' || file_suffix == 'JPG' || file_suffix == 'JPEG' || file_suffix == 'PNG' || file_suffix == 'GIF') {
url = url + '<a href=' + link + temp[1] + ' ref="img">' + temp[0] + '</a>' + ',';
} else {
url = url + '<a href=' + link + temp[1] + '>' + temp[0] + '</a>' + ',';
......
<?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[
<s:server-script import="contract_print_path.js"><![CDATA[
importPackage(java.io);
importPackage(Packages.hls.plugin.docx4j)
importPackage(Packages.hls.plugin.docx4j);
importPackage(Packages.leaf.plugin.word2pdf);
importPackage(Packages.org.apache.commons.io);
......@@ -22,6 +23,18 @@
}
}
//生成pdf
function wordToPdf(word_file_path,pdf_file_path) {
// word转pdf
var pdf_file_path_new = pdf_file_path + '.pdf';
var wordToPdf = new WordToPdf($instance('uncertain.ocm.IObjectRegistry'), "jacob-1.18-x64.dll");
wordToPdf.word2pdf(word_file_path, pdf_file_path_new);
//删除word文件
// deleteFile(word_file_path);
return pdf_file_path_new;
}
function copyFile(fOld, fNew) {
var fis = new java.io.FileInputStream(fOld);
var fos = new java.io.FileOutputStream(fNew);
......@@ -38,7 +51,7 @@
function getDatePath() {
set_parameter_file_path();
var file_path = $ctx.parameter.file_path; //file_path = c:/hls_test_files/content_files/
var file_path = $ctx.parameter.pdf_path; //file_path = c:/hls_test_files/content_files/
var now = new Date()
y = now.getFullYear()
m = now.getMonth() + 1
......@@ -68,7 +81,7 @@
try {
var os = resp.getOutputStream();
write_os_to_file(file_path, os);
//write_os_to_file(file_path+file_name, os);
os.flush();
} catch (e) {
$logger("server-script").severe(e.message);
......@@ -83,13 +96,13 @@
templet_code: $ctx.parameter.templet_code
});
//获取日期目录
set_parameter_file_path();
var datePath = getDatePath();
$ctx.parameter.batch_flag='Y';
FileUtils.forceMkdir(new File(datePath)); //根据日期创建目录
var from_file_data_map = $bm('cont.CON500.con_doc_file_templet_get_atm').queryAsMap({
var from_file_data_map = $bm('cont.CON500.con_doc_file_templet_get_atm_new').queryAsMap({
contract_id: $ctx.parameter.contract_id,
batch_flag:$ctx.parameter.batch_flag,
templet_code: $ctx.parameter.templet_code
});
var from_file_data = from_file_data_map.getChildren();
for (var i = 0;i < from_file_data.length;i++) {
......@@ -109,15 +122,31 @@
} catch (e) {
raise_app_error(e);
}
$bm('cont.CON500.con_file_content_copy_update').update({
table_name: 'CON_CONTRACT_CONTENT',
content_id: record_data.content_id,
file_name: to_file_name.toString(),
file_path: to_file_path.toString()
});
var test=new File(to_file_path);
var test1=new File('D:'+to_file_path);
download_file(to_file_path.toString(),to_file_name.toString());
// word转pdf
var pdf_file_path=to_file_path;
var outputfilepath = wordToPdf(to_file_path,pdf_file_path);
var outputfilename= record_data.to_file_name +'.pdf';
var pdf_file = new File(outputfilepath);
var file_size = 0;
if (pdf_file.exists()) {
file_size = pdf_file.length();
}
//保存文本名及路径
$bm('cont.CON500.con_file_content_copy_update').execute({
table_name: 'CON_CONTRACT_CONTENT',
content_id: record_data.content_id,
file_name: outputfilename.toString(),
file_path: outputfilepath.toString(),
file_size: file_size,
file_type_code: 'pdf',
mime_type: 'application/pdf',
user_id: $ctx.parameter.user_id
});
download_file(outputfilepath.toString(),outputfilename.toString());
}
}
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: WangYu
$Date: 2014-4-25 上午09:31:11
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
<a:view>
<a:link id="con_cashflow_pre_query_id" model="cont.CON930.con_contract_cashflow_monthly" modelaction="update"/>
<script><![CDATA[
function CON321_con_contract_query() {
if ($('con_contract_cashflow_monthly_query_ds').validate()){
var headers_ds = $('con_contract_cashflow_monthly_query_ds');
var record = headers_ds.getAt(0);
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.SAVING}');
Leaf.request({
url: $('con_cashflow_pre_query_id').getUrl(),
para: {
due_date : record.get('due_date'),
bp_id : record.get('bp_id_agent_level1'),
overday1:record.get('overdue_day1'),
overday2:record.get('overdue_day2'),
overday3:record.get('overdue_day3'),
not_overday1:record.get('not_overday1'),
not_overday2:record.get('not_overday2'),
not_overday3:record.get('not_overday3'),
not_overday4:record.get('not_overday4'),
not_overday5:record.get('not_overday5'),
not_overday6:record.get('not_overday6')
},
success: function(res) {
Leaf.Masker.unmask (Ext.getBody());
$('con_contract_cashflow_monthly_result_ds').query();
},
failure: function() {
Leaf.Masker.unmask (Ext.getBody());
},
error: function() {
Leaf.Masker.unmask (Ext.getBody());
},
scope: this
});
}
}
function CON321_con_contract_reset() {
$('con_contract_cashflow_monthly_query_ds').reset();
}
]]></script>
<a:dataSets>
<a:dataSet id="gld_accounts_ds" loadData="true" model="cont.CON930.gld_accounts_ds"/>
<a:dataSet id="con_contract_cashflow_monthly_query_ds" autoCreate="true">
<a:fields>
<a:field name="due_date" required="true" prompt="基准日期"/>
<a:field name="bp_id_agent_level1" required="true" />
<a:field name="account_name" displayField="account_name" options="gld_accounts_ds" returnField="account_id" valueField="account_id"/>
<a:field name="bp_id_agent_level1_n" prompt="代理店" required="true" lovGridHeight="350" lovHeight="500" lovService="basic.hls_bp_master_v_for_lov?bp_category=AGENT" lovWidth="500" title="HLS.BP_TITLE" >
<a:mapping>
<a:map from="bp_id" to="bp_id_agent_level1"/>
<a:map from="bp_name" to="bp_id_agent_level1_n" />
</a:mapping>
</a:field>
<a:field name="overdue_day1" required="true" prompt="已到期1个月界定天数" defaultValue="30"/>
<a:field name="overdue_day2" required="true" prompt="已到期2个月界定天数" defaultValue="60"/>
<a:field name="overdue_day3" required="true" prompt="已到期3个月界定天数" defaultValue="90"/>
<a:field name="not_overday1" required="true" prompt="未到期1个月界定天数" defaultValue="30"/>
<a:field name="not_overday2" required="true" prompt="未到期2个月界定天数" defaultValue="60"/>
<a:field name="not_overday3" required="true" prompt="未到期3个月界定天数" defaultValue="90"/>
<a:field name="not_overday4" required="true" prompt="未到期4个月界定天数" defaultValue="120"/>
<a:field name="not_overday5" required="true" prompt="未到期5个月界定天数" defaultValue="150"/>
<a:field name="not_overday6" required="true" prompt="未到期6个月界定天数" defaultValue="180"/>
</a:fields>
</a:dataSet>
<a:dataSet id="con_contract_cashflow_monthly_result_ds" model="cont.CON930.con_contract_cashflow_monthly" autoPageSize="true" queryDataSet="con_contract_cashflow_monthly_query_ds"/>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:gridButton click="CON321_con_contract_query" text="HLS.QUERY"/>
<a:gridButton click="CON321_con_contract_reset" text="HLS.RESET"/>
</a:screenTopToolbar>
<a:form bindTarget="con_contract_cashflow_balance_query_ds" column="6" title="收付款预定查询" marginWidth="40">
<a:datePicker name="due_date" bindTarget="con_contract_cashflow_monthly_query_ds"/>
<a:lov name="bp_id_agent_level1_n" bindTarget="con_contract_cashflow_monthly_query_ds"/>
<a:numberField name="overdue_day1" bindTarget="con_contract_cashflow_monthly_query_ds" allowDecimals="false"/>
<a:numberField name="overdue_day2" bindTarget="con_contract_cashflow_monthly_query_ds" allowDecimals="false"/>
<a:numberField name="overdue_day3" bindTarget="con_contract_cashflow_monthly_query_ds" allowDecimals="false"/>
<a:numberField name="not_overday1" bindTarget="con_contract_cashflow_monthly_query_ds" allowDecimals="false"/>
<a:numberField name="not_overday2" bindTarget="con_contract_cashflow_monthly_query_ds" allowDecimals="false"/>
<a:numberField name="not_overday3" bindTarget="con_contract_cashflow_monthly_query_ds" allowDecimals="false"/>
<a:numberField name="not_overday4" bindTarget="con_contract_cashflow_monthly_query_ds" allowDecimals="false"/>
<a:numberField name="not_overday5" bindTarget="con_contract_cashflow_monthly_query_ds" allowDecimals="false"/>
<a:numberField name="not_overday6" bindTarget="con_contract_cashflow_monthly_query_ds" allowDecimals="false"/>
<!-- <a:comboBox name="account_name" bindTarget="con_contract_cashflow_monthly_query_ds" prompt="科目"/>-->
</a:form>
<a:grid id="con_contract_cashflow_monthly_result_grid" bindTarget="con_contract_cashflow_monthly_result_ds" marginHeight="150" navBar="true" marginWidth="40">
<a:toolBar>
<a:button type="excel"/>
</a:toolBar>
<a:columns>
<a:column name="bp_id_agent_level1_n" align="center" prompt="代理店" width="120"/>
<a:column name="contract_number" align="center" prompt="合同号" width="120"/>
<a:column name="bp_code" align="center" prompt="业务伙伴号" width="100"/>
<a:column name="account_id_n" align="center" prompt="科目代码" width="80"/>
<a:column name="account_name" align="center" prompt="科目名称" width="180"/>
<a:column name="unreceived_sum_amount" align="center" prompt="总额" renderer="Leaf.formatMoney" width="80"/>
<a:column name="overdue_amount_1" align="center" prompt="已到期1个月" renderer="Leaf.formatMoney" width="80"/>
<a:column name="overdue_amount_2" align="center" prompt="已到期2个月" renderer="Leaf.formatMoney" width="80"/>
<a:column name="overdue_amount_3" align="center" prompt="已到期3个月" renderer="Leaf.formatMoney" width="80"/>
<a:column name="overdue_amount_left" align="center" prompt="已到期3个月以上" renderer="Leaf.formatMoney" width="80"/>
<a:column name="overdue_sum_amount" align="center" prompt="已到期余额合计" renderer="Leaf.formatMoney" width="80"/>
<a:column name="not_due_sum_amount" align="center" prompt="未到期余额" renderer="Leaf.formatMoney" width="80"/>
<a:column name="not_due_amount_1" align="center" prompt="未到期1个月" renderer="Leaf.formatMoney" width="80"/>
<a:column name="not_due_amount_2" align="center" prompt="未到期2个月" renderer="Leaf.formatMoney" width="80"/>
<a:column name="not_due_amount_3" align="center" prompt="未到期3个月" renderer="Leaf.formatMoney" width="80"/>
<a:column name="not_due_amount_4" align="center" prompt="未到期4个月" renderer="Leaf.formatMoney" width="80"/>
<a:column name="not_due_amount_5" align="center" prompt="未到期5个月" renderer="Leaf.formatMoney" width="80"/>
<a:column name="not_due_amount_6" align="center" prompt="未到期6个月" renderer="Leaf.formatMoney" width="80"/>
<a:column name="not_due_amount_left" align="center" prompt="未到期6个月以上" renderer="Leaf.formatMoney" width="80"/>
</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[
<s:server-script import="contract_print_path.js"><![CDATA[
importPackage(java.io);
importPackage(Packages.hls.plugin.docx4j)
importPackage(Packages.hls.plugin.docx4j);
importPackage(Packages.leaf.plugin.word2pdf);
importPackage(Packages.org.apache.commons.io);
......@@ -22,6 +23,19 @@
}
}
//生成pdf
function wordToPdf(word_file_path,pdf_file_path) {
// word转pdf
var pdf_file_path_new = pdf_file_path + '.pdf';
var wordToPdf = new WordToPdf($instance('uncertain.ocm.IObjectRegistry'), "jacob-1.18-x64.dll");
wordToPdf.word2pdf(word_file_path, pdf_file_path_new);
//删除word文件
// deleteFile(word_file_path);
return pdf_file_path_new;
}
function copyFile(fOld, fNew) {
var fis = new java.io.FileInputStream(fOld);
var fos = new java.io.FileOutputStream(fNew);
......@@ -38,7 +52,7 @@
function getDatePath() {
set_parameter_file_path();
var file_path = $ctx.parameter.file_path; //file_path = c:/hls_test_files/content_files/
var file_path = $ctx.parameter.pdf_path; //file_path = c:/hls_test_files/content_files/
var now = new Date()
y = now.getFullYear()
m = now.getMonth() + 1
......@@ -83,14 +97,15 @@
templet_code: $ctx.parameter.templet_code
});
//获取日期目录
set_parameter_file_path();
var datePath = getDatePath();
$ctx.parameter.batch_flag = 'Y';
FileUtils.forceMkdir(new File(datePath)); //根据日期创建目录
var from_file_data_map = $bm('prj.PRJ501N.prj_doc_file_templet_get_atm').queryAsMap({
project_id_id: $ctx.parameter.project_id,
project_id: $ctx.parameter.project_id,
batch_flag: $ctx.parameter.batch_flag,
templet_code: $ctx.parameter.templet_code
});
var from_file_data = from_file_data_map.getChildren();
for (var i = 0; i < from_file_data.length; i++) {
......@@ -101,7 +116,7 @@
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 = datePath + guid_file_name_tables[0].guid_file_name + 'con' + record_data.content_id;
to_file_path = datePath + guid_file_name_tables[0].guid_file_name + 'prj' + record_data.content_id;
copyFile(from_file_path, to_file_path);
try {
var brwt = new BookmarksReplaceWithText($instance('leaf.database.service.IDatabaseServiceFactory'), $instance('uncertain.ocm.IObjectRegistry'), $ctx.getData());
......@@ -109,16 +124,34 @@
} catch (e) {
raise_app_error(e);
}
$bm('prj.PRJ501N.prj_file_content_copy_update').update({
// word转pdf
var pdf_file_path=to_file_path;
var outputfilepath = wordToPdf(to_file_path,pdf_file_path);
var outputfilename= record_data.to_file_name +'.pdf';
var pdf_file = new File(outputfilepath);
var file_size = 0;
if (pdf_file.exists()) {
file_size = pdf_file.length();
}
//保存文本名及路径
$bm('cont.CON500.con_file_content_copy_update').execute({
table_name: 'PRJ_PROJECT_CONTENT',
content_id: record_data.content_id,
file_name: to_file_name.toString(),
file_path: to_file_path.toString(),
source_type: 'PROJECT'
file_name: outputfilename.toString(),
file_path: outputfilepath.toString(),
file_size: file_size,
file_type_code: 'pdf',
mime_type: 'application/pdf',
source_type: 'PROJECT',
user_id: $ctx.parameter.user_id
});
var test = new File(to_file_path);
var test1 = new File('D:' + to_file_path);
download_file(to_file_path.toString(), to_file_name.toString());
download_file(outputfilepath.toString(), outputfilename.toString());
}
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: niminmin
$Date: 2018-12-20 上午9:30:25
$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>
<a:model-query autoCount="false" model="rpt.RPT5012.rpt5012_get_batch" rootPath="batch_id"/>
</a:init-procedure>
<a:view>
<a:link id="rpt5010_print_link_id" model="rpt.RPT5012.rpt5010_get_data" modelaction="update"/>
<script><![CDATA[
function rpt5012_reset() {
$('rpt5012_query_ds').reset();
}
function ref_n01_time(record, name, value) {
var reg = /^\d\d\d\d\d\d$/;
if (reg.test(value)) {
return true;
}
return '时间格式应为【yyyymm】,举例【201812】';
}
function rpt5012_query_ds() {
debugger;
Leaf.Masker.mask(Ext.getBody(), '${l:BEING_IMPLEMENTED}');
var record = $('rpt5012_query_ds').getAt(0);
if (!record) {
Leaf.Masker.unmask(Ext.getBody());
Leaf.showMessage('${l:PROMPT}', '年月未填写');
return;
}
var month = record.get('month');
if (!month) {
Leaf.Masker.unmask(Ext.getBody());
Leaf.showMessage('${l:PROMPT}', '年月未填写');
return;
}
Leaf.request({
url: $('rpt5012_print_link_id').getUrl(),
para: {
month: month,
batch_id:'${/model/batch_id/record/@batch_id}'
},
success: function(res) {
var days = res.result.days;
Leaf.Masker.unmask(Ext.getBody());
var url = '${/request/@context_path}/modules/rpt/rpt5012/export_excel_sheets' + days + '.lsc?month=' + month + '&file_name=' + month + '每日合同未收本金表.xls';
window.open(encodeURI(url), '_self');
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
function rpt5110_run_job() {
Leaf.showConfirm('${l:HLS.PROMPT}', '<font color="red">该任务需执行约1小时,请耐心等待!</font></br></br><font color="red">【特别注意】任务发起后1小时内请勿重复点击</font>', function() {
Leaf.Masker.mask(Ext.getBody(), '${l:BEING_IMPLEMENTED}');
Leaf.request({
url: $('rpt5012_run_job_link_id').getUrl(),
para: {},
success: function(res) {
Leaf.Masker.unmask(Ext.getBody());
Leaf.SideBar.show({
msg: '发起成功!',
duration: 2000
});
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}, null, 300, 150);
}
]]></script>
<a:dataSets>
<a:dataSet id="four_month_date_ds" loadData="true" model="rpt.RPT5012.rpt5012_four_month"/>
<a:dataSet id="rpt5012_query_ds">
<a:fields>
<a:field name="month"/>
<a:field name="month_desc" displayField="value_name" options="four_month_date_ds" required="true" returnField="month" valueField="value_code"/>
</a:fields>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTitle/>
<a:gridButton click="rpt5012_reset" text="HLS.RESET"/>
<a:gridButton click="rpt5012_query" text="查询"/>
</a:screenTopToolbar>
<a:form column="1" labelWidth="100" title="条件" width="300">
<a:comboBox name="month_desc" bindTarget="rpt5012_query_ds" prompt="月结年月"/>
</a:form>
</a:screenBody>
</a:view>
</a:screen>
......@@ -323,7 +323,7 @@
</a:hBox>
</div>
<div style="margin-left:10px;">
<a:treeGrid id="zjwfl5110_result_tree" bindTarget="zjwfl5110_toDoDs" expandField="expand_flag" idField="child_workflow_desc" marginHeight="550" marginWidth="80" navBar="true" parentField="workflow_desc" sequenceField="order_seq" showCheckBox="true" height="400">
<a:treeGrid id="zjwfl5110_result_tree" bindTarget="zjwfl5110_toDoDs" expandField="expand_flag" idField="child_workflow_desc" marginHeight="180" marginWidth="80" navBar="true" parentField="workflow_desc" sequenceField="order_seq" showCheckBox="true">
<a:columns>
<a:column name="child_workflow_desc" prompt="工作流"/>
<a:column name="workflow_info" prompt="工作流名称" renderer="render_zjwfl5110_toDoDs_table"/>
......
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