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

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

parents a3ac8c1d cc16fffc
package com.yeejoin.equipmanage.common.enums;
/**
* 一天内不同时段个数
*/
public enum DayHourEnum {
hour("小时", 24),
hafHour("半小时个数", 48),
twoHour("两小时个数", 12),
fourHour("四小时个数", 6);
private String name;
private int number;
DayHourEnum(String name, int number ){
this.name = name;
this.number = number;
}
public String getName() {
return name;
}
public int getNumber() {
return number;
}
}
......@@ -20,7 +20,8 @@ public enum TopicEnum {
CARZXDT("carIndexInsertOrUpdate", "最新动态-告警日志列表"),
EQXXTJ("fasReportInsertOrUpdate", "设备信号消息统计列表"),
ALARM_LOG_INSERT("alarm/log/insert","告警日志插入"),
IOT_SYSTEM__AlARM("iot-system-alarm", "确警消息");
IOT_SYSTEM__AlARM("iot-system-alarm", "确警消息"),
SHBZYCXH("fasNormalIndexInsertOrUpdate", "四横八纵遥测信号");
private String topic;
......
......@@ -114,8 +114,8 @@ public class BigScreenController extends AbstractBaseController {
ResponseModel entity1 = null;
ResponseModel entity2 = null;
try {
entity1 = iotFeign.selectListNew(getAppKey(), getProduct(), getToken(),prefix,suffix, startDateStr, nowStrLong, "true", pressurePumpStart);
entity2 = iotFeign.selectListNew(getAppKey(), getProduct(), getToken(),prefix,suffix, startDateStr, nowStrLong, "false", pressurePumpStart);
entity1 = iotFeign.selectListNew(prefix,suffix, startDateStr, nowStrLong, "true", pressurePumpStart);
entity2 = iotFeign.selectListNew(prefix,suffix, startDateStr, nowStrLong, "false", pressurePumpStart);
} catch (Exception e) {
e.printStackTrace();
}
......
......@@ -332,8 +332,8 @@ public class ConfigureController extends AbstractBaseController {
ResponseModel entity1 = null;
ResponseModel entity2 = null;
try {
entity1 = iotFeign.selectListNew(getAppKey(), getProduct(), getToken(),prefix,suffix, startDateStr, nowStrLong, "true", pressurePumpStart);
entity2 = iotFeign.selectListNew(getAppKey(), getProduct(), getToken(),prefix,suffix, startDateStr, nowStrLong, "false", pressurePumpStart);
entity1 = iotFeign.selectListNew(prefix,suffix, startDateStr, nowStrLong, "true", pressurePumpStart);
entity2 = iotFeign.selectListNew(prefix,suffix, startDateStr, nowStrLong, "false", pressurePumpStart);
} catch (Exception e) {
e.printStackTrace();
}
......@@ -393,8 +393,8 @@ public class ConfigureController extends AbstractBaseController {
ResponseModel entity1 = null;
ResponseModel entity2 = null;
try {
entity1 = iotFeign.selectListNew(getAppKey(), getProduct(), getToken(),prefix,suffix, startDateStr, nowStrLong, "true", pressurePumpStart);
entity2 = iotFeign.selectListNew(getAppKey(), getProduct(), getToken(),prefix,suffix, startDateStr, nowStrLong, "false", pressurePumpStart);
entity1 = iotFeign.selectListNew(prefix,suffix, startDateStr, nowStrLong, "true", pressurePumpStart);
entity2 = iotFeign.selectListNew(prefix,suffix, startDateStr, nowStrLong, "false", pressurePumpStart);
} catch (Exception e) {
e.printStackTrace();
}
......
......@@ -64,9 +64,6 @@ public interface IotFeign {
@RequestMapping(value = "v1/livedata/common/list", method = RequestMethod.GET, consumes = "application/json")
ResponseModel selectListNew(
@RequestHeader("appKey") String appKey,
@RequestHeader("product") String product,
@RequestHeader("token") String token,
@RequestParam(value = "measurement") String measurement,
@RequestParam( required = false, value = "deviceName") String deviceName,
@RequestParam(value = "timeStart") String beginDate,
......
......@@ -286,7 +286,7 @@ public class EmergencyServiceImpl implements IEmergencyService {
prefix = iotCode.toString().substring(0, 8);
suffix = iotCode.toString().substring(8);
try {
ResponseModel responseModel = iotFeign.selectListNew(appKey, product, token, prefix, suffix, startTime, endTime, null, pressurePumpStart);
ResponseModel responseModel = iotFeign.selectListNew( prefix, suffix, startTime, endTime, null, pressurePumpStart);
if (200 == responseModel.getStatus()) {
String json = JSON.toJSONString(responseModel.getResult());
List<Map<String, String>> dataList = (List<Map<String, String>>) JSONArray.parse(json);
......@@ -451,7 +451,7 @@ public class EmergencyServiceImpl implements IEmergencyService {
durationTime = intervalTime2;
intervalTime1 = falseDataList.get(0).get("createdTime");
String stop5BeforeTime = DateUtils.convertDateToString(DateUtils.dateAddMinutes(DateUtils.convertStrToDate(intervalTime1, "yyyy-MM-dd HH:mm:ss"), -5), "yyyy-MM-dd HH:mm:ss");
ResponseModel pipeResponseModel = iotFeign.selectListNew(appKey, product, token, prefix, null, stop5BeforeTime, intervalTime2, null, "FHS_PipePressureDetector_PipePressure");
ResponseModel pipeResponseModel = iotFeign.selectListNew( prefix, null, stop5BeforeTime, intervalTime2, null, "FHS_PipePressureDetector_PipePressure");
if (200 == pipeResponseModel.getStatus()) {
String pipeJson = JSON.toJSONString(pipeResponseModel.getResult());
List<Map<String, String>> pipeDataList = (List<Map<String, String>>) JSONArray.parse(pipeJson);
......
......@@ -35,6 +35,7 @@ import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
......@@ -788,8 +789,18 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
if(equipmentSpecificMapper.getEquipmentSpecificIotCodeWYB().get(0) != null) {
vo = equipmentSpecificMapper.getEquipmentSpecificIotCodeWYB().get(0);
}
int startNum = Integer.parseInt(stringObjectMap.get("startNum").toString());
ResponseModel start = iotFeign.selectListNew(remoteSecurityService.getServerToken().getAppKey(), remoteSecurityService.getServerToken().getProduct(), remoteSecurityService.getServerToken().getToke(), vo.getIotCode().substring(0,8),null, startTime, endTime,"true", pressurePumpStart);
// 启停总数
int allNum = 0;
// 启动次数
int startNum = 0;
ResponseModel all = iotFeign.selectListNew(vo.getIotCode().substring(0,8),null, startTime, endTime,null, pressurePumpStart);
if (200 == all.getStatus() && !ObjectUtils.isEmpty(all.getResult())) {
String json1 = JSON.toJSONString(all.getResult());
List<Map<String, String>> listObject1 = (List<Map<String, String>>) JSONArray.parse(json1);
allNum = listObject1.size();
}
ResponseModel start = iotFeign.selectListNew(vo.getIotCode().substring(0,8),null, startTime, endTime,"true", pressurePumpStart);
if (200 == start.getStatus() && !ObjectUtils.isEmpty(start.getResult())) {
String json1 = JSON.toJSONString(start.getResult());
List<Map<String, String>> listObject1 = (List<Map<String, String>>) JSONArray.parse(json1);
......@@ -797,7 +808,6 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
}
Map<String, Object> retMap = new HashMap<>();
int allNum = Integer.parseInt(stringObjectMap.get("allNum").toString());
// 计算平均每小时打压频率
try {
......@@ -808,7 +818,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
int twoHour = DateUtils.dateBetweenNew2(DateUtils.dateParse(startTime, null),DateUtils.dateParse(endTime, null));
int fourHour = DateUtils.dateBetweenNew3(DateUtils.dateParse(startTime, null),DateUtils.dateParse(endTime, null));
// 开始时间与结束时间为同一天时 给默认值
if (hour == 0){
hour = DayHourEnum.hour.getNumber();
hafHour = DayHourEnum.hafHour.getNumber();
twoHour = DayHourEnum.twoHour.getNumber();
fourHour = DayHourEnum.fourHour.getNumber();
}
if(allNum/hour > 15) {
retMap.put("status","异常");
} else {
......
......@@ -498,6 +498,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
// 直流中心消息推送刷新
publishDataToDCCenterPage(equipmentSpecificIndexList);
// 四横八纵遥测信号信息列表刷新
publishNormalIndexValueToPage(equipmentSpecificIndexList);
if("zd".equals(system)){
System.out.println("站端系统----------------");
......@@ -1370,6 +1373,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
log.info(String.format("直流中心指标消息发送:%s", JSON.toJSONString(equipmentSpecificIndexList)));
}
public void publishNormalIndexValueToPage(List<EquipmentSpecificIndex> equipmentSpecificIndexList) {
mqttSendGateway.sendToMqtt(TopicEnum.SHBZYCXH.getTopic(), JSON.toJSONString(equipmentSpecificIndexList));
log.info(String.format("四横八纵遥测指标消息发送:%s", JSON.toJSONString(equipmentSpecificIndexList)));
}
/**
* 更新数据报表表
*
......
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