liuguijing 2 years ago
commit 4010be3ab1

@ -18,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -46,8 +47,8 @@ public class TermSetController extends BaseController {
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getResolutionList") @RequestMapping("/getResolutionList")
@Log(title = "获取分辨率代码", type = "查询") @Log(title = "获取分辨率代码", type = "查询")
public ResponseReult<ResolutionModel> getResolutionList() { public ResponseReult<ResolutionModel> getResolutionList(@RequestParam("type") Integer type) {
ServiceBody<ResolutionModel> serviceBody = termSetService.getResolutionList(); ServiceBody<ResolutionModel> serviceBody = termSetService.getResolutionList(type);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) { if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData()); return ResponseReult.success(serviceBody.getData());
} else { } else {

@ -52,6 +52,16 @@ public class TerminalsAndLineAndChannelDto implements Serializable {
private Short boderWidth; private Short boderWidth;
private Short signalStrength4g;
private Integer bootTime;
private float batteryCapacity;
private float batteryVoltage;
private Integer lastHeartbeat;
private List<TerminalChannelsDto> list; private List<TerminalChannelsDto> list;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

@ -79,6 +79,21 @@ public class TerminalListModel implements Serializable {
@ApiModelProperty(value = "经度", example = "213") @ApiModelProperty(value = "经度", example = "213")
private Double longitude; private Double longitude;
@ApiModelProperty(value = "4G信号强度", example = "213")
private Short signalStrength4g;
@ApiModelProperty(value = "装置上次启动时间", example = "213")
private Integer bootTime;
@ApiModelProperty(value = "电池电量", example = "213")
private float batteryCapacity;
@ApiModelProperty(value = "电源电压", example = "213")
private float batteryVoltage;
@ApiModelProperty(value = "最后一次心跳时间", example = "213")
private Integer lastHeartbeat;
@ApiModelProperty(value = "通道编号和名称", example = "213") @ApiModelProperty(value = "通道编号和名称", example = "213")
private List<ChannelBeans> list; private List<ChannelBeans> list;

@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
/** /**
@ -14,10 +16,19 @@ import java.io.Serializable;
public class TerminalVideoParamsModel implements Serializable { public class TerminalVideoParamsModel implements Serializable {
@ApiModelProperty(value = "装置编号", example = "123456") @ApiModelProperty(value = "装置编号", example = "123456")
private Integer termId; private String cmdId;
@ApiModelProperty(value = "通道编号", example = "123456") @ApiModelProperty(value = "通道编号", example = "123456")
private Short channel; private Integer channel;
@ApiModelProperty(value = "视频格式", example = "123456")
private Integer format;
@ApiModelProperty(value = "录制时长", example = "123456")
private Integer time;
@ApiModelProperty(value = "录制时长", example = "123456")
private Boolean isNew = false;
} }

@ -8,7 +8,7 @@ import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
@Data @Data
@ApiModel(value = "声光报警设置对象", description = "声光报警设置对象描述") @ApiModel(value = "视频控制对象", description = "视频控制对象描述")
public class VideoGetVo { public class VideoGetVo {
@NotBlank(message = "监测装置ID") @NotBlank(message = "监测装置ID")

@ -4,20 +4,26 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Data @Data
@ApiModel(value = "视频控制参数对象", description = "视频控制参数对象") @ApiModel(value = "视频控制参数对象", description = "视频控制参数对象")
public class VideoParamsVo { public class VideoParamsVo {
@NotBlank(message = "装置编号不能缺少")
@ApiModelProperty(value = "装置编号", example = "123456") @ApiModelProperty(value = "装置编号", example = "123456")
private String cmdId; private String cmdId;
@NotNull(message = "通道编号不能缺少")
@ApiModelProperty(value = "通道编号", example = "123456") @ApiModelProperty(value = "通道编号", example = "123456")
private Integer channel; private Integer channel;
@NotNull(message = "视频格式不能缺少")
@ApiModelProperty(value = "不知道是啥", example = "123456") @ApiModelProperty(value = "视频格式", example = "123456")
private Integer format; private Integer format;
@ApiModelProperty(value = "不知道是啥", example = "123456") @NotNull(message = "录制时长不能缺少")
@ApiModelProperty(value = "录制时长", example = "123456")
private Integer time; private Integer time;

@ -1,12 +1,13 @@
package com.shxy.xymanager_dao.dao; package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.entity.Resolution; import com.shxy.xymanager_common.entity.Resolution;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
public interface TerminalResolutionDao { public interface TerminalResolutionDao {
List<Resolution> selectAllList(); List<Resolution> selectAllList(@Param("type") Integer type);
int insert(Resolution record); int insert(Resolution record);

@ -8,12 +8,12 @@
<select id="selectAllList" resultMap="BaseResultMap"> <select id="selectAllList" resultMap="BaseResultMap">
select select
id,name id,name
from resolution from resolution and type = #{type}
</select> </select>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.Resolution"> <insert id="insert" parameterType="com.shxy.xymanager_common.entity.Resolution">
insert into resolution (id, name) insert into resolution (id, name)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}) values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.Resolution"> <insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.Resolution">
insert into resolution insert into resolution
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">

@ -40,6 +40,11 @@
<result column="bs_identifier" jdbcType="VARCHAR" property="bsIdentifier"/> <result column="bs_identifier" jdbcType="VARCHAR" property="bsIdentifier"/>
<result column="latitude" jdbcType="DOUBLE" property="latitude"/> <result column="latitude" jdbcType="DOUBLE" property="latitude"/>
<result column="longitude" jdbcType="DOUBLE" property="longitude"/> <result column="longitude" jdbcType="DOUBLE" property="longitude"/>
<result column="signal_strength_4g" jdbcType="SMALLINT" property="signalStrength4g"/>
<result column="boot_time" jdbcType="INTEGER" property="bootTime"/>
<result column="battery_capacity" jdbcType="FLOAT" property="batteryCapacity"/>
<result column="battery_voltage" jdbcType="FLOAT" property="batteryVoltage"/>
<result column="last_heartbeat" jdbcType="INTEGER" property="lastHeartbeat"/>
<collection property="list" javaType="list" ofType="com.shxy.xymanager_common.dto.TerminalChannelsDto"> <collection property="list" javaType="list" ofType="com.shxy.xymanager_common.dto.TerminalChannelsDto">
<result column="channel_id" jdbcType="INTEGER" property="id"/> <result column="channel_id" jdbcType="INTEGER" property="id"/>
<result column="channel_name" jdbcType="VARCHAR" property="name"/> <result column="channel_name" jdbcType="VARCHAR" property="name"/>
@ -139,12 +144,18 @@
a.latitude as latitude, a.latitude as latitude,
a.longitude as longitude, a.longitude as longitude,
e.id as channel_id, e.id as channel_id,
e.channel_name as channel_name e.channel_name as channel_name,
ts.signal_strength_4g as signal_strength_4g,
ts.boot_time as boot_time,
ts.battery_capacity as battery_capacity,
ts.battery_voltage as battery_voltage,
ts.last_heartbeat as last_heartbeat
from from
((((terminals a left join `lines` b on a.line_id = b.id ) (((((terminals a left join `lines` b on a.line_id = b.id )
left join tower c on a.tower_id = c.id) left join tower c on a.tower_id = c.id)
left join terminal_channel_mapper d on a.id = d.term_id) left join terminal_channel_mapper d on a.id = d.term_id)
left join terminal_channels e on d.channel_id = e.id) left join terminal_channels e on d.channel_id = e.id)
left join terminal_status ts on ts.term_id = a.id)
WHERE a.status = 1 WHERE a.status = 1
order by a.create_time desc order by a.create_time desc
</select> </select>

@ -51,9 +51,9 @@ public class TermSetServiceImpl implements TermSetService {
* @return * @return
*/ */
@Override @Override
public ServiceBody<ResolutionModel> getResolutionList() { public ServiceBody<ResolutionModel> getResolutionList(Integer type) {
ResolutionModel model = new ResolutionModel(); ResolutionModel model = new ResolutionModel();
List<Resolution> beans = terminalResolutionDao.selectAllList(); List<Resolution> beans = terminalResolutionDao.selectAllList(type);
List<ResolutionModel.ResolutionBean> list = BeanUtil.copyToList(beans, ResolutionModel.ResolutionBean.class); List<ResolutionModel.ResolutionBean> list = BeanUtil.copyToList(beans, ResolutionModel.ResolutionBean.class);
model.setList(list); model.setList(list);
return Asserts.success(model); return Asserts.success(model);

@ -49,11 +49,13 @@ import java.util.List;
@Slf4j @Slf4j
public class TerminalVideoServiceImpl implements TerminalVideoService { public class TerminalVideoServiceImpl implements TerminalVideoService {
@Autowired
TerminalPhotoDao terminalPhotoDao;
@Override @Override
public ServiceBody<String> updateVideoParam(VideoParamsVo vo) { public ServiceBody<String> updateVideoParam(VideoParamsVo vo) {
String cmd = Constants.CMD+"videoparams --flag=1 --preset=255 --cmdid="+vo.getCmdId()+ " --channel=" + vo.getChannel()+ " --format=" + String cmd = Constants.CMD + "videoparams --flag=1 --preset=255 --cmdid=" + vo.getCmdId() + " --channel=" + vo.getChannel() + " --format=" +
vo.getFormat()+ " --time=" +vo.getTime(); vo.getFormat() + " --time=" + vo.getTime();
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
return Asserts.success("修改完成"); return Asserts.success("修改完成");
} }
@ -61,14 +63,21 @@ public class TerminalVideoServiceImpl implements TerminalVideoService {
@Override @Override
public ServiceBody<GetModel> videoParamGet(VideoGetVo vo) { public ServiceBody<GetModel> videoParamGet(VideoGetVo vo) {
GetModel model = new GetModel(); GetModel model = new GetModel();
String cmd = Constants.CMD+"videoparams --clientid=10 --flag=0 --cmdid="+vo.getCmdId()+ "\t"+"--reqid="+Constants.REQUEST_ID+"\t"+"--channel="+vo.getChannelId(); String cmd = Constants.CMD + "videoparams --clientid=10 --flag=0 --cmdid=" + vo.getCmdId() + "\t" + "--reqid=" + Constants.REQUEST_ID + "\t" + "--channel=" + vo.getChannelId();
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
model.setRequestId(Integer.parseInt( Constants.REQUEST_ID.toString())); model.setRequestId(Integer.parseInt(Constants.REQUEST_ID.toString()));
Constants.REQUEST_ID.addAndGet(1); Constants.REQUEST_ID.addAndGet(1);
return Asserts.success(model); return Asserts.success(model);
} }
@Override @Override
public ServiceBody<TerminalVideoParamsModel> selectVideoParam(Integer requestId) { public ServiceBody<TerminalVideoParamsModel> selectVideoParam(Integer requestId) {
return null; String result = terminalPhotoDao.getRequestResult(requestId);//待修改
TerminalVideoParamsModel model = new TerminalVideoParamsModel();
if (StringUtils.isNotBlank(result)) {
model = JSONObject.parseObject(result, TerminalVideoParamsModel.class);
model.setIsNew(true);
}
return Asserts.success(model);
} }
} }

@ -23,7 +23,8 @@ public interface TermSetService {
/** /**
* *
*
* @return * @return
*/ */
ServiceBody<ResolutionModel> getResolutionList(); ServiceBody<ResolutionModel> getResolutionList(Integer type);
} }

Loading…
Cancel
Save