Commit fbbe7b46 authored by 高建强's avatar 高建强

item:稳压泵诊断分析接口修改

parent 5b82d50b
...@@ -34,8 +34,8 @@ public interface IotFeign { ...@@ -34,8 +34,8 @@ public interface IotFeign {
@RequestHeader("token") String token, @RequestHeader("token") String token,
@RequestParam(value = "top") String top, @RequestParam(value = "top") String top,
@RequestParam(value = "productKey") String productKey, @RequestParam(value = "productKey") String productKey,
@RequestParam(value = "deviceName") String deviceName, @RequestParam(required = false, value = "deviceName") String deviceName,
@RequestParam("FHS_FirePump_RunStatus") String key, @RequestParam("FHS_PressurePump_Start") String key,
@RequestParam(required = false, value = "fieldKey") String fieldKey); @RequestParam(required = false, value = "fieldKey") String fieldKey);
@RequestMapping(value = "v1/livedata/common/list", method = RequestMethod.GET, consumes = "application/json") @RequestMapping(value = "v1/livedata/common/list", method = RequestMethod.GET, consumes = "application/json")
......
...@@ -318,16 +318,16 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -318,16 +318,16 @@ public class EmergencyServiceImpl implements IEmergencyService {
AtomicInteger halfNum = new AtomicInteger(); AtomicInteger halfNum = new AtomicInteger();
AtomicInteger twoNum = new AtomicInteger(); AtomicInteger twoNum = new AtomicInteger();
if (!CollectionUtils.isEmpty(specificList)) { if (!CollectionUtils.isEmpty(specificList)) {
AtomicReference<String> prefix = null; String prefix = null;
specificList.forEach(x -> { for (Map<String, Object> x : specificList) {
Object iotCode = x.get("iotCode"); Object iotCode = x.get("iotCode");
String suffix = null; String suffix = null;
if (x.get("iotCode") != null && iotCode.toString().length() > 8) { if (x.get("iotCode") != null && iotCode.toString().length() > 8) {
prefix.set(iotCode.toString().substring(0, 8)); prefix = iotCode.toString().substring(0, 8);
suffix = iotCode.toString().substring(8); suffix = iotCode.toString().substring(8);
try { try {
ResponseModel halfResponseModel = iotFeign.selectList(appKey, product, token, half, nowStrLong, prefix.get(), suffix, pressurePumpStart); ResponseModel halfResponseModel = iotFeign.selectList(appKey, product, token, half, nowStrLong, prefix, suffix, pressurePumpStart);
ResponseModel twoResponseModel = iotFeign.selectList(appKey, product, token, two, nowStrLong, prefix.get(), suffix, pressurePumpStart); ResponseModel twoResponseModel = iotFeign.selectList(appKey, product, token, two, nowStrLong, prefix, suffix, pressurePumpStart);
if (200 == halfResponseModel.getStatus()) { if (200 == halfResponseModel.getStatus()) {
String json = JSON.toJSONString(halfResponseModel.getResult()); String json = JSON.toJSONString(halfResponseModel.getResult());
List<Map<String, String>> halfDataList = (List<Map<String, String>>) JSONArray.parse(json); List<Map<String, String>> halfDataList = (List<Map<String, String>>) JSONArray.parse(json);
...@@ -344,8 +344,8 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -344,8 +344,8 @@ public class EmergencyServiceImpl implements IEmergencyService {
e.printStackTrace(); e.printStackTrace();
} }
} }
}); }
ResponseModel intervalResponseModel = iotFeign.selectOne(appKey, product, token, "1", String.valueOf(prefix), null, null, pressurePumpStart); ResponseModel intervalResponseModel = iotFeign.selectOne(appKey, product, token, "1", prefix, null, null, pressurePumpStart);
String intervalTime = nowStrLong; String intervalTime = nowStrLong;
String durationTime = nowStrLong; String durationTime = nowStrLong;
if (200 == intervalResponseModel.getStatus()) { if (200 == intervalResponseModel.getStatus()) {
...@@ -354,7 +354,7 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -354,7 +354,7 @@ public class EmergencyServiceImpl implements IEmergencyService {
if (!CollectionUtils.isEmpty(intervalDataList)) { if (!CollectionUtils.isEmpty(intervalDataList)) {
String value = intervalDataList.get(0).get(pressurePumpStart); String value = intervalDataList.get(0).get(pressurePumpStart);
if ("true".equals(value)) { if ("true".equals(value)) {
ResponseModel stopResponseModel = iotFeign.selectOne(appKey, product, token, "1", String.valueOf(prefix), null, "false", pressurePumpStart); ResponseModel stopResponseModel = iotFeign.selectOne(appKey, product, token, "1", prefix, null, "false", pressurePumpStart);
if (200 == stopResponseModel.getStatus()) { if (200 == stopResponseModel.getStatus()) {
String stopJson = JSON.toJSONString(stopResponseModel.getResult()); String stopJson = JSON.toJSONString(stopResponseModel.getResult());
List<Map<String, String>> stopDataList = (List<Map<String, String>>) JSONArray.parse(stopJson); List<Map<String, String>> stopDataList = (List<Map<String, String>>) JSONArray.parse(stopJson);
...@@ -363,7 +363,7 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -363,7 +363,7 @@ public class EmergencyServiceImpl implements IEmergencyService {
// 停泵前的前5分钟,判断管网压力状态 // 停泵前的前5分钟,判断管网压力状态
try { try {
String stop5BeforeTime = DateUtils.convertDateToString(DateUtils.dateAddMinutes(DateUtils.convertStrToDate(intervalTime, "yyyy-MM-dd HH:mm:ss"), -5), "yyyy-MM-dd HH:mm:ss"); String stop5BeforeTime = DateUtils.convertDateToString(DateUtils.dateAddMinutes(DateUtils.convertStrToDate(intervalTime, "yyyy-MM-dd HH:mm:ss"), -5), "yyyy-MM-dd HH:mm:ss");
ResponseModel pipeResponseModel = iotFeign.selectListNew(appKey, product, token,String.valueOf(prefix), stop5BeforeTime, intervalTime, null, "FHS_PipePressureDetector_PipePressure"); ResponseModel pipeResponseModel = iotFeign.selectListNew(appKey, product, token, prefix, stop5BeforeTime, intervalTime, null, "FHS_PipePressureDetector_PipePressure");
if (200 == pipeResponseModel.getStatus()) { if (200 == pipeResponseModel.getStatus()) {
String pipeJson = JSON.toJSONString(pipeResponseModel.getResult()); String pipeJson = JSON.toJSONString(pipeResponseModel.getResult());
List<Map<String, String>> pipeDataList = (List<Map<String, String>>) JSONArray.parse(pipeJson); List<Map<String, String>> pipeDataList = (List<Map<String, String>>) JSONArray.parse(pipeJson);
...@@ -378,7 +378,7 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -378,7 +378,7 @@ public class EmergencyServiceImpl implements IEmergencyService {
} }
} }
} }
ResponseModel startResponseModel = iotFeign.selectOne(appKey, product, token, "2", String.valueOf(prefix), null, "true", pressurePumpStart); ResponseModel startResponseModel = iotFeign.selectOne(appKey, product, token, "2", prefix, null, "true", pressurePumpStart);
if (200 == startResponseModel.getStatus()) { if (200 == startResponseModel.getStatus()) {
String startJson = JSON.toJSONString(startResponseModel.getResult()); String startJson = JSON.toJSONString(startResponseModel.getResult());
List<Map<String, String>> startDataList = (List<Map<String, String>>) JSONArray.parse(startJson); List<Map<String, String>> startDataList = (List<Map<String, String>>) JSONArray.parse(startJson);
...@@ -387,7 +387,7 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -387,7 +387,7 @@ public class EmergencyServiceImpl implements IEmergencyService {
} }
} }
} else { } else {
ResponseModel startResponseModel = iotFeign.selectOne(appKey, product, token, "1", String.valueOf(prefix), null, "true", pressurePumpStart); ResponseModel startResponseModel = iotFeign.selectOne(appKey, product, token, "1", prefix, null, "true", pressurePumpStart);
if (200 == startResponseModel.getStatus()) { if (200 == startResponseModel.getStatus()) {
String startJson = JSON.toJSONString(startResponseModel.getResult()); String startJson = JSON.toJSONString(startResponseModel.getResult());
List<Map<String, String>> startDataList = (List<Map<String, String>>) JSONArray.parse(startJson); List<Map<String, String>> startDataList = (List<Map<String, String>>) JSONArray.parse(startJson);
...@@ -399,8 +399,8 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -399,8 +399,8 @@ public class EmergencyServiceImpl implements IEmergencyService {
} }
} }
} }
intervalMap.put("value", DateUtils.getDurationMinutes(nowStrLong, intervalTime, "yyyy-MM-dd HH:mm:ss")); intervalMap.put("value", DateUtils.getDurationMinutes(intervalTime, nowStrLong, "yyyy-MM-dd HH:mm:ss"));
durationlMap.put("value", DateUtils.getDurationMinutes(nowStrLong, durationTime, "yyyy-MM-dd HH:mm:ss")); durationlMap.put("value", DateUtils.getDurationMinutes(durationTime, nowStrLong, "yyyy-MM-dd HH:mm:ss"));
} else { } else {
intervalMap.put("value", 0); intervalMap.put("value", 0);
durationlMap.put("value", 0); durationlMap.put("value", 0);
......
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