Commit 0999b034 authored by 陆正友's avatar 陆正友

Merge remote-tracking branch 'origin/master'

parents 88a7238f b4359d7d
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: 18083
$Date:
$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.bank_account_num vender_bank_account_number,
t.bank_account_name vender_bank_account_name,
bank_account_id vender_bank_account_id,
t.bank_full_name vender_bank_full_name,
(select bp_name from hls_bp_master hbm where hbm.bp_id=t.bp_id) vender_name
from hls_bp_master_bank_account_v t
where t.bp_id = (
select hli.vender_id
from hls_lease_item hli,con_contract_lease_item ccli
where hli.lease_item_id=ccli.lease_item_id
and ccli.contract_id=${/parameter/@contract_id}
)
and t.enabled_flag = 'Y'
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
......@@ -62,7 +62,7 @@
param['req_status'] = req_status;
param['url_title'] = '合同回购';
if (req_status == 'APPROVED' || req_status == 'APPROVING' || req_status == 'CANCEL') {
if (req_status == 'APPROVED' || req_status == 'APPROVING' || req_status == 'CANCEL'|| req_status == 'REJECT') {
param['maintain_type'] = 'READONLY';
param['function_code'] = 'CON_REPO001D_Q';
} else {
......
<?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 writeFile(zos, fn, fp) {
var ze = new ZipEntry(fn);
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();
}
function transfer(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 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
}
$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_str = getdate();
var doc_code = '付款请求书'
var zip_filename = doc_code + '-' + date_str + ".zip";
var file_path;
var fnd_atm_flag = $ctx.parameter.fnd_atm_flag;
resp.setDateHeader("Expires", 0);
resp.setContentType("application/x-msdownload");
try {
var attachment_batch_dl = $bm('hls.HLS811.hls_doc_file_templet_get_atm');
var result = attachment_batch_dl.queryAsMap({
document_id: $ctx.parameter.document_id,
document_table: $ctx.parameter.document_table,
batch_flag: $ctx.parameter.batch_flag,
content_id: $ctx.parameter.content_id
});
var arr = result.getChildren();
if (arr.length == 1) {
//单个下载
file_name = arr[0].download_file_name;
if (fnd_atm_flag == 'Y') {
file_path = arr[0].download_file_path;
} else {
file_path = arr[0].download_file_path + file_name;
}
resp.setHeader("Content-disposition", "attachment; filename=" + encodeURI(file_name, 'utf-8'));
var os = resp.getOutputStream();
transfer(file_path, os);
os.flush();
} else if (arr.length > 1) {
//打包下载
resp.setHeader("Content-disposition", "attachment; filename=" + encodeURI(zip_filename));
var zos = new ZipOutputStream(resp.getOutputStream());
var file_exist_list = {};
for (var i = 0;i < arr.length;i++) {
var f = arr[i];
if (f.download_file_path && !file_exist_list[f.download_file_name]) {
writeFile(zos, f.download_file_name, f.download_file_path);
file_exist_list[f.download_file_name] = 1;
} else {
file_exist_list[f.download_file_name] = file_exist_list[f.download_file_name] * 1 + 1;
var last_index = f.download_file_name.lastIndexOf(".");
var temp_exists_file_name = f.download_file_name.substr(0, last_index);
var temp_exists_file_type = f.download_file_name.substr(last_index, f.download_file_name.length);
temp_exists_file_name = temp_exists_file_name + '-' + file_exist_list[f.download_file_name] + temp_exists_file_type;
writeFile(zos, temp_exists_file_name, f.download_file_name);
}
}
zos.close();
}
} catch (e) {
println(e);
var logger = $logger("server-script");
logger.severe(e.message);
}
]]></s:server-script>
</a:init-procedure>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<a:model-update model="hls.HLS811.hls_doc_file_templet_get_atm"/>
<s:server-script import="con_print_path.js"><![CDATA[
importPackage(Packages.hls.plugin.docx4j);
importPackage(java.io);
function copyFile(fOld, fNew) {
var fis = new java.io.FileInputStream(fOld);
var fos = new java.io.FileOutputStream(fNew);
var b = new java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024 * 4);
var len = -1;
while ((len = fis.read(b)) != -1) {
fos.write(b, 0, len);
}
fis.close();
fos.close();
}
function transfer(file_path, os) {
println(file_path);
var fis = new FileInputStream(file_path);
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_name, file_path) {
$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");
resp.setDateHeader("Expires", 0);
resp.setContentType("application/x-msdownload");
resp.setHeader("Content-disposition", "attachment; filename=" + encodeURI(file_name, 'UTF-8'));
var os = resp.getOutputStream();
transfer(file_path, os);
os.flush();
}
var attachment_batch_dl = $bm('hls.HLS811.hls_doc_file_templet_get_atm');
var result = attachment_batch_dl.queryAsMap({
document_id: $ctx.parameter.document_id,
document_table: $ctx.parameter.document_table,
batch_flag: $ctx.parameter.batch_flag,
content_id: $ctx.parameter.content_id
});
var from_file_data = result.getChildren();
for (var i = 0;i < from_file_data.length;i++) {
if (!$ctx.parameter.file_path) {
set_parameter_file_path();
}
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 + 'doc' + record_data.content_id;
copyFile(from_file_path, to_file_path);
$bm('hls.HLS811.hls_file_content_copy_update').update({
table_name: 'HLS_DOC_FILE_CONTENT',
content_id: record_data.content_id,
file_name: to_file_name.toString(),
file_path: to_file_path.toString(),
source_type: $ctx.parameter.source_type
});
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.toString(), 'COMMON');
//download_file(to_file_name, to_file_path);
} catch (e) {
raise_app_error(e);
}
}
]]></s:server-script>
</a:init-procedure>
</a:service>
......@@ -15,7 +15,7 @@
<a:link id="prj_project_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="prj_project_modify_link" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_create_tree_n.lview"/>
<a:link id="prj_project_bp_parameter_link" url="${/request/@context_path}/modules/prj/PRJ501/prj_project_bp_parameter.lview"/>
<!-- <a:link id="car_modify_link_readonly" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain_readonly.lview"/>-->
<!-- <a:link id="car_modify_link" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain_readonly.lview"/>-->
<a:link id="car_modify_link_readonly" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain.lview"/>
<a:link id="car_modify_link_readonly_c" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain_constru.lview"/>
<a:link id="car_modify_mananger_link" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain_manager.lview"/>
......@@ -23,6 +23,7 @@
<a:link id="car_modify_special_link" url="${/request/@context_path}/modules/prj/PRJ500N/prj_project_create_special.lview"/>
<a:link id="document_history_query_link_id" url="${/request/@context_path}/modules/prj/PRJ502N/prj_document_history_query.lview"/>
<script src="${/request/@context_path}/javascripts/hap/dynamicStopAutoQuery.js" type="text/javascript"/>
<a:link id="car_modify_operat_link" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain_opreat.lview"/>
<script type="text/javascript"><![CDATA[
// stopDymanicAutoQuery('${/parameter/@layout_code}', 'G_PROJECT_RESULT', 'prj_project');
function open_project_modify_win(record_id, ds_id) {
......@@ -31,11 +32,11 @@
var url;
//项目类layout_code
maintain_type = 'QUERY';
maintain_type = 'READONLY';
param = record.data;
param['document_id'] = record.get('project_id');
param['function_usage'] = 'MODIFY';
param['function_usage'] = 'QUERY';
param['bp_class'] = 'NP';
param['maintain_type'] = maintain_type;
param['url_title'] = '${l:HLS.PROJECT_MAITAIN}';
......@@ -52,10 +53,29 @@
}
function on_business_type_leaseoperat_win(record_id, ds_id) {
var record = $(ds_id).findById(record_id);
var url;
maintain_type = 'READONLY';
param = record.data;
param['document_id'] = record.get('project_id');
param['function_usage'] = 'QUERY';
param['bp_class'] = 'NP';
param['maintain_type'] = maintain_type;
param['url_title'] = '${l:HLS.PROJECT_MAITAIN}';
param['function_code'] = 'PRJ501_OPERAT_WFL';
url = 'car_modify_operat_link';
hls_doc_get_layout_code('prj_project_get_layout_code_link_id', param, url, ds_id);
}
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
if (name == 'project_number' && value) {
if(record.get('business_type')=='LEASE'||record.get('business_type')=='LEASEBACK'){
return '<a href="javascript:open_project_modify_win(\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>';
}else if(record.get('business_type')=='LEASEOPERAT'){
return '<a href="javascript:on_business_type_leaseoperat_win(\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>';
}
}
return value;
};
......@@ -156,7 +176,6 @@
document.getElementById("PROJECT_QUERY_ENTRANCE_F_QUERY_NULL_INVOICE_AGENT_ID_prompt").style.display = "none";
document.getElementById("PROJECT_QUERY_ENTRANCE_F_QUERY_NULL_INVOICE_AGENT_ID").style.display = "none";
}
//深圳美鹏和hcs显示分公司,其他隐藏
var bp_code = '${/model/user_agent_description/record/@bp_code}';
if (!Ext.isEmpty(bp_code) && bp_code !== 'D00010001' && bp_code !== 'D00000009') {
......
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