Commit 2d074a2c authored by KeYong's avatar KeYong

Merge remote-tracking branch 'origin/develop_dl_plan6_temp' into develop_dl_plan6_temp

parents 74c31d52 86ae93d8
...@@ -322,8 +322,8 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -322,8 +322,8 @@ public class SupervisionConfigureController extends AbstractBaseController {
twoHourEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), two, nowStrLong, prefix, suffix, pressurePumpStart); twoHourEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), two, nowStrLong, prefix, suffix, pressurePumpStart);
fourHourEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), four, nowStrLong, prefix, suffix, pressurePumpStart); fourHourEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), four, nowStrLong, prefix, suffix, pressurePumpStart);
oneHourEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), one, nowStrLong, prefix, suffix, pressurePumpStart); oneHourEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), one, nowStrLong, prefix, suffix, pressurePumpStart);
start = iotFeign.selectOne(getAppKey(), getProduct(), getToken(), "1", prefix, suffix, "true", pressurePumpStart); start = iotFeign.topSingleField(getAppKey(), getProduct(), getToken(), "1", prefix, suffix, "true", pressurePumpStart);
stop = iotFeign.selectOne(getAppKey(), getProduct(), getToken(), "1", prefix, suffix, "false", pressurePumpStart); stop = iotFeign.topSingleField(getAppKey(), getProduct(), getToken(), "1", prefix, suffix, "false", pressurePumpStart);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -219,7 +219,7 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -219,7 +219,7 @@ public class EmergencyServiceImpl implements IEmergencyService {
@Override @Override
public Map<String, Object> getPressurePumpStatusChart(String equipmentCode, String startTime, String endTime, String bizOrgCode, String appKey, String product, String token) { public Map<String, Object> getPressurePumpStatusChart(String equipmentCode, String startTime, String endTime, String bizOrgCode, String appKey, String product, String token) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
// 获取稳压泵 // 获取稳压泵
List<Map<String, Object>> list = equipmentSpecificSerivce.getListByEquipmentCode(equipmentCode, bizOrgCode); List<Map<String, Object>> list = equipmentSpecificSerivce.getListByEquipmentCode(equipmentCode, bizOrgCode);
// 获取各稳压泵数据,及时间戳 // 获取各稳压泵数据,及时间戳
...@@ -232,10 +232,12 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -232,10 +232,12 @@ public class EmergencyServiceImpl implements IEmergencyService {
list.forEach(x -> { list.forEach(x -> {
Object iotCode = x.get("iotCode"); Object iotCode = x.get("iotCode");
String prefix = null; String prefix = null;
String suffix = null;
if (x.get("iotCode") != null && iotCode.toString().length() > 8) { if (x.get("iotCode") != null && iotCode.toString().length() > 8) {
prefix = iotCode.toString().substring(0, 8); prefix = iotCode.toString().substring(0, 8);
suffix = iotCode.toString().substring(8);
try { try {
ResponseModel responseModel = iotFeign.selectListNew(appKey, product, token, prefix,null, startTime, endTime, null, pressurePumpStart); ResponseModel responseModel = iotFeign.selectListNew(appKey, product, token, prefix, suffix, startTime, endTime, null, pressurePumpStart);
if (200 == responseModel.getStatus()) { if (200 == responseModel.getStatus()) {
String json = JSON.toJSONString(responseModel.getResult()); String json = JSON.toJSONString(responseModel.getResult());
List<Map<String, String>> dataList = (List<Map<String, String>>) JSONArray.parse(json); List<Map<String, String>> dataList = (List<Map<String, String>>) JSONArray.parse(json);
...@@ -287,7 +289,9 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -287,7 +289,9 @@ public class EmergencyServiceImpl implements IEmergencyService {
if (!CollectionUtils.isEmpty(data)) { if (!CollectionUtils.isEmpty(data)) {
yDataList = data.stream().filter(o -> "true".equalsIgnoreCase(o.get(pressurePumpStart))).collect(Collectors.toList()); yDataList = data.stream().filter(o -> "true".equalsIgnoreCase(o.get(pressurePumpStart))).collect(Collectors.toList());
yList.add(!CollectionUtils.isEmpty(yDataList) && "true".equalsIgnoreCase(flag) ? 1 : 0); yList.add(!CollectionUtils.isEmpty(yDataList) && "true".equalsIgnoreCase(flag) ? 1 : 0);
flag = data.get(data.size() - 1).get(pressurePumpStart); //flag = data.get(data.size() - 1).get(pressurePumpStart);
// 原有逻辑仅限第一次启停、第一次经历启停处理完后、flag 为 false(未恢复起始默认状态) 导致后续启动后状态判断失效数据异常
flag = "true".equals(flag) ? "false" : "true";
} else { } else {
yList.add(0); yList.add(0);
} }
...@@ -378,7 +382,7 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -378,7 +382,7 @@ public class EmergencyServiceImpl implements IEmergencyService {
} }
} }
} }
ResponseModel intervalResponseModel = iotFeign.topSingleField(appKey, product, token, "10", prefix, null, null, pressurePumpStart); ResponseModel intervalResponseModel = iotFeign.topSingleField(appKey, product, token, "100", prefix, null, null, pressurePumpStart);
String intervalTime1 = nowStrLong; String intervalTime1 = nowStrLong;
String intervalTime2 = nowStrLong; String intervalTime2 = nowStrLong;
String durationTime = nowStrLong; String durationTime = nowStrLong;
...@@ -423,8 +427,8 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -423,8 +427,8 @@ public class EmergencyServiceImpl implements IEmergencyService {
} }
} }
} }
intervalMap.put("value", Math.abs(DateUtils.getDurationMinutes(intervalTime1, intervalTime2, "yyyy-MM-dd HH:mm:ss"))); intervalMap.put("value", Math.ceil((double) Math.abs(DateUtils.getDurationSecconds(intervalTime1, intervalTime2, "yyyy-MM-dd HH:mm:ss")) / 60));
durationlMap.put("value", Math.abs(DateUtils.getDurationMinutes(durationTime, nowStrLong, "yyyy-MM-dd HH:mm:ss"))); durationlMap.put("value", Math.ceil((double) Math.abs(DateUtils.getDurationSecconds(durationTime, nowStrLong, "yyyy-MM-dd HH:mm:ss")) / 60));
} else { } else {
intervalMap.put("value", 0); intervalMap.put("value", 0);
durationlMap.put("value", 0); durationlMap.put("value", 0);
......
...@@ -699,7 +699,7 @@ ...@@ -699,7 +699,7 @@
wlesal.id, wlesal.id,
wlesal.equipment_specific_id AS equipmentSpecificId, wlesal.equipment_specific_id AS equipmentSpecificId,
IFNULL(wlesal.equipment_specific_code,'') AS fireEquipmentCode, IFNULL(wlesal.equipment_specific_code,'') AS fireEquipmentCode,
wlesal.equipment_specific_name AS fireEquipmentName, (SELECT name from wl_equipment_specific where id = wlesal.equipment_specific_id) AS fireEquipmentName,
wlesal.equipment_index_id AS fireEquipmentIndexId, wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey, wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName, wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
......
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