Commit d63dcf6f authored by 18083's avatar 18083

调整代码与正式环境一致

parent 06d6dbd0
......@@ -5,12 +5,12 @@
importPackage(java.io);
importPackage(Packages.hls.plugin.docx4j)
importPackage(Packages.org.apache.commons.io);
importPackage(Packages.com.hand.hl);
function RandomString(length) {
var str = '';
for (;str.length < length;str += Math.random().toString(36).substr(2));
return str.substr(0, length);
function RandomString(length) {   
var str = '';   
for (;str.length < length;str += Math.random().toString(36).substr(2));   
return str.substr(0, length); 
}
//删除文件
......@@ -37,7 +37,7 @@
//按日期创建目录
function getDatePath() {
set_pdf_parameter_file_path();
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()
......@@ -47,16 +47,6 @@
return datePath; //datePath = d:/hls_test_files/fileupload/2018/04/
}
function get_file_length(path){
var file=new File(String(path));
if(file.exists() && file.isFile()){
length=file.length();
return length;
}else{
return 0 ;
}
}
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);
......@@ -120,28 +110,19 @@
} 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()-->
<!-- });-->
$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());-->
var file_size=get_file_length(to_file_path);
var business_daily_email=$bm('cont.CON301N.insert_into_attachment_bmp').update({
p_file_path :(to_file_path).toString(),
p_file_name :($ctx.parameter.file_name+'.docx').toString(),
p_file_size :file_size,
p_user_id :$ctx.session.user_id,
p_contract_id :$ctx.parameter.contract_id,
p_file_type :'WORD',
p_lease_type :'02'
});
download_file(to_file_path.toString(),to_file_name.toString());
}
}
$ctx.parameter.return_status = 'S';
$ctx.parameter.return_message = '执行成功';
} catch (e) {
......
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