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

*)增加附件解析

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