Commit 39e4f16f authored by KeYong's avatar KeYong

Merge branch 'develop_station' of http://39.98.45.134:8090/moa/amos-boot-biz into dev_bitmap

parents cb98b1a8 0ddd9fdc
......@@ -4,7 +4,7 @@ import java.math.BigDecimal;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import com.yeejoin.equipmanage.common.vo.QRCodeRequest;
......@@ -96,6 +96,13 @@ public class StringUtil {
return 0;
}
public static String toNotEmptyString(String s) {
if (ObjectUtils.isEmpty(s)) {
return "";
}
return s;
}
/**
* 截取前后都不是0的数字字符串
*
......
......@@ -36,13 +36,11 @@ import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentFireAlarm;
import com.yeejoin.equipmanage.common.dto.TemperatureAlarmDto;
import com.yeejoin.equipmanage.common.entity.CarProperty;
import com.yeejoin.equipmanage.common.entity.EquipmentAlarmReportDay;
import com.yeejoin.equipmanage.common.entity.EquipmentDetail;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarmLog;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
import com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity;
import com.yeejoin.equipmanage.common.entity.publics.BaseEntity;
import com.yeejoin.equipmanage.common.entity.vo.CarIndexVo;
import com.yeejoin.equipmanage.common.entity.vo.CarPropertyVo;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO;
......@@ -61,11 +59,9 @@ import com.yeejoin.equipmanage.common.enums.TemperatureAlarm;
import com.yeejoin.equipmanage.common.enums.TopicEnum;
import com.yeejoin.equipmanage.common.enums.TrueOrFalseEnum;
import com.yeejoin.equipmanage.common.utils.DateUtils;
import com.yeejoin.equipmanage.common.utils.EquipmentStateUtil;
import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.common.vo.CarIndexGisVo;
import com.yeejoin.equipmanage.common.vo.EquipmentIndexLabelsVo;
import com.yeejoin.equipmanage.common.vo.EquipmentVo;
import com.yeejoin.equipmanage.common.vo.IotDataVO;
import com.yeejoin.equipmanage.common.vo.Token;
import com.yeejoin.equipmanage.common.vo.TopicEntityVo;
......@@ -168,9 +164,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
private IEquipmentAlarmReportDayService iEquipmentAlarmReportDayService;
@Autowired
private IEquipmentDetailService iEquipmentDetailService;
@Autowired
private IEquipmentSpecificSerivce iEquipmentSpecificSerivce;
@Autowired
......@@ -180,12 +173,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
private SystemctlFeign systemctlFeign;
@Autowired
private TopographyService topographyService;
@Autowired
private IEquipmentService equipmentService;
@Autowired
private RemoteSecurityService remoteSecurityService;
@Value("${equipManage.name}")
......@@ -1254,22 +1241,22 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
equipmentAlarmLogs.forEach(action->{
FireEquipmentFireAlarm alarm = new FireEquipmentFireAlarm();
BeanUtils.copyProperties(action, alarm);
alarm.setAliasname(action.getEquipmentSpecificIndexName());
alarm.setEquipmentMeasurementId(action.getEquipmentIndexId().toString());
alarm.setEquipmentMeasurementMRid(action.getEquipmentIndexId().toString());
alarm.setFieldLabel(action.getEquipmentSpecificIndexKey());
alarm.setFieldName(action.getEquipmentSpecificIndexName());
alarm.setFireEquipmentId(action.getEquipmentSpecificId().toString());
alarm.setFireEquipmentMRid(action.getEquipmentSpecificCode());
alarm.setFireEquipmentName(action.getEquipmentSpecificName());
alarm.setAliasname(StringUtil.toNotEmptyString(action.getEquipmentSpecificIndexName()));
alarm.setEquipmentMeasurementId(StringUtil.toNotEmptyString(action.getEquipmentIndexId().toString()));
alarm.setEquipmentMeasurementMRid(StringUtil.toNotEmptyString(action.getEquipmentIndexId().toString()));
alarm.setFieldLabel(StringUtil.toNotEmptyString(action.getEquipmentSpecificIndexKey()));
alarm.setFieldName(StringUtil.toNotEmptyString(action.getEquipmentSpecificIndexName()));
alarm.setFireEquipmentId(StringUtil.toNotEmptyString(action.getEquipmentSpecificId().toString()));
alarm.setFireEquipmentMRid(StringUtil.toNotEmptyString(action.getEquipmentSpecificCode()));
alarm.setFireEquipmentName(StringUtil.toNotEmptyString(action.getEquipmentSpecificName()));
alarm.setFrequency(1);
alarm.setId(action.getId().toString());
alarm.setId(StringUtil.toNotEmptyString(action.getId().toString()));
alarm.setMrid(action.getId().toString());
alarm.setName(action.getEquipmentSpecificIndexName());
alarm.setRecoveryDate(action.getUpdateDate());
alarm.setStationCode(ObjectUtils.isEmpty(stationInfo)?"":stationInfo.get("stationCode"));
alarm.setStationName(ObjectUtils.isEmpty(stationInfo)?"":stationInfo.get("stationName"));
alarm.setValue(action.getEquipmentSpecificIndexValue());
alarm.setStationCode(StringUtil.toNotEmptyString(stationInfo.get("stationCode")));
alarm.setStationName(StringUtil.toNotEmptyString(stationInfo.get("stationName")));
alarm.setValue(StringUtil.toNotEmptyString(action.getEquipmentSpecificIndexValue()));
alarmList.add(alarm);
});
return alarmList;
......
......@@ -114,6 +114,10 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
@Value("${param.nrvideo.url}")
private String nrvideoUrl;
@Value("${param.nrflvbyvoideoid.url}")
private String nrflvByVoideoidUrl;
@Value("${dcs.client-id}")
private String clientId;
......@@ -520,12 +524,12 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
@Override
public String getVideoUrl(String videoId, String presetIndex, String defaultUrl, String code) {
public String getVideoUrl(String videoName, String presetIndex, String defaultUrl, String code) {
String url = "";
if ("hls".equals(vedioFormat)) {
url = getVideoUrl(code);
} else {
url = getFlvUrlByVideoIdOrPresetIndex(videoId, presetIndex);
url = getFlvUrlByVideoId(code);
}
return ObjectUtils.isEmpty(url) ? defaultUrl : url;
}
......@@ -543,6 +547,35 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
return url;
}
public String getFlvUrlByVideoId(String videoId) {
try {
Map<String, Object> request = new HashMap<String, Object>();
request.put("cameraId", videoId);
request.put("clientType", 1);
request.put("streamType", 1);
request.put("templetId ", "000004");
request.put("urlType", 4);
JSONObject json = new JSONObject(request);
log.info("request:{}", JSONObject.toJSONString(request));
log.info("nrvideoUrl=={}", nrflvByVoideoidUrl);
String content = HttpContentTypeUtil.sendHttpPostJson(nrflvByVoideoidUrl, json.toJSONString());
if (ObjectUtils.isEmpty(content)) {
log.error("getFlvUrlByVideoId=flv视频流接口获取失败,参数:{}" + JSONObject.toJSONString(request));
}
Map<String, Object> respond = JSONObject.parseObject(content, Map.class);
log.error("getFlvUrlByVideoId=flv视频流接口返回respond:{}" + JSONObject.toJSONString(respond));
if ("SUCCESS".equals(respond.get("resultDesc")) && respond.containsKey("url")) {
return respond.get("url").toString();
}
return "";
} catch (Exception e) {
log.error("getFlvUrlByVideoId=flv视频流接口获取失败:{}", e.getMessage());
}
return "";
}
public String getFlvUrlByVideoIdOrPresetIndex(String videoId, String presetIndex) {
try {
String rtsp = getRtspUrlByVideoIdOrPresetIndex(videoId, presetIndex);
......@@ -555,21 +588,21 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
request.put("messageType", "/video-service/transcode/getCameraPlaybackFlv/call");
request.put("cameraId", videoId);
request.put("rtsp ", rtsp);
String content = HttpContentTypeUtil.sendHttpGetWithHeader(nrvideoUrl, request);
log.info("request:{}", JSONObject.toJSONString(request));
log.info("nrvideoUrl=={}", nrvideoUrl);
String content = HttpContentTypeUtil.sendHttpGetWithHeader(nrvideoUrl, request);
if (ObjectUtils.isEmpty(content)) {
log.error("flv视频流接口获取失败,参数:{}" + JSONObject.toJSONString(request));
log.error("getFlvUrlByVideoIdOrPresetIndex==flv视频流接口获取失败,参数:{}" + JSONObject.toJSONString(request));
}
Map<String, String> respond = JSONObject.parseObject(content, Map.class);
log.error("flv视频流接口返回respond:{}" + JSONObject.toJSONString(respond));
log.error("getFlvUrlByVideoIdOrPresetIndex==flv视频流接口返回respond:{}" + JSONObject.toJSONString(respond));
if (respond.containsKey("url")) {
return respond.get("url");
}
return "";
} catch (Exception e) {
log.error("flv视频流接口获取失败:{}", e.getMessage());
log.error("getFlvUrlByVideoIdOrPresetIndex==flv视频流接口获取失败:{}", e.getMessage());
}
return "";
}
......@@ -581,11 +614,11 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
videoRequest.put("messageType", "getCameraRTSP");
videoRequest.put("cameraId", videoId);
videoRequest.put("presetIndex", ObjectUtils.isEmpty(presetIndex) ? "1" : presetIndex);
String content = HttpContentTypeUtil.sendHttpGetWithHeader(htvideoUrl, videoRequest);
log.info("videoRequest:{}", JSONObject.toJSONString(videoRequest));
log.info("htvideoUrl=={}", htvideoUrl);
String content = HttpContentTypeUtil.sendHttpGetWithHeader(htvideoUrl, videoRequest);
if (ObjectUtils.isEmpty(content)) {
log.error("接口获取失败,参数={}", JSONObject.toJSONString(videoRequest));
log.error("getRtspUrlByVideoIdOrPresetIndex==接口获取失败,参数={}", JSONObject.toJSONString(videoRequest));
}
Map<String, String> respond = JSONObject.parseObject(content, Map.class);
......
......@@ -66,7 +66,10 @@ param.system.online.date = 2019-02-12
# 视频转码服务开关 hls(关)/flv(开),默认关闭,数字换流站使用时开启
window.vedioFormat = hls
# 航天视频服务地址
param.htvideo.url="http://192.168.4.174:9001";
param.htvideo.url=http://192.168.4.174:9001;
# 南瑞视频转码服务地址
param.nrvideo.url="http://198.87.103.158:8001";
param.nrvideo.url=http://198.87.103.158:8001;
#南瑞视频平台通过视频id获取flv格式视频播放地址
param.nrflvbyvoideoid.url=http://192.168.4.159:10010/api/media/live
......@@ -69,3 +69,5 @@ window.vedioFormat = hls
param.htvideo.url="";
# 南瑞视频转码服务地址
param.nrvideo.url="";
#南瑞视频平台通过视频id获取flv格式视频播放地址
param.nrflvbyvoideoid.url=http://192.168.4.159:10010/api/media/live
......@@ -76,3 +76,5 @@ window.vedioFormat = hls
param.htvideo.url="";
# 南瑞视频转码服务地址
param.nrvideo.url="";
#南瑞视频平台通过视频id获取flv格式视频播放地址
param.nrflvbyvoideoid.url=http://192.168.4.159:10010/api/media/live
......@@ -68,3 +68,5 @@ window.vedioFormat = hls
param.htvideo.url="";
# 南瑞视频转码服务地址
param.nrvideo.url="";
#南瑞视频平台通过视频id获取flv格式视频播放地址
param.nrflvbyvoideoid.url=http://192.168.4.159:10010/api/media/live
......@@ -61,3 +61,5 @@ window.vedioFormat = hls
param.htvideo.url="";
# 南瑞视频转码服务地址
param.nrvideo.url="";
#南瑞视频平台通过视频id获取flv格式视频播放地址
param.nrflvbyvoideoid.url=http://192.168.4.159:10010/api/media/live
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