视频增加中威和海康的区分

camera_merge
qiushui 4 years ago
parent ff2fa9d01f
commit 0482e9f402

@ -23,5 +23,9 @@ public class OrderVO extends Order {
private String [] pics; private String [] pics;
@ApiModelProperty("当视频为海康球机时")
private String cmd1;
@ApiModelProperty("当视频为海康球机时")
private String cmd2;
} }

@ -1,6 +1,7 @@
package com.zhehekeji.web.pojo.realTime; package com.zhehekeji.web.pojo.realTime;
import com.zhehekeji.web.entity.Camera; import com.zhehekeji.web.entity.Camera;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
@ -12,5 +13,8 @@ public class RealTime {
private String streetName; private String streetName;
@ApiModelProperty("样式 默认0 0:1个铺满 1:上下两个视频 2:2*2 3:3*3 4:4*4 5:5*5 66*6 8:8*8")
private Integer videoStyle;
private List<Camera> cameras; private List<Camera> cameras;
} }

@ -1,6 +1,7 @@
package com.zhehekeji.web.pojo.warn; package com.zhehekeji.web.pojo.warn;
import com.zhehekeji.web.entity.Warn; import com.zhehekeji.web.entity.Warn;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@Data @Data
@ -9,4 +10,9 @@ public class WarnVO extends Warn {
private String streetName; private String streetName;
private String timeLength; private String timeLength;
@ApiModelProperty("为海康球机时,调用此命令")
private String cmd1;
@ApiModelProperty("为海康球机时,调用此命令")
private String cmd2;
} }

@ -35,6 +35,9 @@ public class OrderService {
@Value("${mp4Path}") @Value("${mp4Path}")
private String mp4Path; private String mp4Path;
@Value("${cameraType}")
private Integer cameraType;
public PageInfo<OrderVO> orders(OrderSearch orderSearch) { public PageInfo<OrderVO> orders(OrderSearch orderSearch) {
List<Street> streets = streetMapper.selectByMap(new HashMap<>(0)); List<Street> streets = streetMapper.selectByMap(new HashMap<>(0));
Map<Integer, Street> streetMap = new HashMap<>(); Map<Integer, Street> streetMap = new HashMap<>();
@ -61,6 +64,12 @@ public class OrderService {
String[] pics = orderVO.getPicPaths().split(","); String[] pics = orderVO.getPicPaths().split(",");
orderVO.setPics(pics); orderVO.setPics(pics);
} }
if(cameraType == 1 && StringUtils.isEmpty(orderVO.getVideoPath1())){
orderVO.setCmd1(" VSPlayer "+ orderVO.getVideoPath1());
}
if(cameraType == 1 && StringUtils.isEmpty(orderVO.getVideoPath2())){
orderVO.setCmd1(" VSPlayer "+ orderVO.getVideoPath2());
}
orderVO.setGoodsLocation(location(orderVO,streetMap.get(orderVO.getStreetId()))); orderVO.setGoodsLocation(location(orderVO,streetMap.get(orderVO.getStreetId())));
}); });
return new PageInfo<>(orders); return new PageInfo<>(orders);

@ -1,10 +1,12 @@
package com.zhehekeji.web.service; package com.zhehekeji.web.service;
import com.baomidou.mybatisplus.extension.api.R;
import com.zhehekeji.web.entity.Camera; import com.zhehekeji.web.entity.Camera;
import com.zhehekeji.web.entity.Street; import com.zhehekeji.web.entity.Street;
import com.zhehekeji.web.mapper.CameraMapper; import com.zhehekeji.web.mapper.CameraMapper;
import com.zhehekeji.web.mapper.StreetMapper; import com.zhehekeji.web.mapper.StreetMapper;
import com.zhehekeji.web.pojo.realTime.RealTime; import com.zhehekeji.web.pojo.realTime.RealTime;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -21,6 +23,9 @@ public class RealTimeService {
@Resource @Resource
private CameraMapper cameraMapper; private CameraMapper cameraMapper;
@Value("${videoStyleAll}")
private Integer videoStyleAll;
public List<RealTime> realTimes(){ public List<RealTime> realTimes(){
List<Street> streets = streetMapper.selectByMap(new HashMap<>(0)); List<Street> streets = streetMapper.selectByMap(new HashMap<>(0));
List<Camera> cameras = cameraMapper.selectByMap(new HashMap<>(0)); List<Camera> cameras = cameraMapper.selectByMap(new HashMap<>(0));
@ -33,6 +38,7 @@ public class RealTimeService {
RealTime realTime = new RealTime(); RealTime realTime = new RealTime();
realTime.setStreetId(street.getId()); realTime.setStreetId(street.getId());
realTime.setStreetName(street.getName()); realTime.setStreetName(street.getName());
realTime.setVideoStyle(street.getVideoStyle());
List<Camera> cameraList = new ArrayList<>(2); List<Camera> cameraList = new ArrayList<>(2);
if(cameraMap.get(street.getCamera1Id()) != null){ if(cameraMap.get(street.getCamera1Id()) != null){
cameraList.add(cameraMap.get(street.getCamera1Id())); cameraList.add(cameraMap.get(street.getCamera1Id()));
@ -43,7 +49,15 @@ public class RealTimeService {
realTime.setCameras(cameraList); realTime.setCameras(cameraList);
realTimes.add(realTime); realTimes.add(realTime);
}); });
RealTime all = new RealTime();
all.setStreetId(0);
all.setStreetName("全部");
all.setCameras(cameras);
all.setVideoStyle(videoStyleAll);
realTimes.add(all);
return realTimes; return realTimes;
} }
} }

@ -5,7 +5,9 @@ import com.github.pagehelper.PageInfo;
import com.zhehekeji.web.mapper.WarnMapper; import com.zhehekeji.web.mapper.WarnMapper;
import com.zhehekeji.web.pojo.warn.WarnSearch; import com.zhehekeji.web.pojo.warn.WarnSearch;
import com.zhehekeji.web.pojo.warn.WarnVO; import com.zhehekeji.web.pojo.warn.WarnVO;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.Duration; import java.time.Duration;
@ -17,6 +19,9 @@ public class WarnService {
@Resource @Resource
private WarnMapper warnMapper; private WarnMapper warnMapper;
@Value("${cameraType}")
private Integer cameraType;
public PageInfo<WarnVO> page(WarnSearch warnSearch){ public PageInfo<WarnVO> page(WarnSearch warnSearch){
PageHelper.startPage(warnSearch.getPageNum(),warnSearch.getPageSize()); PageHelper.startPage(warnSearch.getPageNum(),warnSearch.getPageSize());
@ -29,6 +34,12 @@ public class WarnService {
int remainingSeconds = seconds.intValue() % 60; int remainingSeconds = seconds.intValue() % 60;
String timeLength = String.format("%02d:%02d", minutes,remainingSeconds); String timeLength = String.format("%02d:%02d", minutes,remainingSeconds);
warnVO.setTimeLength(timeLength); warnVO.setTimeLength(timeLength);
if(cameraType == 1 && StringUtils.isEmpty(warnVO.getVideoPath1())){
warnVO.setCmd1(" VSPlayer "+ warnVO.getVideoPath1());
}
if(cameraType == 1 && StringUtils.isEmpty(warnVO.getVideoPath2())){
warnVO.setCmd1(" VSPlayer "+ warnVO.getVideoPath2());
}
} }
}); });

@ -12,15 +12,15 @@ spring:
maxWait: 60000 maxWait: 60000
minEvictableIdleTimeMillis: 300000 minEvictableIdleTimeMillis: 300000
minIdle: 15 minIdle: 15
password: lipoLiPo password: Leaper@123
poolPreparedStatements: true poolPreparedStatements: true
testOnBorrow: true testOnBorrow: true
testOnReturn: false testOnReturn: false
testWhileIdle: false testWhileIdle: false
timeBetweenEvictionRunsMillis: 60000 timeBetweenEvictionRunsMillis: 60000
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
url: jdbc:mysql://47.99.98.250:33306/lipo_duoji?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8 url: jdbc:mysql://115.236.65.98:12004/lia_duoji?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8
username: lipo username: root
validationQuery: SELECT 1 FROM DUAL validationQuery: SELECT 1 FROM DUAL
zhehe: zhehe:
common: common:
@ -46,3 +46,8 @@ mediaPath: d:\\data\media\
mp4Path: d:\\data\mp4\ mp4Path: d:\\data\mp4\
# ------------球機選擇--- 0:中威 1海康 # ------------球機選擇--- 0:中威 1海康
cameraType: 1 cameraType: 1
# ------------服务端类型 0TCP 1:JSON
serverMode: 1
# ------------ 实时视频流 全部页面的格式
# --------------默认0 0:1个铺满 1:上下两个视频 2:2*2 3:3*3 4:4*4 5:5*5 66*6 8:8*8
videoStyleAll : 2

Loading…
Cancel
Save