Commit 95c48e7d authored by chenzhao's avatar chenzhao

图片接口修改

parent 83c95ead
......@@ -1009,9 +1009,23 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public Map<String, Object> getSwitchUrl(String gatewayId,String equipName ){
String sql = "SELECT * FROM indicators_"+gatewayId+" WHERE systemType = '开关' and frontModule =~ /"+equipName+"/ and displayName =~/合位$/";
String sql1 = "SELECT * FROM indicators_"+gatewayId+" WHERE systemType = '开关' and frontModule =~ /"+equipName+"/ and displayName =~/远方就地开关$/";
String sql2 = "SELECT * FROM indicators_"+gatewayId+" WHERE systemType = '开关' and frontModule =~ /"+equipName+"/ and displayName =~/接地刀位置$/";
List<IndicatorsDto> listData = influxDButils.getListData(sql, IndicatorsDto.class);
List<IndicatorsDto> listDatas = influxDButils.getListData(sql1, IndicatorsDto.class);
List<IndicatorsDto> listDatass = influxDButils.getListData(sql2, IndicatorsDto.class);
Map<String, Object> photoUrls = new HashMap<>();
for (IndicatorsDto datass : listDatass) {
String url = "";
String[] urls = datass.getPictureName().split(",");
if (datass.getValue().equals("true")){
url =pictureUrl+urls[0];
}else {
url =pictureUrl+ urls[1];;
}
photoUrls.put(datass.getDisplayName().split("_")[0]+"jddwz",url);
}
for (IndicatorsDto data : listDatas) {
String url = "";
String[] urls = data.getPictureName().split(",");
......@@ -1025,22 +1039,28 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
for (IndicatorsDto listDatum : listData) {
String url = "";
if (listDatum.getValue().equals("true")){
url =pictureUrl+ listDatum.getPictureName();
if (listDatum.getDisplayName().contains("手车工作位置")){
String[] split = listDatum.getPictureName().split(":");
if (listDatum.getValue().equals("true")){
String[] split1 = split[0].split(",");
photoUrls.put(listDatum.getDisplayName().split("_")[0]+"scsurl",pictureUrl+split1[0]);
photoUrls.put(listDatum.getDisplayName().split("_")[0]+"scxurl",pictureUrl+split1[1]);
}else {
String[] split1 = split[1].split(",");
photoUrls.put(listDatum.getDisplayName().split("_")[0]+"scsurl",pictureUrl+split1[0]);
photoUrls.put(listDatum.getDisplayName().split("_")[0]+"scxurl",pictureUrl+split1[1]);
}
}else {
url =pictureUrl+ listDatum.getPictureName().replace("red", "green");
if (listDatum.getValue().equals("true")){
url =pictureUrl+ listDatum.getPictureName();
}else {
url =pictureUrl+ listDatum.getPictureName().replace("red", "green");
}
photoUrls.put(listDatum.getDisplayName().split("_")[0]+"url",url);
}
photoUrls.put(listDatum.getDisplayName().split("_")[0]+"url",url);
}
return photoUrls;
/* try {
emqKeeper.getMqttClient().publish(stationId+"/switch/",JSON.toJSONString(photoUrls).getBytes(),0,false);
} catch (MqttException e) {
e.printStackTrace();
log.error("开关消息发送失败");
}*/
}
}
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