#20230510 欣影管理平台装置信息查询代码
parent
674268589b
commit
469f2a63d7
@ -0,0 +1,74 @@
|
||||
package com.shxy.xymanager_admin.controller;
|
||||
|
||||
import com.shxy.xymanager_common.annotation.Log;
|
||||
import com.shxy.xymanager_common.base.BaseController;
|
||||
import com.shxy.xymanager_common.base.ResponseReult;
|
||||
import com.shxy.xymanager_common.bean.ServiceBody;
|
||||
import com.shxy.xymanager_common.bean.ServiceStatus;
|
||||
import com.shxy.xymanager_common.model.GetModel;
|
||||
import com.shxy.xymanager_common.model.TerminalVideoParamsModel;
|
||||
import com.shxy.xymanager_common.vo.PhotoParamsVo;
|
||||
import com.shxy.xymanager_common.vo.VideoParamsVo;
|
||||
import com.shxy.xymanager_service.service.TerminalVideoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import io.swagger.annotations.ApiResponses;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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;
|
||||
|
||||
|
||||
@Api(value = "视频接口", tags = "视频接口相关")
|
||||
@RestController
|
||||
@Slf4j
|
||||
public class TerminalVideoController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
TerminalVideoService terminalVideoService;
|
||||
|
||||
@ApiOperation(value = "视频参数设置", notes = "视频参数设置接口", httpMethod = "POST")
|
||||
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
|
||||
@RequestMapping("/updateVideoParam")
|
||||
@Log(title = "视频参数设置", type = "查询")
|
||||
public ResponseReult<String> updateVideoParam(@RequestBody @Validated VideoParamsVo vo) {
|
||||
ServiceBody<String> serviceBody = terminalVideoService.updateVideoParam(vo);
|
||||
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
|
||||
return ResponseReult.success(serviceBody.getData());
|
||||
} else {
|
||||
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "视频参数查询触发", notes = "视频参数查询触发接口", httpMethod = "POST")
|
||||
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
|
||||
@RequestMapping("/videoParamGet")
|
||||
@Log(title = "视频参数查询触发", type = "查询")
|
||||
public ResponseReult<GetModel> videoParamGet(@RequestBody @Validated VideoParamsVo vo) {
|
||||
ServiceBody<GetModel> serviceBody = terminalVideoService.videoParamGet(vo);
|
||||
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
|
||||
return ResponseReult.success(serviceBody.getData());
|
||||
} else {
|
||||
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "视频参数查询", notes = "视频参数查询接口", httpMethod = "POST")
|
||||
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
|
||||
@RequestMapping("/selectVideoParam")
|
||||
@Log(title = "视频参数查询", type = "查询")
|
||||
public ResponseReult<TerminalVideoParamsModel> selectVideoParam(@RequestParam("requestId") Integer requestId) {
|
||||
ServiceBody<TerminalVideoParamsModel> serviceBody = terminalVideoService.selectVideoParam(requestId);
|
||||
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
|
||||
return ResponseReult.success(serviceBody.getData());
|
||||
} else {
|
||||
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.shxy.xymanager_common.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 视频参数
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "视频参数对象", description = "视频参数对象信息")
|
||||
public class TerminalVideoParamsModel implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "装置编号", example = "123456")
|
||||
private Integer termId;
|
||||
|
||||
@ApiModelProperty(value = "通道编号", example = "123456")
|
||||
private Short channel;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.shxy.xymanager_common.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "视频控制参数对象", description = "视频控制参数对象")
|
||||
public class VideoParamsVo {
|
||||
@ApiModelProperty(value = "装置编号", example = "123456")
|
||||
private String cmdId;
|
||||
|
||||
@ApiModelProperty(value = "通道编号", example = "123456")
|
||||
private Integer channel;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "不知道是啥", example = "123456")
|
||||
private Integer format;
|
||||
|
||||
@ApiModelProperty(value = "不知道是啥", example = "123456")
|
||||
private Integer time;
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 视频控制实现层
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class TerminalVideoServiceImpl implements TerminalVideoService {
|
||||
|
||||
|
||||
@Override
|
||||
public ServiceBody<String> updateVideoParam(VideoParamsVo vo) {
|
||||
String cmd = Constants.CMD+"videoparams --flag=1 --preset=255 --cmdid="+vo.getCmdId()+ "\t"+ "--channel=" + vo.getChannel()+ "\t"+ "--format=" +
|
||||
vo.getFormat()+ "\t"+ "--time=" +vo.getTime();
|
||||
ProcessExecUtils.exec(cmd);
|
||||
return Asserts.success("修改完成");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServiceBody<GetModel> videoParamGet(VideoParamsVo vo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServiceBody<TerminalVideoParamsModel> selectVideoParam(Integer requestId) {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.shxy.xymanager_service.service;
|
||||
|
||||
import com.shxy.xymanager_common.bean.ServiceBody;
|
||||
import com.shxy.xymanager_common.model.*;
|
||||
import com.shxy.xymanager_common.vo.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 视频控制接口
|
||||
*
|
||||
* @author CY
|
||||
*/
|
||||
public interface TerminalVideoService {
|
||||
/**
|
||||
* 获取视频参数
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ServiceBody<String> updateVideoParam(VideoParamsVo vo);
|
||||
|
||||
ServiceBody<GetModel> videoParamGet(VideoParamsVo vo);
|
||||
|
||||
ServiceBody<TerminalVideoParamsModel> selectVideoParam(Integer requestId);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue