Commit 4ef71158 authored by 刘凡's avatar 刘凡

*)增加附件解析

parent 99eb353c
......@@ -75,11 +75,16 @@ public class DPSubServiceImpl {
JSONObject map = content.getJSONObject(tab.getString("key"));
JSONObject apiResult = new JSONObject();
JSONArray apiArrayResult = new JSONArray();
if (!ValidationUtil.isEmpty(api)) {
ResponseModel responseModel = this.getApiResult((JSONObject) api, !ValidationUtil.isEmpty(resultConvert) ? resultConvert.toString() : null);
if (!ValidationUtil.isEmpty(responseModel.getResult())) {
apiResult = JSONObject.parseObject(responseModel.getResult().toString());
if (responseModel.getResult() instanceof JSONObject){
apiResult = JSONObject.parseObject(responseModel.getResult().toString());
} else {
apiArrayResult = JSONArray.parseArray(responseModel.getResult().toString());
}
}
}
......@@ -132,12 +137,12 @@ public class DPSubServiceImpl {
}
if (!ValidationUtil.isEmpty(matinfo.getJSONArray("datas"))){
matinfo.put("columns", map.getJSONObject("basic").getString("columns"));
matinfo.put("columns", map.get("columns"));
map.getJSONArray("subs").add(matinfo);
}
} else {
if (ValidationUtil.isEmpty(map)) {
content.put(tab.getString("key"), apiResult);
content.put(tab.getString("key"), apiArrayResult);
}
}
}
......@@ -249,7 +254,7 @@ public class DPSubServiceImpl {
}
}
}
return (JSONObject) collect.get(0);
return !ValidationUtil.isEmpty(collect) ? (JSONObject) collect.get(0) : null;
}
/**
......@@ -278,7 +283,7 @@ public class DPSubServiceImpl {
}).collect(Collectors.toList());
if (i < noHiddenMergedArray.size()) {
mergedArray.add(cchildren.get(i));
mergedArray.add(noHiddenMergedArray.get(i));
}
}
}
......@@ -377,8 +382,27 @@ public class DPSubServiceImpl {
if (!ValidationUtil.isEmpty(value)) {
JSONObject attachmentUploadDatasObj = new JSONObject();
attachmentUploadDatasObj.put("value", value);
String accept = JsonValueUtils.getValueByKey(xObj, "visualParams", "visualParams.accept").toString();
if (accept.contains("doc") || accept.contains("docx") || accept.contains("pdf") || accept.contains("xls") || accept.contains("xlsx")){
attachmentUploadDatasObj.put("label", "附件");
attachmentUploadDatasObj.put("type", "file");
} else if(accept.contains("png") || accept.contains("img")){
attachmentUploadDatasObj.put("label", "证照");
attachmentUploadDatasObj.put("type", "img");
} else if(accept.contains("mp4") || accept.contains("flv")){
attachmentUploadDatasObj.put("label", "视频");
attachmentUploadDatasObj.put("type", "video");
}
attachmentUploadDatas.add(attachmentUploadDatasObj);
}
} else if ("lnglatSelect".equals(xObj.getString("componentKey"))) {
jsonObject.put("type", "text");
if (!ValidationUtil.isEmpty(value) && value instanceof JSONObject) {
JSONObject lnglatSelect = (JSONObject) value;
jsonObject.put("value", String.format("[%s,%s]", lnglatSelect.getString("latitude"), lnglatSelect.getString("longitude")));
} else {
jsonObject.put("value", value);
}
} else if ("checkbox".equals(xObj.getString("componentKey"))) {
jsonObject.put("type", "text");
ResponseModel checkboxResult = this.getApiResult(visualParams.getJSONObject("api"), null);
......
......@@ -21,7 +21,7 @@
},
{
"key": "gl",
"displayName": "锅炉技术参数",
"displayName": "技术参数",
"renderType": "basic",
"formSeq": "1734819004637278210",
"dataConfig": {
......@@ -66,8 +66,8 @@
"httpMethod":"GET",
"apiPath":"/jg/safety-problem-tracing/equipId/page",
"params": {
"number": 1,
"size": 10,
"current": 1,
"size": 14,
"record": "{record}"
}
},
......
......@@ -21,7 +21,7 @@
},
{
"key": "ylrq",
"displayName": "压力容器技术参数",
"displayName": "技术参数",
"renderType": "basic",
"formSeq": "1734818687287848961",
"dataConfig": {
......@@ -66,8 +66,8 @@
"httpMethod":"GET",
"apiPath":"/jg/safety-problem-tracing/equipId/page",
"params": {
"number": 1,
"size": 10,
"current": 1,
"size": 14,
"record": "{record}"
}
},
......
......@@ -21,7 +21,7 @@
},
{
"key": "dt",
"displayName": "电梯技术参数",
"displayName": "技术参数",
"renderType": "basic",
"formSeq": "1734504628768239617",
"dataConfig": {
......@@ -66,8 +66,8 @@
"httpMethod":"GET",
"apiPath":"/jg/safety-problem-tracing/equipId/page",
"params": {
"number": 1,
"size": 10,
"current": 1,
"size": 14,
"record": "{record}"
}
},
......
......@@ -21,7 +21,7 @@
},
{
"key": "qzqx",
"displayName": "起重机械技术参数",
"displayName": "技术参数",
"renderType": "basic",
"formSeq": "1734818709194698753",
"dataConfig": {
......@@ -66,8 +66,8 @@
"httpMethod":"GET",
"apiPath":"/jg/safety-problem-tracing/equipId/page",
"params": {
"number": 1,
"size": 10,
"current": 1,
"size": 14,
"record": "{record}"
}
},
......
......@@ -21,7 +21,7 @@
},
{
"key": "cnjdc",
"displayName": "场(厂)内机动车技术参数",
"displayName": "技术参数",
"renderType": "basic",
"formSeq": "1734818684284727297",
"dataConfig": {
......@@ -66,8 +66,8 @@
"httpMethod":"GET",
"apiPath":"/jg/safety-problem-tracing/equipId/page",
"params": {
"number": 1,
"size": 10,
"current": 1,
"size": 14,
"record": "{record}"
}
},
......
......@@ -21,7 +21,7 @@
},
{
"key": "dxylss",
"displayName": "大型游乐设施技术参数",
"displayName": "技术参数",
"renderType": "basic",
"formSeq": "1734818700369883137",
"dataConfig": {
......@@ -66,8 +66,8 @@
"httpMethod":"GET",
"apiPath":"/jg/safety-problem-tracing/equipId/page",
"params": {
"number": 1,
"size": 10,
"current": 1,
"size": 14,
"record": "{record}"
}
},
......
......@@ -21,7 +21,7 @@
},
{
"key": "ylgd",
"displayName": "压力管道",
"displayName": "技术参数",
"renderType": "basic",
"formSeq": "1734818687287848961",
"dataConfig": {
......@@ -66,8 +66,8 @@
"httpMethod":"GET",
"apiPath":"/jg/safety-problem-tracing/equipId/page",
"params": {
"number": 1,
"size": 10,
"current": 1,
"size": 14,
"record": "{record}"
}
},
......
......@@ -21,7 +21,7 @@
},
{
"key": "kysd",
"displayName": "客运索道",
"displayName": "技术参数",
"renderType": "basic",
"formSeq": "1734818694514634753",
"dataConfig": {
......@@ -66,8 +66,8 @@
"httpMethod":"GET",
"apiPath":"/jg/safety-problem-tracing/equipId/page",
"params": {
"number": 1,
"size": 10,
"current": 1,
"size": 14,
"record": "{record}"
}
},
......
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