#20230529 欣影管理平台拍照时间表代码

master
18616268358 2 years ago
parent 4464e01ebd
commit cf7ed7533e

@ -18,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
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 = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getResolutionList")
@Log(title = "获取分辨率代码", type = "查询")
public ResponseReult<ResolutionModel> getResolutionList() {
ServiceBody<ResolutionModel> serviceBody = termSetService.getResolutionList();
public ResponseReult<ResolutionModel> getResolutionList(@RequestParam("type") Integer type) {
ServiceBody<ResolutionModel> serviceBody = termSetService.getResolutionList(type);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {

@ -4,6 +4,8 @@ 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;
/**
@ -14,10 +16,19 @@ import java.io.Serializable;
public class TerminalVideoParamsModel implements Serializable {
@ApiModelProperty(value = "装置编号", example = "123456")
private Integer termId;
private String cmdId;
@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;
@Data
@ApiModel(value = "声光报警设置对象", description = "声光报警设置对象描述")
@ApiModel(value = "视频控制对象", description = "视频控制对象描述")
public class VideoGetVo {
@NotBlank(message = "监测装置ID")

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

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

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

@ -51,9 +51,9 @@ public class TermSetServiceImpl implements TermSetService {
* @return
*/
@Override
public ServiceBody<ResolutionModel> getResolutionList() {
public ServiceBody<ResolutionModel> getResolutionList(Integer type) {
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);
model.setList(list);
return Asserts.success(model);

@ -49,11 +49,13 @@ import java.util.List;
@Slf4j
public class TerminalVideoServiceImpl implements TerminalVideoService {
@Autowired
TerminalPhotoDao terminalPhotoDao;
@Override
public ServiceBody<String> 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 --preset=255 --cmdid=" + vo.getCmdId() + " --channel=" + vo.getChannel() + " --format=" +
vo.getFormat() + " --time=" + vo.getTime();
ProcessExecUtils.exec(cmd);
return Asserts.success("修改完成");
}
@ -61,14 +63,21 @@ public class TerminalVideoServiceImpl implements TerminalVideoService {
@Override
public ServiceBody<GetModel> videoParamGet(VideoGetVo vo) {
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);
model.setRequestId(Integer.parseInt( Constants.REQUEST_ID.toString()));
model.setRequestId(Integer.parseInt(Constants.REQUEST_ID.toString()));
Constants.REQUEST_ID.addAndGet(1);
return Asserts.success(model);
}
@Override
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
*/
ServiceBody<ResolutionModel> getResolutionList();
ServiceBody<ResolutionModel> getResolutionList(Integer type);
}

Loading…
Cancel
Save