Commit a3bfcee9 authored by 刘凡's avatar 刘凡

*)增加独立访问tab接口功能

parent 0cd13ade
......@@ -18,7 +18,15 @@ public enum DPStatusEnum {
EQUIP_STATUS_SCRAP("equipScrap", "报废","报废", "", "error"),
EQUIP_EMPHASIS_MONITOR("equipEmphasis", "重点监控设备","重点监控设备", "", "success"),
USE_YEAR_GT_15("gt15", ">15年","使用年限大于15年", "", "error"),
COMPANY_TYPE("companyType", "单位类型","单位类型", "", "success"),
// 单位类型
COMPANY_SY("sy", "使用单位","使用单位", "", "success"),
COMPANY_CZ("cz", "充装单位","充装单位", "", "success"),
COMPANY_JYJC("jyjc", "检验检测机构","检验检测机构", "", "success"),
COMPANY_ZZ("zz", "制造单位","制造单位", "", "success"),
COMPANY_SJ("sj", "设计单位","设计单位", "", "success"),
COMPANY_AZGZWX("azgzwx", "安装改造维修单位","安装改造维修单位", "", "success"),
MANAGE_STATUS_USE("manageUse", "在业","在业", "", "success"),
MANAGE_STATUS_OPEN("manageOpen", "在业","开业", "", "success"),
MANAGE_STATUS_STOP("manageStop", "停业","停业", "", "error"),
......
package com.yeejoin.amos.boot.module.statistcs.biz.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.statistcs.biz.service.impl.DPSubServiceImpl;
import io.swagger.annotations.Api;
......@@ -51,6 +52,13 @@ public class DPSubController {
}
return ResponseHelper.buildResponse(subService.commonQuery(template, param));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "tab返回单个详情数据", notes = "tab返回单个详情数据")
@PostMapping(value = "/tab/aloneApi")
public ResponseModel<Object> aloneApi(@RequestBody Map map) {
return ResponseHelper.buildResponse(subService.aloneApi(JSONObject.parseObject(JSON.toJSONString(map))));
}
}
......@@ -83,7 +83,34 @@ public class DPSubServiceImpl {
return result;
}
public Object aloneApi(JSONObject jsonObject){
Object resultConvert = JsonValueUtils.getValueByKey(jsonObject, "dataConfig", "dataConfig.resultConvert");
Object api = JsonValueUtils.getValueByKey(jsonObject, "dataConfig", "dataConfig.api");
String renderType = jsonObject.getString("renderType");
Object apiResult = null;
ResponseModel responseModel = this.getApiResult((JSONObject) api, !ValidationUtil.isEmpty(resultConvert) ? resultConvert.toString() : null);
if (!ValidationUtil.isEmpty(responseModel.getResult())) {
apiResult = responseModel.getResult();
}
if ("timeline".equals(renderType)){
return apiResult;
} else if("table".equals(renderType)){
JSONObject map = new JSONObject();
Object columns = JsonValueUtils.getValueByKey(jsonObject, "visualParams", "visualParams.columns");
map.put("columns", columns);
map.put("dataList", apiResult);
map.put("showPage", true);
map.put("api", api);
map.put("rowKey", JsonValueUtils.getValueByKey(jsonObject, "visualParams", "visualParams.rowKey"));
return map;
}
return apiResult;
}
public void buildContent(JSONObject content, JSONObject tab, Map<String, Object> param) {
if (!ValidationUtil.isEmpty(tab.getBoolean("useAloneApi")) && tab.getBoolean("useAloneApi")){
return;
}
Long formSeq = tab.getLong("formSeq");
String renderType = tab.getString("renderType");
Object resultConvert = JsonValueUtils.getValueByKey(tab, "dataConfig", "dataConfig.resultConvert");
......@@ -207,7 +234,6 @@ public class DPSubServiceImpl {
content.getJSONObject("keyinfo").put("photo", jsonArray.getJSONObject(0).getString("url"));
}
// 处理标签
// 处理标签
JSONArray status = (JSONArray)JsonValueUtils.getValueByKey(content, "keyinfo", "keyinfo.status");
this.processLabel(status, param.getString("EQU_STATE"));
......
......@@ -45,7 +45,7 @@
"key": "devtable",
"displayName": "设备列表",
"renderType": "table",
"formSeq": "",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"GET",
......
......@@ -84,13 +84,27 @@
{
"key": "reghistory",
"displayName": "监管履历信息",
"renderType": "timeline"
"renderType": "timeline",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/common/equOnJgServiceOperationRecords",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result",
"operater": "content"
}
}
}
},
{
"key": "devtable",
"displayName": "问题列表",
"renderType": "table",
"formSeq": "",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"GET",
......
......@@ -88,13 +88,27 @@
{
"key": "reghistory",
"displayName": "监管履历信息",
"renderType": "timeline"
"renderType": "timeline",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/common/equOnJgServiceOperationRecords",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result",
"operater": "content"
}
}
}
},
{
"key": "devtable",
"displayName": "问题列表",
"renderType": "table",
"formSeq": "",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"GET",
......
......@@ -84,13 +84,27 @@
{
"key": "reghistory",
"displayName": "监管履历信息",
"renderType": "timeline"
"renderType": "timeline",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/common/equOnJgServiceOperationRecords",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result",
"operater": "content"
}
}
}
},
{
"key": "devtable",
"displayName": "问题列表",
"renderType": "table",
"formSeq": "",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"GET",
......
......@@ -80,13 +80,27 @@
{
"key": "reghistory",
"displayName": "监管履历信息",
"renderType": "timeline"
"renderType": "timeline",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/common/equOnJgServiceOperationRecords",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result",
"operater": "content"
}
}
}
},
{
"key": "devtable",
"displayName": "问题列表",
"renderType": "table",
"formSeq": "",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"GET",
......
......@@ -76,13 +76,27 @@
{
"key": "reghistory",
"displayName": "监管履历信息",
"renderType": "timeline"
"renderType": "timeline",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/common/equOnJgServiceOperationRecords",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result",
"operater": "content"
}
}
}
},
{
"key": "devtable",
"displayName": "问题列表",
"renderType": "table",
"formSeq": "",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"GET",
......
......@@ -70,13 +70,27 @@
{
"key": "reghistory",
"displayName": "监管履历信息",
"renderType": "timeline"
"renderType": "timeline",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/common/equOnJgServiceOperationRecords",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result",
"operater": "content"
}
}
}
},
{
"key": "devtable",
"displayName": "问题列表",
"renderType": "table",
"formSeq": "",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"GET",
......
......@@ -76,13 +76,27 @@
{
"key": "reghistory",
"displayName": "监管履历信息",
"renderType": "timeline"
"renderType": "timeline",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/common/equOnJgServiceOperationRecords",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result",
"operater": "content"
}
}
}
},
{
"key": "devtable",
"displayName": "问题列表",
"renderType": "table",
"formSeq": "",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"GET",
......
......@@ -76,13 +76,27 @@
{
"key": "reghistory",
"displayName": "监管履历信息",
"renderType": "timeline"
"renderType": "timeline",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/common/equOnJgServiceOperationRecords",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result",
"operater": "content"
}
}
}
},
{
"key": "devtable",
"displayName": "问题列表",
"renderType": "table",
"formSeq": "",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"GET",
......
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