Commit 9925645c authored by 麻笑宇's avatar 麻笑宇

1.大屏业务模块详情提交

parent f26bee5b
......@@ -77,6 +77,22 @@ public class DPSubController {
} else if(template.equals("inspection")) { // 报检
template = template + "_" + param.get("equListCode");
Assert.notNull(param.get("sequenceNbr"), "sequenceNbr不能为空");
} else if(template.equals("sydj")){
Assert.notNull(param.get("sequenceNbr"), "sequenceNbr不能为空");
if("vehicle".equals(param.get("bType"))){
template = template + "_" + param.get("bType");
}
} else if(template.equals("azgz")){
Assert.notNull(param.get("sequenceNbr"), "sequenceNbr不能为空");
} else if(template.equals("jdjy")){
Assert.notNull(param.get("sequenceNbr"), "sequenceNbr不能为空");
} else if(template.equals("dqjy")){
Assert.notNull(param.get("sequenceNbr"), "sequenceNbr不能为空");
} else if(template.equals("bgdj")){
Assert.notNull(param.get("sequenceNbr"), "sequenceNbr不能为空");
template = template + "_" + param.get("bType");
} else if(template.equals("zxbf")){
Assert.notNull(param.get("sequenceNbr"), "sequenceNbr不能为空");
} else {
throw new RuntimeException("暂无模板");
}
......
......@@ -103,6 +103,8 @@ public class DPSubServiceImpl {
ResponseModel responseModel = this.getApiResult((JSONObject) api, !ValidationUtil.isEmpty(resultConvert) ? resultConvert.toString() : null);
if (!ValidationUtil.isEmpty(responseModel.getResult())) {
apiResult = responseModel.getResult();
}else{
apiResult = new JSONObject();
}
if ("timeline".equals(renderType)){
return apiResult;
......@@ -141,6 +143,8 @@ public class DPSubServiceImpl {
ResponseModel responseModel = this.getApiResult((JSONObject) api, !ValidationUtil.isEmpty(resultConvert) ? resultConvert.toString() : null);
if (!ValidationUtil.isEmpty(responseModel.getResult())) {
apiResult = responseModel.getResult();
}else{
apiResult = new JSONObject();
}
long e = System.currentTimeMillis();
log.info("{}tab页获取详情接口,共耗时:{} 毫秒", tab.get("displayName"), (e - s));
......@@ -329,6 +333,8 @@ public class DPSubServiceImpl {
private JSONArray processShowHideRules(JSONArray children, Object showHideRules, Object apiResult) {
JSONObject result = JSONObject.parseObject(apiResult.toString());
result.put("formType","detail");
result.put("EQU_CATEGORY_CODE","8100");
if (!ValidationUtil.isEmpty(showHideRules)) {
((JSONArray) showHideRules).stream().forEach(x -> {
JSONObject xObj = (JSONObject) x;
......@@ -513,7 +519,26 @@ public class DPSubServiceImpl {
JSONArray datas = new JSONArray();
mergedArray.stream().forEach(x -> {
Object fieldKey = JsonValueUtils.getValueByKey(x, "visualParams", "visualParams.fieldKey");
if (!ValidationUtil.isEmpty(fieldKey)) {
Object componentKey = JsonValueUtils.getValueByKey(x, "componentKey", null);
if("tableToTable".equals(componentKey+"")){
JSONArray children1 = (JSONArray) JsonValueUtils.getValueByKey(x, "visualParams", "visualParams.tableColumns");
List<JSONObject> columns = children1.stream().map(t -> {
JSONObject xObj = (JSONObject) t;
JSONObject jsonObject = new JSONObject();
jsonObject.put("key", xObj.get("key"));
jsonObject.put("dataIndex", xObj.get("dataIndex"));
jsonObject.put("title", xObj.get("title"));
return jsonObject;
}).collect(Collectors.toList());
subObj.put("renderType", "table");
subObj.put("displayName", JsonValueUtils.getValueByKey(x, "visualParams", "visualParams.label"));
subObj.put("rowKey", "key");
subObj.put("showPage", false);
subObj.put("columns",columns);
Object o = JSONObject.parseObject(apiResult.toString()).get(fieldKey);
subObj.put("dataList",o);
} else if (!ValidationUtil.isEmpty(fieldKey)) {
this.processWidgets(tab, datas, x, displayName, fieldKey.toString(), JSONObject.parseObject(apiResult.toString()), matinfo);
subObj.put("datas", datas);
}
......@@ -667,18 +692,22 @@ public class DPSubServiceImpl {
}
} else if ("checkbox".equals(xObj.getString("componentKey"))) {
ResponseModel checkboxResult = this.getApiResult(visualParams.getJSONObject("api"), null);
if (!ValidationUtil.isEmpty(checkboxResult) && checkboxResult.getStatus() == 200 && !ValidationUtil.isEmpty(value)) {
List<Object> collect = ((JSONArray) checkboxResult.getResult()).stream().filter(y -> ((JSONArray) value).contains(JsonValueUtils.getValueByKey(y, "valueKey", "valueKey"))).collect(Collectors.toList());
String nameKey = collect.stream().map(item -> ((JSONObject) item).getString("nameKey")).collect(Collectors.joining("、"));
jsonObject.put("value", nameKey);
if (!ValidationUtil.isEmpty(visualParams.getJSONObject("api"))){
ResponseModel checkboxResult = this.getApiResult(visualParams.getJSONObject("api"), null);
if (!ValidationUtil.isEmpty(checkboxResult) && checkboxResult.getStatus() == 200 && !ValidationUtil.isEmpty(value)) {
List<Object> collect = ((JSONArray) checkboxResult.getResult()).stream().filter(y -> ((JSONArray) value).contains(JsonValueUtils.getValueByKey(y, "valueKey", "valueKey"))).collect(Collectors.toList());
String nameKey = collect.stream().map(item -> ((JSONObject) item).getString("nameKey")).collect(Collectors.joining("、"));
jsonObject.put("value", nameKey);
}
}
} else if ("select".equals(xObj.getString("componentKey"))) {
ResponseModel selectResult = this.getApiResult(visualParams.getJSONObject("api"), null);
if (!ValidationUtil.isEmpty(selectResult) && selectResult.getStatus() == 200 && !ValidationUtil.isEmpty(value)) {
((JSONArray) selectResult.getResult()).stream().filter(y -> value.equals(JsonValueUtils.getValueByKey(y, "valueKey", "valueKey"))).findFirst().ifPresent(z -> {
jsonObject.put("value", ((JSONObject) z).getString("nameKey"));
});
if (!ValidationUtil.isEmpty(visualParams.getJSONObject("api"))){
ResponseModel selectResult = this.getApiResult(visualParams.getJSONObject("api"), null);
if (!ValidationUtil.isEmpty(selectResult) && selectResult.getStatus() == 200 && !ValidationUtil.isEmpty(value)) {
((JSONArray) selectResult.getResult()).stream().filter(y -> value.equals(JsonValueUtils.getValueByKey(y, "valueKey", "valueKey"))).findFirst().ifPresent(z -> {
jsonObject.put("value", ((JSONObject) z).getString("nameKey"));
});
}
}
} else if ("radio".equals(xObj.getString("componentKey"))) {
if (!ValidationUtil.isEmpty(visualParams.getJSONObject("api"))){
......@@ -698,6 +727,8 @@ public class DPSubServiceImpl {
));
jsonObject.put("value", fieldMap.get(value));
}
} else if("tableToTable".equals(xObj.getString("componentKey"))){
}
}
if (!("upload".equals(xObj.getString("componentKey")) || "attachmentUpload".equals(xObj.getString("componentKey")))){
......@@ -742,6 +773,9 @@ public class DPSubServiceImpl {
public ResponseModel getApiResult(JSONObject apiObj, String resultConvert) {
String url = apiObj.getString("apiPath");
if(ValidationUtil.isEmpty(url)){
return null;
}
String reqType = !ValidationUtil.isEmpty(apiObj.getString("httpMethod")) ? apiObj.getString("httpMethod") : "GET";
Object params = apiObj.get("params");
if (ValidationUtil.isEmpty(params) && !ValidationUtil.isEmpty(apiObj.get("queryParams"))){
......
{
"name": "安装告知",
"tabs": [
{
"key": "basic",
"displayName": "安装告知详情",
"renderType": "basic",
"formSeq": "1734107811517853698",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/jg-installation-notice/details",
"params": {
"sequenceNbr": "{sequenceNbr}"
},
"ruleData": {
"responseSuccess": "data.result.installationInfo"
}
}
}
}
],
"content": {
"basic": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "车用气瓶变更",
"tabs": [
{
"key": "basic",
"displayName": "车用气瓶变更详情",
"renderType": "basic",
"formSeq": "1811232965410189314",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/jg-change-vehicle-registration-unit/details",
"params": {
"sequenceNbr": "{sequenceNbr}"
},
"ruleData": {
"responseSuccess": "data.result"
}
}
}
}
],
"content": {
"basic": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "单位变更",
"tabs": [
{
"key": "basic",
"displayName": "单位变更详情",
"renderType": "basic",
"formSeq": "1738022519656443905",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/jg-change-registration-unit/details",
"params": {
"sequenceNbr": "{sequenceNbr}"
},
"ruleData": {
"responseSuccess": "data.result.changeRegisInfo"
}
}
}
}
],
"content": {
"basic": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "更名变更",
"tabs": [
{
"key": "basic",
"displayName": "更名变更详情",
"renderType": "basic",
"formSeq": "1739185443716493313",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/jg-change-registration-name/details",
"params": {
"sequenceNbr": "{sequenceNbr}"
},
"ruleData": {
"responseSuccess": "data.result.jgRegistrationInfo"
}
}
}
}
],
"content": {
"basic": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "改造变更",
"tabs": [
{
"key": "basic",
"displayName": "改造变更详情",
"renderType": "basic",
"formSeq": "1737034262198120450",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/jg-change-registration-reform/getDetail",
"params": {
"sequenceNbr": "{sequenceNbr}"
},
"ruleData": {
"responseSuccess": "data.result"
}
}
}
}
],
"content": {
"basic": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "移装变更",
"tabs": [
{
"key": "basic",
"displayName": "移装变更详情",
"renderType": "basic",
"formSeq": "1737063574276173826",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/jg-change-registration-transfer/detail",
"params": {
"sequenceNbr": "{sequenceNbr}"
},
"ruleData": {
"responseSuccess": "data.result.changeRegistrationTransfer"
}
}
}
}
],
"content": {
"basic": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "定期检验",
"tabs": [
{
"key": "basic",
"displayName": "定期检验详情",
"renderType": "basic",
"formSeq": "1734854656288387074",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jyjc/jyjc-inspection-application/{sequenceNbr}",
"params": {
"sequenceNbr": "{sequenceNbr}"
},
"ruleData": {
"responseSuccess": "data.result"
}
}
}
}
],
"content": {
"basic": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "监督检验",
"tabs": [
{
"key": "basic",
"displayName": "监督检验详情",
"renderType": "basic",
"formSeq": "1734854656288387074",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jyjc/jyjc-inspection-application/{sequenceNbr}",
"params": {
"sequenceNbr": "{sequenceNbr}"
},
"ruleData": {
"responseSuccess": "data.result"
}
}
}
}
],
"content": {
"basic": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "使用登记",
"tabs": [
{
"key": "basic",
"displayName": "使用登记详情",
"renderType": "basic",
"formSeq": "1744311337623777282",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/jg-use-registration/getDetail",
"params": {
"sequenceNbr": "{sequenceNbr}"
},
"ruleData": {
"responseSuccess": "data.result"
}
}
}
}
],
"content": {
"basic": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "使用登记",
"tabs": [
{
"key": "basic",
"displayName": "车用气瓶登记详情",
"renderType": "basic",
"formSeq": "1770000499483897858",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/jg-vehicle-information/details",
"params": {
"sequenceNbr": "{sequenceNbr}"
},
"ruleData": {
"responseSuccess": "data.result"
}
}
}
}
],
"content": {
"basic": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "注销报废",
"tabs": [
{
"key": "basic",
"displayName": "注销报废详情",
"renderType": "basic",
"formSeq": "1737366819582275586",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/jg-scrap-cancel/details",
"params": {
"sequenceNbr": "{sequenceNbr}"
},
"ruleData": {
"responseSuccess": "data.result.jgScrapCancelAdd"
}
}
}
}
],
"content": {
"basic": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
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