diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalVideoParamsModel.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalVideoParamsModel.java index 694134a..be7d4b2 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalVideoParamsModel.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalVideoParamsModel.java @@ -4,8 +4,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; import java.io.Serializable; /** @@ -19,7 +17,7 @@ public class TerminalVideoParamsModel implements Serializable { private String cmdId; @ApiModelProperty(value = "通道编号", example = "123456") - private Integer channel; + private Integer channelId; @ApiModelProperty(value = "视频格式", example = "123456") private Integer format; diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/VideoParamsVo.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/VideoParamsVo.java index 4a20c10..906c5ba 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/VideoParamsVo.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/VideoParamsVo.java @@ -16,7 +16,7 @@ public class VideoParamsVo { @NotNull(message = "通道编号不能缺少") @ApiModelProperty(value = "通道编号", example = "123456") - private Integer channel; + private Integer channelId; @NotNull(message = "视频格式不能缺少") @ApiModelProperty(value = "视频格式", example = "123456") @@ -26,6 +26,10 @@ public class VideoParamsVo { @ApiModelProperty(value = "录制时长", example = "123456") private Integer time; + @NotNull(message = "预制位") + @ApiModelProperty(value = "预制位", example = "123456") + private Integer preset; + } diff --git a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalVideoServiceImpl.java b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalVideoServiceImpl.java index 96fe051..8634e37 100644 --- a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalVideoServiceImpl.java +++ b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalVideoServiceImpl.java @@ -1,47 +1,19 @@ package com.shxy.xymanager_service.impl; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.date.DateField; -import cn.hutool.core.date.DateTime; -import cn.hutool.core.date.DateUtil; -import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.github.pagehelper.PageInfo; -import com.google.common.collect.Lists; import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.constant.Constants; -import com.shxy.xymanager_common.dto.*; -import com.shxy.xymanager_common.entity.Lines; -import com.shxy.xymanager_common.entity.TerminalChannels; -import com.shxy.xymanager_common.entity.TerminalPhoto; -import com.shxy.xymanager_common.entity.Terminals; -import com.shxy.xymanager_common.enums.CommonStatus; import com.shxy.xymanager_common.exception.Asserts; import com.shxy.xymanager_common.model.*; -import com.shxy.xymanager_common.page.PageUtils; -import com.shxy.xymanager_common.util.MyDateUtils; import com.shxy.xymanager_common.util.ProcessExecUtils; import com.shxy.xymanager_common.util.StringUtils; import com.shxy.xymanager_common.vo.*; -import com.shxy.xymanager_dao.dao.LinesDao; -import com.shxy.xymanager_dao.dao.TerminalChannelsDao; import com.shxy.xymanager_dao.dao.TerminalPhotoDao; -import com.shxy.xymanager_dao.dao.TerminalsDao; -import com.shxy.xymanager_service.service.TerminalPhotoService; -import com.shxy.xymanager_service.service.TerminalScheduleRuleService; import com.shxy.xymanager_service.service.TerminalVideoService; import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - /** * 视频控制实现层 */ @@ -54,8 +26,8 @@ public class TerminalVideoServiceImpl implements TerminalVideoService { @Override public ServiceBody updateVideoParam(VideoParamsVo vo) { - String cmd = Constants.CMD + "videoparams --flag=1 --preset=255 --cmdid=" + vo.getCmdId() + " --channel=" + vo.getChannel() + " --format=" + - vo.getFormat() + " --time=" + vo.getTime(); + String cmd = Constants.CMD + "videoparams --flag=1 --cmdid=" + vo.getCmdId() + " --channel=" + vo.getChannelId() + " --format=" + + vo.getFormat() + " --time=" + vo.getTime()+" --preset="+vo.getPreset(); ProcessExecUtils.exec(cmd); return Asserts.success("修改完成"); } @@ -63,7 +35,7 @@ public class TerminalVideoServiceImpl implements TerminalVideoService { @Override public ServiceBody videoParamGet(VideoGetVo vo) { GetModel model = new GetModel(); - String cmd = Constants.CMD + "videoparams --clientid=10 --flag=0 --cmdid=" + vo.getCmdId() + "\t" + "--reqid=" + Constants.REQUEST_ID; + String cmd = Constants.CMD + "videoparams --clientid=10 --flag=0 --cmdid=" + vo.getCmdId()+ " --reqid=" + Constants.REQUEST_ID+ " --channel=" + vo.getChannelId(); ProcessExecUtils.exec(cmd); model.setRequestId(Integer.parseInt(Constants.REQUEST_ID.toString())); Constants.REQUEST_ID.addAndGet(1);