From 674268589b9a79273bbe3dbc42c5a472aaebd2bd Mon Sep 17 00:00:00 2001 From: 18616268358 <1440265357@qq.com> Date: Wed, 17 May 2023 14:54:15 +0800 Subject: [PATCH 01/12] =?UTF-8?q?#20230510=20=E6=AC=A3=E5=BD=B1=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=B9=B3=E5=8F=B0=E8=A3=85=E7=BD=AE=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/shxy/xymanager_common/constant/Constants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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..545117d 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 @@ -176,6 +176,6 @@ 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="; + public static String CMD = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6981 --act="; } \ No newline at end of file From 469f2a63d7480b6f814dc1b31197197c24e43fe5 Mon Sep 17 00:00:00 2001 From: 18616268358 <1440265357@qq.com> Date: Wed, 17 May 2023 18:42:05 +0800 Subject: [PATCH 02/12] =?UTF-8?q?#20230510=20=E6=AC=A3=E5=BD=B1=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=B9=B3=E5=8F=B0=E8=A3=85=E7=BD=AE=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/TerminalVideoController.java | 74 +++++++++++++++++++ .../model/TerminalVideoParamsModel.java | 23 ++++++ .../xymanager_common/vo/VideoParamsVo.java | 25 +++++++ .../resources/mappers/TerminalChannelsDao.xml | 1 + .../resources/mappers/TerminalScheduleDao.xml | 2 +- .../mappers/TerminalScheduleRuleDao.xml | 11 +-- .../main/resources/mappers/TerminalsDao.xml | 1 + .../impl/TerminalScheduleRuleServiceImpl.java | 1 + .../impl/TerminalVideoServiceImpl.java | 70 ++++++++++++++++++ .../service/TerminalVideoService.java | 30 ++++++++ 10 files changed, 227 insertions(+), 11 deletions(-) create mode 100644 xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalVideoController.java create mode 100644 xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalVideoParamsModel.java create mode 100644 xymanager_common/src/main/java/com/shxy/xymanager_common/vo/VideoParamsVo.java create mode 100644 xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalVideoServiceImpl.java create mode 100644 xymanager_service/src/main/java/com/shxy/xymanager_service/service/TerminalVideoService.java 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/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/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/resources/mappers/TerminalChannelsDao.xml b/xymanager_dao/src/main/resources/mappers/TerminalChannelsDao.xml index e2c7b13..397a3e7 100644 --- a/xymanager_dao/src/main/resources/mappers/TerminalChannelsDao.xml +++ b/xymanager_dao/src/main/resources/mappers/TerminalChannelsDao.xml @@ -81,6 +81,7 @@ and x.term_id = #{termid} + order by x.create_time desc + + + + - select - recv_time photoTime + from terminal_photos where term_id = #{termId} order by recv_time desc limit 1 diff --git a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalPhotoServiceImpl.java b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalPhotoServiceImpl.java index 3196269..69c216f 100644 --- a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalPhotoServiceImpl.java +++ b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalPhotoServiceImpl.java @@ -296,9 +296,14 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService { @Override public ServiceBody getReturnedPhoto(ReturnedPhotoVo vo) { Boolean hasNew = false; - BigInteger photoTime = terminalPhotoDao.getLatestPhoto(vo.getTermId()); + TerminalPhoto photo = terminalPhotoDao.getLatestPhoto(vo.getTermId()); BigInteger localPhotoTime = MyDateUtils.TimeMillSecond2Second(vo.getPhotoTime()); - hasNew = photoTime.compareTo(localPhotoTime) < 0 ? false : true; + hasNew = photo.getRecvTime().compareTo(localPhotoTime) < 0 ? false : true; + if(hasNew){ + if(!StringUtils.isNotBlank(photo.getThumb())){ + hasNew=false; + } + } return Asserts.success(hasNew); } From 226ab79eb1d2c6f4b9bd907d4dba0b08ef3ff2c5 Mon Sep 17 00:00:00 2001 From: 18616268358 <1440265357@qq.com> Date: Thu, 18 May 2023 17:12:22 +0800 Subject: [PATCH 09/12] =?UTF-8?q?#20230510=20=E6=AC=A3=E5=BD=B1=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=B9=B3=E5=8F=B0=E8=A3=85=E7=BD=AE=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/shxy/xymanager_common/vo/UpdateTowerVo.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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..cd3c882 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 = "名称名称") From 959bb2f628bedd501f90682417a8adb4fd39926d Mon Sep 17 00:00:00 2001 From: 18616268358 <1440265357@qq.com> Date: Thu, 18 May 2023 17:13:20 +0800 Subject: [PATCH 10/12] =?UTF-8?q?#20230510=20=E6=AC=A3=E5=BD=B1=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=B9=B3=E5=8F=B0=E8=A3=85=E7=BD=AE=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/shxy/xymanager_common/vo/UpdateTowerVo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 cd3c882..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 @@ -20,7 +20,7 @@ public class UpdateTowerVo { private String name; @ApiModelProperty(value = "线路编号", example = "单位") - @NotBlank(message = "线路编号不能缺少") + @NotNull(message = "线路编号不能缺少") private Integer lineId; From cf76d84def8734aab72db9773232b485cb67cb39 Mon Sep 17 00:00:00 2001 From: 18616268358 <1440265357@qq.com> Date: Fri, 19 May 2023 10:08:28 +0800 Subject: [PATCH 11/12] =?UTF-8?q?#20230510=20=E6=AC=A3=E5=BD=B1=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=B9=B3=E5=8F=B0=E8=A3=85=E7=BD=AE=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shxy/xymanager_service/impl/TerminalChannelServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalChannelServiceImpl.java b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalChannelServiceImpl.java index 152502c..2dcd903 100644 --- a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalChannelServiceImpl.java +++ b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalChannelServiceImpl.java @@ -57,7 +57,7 @@ public class TerminalChannelServiceImpl implements TerminalChannelService { Date date = new Date(); int count = terminalChannelsDao.selectChannelCount(vo.getList()); if(count>0){ - return Asserts.success("通道重复"); + return Asserts.error("通道重复"); } int i = terminalChannelsDao.insertList(list, CommonStatus.EFFECTIVE.value(), date, date); From 009967f83fd00967f118191329070b86131bd609 Mon Sep 17 00:00:00 2001 From: 18616268358 <1440265357@qq.com> Date: Fri, 19 May 2023 10:52:22 +0800 Subject: [PATCH 12/12] =?UTF-8?q?#20230510=20=E6=AC=A3=E5=BD=B1=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=B9=B3=E5=8F=B0=E8=A3=85=E7=BD=AE=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xymanager_common/constant/Constants.java | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) 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 545117d..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=127.0.0.1 --port=6981 --act="; } \ No newline at end of file