Commit 1d2be9a9 authored by kiritoausna's avatar kiritoausna

重新拼接实时数据

parent ce929bfd
......@@ -18,7 +18,7 @@ import java.util.List;
*/
@Mapper
public interface WebMonitorLinkMapper extends BaseMapper<WebMonitorLink> {
@Select(value = "SELECT b.pointid,c.equipno as id,c.equipname as name FROM web_monitor_link b join tb_drybeachequipinfor c on c.equipno = b .deviceid where b.pointid in (select guid from web_monitor_points where chartid = #{chartid} )")
@Select(value = "SELECT b.pointid,c.equipno as id,c.equipname as name ,c.eqdanwei as unit FROM web_monitor_link b join tb_drybeachequipinfor c on c.equipno = b .deviceid where b.pointid in (select guid from web_monitor_points where chartid = #{chartid} )")
List<HashMap<String, Object>> getByChartId(int chartid);
@Select(value = "SELECT * FROM `web_monitor_link` where pointid = (select guid from web_monitor_points where guid = #{guid})")
......
......@@ -195,6 +195,8 @@ public class WebMonitorChartServiceImpl extends ServiceImpl<WebMonitorChartMappe
for (WebMonitorPointsVo point : points) {
List<HashMap<String, Object>> items = point.getItems();
for (HashMap<String, Object> item : items) {
StringBuffer stringBuffer1 = new StringBuffer();
stringBuffer1.append("( ");
String id1 = (String) item.get("id");
for (HashMap<String, Object> hashMap : hashMaps) {
String equipno = (String) hashMap.get("equipno");
......@@ -225,18 +227,18 @@ public class WebMonitorChartServiceImpl extends ServiceImpl<WebMonitorChartMappe
//
HashMap<String, Object> map = new HashMap<>();
//遍历键值
for (Map key : keys) {
Set keyset1 = key.keySet();
for (Object o : keyset1) {
String s = (String) key.get(o.toString());
for (String string : strings) {
if (s.equals(string)) {
map.put(o.toString(), data.get(string));
}
}
}
}
item.put("realdata", map);
for (Map keyMap : keys) {
String name = keyMap.get("name").toString();
String key = keyMap.get("key").toString();
String value = data.get(key).toString();
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append(name).append(": ").append(value).append(" ").append(item.get("unit"));
String string = stringBuffer.toString();
data.put(key, string);
stringBuffer.append(string).append(",");
}
stringBuffer1.append(" )");
item.put("realdata", data);
}
}
}
......
......@@ -5,7 +5,7 @@ spring:
freemarker:
check-template-location: false
profiles:
active: dev
active: prod
jackson:
time-zone: GMT+8
data:
......@@ -28,9 +28,9 @@ spring:
redis:
#数据库索引
database: ${REDIS_DB:0}
host: ${REDIS_HOST:127.0.0.1}
port: ${REDIS_PORT:6399}
password: ${REDIS_PWD:R#9Xz&2Lp$Wq8v!u}
host: ${REDIS_HOST:8.142.46.126}
port: ${REDIS_PORT:6379}
password: ${REDIS_PWD:}
#连接超时时间
timeout: 5000
......
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