Commit d9eb09cf authored by taabe's avatar taabe

96333大屏统计接口移至statistics服务

parent cf4d521e
...@@ -22,6 +22,11 @@ ...@@ -22,6 +22,11 @@
<artifactId>amos-boot-module-jg-api</artifactId> <artifactId>amos-boot-module-jg-api</artifactId>
<version>${amos-boot-biz.version}</version> <version>${amos-boot-biz.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-96333-api</artifactId>
<version>${amos-boot-biz.version}</version>
</dependency>
</dependencies> </dependencies>
......
package com.yeejoin.amos.boot.module.statistcs.biz.controller;
import com.yeejoin.amos.boot.module.statistcs.biz.service.impl.EmergencyBizServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
@RestController
@RequestMapping(value = "/dp/biz/emergency")
@Api(tags = "大屏-应急-业务API")
public class EmergencyBizController {
private EmergencyBizServiceImpl emergencyBizService;
public EmergencyBizController (EmergencyBizServiceImpl emergencyBizService) {
this.emergencyBizService = emergencyBizService;
}
/**
* 应急大屏使用
*
* @param id 主键
* @return Object
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/detail/{id}")
@ApiOperation(httpMethod = "GET", value = "根据id获取应急事件详细信息", notes = "根据id获取应急事件详细信息")
public ResponseModel<Object> getDetail(@PathVariable Long id) {
return ResponseHelper.buildResponse(emergencyBizService.getDetail(id));
}
}
package com.yeejoin.amos.boot.module.statistcs.biz.utils; package com.yeejoin.amos.boot.module.statistcs.biz.utils;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.elevator.api.dto.FormValue;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Map; import java.util.Map;
import static com.alibaba.fastjson.JSON.parseArray;
public class JsonUtils { public class JsonUtils {
//将json文件转化为Map<list<Map<>>> //将json文件转化为Map<list<Map<>>>
...@@ -19,4 +23,14 @@ public class JsonUtils { ...@@ -19,4 +23,14 @@ public class JsonUtils {
} }
return JSONObject.parseObject(json, Map.class); return JSONObject.parseObject(json, Map.class);
} }
public static List<FormValue> getJsonData(Resource resource) {
String json;
try {
json = IOUtils.toString(resource.getInputStream(), String.valueOf(StandardCharsets.UTF_8));
} catch (IOException e) {
throw new RuntimeException(e);
}
return parseArray(json, FormValue.class);
}
} }
[
{
"key": "emergencyPerson",
"label": "救援人姓名",
"type": "text"
},
{
"key": "callTime",
"label": "接警时间",
"type": "text"
},
{
"key": "contactPhone",
"label": "联系人电话",
"type": "text"
},
{
"key": "useSiteCategory",
"label": "使用场所分类",
"type": "text"
},
{
"key": "deviceId",
"label": "电梯识别码",
"type": "text"
},
{
"key": "useStatus",
"label": "使用情况",
"type": "text"
},
{
"key": "address",
"label": "地址",
"type": "text"
},
{
"key": "useUnitName",
"label": "使用单位",
"type": "text"
},
{
"key": "principalPhone",
"label": "单位电话",
"type": "text"
},
{
"key": "unitAddress",
"label": "单位地址",
"type": "text"
},
{
"key": "securityAdministrator",
"label": "电梯安全管理员",
"type": "text"
},
{
"key": "securityAdministratorPhone",
"label": "电梯安全管理员电话",
"type": "text"
}
]
\ 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