Commit fc848c9a authored by gzj34291's avatar gzj34291

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

parents 77c7add6 86393199
......@@ -216,6 +216,47 @@
<artifactId>spring-core</artifactId>
<version>5.3.14</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<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>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.4</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.5.2</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
</dependencies>
<build>
<finalName>hlcm</finalName>
......
package com.hand.att;
import org.apache.commons.httpclient.HttpClient;
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.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.springframework.web.client.RestTemplate;
import java.io.File;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
/**
* description
*
* @author Administrator 2023/01/03 15:07
*/
public class HttpPostAttUtil {
public static String httpPostAttImport(String postUrl, String data,String token,String tokentype){
try {
PostMethod postMethod = null;
HttpClient httpClient = new HttpClient();
postMethod = new PostMethod(postUrl) ;
RequestEntity entity = null;
postMethod.setRequestHeader("Content-Type", "application/json") ;
postMethod.setRequestHeader("Authorization", tokentype+" "+token) ;
//参数设置,需要注意的就是里边不能传NULL,要传空字符串
entity = new StringRequestEntity(data, "application/json", "UTF-8");
// 设置请求体信息
postMethod.setRequestEntity(entity);
// 执行POST方法
int response = httpClient.executeMethod(postMethod);
String result = postMethod.getResponseBodyAsString() ;
return result;
} catch (Exception e) {
return "{\n" +
" \"error\": \"interError\",\n" +
" \"message\": \"请求接口失败\",\n" +
" \"path\": \"/oauth/token\"\n" +
"}";
}
}
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)
.append("?");
int i=1;
Set<Map.Entry<String, String>> set = param.entrySet();
Iterator<Map.Entry<String, String>> it = set.iterator();
while (it.hasNext()) {
Map.Entry<String, String> entry = (Map.Entry<String, String>) it.next();
if(i==1){
stringBuffer.append(entry.getKey()+"="+entry.getValue());
i++;
}else{
stringBuffer.append("&"+entry.getKey()+"="+entry.getValue());
}
}
String post_url = stringBuffer.toString();
System.out.println(post_url);
CloseableHttpClient httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(post_url);
MultipartEntityBuilder builder=MultipartEntityBuilder.create();
builder.addBinaryBody("file",file);
HttpEntity httpEntity=(HttpEntity)builder.build();
httpPost.setHeader("Authorization", tokentype+" "+token);
httpPost.setEntity(httpEntity);//设置请求参数
HttpResponse response = httpClient.execute(httpPost);
HttpEntity responseEntity = response.getEntity();
String result = EntityUtils.toString(responseEntity, java.nio.charset.Charset.forName("UTF-8"));
return result;
} catch (Exception ex) {
return ex.getMessage() ;
}
}
public static void main(String[] args) throws Exception {
//String resPonse=httpPostAttImport("http://apistage.huilianyi.com/gateway/e-archives/api/open/v1/import/document","[{\"companyCode\":\"0001\",\"particularYear\":\"2022\",\"documentTypeCode\":\"DT002002\",\"originalNumber\":\"1234567890\",\"primaryField\":\"SAP_TEST0000001\",\"isPaper\":\"true\",\"documentSource\":\"SAP\",\"attachmentList\":[{\"fileURL\":\"https://gss0.baidu.com/-vo3dSag_xI4khGko9WTAnF6hhy/zhidao/pic/item/314e251f95cad1c8ea88af74793e6709c93d51b5.jpg\",\"fileName\":\"314e251f95cad1c8ea88af74793e6709c93d51b5.jpg\",\"attachmentOID\":\"\"},{\"fileURL\":\"https://gss0.baidu.com/-vo3dSag_xI4khGko9WTAnF6hhy/zhidao/pic/item/314e251f95cad1c8ea88af74793e6709c93d51b5.jpg\",\"fileName\":\"314e251f95cad1c8ea88af74793e6709c93d51b5.jpg\",\"attachmentOID\":\"\",\"attachTypeCode\":\"0\"}],\"ruleOID\":\"684fb42f-1df4-4710-8ac7-ea0146786a05\",\"securityLevelCode\":\"CONFIDENTIAL\",\"fieldValueList\":[{\"fieldCode\":\"AMOUNT\",\"value\":\"13\"},{\"fieldCode\":\"COMPANY\",\"value\":\"阳光照明\"},{\"fieldCode\":\"DOC_NAME\",\"value\":\"日常报销单\"},{\"fieldCode\":\"CURRENCY\",\"value\":\"CNY\"},{\"fieldCode\":\"CREATED_DATE\",\"value\":\"2021-01-01 12:00:00\"},{\"fieldCode\":\"CREATION_NAME\",\"value\":\"张三\"},{\"fieldCode\":\"REMARK\",\"value\":\"去年的报销\"}]}]","4557fa35-d2da-479a-be68-323b6be619d9","Bearer");
File file=new File("D:\\aurora_reference.pdf");
HashMap mmp = new HashMap();
mmp.put("documentTypeCode", "workflow_QC01");
mmp.put("primaryField", "CF-4252CE7A665C4562BF8E8AC3AD79BF1D");
mmp.put("documentSource", "CF");
mmp.put("companyCode", "HL");
//String resPonse1=doPostFile1("http://apistage.huilianyi.com/gateway/e-archives/api/open/v1/attachment/upload",mmp,file,"4557fa35-d2da-479a-be68-323b6be619d9","Bearer");
String resPonse2=UploadFile("http://apistage.huilianyi.com/gateway/e-archives/api/open/v1/attachment/upload",mmp,file,"4557fa35-d2da-479a-be68-323b6be619d9","Bearer");
System.out.println(resPonse2);
}
}
package com.hand.attDownload;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
public class attDownload {
public static void downloadFile(HttpServletRequest request, HttpServletResponse response,String filePath,String fileName)
throws IOException {
// 本地文件地址,文件名称,我是在本机运行,如果是服务器的话,地址可能是 ../fileServer/file/deploy2.sh
// String filePath = "D:\\project\\hl_leasing\\file\\2023\\02\\8DAA574FA8714BE9B22B861A6F55AE01";
// String fileName = "8DAA574FA8714BE9B22B861A6F55AE01";
// 获取浏览器的信息
String agent = request.getHeader("USER-AGENT");
if (agent != null && agent.toLowerCase().indexOf("FIRE_FOX") > 0) {
//火狐浏览器自己会对URL进行一次URL转码所以区别处理
response.setHeader("Content-Disposition",
"attachment; filename=" + new String(fileName.getBytes("GB2312"), "ISO-8859-1"));
} else if (agent.toLowerCase().indexOf("SAFARI") > 0) {
//苹果浏览器需要用ISO 而且文件名得用UTF-8
response.setHeader("Content-Disposition",
"attachment; filename=" + new String(fileName.getBytes("UTF-8"), "ISO-8859-1"));
} else {
//其他的浏览器
response.setHeader("Content-Disposition",
"attachment; filename=\"" + java.net.URLEncoder.encode(fileName, "UTF-8"));
}
response.setContentType("charset=utf-8");
String result = "{\"statusCode\":\"00000\",\"message\":\"success\"}";
// 返回数据
response.getWriter().print(result);
File file = new File(filePath);
FileInputStream fileInputStream = new FileInputStream(file);
byte[] fileByte = new byte[(int) file.length()];
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
byte[] bytes = new byte[1024];
int len;
while ((len = fileInputStream.read(bytes, 0, bytes.length)) != -1) {
byteArrayOutputStream.write(bytes, 0, len);
}
byteArrayOutputStream.close();
fileByte = byteArrayOutputStream.toByteArray();
OutputStream outputStream = null;
outputStream = response.getOutputStream();
outputStream.write(fileByte);
outputStream.flush();
outputStream.close();
}
public static void downloadUitl(HttpServletResponse response,String filePath,String fileName)
throws IOException {
// 本地文件地址,文件名称,我是在本机运行,如果是服务器的话,地址可能是 ../fileServer/file/deploy2.sh
// String filePath = "D:\\project\\hl_leasing\\file\\2023\\02\\8DAA574FA8714BE9B22B861A6F55AE01";
// String fileName = "8DAA574FA8714BE9B22B861A6F55AE01";
File file = new File(filePath);
FileInputStream fileInputStream = new FileInputStream(file);
byte[] fileByte = new byte[(int) file.length()];
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
byte[] bytes = new byte[1024];
int len;
while ((len = fileInputStream.read(bytes, 0, bytes.length)) != -1) {
byteArrayOutputStream.write(bytes, 0, len);
}
byteArrayOutputStream.close();
fileByte = byteArrayOutputStream.toByteArray();
OutputStream outputStream = null;
outputStream = response.getOutputStream();
outputStream.write(fileByte);
outputStream.flush();
outputStream.close();
}
public static void main(String[] args) throws Exception {
File file=new File("D:\\aurora_reference.pdf");
String filePath = "D:\\project\\hl_leasing\\file\\2023\\02\\8DAA574FA8714BE9B22B861A6F55AE01";
String fileName = "8DAA574FA8714BE9B22B861A6F55AE01";
}
}
package com.hand.hl;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.RequestEntity;
import org.apache.commons.httpclient.methods.StringRequestEntity;
/**
* description
*
* @author lcl 2023/02/15 15:07
*/
public class HttpPostUtilNew {
public HttpPostUtilNew() {
}
public static String httpPostDocImport(String postUrl, String data, String token, String tokentype) {
try {
PostMethod postMethod = null;
HttpClient httpClient = new HttpClient();
postMethod = new PostMethod(postUrl);
RequestEntity entity = null;
postMethod.setRequestHeader("Content-Type", "application/json");
postMethod.setRequestHeader("Authorization", tokentype + " " + token);
entity = new StringRequestEntity(data, "application/json", "UTF-8");
postMethod.setRequestEntity(entity);
System.out.println(data);
httpClient.executeMethod(postMethod);
String result = postMethod.getResponseBodyAsString();
return result;
} catch (Exception var9) {
return "{\n \"error\": \"interError\",\n \"message\": \"请求接口失败\",\n \"path\": \"/oauth/token\"\n}";
}
}
public static void main(String[] args) throws Exception {
String resPonse = httpPostDocImport("http://apistage.huilianyi.com/gateway/e-archives/api/open/v1/import/document", "[{\"companyCode\":\"0001\",\"particularYear\":\"2022\",\"documentTypeCode\":\"DT002002\",\"originalNumber\":\"1234567890\",\"primaryField\":\"SAP_TEST0000001\",\"isPaper\":\"true\",\"documentSource\":\"SAP\",\"attachmentList\":[{\"fileURL\":\"https://gss0.baidu.com/-vo3dSag_xI4khGko9WTAnF6hhy/zhidao/pic/item/314e251f95cad1c8ea88af74793e6709c93d51b5.jpg\",\"fileName\":\"314e251f95cad1c8ea88af74793e6709c93d51b5.jpg\",\"attachmentOID\":\"\"},{\"fileURL\":\"https://gss0.baidu.com/-vo3dSag_xI4khGko9WTAnF6hhy/zhidao/pic/item/314e251f95cad1c8ea88af74793e6709c93d51b5.jpg\",\"fileName\":\"314e251f95cad1c8ea88af74793e6709c93d51b5.jpg\",\"attachmentOID\":\"\",\"attachTypeCode\":\"0\"}],\"ruleOID\":\"684fb42f-1df4-4710-8ac7-ea0146786a05\",\"securityLevelCode\":\"CONFIDENTIAL\",\"fieldValueList\":[{\"fieldCode\":\"AMOUNT\",\"value\":\"13\"},{\"fieldCode\":\"COMPANY\",\"value\":\"阳光照明\"},{\"fieldCode\":\"DOC_NAME\",\"value\":\"日常报销单\"},{\"fieldCode\":\"CURRENCY\",\"value\":\"CNY\"},{\"fieldCode\":\"CREATED_DATE\",\"value\":\"2021-01-01 12:00:00\"},{\"fieldCode\":\"CREATION_NAME\",\"value\":\"张三\"},{\"fieldCode\":\"REMARK\",\"value\":\"去年的报销\"}]}]", "4557fa35-d2da-479a-be68-323b6be619d9", "Bearer");
System.out.println(resPonse);
}
}
<?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
fam.table_name,
fam.table_pk_value,
fam.record_id,
faa.attachment_id,
faa.file_name,
faa.file_type_code,
faa.file_path
FROM
fnd_atm_attachment_multi fam,
fnd_atm_attachment faa
WHERE
faa.rowid =${@rowid} AND
fam.attachment_id = faa.attachment_id
]]></bm:query-sql>
<bm:parameters>
<bm:parameter name="rowid"/>
</bm:parameters>
</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_type_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_TYPE_CODE"/>
<bm:field name="file_path" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_PATH"/>
</bm:fields>
</bm:model>
<?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 * from (SELECT t1.pool_id,
t1.primary_field,
t1.internal_period_num,
t1.base_archive_code,
t1.archive_type,
t1.document_id,
t1.document_number,
t1.document_info,
t1.post_status,
(SELECT c.code_value_name FROM sys_code_values_v c where c.code='DATA_CLASSIFICATION' and c.code_value = t1.archive_type) archive_type_desc,
(SELECT c.code_value_name FROM sys_code_values_v c where c.code='YES_NO' and c.code_value = 'Y') suppl_trans_flag, t1.hly_req_number as post_batch_num,
t1.post_message
FROM hl_e_archives_pool t1
where t1.creation_date>=sysdate-30)
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="pool_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="POOL_ID" />
<bm:field name="primary_field" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PRIMARY_ID" />
<bm:field name="internal_period_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INTERNAL_PERIOD_NUM"/>
<bm:field name="base_archive_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BASE_ARCHIVE_CODE" />
<bm:field name="archive_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ARCHIVE_TYPE"/>
<bm:field name="document_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DOCUMENT_ID"/>
<bm:field name="document_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_NUMBER"/>
<bm:field name="post_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_NUMBER"/>
<bm:field name="document_info" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="POST_STATUS"/>
<bm:field name="post_message" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="POST_MESSAGE"/>
</bm:fields>
</bm:model>
......@@ -10,6 +10,7 @@
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT t1.pool_id,
t1.primary_field,
t1.internal_period_num,
t1.base_archive_code,
t1.archive_type,
......@@ -17,12 +18,10 @@
t1.document_number,
t1.document_info,
t1.post_status,
nvl((select gps.monthly_closed_flag from gld_periods gp,gld_period_status gps where replace(gp.period_name,'-','')=t1.internal_period_num and gps.company_id = ${/session/@company_id} and gp.internal_period_num=gps.internal_period_num and gps.period_set_code=gp.period_set_code),'N') monthly_closed_flag ,
(SELECT c.code_value_name FROM sys_code_values_v c where c.code='DATA_CLASSIFICATION' and c.code_value = t1.archive_type) archive_type_desc,
(SELECT c.code_value_name FROM sys_code_values_v c where c.code='YES_NO' and c.code_value = 'Y') suppl_trans_flag,
(SELECT c.code_value_name FROM sys_code_values_v c where c.code='POST_STATUS_DESC' and c.code_value =t1.post_status) post_status_desc,
'CM_xxxxxx' as cm_pk,
'xxxxx' as original_archive_no,
'xxxx' as post_batch_num,
t1.hly_req_number as post_batch_num,
t1.post_message
FROM hl_e_archives_pool t1
#WHERE_CLAUSE#
......@@ -80,12 +79,12 @@
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field field="internal_period_num" queryExpression="t1.internal_period_num =${@internal_period_num}"/>
<bm:query-field field="archive_type_desc" queryExpression="t1.archive_type_desc =${@archive_type_desc}"/>
<bm:query-field field="cm_pk" queryExpression="t1.cm_pk =${@cm_pk}"/>
<bm:query-field field="original_archive_no" queryExpression="t1.original_archive_no =${@original_archive_no}"/>
<bm:query-field field="post_status_desc" queryExpression="t1.post_status_desc =${@post_status_desc}"/>
<bm:query-field field="post_batch_num" queryExpression="t1.post_batch_num =${@post_batch_num}"/>
<bm:query-field field="suppl_trans_flag" queryExpression="t1.suppl_trans_flag =${@suppl_trans_flag}"/>
<bm:query-field name="internal_period_num" queryExpression="t1.internal_period_num =${@internal_period_num}"/>
<bm:query-field name="archive_type_desc" queryExpression="t1.archive_type_desc =${@archive_type_desc}"/>
<bm:query-field name="primary_field" queryExpression="t1.primary_field =${@primary_field}"/>
<bm:query-field name="document_info" queryExpression="t1.document_info =${@document_info}"/>
<bm:query-field name="post_status" queryExpression="t1.post_status =${@post_status}"/>
<bm:query-field name="post_batch_num" queryExpression="t1.post_batch_num =${@post_batch_num}"/>
<bm:query-field name="suppl_trans_flag" queryExpression="t1.suppl_trans_flag =${@suppl_trans_flag}"/>
</bm:query-fields>
</bm:model>
<?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 '{'||pt.atm_data_json||'}' sql_content
from hl_e_archives_pool_data pt
where pt.pool_id = ${@pool_id}
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="sql_content" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SQL"/>
</bm:fields>
</bm:model>
<?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 '{'||pt.stru_data_json||'}' sql_content
from hl_e_archives_pool_data pt
where pt.pool_id = ${@pool_id}
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="sql_content" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SQL"/>
</bm:fields>
</bm:model>
<?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 t1.pool_id,
t1.primary_field,
t1.internal_period_num,
t1.base_archive_code,
t1.archive_type,
t1.document_id,
t1.document_number,
t1.document_info,
t1.post_status,
(SELECT c.code_value_name FROM sys_code_values_v c where c.code='DATA_CLASSIFICATION' and c.code_value = t1.archive_type) archive_type_desc,
(SELECT c.code_value_name FROM sys_code_values_v c where c.code='YES_NO' and c.code_value = 'Y') suppl_trans_flag,
(SELECT c.code_value_name FROM sys_code_values_v c where c.code='POST_STATUS_DESC' and c.code_value =t1.post_status) post_status_desc,
t1.hly_req_number as post_batch_num,
t1.post_message
FROM hl_e_archives_pool t1
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
elec_wfl_pkg.att_upload_return(
p_primary_field =>${@primary_field},
p_status =>${@status},
p_message =>${@message},
p_attachmentoid =>${@attachmentoid},
p_hly_fileurl =>${@hly_fileurl},
p_user_id =>${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
elec_wfl_pkg.elec_type_update(
p_sql_type => 'UPDATE',
p_base_archive_id => ${@base_archive_id},
p_base_archive_code => ${@base_archive_code},
p_archive_type => ${@archive_type},
p_post_stru_data_flag => ${@post_stru_data_flag},
p_stru_data_sql => ${@stru_data_sql},
p_is_workflow => ${@is_workflow},
p_workflow_id => ${@workflow_id},
p_post_atm_flag => ${@post_atm_flag},
p_atm_sql => ${@atm_sql},
p_je_check_flag => ${@je_check_flag},
p_je_source_sql => ${@je_source_sql},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="delete">
<bm:update-sql><![CDATA[
begin
elec_wfl_pkg.elec_type_delete(
p_base_archive_id => ${@base_archive_id},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="internal_period_num" queryExpression="t1.internal_period_num =${@internal_period_num}"/>
<bm:query-field name="archive_type_desc" queryExpression="t1.archive_type_desc =${@archive_type_desc}"/>
<bm:query-field name="primary_field" queryExpression="t1.primary_field =${@primary_field}"/>
<bm:query-field name="document_info" queryExpression="t1.document_info like ${@document_info}"/>
<bm:query-field name="post_status_desc" queryExpression="t1.post_status_desc =${@post_status_desc}"/>
<bm:query-field name="post_batch_num" queryExpression="t1.post_batch_num =${@post_batch_num}"/>
<bm:query-field name="suppl_trans_flag" queryExpression="t1.suppl_trans_flag =${@suppl_trans_flag}"/>
</bm:query-fields>
</bm:model>
<?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 t1.pool_id,
t1.primary_field,
t1.internal_period_num,
t1.base_archive_code,
t1.archive_type,
t1.document_id,
t1.document_number,
t1.document_info,
t1.post_status,
(SELECT c.code_value_name FROM sys_code_values_v c where c.code='DATA_CLASSIFICATION' and c.code_value = t1.archive_type) archive_type_desc,
(SELECT c.code_value_name FROM sys_code_values_v c where c.code='YES_NO' and c.code_value = 'Y') suppl_trans_flag,
(SELECT c.code_value_name FROM sys_code_values_v c where c.code='POST_STATUS_DESC' and c.code_value =t1.post_status) post_status_desc,
t1.hly_req_number as post_batch_num,
t1.post_message
FROM hl_e_archives_pool t1
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
elec_wfl_pkg.doc_import_return(
p_primary_field =>${@primary_field},
p_post_status =>${@post_status},
p_post_message =>${@post_message},
p_hly_req_number =>${@hly_req_number},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
elec_wfl_pkg.elec_type_update(
p_sql_type => 'UPDATE',
p_base_archive_id => ${@base_archive_id},
p_base_archive_code => ${@base_archive_code},
p_archive_type => ${@archive_type},
p_post_stru_data_flag => ${@post_stru_data_flag},
p_stru_data_sql => ${@stru_data_sql},
p_is_workflow => ${@is_workflow},
p_workflow_id => ${@workflow_id},
p_post_atm_flag => ${@post_atm_flag},
p_atm_sql => ${@atm_sql},
p_je_check_flag => ${@je_check_flag},
p_je_source_sql => ${@je_source_sql},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="delete">
<bm:update-sql><![CDATA[
begin
elec_wfl_pkg.elec_type_delete(
p_base_archive_id => ${@base_archive_id},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="internal_period_num" queryExpression="t1.internal_period_num =${@internal_period_num}"/>
<bm:query-field name="archive_type_desc" queryExpression="t1.archive_type_desc =${@archive_type_desc}"/>
<bm:query-field name="primary_field" queryExpression="t1.primary_field =${@primary_field}"/>
<bm:query-field name="document_info" queryExpression="t1.document_info like ${@document_info}"/>
<bm:query-field name="post_status_desc" queryExpression="t1.post_status_desc =${@post_status_desc}"/>
<bm:query-field name="post_batch_num" queryExpression="t1.post_batch_num =${@post_batch_num}"/>
<bm:query-field name="suppl_trans_flag" queryExpression="t1.suppl_trans_flag =${@suppl_trans_flag}"/>
</bm:query-fields>
</bm:model>
<?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 pt.atm_data_json attachmentList,pt.stru_data_json as fieldValueList
from hl_e_archives_pool_data pt
where pt.pool_id = ${@pool_id}
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="fieldValueList"/>
<bm:field name="attachmentList"/>
</bm:fields>
</bm:model>
......@@ -2,8 +2,8 @@
<!--
$Author: trd
$Date: 2022-12-6 下午2:36:27
$Revision: 1.0
$Purpose:
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
......@@ -37,6 +37,7 @@
from sys_code_values_v v
where v.code = 'HLS536_WFL_STATUS'
and v.code_value = t1.wfl_status) wfl_status_n,
t1.reversed_flag,
t1.reverse_wfl_status,
(select v.code_value_name value_name
from sys_code_values_v v
......@@ -45,7 +46,8 @@
t1.journal_type,
(select t.post_gl_status
from hls_journal_header t
where t.journal_num = t1.journal_num) post_gl_status
where t.journal_header_imp_id = t1.journal_header_id
) post_gl_status
FROM hls_journal_header_imp t1
#WHERE_CLAUSE#
order by t1.journal_header_id desc
......@@ -53,17 +55,18 @@
</bm:operation>
</bm:operations>
<bm:data-filters>
<bm:data-filter name="query" expression="t1.reversed_journal_header_id is null "/>
</bm:data-filters>
<bm:data-filter name="query" expression="t1.reversed_journal_header_id is null "/>
</bm:data-filters>
<bm:query-fields>
<bm:query-field name="journal_num" queryExpression="t1.journal_num like ${@journal_num}"/>
<bm:query-fields>
<bm:query-field name="journal_num" queryExpression="t1.journal_num like ${@journal_num}"/>
<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="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="wfl_status" queryExpression="t1.wfl_status=${@wfl_status}"/>
</bm:query-fields>
<bm:query-field name="reverse_wfl_status" queryExpression="t1.reverse_wfl_status=${@reverse_wfl_status}"/>
</bm:query-fields>
</bm:model>
......@@ -46,7 +46,7 @@
t1.journal_type,
(select t.post_gl_status
from hls_journal_header t
where t.journal_num = t1.journal_num) post_gl_status
where t.journal_header_imp_id = t1.journal_header_id) post_gl_status
FROM hls_journal_header_imp t1
#WHERE_CLAUSE#
order by t1.journal_header_id desc
......
......@@ -24,5 +24,16 @@
END;
]]></bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:query-sql><![CDATA[
BEGIN
hl_hsbc_interface_pkg.hl_hsbc_error(
p_reqsn => ${@reqsn},
p_user_id => '-1'
);
END;
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
......@@ -5,7 +5,7 @@
<bm:update-sql><![CDATA[
BEGIN
wfl_instance_pdf_pkg.create_wfl_instance_content(p_instance_id => ${@instance_id},
p_user_id => ${/session/@user_id});
p_user_id => nvl(${/session/@user_id},${@user_id}));
commit;
END;
]]></bm:update-sql>
......@@ -18,7 +18,7 @@
p_table_pk_value =>${@instance_id},
p_file_name =>${@file_name},
p_file_path =>${@file_path},
p_user_id =>nvl(${/session/@user_id},1),
p_user_id =>nvl(${/session/@user_id},${@user_id}),
p_file_size =>${@file_size}
);
END;
......
......@@ -58,11 +58,11 @@
<!--<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} not in (select role_id from sys_role where role_code in('0005', '0006', '0008', '0012', '0013', '0014')) and 1 = 1)
or( ((t1.SUBMITTED_BY = ${/session/@user_id}) or (t1.APPROVE_USER_CODE = (
or( ((t1.SUBMITTED_BY = ${/session/@user_id}) or (t1.APPROVE_USER_CODE in (
Select distinct e.employee_code From exp_employees e, exp_employee_assigns ea Where e.employee_id =
ea.employee_id And nvl(e.enabled_flag, 'N') = 'Y' And nvl(ea.enabled_flag, 'N') =
'Y' And
e.employee_id = (Select t.employee_id From sys_user t Where t.user_id = ${/session/@user_id})
) ) ) and t1.workflow_code = 'HLS_JOURNAL_WFL'))"/>
e.employee_id in (Select t.employee_id From sys_user t Where t.user_id = ${/session/@user_id})
) ) ) and t1.workflow_code in('HLS_JOURNAL_WFL','HLS_JOURNAL_REVERSE_WFL')))"/>
</bm:data-filters>
</bm:model>
importClass(Packages.com.hand.attDownload.attDownload);
importPackage(Packages.java.io);
importPackage(Packages.java.util);
//importClass(Packages.leaf.plugin.util.Base64);
function attDownloadUtil(response,filePath,fileName) {
try {
var result = new attDownload().downloadUitl(response,filePath,fileName);
return result;
} catch (e) {
println(e);
return false;
}
}attDownload
\ No newline at end of file
importClass(Packages.com.hand.att.HttpPostAttUtil);
importPackage(Packages.java.io);
importPackage(Packages.java.util);
//importClass(Packages.leaf.plugin.util.Base64);
function httpPostAttUpload(postUrl,maplist,file,token,tokentype) {
try {
var result = new HttpPostAttUtil().UploadFile(postUrl,maplist,file,token,tokentype);
return result;
} catch (e) {
println(e);
return false;
}
}
\ No newline at end of file
importClass(Packages.com.hand.hl.HttpPostUtilNew);
importPackage(Packages.java.io);
importPackage(Packages.java.util);
//importClass(Packages.leaf.plugin.util.Base64);
function httpPostDocImport(postUrl,data,token,tokentType) {
try {
var result = new HttpPostUtilNew().httpPostDocImport(postUrl,data,token,tokentType);
return result;
} catch (e) {
println(e);
return false;
}
}
\ No newline at end of file
......@@ -131,10 +131,10 @@
<a:gridButton click="cloumn_code_delete" text="删除"/>-
<a:gridButton click="cloumn_code_save" text="HLS.SAVE"/>
</a:screenTopToolbar>
<a:grid id="cloumn_para_ds_id" bindTarget="cloumn_para_ds" marginHeight="200" marginWidth="200" navBar="true">
<a:grid id="cloumn_para_ds_id" bindTarget="cloumn_para_ds" height="300" width="380" navBar="true">
<a:columns>
<a:column name="cloumn_code" editor="elec_text_ed" prompt="结构化字段code" width="150"/>
<a:column name="cloumn_name" editor="elec_text_ed" prompt="结构化字段描述" width="150"/>
<a:column name="cloumn_code" editor="elec_text_ed" prompt="结构化字段code" width="170"/>
<a:column name="cloumn_name" editor="elec_text_ed" prompt="结构化字段描述" width="170"/>
</a:columns>
<a:editors>
<a:textField id="elec_text_ed"/>
......
......@@ -99,7 +99,7 @@
record_id: record_id
},
height: 350,
width: 700
width: 420
});
}
......@@ -116,7 +116,7 @@
record_id: record_id
},
height: 350,
width: 700
width: 420
});
}
......@@ -200,7 +200,7 @@
<a:gridButton click="efile_type_query" text="HLS.QUERY"/>
<a:gridButton click="efile_type_save" text="HLS.SAVE"/>
</a:screenTopToolbar>
<a:form column="4" marginWidth="30" title="查询条件">
<a:form column="4" marginWidth="30" labelWidth="150" title="查询条件">
<a:comboBox name="archive_type_desc" bindTarget="for_query_ds" prompt="资料分类"/>
<a:comboBox name="is_workflow_desc" bindTarget="for_query_ds" prompt="是否关联工作流"/>
<a:comboBox name="post_atm_flag_desc" bindTarget="for_query_ds" prompt="是否传递附件"/>
......
......@@ -130,10 +130,10 @@
<a:gridButton click="je_template_delete" text="删除"/>
<a:gridButton click="je_template_save" text="HLS.SAVE"/>
</a:screenTopToolbar>
<a:grid id="je_template_ds_id" bindTarget="je_template_ds" marginHeight="200" marginWidth="200" navBar="true">
<a:grid id="je_template_ds_id" bindTarget="je_template_ds" height="300" width="380" navBar="true">
<a:columns>
<a:column name="je_template_code" editor="voucherconBasicClauseParaDs_grid_lov" prompt="凭证模板代码" width="150"/>
<a:column name="je_template_name" editor="voucher_text_ed" prompt="凭证模板描述" width="150"/>
<a:column name="je_template_code" editor="voucherconBasicClauseParaDs_grid_lov" prompt="凭证模板代码" width="170"/>
<a:column name="je_template_name" editor="voucher_text_ed" prompt="凭证模板描述" width="170"/>
</a:columns>
<a:editors>
<a:textField id="voucher_text_ed"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<batch-apply sourcepath="/parameter">
<a:model-insert model="efile.EFILE1020.efile_generated_selected"/>
</batch-apply>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<s:server-script import="att_downloadUtil.js"><![CDATA[
importPackage(java.util.zip);
importPackage(java.io);
importPackage(java.net);
var logger = $logger('server-script');
$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");
var rowid = $ctx.parameter.rowid;
var attachment_queryBm = $bm('efile.EFILE1030.att_download');
var attachment_data = attachment_queryBm.queryAsMap({
rowid:rowid
});
if(rowid){
var filename = attachment_data.getChildren()[0].file_name;
var filepath= attachment_data.getChildren()[0].file_path;
resp.setHeader("Content-Disposition",
"attachment; filename=\"" + java.net.URLEncoder.encode(filename, "UTF-8"));
resp.setDateHeader("Expires", 0);
resp.setContentType("application/x-msdownload");
attDownloadUtil(resp,filepath,filename);
}
]]></s:server-script>
</a:init-procedure>
</a:service>
......@@ -9,18 +9,76 @@
<a:view>
<a:link id="att_link_id" url="${/request/@context_path}/modules/efile/EFILE1030/efile_att_json_lov.lview"/>
<a:link id="post_stru_link_id" url="${/request/@context_path}/modules/efile/EFILE1030/efile_post_stru_json_lov.lview"/>
<a:link id="doc_post_link" url="${/request/@context_path}/modules/efile/EFILE1040/efile_doc_import.svc"/>
<script type="text/javascript"><![CDATA[
function efile_archive_pool_batch_trans() {
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('doc_post_link').getUrl(),
para: {
batch_flag :'Y'
},
success: function() {
Leaf.Masker.unmask(Ext.getBody());
Leaf.showMessage('提示','传输成功',function(){
$('efile_archive_pool_ds').query();
});
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
function efile_archive_pool_manual_trans() {
var record = $('efile_archive_pool_ds').getSelected();
if (record.length==0){
Leaf.showMessage('提示','请选择传输数据!');
return;
}
for (var i = 0; i < record.length; i++) {
if(record[i].get('monthly_closed_flag')=='N'){
Leaf.showMessage('提示','资料期间对应的会计期间必须是关账状态!');
return;
}
}
var records = new Array();
for (i = 0;i < record.length;i++) {
records.push(record[i].data);
/* if (record[i].get('upload_ftp_flag') == 'Y') {
Aurora.showMessage('提示','已上传批次不能重复上传!');
return;
}*/
}
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('doc_post_link').getUrl(),
para: records,
success: function() {
Leaf.Masker.unmask(Ext.getBody());
Leaf.showMessage('提示','传输成功',function(){
$('efile_archive_pool_ds').query();
});
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
function efile_archive_pool_reset() {
......@@ -88,9 +146,9 @@
<a:dataSet id="for_query_ds" autoCreate="true">
<a:fields>
<a:field name="internal_period_num" />
<a:field name="psot_batch_num" />
<a:field name="cm_pk" />
<a:field name="original_archive_no" />
<a:field name="post_batch_num" />
<a:field name="primary_field" />
<a:field name="document_info" />
<a:field name="post_status" />
<a:field name="archive_type" />
<a:field name="archive_type_desc" displayField="code_value_name" options="data_cf_ds" returnField="archive_type" valueField="code_value"/>
......@@ -99,9 +157,8 @@
</a:fields>
</a:dataSet>
<a:dataSet id="efile_archive_pool_ds" model="efile.EFILE1030.e_archive_pool_query" queryDataSet="for_query_ds" selectable="true">
<a:fields>
<a:field name="cm_pk" />
<a:field name="pool_id" />
<a:fields>
<a:field name="monthly_closed_flag" />
</a:fields>
</a:dataSet>
</a:dataSets>
......@@ -116,32 +173,25 @@
<a:form column="4" marginWidth="30" title="查询条件">
<a:textField name="internal_period_num" bindTarget="for_query_ds" prompt="资料期间"/>
<a:comboBox name="archive_type_desc" bindTarget="for_query_ds" prompt="资料类型"/>
<a:textField name="cm_pk" bindTarget="for_query_ds" prompt="主键"/>
<a:textField name="primary_field" bindTarget="for_query_ds" prompt="主键"/>
<a:comboBox name="suppl_trans_flag" bindTarget="for_query_ds" prompt="是否补传"/>
<a:textField name="original_archive_no" bindTarget="for_query_ds" prompt="原始资料号"/>
<a:textField name="document_info" bindTarget="for_query_ds" prompt="原始资料号"/>
<a:comboBox name="post_status_desc" bindTarget="for_query_ds" prompt="传输状态"/>
<a:textField name="psot_batch_num" bindTarget="for_query_ds" prompt="传输批次号"/>
<a:textField name="post_batch_num" bindTarget="for_query_ds" prompt="传输批次号"/>
</a:form>
<a:grid id="efile_archive_pool_ds_id" bindTarget="efile_archive_pool_ds" marginHeight="200" marginWidth="30" navBar="true">
<a:columns>
<a:column name="cm_pk" prompt="主键" width="140"/>
<a:column name="primary_field" prompt="主键" width="320"/>
<a:column name="internal_period_num" prompt="资料期间" width="120"/>
<a:column name="archive_type_desc" prompt="资料类型" width="150"/>
<a:column name="original_archive_no" prompt="原始资料号" width="140"/>
<a:column name="post_stru_data" prompt="结构化数据" renderer="att_update_renderer" />
<a:column name="archive_type_desc" prompt="资料类型" width="120"/>
<a:column name="document_info" prompt="原始资料号" width="300"/>
<a:column name="post_stru_data" prompt="结构化数据" renderer="att_update_renderer" width="110"/>
<a:column name="att" align="center" prompt="附件" renderer="att_update_renderer"/>
<a:column name="suppl_trans_flag" align="center" width="120" prompt="是否补传"/>
<a:column name="post_status_desc" align="center" width="120" prompt="传输状态"/>
<a:column name="post_status" align="center" width="120" prompt="传输状态"/>
<a:column name="post_message" align="center" width="180" prompt="传输结果"/>
<a:column name="psot_batch_num" align="center" width="140" prompt="传输批次号"/>
<a:column name="post_batch_num" align="center" width="120" prompt="传输批次号"/>
</a:columns>
<a:editors>
<a:textField id="text_ed"/>
<a:textField id="text_ed_up" typeCase="upper"/>
<a:checkBox id="checkbox_ed"/>
<a:lov id="conBasicClauseParaDs_grid_lov"/>
<a:comboBox id="efile_archive_pool_comed"/>
</a:editors>
</a:grid>
</a:screenBody>
</a:view>
......
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<s:server-script import="token_record.js;att_upload.js"><![CDATA[
try {
var logger = $logger('server-script');
logger.info('------');
var req_date = $ctx.parameter.getChildren();
var sys_url_bm = $bm('cont.CON4000.get_sys_url');
var parameter_code = 'TOKEN_POSTURL';
var SysposturlQuery = sys_url_bm.queryAsMap({
parameter_code: parameter_code
});
var posturl = SysposturlQuery.getChildren()[0].parameter_value;
var parameter_code = 'TOKEN_APPID';
var SysappidQuery = sys_url_bm.queryAsMap({
parameter_code: parameter_code
});
var token_appid = SysappidQuery.getChildren()[0].parameter_value;
var parameter_code = 'TOKEN_APPSECRET';
var SysappsecretQuery = sys_url_bm.queryAsMap({
parameter_code: parameter_code
});
var parameter_code = 'ATT_UPLOAD_POSTURL';
var attUrlQuery = sys_url_bm.queryAsMap({
parameter_code: parameter_code
});
var attUrl = attUrlQuery.getChildren()[0].parameter_value;
var parameter_code = 'TOKEN_TYPE';
var tokenTypeyQuery = sys_url_bm.queryAsMap({
parameter_code: parameter_code
});
var token_type = tokenTypeyQuery.getChildren()[0].parameter_value;
var token_appsecret = SysappsecretQuery.getChildren()[0].parameter_value;
var token_savelogs_bm = $bm('efile.EFILE1000.efile_get_token');
//token是否在有效期内,在有效期内直接获取表中的token
var check_token_valid_bm = $bm('efile.EFILE1000.check_token_valid');
var checkTokenQuery = check_token_valid_bm.queryAsMap();
var is_valid = checkTokenQuery.getChildren()[0].is_valid;
var primaryField='CF-4252CE7A665C4562BF8E8AC3AD79BF1D';
var file=new File('D:\\aurora_reference.pdf');
logger.info(primaryField);
var map = {
"documentTypeCode" : "workflow_QC02",
"primaryField": primaryField,
"documentSource":"CF",
"companyCode":"HL"
}
var att_recordBm=$bm('efile.EFILE1040.att_upload_return');
if (is_valid == 'true') {
var SystokenQuery = token_savelogs_bm.queryAsMap();
var access_token = SystokenQuery.getChildren()[0].access_token;
var data=httpPostAttUpload(attUrl,map,file,access_token,token_type);
var json = JSON.parse(data);
var result=JSON.stringify(json.result);
result=JSON.parse(result)
att_recordBm.insert({
'primary_field': primaryField,
'status': json.statusCode,
'message': json.message,
'attachmentoid': result.attachmentOID,
'hly_fileurl': result.fileURL
})
logger.info(data);
} else {
println("=======有效期外======");
var data = httpPostGetToken(posturl, token_appid, token_appsecret);
var json = JSON.parse(data);
var access_token = json.access_token;
var status = json.status;
if (access_token) {
var data_att=httpPostAttUpload(attUrl,map,file,access_token,token_type);
var json = JSON.parse(data_att);
var result=JSON.stringify(json.result);
result=JSON.parse(result)
att_recordBm.insert({
'primary_field': primaryField,
'status': json.statusCode,
'message': json.message,
'attachmentoid': result.attachmentOID,
'hly_fileurl': result.fileURL
})
logger.info(data_att);
token_savelogs_bm.insert({
'json': data,
'status': 'success'
})
token_savelogs_bm.update({
'system_source': 'hlcm',
'expires_in': json.expires_in,
'access_token': access_token
})
}
if (status) {
var token_savelogs_bm = $bm('efile.EFILE1000.token_savelogs');
token_savelogs_bm.insert({
'json': json,
'status': 'fail'
});
}
}
} catch (e) {
println('e:' + e);
}
]]></s:server-script>
</a:init-procedure>
</a:service>
This diff is collapsed.
......@@ -77,6 +77,7 @@
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:dataSets>
<a:dataSet id="hls536_wfl_status_ds" lookupCode="HLS536_WFL_STATUS"/>
<a:dataSet id="hls536_reverse_wfl_status_ds" lookupCode="HLS536_WFL_STATUS_REVERSE"/>
<a:dataSet id="hls_journal_header_query">
<a:fields>
<a:field name="journal_num"/>
......@@ -87,6 +88,8 @@
<a:field name="description"/>
<a:field name="wfl_status_n" displayField="code_value_name" options="hls536_wfl_status_ds" returnField="wfl_status" valueField="code_value"/>
<a:field name="wfl_status" />
<a:field name="reverse_wfl_status_n" displayField="code_value_name" options="hls536_reverse_wfl_status_ds" returnField="reverse_wfl_status" valueField="code_value"/>
<a:field name="reverse_wfl_status" />
</a:fields>
</a:dataSet>
<a:dataSet id="hls_journal_header_result_ds" autoPageSize="true" autoQuery="true" model="hls.HLS536.hls_journal_import_header_wfl" queryDataSet="hls_journal_header_query" selectable="true">
......@@ -106,6 +109,7 @@
<a:numberField name="total_amount_dr_to" allowFormat="true" bindTarget="hls_journal_header_query" prompt="金额到"/>
<a:textField name="description" bindTarget="hls_journal_header_query" prompt="凭证摘要"/>
<a:comboBox name="wfl_status_n" bindTarget="hls_journal_header_query" prompt="凭证导入状态"/>
<a:comboBox name="reverse_wfl_status_n" bindTarget="hls_journal_header_query" prompt="凭证反冲状态"/>
</a:form>
<a:grid id="hls_journal_headers_grid" bindTarget="hls_journal_header_result_ds" marginHeight="250" marginWidth="40" navBar="true">
<a:columns>
......
......@@ -80,38 +80,47 @@
var KEY_PATH = AuthTypeMode.getProperties("KEY_PATH");
var AUTH_CODE = AuthTypeMode.getProperties("AUTH_CODE");
var DOWN_FILEDIR = AuthTypeMode.getProperties("DOWN_FILEDIR");
var sftpTool = new SftpTool(URL,USER_NAME,PORT);
var send_code = sftpTool.upload(ROOT_PATH, FilePath, new AuthTypeMode(AUTH_CODE,KEY_PATH));
//插入日志表
//生成log_id
var log_bm = new ModelService('hsbc.HSBC110.hsbc_get_log_id');
var res = log_bm.queryAsMap();
var arr = res.getChildren();
var log_id = arr[0].log_id;
log_bm.insert({
log_id: log_id,
interface_code:'HSBC_SEND',
reqsn:reqsn,
request:xml_content,
send_return_code:send_code
});
var send_bm = $bm('hsbc.HSBC110.upload_interface_process');
if (send_code=='UPLOAD_SUCCESS'){
//解析XML文件2个,先修改下载状态。 建议还是解析XML和修改下载状态独立吧
send_bm.update({
reqsn: reqsn,
errMsg:''
});
}else{
//上传失败
send_bm.update({
reqsn: reqsn,
errMsg:send_code
});
try {
var sftpTool = new SftpTool(URL,USER_NAME,PORT);
var send_code = sftpTool.upload(ROOT_PATH, FilePath, new AuthTypeMode(AUTH_CODE,KEY_PATH));
} catch (e) {
var error_bm = new ModelService('hsbc.HSBC110.hsbc_get_log_id');
error_bm.update({
reqsn: reqsn
});
raise_app_error(e.message);
}
//插入日志表
//生成log_id
var log_bm = new ModelService('hsbc.HSBC110.hsbc_get_log_id');
var res = log_bm.queryAsMap();
var arr = res.getChildren();
var log_id = arr[0].log_id;
log_bm.insert({
log_id: log_id,
interface_code:'HSBC_SEND',
reqsn:reqsn,
request:xml_content,
send_return_code:send_code
});
var send_bm = $bm('hsbc.HSBC110.upload_interface_process');
if (send_code=='UPLOAD_SUCCESS'){
//解析XML文件2个,先修改下载状态。 建议还是解析XML和修改下载状态独立吧
send_bm.update({
reqsn: reqsn,
errMsg:''
});
}else{
//上传失败
send_bm.update({
reqsn: reqsn,
errMsg:send_code
});
}
}
function main() {
println('main');
......
......@@ -31,13 +31,17 @@
return 0 ;}
}
var logger = $logger('server-script');
var instance_id = $ctx.parameter.instance_id;
var user_id=$ctx.parameter.user_id;
$bm('zjwfl.ZJWFL1060.wfl_instance_pdf').update({
instance_id: instance_id
instance_id: instance_id,
user_id :user_id
});
var file_templet_get_atm_path = $bm('zjwfl.ZJWFL1060.wfl_instance_pdf').queryAsMap({
instance_id: instance_id
instance_id: instance_id,
user_id :user_id
});
var from_file_data = file_templet_get_atm_path.getChildren();
......@@ -53,6 +57,7 @@
copyFile(from_file_path, to_file_path);
//放入实例id方便表单参数取值
$ctx.current_parameter.document_id = instance_id;
$ctx.current_parameter.user_id = user_id;
try {
var brwt = new BookmarksReplaceWithText($instance('leaf.database.service.IDatabaseServiceFactory'), $instance('uncertain.ocm.IObjectRegistry'), $ctx.getData());
......@@ -70,7 +75,8 @@
instance_id: instance_id,
file_name: to_file_name.toString(),
file_path: to_file_path.toString(),
file_size: file_size
file_size: file_size,
user_id :user_id
});
var attachment_update = $bm('zjwfl.ZJWFL1060.wfl_instance_pdf');
......
......@@ -172,7 +172,7 @@
<a:hBox>
<a:button click="query_monitorDs" text="HAP_QUERY"/>
<a:button click="reset_para_monitorDs" text="HAP_RESET"/>
<a:button click="get_pdf" text="生成一个工作流实例的附件"/>
<!--<a:button click="get_pdf" text="生成一个工作流实例的附件"/>-->
</a:hBox>
<a:grid id="monitorDs_grid" bindTarget="monitorDs" marginHeight="200" marginWidth="50" navBar="true">
<a:columns>
......
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