Commit d4b9af01 authored by Luochenglong's avatar Luochenglong

电子档案传输取值调整

parent 1410e64f
......@@ -18,8 +18,47 @@
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.e_archives_id,
(SELECT DISTINCT zwi.workflow_id
FROM zj_wfl_workflow_instance zwi,
zj_wfl_workflow zww
WHERE zww.workflow_id = zwi.workflow_id
AND zwi.instance_id = t1.document_id) workflow_id,
(SELECT e.je_check_flag
FROM e_archives_define e
WHERE e.base_archive_code = t1.base_archive_code
AND e.workflow_id = (SELECT DISTINCT zwi.workflow_id
FROM zj_wfl_workflow_instance zwi,
zj_wfl_workflow zww
WHERE zww.workflow_id = zwi.workflow_id
AND zwi.instance_id = t1.document_id)) je_check_flag,
(SELECT e.base_archive_id
FROM e_archives_define e
WHERE e.base_archive_code = t1.base_archive_code
AND e.workflow_id = (SELECT DISTINCT zwi.workflow_id
FROM zj_wfl_workflow_instance zwi,
zj_wfl_workflow zww
WHERE zww.workflow_id = zwi.workflow_id
AND zwi.instance_id = t1.document_id)) base_archive_id,
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,
t1.hly_req_number AS post_batch_num,
t1.post_message
FROM hl_e_archives_pool t1
where t1.creation_date>=sysdate-30)
......@@ -29,6 +68,11 @@
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="e_archives_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="E_ARCHIVES_ID" />
<bm:field name="workflow_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="WORKFLOW_ID" />
<bm:field name="je_check_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="JE_CHECK_FLAG"/>
<bm:field name="base_archive_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BASE_ARCHIVE_ID" />
<bm:field name="monthly_closed_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="MONTHLY_CLOSED_FLAG"/>
<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"/>
......
......@@ -10,7 +10,7 @@
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT t1.pool_id,
t1.primary_field,
t1.primary_field,
t1.internal_period_num,
t1.base_archive_code,
t1.archive_type,
......@@ -18,10 +18,47 @@
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,
t1.hly_req_number as post_batch_num,
t1.e_archives_id,
(SELECT DISTINCT zwi.workflow_id
FROM zj_wfl_workflow_instance zwi,
zj_wfl_workflow zww
WHERE zww.workflow_id = zwi.workflow_id
AND zwi.instance_id = t1.document_id) workflow_id,
(SELECT e.je_check_flag
FROM e_archives_define e
WHERE e.base_archive_code = t1.base_archive_code
AND e.workflow_id = (SELECT DISTINCT zwi.workflow_id
FROM zj_wfl_workflow_instance zwi,
zj_wfl_workflow zww
WHERE zww.workflow_id = zwi.workflow_id
AND zwi.instance_id = t1.document_id)) je_check_flag,
(SELECT e.base_archive_id
FROM e_archives_define e
WHERE e.base_archive_code = t1.base_archive_code
AND e.workflow_id = (SELECT DISTINCT zwi.workflow_id
FROM zj_wfl_workflow_instance zwi,
zj_wfl_workflow zww
WHERE zww.workflow_id = zwi.workflow_id
AND zwi.instance_id = t1.document_id)) base_archive_id,
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,
t1.hly_req_number AS post_batch_num,
t1.post_message
FROM hl_e_archives_pool t1
#WHERE_CLAUSE#
......@@ -82,7 +119,7 @@
<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="original_archive_no" queryExpression="t1.original_archive_no =${@original_archive_no}"/>
<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}"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<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 elec_wfl_pkg.get_sql_value(p_e_archives_id =>${@e_archives_id},
p_instance_id =>${@document_id},
p_sql_type =>'JE_DATA_JSON',
p_workflow_id =>${@workflow_id},
p_user_id =>${/session/@user_id}) je_data_json from dual
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="je_data_json"/>
</bm:fields>
</bm:model>
......@@ -43,25 +43,50 @@
var checkTokenQuery = check_token_valid_bm.queryAsMap();
var is_valid = checkTokenQuery.getChildren()[0].is_valid;
var fieldValueList_bm=$bm('efile.EFILE1040.efile_doc_import_query');
var je_data_json_bm=$bm('efile.EFILE1040.efile_journal_clob_query');
var record=[];
var doc_data=[];
var batch_num=0;
if(batch_flag=='Y'){
for(var i=0;i<batch_data.length;i++){
var fieldValueList_data = fieldValueList_bm.queryAsMap({
pool_id: batch_data[i].pool_id
});
var je_data_json_data = je_data_json_bm.queryAsMap({
e_archives_id: batch_data[i].e_archives_id,
document_id: batch_data[i].document_id,
workflow_id: batch_data[i].workflow_id
});
var companyCode='HL';
var documentTypeCode=batch_data[i].base_archive_code;
var originalNumber=batch_data[i].document_info;
var primaryField=batch_data[i].primary_field;
var isPaper='true';
var documentSource='CF';
var ruleOID='';
var securityLevelCode='';
var fieldValueList=fieldValueList_data.getChildren()[0].fieldValueList;
var je_json_data=je_data_json_data.getChildren()[0].je_data_json;
logger.info(je_json_data);
//var je_json_data='[{"fieldCode":"PREPROCESS_CODE","value":"111"},{"fieldCode":"GL_CODE_ARRAY","value":"222"}]';
var je_json_data_result=JSON.parse(je_json_data);
logger.info(je_json_data_result[0].fieldCode);
var je_json_data1=je_json_data_result[0];
var je_json_data2=je_json_data_result[1];
var attlist=[];
var filelist=[];
if(fieldValueList.length==8){
filelist='[]';
}else{
fieldValueList=fieldValueList.substring(17);
fieldValueList=JSON.parse(fieldValueList);
if(batch_data[i].je_check_flag=='Y'){
fieldValueList.push(je_json_data1);
fieldValueList.push(je_json_data2);
}
fieldValueList=JSON.stringify(fieldValueList);
filelist.push(fieldValueList);
}
......@@ -70,26 +95,33 @@
var attachmentList = fieldValueList_data.getChildren()[0].attachmentList;
attachmentList=attachmentList.replace('\s+', '');
if(attachmentList.length==8){
attlist='[]';
var fils = '{'
+'"companyCode": "'+companyCode
+'",'
+'"documentTypeCode": "'+documentTypeCode
+'",'
+'"originalNumber": "'+originalNumber
+'",'
+'"primaryField": "'+primaryField
+'",'
+'"isPaper": "'+isPaper
+'",'
+'"documentSource": "'+documentSource
+'",'
+'"ruleOID": "'+ruleOID
+'",'
+'"securityLevelCode": "'+securityLevelCode
+'",'
+'"fieldValueList": '+filelist
+'}';
fils=JSON.parse(fils);
doc_data.push(fils);
}else{
attachmentList=attachmentList.substring(17);
logger.info(attachmentList);
logger.info(attachmentList);
attachmentList=JSON.parse(attachmentList);
attachmentList=JSON.stringify(attachmentList);
attlist.push(attachmentList);
}
var companyCode='HL';
var documentTypeCode=batch_data[i].base_archive_code;
var originalNumber=batch_data[i].document_info;
var primaryField=batch_data[i].primary_field;
var isPaper='true';
var documentSource='CM';
var ruleOID='';
var securityLevelCode='';
var fils = '{'
+'"companyCode": "'+companyCode
......@@ -112,8 +144,16 @@
+','
+'"fieldValueList": '+filelist
+'}';
fils=JSON.parse(fils);
doc_data.push(fils);
fils=JSON.parse(fils);
doc_data.push(fils);
}
if(doc_data.length==100||batch_data.length==i+1){
batch_num++;
......@@ -203,7 +243,29 @@
var fieldValueList_data = fieldValueList_bm.queryAsMap({
pool_id: req_date[i].pool_id
});
var je_data_json_data = je_data_json_bm.queryAsMap({
e_archives_id: req_date[i].e_archives_id,
document_id: req_date[i].document_id,
workflow_id: req_date[i].workflow_id
});
var companyCode='HL';
var documentTypeCode=req_date[i].base_archive_code;
var originalNumber=req_date[i].document_info;
var primaryField=req_date[i].primary_field;
var isPaper='true';
var documentSource='CF';
var ruleOID='';
var securityLevelCode='';
var fieldValueList=fieldValueList_data.getChildren()[0].fieldValueList;
var je_json_data=je_data_json_data.getChildren()[0].je_data_json;
//var je_json_data='[{"fieldCode":"PREPROCESS_CODE","value":"111"},{"fieldCode":"GL_CODE_ARRAY","value":"222"}]';
var je_json_data_result=JSON.parse(je_json_data);
var je_json_data1=je_json_data_result[0];
var je_json_data2=je_json_data_result[1];
var attlist=[];
var filelist=[];
......@@ -212,34 +274,49 @@
}else{
fieldValueList=fieldValueList.substring(17);
fieldValueList=JSON.parse(fieldValueList);
if(req_date[i].je_check_flag=='Y'){
fieldValueList.push(je_json_data1);
fieldValueList.push(je_json_data2);
}
fieldValueList=JSON.stringify(fieldValueList);
filelist.push(fieldValueList);
logger.info(filelist);
}
var attachmentList = fieldValueList_data.getChildren()[0].attachmentList;
attachmentList=attachmentList.replace('\s+', '');
if(attachmentList.length==8){
attlist='[]';
var fils = '{'
+'"companyCode": "'+companyCode
+'",'
+'"documentTypeCode": "'+documentTypeCode
+'",'
+'"originalNumber": "'+originalNumber
+'",'
+'"primaryField": "'+primaryField
+'",'
+'"isPaper": "'+isPaper
+'",'
+'"documentSource": "'+documentSource
+'",'
+'"ruleOID": "'+ruleOID
+'",'
+'"securityLevelCode": "'+securityLevelCode
+'",'
+'"fieldValueList": '+filelist
+'}';
fils=JSON.parse(fils);
doc_data.push(fils);
}else{
attachmentList=attachmentList.substring(17);
logger.info(attachmentList);
logger.info(attachmentList);
attachmentList=JSON.parse(attachmentList);
attachmentList=JSON.stringify(attachmentList);
attlist.push(attachmentList);
}
var companyCode='HL';
var documentTypeCode=req_date[i].base_archive_code;
var originalNumber=req_date[i].document_info;
var primaryField=req_date[i].primary_field;
var isPaper='true';
var documentSource='CM';
var ruleOID='';
var securityLevelCode='';
var fils = '{'
var fils = '{'
+'"companyCode": "'+companyCode
+'",'
+'"documentTypeCode": "'+documentTypeCode
......@@ -262,6 +339,10 @@
+'}';
fils=JSON.parse(fils);
doc_data.push(fils);
}
}
if (is_valid == 'true') {
......
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