From 387926551a188e4cba9b5ff978c32a752bbc1e63 Mon Sep 17 00:00:00 2001 From: 18616268358 <1440265357@qq.com> Date: Wed, 17 May 2023 11:32:57 +0800 Subject: [PATCH] =?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/SystemConfigController.java | 10 +++--- .../controller/TerminalController.java | 4 +-- .../controller/TerminalPhotoController.java | 8 ++--- .../xymanager_common/constant/Constants.java | 13 ++++++++ .../xymanager_common/model/CmaBackModel.java | 21 ------------ ...{TerminalIdGetModel.java => GetModel.java} | 4 +-- .../model/TerminalStatusGetModel.java | 21 ------------ .../xymanager_common/vo/TerminalIdVo.java | 3 -- .../impl/SystemConfigServiceImpl.java | 21 ++++++------ .../impl/TermSetServiceImpl.java | 4 +-- .../impl/TerminalGpsServiceImpl.java | 32 ++++++++----------- .../impl/TerminalPhotoServiceImpl.java | 18 +++++------ .../impl/TerminalServiceImpl.java | 15 ++++----- .../service/SystemConfigService.java | 7 ++-- .../service/TerminalPhotoService.java | 4 +-- .../service/TerminalService.java | 2 +- 16 files changed, 72 insertions(+), 115 deletions(-) delete mode 100644 xymanager_common/src/main/java/com/shxy/xymanager_common/model/CmaBackModel.java rename xymanager_common/src/main/java/com/shxy/xymanager_common/model/{TerminalIdGetModel.java => GetModel.java} (67%) delete mode 100644 xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalStatusGetModel.java diff --git a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/SystemConfigController.java b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/SystemConfigController.java index 050f552..6b166e3 100644 --- a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/SystemConfigController.java +++ b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/SystemConfigController.java @@ -5,7 +5,7 @@ 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.CmaBackModel; +import com.shxy.xymanager_common.model.GetModel; import com.shxy.xymanager_common.model.SystemConfigModel; import com.shxy.xymanager_common.model.UpperComputerInfoModel; import com.shxy.xymanager_common.vo.SystemConfigReqVo; @@ -37,8 +37,8 @@ public class SystemConfigController extends BaseController { @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) @RequestMapping("/getSystemConfigGet") @Log(title = "获取全局配置触发接口", type = "查询") - public ResponseReult getSystemConfigGet(@RequestParam("id") String id) { - ServiceBody serviceBody = configService.getSystemConfig(id); + public ResponseReult getSystemConfigGet(@RequestParam("id") String id) { + ServiceBody serviceBody = configService.getSystemConfig(id); if (serviceBody.getCode() == ServiceStatus.SUCCESS) { return ResponseReult.success(serviceBody.getData()); } else { @@ -76,8 +76,8 @@ public class SystemConfigController extends BaseController { @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) @RequestMapping("/upperComputerGet") @Log(title = "获取上位机信息触发", type = "查询") - public ResponseReult upperComputerGet(@RequestParam("cmdId") String cmdId) { - ServiceBody serviceBody = configService.upperComputerGet(cmdId); + public ResponseReult upperComputerGet(@RequestParam("cmdId") String cmdId) { + ServiceBody serviceBody = configService.upperComputerGet(cmdId); if (serviceBody.getCode() == ServiceStatus.SUCCESS) { return ResponseReult.success(serviceBody.getData()); } else { diff --git a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalController.java b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalController.java index faba6b9..89c9f53 100644 --- a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalController.java +++ b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalController.java @@ -134,8 +134,8 @@ public class TerminalController extends BaseController { @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) @RequestMapping("/terminalIdGet") @Log(title = "图像装置ID查询触发", type = "修改") - public ResponseReult terminalIdGet(@RequestBody @Validated TerminalIdUpdateVo vo) { - ServiceBody serviceBody = terminalService.terminalIdGet(vo); + public ResponseReult terminalIdGet(@RequestBody @Validated TerminalIdUpdateVo vo) { + ServiceBody serviceBody = terminalService.terminalIdGet(vo); if (serviceBody.getCode() == ServiceStatus.SUCCESS) { return ResponseReult.success(serviceBody.getData()); } else { diff --git a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalPhotoController.java b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalPhotoController.java index db7659e..8757bb1 100644 --- a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalPhotoController.java +++ b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalPhotoController.java @@ -76,8 +76,8 @@ public class TerminalPhotoController extends BaseController { @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) @RequestMapping("/selectPhotoTimeGet") @Log(title = "拍照时间表查询触发", type = "查询") - public ResponseReult selectPhotoTimeGet(@RequestBody @Validated TerminalPhotoTimeGetVo vo) { - ServiceBody serviceBody = terminalPhotoService.selectPhotoTimeGet(vo); + public ResponseReult selectPhotoTimeGet(@RequestBody @Validated TerminalPhotoTimeGetVo vo) { + ServiceBody serviceBody = terminalPhotoService.selectPhotoTimeGet(vo); if (serviceBody.getCode() == ServiceStatus.SUCCESS) { return ResponseReult.success(serviceBody.getData()); } else { @@ -155,8 +155,8 @@ public class TerminalPhotoController extends BaseController { @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) @RequestMapping("/getPhotoQueryParamList") @Log(title = "最新图片采集参数触发", type = "查询") - public ResponseReult getPhotoQueryParamList(@RequestBody @Validated ReturnedPhotoParamsGetVo vo) { - ServiceBody serviceBody = terminalPhotoService.getPhotoQueryParam(vo); + public ResponseReult getPhotoQueryParamList(@RequestBody @Validated ReturnedPhotoParamsGetVo vo) { + ServiceBody serviceBody = terminalPhotoService.getPhotoQueryParam(vo); if (serviceBody.getCode() == ServiceStatus.SUCCESS) { return ResponseReult.success(serviceBody.getData()); } else { 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 4af62ee..7fd7954 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 @@ -1,6 +1,8 @@ package com.shxy.xymanager_common.constant; +import org.springframework.beans.factory.annotation.Value; + import java.util.concurrent.atomic.AtomicInteger; /** @@ -10,6 +12,14 @@ import java.util.concurrent.atomic.AtomicInteger; */ public class Constants { + @Value("${cma.server}") + private static String server; + + @Value("${cma.port}") + private static int port; + + + /** * UTF-8 字符集 */ @@ -165,4 +175,7 @@ public class Constants * 调用JNI自增ID */ 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/CmaBackModel.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/CmaBackModel.java deleted file mode 100644 index 980a94d..0000000 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/CmaBackModel.java +++ /dev/null @@ -1,21 +0,0 @@ -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.List; - -/** - * 所有杆塔列表 - */ -@Data -@ApiModel(value = "Cma返回信息", description = "Cma返回信息") -public class CmaBackModel implements Serializable { - - @ApiModelProperty(value = "请求ID", example = "1233") - private Integer requestId; - - -} diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalIdGetModel.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/GetModel.java similarity index 67% rename from xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalIdGetModel.java rename to xymanager_common/src/main/java/com/shxy/xymanager_common/model/GetModel.java index ebb52b3..993f2c4 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalIdGetModel.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/GetModel.java @@ -10,8 +10,8 @@ import java.io.Serializable; * 设备ID触发查询信息 */ @Data -@ApiModel(value = "设备ID触发查询信息", description = "获取设备ID触发查询信息") -public class TerminalIdGetModel implements Serializable { +@ApiModel(value = "触发查询信息", description = "触发查询信息") +public class GetModel implements Serializable { @ApiModelProperty(value = "请求ID", example = "123456") private Integer requestId; diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalStatusGetModel.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalStatusGetModel.java deleted file mode 100644 index 3dc97e0..0000000 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalStatusGetModel.java +++ /dev/null @@ -1,21 +0,0 @@ -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 TerminalStatusGetModel implements Serializable { - - @ApiModelProperty(value = "请求Id", example = "123456") - private Integer requestId; - - - -} diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalIdVo.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalIdVo.java index e397e69..dacb1bd 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalIdVo.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalIdVo.java @@ -17,7 +17,4 @@ public class TerminalIdVo { @ApiModelProperty(value = "图像监测装置 ID", example = "123455") private String cmdId; - - @ApiModelProperty(value = "请求 ID", example = "123455") - private Integer requestId; } diff --git a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/SystemConfigServiceImpl.java b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/SystemConfigServiceImpl.java index 28eb4ab..d0cb780 100644 --- a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/SystemConfigServiceImpl.java +++ b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/SystemConfigServiceImpl.java @@ -7,10 +7,7 @@ import com.shxy.xymanager_common.dto.PhotoParamsDto; import com.shxy.xymanager_common.dto.UpperComputerInfoDto; import com.shxy.xymanager_common.entity.TerminalParams; import com.shxy.xymanager_common.exception.Asserts; -import com.shxy.xymanager_common.model.CmaBackModel; -import com.shxy.xymanager_common.model.SystemConfigModel; -import com.shxy.xymanager_common.model.TerminalPhotosParamsModel; -import com.shxy.xymanager_common.model.UpperComputerInfoModel; +import com.shxy.xymanager_common.model.*; import com.shxy.xymanager_common.util.ProcessExecUtils; import com.shxy.xymanager_common.util.StringUtils; import com.shxy.xymanager_common.vo.SystemConfigReqVo; @@ -40,14 +37,14 @@ public class SystemConfigServiceImpl implements SystemConfigService { @Override - public ServiceBody getSystemConfig(String cmdId) { + public ServiceBody getSystemConfig(String cmdId) { /* SystemConfigModel model = new SystemConfigModel(); Integer beatHeartTime = systemConfigDao.getTerminalParams(id); model.setHeartBeatTime(beatHeartTime); String globalTime = systemConfigDao.getGlobalTime(Constants.GLOBAL_TIME); model.setGlobalTime(Integer.parseInt(globalTime));*/ - CmaBackModel model = new CmaBackModel(); - String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --clientid=10 --act=sampling --flag=0 --cmdid="+cmdId+ "\t"+"--reqid="+Constants.REQUEST_ID; + GetModel model = new GetModel(); + String cmd = Constants.CMD+"sampling --clientid=10 --flag=0 --cmdid="+cmdId+ "\t"+"--reqid="+Constants.REQUEST_ID; ProcessExecUtils.exec(cmd); model.setRequestId(Integer.parseInt(Constants.REQUEST_ID.toString())); Constants.REQUEST_ID.addAndGet(1); @@ -61,7 +58,7 @@ public class SystemConfigServiceImpl implements SystemConfigService { param.setHeartbeatTime(vo.getHeartBeatTime()); systemConfigDao.updateSystemConfig(param); - String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --act=sampling --cmdid="+vo.getCmdId()+ "\t"+ "--heartbeat=" + vo.getHeartBeatTime(); + String cmd =Constants.CMD+"sampling --cmdid="+vo.getCmdId()+ "\t"+ "--heartbeat=" + vo.getHeartBeatTime(); ProcessExecUtils.exec(cmd); return Asserts.success("修改成功"); } @@ -82,11 +79,13 @@ public class SystemConfigServiceImpl implements SystemConfigService { } @Override - public ServiceBody upperComputerGet(String cmdId) { - String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --clientid=10 --act=cma --flag=0 --cmdid="+cmdId+ "\t"+"--reqid="+Constants.REQUEST_ID; + public ServiceBody upperComputerGet(String cmdId) { + GetModel model = new GetModel(); + String cmd = Constants.CMD+"cma --clientid=10 --flag=0 --cmdid="+cmdId+ "\t"+"--reqid="+Constants.REQUEST_ID; ProcessExecUtils.exec(cmd); + model.setRequestId(Integer.parseInt( Constants.REQUEST_ID.toString())); Constants.REQUEST_ID.addAndGet(1); - return Asserts.success(Integer.parseInt(Constants.REQUEST_ID.toString())); + return Asserts.success(model); } @Override 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 index e68c1fb..b2e3c96 100644 --- 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 @@ -34,14 +34,14 @@ 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"; + String cmd =Constants.CMD+"imgparams --cmdid="+vo.getCmdId()+ "\t" + "--reqid="+ Constants.REQUEST_ID+ "\t"+ "--clientid=10--flag=0 --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"; + String cmd = Constants.CMD+"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/TerminalGpsServiceImpl.java b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalGpsServiceImpl.java index e8ec31a..032797c 100644 --- a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalGpsServiceImpl.java +++ b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalGpsServiceImpl.java @@ -79,7 +79,7 @@ public class TerminalGpsServiceImpl implements TerminalGpsService { } else { status = CommonStatus.DELETE.value(); } - String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --act=gpsctrl --cmdid="+vo.getCmdId() +"\t" +"--ctrl="+ status; + String cmd = Constants.CMD+"gpsctrl --cmdid="+vo.getCmdId() +"\t" +"--ctrl="+ status; ProcessExecUtils.exec(cmd); if (set) { TerminalStatus record = new TerminalStatus(); @@ -107,24 +107,18 @@ public class TerminalGpsServiceImpl implements TerminalGpsService { TerminalGpsModel model = new TerminalGpsModel(); // Cma cma = new Cma("47.96.238.157", 6891); // boolean b = cma.requestGpsInfo(vo.getTermid().toString()); - String result = terminalPhotoDao.getRequestResult(5);//待修改 - DateTime now = DateTime.now(); - if(StringUtils.isNotBlank(result)) { - model = JSONObject.parseObject(result, TerminalGpsModel.class); - }else { - TerminalPositions bean = terminalPositionsDao.selectByPrimaryKey(vo.getTermid()); - - if (!BeanUtil.isEmpty(bean)) { - model.setRadius(bean.getRadius()); - model.setLongitude(bean.getLongitude()); - model.setLatitude(bean.getLatitude()); - model.setTermid(bean.getTermId()); - model.setQueryTime(now); - BigInteger updatetime = MyDateUtils.TimeSecond2MillSecond(bean.getUpdateTime().longValue()); - model.setUpdatetime(MyDateUtils.date(updatetime.longValue())); - } - + DateTime now = DateTime.now(); + TerminalPositions bean = terminalPositionsDao.selectByPrimaryKey(vo.getTermid()); + + if (!BeanUtil.isEmpty(bean)) { + model.setRadius(bean.getRadius()); + model.setLongitude(bean.getLongitude()); + model.setLatitude(bean.getLatitude()); + model.setTermid(bean.getTermId()); + model.setQueryTime(now); + BigInteger updatetime = MyDateUtils.TimeSecond2MillSecond(bean.getUpdateTime().longValue()); + model.setUpdatetime(MyDateUtils.date(updatetime.longValue())); } if (null!=model) { return Asserts.success(model); @@ -136,7 +130,7 @@ public class TerminalGpsServiceImpl implements TerminalGpsService { @Override public ServiceBody getReturnedGPS(TerminalGpsVo vo) { - String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --clientid=10 --act=gpsinfo --cmdid="+vo.getCmdId()+ "\t" +"--reqid="+ Constants.REQUEST_ID; + String cmd = Constants.CMD+"gpsinfo --cmdid="+vo.getCmdId()+ "\t" +"--clientid=10 --reqid="+ Constants.REQUEST_ID; ProcessExecUtils.exec(cmd); return Asserts.success(Constants.REQUEST_ID.addAndGet(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 c5dd62e..ba553bf 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 @@ -289,7 +289,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService { public ServiceBody getLatestPhoto(TerminalPhotoVo vo) { /* Cma cma = new Cma(server, port);*/ DateTime now = DateTime.now(); - String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --act=capture --cmdid=" + vo.getCmdid() + "\t" + "--channel=" + vo.getChannel() + "\t" + "--preset=255 --type=" + vo.getCaptureType(); + String cmd =Constants.CMD+"capture --cmdid=" + vo.getCmdid() + "\t" + "--channel=" + vo.getChannel() + "\t" + "--preset=255 --type=" + vo.getCaptureType(); ProcessExecUtils.exec(cmd); /* Boolean hasNew = cma.requestCapture(vo.getCmdid(), vo.getChannel(), vo.getPreset(), vo.getCaptureType());*/ return Asserts.success(now); @@ -404,7 +404,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService { span1 = (short) 0; span2 = span; } - String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --act=schedule --cmdid=" + dtoList.get(j).getCmid() + "\t" + "--channel=" + vo.getChannel() + "\t" + String cmd = Constants.CMD+"schedule --cmdid=" + dtoList.get(j).getCmid() + "\t" + "--channel=" + vo.getChannel() + "\t" + "--group=3 --hour1=" + startHour + "\t" + "--min1=" + startMin + "\t" + "--preset1=255 --hour2=" + endTimeHour + "\t" + "--min2=" + endTimeMin + "\t" + "--preset2=255 --hour3=" + span1 + "\t" + "--min3=" + span2 + "\t" + "--preset3=255"; ProcessExecUtils.exec(cmd); @@ -414,9 +414,9 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService { } @Override - public ServiceBody getPhotoQueryParam(ReturnedPhotoParamsGetVo vo) { - TerminalStatusGetModel model = new TerminalStatusGetModel(); - String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --act=imgparams --cmdid=" + vo.getCmdId() + "\t" + "--clientid=10 --reqid=" + Constants.REQUEST_ID + "\t" + "--flag=0 --rf=7 --channel=" + vo.getChannelId(); + public ServiceBody getPhotoQueryParam(ReturnedPhotoParamsGetVo vo) { + GetModel model = new GetModel(); + String cmd = Constants.CMD+"act=imgparams --cmdid=" + vo.getCmdId() + "\t" + "--clientid=10 --reqid=" + Constants.REQUEST_ID + "\t" + "--flag=0 --rf=7 --channel=" + vo.getChannelId(); ProcessExecUtils.exec(cmd); model.setRequestId(Integer.parseInt(Constants.REQUEST_ID.toString())); Constants.REQUEST_ID.addAndGet(1); @@ -430,7 +430,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService { @Override public ServiceBody addOrUpdatePhotoParams(PhotoParamsVo vo) { - String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --act=imgparams --clientid=10 --cmdid=" + vo.getCmdId() + "\t" + "--color=" + vo.getColor() + "\t" + "--resolution=" + vo.getResolution() + "\t" + String cmd = Constants.CMD+"imgparams --clientid=10 --cmdid=" + vo.getCmdId() + "\t" + "--color=" + vo.getColor() + "\t" + "--resolution=" + vo.getResolution() + "\t" + "--luminance=" + vo.getLuminance() + "\t" + "-contrast=" + vo.getContrast() + "\t" + "--saturation=" + vo.getSaturation() + "\t" + "--channel=" + vo.getChannelId(); ProcessExecUtils.exec(cmd); return Asserts.success("设置成功"); @@ -484,9 +484,9 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService { } @Override - public ServiceBody selectPhotoTimeGet(TerminalPhotoTimeGetVo vo) { - CmaBackModel model = new CmaBackModel(); - String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --act=schedule --cmdid=" + vo.getCmdId() + "\t" + "--reqid=" + Constants.REQUEST_ID + "\t" + "--clientid=10 --flag=0 --rf=7 --channel=" + vo.getChannel(); + public ServiceBody selectPhotoTimeGet(TerminalPhotoTimeGetVo vo) { + GetModel model = new GetModel(); + String cmd = Constants.CMD+"schedule --cmdid=" + vo.getCmdId() + "\t" + "--reqid=" + Constants.REQUEST_ID + "\t" + "--clientid=10 --flag=0 --rf=7 --channel=" + vo.getChannel(); ProcessExecUtils.exec(cmd); Integer requestId = Integer.parseInt(Constants.REQUEST_ID.toString()); model.setRequestId(requestId); diff --git a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalServiceImpl.java b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalServiceImpl.java index b3d695e..590739b 100644 --- a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalServiceImpl.java +++ b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalServiceImpl.java @@ -9,7 +9,6 @@ import com.github.pagehelper.PageInfo; import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.constant.Constants; import com.shxy.xymanager_common.dto.DyLineAndTerminalNoHeartDto; -import com.shxy.xymanager_common.dto.PhotoParamsDto; import com.shxy.xymanager_common.dto.TerminalInfoDto; import com.shxy.xymanager_common.dto.TerminalsAndLineAndChannelDto; import com.shxy.xymanager_common.entity.TerminalChannelMapper; @@ -192,7 +191,7 @@ public class TerminalServiceImpl implements TerminalService { @Override public ServiceBody resetTerminal(String cmId) { // Cma cma = new Cma("47.96.238.157", 6891); - String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --act=reset --cmdid=" + cmId + "\t" + "--mode=0"; + String cmd = Constants.CMD+"reset --cmdid=" + cmId + "\t" + "--mode=0"; Integer retCode = ProcessExecUtils.exec(cmd); // boolean reset = cma.reset(vo.getTermid().toString(), (short) 0x01); if (retCode == 0) { @@ -207,7 +206,7 @@ public class TerminalServiceImpl implements TerminalService { public ServiceBody getTerminalStatus(Integer termId) { TerminalStatusModel model = new TerminalStatusModel(); String cmdId = terminalsDao.getCmdIdByTermId(termId); - String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --flag=0 --act=runningstatus --cmdid=" + cmdId; + String cmd = Constants.CMD+"runningstatus --flag=0 --cmdid=" + cmdId; ProcessExecUtils.exec(cmd); /* TerminalModel model = new TerminalModel();*/ @@ -253,11 +252,9 @@ public class TerminalServiceImpl implements TerminalService { @Override public ServiceBody updateTerminalId(TerminalIdUpdateVo vo) { TerminalUpdateModel model = new TerminalUpdateModel(); - String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --act=termid --cmdid=" + vo.getCmdId() + "\t" + "--newcmdid=" + vo.getNewCmdId() ; + String cmd = Constants.CMD+"termid --cmdid=" + vo.getCmdId() + "\t" + "--newcmdid=" + vo.getNewCmdId() ; Integer retCode = ProcessExecUtils.exec(cmd); - model.setRequestId(Integer.parseInt(Constants.REQUEST_ID.toString())); model.setTermId(vo.getTermId()); - Constants.REQUEST_ID.addAndGet(1); if (retCode == 0) { int result = terminalsDao.updateCmd(vo); if (result > 0) { @@ -290,10 +287,10 @@ public class TerminalServiceImpl implements TerminalService { } @Override - public ServiceBody terminalIdGet(TerminalIdUpdateVo vo) { - String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --clientid=10 --act=termid --cmdid=" + vo.getCmdId() + "\t" + "--reqid=" + Constants.REQUEST_ID; + public ServiceBody terminalIdGet(TerminalIdUpdateVo vo) { + String cmd = Constants.CMD+"termid --clientid=10 flag=0 --cmdid=" + vo.getCmdId() + "\t" + "--reqid=" + Constants.REQUEST_ID; ProcessExecUtils.exec(cmd); - TerminalIdGetModel model = new TerminalIdGetModel(); + GetModel model = new GetModel(); model.setRequestId(Integer.parseInt(Constants.REQUEST_ID.toString())); Constants.REQUEST_ID.addAndGet(1); return Asserts.success(model); diff --git a/xymanager_service/src/main/java/com/shxy/xymanager_service/service/SystemConfigService.java b/xymanager_service/src/main/java/com/shxy/xymanager_service/service/SystemConfigService.java index 5472a5d..cad042b 100644 --- a/xymanager_service/src/main/java/com/shxy/xymanager_service/service/SystemConfigService.java +++ b/xymanager_service/src/main/java/com/shxy/xymanager_service/service/SystemConfigService.java @@ -1,13 +1,12 @@ package com.shxy.xymanager_service.service; import com.shxy.xymanager_common.bean.ServiceBody; -import com.shxy.xymanager_common.model.CmaBackModel; +import com.shxy.xymanager_common.model.GetModel; import com.shxy.xymanager_common.model.SystemConfigModel; import com.shxy.xymanager_common.model.UpperComputerInfoModel; import com.shxy.xymanager_common.vo.SystemConfigReqVo; import com.shxy.xymanager_common.vo.SystemConfigVo; import com.shxy.xymanager_common.vo.TerminalUpperComputerVo; -import org.springframework.web.multipart.MultipartFile; /** * @@ -21,7 +20,7 @@ public interface SystemConfigService { * * @return */ - ServiceBody getSystemConfig(String id); + ServiceBody getSystemConfig(String id); /** @@ -39,7 +38,7 @@ public interface SystemConfigService { * * @return */ - ServiceBody upperComputerGet(String cmdId); + ServiceBody upperComputerGet(String cmdId); ServiceBody getUpperComputerInfo(TerminalUpperComputerVo vo); diff --git a/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TerminalPhotoService.java b/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TerminalPhotoService.java index 62e4450..83e4ac1 100644 --- a/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TerminalPhotoService.java +++ b/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TerminalPhotoService.java @@ -69,7 +69,7 @@ public interface TerminalPhotoService { * * @return */ - ServiceBody getPhotoQueryParam(ReturnedPhotoParamsGetVo vo); + ServiceBody getPhotoQueryParam(ReturnedPhotoParamsGetVo vo); ServiceBody addOrUpdatePhotoParams(PhotoParamsVo vo); @@ -78,7 +78,7 @@ public interface TerminalPhotoService { ServiceBody selectPhotoTime(TerminalReqPhotoTimeVo vo); - ServiceBody selectPhotoTimeGet(TerminalPhotoTimeGetVo vo); + ServiceBody selectPhotoTimeGet(TerminalPhotoTimeGetVo vo); diff --git a/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TerminalService.java b/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TerminalService.java index c16f6ac..07b4246 100644 --- a/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TerminalService.java +++ b/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TerminalService.java @@ -75,7 +75,7 @@ public interface TerminalService { * @param vo * @return */ - ServiceBody terminalIdGet(TerminalIdUpdateVo vo); + ServiceBody terminalIdGet(TerminalIdUpdateVo vo); /** * 根据请求ID查询装置ID