diff --git a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalVideoController.java b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalVideoController.java new file mode 100644 index 0000000..57f4612 --- /dev/null +++ b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalVideoController.java @@ -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 updateVideoParam(@RequestBody @Validated VideoParamsVo vo) { + ServiceBody 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 videoParamGet(@RequestBody @Validated VideoParamsVo vo) { + ServiceBody 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 selectVideoParam(@RequestParam("requestId") Integer requestId) { + ServiceBody serviceBody = terminalVideoService.selectVideoParam(requestId); + if (serviceBody.getCode() == ServiceStatus.SUCCESS) { + return ResponseReult.success(serviceBody.getData()); + } else { + return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg()); + } + } + + +} diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/constant/Constants.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/constant/Constants.java index 7fd7954..657bcef 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/constant/Constants.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/constant/Constants.java @@ -2,7 +2,9 @@ package com.shxy.xymanager_common.constant; import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; +import javax.annotation.PostConstruct; import java.util.concurrent.atomic.AtomicInteger; /** @@ -10,14 +12,31 @@ import java.util.concurrent.atomic.AtomicInteger; * * @author xzg */ +@Component public class Constants { + @Value("${cma.server}") - private static String server; + public String cmServer; @Value("${cma.port}") + public int cmaPort; + + private static String server; + private static int port; + public static String CMD = ""; + + + @PostConstruct + private void init(){ + server = cmServer; + port = cmaPort; + CMD = "/usr/local/bin/xympadmn --server="+server+"\t" +"--port="+port+"\t" +"--act="; + } + + /** @@ -176,6 +195,5 @@ public class Constants */ public static AtomicInteger REQUEST_ID = new AtomicInteger((int) (System.currentTimeMillis()/1000)); - public static String CMD = "/usr/local/bin/xympadmn --server="+server+"\t" +"--port="+port+"\t" +"--act="; } \ No newline at end of file diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalPhotoListModel.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalPhotoListModel.java index cef0ec3..7bf7198 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalPhotoListModel.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalPhotoListModel.java @@ -63,5 +63,8 @@ public class TerminalPhotoListModel implements Serializable { @ApiModelProperty(value = "拍照方式", example = "123456") private Integer manualRequest; + @ApiModelProperty(value = "拍照类型", example = "123456") + private Integer mediaType; + } } diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalPhotoSelectListModel.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalPhotoSelectListModel.java index da2da91..f7afae8 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalPhotoSelectListModel.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalPhotoSelectListModel.java @@ -56,7 +56,7 @@ public class TerminalPhotoSelectListModel implements Serializable { private BigInteger orginalid; @ApiModelProperty(value = "图片类型", example = "123456") - private Integer mediatype; + private Integer mediaType; @ApiModelProperty(value = "拍照时间", example = "123456") private Date photoTime; 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 new file mode 100644 index 0000000..58e9192 --- /dev/null +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalVideoParamsModel.java @@ -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; + + +} diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalChannelVo.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalChannelVo.java index 6b69a51..5e758fb 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalChannelVo.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalChannelVo.java @@ -8,7 +8,7 @@ import javax.validation.constraints.NotNull; import java.util.List; @Data -@ApiModel(value = "通道对象", description = "通道对象描述") +@ApiModel(value = "添加通道对象", description = "添加通道对象描述") public class TerminalChannelVo { @NotNull(message = "装置列表不能缺少") diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/UpdateTowerVo.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/UpdateTowerVo.java index f5f8956..c0bcab5 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/UpdateTowerVo.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/UpdateTowerVo.java @@ -5,13 +5,14 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; @Data @ApiModel(value = "修改杆塔对象", description = "修改杆塔对象描述") public class UpdateTowerVo { @ApiModelProperty(value = "杆塔编号", example = "123456") - @NotBlank(message = "杆塔编号不能缺少") + @NotNull(message = "杆塔编号不能缺少") private Integer id; @ApiModelProperty(value = "杆塔名称", example = "名称名称") @@ -19,7 +20,7 @@ public class UpdateTowerVo { private String name; @ApiModelProperty(value = "线路编号", example = "单位") - @NotBlank(message = "线路编号不能缺少") + @NotNull(message = "线路编号不能缺少") private Integer lineId; 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 new file mode 100644 index 0000000..79c997c --- /dev/null +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/VideoParamsVo.java @@ -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; + + + +} diff --git a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalChannelsDao.java b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalChannelsDao.java index b67dc53..8d7d432 100644 --- a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalChannelsDao.java +++ b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalChannelsDao.java @@ -5,6 +5,8 @@ import com.shxy.xymanager_common.dto.TermChannelAndMapperDto; import com.shxy.xymanager_common.entity.TerminalChannels; import com.shxy.xymanager_common.entity.TerminalScheduleMapper; import com.shxy.xymanager_common.entity.Terminals; +import com.shxy.xymanager_common.vo.TerminalChannelVo; +import com.shxy.xymanager_common.vo.UpdateTerminalChannelVo; import org.apache.ibatis.annotations.Param; import java.util.Date; @@ -32,4 +34,8 @@ public interface TerminalChannelsDao { int deleteList(@Param("list") List list,@Param("status") Integer status,@Param("updateat") Date update); + int selectChannelCount(List list); + + int selectChannelCountById(UpdateTerminalChannelVo vo); + } \ No newline at end of file diff --git a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalPhotoDao.java b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalPhotoDao.java index 6cc76f2..54752fd 100644 --- a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalPhotoDao.java +++ b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalPhotoDao.java @@ -32,7 +32,7 @@ public interface TerminalPhotoDao { int updateByPrimaryKey(TerminalPhoto record); - BigInteger getLatestPhoto(@Param("termId") Integer termId); + TerminalPhoto getLatestPhoto(@Param("termId") Integer termId); List selectPhotos(); diff --git a/xymanager_dao/src/main/resources/mappers/TerminalChannelsDao.xml b/xymanager_dao/src/main/resources/mappers/TerminalChannelsDao.xml index e2c7b13..279cc67 100644 --- a/xymanager_dao/src/main/resources/mappers/TerminalChannelsDao.xml +++ b/xymanager_dao/src/main/resources/mappers/TerminalChannelsDao.xml @@ -60,6 +60,29 @@ where status = #{status} + + + + - select - recv_time photoTime + from terminal_photos where term_id = #{termId} order by recv_time desc limit 1 diff --git a/xymanager_dao/src/main/resources/mappers/TerminalScheduleDao.xml b/xymanager_dao/src/main/resources/mappers/TerminalScheduleDao.xml index 6da1ee1..f7a572f 100644 --- a/xymanager_dao/src/main/resources/mappers/TerminalScheduleDao.xml +++ b/xymanager_dao/src/main/resources/mappers/TerminalScheduleDao.xml @@ -47,7 +47,7 @@ y.span as span from terminal_schedule x, terminal_schedule_rule y - where y.schedule_id = x.id and x.status = #{status} + where y.schedule_id = x.id and x.status = #{status} order by x.create_time desc