Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
leaf-hlcm
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hlcm
leaf-hlcm
Commits
538aadbc
Commit
538aadbc
authored
Nov 14, 2024
by
18083
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量下载解约通知函、连带责任函、拖车授权委托书改造
parent
e00ca296
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
630 additions
and
15 deletions
+630
-15
con_contract_download_batch_dl.lwm
...NF/classes/cont/CON620/con_contract_download_batch_dl.lwm
+36
-0
con_contract_download_get_atm.lwm
...INF/classes/cont/CON620/con_contract_download_get_atm.lwm
+61
-0
con_contract_download_temp.lwm
...EB-INF/classes/cont/CON620/con_contract_download_temp.lwm
+40
-0
con_doc_file_templet_for_content.lwm
.../classes/cont/CON620/con_doc_file_templet_for_content.lwm
+63
-0
con_contract_download_batch_dl.lsc
...pp/modules/cont/CON620/con_contract_download_batch_dl.lsc
+70
-0
con_contract_download_temp.lsc
...webapp/modules/cont/CON620/con_contract_download_temp.lsc
+11
-0
con_contract_rent_dun_query.lview
...app/modules/cont/CON620/con_contract_rent_dun_query.lview
+203
-14
create_content_download_collection.lsc
...odules/cont/CON620/create_content_download_collection.lsc
+145
-0
create_content_for_collection.lsc
...app/modules/cont/CON620/create_content_for_collection.lsc
+1
-1
No files found.
src/main/webapp/WEB-INF/classes/cont/CON620/con_contract_download_batch_dl.lwm
0 → 100644
View file @
538aadbc
<?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 faa.file_name,
faa.file_path,
faa.attachment_id,
m.table_name,
m.table_pk_value,
m.record_id
FROM fnd_atm_attachment faa,
fnd_atm_attachment_multi m,
con_clause_templet t,
con_contract_content_v cc,
con_contract_download_temp pt
WHERE faa.attachment_id = m.attachment_id
AND m.table_name = 'CON_CONTRACT_CONTENT'
AND m.table_pk_value = cc.content_id
AND t.doc_plugin_flag = 'Y'
AND t.templet_id = cc.templet_id
AND cc.contract_id = pt.contract_id
AND pt.session_id = ${/session/@session_id}
AND t.templet_code = ${/parameter/@templet_code}
]]>
</bm:query-sql>
</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_path"
databaseType=
"VARCHAR2"
datatype=
"java.lang.String"
physicalName=
"FILE_PATH"
/>
</bm:fields>
</bm:model>
src/main/webapp/WEB-INF/classes/cont/CON620/con_contract_download_get_atm.lwm
0 → 100644
View file @
538aadbc
<?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 ct.contract_number
from con_contract ct
where ct.contract_id = cc.contract_id) to_file_name,
lt.pwd,
cc.content_id,
pt.contract_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,
con_contract_download_temp pt
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 = cc.templet_id AND
cc.contract_id = pt.contract_id AND
pt.session_id = ${/session/@session_id} AND
t.templet_code =${/parameter/@templet_code}
]]>
</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:field
name=
"contract_id"
databaseType=
"NUMBER"
datatype=
"java.lang.Long"
physicalName=
"CONTRACT_ID"
/>
</bm:fields>
</bm:model>
src/main/webapp/WEB-INF/classes/cont/CON620/con_contract_download_temp.lwm
0 → 100644
View file @
538aadbc
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2024-11-11 下午5:06:06
$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
con_contract_content_pkg.delect_contract_download_temp(p_session_id =>
${/session/@session_id});
end;
]]>
</bm:update-sql>
</bm:operation>
<bm:operation
name=
"insert"
>
<bm:update-sql>
<![CDATA[
begin
con_contract_content_pkg.contract_rent_download_create(
p_session_id =>
${/session/@session_id},
p_contract_id =>${@contract_id}
);
end;
]]>
</bm:update-sql>
</bm:operation>
<bm:operation
name=
"update"
>
<bm:update-sql>
<![CDATA[
begin
con_contract_content_pkg.content_create_for_collection(
p_contract_id =>
${@contract_id},
p_user_id =>${/session/@user_id},
p_templet_code=>${@templet_code}
);
end;
]]>
</bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
src/main/webapp/WEB-INF/classes/cont/CON620/con_doc_file_templet_for_content.lwm
0 → 100644
View file @
538aadbc
<?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 ct.contract_number
from con_contract ct
where 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>
src/main/webapp/modules/cont/CON620/con_contract_download_batch_dl.lsc
0 → 100644
View file @
538aadbc
<?xml version="1.0" encoding="UTF-8"?>
<a:service
xmlns:a=
"http://www.leaf-framework.org/application"
xmlns:s=
"leaf.plugin.script"
trace=
"true"
>
<a:init-procedure>
<s:server-script>
<![CDATA[
importPackage(java.util.zip);
importPackage(java.io);
function getdate() {
var now = new Date()
y = now.getFullYear()
m = now.getMonth() + 1
d = now.getDate()
m = m < 10 ? "0" + m : m
d = d < 10 ? "0" + d : d
return y + "" + m + "" + d
}
function writeFile(zos, fn, fp) {
var ze = new ZipEntry(fn);
//zos.setEncoding("UTF-8");//如果是org.apache.tools.zip需要追加字符集
zos.putNextEntry(ze);
var fis = new FileInputStream(fp);
var b = new java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024 * 64);
var len = -1;
while ((len = fis.read(b)) != -1) {
zos.write(b, 0, len);
}
fis.close();
}
$ctx["__request_type__"] = 'file'; //to indicate this request is not a JSON_REQUEST
var resp = $ctx['_instance.javax.servlet.http.HttpServletResponse'];
resp.setHeader("Pragma", "No-cache");
resp.setHeader("Cache-Control", "no-cache, must-revalidate");
var date = new Date();
var date_str = getdate();
var doc_code = $ctx.parameter.doc_code;
var filename = doc_code + '-' + date_str + ".zip"
resp.setHeader("Content-disposition", "attachment; filename=" + encodeURI(filename, 'utf-8'));
resp.setDateHeader("Expires", 0);
resp.setContentType("application/x-msdownload");
var zos = new ZipOutputStream(resp.getOutputStream());
try {
var attachment_batch_dl = $bm('cont.CON620.con_contract_download_batch_dl');
var result = attachment_batch_dl.queryAsMap();
var arr = result.getChildren();
var file_exist_list = {};
for (var i = 0;i < arr.length;i++) {
var f = arr[i];
if (f.file_path && !file_exist_list[f.file_name]) {
writeFile(zos, f.file_name, f.file_path);
file_exist_list[f.file_name] = 1;
} else {
file_exist_list[f.file_name] = file_exist_list[f.file_name] * 1 + 1;
var last_index = f.file_name.lastIndexOf(".");
var temp_exists_file_name = f.file_name.substr(0, last_index);
var temp_exists_file_type = f.file_name.substr(last_index, f.file_name.length);
temp_exists_file_name = temp_exists_file_name + '-' + file_exist_list[f.file_name] + temp_exists_file_type;
writeFile(zos, temp_exists_file_name, f.file_path);
}
}
} catch (e) {
var logger = $logger("server-script");
logger.severe(e.message)
}
zos.close();
]]>
</s:server-script>
</a:init-procedure>
</a:service>
src/main/webapp/modules/cont/CON620/con_contract_download_temp.lsc
0 → 100644
View file @
538aadbc
<?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>
<a:model-delete
model=
"cont.CON620.con_contract_download_temp"
/>
<batch-apply
sourcepath=
"/parameter"
>
<a:model-insert
model=
"cont.CON620.con_contract_download_temp"
/>
<a:model-update
model=
"cont.CON620.con_contract_download_temp"
/>
</batch-apply>
</a:init-procedure>
<a:service-output
output=
"/parameter"
/>
</a:service>
src/main/webapp/modules/cont/CON620/con_contract_rent_dun_query.lview
View file @
538aadbc
...
@@ -21,16 +21,18 @@
...
@@ -21,16 +21,18 @@
url=
"${/request/@context_path}/modules/cont/CON620/con_contract_account_detail.lview"
/>
url=
"${/request/@context_path}/modules/cont/CON620/con_contract_account_detail.lview"
/>
<a:link
id=
"con_contract_query_link_id"
<a:link
id=
"con_contract_query_link_id"
url=
"${/request/@context_path}/modules/cont/CON3200/con_re_incept_modify.lview"
/>
url=
"${/request/@context_path}/modules/cont/CON3200/con_re_incept_modify.lview"
/>
<a:link
id=
"con_contract_op_query_link_id"
<a:link
id=
"con_contract_op_query_link_id"
url=
"${/request/@context_path}/modules/cont/CON3200/con_re_incept_op_modify.lview"
/>
url=
"${/request/@context_path}/modules/cont/CON3200/con_re_incept_op_modify.lview"
/>
<a:link
id=
"con601_send_dun_msg"
model=
"cont.CON620.con620_send_dun_msg"
modelaction=
"execute"
/>
<a:link
id=
"con601_send_dun_msg"
model=
"cont.CON620.con620_send_dun_msg"
modelaction=
"execute"
/>
<a:link
id=
"contract_rent_download_link_id"
<a:link
id=
"contract_rent_download_link_id"
url=
"${/request/@context_path}/modules/cont/CON620/con_contract_rent_download.lview"
/>
url=
"${/request/@context_path}/modules/cont/CON620/con_contract_rent_download.lview"
/>
<script
type=
"text/javascript"
>
<![CDATA[
<a:link
id=
"con_contract_down_temp_link_id"
url=
"${/request/@context_path}/modules/cont/CON620/con_contract_download_temp.lsc"
/>
<a:link
id=
"con_contract_down_word_link_id"
url=
"${/request/@context_path}/modules/cont/CON620/create_content_download_collection.lsc"
/>
<a:link
id=
"con_contract_down_zip_link_id"
url=
"${/request/@context_path}/modules/cont/CON620/con_contract_download_batch_dl.lsc"
/>
<script
type=
"text/javascript"
>
<![CDATA[
function CON601_con_contract_query() {
function CON601_con_contract_query() {
$('CON620_contract_result_ds').query();
$('CON620_contract_result_ds').query();
$('CON620_contract_repur_result_ds').query();
$('CON620_contract_repur_result_ds').query();
}
}
function CON601_con_contract_reset() {
function CON601_con_contract_reset() {
...
@@ -248,7 +250,7 @@
...
@@ -248,7 +250,7 @@
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_query_link_id');
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_query_link_id');
}
}
//经租合同明细
//经租合同明细
function contract_op_detail_link(record_id, ds_id) {
function contract_op_detail_link(record_id, ds_id) {
var current_record = $(ds_id).findById(record_id);
var current_record = $(ds_id).findById(record_id);
var record = current_record;
var record = current_record;
...
@@ -333,9 +335,9 @@
...
@@ -333,9 +335,9 @@
Leaf.onReady(function () {
Leaf.onReady(function () {
if ("${/model/role_info/record/@role_code}" == "0018" || "${/model/role_info/record/@role_code}" == "0019") {
if ("${/model/role_info/record/@role_code}" == "0018" || "${/model/role_info/record/@role_code}" == "0019") {
document.getElementById('msg_money_id').style.display = "none";
document.getElementById('msg_money_id').style.display = "none";
document.getElementById('msg_no_money_id').style.display = "none";
document.getElementById('msg_no_money_id').style.display = "none";
$('CON601_con_contract_grid_ds').hideColumn('account_due_times');
$('CON601_con_contract_grid_ds').hideColumn('account_due_times');
$('CON601_con_contract_grid_ds').hideColumn('account_due_days');
$('CON601_con_contract_grid_ds').hideColumn('account_due_days');
$('CON601_con_contract_grid_ds').hideColumn('account_due_amount');
$('CON601_con_contract_grid_ds').hideColumn('account_due_amount');
$('CON601_con_contract_grid_ds').hideColumn('ac_received_amount');
$('CON601_con_contract_grid_ds').hideColumn('ac_received_amount');
...
@@ -382,7 +384,6 @@
...
@@ -382,7 +384,6 @@
function CON601_dun_msg_money() {
function CON601_dun_msg_money() {
var records = $('CON620_contract_result_ds').getSelected();
var records = $('CON620_contract_result_ds').getSelected();
var records_repur = $('CON620_contract_repur_result_ds').getSelected();
var records_repur = $('CON620_contract_repur_result_ds').getSelected();
if (records_repur.length > 0) {
if (records_repur.length > 0) {
$L.showInfoMessage('提示', '解约回购合同不在催收短信发送范围!');
$L.showInfoMessage('提示', '解约回购合同不在催收短信发送范围!');
return;
return;
...
@@ -397,7 +398,7 @@
...
@@ -397,7 +398,7 @@
var no_send_message = '';
var no_send_message = '';
//判断单据的状态
//判断单据的状态
for (var i = 0; i
< records.length
;
i++)
{
for (var i = 0; i
< records.length
;
i++)
{
if(records[i].get('division')
==
'95'){
if(records[i].get('division')
==
'95'){
$L.showInfoMessage('提示','经营性租赁业务不支持发送催收短信!');
$L.showInfoMessage('提示','经营性租赁业务不支持发送催收短信!');
return;
return;
}
}
...
@@ -480,7 +481,7 @@
...
@@ -480,7 +481,7 @@
var no_send_message = '';
var no_send_message = '';
for (var i = 0; i
< records.length
;
i++)
{
for (var i = 0; i
< records.length
;
i++)
{
if(records[i].get('division')
==
'95'){
if(records[i].get('division')
==
'95'){
$L.showInfoMessage('提示','经营性租赁业务不支持发送催收短信!');
$L.showInfoMessage('提示','经营性租赁业务不支持发送催收短信!');
return;
return;
}
}
...
@@ -574,7 +575,7 @@
...
@@ -574,7 +575,7 @@
//批量下载催收函
//批量下载催收函
function
CON601_con_contract_download(){
function
CON601_con_contract_download(){
var
records =
$('CON620_contract_result_ds').getSelected();
var
records =
$('CON620_contract_result_ds').getSelected();
var
records_repur =
$('CON620_contract_repur_result_ds').getSelected();
var
records_repur =
$('CON620_contract_repur_result_ds').getSelected();
if
(records_repur.length
>
0) {
if
(records_repur.length
>
0) {
$L.showInfoMessage('提示', '解约回购合同不在批量下载范围!');
$L.showInfoMessage('提示', '解约回购合同不在批量下载范围!');
...
@@ -609,7 +610,193 @@
...
@@ -609,7 +610,193 @@
height:
150,
height:
150,
width:
360
width:
360
});
});
}
}
//批量下载解约通知函
function
CON601_notice_of_termination_download(){
var
records =
$('CON620_contract_result_ds').getSelected();
var
records_repur =
$('CON620_contract_repur_result_ds').getSelected();
if
(records_repur.length
>
0) {
$L.showInfoMessage('提示', '解约回购合同不在批量下载范围!');
return;
}
if (records.length == 0) {
$L.showInfoMessage('提示', '请选择需下载解约通知函对应的合同!');
return;
}
if (records.length > 10) {
$L.showInfoMessage('提示', '批量下载解约通知函最多可勾选10个合同,请重新选择!');
return;
}
var datas = [];
var templet_code = 'CON_LEASE_CONFIRM';
for (var i = 0;i
< records.length
;i++)
{
var
obj =
{};
obj['contract_id']
=
records[i].get('contract_id');
obj['templet_code']
=
templet_code;
datas[i]
=
obj;
}
//
清除临时表数据并插入新数据,删除再生成文本
Leaf.Masker.mask(Ext.getBody(),
'${l:HLS.EXECUTING}');
Leaf.request({
url:
$('con_contract_down_temp_link_id').getUrl(),
para:
datas,
success:
function()
{
//
打印
Leaf.request({
url:
$('con_contract_down_word_link_id').getUrl(),
para:
{
templet_code:
templet_code
},
success:
function()
{
//
下载
var
doc_code =
'解约通知函-'
;
var
url_l =
$('con_contract_down_zip_link_id').getUrl()
+
'?
templet_code=
'+templet_code+'
&
doc_code=
' + encodeURI(doc_code);
window.open(href = url_l, target = "_self");
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
//批量下载连带责任函
function CON601_joint_responsibility_download(){
var records = $('
CON620_contract_result_ds').getSelected();
var
records_repur =
$('CON620_contract_repur_result_ds').getSelected();
if
(records_repur.length
>
0) {
$L.showInfoMessage('提示', '解约回购合同不在批量下载范围!');
return;
}
if (records.length == 0) {
$L.showInfoMessage('提示', '请选择需下载连带责任函对应的合同!');
return;
}
if (records.length > 10) {
$L.showInfoMessage('提示', '批量下载连带责任函最多可勾选10个合同,请重新选择!');
return;
}
var datas = [];
var templet_code = 'CON_LEASE';
for (var i = 0;i
< records.length
;i++)
{
var
obj =
{};
obj['contract_id']
=
records[i].get('contract_id');
obj['templet_code']
=
templet_code;
datas[i]
=
obj;
}
//
清除临时表数据并插入新数据,删除再生成文本
Leaf.Masker.mask(Ext.getBody(),
'${l:HLS.EXECUTING}');
Leaf.request({
url:
$('con_contract_down_temp_link_id').getUrl(),
para:
datas,
success:
function()
{
//
打印
Leaf.request({
url:
$('con_contract_down_word_link_id').getUrl(),
para:
{
templet_code:
templet_code
},
success:
function()
{
//
下载
var
doc_code =
'连带责任函-'
;
var
url_l =
$('con_contract_down_zip_link_id').getUrl()
+
'?
templet_code=
'+templet_code+'
&
doc_code=
' + encodeURI(doc_code);
window.open(href = url_l, target = "_self");
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
//批量下载拖车授权委托书
function CON601_trailer_letter_download(){
var records = $('
CON620_contract_result_ds').getSelected();
var
records_repur =
$('CON620_contract_repur_result_ds').getSelected();
if
(records_repur.length
>
0) {
$L.showInfoMessage('提示', '解约回购合同不在批量下载范围!');
return;
}
if (records.length == 0) {
$L.showInfoMessage('提示', '请选择需下载拖车授权委托书对应的合同!');
return;
}
if (records.length > 10) {
$L.showInfoMessage('提示', '批量下载拖车授权委托书最多可勾选10个合同,请重新选择!');
return;
}
var datas = [];
var templet_code = 'LEASE_RETURN';
for (var i = 0;i
< records.length
;i++)
{
var
obj =
{};
obj['contract_id']
=
records[i].get('contract_id');
obj['templet_code']
=
templet_code;
datas[i]
=
obj;
}
//
清除临时表数据并插入新数据,删除再生成文本
Leaf.Masker.mask(Ext.getBody(),
'${l:HLS.EXECUTING}');
Leaf.request({
url:
$('con_contract_down_temp_link_id').getUrl(),
para:
datas,
success:
function()
{
//
打印
Leaf.request({
url:
$('con_contract_down_word_link_id').getUrl(),
para:
{
templet_code:
templet_code
},
success:
function()
{
//
下载
var
doc_code =
'拖车授权委托书-'
;
var
url_l =
$('con_contract_down_zip_link_id').getUrl()
+
'?
templet_code=
'+templet_code+'
&
doc_code=
'
+
encodeURI(doc_code);
window.open(
href =
url_l,
target =
"_self"
);
Leaf.Masker.unmask(Ext.getBody());
},
error:
function()
{
Leaf.Masker.unmask(Ext.getBody());
},
failure:
function()
{
Leaf.Masker.unmask(Ext.getBody());
},
scope:
this
});
},
error:
function()
{
Leaf.Masker.unmask(Ext.getBody());
},
failure:
function()
{
Leaf.Masker.unmask(Ext.getBody());
},
scope:
this
});
}
]]
></script>
]]
></script>
<a:screen-include
screen=
"modules/cont/CON500/con_contract_get_layout_code.lview"
/>
<a:screen-include
screen=
"modules/cont/CON500/con_contract_get_layout_code.lview"
/>
...
@@ -619,7 +806,7 @@
...
@@ -619,7 +806,7 @@
<a:datas>
<a:datas>
<a:record
code_value=
"LEASE"
code_value_name=
"直租"
/>
<a:record
code_value=
"LEASE"
code_value_name=
"直租"
/>
<a:record
code_value=
"LEASEBACK"
code_value_name=
"售后回租"
/>
<a:record
code_value=
"LEASEBACK"
code_value_name=
"售后回租"
/>
<a:record
code_value=
"LEASEOPERAT"
code_value_name=
"经营性租赁"
/>
<a:record
code_value=
"LEASEOPERAT"
code_value_name=
"经营性租赁"
/>
</a:datas>
</a:datas>
</a:dataSet>
</a:dataSet>
<a:dataSet
id=
"repurchase_types_ds"
lookupCode=
"REPURCHASE_TYPES"
/>
<a:dataSet
id=
"repurchase_types_ds"
lookupCode=
"REPURCHASE_TYPES"
/>
...
@@ -680,7 +867,6 @@
...
@@ -680,7 +867,6 @@
queryUrl=
"${/request/@context_path}/autocrud/cont.CON620.con_contract_dun_for_repur_query/query"
queryUrl=
"${/request/@context_path}/autocrud/cont.CON620.con_contract_dun_for_repur_query/query"
selectable=
"true"
selectionModel=
"multiple"
>
selectable=
"true"
selectionModel=
"multiple"
>
</a:dataSet>
</a:dataSet>
<!--<a:dataSet id="bgt_contract_payment_detail_line_ds" fetchAll="true" model="cont.CON620.bgt_contract_payment_detail_line"/>-->
</a:dataSets>
</a:dataSets>
<a:screenBody>
<a:screenBody>
<a:screenTopToolbar>
<a:screenTopToolbar>
...
@@ -690,6 +876,9 @@
...
@@ -690,6 +876,9 @@
<a:gridButton
id=
"msg_money_id"
click=
"CON601_dun_msg_money"
text=
"催收短信发送(含金额)"
/>
<a:gridButton
id=
"msg_money_id"
click=
"CON601_dun_msg_money"
text=
"催收短信发送(含金额)"
/>
<a:gridButton
id=
"msg_no_money_id"
click=
"CON601_dun_msg_no_money"
text=
"催收短信发送(无金额)"
/>
<a:gridButton
id=
"msg_no_money_id"
click=
"CON601_dun_msg_no_money"
text=
"催收短信发送(无金额)"
/>
<a:gridButton
id=
"CON601_con_contract_download_btn"
click=
"CON601_con_contract_download"
text=
"下载催收函"
/>
<a:gridButton
id=
"CON601_con_contract_download_btn"
click=
"CON601_con_contract_download"
text=
"下载催收函"
/>
<a:gridButton
id=
"CON601_notice_of_termination_id"
click=
"CON601_notice_of_termination_download"
text=
"下载解约通知函"
/>
<a:gridButton
id=
"CON601_joint_responsibility_id"
click=
"CON601_joint_responsibility_download"
text=
"下载连带责任函"
/>
<a:gridButton
id=
"CON601_trailer_letter_id"
click=
"CON601_trailer_letter_download"
text=
"下载拖车授权委托书"
/>
<!--<a:gridButton id="CON601_con_contract_print_btn" click="CON601_con_contract_print" text="打印催收函"/>-->
<!--<a:gridButton id="CON601_con_contract_print_btn" click="CON601_con_contract_print" text="打印催收函"/>-->
</a:screenTopToolbar>
</a:screenTopToolbar>
...
...
src/main/webapp/modules/cont/CON620/create_content_download_collection.lsc
0 → 100644
View file @
538aadbc
<?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[
importPackage(java.io);
importPackage(Packages.hls.plugin.docx4j)
importPackage(Packages.org.apache.commons.io);
function RandomString(length) {
var str = '';
for (;str.length < length;str += Math.random().toString(36).substr(2));
return str.substr(0, length);
}
//删除文件
function deleteFile(filePath) {
var file = new File(filePath);
if (file.exists()) {
file.delete();
}
}
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 getDatePath() {
set_parameter_file_path();
var file_path = $ctx.parameter.file_path; //file_path = c:/hls_test_files/content_files/
var now = new Date()
y = now.getFullYear()
m = now.getMonth() + 1
m = m < 10 ? "0" + m : m
var datePath = file_path + y + "/" + m + "/";
return datePath; //datePath = d:/hls_test_files/fileupload/2018/04/
}
function write_os_to_file(file, os) {
var fis = new FileInputStream(file);
var b = new java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024 * 64);
var len = -1;
while ((len = fis.read(b)) != -1) {
os.write(b, 0, len);
}
fis.close();
}
function download_file(file_path, file_name) {
$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");
resp.setHeader("Content-disposition", "attachment; filename=" + encodeURI(file_name, 'utf-8'));
resp.setDateHeader("Expires", 0);
resp.setContentType("application/x-msdownload");
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);
}
}
function collection_create_content() {
try {
//获取日期目录
set_parameter_file_path();
var datePath = getDatePath();
FileUtils.forceMkdir(new File(datePath)); //根据日期创建目录
var from_file_data_map = $bm('cont.CON620.con_contract_download_get_atm').queryAsMap({
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++) {
var to_file_path = $ctx.parameter.file_path;
var record_data = from_file_data[i];
if (record_data.file_exists_flag != 'Y') {
var to_file_name = record_data.to_file_name + '.' + record_data.file_type_code || 'doc';
var from_file_path = record_data.file_path;
$ctx.parameter.contract_id = record_data.contract_id;
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;
copyFile(from_file_path, to_file_path);
try {
var brwt = new BookmarksReplaceWithText($instance('leaf.database.service.IDatabaseServiceFactory'), $instance('uncertain.ocm.IObjectRegistry'), $ctx.getData());
brwt.replaceBookmarkFromContent(to_file_path.toString(), record_data.content_id);
} catch (e) {
raise_app_error(e);
}
$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());
//插入催收信息记录
$bm('cont.CON620.con_collection_message_create').update({
contract_id: record_data.contract_id,
templet_code: $ctx.parameter.templet_code
});
}
}
$ctx.parameter.return_status = 'S';
$ctx.parameter.return_message = '执行成功';
} catch (e) {
$ctx.success = "true";
$ctx.parameter.return_status = 'E';
$ctx.parameter.return_message = $ctx.get('/error/@message') || String(e);
raise_app_error(e);
}
var result = {
result: $ctx.parameter.return_status,
message: $ctx.parameter.return_message
};
$ctx.parameter.json = JSON.stringify(result);
}
if ($ctx.parameter.return_status != 'E' && $ctx.parameter.return_status != 'TIMEOUT') {
collection_create_content();
}
]]>
</s:server-script>
</a:init-procedure>
<a:service-output/>
</a:service>
src/main/webapp/modules/cont/CON620/create_content_for_collection.lsc
View file @
538aadbc
...
@@ -97,7 +97,7 @@
...
@@ -97,7 +97,7 @@
var datePath = getDatePath();
var datePath = getDatePath();
$ctx.parameter.batch_flag='Y';
$ctx.parameter.batch_flag='Y';
FileUtils.forceMkdir(new File(datePath)); //根据日期创建目录
FileUtils.forceMkdir(new File(datePath)); //根据日期创建目录
var from_file_data_map = $bm('cont.CON
500.con_doc_file_templet_get_atm_new
').queryAsMap({
var from_file_data_map = $bm('cont.CON
620.con_doc_file_templet_for_content
').queryAsMap({
contract_id: $ctx.parameter.contract_id,
contract_id: $ctx.parameter.contract_id,
batch_flag:$ctx.parameter.batch_flag,
batch_flag:$ctx.parameter.batch_flag,
templet_code: $ctx.parameter.templet_code
templet_code: $ctx.parameter.templet_code
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment