From b680dace0f10c897110ffc0e5fa0d9e63ad21ea7 Mon Sep 17 00:00:00 2001 From: liuguijing <123456> Date: Mon, 15 May 2023 09:47:10 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A3=85=E7=BD=AE=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/TermSetController.java | 47 +++++++++++++++++++ .../src/main/resources/mappers/DyLevelDao.xml | 2 +- .../impl/TermSetServiceImpl.java | 41 ++++++++++++++++ .../impl/TerminalPhotoServiceImpl.java | 2 +- .../service/TermSetService.java | 27 +++++++++++ 5 files changed, 117 insertions(+), 2 deletions(-) create mode 100644 xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TermSetController.java create mode 100644 xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TermSetServiceImpl.java create mode 100644 xymanager_service/src/main/java/com/shxy/xymanager_service/service/TermSetService.java diff --git a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TermSetController.java b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TermSetController.java new file mode 100644 index 0000000..0c670aa --- /dev/null +++ b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TermSetController.java @@ -0,0 +1,47 @@ +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.DyLineTreeAndChannelListModel; +import com.shxy.xymanager_common.model.TerminalAllChannelListModel; +import com.shxy.xymanager_common.model.TerminalChannelListModel; +import com.shxy.xymanager_common.model.TerminalChannelMapperListModel; +import com.shxy.xymanager_common.vo.*; +import com.shxy.xymanager_service.service.TermSetService; +import com.shxy.xymanager_service.service.TerminalChannelService; +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.RestController; + + +@Api(value = "装置cma控制", tags = "装置cma控制") +@RestController +@Slf4j +public class TermSetController extends BaseController { + + @Autowired + TermSetService termSetService; + + @ApiOperation(value = "装置cma控制", notes = "装置cma控制", httpMethod = "POST") + @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) + @RequestMapping("/alarmMark") + @Log(title = "装置cma控制", type = "查询") + public ResponseReult alarmMark(@RequestBody @Validated TerminalIdVo vo) { + ServiceBody serviceBody = termSetService.alarmMark(vo); + if (serviceBody.getCode() == ServiceStatus.SUCCESS) { + return ResponseReult.success(serviceBody.getData()); + } else { + return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg()); + } + } +} diff --git a/xymanager_dao/src/main/resources/mappers/DyLevelDao.xml b/xymanager_dao/src/main/resources/mappers/DyLevelDao.xml index 238406b..fdbf6b2 100644 --- a/xymanager_dao/src/main/resources/mappers/DyLevelDao.xml +++ b/xymanager_dao/src/main/resources/mappers/DyLevelDao.xml @@ -19,7 +19,7 @@ - + diff --git a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TermSetServiceImpl.java b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TermSetServiceImpl.java new file mode 100644 index 0000000..ac9cfd3 --- /dev/null +++ b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TermSetServiceImpl.java @@ -0,0 +1,41 @@ +package com.shxy.xymanager_service.impl; + +import com.shxy.xymanager_common.bean.ServiceBody; +import com.shxy.xymanager_common.constant.Constants; +import com.shxy.xymanager_common.exception.Asserts; +import com.shxy.xymanager_common.util.ProcessExecUtils; +import com.shxy.xymanager_common.vo.TerminalIdVo; +import com.shxy.xymanager_common.vo.TerminalReqPhotoTimeVo; +import com.shxy.xymanager_service.service.TermSetService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + + + +/** + * 装置通过Cma控制 + * + * @author 晶晶 + */ +@Slf4j +@Service +public class TermSetServiceImpl implements TermSetService { + + + @Override + public ServiceBody alarmMark(TerminalIdVo vo) { + + String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --act=imgparams --cmdid="+vo.getCmdId()+ "\t" + "--reqid="+ Constants.REQUEST_ID+ "\t"+ "--clientid=10--flag=1 --rf=7"; + ProcessExecUtils.exec(cmd); + return Asserts.success(Integer.parseInt(Constants.REQUEST_ID.toString())); + } + + @Override + public ServiceBody selectPhotoTimeGet(TerminalIdVo vo) { + String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --act=alarmMark --cmdid="+vo.getCmdId()+ "\t" + "--reqid="+Constants.REQUEST_ID+ "\t"+ "--clientid=10--flag=1 --rf=7"; + ProcessExecUtils.exec(cmd); + return Asserts.success(Integer.parseInt(Constants.REQUEST_ID.toString())); + } + +} + 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 f71265a..cebf6c9 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 @@ -464,7 +464,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService { @Override public ServiceBody selectPhotoTimeGet(TerminalReqPhotoTimeVo vo) { - String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --act=imgparams --cmdid="+vo.getCmdId()+ "\t" + "--reqid="+Constants.REQUEST_ID+ "\t"+ "--clientid=10--flag=1 --rf=7"; + String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --act=alarmMark --cmdid="+vo.getCmdId()+ "\t" + "--reqid="+Constants.REQUEST_ID+ "\t"+ "--clientid=10--flag=1 --rf=7"; ProcessExecUtils.exec(cmd); return Asserts.success(Integer.parseInt(Constants.REQUEST_ID.toString())); } diff --git a/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TermSetService.java b/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TermSetService.java new file mode 100644 index 0000000..42bab6a --- /dev/null +++ b/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TermSetService.java @@ -0,0 +1,27 @@ +package com.shxy.xymanager_service.service; + +import com.shxy.xymanager_common.bean.ServiceBody; +import com.shxy.xymanager_common.model.DyLineTreeAndChannelListModel; +import com.shxy.xymanager_common.model.TerminalAllChannelListModel; +import com.shxy.xymanager_common.model.TerminalChannelListModel; +import com.shxy.xymanager_common.model.TerminalChannelMapperListModel; +import com.shxy.xymanager_common.vo.*; + +/** + * 装置控制接口 + * + * @author 晶晶 + */ +public interface TermSetService { + + + /** + * 声光报警 + * + * @return + */ + ServiceBody alarmMark(TerminalIdVo vo); + + ServiceBody selectPhotoTimeGet(TerminalIdVo vo); + +}