Commit bc23b698 authored by KeYong's avatar KeYong

更新接口

parent 79999b43
...@@ -558,7 +558,19 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -558,7 +558,19 @@ public class SupervisionConfigureController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "管网压力详情", produces = "application/json;charset=UTF-8", notes = "管网压力详情") @ApiOperation(httpMethod = "GET", value = "管网压力详情", produces = "application/json;charset=UTF-8", notes = "管网压力详情")
public ResponseModel selectPipePressureDetail(@RequestParam(value = "equipmentSpecificId") String equipmentSpecificId) { public ResponseModel selectPipePressureDetail(@RequestParam(value = "equipmentSpecificId") String equipmentSpecificId) {
if (!StringUtil.isNotEmpty(equipmentSpecificId)) {
return CommonResponseUtil.success();
}
Map<String, Object> map = fireFightingSystemMapper.selectEquipmentSpecificById(equipmentSpecificId); Map<String, Object> map = fireFightingSystemMapper.selectEquipmentSpecificById(equipmentSpecificId);
String name = "";
String code = "";
if (String.valueOf(map.get("equipment_code")).indexOf("92011000") != -1) {
name = "管网压力";
code = "gwyl";
} else if (String.valueOf(map.get("equipment_code")).indexOf("92011100") != -1) {
name = "水池液位";
code = "scyw";
}
if (ObjectUtils.isEmpty(map) || ObjectUtils.isEmpty(map.get("iot_code"))) { if (ObjectUtils.isEmpty(map) || ObjectUtils.isEmpty(map.get("iot_code"))) {
return CommonResponseUtil.success(null); return CommonResponseUtil.success(null);
} }
...@@ -593,14 +605,33 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -593,14 +605,33 @@ public class SupervisionConfigureController extends AbstractBaseController {
} }
} }
result.stream().map(item -> { List<Map<String, String>> res = new ArrayList<>();
if (!ObjectUtils.isEmpty(item.get("time"))) { for (Map<String, String> m : result) {
item.put("time", change(String.valueOf(item.get("time")))); Map<String, String> item = new HashMap<>();
item.put("time", change(String.valueOf(m.get("time"))));
for (String s : m.keySet()) {
if (!s.equals("time")) {
item.put("value", m.get(s));
item.remove(s);
continue;
}
} }
return item; res.add(item);
}).collect(Collectors.toList()); }
// result.stream().map(item -> {
return CommonResponseUtil.success(result); // if (!ObjectUtils.isEmpty(item.get("time"))) {
// item.put("time", change(String.valueOf(item.get("time"))));
// }
// return item;
// }).collect(Collectors.toList());
List<Map<String, Object>> resList = new ArrayList<>();
Map<String, Object> map1 = new HashMap<>();
map1.put("name", name);
map1.put("xData", res.stream().map(x -> x.get("time")).collect(Collectors.toList()));
map1.put("yData", res.stream().map(x -> x.get("value")).collect(Collectors.toList()));
Map<String, Object> resMap = new HashMap<>();
resMap.put(code, map1);
return CommonResponseUtil.success(resMap);
} }
private String change(String time) { private String change(String time) {
......
...@@ -986,6 +986,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -986,6 +986,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("key", i); map.put("key", i);
map.put("name", m.get("equipmentName")); map.put("name", m.get("equipmentName"));
map.put("equipmentCode", m.get("equipmentCode"));
map.put("code", m.get("code")); map.put("code", m.get("code"));
map.put("value", m.get("flag")); map.put("value", m.get("flag"));
map.put("unit", ""); map.put("unit", "");
......
...@@ -5671,7 +5671,7 @@ ...@@ -5671,7 +5671,7 @@
es.id es.id
</select> </select>
<select id="selectEquipmentSpecificById" resultType="java.util.Map"> <select id="selectEquipmentSpecificById" resultType="java.util.Map">
select * from wl_equipment_specific where id = #{id} select * from wl_equipment_specific where id = #{id}
</select> </select>
</mapper> </mapper>
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