Commit d06892e9 authored by Luochenglong's avatar Luochenglong

附件json解析

parent 804596fa
<?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>
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
var ds = $('cloumn_para_ds'); var ds = $('cloumn_para_ds');
var records=ds.getAll(); var records=ds.getAll();
var paras = []; var paras = [];
var detail_masks = Ext.getBody(); var detail_mask = Ext.getBody();
var base_archive_id='${/parameter/@record_id}'; var base_archive_id='${/parameter/@record_id}';
console.log(base_archive_id); console.log(base_archive_id);
for(var n=0;n<records.length;n++){ for(var n=0;n<records.length;n++){
......
...@@ -13,19 +13,24 @@ ...@@ -13,19 +13,24 @@
name); name);
} }
var para = $ctx.current_parameter || $ctx.parameter; var para = $ctx.current_parameter || $ctx.parameter;
var logger = $logger('server-script');
var sql_content; var sql_content;
var query_validation_sql_bm = $bm('efile.EFILE1030.efile_pool_att_para_sql'); 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 = query_validation_sql_bm.queryAsMap(para);
var config_map_detail = config_map.getChildren(); var config_map_detail = config_map.getChildren();
logger.info(config_map_detail.length);
if (config_map_detail.length != 0) { if (config_map_detail.length != 0) {
sql_content = config_map_detail[0].sql_content; sql_content = config_map_detail[0].sql_content;
logger.info(sql_content);
para.sql_content = sql_content; para.sql_content = sql_content;
} }
//println(sql_content); //println(sql_content);
var obj; var obj;
var dataSet_id='att_json_ds'; var dataSet_id='att_json_ds';
if(typeof(sql_content)!="undefined"){ if(typeof(sql_content)!="undefined"){
sql_content = '{'+sql_content+'}'; sql_content ='{'+sql_content+'}';
obj = JSON.parse(sql_content).attachmentList; obj = JSON.parse(sql_content).attachmentList;
}else{ }else{
obj=''; obj='';
...@@ -48,6 +53,7 @@ ...@@ -48,6 +53,7 @@
// dataSets.addChild(dataSet.getData()); // dataSets.addChild(dataSet.getData());
// var datas = newMap("datas"); // var datas = newMap("datas");
// dataSet.addChild(datas.getData()); // dataSet.addChild(datas.getData());
if(obj.length>0){ if(obj.length>0){
for (var k in obj) { for (var k in obj) {
// if (obj[k] instanceof Object) { // if (obj[k] instanceof Object) {
...@@ -55,6 +61,11 @@ ...@@ -55,6 +61,11 @@
datasRecord.code_value = obj[k].fileURL; datasRecord.code_value = obj[k].fileURL;
datasRecord.code_value_name = obj[k].fileName; datasRecord.code_value_name = obj[k].fileName;
datasRecord.action_type = obj[k].attachTypeCode; 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()); datas.addChild(datasRecord.getData());
//println(datasRecord.code_value+":"+datasRecord.code_value_name); //println(datasRecord.code_value+":"+datasRecord.code_value_name);
......
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