Commit 5629e417 authored by gzj34291's avatar gzj34291

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

parents 11183e05 d6cbd6ce
......@@ -221,28 +221,13 @@
<artifactId>spring-test</artifactId>
<version>5.3.14</version>
</dependency>
<dependency>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
<version>2.0.23</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.15</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.3.5</version>
<version>1.10</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.4</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
......@@ -250,12 +235,6 @@
<version>4.5.2</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
</dependencies>
<build>
......
......@@ -6,28 +6,22 @@ import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.RequestEntity;
import org.apache.commons.httpclient.methods.StringRequestEntity;
import org.apache.commons.httpclient.methods.multipart.FilePart;
import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.springframework.http.HttpHeaders;
import org.apache.commons.httpclient.methods.multipart.Part;
import org.apache.commons.httpclient.methods.multipart.StringPart;
import org.apache.commons.httpclient.params.HttpMethodParams;
import org.springframework.web.client.RestTemplate;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.*;
/**
* description
......@@ -69,7 +63,7 @@ public class HttpPostAttUtil {
public static String UploadFile(String url, Map<String, String> param, File file, String token, String tokentype ) throws Exception {
/*public static String UploadFile(String url, Map<String, String> param, File file, String token, String tokentype ) throws Exception {
try {
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append( url)
......@@ -92,7 +86,7 @@ public class HttpPostAttUtil {
HttpPost httpPost = new HttpPost(post_url);
MultipartEntityBuilder builder=MultipartEntityBuilder.create();
builder.addBinaryBody("file",file);
HttpEntity httpEntity=(HttpEntity)builder.build();
HttpEntity httpEntity=builder.build();
httpPost.setHeader("Authorization", tokentype+" "+token);
httpPost.setEntity(httpEntity);//设置请求参数
HttpResponse response = httpClient.execute(httpPost);
......@@ -102,6 +96,38 @@ public class HttpPostAttUtil {
} catch (Exception ex) {
return ex.getMessage() ;
}
}*/
public static String UploadFile(String url, Map<String, String> param, File file, String token, String tokentype ) throws Exception {
HttpClient httpClient = new HttpClient();
HttpServletResponse response = null;
PostMethod post = new PostMethod(url);
String resultString = "";
List<Part> list = new ArrayList<>();
httpClient.getHttpConnectionManager().getParams().setConnectionTimeout(5000);
try {
list.add(new FilePart("file", file));
if (param != null) {
for (String key : param.keySet()) {
list.add(new StringPart(key, param.get(key), "UTF-8"));
}
}
Part[] parts = list.toArray(new Part[list.size()]);
MultipartRequestEntity entity = new MultipartRequestEntity(parts, new HttpMethodParams());
post.setRequestEntity(entity);
post.addRequestHeader( "Authorization", tokentype+" "+token);
System.out.println(entity.getContentType());
int status = httpClient.executeMethod(post);
String result = post.getResponseBodyAsString() ;
System.out.println(result);
} catch (Exception e) {
e.printStackTrace();
} finally {
post.releaseConnection();
}
return "";
}
......
......@@ -14,8 +14,10 @@ import java.io.*;
import java.math.BigDecimal;
import java.net.URL;
import java.net.URLEncoder;
import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import javax.imageio.ImageIO;
......@@ -332,10 +334,19 @@ public class ConExportServiceImpl implements ConExportService {
if(x.compareTo((BigDecimal) map1.get("CF_ITEM")) ==0){
cell.setCellValue("");
}else {
DataFormat df = wb.createDataFormat(); // 此处设置数据格式
contentTable.setDataFormat(df.getFormat("#,##0.00"));//保留两位小数点
cell.setCellStyle(contentTable);
cell.setCellValue(new DecimalFormat().parse(map1.get("UNRECEIVED_AMOUNT").toString()).doubleValue());// 未收金额
// 系统时间大于应收日的才set值
DateFormat dft = new SimpleDateFormat("yyyy-MM-dd");
Date dueDate = dft.parse((String) map1.get("DUE_DATE"));
// 去除时分秒
Date now = dft.parse(dft.format(new Date()));
if(Objects.nonNull(dueDate) && now.compareTo(dueDate) == 1){
DataFormat df = wb.createDataFormat(); // 此处设置数据格式
contentTable.setDataFormat(df.getFormat("#,##0.00"));//保留两位小数点
cell.setCellStyle(contentTable);
cell.setCellValue(new DecimalFormat().parse(map1.get("UNRECEIVED_AMOUNT").toString()).doubleValue());// 未收金额
}else{
cell.setCellValue("");
}
}
} else {
cell.setCellValue(""); // 未收金额
......
<?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 v.code_value_name archive_type_desc
from sys_code_values_v v
where v.code = 'ARCHIVE_TYPE'
and v.code_value = ${@archive_type}
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="archive_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ARCHIVE_TYPE_DESC"/>
</bm:fields>
</bm:model>
......@@ -92,9 +92,13 @@
<bm:query-field name="description" queryExpression="t1.description like &apos;%&apos;||${@description}||&apos;%&apos;"/>
<bm:query-field name="query_reversed_flag" queryExpression="(${@query_reversed_flag}=&apos;Y&apos; and nvl(t1.reversed_flag,&apos;N&apos;)=&apos;N&apos;)"/>
<bm:query-field name="status_list_flag" queryExpression="(${@status_list_flag}=&apos;Y&apos; and t1.status in (&apos;U&apos;,&apos;B&apos;))"/>
<bm:query-field name="gld_flag" queryExpression="exists (select 1 from gld_je_transaction d where d.je_transaction_code = t1.je_transaction_code and d.gld_flag = ${@gld_flag})"/>
<!--<bm:query-field name="gld_flag" queryExpression="exists (select 1 from gld_je_transaction d where d.je_transaction_code = t1.je_transaction_code and d.gld_flag = ${@gld_flag})"/>-->
<bm:query-field name="bp_id_tenant" queryExpression="exists (select 1 from hls_journal_detail_v dv where dv.reference1=(select a.bp_code from hls_bp_master a where a.bp_id=${@bp_id_tenant} )and dv.journal_header_id=t1.journal_header_id )"/>
<bm:query-field name="desc" queryExpression="t1.description like &apos;%&apos;||${@desc}||&apos;%&apos; "/>
<bm:query-field name="post_sap" queryExpression="(decode(t1.sap_belnr,null,'N','Y') = ${@post_sap})"/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filter name="query" expression="(CASE WHEN ${/session/@role_id} in (select role_id from sys_role where role_code in('HAND','0017')) THEN nvl(t1.manual_flag,&apos;N&apos;) else 'N' end =&apos;N&apos;)"/>
</bm:data-filters>
</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:fields>
<bm:field name="year"/>
<bm:field name="month"/>
<bm:field name="base_journal_dir"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select sys_parameter_pkg.value('HLS_JOURNAL_DIR') base_journal_dir,
to_char(sysdate,'yyyy') year,
to_char(sysdate,'mm') month
from dual
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2023-03-21 14:20:22
$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
delete from hls_journal_imp_tem ot where ot.session_id = ${/session/@session_id};
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
BEGIN
INSERT INTO hls_journal_imp_tem
(session_id, journal_header_id)
VALUES
(${/session/@session_id}, ${@journal_header_id});
END;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select ot.journal_header_id from hls_journal_imp_tem ot where ot.session_id = ${/session/@session_id}
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
......@@ -11,6 +11,9 @@
<bm:query-sql><![CDATA[
select * from (
select t1.journal_header_id,
t1.batch_id,
t1.batch_number,
t1.reverse_batch_number,
t1.journal_submit_batch_id,
t1.journal_num,
t1.error_message,
......@@ -58,6 +61,9 @@
and t1.journal_type in('COST_IMPORT','GLOBAL_TEMPLATE')
union
select t1.journal_header_id,
t1.batch_id,
t1.batch_number,
t1.reverse_batch_number,
t1.journal_submit_batch_id,
t1.journal_num,
t1.error_message,
......@@ -105,6 +111,9 @@
and t1.journal_type in('FUND_POOL','FINANCIAL_TEMPLATE')
union
select t1.journal_header_id,
t1.batch_id,
t1.batch_number,
t1.reverse_batch_number,
t1.journal_submit_batch_id,
t1.journal_num,
t1.error_message,
......@@ -148,10 +157,13 @@
EXISTS (SELECT 1
FROM exp_emp_assign_e_v t
WHERE t.user_id = ${/session/@user_id}
AND t.position_code IN ('026'))
AND t.position_code IN ('026','025'))
and t1.journal_type in('GENERAL_SALARIES','BPO_SALARIES')
union
select t1.journal_header_id,
t1.batch_id,
t1.batch_number,
t1.reverse_batch_number,
t1.journal_submit_batch_id,
t1.journal_num,
t1.error_message,
......@@ -191,28 +203,29 @@
where t.journal_header_imp_id = t1.journal_header_id
) post_gl_status
FROM hls_journal_header_imp t1
where
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
)
where EXISTS (SELECT 1
FROM exp_emp_assign_e_v t
WHERE t.user_id = ${/session/@user_id}
AND t.position_code IN ('002','013') or ${/session/@user_id} = 10418
)
and t1.journal_type in('GENERAL_SALARIES','BPO_SALARIES','COST_IMPORT','FUND_POOL','GLOBAL_TEMPLATE','FINANCIAL_TEMPLATE')
) t1
) 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_num" queryExpression="t1.journal_num like &apos;%&apos;||${@journal_num}||&apos;%&apos;"/>
<bm:query-field name="batch_number" queryExpression="t1.batch_number like &apos;%&apos;||${@batch_number}||&apos;%&apos;"/>
<bm:query-field name="reverse_batch_number" queryExpression="t1.reverse_batch_number like &apos;%&apos;||${@reverse_batch_number}||&apos;%&apos;"/>
<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="description" queryExpression="t1.description like &apos;%&apos;||${@description}||&apos;%&apos;"/>
<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:query-fields>
</bm:model>
......@@ -10,6 +10,7 @@
<bm:operation name="query">
<bm:query-sql><![CDATA[
select t1.journal_header_id,
t1.batch_id,
t1.journal_submit_batch_id,
t1.journal_num,
t1.error_message,
......@@ -59,13 +60,13 @@
</bm:data-filters>
<bm:query-fields>
<bm:query-field name="journal_num" queryExpression="t1.journal_num like ${@journal_num}"/>
<bm:query-field name="journal_num" queryExpression="t1.journal_num like &apos;%&apos;||${@journal_num}||&apos;%&apos;"/>
<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="description" queryExpression="t1.description like &apos;%&apos;||${@description}||&apos;%&apos;"/>
<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>
......
......@@ -54,13 +54,13 @@
</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_num" queryExpression="t1.journal_num like &apos;%&apos;||${@journal_num}||&apos;%&apos;"/>
<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="description" queryExpression="t1.description like &apos;%&apos;||${@description}||&apos;%&apos;"/>
<bm:query-field name="wfl_status" queryExpression="t1.wfl_status=${@wfl_status}"/>
</bm:query-fields>
</bm:model>
......@@ -8,6 +8,7 @@
hls_journal_import_pkg.insert_hls_journal_tmp(p_user_id => ${/session/@user_id},
p_header_id => ${@header_id},
p_company_id => ${/session/@company_id},
p_count =>${@v_count},
p_template_type=>${@template_type}
);
END;
......@@ -16,14 +17,17 @@
<bm:parameter inputPath="/session/@user_id"/>
<bm:parameter inputPath="/session/@session_id"/>
<bm:parameter inputPath="/session/@template_type"/>
<bm:parameter name="v_count" dataType="java.lang.Long" input="false" output="true" outputPath="@v_count"/>
</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},
hls_journal_import_pkg.init_other_journal_atm(p_session_id =>${/session/@session_id},
p_file_path =>${@file_path},
p_file_name =>${@file_name},
p_file_type =>${@file_type},
p_file_length =>${@file_length},
p_user_id =>${/session/@user_id});
END;
......
......@@ -56,7 +56,7 @@
</bm:query-fields>
<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;)) 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} in (select role_id from sys_role where role_code in ('0017','HAND')) and t1.workflow_code not in (&apos;HLS_JOURNAL_WFL&apos;, &apos;HLS_JOURNAL_REVERSE_WFL&apos;)) or (${/session/@role_id} not in (select role_id from sys_role where role_code in('0005', '0006', '0008', '0012', '0013', '0014','0017','HAND')) and 1 = 1)
or( ((t1.SUBMITTED_BY = ${/session/@user_id}) or (
(${/session/@user_id}
in (Select t.user_id
......
......@@ -63,7 +63,7 @@
var ds = $('cloumn_para_ds');
var records=ds.getAll();
var paras = [];
var detail_masks = Ext.getBody();
var detail_mask = Ext.getBody();
var base_archive_id='${/parameter/@record_id}';
console.log(base_archive_id);
for(var n=0;n<records.length;n++){
......
......@@ -111,8 +111,8 @@
params: {
record_id: record_id
},
height: 350,
width: 700
height: 200,
width: 1100
});
}
......@@ -128,8 +128,8 @@
params: {
record_id: record_id
},
height: 350,
width: 700
height: 550,
width: 800
});
}
......
......@@ -12,28 +12,33 @@
return new CompositeMap("a", 'http://www.aurora-framework.org/application',
name);
}
var para = $ctx.current_parameter || $ctx.parameter;
var para = $ctx.current_parameter || $ctx.parameter;
var logger = $logger('server-script');
var sql_content;
var query_validation_sql_bm = $bm('efile.EFILE1030.efile_pool_att_para_sql');
var query_archive_type_bm = $bm('efile.EFILE1030.efile_archive_type_sql');
var config_map = query_validation_sql_bm.queryAsMap(para);
var config_map_detail = config_map.getChildren();
logger.info(config_map_detail.length);
if (config_map_detail.length != 0) {
sql_content = config_map_detail[0].sql_content;
logger.info(sql_content);
para.sql_content = sql_content;
}
//println(sql_content);
var obj;
var dataSet_id='att_json_ds';
var obj;
var dataSet_id='att_json_ds';
if(typeof(sql_content)!="undefined"){
sql_content = '{'+sql_content+'}';
sql_content ='{'+sql_content+'}';
obj = JSON.parse(sql_content).attachmentList;
}else{
obj='';
}
var config = $config();
var dataSets = CompositeUtil.findChild(config, 'dataSets');
var dataSet = CompositeUtil.findChild(dataSets, 'dataSet', 'id', dataSet_id);
if (!dataSet) {
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';
......@@ -42,19 +47,25 @@
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());
if(obj.length>0){
// dataSets.addChild(dataSet.getData());
// dataSet.id = 'att_json_ds';
// dataSet.autocreate = 'true';
// dataSets.addChild(dataSet.getData());
// var datas = newMap("datas");
// dataSet.addChild(datas.getData());
if(obj.length>0){
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;
var archive_type_desc_data=query_archive_type_bm.queryAsMap({
archive_type : obj[k].attachTypeCode
});
var archive_type_desc=archive_type_desc_data.getChildren()[0].archive_type_desc;
datasRecord.archive_type_desc=archive_type_desc;
datas.addChild(datasRecord.getData());
//println(datasRecord.code_value+":"+datasRecord.code_value_name);
......@@ -80,11 +91,11 @@
<a:dataSets>
</a:dataSets>
<a:screenBody>
<a:grid id="att_para_ds_id" bindTarget="att_json_ds" height="180" width="760" navBar="true">
<a:grid id="att_para_ds_id" bindTarget="att_json_ds" height="180" width="1050" 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:column name="code_value" prompt="附件地址" width="650"/>
<a:column name="code_value_name" prompt="附件名称" width="250"/>
</a:columns>
</a:grid>
</a:screenBody>
......
......@@ -76,10 +76,10 @@
<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:grid id="post_stru_para_ds_id" bindTarget="post_stur_json_ds" marginHeight="480" width="740" navBar="true">
<a:columns>
<a:column name="code_value" prompt="字段代码" width="150"/>
<a:column name="code_value_name" prompt="值内容" width="200"/>
<a:column name="code_value_name" prompt="值内容" width="589"/>
</a:columns>
</a:grid>
</a:screenBody>
......
<?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="hls.HLS536.hls_attachment_tmp" trace="true"/>
<a:batch-apply sourcepath="/parameter/details">
<a:model-insert model="hls.HLS536.hls_attachment_tmp" trace="true"/>
</a:batch-apply>
</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>
<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: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>
......
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<p:echo/>
<s:server-script><![CDATA[
importPackage(java.io);
var request = $ctx['_instance.javax.servlet.http.HttpServletRequest'];
var response = $ctx['_instance.javax.servlet.http.HttpServletResponse'];
try{
data = $bm('hls.HLS536.excel_system_parameter').queryAsMap().getChildren();
var base_dir=data[0].base_journal_dir;
var year=data[0].year;
var month=data[0].month;
var factory = new Packages.org.apache.commons.fileupload.disk.DiskFileItemFactory();
var up = new Packages.org.apache.commons.fileupload.servlet.ServletFileUpload(factory);
var items = up.parseRequest(request);
var i = items.iterator();
while (i.hasNext()) {
var item = i.next();
if (item.isFormField()) {
println("item.getFieldName()"+item.getFieldName() + "=" + item.getString());
} else {
var file_old_name =item.getName();
//println('文件名'+file_old_name);
var file_type_name = item.getName().substr(item.getName().lastIndexOf("."));
var file_type = item.getName().substr(item.getName().lastIndexOf(".")+1);
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();
var file_name=guid_file_name_tables[0].guid_file_name;
var file_path = base_dir+year+"\\"+month+"\\";
var dir=new File(String(file_path));
if(!dir.exists()){
createDir(file_path);
}
var f = item.getStoreLocation();
var input,output;
var tempFile=new File(String(f));
try{
input = new FileInputStream(tempFile);
output = new FileOutputStream(file_path+file_name);
var buf = new java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024);
var bytesRead;
while ((bytesRead = input.read(buf)) > 0) {
output.write(buf, 0, bytesRead);
}
input.close();
output.close();
}catch(e){
//删除临时表
$bm('hls.HLS536.hls_attachment_tmp').delete();
println('上传文件出错,请联系管联系管理员理员!e'+e);
if(input!=null){
input.close();
}
if(output!=null){
output.close();
}
raise_app_error('上传文件出错,请联系管理员!');
println('上传文件出错,请联系管理员!e');
}
var file_length=get_file_length(file_path+file_name);
//文件上传成功后进行附件挂载
$bm('hls.HLS536.insert_hls_journal_tmp').update({
"file_path":String(file_path+file_name),
"file_name":file_old_name,
"file_type":file_type,
file_length:file_length
})
//删除临时表
$bm('hls.HLS536.hls_attachment_tmp').delete();
}
}
}catch (e) {
//删除临时表
$bm('hls.HLS536.hls_attachment_tmp').delete();
raise_app_error(e);
}
function createDir(dir){
var file=new File(String(dir));
if(!file.exists()){//如果文件夹不存在
file.mkdirs();//创建文件夹
}
}
//获取文件长度
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;
}
}
]]></s:server-script>
</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>
......@@ -14,7 +14,6 @@
<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}');
......@@ -69,10 +68,28 @@
height: 400
});
win.on('close', function() {
hls536_journal_query();
$('hls_journal_header_result_ds').query();
});
}
function attachment_upload(val,rec,name){
return '<a href=javascript:open_other_attachment_download('+rec.get('journal_header_id')+')>其它附件</a>';
}
//其它附件下载
function open_other_attachment_download(record_id){
var url = $('journal_attachment_uploadFile_id').getUrl() + '?table_name=HLS_JOURNAL_DETAIL_IMP&header_id=' + record_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'other_attachment_uploadFile_id',
width: 850,
height: 400
});
win.on('close', function() {
$('hls_journal_header_result_ds').query();
});
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
......@@ -120,6 +137,7 @@
<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="other_attachment_file" prompt="其它附件" width="120" renderer="attachment_upload" align="center"/>
<!--<a:column name="error_message" prompt="错误信息" width="150"/>-->
<!--<a:column name="attachment_file" prompt="附件" width="120" renderer="receipt_attachment_upload" align="center"/>-->
</a:columns>
......
......@@ -3,7 +3,7 @@
<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="${/model/header/record/@header_id}" attribute5="D:\u01\hls_file\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"/>-->
......@@ -22,11 +22,16 @@
para: param,
success: function (res) {
Leaf.Masker.unmask(Ext.getBody());
if(res.result.v_count>0){
Leaf.showInfoMessage('成功','导入成功!',function(){
window.location.href = $('hls_journal_entrance_import_link').getUrl();
window.location.href = $('hls_journal_entrance_import_link').getUrl();
});
}else{
Leaf.showInfoMessage('失败','导入失败!',function(){
window.location.href = $('hls_journal_entrance_import_link').getUrl();
});
}
},
failure: function (res) {
Leaf.Masker.unmask(Ext.getBody());
......
<?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"/>
......
......@@ -56,7 +56,7 @@
}
function receipt_attachment_upload(val,rec,name){
return '<a href=javascript:open_upload_window('+rec.get('journal_header_id')+')>附件</a>';
return '<a href=javascript:open_upload_window('+rec.get('journal_header_id')+')>凭证模板附件</a>';
}
function open_upload_window(record_id){
......@@ -73,6 +73,24 @@
});
}
function attachment_upload(val,rec,name){
return '<a href=javascript:open_attachment_upload('+rec.get('journal_header_id')+')>其它附件</a>';
}
function open_attachment_upload(record_id){
var url = $('journal_attachment_uploadFile_id').getUrl() + '?table_name=HLS_JOURNAL_DETAIL_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>
......@@ -124,7 +142,8 @@
<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:column name="attachment_file" prompt="凭证模板附件" width="120" renderer="receipt_attachment_upload" align="center"/>
<a:column name="other_attachment_file" prompt="其它附件" width="120" renderer="attachment_upload" align="center"/>
</a:columns>
</a:grid>
</a:screenBody>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2023-3-20 下午1:49:19
$Revision: 1.0
$Purpose: 手工凭证其它附件导入
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:init-procedure/>
<a:view>
<script type="text/javascript"><![CDATA[
function saveClick(){
if (document.getElementById('importFile').value){
var fileName = document.getElementById('importFile').value;
var fileType = fileName.substr(fileName.lastIndexOf("."));
document.getElementById('importForm').submit();
}
}
]]></script>
<a:dataSets>
<a:dataSet id="label_ds" autoCreate="true">
</a:dataSet>
</a:dataSets>
<a:fieldSet style="margin-left:10px;margin-top:10px;" title="导入文件" width="400">
<form name="upload" id="importForm" action="hls_journal_attach_trans_upload.lview?session_id=${/parameter/@session_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:50px;margin-top:10px;width:60px;" type="button" value="导入"/>
</form>
</a:fieldSet>
</a:view>
</a:screen>
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