修复视频缩略图不显示的bug

修改主动拍照流程
hunan
liuguijing 2 years ago
parent d31e24ecce
commit 8a1a9b6432

@ -17,12 +17,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
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.*;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
@Api(value = "图片接口", tags = "图片接口相关") @Api(value = "图片接口", tags = "图片接口相关")
@ -33,6 +28,7 @@ public class TerminalPhotoController extends BaseController {
@Autowired @Autowired
TerminalPhotoService terminalPhotoService; TerminalPhotoService terminalPhotoService;
@ApiOperation(value = "获取图片列表", notes = "获取图片列表接口", httpMethod = "POST") @ApiOperation(value = "获取图片列表", notes = "获取图片列表接口", httpMethod = "POST")
@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("/getTerminalPhotoList") @RequestMapping("/getTerminalPhotoList")
@ -49,10 +45,36 @@ public class TerminalPhotoController extends BaseController {
@ApiOperation(value = "主动拍照", notes = "主动拍照接口", httpMethod = "POST") @ApiOperation(value = "主动拍照", notes = "主动拍照接口", httpMethod = "POST")
@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("/getLatestPhoto") @RequestMapping("/takePic")
@Log(title = "主动拍照", type = "查询") @Log(title = "主动拍照", type = "查询")
public ResponseReult<Date> getLatestPhoto(@RequestBody @Validated TerminalPhotoVo vo) { public ResponseReult<TakePIcModel> takePic(@Validated TerminalPhotoVo vo) {
ServiceBody<Date> serviceBody = terminalPhotoService.getLatestPhoto(vo); ServiceBody<TakePIcModel> serviceBody = terminalPhotoService.takePic(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("/getTakePicStatus")
@Log(title = "最新图片查询", type = "查询")
public ResponseReult<Integer> getTakePicStatus(@Validated RequestIdVo vo) {
ServiceBody<Integer> serviceBody = terminalPhotoService.getTakePicStatus(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("/getTakePicPhotoStatus")
@Log(title = "主动拍照下照片状态查询", type = "查询")
public ResponseReult<Boolean> getTakePicPhotoStatus( @Validated ReturnedPhotoVo vo) {
ServiceBody<Boolean> serviceBody = terminalPhotoService.getTakePicPhotoStatus(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) { if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData()); return ResponseReult.success(serviceBody.getData());
} else { } else {
@ -100,18 +122,6 @@ public class TerminalPhotoController extends BaseController {
} }
} }
@ApiOperation(value = "最新图片查询", notes = "图片查询接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getReturnedPhoto")
@Log(title = "最新图片查询", type = "查询")
public ResponseReult<Boolean> getReturnedPhoto(@RequestBody @Validated ReturnedPhotoVo vo) {
ServiceBody<Boolean> serviceBody = terminalPhotoService.getReturnedPhoto(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
@ApiOperation(value = "图片轮询", notes = "图片轮询接口", httpMethod = "POST") @ApiOperation(value = "图片轮询", notes = "图片轮询接口", httpMethod = "POST")
@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 = "请求路径没有或页面跳转路径不对")})

@ -3,6 +3,7 @@ package com.shxy.xymanager_common.entity;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigInteger;
@Data @Data
public class RequestResults implements Serializable { public class RequestResults implements Serializable {
@ -22,9 +23,9 @@ public class RequestResults implements Serializable {
private Integer scheduleStatus; private Integer scheduleStatus;
private Long requestTime; private BigInteger requestTime;
private Long createTime; private BigInteger createTime;
private String data; private String data;

@ -0,0 +1,29 @@
package com.shxy.xymanager_common.enums;
/**
*
* "0---未知 1---成功 2---失败"
*
* @author
*/
public enum TakePicStatus {
UNKONW("UNKONW", 0), SUCCESS("SUCCESS", 1), FAIL("FAIL", 2);
private String name;
private Integer value;
TakePicStatus(String name, Integer value) {
this.name = name;
this.value = value;
}
@Override
public String toString() {
return this.value + "_" + this.name;
}
public Integer value() {
return this.value;
}
}

@ -0,0 +1,24 @@
package com.shxy.xymanager_common.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
*
*/
@Data
@ApiModel(value = "主动拍照的返回对象", description = "主动拍照的返回对象")
public class TakePIcModel implements Serializable {
@ApiModelProperty(value = "请求编号", example = "123456")
private Integer requestId;
@ApiModelProperty(value = "拍照时间", example = "AAAA")
private Date taketime;
}

@ -1,6 +1,9 @@
package com.shxy.xymanager_common.util; package com.shxy.xymanager_common.util;
import com.shxy.xymanager_common.constant.Constants; import com.shxy.xymanager_common.constant.Constants;
import com.shxy.xymanager_common.dto.ScheduleDetailsDto;
import java.util.List;
/** /**
* Cma * Cma
@ -9,14 +12,205 @@ public class CmaUtil {
/** /**
* *
*
* @param cmdid * @param cmdid
* @param channel * @param channel
* @param type * @param type
* @return * @return
*/ */
public static String takePic(String cmdid, Integer channel, Integer type) { public static String takePic(String cmdid, Integer channel, Integer preset, Integer type, Integer requestId) {
String cmd = Constants.CMD + "capture --cmdid=" + cmdid + " --channel=" + channel + " --preset=255 --type=" + type; String cmd = Constants.CMD + "capture --cmdid=" + cmdid + " --channel=" + channel + " --preset=" + preset + " --type=" + type + " --clientid=10" + " --reqid=" + requestId;
return cmd;
}
/**
*
*
* @param cmdid
* @param ctrl
* @return
*/
public static String alarmMark(String cmdid, Integer ctrl) {
String cmd = Constants.CMD + "voice --cmdid=" + cmdid + " --ctrl=" + ctrl;
return cmd;
}
/**
* GPS
*
* @param cmdid
* @param status
* @return
*/
public static String setTermGPS(String cmdid, Integer status) {
String cmd = Constants.CMD + "gpsctrl --flag=1 --cmdid=" + cmdid + " --ctrl=" + status;
return cmd;
}
/**
* GPS
*
* @param cmdid
* @return
*/
public static String getReturnedGPS(String cmdid) {
String cmd = Constants.CMD + "gpsinfo --flag=0 --cmdid=" + cmdid + " --clientid=10";
return cmd;
}
/**
*
*
* @param cmdid
* @return
*/
public static String getPhotoQueryParam(String cmdid, Integer requestId, Integer channelid) {
String cmd = Constants.CMD + "imgparams --cmdid=" + cmdid + " --clientid=10 --reqid=" + requestId + " --flag=0 --rf=7 --channel=" + channelid;
return cmd;
}
/**
*
*
* @param cmdid
* @return
*/
public static String addOrUpdatePhotoParams(String cmdid, Integer color, Integer resolution, Integer luminance, Integer contrast, Integer saturation, Integer channel) {
String cmd = Constants.CMD + "imgparams --flag=1 --cmdid=" + cmdid + " --rf=7 --color=" + color + " --resolution=" + resolution
+ " --luminance=" + luminance + " -contrast=" + contrast + " --saturation=" + saturation + " --channel=" + channel;
return cmd;
}
/**
*
*
* @param cmdid
* @return
*/
public static String selectPhotoTimeGet(String cmdid, Integer requestId, Integer channel) {
String cmd = Constants.CMD + "schedule --cmdid=" + cmdid + " --reqid=" + requestId + " --clientid=10 --flag=0 --rf=7 --channel=" + channel;
return cmd;
}
/**
*
*
* @return
*/
public static String relateSchelduleRule(List<ScheduleDetailsDto> dtoList, String cmdid, Integer requestId, Integer channel, String timestr) {
String cmd = Constants.CMD + "schedule --group=" + dtoList.size() + " --flag=1 --clientid=10 --cmdid="
+ cmdid + " --reqid=" + requestId + " --channel=" + channel + " " +
timestr;
return cmd;
}
/**
* CMA
*
* @return
*/
public static String cmaSchelduleDetials(String cmdid, Integer requestId, Integer channel) {
String cmd = Constants.CMD + "schedule --cmdid=" + cmdid + " --reqid=" + requestId + " --clientid=10 --flag=0 --channel=" + channel;
return cmd;
}
/**
* CMA
*
* @return
*/
public static String resetTerminal(String cmdid) {
String cmd = Constants.CMD + "reset --cmdid=" + cmdid + " --mode=0";
return cmd;
}
/**
*
*
* @return
*/
public static String getTerminalStatus(String cmdid) {
String cmd = Constants.CMD + "runningstatus --flag=0 --cmdid=" + cmdid;
return cmd; return cmd;
} }
/**
*
*
* @return
*/
public static String updateTerminalId(String cmdid, String newcmdid) {
String cmd = Constants.CMD + "termid --flag=1 --cmdid=" + cmdid + " --newcmdid=" + newcmdid;
return cmd;
}
/**
*
*
* @return
*/
public static String terminalIdGet(String cmdid, Integer requestId) {
String cmd = Constants.CMD + "termid --clientid=10 --flag=0 --cmdid=" + cmdid + " --reqid=" + requestId;
return cmd;
}
/**
*
*
* @return
*/
public static String updateVideoParam(String cmdid, Integer channel, Integer videoformat, Integer videotime, Integer preset) {
String cmd = Constants.CMD + "videoparams --flag=1 --cmdid=" + cmdid + " --channel=" + channel + " --format=" +
videoformat + " --time=" + videotime + " --preset=" + preset;
return cmd;
}
/**
*
*
* @return
*/
public static String videoParamGet(String cmdid, Integer requestId, Integer channel) {
String cmd = Constants.CMD + "videoparams --clientid=10 --flag=0 --cmdid=" + cmdid + " --reqid=" + requestId + " --channel=" + channel;
return cmd;
}
/**
*
*
* @param cmdid
* @param requestId
* @return
*/
public static String getSystemConfig(String cmdid, Integer requestId) {
String cmd = Constants.CMD + "sampling --clientid=10 --flag=0 --cmdid=" + cmdid + " --reqid=" + requestId;
return cmd;
}
/**
*
*
* @param cmdid
* @param heartbeat
* @return
*/
public static String updateSystemConfig(String cmdid, Integer heartbeat) {
String cmd = Constants.CMD + "sampling --flag =1 --cmdid=" + cmdid + " --heartbeat=" + heartbeat;
return cmd;
}
/**
*
*
* @param cmdid
* @param requestId
* @return
*/
public static String upperComputerGet(String cmdid, Integer requestId) {
String cmd = Constants.CMD + "cma --clientid=10 --flag=0 --cmdid=" + cmdid + " --reqid=" + requestId;
return cmd;
}
} }

@ -25,7 +25,7 @@ import java.util.Map;
/** /**
* *
* *
* @author cy * @author jingjing
*/ */
@Slf4j @Slf4j
@Component @Component
@ -94,7 +94,7 @@ public class TerminalUtils {
* *
*/ */
public static String getThumbPhotoPath(Integer mediaType, String requestIp, String path) { public static String getThumbPhotoPath(Integer mediaType, String requestIp, String path) {
if (mediaType.intValue() == 0) { if (mediaType.intValue() == 1) {
if (StringUtils.isNotBlank(path)) { if (StringUtils.isNotBlank(path)) {
return requestIp + videoaddress + path; return requestIp + videoaddress + path;
} else { } else {

@ -15,5 +15,5 @@ public class ReturnedPhotoParamsGetVo {
@ApiModelProperty(value = "通道ID", required = true, example = "A0001") @ApiModelProperty(value = "通道ID", required = true, example = "A0001")
private Short channelId; private Integer channelId;
} }

@ -1,12 +1,16 @@
package com.shxy.xymanager_common.vo; package com.shxy.xymanager_common.vo;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.math.BigInteger;
import java.time.LocalDateTime;
@Data @Data
@ApiModel(value = "返回图片查询", description = "返回图片查询") @ApiModel(value = "返回图片查询", description = "返回图片查询")
@ -15,7 +19,6 @@ public class ReturnedPhotoVo {
@ApiModelProperty(value = "装置id", required = true, example = "A0001") @ApiModelProperty(value = "装置id", required = true, example = "A0001")
private Integer termId; private Integer termId;
@ApiModelProperty(value = "手动拍照时间", required = true, example = "A0001") @ApiModelProperty(value = "手动拍照时间", required = true, example = "A0001")
private DateTime photoTime; private BigInteger photoTime;
} }

@ -17,7 +17,7 @@ public class SystemConfigVo {
@NotNull(message = "装置ID") @NotNull(message = "装置ID")
@ApiModelProperty(value = "装置ID", example = "123455") @ApiModelProperty(value = "装置ID", example = "123455")
private Integer cmdId; private String cmdId;
@NotNull(message = "参数值") @NotNull(message = "参数值")
@ApiModelProperty(value = "参数值", example = "123455") @ApiModelProperty(value = "参数值", example = "123455")

@ -12,7 +12,7 @@ public class TerminalPhotoTimeGetVo {
@NotNull(message = "通道号") @NotNull(message = "通道号")
@ApiModelProperty(value = "通道号", example = "123455") @ApiModelProperty(value = "通道号", example = "123455")
private Short channel; private Integer channel;
@NotNull(message = "检测装置ID不能缺少") @NotNull(message = "检测装置ID不能缺少")
@ApiModelProperty(value = "检测装置ID", example = "123455") @ApiModelProperty(value = "检测装置ID", example = "123455")

@ -9,9 +9,6 @@ import javax.validation.constraints.NotNull;
@Data @Data
@ApiModel(value = "最近图片请求参数", description = "最近图片请求参数") @ApiModel(value = "最近图片请求参数", description = "最近图片请求参数")
public class TerminalPhotoVo { public class TerminalPhotoVo {
// @NotNull(message = "装置列表不能缺少")
// @ApiModelProperty(value = "装置通道编号列表", example = "123455")
// private String cmdid;
@NotNull(message = "装置编号") @NotNull(message = "装置编号")
@ApiModelProperty(value = "装置编号", example = "123455") @ApiModelProperty(value = "装置编号", example = "123455")

@ -28,7 +28,6 @@ public class UpdateTowerVo {
private Integer order; private Integer order;
@ApiModelProperty(value = "地址", example = "地址地址") @ApiModelProperty(value = "地址", example = "地址地址")
@NotBlank(message = "地址地址")
private String address; private String address;

@ -17,7 +17,7 @@ public class VideoGetVo {
@NotNull(message = "通道编号") @NotNull(message = "通道编号")
@ApiModelProperty(value = "通道编号", example = "01") @ApiModelProperty(value = "通道编号", example = "01")
private short channelId; private Integer channelId;
} }

@ -20,7 +20,7 @@ public class VoiceCtrlVo {
@NotNull(message = "声光报警开关 0:关闭 1:开启") @NotNull(message = "声光报警开关 0:关闭 1:开启")
@ApiModelProperty(value = "声光报警开关", example = "0:关闭 1:开启") @ApiModelProperty(value = "声光报警开关", example = "0:关闭 1:开启")
private short ctrl; private Integer ctrl;
} }

@ -13,7 +13,7 @@ public interface DyLevelDao {
List<DyAndLineAndTowerAndTermDto> selectDyAndLineAndTowerAnTermList(@Param("dyid") Integer dyid, @Param("lineid") Integer lineid, @Param("towerid") Integer towerid, @Param("termid") Integer termid, @Param("search") String search, @Param("status") Integer status); List<DyAndLineAndTowerAndTermDto> selectDyAndLineAndTowerAnTermList(@Param("dyid") Integer dyid, @Param("lineid") Integer lineid, @Param("towerid") Integer towerid, @Param("termid") Integer termid, @Param("search") String search, @Param("status") Integer status);
List<DyLineAndTowertDto> selectDyAndLineAndTowerList(@Param("dyid") Integer dyid, @Param("lineid") Integer lineid, @Param("towerid") Integer towerid); List<DyLineAndTowertDto> selectDyAndLineAndTowerList(@Param("dyid") Integer dyid, @Param("lineid") Integer lineid, @Param("towerid") Integer towerid,@Param("status") Integer status);
int deleteByPrimaryKey(Integer id); int deleteByPrimaryKey(Integer id);

@ -13,6 +13,7 @@ import java.util.List;
public interface TerminalPhotoDao { public interface TerminalPhotoDao {
List<TerminalPhoto> selectPhotoList(@Param("terminalid") Integer terminalid, @Param("channelid") Integer channelid, @Param("starttime") BigInteger starttime, @Param("endtime") BigInteger endtime); List<TerminalPhoto> selectPhotoList(@Param("terminalid") Integer terminalid, @Param("channelid") Integer channelid, @Param("starttime") BigInteger starttime, @Param("endtime") BigInteger endtime);
List<TerminalPhoto> selectPhotoListByOrginIdAndTermList(@Param("list") List<TerminalImgAlarmsDto> list); List<TerminalPhoto> selectPhotoListByOrginIdAndTermList(@Param("list") List<TerminalImgAlarmsDto> list);

@ -158,7 +158,7 @@
from ((dy_level a left join `lines` b on a.id = b.dy_level_id ) from ((dy_level a left join `lines` b on a.id = b.dy_level_id )
left join towers c on c.line_id = b.id ) left join towers c on c.line_id = b.id )
<where> <where>
true a.status = #{status} and b.status = #{status} and c.status = #{status}
<if test="dyid != null"> <if test="dyid != null">
and a.id = #{dyid} and a.id = #{dyid}
</if> </if>

@ -108,6 +108,7 @@
</if> </if>
order by photo_time desc order by photo_time desc
</select> </select>
<select id="selectPhotoListByOrginIdAndTermList" resultMap="BaseResultMap"> <select id="selectPhotoListByOrginIdAndTermList" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>

@ -124,9 +124,9 @@ public class DyLevelServiceImpl implements DyLevelService {
int pagesize = vo.getPagesize(); int pagesize = vo.getPagesize();
List<DyLineAndTowertDto> dtos = new ArrayList<>(); List<DyLineAndTowertDto> dtos = new ArrayList<>();
if (type == 1) { if (type == 1) {
dtos = dyLevelDao.selectDyAndLineAndTowerList(id, null, null); dtos = dyLevelDao.selectDyAndLineAndTowerList(id, null, null, CommonStatus.EFFECTIVE.value());
} else { } else {
dtos = dyLevelDao.selectDyAndLineAndTowerList(null, id, null); dtos = dyLevelDao.selectDyAndLineAndTowerList(null, id, null, CommonStatus.EFFECTIVE.value());
} }
if (CollectionUtil.isEmpty(dtos)) { if (CollectionUtil.isEmpty(dtos)) {
model.setList(new ArrayList<>()); model.setList(new ArrayList<>());

@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import com.shxy.xymanager_common.constant.Constants;
import com.shxy.xymanager_common.constant.UuidUtils; import com.shxy.xymanager_common.constant.UuidUtils;
import com.shxy.xymanager_common.dto.TerminalsWithHeart; import com.shxy.xymanager_common.dto.TerminalsWithHeart;
import com.shxy.xymanager_common.entity.SysUser; import com.shxy.xymanager_common.entity.SysUser;
@ -157,10 +158,11 @@ public class OpenServiceImpl implements OpenService {
jsonObject.set("errmsg", "invalid protocol"); jsonObject.set("errmsg", "invalid protocol");
return jsonObject; return jsonObject;
} }
int requestId = Constants.REQUEST_ID.addAndGet(1);
String cmd1 = CmaUtil.takePic(vo.getDeviceID(), 1, operateType); String cmd1 = CmaUtil.takePic(vo.getDeviceID(), 1,255, operateType, requestId);
ProcessExecUtils.exec(cmd1); ProcessExecUtils.exec(cmd1);
String cmd2 = CmaUtil.takePic(vo.getDeviceID(), 2, operateType); int requestId2 = Constants.REQUEST_ID.addAndGet(1);
String cmd2 = CmaUtil.takePic(vo.getDeviceID(), 2,255, operateType,requestId2);
ProcessExecUtils.exec(cmd2); ProcessExecUtils.exec(cmd2);
jsonObject.set("errcode", 0); jsonObject.set("errcode", 0);
jsonObject.set("errmsg", "OK"); jsonObject.set("errmsg", "OK");

@ -7,6 +7,7 @@ import com.shxy.xymanager_common.dto.UpperComputerInfoDto;
import com.shxy.xymanager_common.entity.TerminalParams; import com.shxy.xymanager_common.entity.TerminalParams;
import com.shxy.xymanager_common.exception.Asserts; import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.*; import com.shxy.xymanager_common.model.*;
import com.shxy.xymanager_common.util.CmaUtil;
import com.shxy.xymanager_common.util.xinyin.ProcessExecUtils; import com.shxy.xymanager_common.util.xinyin.ProcessExecUtils;
import com.shxy.xymanager_common.util.StringUtils; import com.shxy.xymanager_common.util.StringUtils;
import com.shxy.xymanager_common.vo.SystemConfigReqVo; import com.shxy.xymanager_common.vo.SystemConfigReqVo;
@ -44,7 +45,7 @@ public class SystemConfigServiceImpl implements SystemConfigService {
model.setGlobalTime(Integer.parseInt(globalTime));*/ model.setGlobalTime(Integer.parseInt(globalTime));*/
int requestId = Constants.REQUEST_ID.addAndGet(1); int requestId = Constants.REQUEST_ID.addAndGet(1);
GetModel model = new GetModel(); GetModel model = new GetModel();
String cmd = Constants.CMD+"sampling --clientid=10 --flag=0 --cmdid="+cmdId+ " --reqid="+requestId; String cmd = CmaUtil.getSystemConfig(cmdId, requestId);
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
model.setRequestId(requestId); model.setRequestId(requestId);
return Asserts.success(model); return Asserts.success(model);
@ -57,7 +58,7 @@ public class SystemConfigServiceImpl implements SystemConfigService {
param.setHeartbeatTime(vo.getHeartBeatTime()); param.setHeartbeatTime(vo.getHeartBeatTime());
systemConfigDao.updateSystemConfig(param); systemConfigDao.updateSystemConfig(param);
String cmd =Constants.CMD+"sampling --flag =1 --cmdid="+vo.getCmdId()+ " --heartbeat=" + vo.getHeartBeatTime(); String cmd = CmaUtil.updateSystemConfig(vo.getCmdId(), vo.getHeartBeatTime());
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
return Asserts.success("修改成功"); return Asserts.success("修改成功");
} }
@ -81,7 +82,7 @@ public class SystemConfigServiceImpl implements SystemConfigService {
public ServiceBody<GetModel> upperComputerGet(String cmdId) { public ServiceBody<GetModel> upperComputerGet(String cmdId) {
GetModel model = new GetModel(); GetModel model = new GetModel();
int requestId = Constants.REQUEST_ID.addAndGet(1); int requestId = Constants.REQUEST_ID.addAndGet(1);
String cmd = Constants.CMD+"cma --clientid=10 --flag=0 --cmdid="+cmdId+ " --reqid="+requestId; String cmd = CmaUtil.upperComputerGet(cmdId, requestId);
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
model.setRequestId(requestId); model.setRequestId(requestId);
return Asserts.success(model); return Asserts.success(model);

@ -6,6 +6,7 @@ import com.shxy.xymanager_common.constant.Constants;
import com.shxy.xymanager_common.entity.Resolution; import com.shxy.xymanager_common.entity.Resolution;
import com.shxy.xymanager_common.exception.Asserts; import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.ResolutionModel; import com.shxy.xymanager_common.model.ResolutionModel;
import com.shxy.xymanager_common.util.CmaUtil;
import com.shxy.xymanager_common.util.xinyin.ProcessExecUtils; import com.shxy.xymanager_common.util.xinyin.ProcessExecUtils;
import com.shxy.xymanager_common.vo.TerminalIdVo; import com.shxy.xymanager_common.vo.TerminalIdVo;
import com.shxy.xymanager_common.vo.VoiceCtrlVo; import com.shxy.xymanager_common.vo.VoiceCtrlVo;
@ -32,21 +33,15 @@ public class TermSetServiceImpl implements TermSetService {
@Override @Override
public ServiceBody<String> alarmMark(VoiceCtrlVo vo) { public ServiceBody<String> alarmMark(VoiceCtrlVo vo) {
String cmd =Constants.CMD+"voice --cmdid="+vo.getCmdId()+ " --ctrl="+ vo.getCtrl(); String cmd = CmaUtil.alarmMark(vo.getCmdId(), vo.getCtrl());
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
return Asserts.success("设置成功"); return Asserts.success("设置成功");
} }
@Override
public ServiceBody<Integer> selectPhotoTimeGet(TerminalIdVo vo) {
int requestId = Constants.REQUEST_ID.addAndGet(1);
String cmd = Constants.CMD+"alarmMark --cmdid="+vo.getCmdId()+ " --reqid="+requestId+ " --clientid=10 --flag=1 --rf=7";
ProcessExecUtils.exec(cmd);
return Asserts.success(requestId);
}
/** /**
* *
*
* @return * @return
*/ */
@Override @Override

@ -8,6 +8,7 @@ import com.shxy.xymanager_common.entity.TerminalPositions;
import com.shxy.xymanager_common.enums.CommonStatus; import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.exception.Asserts; import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.*; import com.shxy.xymanager_common.model.*;
import com.shxy.xymanager_common.util.CmaUtil;
import com.shxy.xymanager_common.util.MyDateUtils; import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_common.util.xinyin.ProcessExecUtils; import com.shxy.xymanager_common.util.xinyin.ProcessExecUtils;
import com.shxy.xymanager_common.vo.*; import com.shxy.xymanager_common.vo.*;
@ -46,7 +47,6 @@ public class TerminalGpsServiceImpl implements TerminalGpsService {
*/ */
@Override @Override
public ServiceBody<String> setTermGPS(TerminalIdAndGpsVo vo) { public ServiceBody<String> setTermGPS(TerminalIdAndGpsVo vo) {
// Cma cma = new Cma("47.96.238.157", 6891);
Integer status; Integer status;
Integer gpsstatus = vo.getGpsstatus(); Integer gpsstatus = vo.getGpsstatus();
if (gpsstatus == 0) { if (gpsstatus == 0) {
@ -54,7 +54,7 @@ public class TerminalGpsServiceImpl implements TerminalGpsService {
} else { } else {
status = CommonStatus.DELETE.value(); status = CommonStatus.DELETE.value();
} }
String cmd = Constants.CMD + "gpsctrl --flag=1 --cmdid=" + vo.getCmdId() + "\t" + "--ctrl=" + status; String cmd = CmaUtil.setTermGPS(vo.getCmdId(), status);
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
return Asserts.success("操作成功"); return Asserts.success("操作成功");
} }
@ -96,7 +96,7 @@ public class TerminalGpsServiceImpl implements TerminalGpsService {
@Override @Override
public ServiceBody<DateTime> getReturnedGPS(TerminalGpsVo vo) { public ServiceBody<DateTime> getReturnedGPS(TerminalGpsVo vo) {
String cmd = Constants.CMD + "gpsinfo --flag=0 --cmdid=" + vo.getCmdId() + " --clientid=10"; String cmd = CmaUtil.getReturnedGPS(vo.getCmdId());
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
DateTime now = DateTime.now(); DateTime now = DateTime.now();
return Asserts.success(now); return Asserts.success(now);

@ -15,6 +15,7 @@ import com.shxy.xymanager_common.constant.Constants;
import com.shxy.xymanager_common.dto.*; import com.shxy.xymanager_common.dto.*;
import com.shxy.xymanager_common.entity.*; import com.shxy.xymanager_common.entity.*;
import com.shxy.xymanager_common.enums.CommonStatus; import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.enums.TakePicStatus;
import com.shxy.xymanager_common.exception.Asserts; import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.*; import com.shxy.xymanager_common.model.*;
import com.shxy.xymanager_common.page.PageUtils; import com.shxy.xymanager_common.page.PageUtils;
@ -23,6 +24,7 @@ import com.shxy.xymanager_common.util.xinyin.ProcessExecUtils;
import com.shxy.xymanager_common.util.xinyin.TerminalUtils; import com.shxy.xymanager_common.util.xinyin.TerminalUtils;
import com.shxy.xymanager_common.vo.*; import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.*; import com.shxy.xymanager_dao.dao.*;
import com.shxy.xymanager_service.interaction.Cma;
import com.shxy.xymanager_service.service.CacheService; import com.shxy.xymanager_service.service.CacheService;
import com.shxy.xymanager_service.service.TerminalPhotoService; import com.shxy.xymanager_service.service.TerminalPhotoService;
import com.shxy.xymanager_service.service.TerminalScheduleRuleService; import com.shxy.xymanager_service.service.TerminalScheduleRuleService;
@ -33,6 +35,7 @@ import org.springframework.stereotype.Service;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.math.BigInteger; import java.math.BigInteger;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
/** /**
@ -326,9 +329,14 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
} }
@Override @Override
public ServiceBody<Date> getLatestPhoto(TerminalPhotoVo vo) { public ServiceBody<TakePIcModel> takePic(TerminalPhotoVo vo) {
Integer termId = vo.getTermId(); TakePIcModel model = new TakePIcModel();
int requestId = 0;
DateTime now = DateTime.now(); DateTime now = DateTime.now();
Integer termId = vo.getTermId();
Integer channel = vo.getChannel();
Integer preset = vo.getPreset();
Integer captureType = vo.getCaptureType();
Map<Integer, Terminals> terminalMap = cacheService.getTerminalMap(); Map<Integer, Terminals> terminalMap = cacheService.getTerminalMap();
Terminals terminals = terminalMap.get(termId); Terminals terminals = terminalMap.get(termId);
String cmdid = null; String cmdid = null;
@ -336,20 +344,51 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
cmdid = terminals.getCmdid(); cmdid = terminals.getCmdid();
} }
if (StrUtil.isNotEmpty(cmdid)) { if (StrUtil.isNotEmpty(cmdid)) {
String cmd = CmaUtil.takePic(cmdid, vo.getChannel(), vo.getCaptureType()); requestId = Constants.REQUEST_ID.addAndGet(1);
String cmd = CmaUtil.takePic(cmdid, channel, preset, captureType, requestId);
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
model.setRequestId(requestId);
model.setTaketime(MyDateUtils.date(now));
} }
return Asserts.success(now); return Asserts.success(model);
} }
/**
*
*
* @param vo
* @return
*/
@Override
public ServiceBody<Integer> getTakePicStatus(RequestIdVo vo) {
Integer requestid = vo.getRequestid();
if (requestid == null) {
Asserts.fail("请求编号不能为空");
}
RequestResults results = requestResultsDao.selectByRequestId(requestid);
if (BeanUtil.isEmpty(results)) {
return Asserts.success(TakePicStatus.UNKONW.value());
} else {
if (results.getResult() == 255) {
return Asserts.success(TakePicStatus.SUCCESS.value());
} else {
return Asserts.success(TakePicStatus.FAIL.value());
}
}
}
@Override @Override
public ServiceBody<Boolean> getReturnedPhoto(ReturnedPhotoVo vo) { public ServiceBody<Boolean> getTakePicPhotoStatus(ReturnedPhotoVo vo) {
Boolean hasNew = false; Boolean hasNew = false;
TerminalPhoto photo = terminalPhotoDao.getLatestPhoto(vo.getTermId()); Integer termId = vo.getTermId();
BigInteger photoTime = vo.getPhotoTime();
if (photoTime == null) {
Asserts.fail("查询时间不能缺少");
}
TerminalPhoto photo = terminalPhotoDao.getLatestPhoto(termId);
if (photo != null) { if (photo != null) {
long localPhotoTime = MyDateUtils.TimeMillSecond2Second(vo.getPhotoTime()); long localPhotoTime = MyDateUtils.TimeMillSecond2Second(MyDateUtils.date(photoTime.longValue()));
log.info("请求时间:{}", localPhotoTime); log.info("请求时间:{}", localPhotoTime);
log.info("装置凯斯处理时间:{}", photo.getRecvTime()); log.info("装置凯斯处理时间:{}", photo.getRecvTime());
hasNew = photo.getRecvTime().longValue() < localPhotoTime ? false : true; hasNew = photo.getRecvTime().longValue() < localPhotoTime ? false : true;
@ -419,7 +458,8 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
String cmdid = terminals.getCmdid(); String cmdid = terminals.getCmdid();
GetModel model = new GetModel(); GetModel model = new GetModel();
int requestId = Constants.REQUEST_ID.addAndGet(1); int requestId = Constants.REQUEST_ID.addAndGet(1);
String cmd = Constants.CMD + "imgparams --cmdid=" + cmdid + " --clientid=10 --reqid=" + requestId + " --flag=0 --rf=7 --channel=" + vo.getChannelId();
String cmd = CmaUtil.getPhotoQueryParam(cmdid, requestId, vo.getChannelId());
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
model.setRequestId(requestId); model.setRequestId(requestId);
/* /*
@ -433,8 +473,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
@Override @Override
public ServiceBody<String> addOrUpdatePhotoParams(PhotoParamsVo vo) { public ServiceBody<String> addOrUpdatePhotoParams(PhotoParamsVo vo) {
String cmd = Constants.CMD + "imgparams --flag=1 --cmdid=" + vo.getCmdId() + " --rf=7 --color=" + vo.getColor() + " --resolution=" + vo.getResolution() String cmd = CmaUtil.addOrUpdatePhotoParams(vo.getCmdId(), vo.getColor(), vo.getResolution(), vo.getLuminance(), vo.getContrast(), vo.getSaturation(), vo.getChannelId());
+ " --luminance=" + vo.getLuminance() + " -contrast=" + vo.getContrast() + " --saturation=" + vo.getSaturation() + " --channel=" + vo.getChannelId();
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
return Asserts.success("设置成功"); return Asserts.success("设置成功");
} }
@ -492,7 +531,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
public ServiceBody<GetModel> selectPhotoTimeGet(TerminalPhotoTimeGetVo vo) { public ServiceBody<GetModel> selectPhotoTimeGet(TerminalPhotoTimeGetVo vo) {
GetModel model = new GetModel(); GetModel model = new GetModel();
int requestId = Constants.REQUEST_ID.addAndGet(1); int requestId = Constants.REQUEST_ID.addAndGet(1);
String cmd = Constants.CMD + "schedule --cmdid=" + vo.getCmdId() + " --reqid=" + requestId + " --clientid=10 --flag=0 --rf=7 --channel=" + vo.getChannel(); String cmd = CmaUtil.selectPhotoTimeGet(vo.getCmdId(), requestId, vo.getChannel());
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
model.setRequestId(requestId); model.setRequestId(requestId);
return Asserts.success(model); return Asserts.success(model);

@ -260,9 +260,7 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
} }
String timestr = ScheduleListUtils.relateTime(dtoList, offset); String timestr = ScheduleListUtils.relateTime(dtoList, offset);
String cmd = Constants.CMD + "schedule --group=" + dtoList.size() + " --flag=1 --clientid=10 --cmdid=" String cmd = CmaUtil.relateSchelduleRule(dtoList, channelAndTermDto.getCmdid(), requestId, channelAndTermDto.getChannelid(), timestr);
+ channelAndTermDto.getCmdid() + " --reqid=" + requestId + " --channel=" + channelAndTermDto.getChannelid() + " " +
timestr;
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
log.info("cma下发时间表命令", cmd); log.info("cma下发时间表命令", cmd);
@ -410,13 +408,12 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
@Override @Override
public ServiceBody<GetModel> cmaSchelduleDetials(TerminalAndChannelIdVo vo) { public ServiceBody<GetModel> cmaSchelduleDetials(TerminalAndChannelIdVo vo) {
GetModel model = new GetModel(); GetModel model = new GetModel();
Integer terminalid = vo.getTerminalid(); Integer terminalid = vo.getTerminalid();
Integer channelid = vo.getChannelid(); Integer channelid = vo.getChannelid();
String cmdIdByTermId = terminalsDao.getCmdIdByTermId(terminalid); String cmdIdByTermId = terminalsDao.getCmdIdByTermId(terminalid);
int requestId = Constants.REQUEST_ID.addAndGet(1); int requestId = Constants.REQUEST_ID.addAndGet(1);
String cmd = Constants.CMD + "schedule --cmdid=" + cmdIdByTermId + " --reqid=" + requestId + " --clientid=10 --flag=0 --channel=" + channelid; String cmd = CmaUtil.cmaSchelduleDetials(cmdIdByTermId, requestId, channelid);
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
model.setRequestId(requestId); model.setRequestId(requestId);
return Asserts.success(model); return Asserts.success(model);

@ -18,6 +18,7 @@ import com.shxy.xymanager_common.enums.GloableParamsType;
import com.shxy.xymanager_common.exception.Asserts; import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.*; import com.shxy.xymanager_common.model.*;
import com.shxy.xymanager_common.page.PageUtils; import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.util.CmaUtil;
import com.shxy.xymanager_common.util.MyDateUtils; import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_common.util.xinyin.ProcessExecUtils; import com.shxy.xymanager_common.util.xinyin.ProcessExecUtils;
import com.shxy.xymanager_common.util.StringUtils; import com.shxy.xymanager_common.util.StringUtils;
@ -280,10 +281,8 @@ public class TerminalServiceImpl implements TerminalService {
*/ */
@Override @Override
public ServiceBody<String> resetTerminal(String cmId) { public ServiceBody<String> resetTerminal(String cmId) {
// Cma cma = new Cma("47.96.238.157", 6891); String cmd = CmaUtil.resetTerminal(cmId);
String cmd = Constants.CMD + "reset --cmdid=" + cmId + " --mode=0";
Integer retCode = ProcessExecUtils.exec(cmd); Integer retCode = ProcessExecUtils.exec(cmd);
// boolean reset = cma.reset(vo.getTermid().toString(), (short) 0x01);
if (retCode == 0) { if (retCode == 0) {
return Asserts.success("装置复位成功"); return Asserts.success("装置复位成功");
} else { } else {
@ -296,7 +295,7 @@ public class TerminalServiceImpl implements TerminalService {
public ServiceBody<TerminalStatusModel> getTerminalStatus(Integer termId) { public ServiceBody<TerminalStatusModel> getTerminalStatus(Integer termId) {
TerminalStatusModel model = new TerminalStatusModel(); TerminalStatusModel model = new TerminalStatusModel();
String cmdId = terminalsDao.getCmdIdByTermId(termId); String cmdId = terminalsDao.getCmdIdByTermId(termId);
String cmd = Constants.CMD + "runningstatus --flag=0 --cmdid=" + cmdId; String cmd = CmaUtil.getTerminalStatus(cmdId);
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
/* TerminalModel model = new TerminalModel();*/ /* TerminalModel model = new TerminalModel();*/
@ -344,7 +343,7 @@ public class TerminalServiceImpl implements TerminalService {
@Override @Override
public ServiceBody<TerminalUpdateModel> updateTerminalId(TerminalIdUpdateVo vo) { public ServiceBody<TerminalUpdateModel> updateTerminalId(TerminalIdUpdateVo vo) {
TerminalUpdateModel model = new TerminalUpdateModel(); TerminalUpdateModel model = new TerminalUpdateModel();
String cmd = Constants.CMD + "termid --flag=1 --cmdid=" + vo.getCmdId() + " --newcmdid=" + vo.getNewCmdId(); String cmd = CmaUtil.updateTerminalId(vo.getCmdId(),vo.getNewCmdId());
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
model.setTermId(vo.getTermId()); model.setTermId(vo.getTermId());
@ -395,7 +394,7 @@ public class TerminalServiceImpl implements TerminalService {
@Override @Override
public ServiceBody<GetModel> terminalIdGet(TerminalIdUpdateVo vo) { public ServiceBody<GetModel> terminalIdGet(TerminalIdUpdateVo vo) {
int requestId = Constants.REQUEST_ID.addAndGet(1); int requestId = Constants.REQUEST_ID.addAndGet(1);
String cmd = Constants.CMD + "termid --clientid=10 --flag=0 --cmdid=" + vo.getCmdId() + " --reqid=" + requestId; String cmd = CmaUtil.terminalIdGet(vo.getCmdId(), requestId);
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
GetModel model = new GetModel(); GetModel model = new GetModel();
model.setRequestId(requestId); model.setRequestId(requestId);

@ -5,6 +5,7 @@ import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.constant.Constants; import com.shxy.xymanager_common.constant.Constants;
import com.shxy.xymanager_common.exception.Asserts; import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.*; import com.shxy.xymanager_common.model.*;
import com.shxy.xymanager_common.util.CmaUtil;
import com.shxy.xymanager_common.util.xinyin.ProcessExecUtils; import com.shxy.xymanager_common.util.xinyin.ProcessExecUtils;
import com.shxy.xymanager_common.util.StringUtils; import com.shxy.xymanager_common.util.StringUtils;
import com.shxy.xymanager_common.vo.*; import com.shxy.xymanager_common.vo.*;
@ -26,8 +27,7 @@ public class TerminalVideoServiceImpl implements TerminalVideoService {
@Override @Override
public ServiceBody<String> updateVideoParam(VideoParamsVo vo) { public ServiceBody<String> updateVideoParam(VideoParamsVo vo) {
String cmd = Constants.CMD + "videoparams --flag=1 --cmdid=" + vo.getCmdId() + " --channel=" + vo.getChannelId() + " --format=" + String cmd = CmaUtil.updateVideoParam(vo.getCmdId(), vo.getChannelId(), vo.getVideoFormat(), vo.getVideoTime(), vo.getPreset());
vo.getVideoFormat() + " --time=" + vo.getVideoTime()+" --preset="+vo.getPreset();
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
return Asserts.success("修改完成"); return Asserts.success("修改完成");
} }
@ -36,7 +36,7 @@ public class TerminalVideoServiceImpl implements TerminalVideoService {
public ServiceBody<GetModel> videoParamGet(VideoGetVo vo) { public ServiceBody<GetModel> videoParamGet(VideoGetVo vo) {
int requestId = Constants.REQUEST_ID.addAndGet(1); int requestId = Constants.REQUEST_ID.addAndGet(1);
GetModel model = new GetModel(); GetModel model = new GetModel();
String cmd = Constants.CMD + "videoparams --clientid=10 --flag=0 --cmdid=" + vo.getCmdId()+ " --reqid=" + requestId+ " --channel=" + vo.getChannelId(); String cmd = CmaUtil.videoParamGet(vo.getCmdId(), requestId, vo.getChannelId());
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
model.setRequestId(requestId); model.setRequestId(requestId);
return Asserts.success(model); return Asserts.success(model);

@ -19,8 +19,6 @@ public interface TermSetService {
*/ */
ServiceBody<String> alarmMark(VoiceCtrlVo vo); ServiceBody<String> alarmMark(VoiceCtrlVo vo);
ServiceBody<Integer> selectPhotoTimeGet(TerminalIdVo vo);
/** /**
* *
* *

@ -17,6 +17,7 @@ public interface TerminalPhotoService {
* *
* @return * @return
*/ */
ServiceBody<TerminalPhotoListModel> getTerminalPhotoList(String requestIp,TerminalAndChannelIdAndTimeVo vo); ServiceBody<TerminalPhotoListModel> getTerminalPhotoList(String requestIp,TerminalAndChannelIdAndTimeVo vo);
/** /**
@ -36,19 +37,25 @@ public interface TerminalPhotoService {
ServiceBody<TerminalPhotoListForOpenModel> getPhotoListForOpen(String requestIp, OpenTerminalAndTimeVo vo); ServiceBody<TerminalPhotoListForOpenModel> getPhotoListForOpen(String requestIp, OpenTerminalAndTimeVo vo);
/** /**
* id *
* *
* @return * @return
*/ */
ServiceBody<Date> getLatestPhoto(TerminalPhotoVo vo); ServiceBody<TakePIcModel> takePic(TerminalPhotoVo vo);
/**
*
*
* @return
*/
ServiceBody<Integer> getTakePicStatus(RequestIdVo vo);
/** /**
* *
* *
* @return * @return
*/ */
ServiceBody<Boolean> getReturnedPhoto(ReturnedPhotoVo vo); ServiceBody<Boolean> getTakePicPhotoStatus(ReturnedPhotoVo vo);
/** /**
* *

Loading…
Cancel
Save