#20230510 欣影管理平台装置信息查询代码

jni
18616268358 2 years ago
parent 67b3a73998
commit 387926551a

@ -5,7 +5,7 @@ import com.shxy.xymanager_common.base.BaseController;
import com.shxy.xymanager_common.base.ResponseReult; import com.shxy.xymanager_common.base.ResponseReult;
import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.bean.ServiceStatus; 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.SystemConfigModel;
import com.shxy.xymanager_common.model.UpperComputerInfoModel; import com.shxy.xymanager_common.model.UpperComputerInfoModel;
import com.shxy.xymanager_common.vo.SystemConfigReqVo; 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 = "请求路径没有或页面跳转路径不对")}) @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getSystemConfigGet") @RequestMapping("/getSystemConfigGet")
@Log(title = "获取全局配置触发接口", type = "查询") @Log(title = "获取全局配置触发接口", type = "查询")
public ResponseReult<CmaBackModel> getSystemConfigGet(@RequestParam("id") String id) { public ResponseReult<GetModel> getSystemConfigGet(@RequestParam("id") String id) {
ServiceBody<CmaBackModel> serviceBody = configService.getSystemConfig(id); ServiceBody<GetModel> serviceBody = configService.getSystemConfig(id);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) { if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData()); return ResponseReult.success(serviceBody.getData());
} else { } else {
@ -76,8 +76,8 @@ public class SystemConfigController extends BaseController {
@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("/upperComputerGet") @RequestMapping("/upperComputerGet")
@Log(title = "获取上位机信息触发", type = "查询") @Log(title = "获取上位机信息触发", type = "查询")
public ResponseReult<Integer> upperComputerGet(@RequestParam("cmdId") String cmdId) { public ResponseReult<GetModel> upperComputerGet(@RequestParam("cmdId") String cmdId) {
ServiceBody<Integer> serviceBody = configService.upperComputerGet(cmdId); ServiceBody<GetModel> serviceBody = configService.upperComputerGet(cmdId);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) { if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData()); return ResponseReult.success(serviceBody.getData());
} else { } else {

@ -134,8 +134,8 @@ public class TerminalController extends BaseController {
@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("/terminalIdGet") @RequestMapping("/terminalIdGet")
@Log(title = "图像装置ID查询触发", type = "修改") @Log(title = "图像装置ID查询触发", type = "修改")
public ResponseReult<TerminalIdGetModel> terminalIdGet(@RequestBody @Validated TerminalIdUpdateVo vo) { public ResponseReult<GetModel> terminalIdGet(@RequestBody @Validated TerminalIdUpdateVo vo) {
ServiceBody<TerminalIdGetModel> serviceBody = terminalService.terminalIdGet(vo); ServiceBody<GetModel> serviceBody = terminalService.terminalIdGet(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) { if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData()); return ResponseReult.success(serviceBody.getData());
} else { } else {

@ -76,8 +76,8 @@ public class TerminalPhotoController extends BaseController {
@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("/selectPhotoTimeGet") @RequestMapping("/selectPhotoTimeGet")
@Log(title = "拍照时间表查询触发", type = "查询") @Log(title = "拍照时间表查询触发", type = "查询")
public ResponseReult<CmaBackModel> selectPhotoTimeGet(@RequestBody @Validated TerminalPhotoTimeGetVo vo) { public ResponseReult<GetModel> selectPhotoTimeGet(@RequestBody @Validated TerminalPhotoTimeGetVo vo) {
ServiceBody<CmaBackModel> serviceBody = terminalPhotoService.selectPhotoTimeGet(vo); ServiceBody<GetModel> serviceBody = terminalPhotoService.selectPhotoTimeGet(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) { if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData()); return ResponseReult.success(serviceBody.getData());
} else { } else {
@ -155,8 +155,8 @@ public class TerminalPhotoController extends BaseController {
@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("/getPhotoQueryParamList") @RequestMapping("/getPhotoQueryParamList")
@Log(title = "最新图片采集参数触发", type = "查询") @Log(title = "最新图片采集参数触发", type = "查询")
public ResponseReult<TerminalStatusGetModel> getPhotoQueryParamList(@RequestBody @Validated ReturnedPhotoParamsGetVo vo) { public ResponseReult<GetModel> getPhotoQueryParamList(@RequestBody @Validated ReturnedPhotoParamsGetVo vo) {
ServiceBody<TerminalStatusGetModel> serviceBody = terminalPhotoService.getPhotoQueryParam(vo); ServiceBody<GetModel> serviceBody = terminalPhotoService.getPhotoQueryParam(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) { if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData()); return ResponseReult.success(serviceBody.getData());
} else { } else {

@ -1,6 +1,8 @@
package com.shxy.xymanager_common.constant; package com.shxy.xymanager_common.constant;
import org.springframework.beans.factory.annotation.Value;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
/** /**
@ -10,6 +12,14 @@ import java.util.concurrent.atomic.AtomicInteger;
*/ */
public class Constants public class Constants
{ {
@Value("${cma.server}")
private static String server;
@Value("${cma.port}")
private static int port;
/** /**
* UTF-8 * UTF-8
*/ */
@ -165,4 +175,7 @@ public class Constants
* JNIID * JNIID
*/ */
public static AtomicInteger REQUEST_ID = new AtomicInteger((int) (System.currentTimeMillis()/1000)); 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=";
} }

@ -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;
}

@ -10,8 +10,8 @@ import java.io.Serializable;
* ID * ID
*/ */
@Data @Data
@ApiModel(value = "设备ID触发查询信息", description = "获取设备ID触发查询信息") @ApiModel(value = "触发查询信息", description = "触发查询信息")
public class TerminalIdGetModel implements Serializable { public class GetModel implements Serializable {
@ApiModelProperty(value = "请求ID", example = "123456") @ApiModelProperty(value = "请求ID", example = "123456")
private Integer requestId; private Integer requestId;

@ -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;
}

@ -17,7 +17,4 @@ public class TerminalIdVo {
@ApiModelProperty(value = "图像监测装置 ID", example = "123455") @ApiModelProperty(value = "图像监测装置 ID", example = "123455")
private String cmdId; private String cmdId;
@ApiModelProperty(value = "请求 ID", example = "123455")
private Integer requestId;
} }

@ -7,10 +7,7 @@ import com.shxy.xymanager_common.dto.PhotoParamsDto;
import com.shxy.xymanager_common.dto.UpperComputerInfoDto; 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.CmaBackModel; import com.shxy.xymanager_common.model.*;
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.util.ProcessExecUtils; import com.shxy.xymanager_common.util.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;
@ -40,14 +37,14 @@ public class SystemConfigServiceImpl implements SystemConfigService {
@Override @Override
public ServiceBody<CmaBackModel> getSystemConfig(String cmdId) { public ServiceBody<GetModel> getSystemConfig(String cmdId) {
/* SystemConfigModel model = new SystemConfigModel(); /* SystemConfigModel model = new SystemConfigModel();
Integer beatHeartTime = systemConfigDao.getTerminalParams(id); Integer beatHeartTime = systemConfigDao.getTerminalParams(id);
model.setHeartBeatTime(beatHeartTime); model.setHeartBeatTime(beatHeartTime);
String globalTime = systemConfigDao.getGlobalTime(Constants.GLOBAL_TIME); String globalTime = systemConfigDao.getGlobalTime(Constants.GLOBAL_TIME);
model.setGlobalTime(Integer.parseInt(globalTime));*/ model.setGlobalTime(Integer.parseInt(globalTime));*/
CmaBackModel model = new CmaBackModel(); GetModel model = new GetModel();
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; String cmd = Constants.CMD+"sampling --clientid=10 --flag=0 --cmdid="+cmdId+ "\t"+"--reqid="+Constants.REQUEST_ID;
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
model.setRequestId(Integer.parseInt(Constants.REQUEST_ID.toString())); model.setRequestId(Integer.parseInt(Constants.REQUEST_ID.toString()));
Constants.REQUEST_ID.addAndGet(1); Constants.REQUEST_ID.addAndGet(1);
@ -61,7 +58,7 @@ public class SystemConfigServiceImpl implements SystemConfigService {
param.setHeartbeatTime(vo.getHeartBeatTime()); param.setHeartbeatTime(vo.getHeartBeatTime());
systemConfigDao.updateSystemConfig(param); 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); ProcessExecUtils.exec(cmd);
return Asserts.success("修改成功"); return Asserts.success("修改成功");
} }
@ -82,11 +79,13 @@ public class SystemConfigServiceImpl implements SystemConfigService {
} }
@Override @Override
public ServiceBody<Integer> upperComputerGet(String cmdId) { public ServiceBody<GetModel> 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; GetModel model = new GetModel();
String cmd = Constants.CMD+"cma --clientid=10 --flag=0 --cmdid="+cmdId+ "\t"+"--reqid="+Constants.REQUEST_ID;
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
model.setRequestId(Integer.parseInt( Constants.REQUEST_ID.toString()));
Constants.REQUEST_ID.addAndGet(1); Constants.REQUEST_ID.addAndGet(1);
return Asserts.success(Integer.parseInt(Constants.REQUEST_ID.toString())); return Asserts.success(model);
} }
@Override @Override

@ -34,14 +34,14 @@ public class TermSetServiceImpl implements TermSetService {
@Override @Override
public ServiceBody<Integer> alarmMark(TerminalIdVo vo) { public ServiceBody<Integer> 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); ProcessExecUtils.exec(cmd);
return Asserts.success(Integer.parseInt(Constants.REQUEST_ID.toString())); return Asserts.success(Integer.parseInt(Constants.REQUEST_ID.toString()));
} }
@Override @Override
public ServiceBody<Integer> selectPhotoTimeGet(TerminalIdVo vo) { public ServiceBody<Integer> 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); ProcessExecUtils.exec(cmd);
return Asserts.success(Integer.parseInt(Constants.REQUEST_ID.toString())); return Asserts.success(Integer.parseInt(Constants.REQUEST_ID.toString()));
} }

@ -79,7 +79,7 @@ public class TerminalGpsServiceImpl implements TerminalGpsService {
} else { } else {
status = CommonStatus.DELETE.value(); 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); ProcessExecUtils.exec(cmd);
if (set) { if (set) {
TerminalStatus record = new TerminalStatus(); TerminalStatus record = new TerminalStatus();
@ -107,11 +107,8 @@ public class TerminalGpsServiceImpl implements TerminalGpsService {
TerminalGpsModel model = new TerminalGpsModel(); TerminalGpsModel model = new TerminalGpsModel();
// Cma cma = new Cma("47.96.238.157", 6891); // Cma cma = new Cma("47.96.238.157", 6891);
// boolean b = cma.requestGpsInfo(vo.getTermid().toString()); // boolean b = cma.requestGpsInfo(vo.getTermid().toString());
String result = terminalPhotoDao.getRequestResult(5);//待修改
DateTime now = DateTime.now(); DateTime now = DateTime.now();
if(StringUtils.isNotBlank(result)) {
model = JSONObject.parseObject(result, TerminalGpsModel.class);
}else {
TerminalPositions bean = terminalPositionsDao.selectByPrimaryKey(vo.getTermid()); TerminalPositions bean = terminalPositionsDao.selectByPrimaryKey(vo.getTermid());
if (!BeanUtil.isEmpty(bean)) { if (!BeanUtil.isEmpty(bean)) {
@ -123,9 +120,6 @@ public class TerminalGpsServiceImpl implements TerminalGpsService {
BigInteger updatetime = MyDateUtils.TimeSecond2MillSecond(bean.getUpdateTime().longValue()); BigInteger updatetime = MyDateUtils.TimeSecond2MillSecond(bean.getUpdateTime().longValue());
model.setUpdatetime(MyDateUtils.date(updatetime.longValue())); model.setUpdatetime(MyDateUtils.date(updatetime.longValue()));
} }
}
if (null!=model) { if (null!=model) {
return Asserts.success(model); return Asserts.success(model);
} else { } else {
@ -136,7 +130,7 @@ public class TerminalGpsServiceImpl implements TerminalGpsService {
@Override @Override
public ServiceBody<Integer> getReturnedGPS(TerminalGpsVo vo) { public ServiceBody<Integer> 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); ProcessExecUtils.exec(cmd);
return Asserts.success(Constants.REQUEST_ID.addAndGet(1)); return Asserts.success(Constants.REQUEST_ID.addAndGet(1));
} }

@ -289,7 +289,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
public ServiceBody<Date> getLatestPhoto(TerminalPhotoVo vo) { public ServiceBody<Date> getLatestPhoto(TerminalPhotoVo vo) {
/* Cma cma = new Cma(server, port);*/ /* Cma cma = new Cma(server, port);*/
DateTime now = DateTime.now(); 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); ProcessExecUtils.exec(cmd);
/* Boolean hasNew = cma.requestCapture(vo.getCmdid(), vo.getChannel(), vo.getPreset(), vo.getCaptureType());*/ /* Boolean hasNew = cma.requestCapture(vo.getCmdid(), vo.getChannel(), vo.getPreset(), vo.getCaptureType());*/
return Asserts.success(now); return Asserts.success(now);
@ -404,7 +404,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
span1 = (short) 0; span1 = (short) 0;
span2 = span; 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" + "--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"; + "--preset2=255 --hour3=" + span1 + "\t" + "--min3=" + span2 + "\t" + "--preset3=255";
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
@ -414,9 +414,9 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
} }
@Override @Override
public ServiceBody<TerminalStatusGetModel> getPhotoQueryParam(ReturnedPhotoParamsGetVo vo) { public ServiceBody<GetModel> getPhotoQueryParam(ReturnedPhotoParamsGetVo vo) {
TerminalStatusGetModel model = new TerminalStatusGetModel(); GetModel model = new GetModel();
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(); 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); ProcessExecUtils.exec(cmd);
model.setRequestId(Integer.parseInt(Constants.REQUEST_ID.toString())); model.setRequestId(Integer.parseInt(Constants.REQUEST_ID.toString()));
Constants.REQUEST_ID.addAndGet(1); Constants.REQUEST_ID.addAndGet(1);
@ -430,7 +430,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
@Override @Override
public ServiceBody<String> addOrUpdatePhotoParams(PhotoParamsVo vo) { public ServiceBody<String> 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(); + "--luminance=" + vo.getLuminance() + "\t" + "-contrast=" + vo.getContrast() + "\t" + "--saturation=" + vo.getSaturation() + "\t" + "--channel=" + vo.getChannelId();
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
return Asserts.success("设置成功"); return Asserts.success("设置成功");
@ -484,9 +484,9 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
} }
@Override @Override
public ServiceBody<CmaBackModel> selectPhotoTimeGet(TerminalPhotoTimeGetVo vo) { public ServiceBody<GetModel> selectPhotoTimeGet(TerminalPhotoTimeGetVo vo) {
CmaBackModel model = new CmaBackModel(); GetModel model = new GetModel();
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(); 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); ProcessExecUtils.exec(cmd);
Integer requestId = Integer.parseInt(Constants.REQUEST_ID.toString()); Integer requestId = Integer.parseInt(Constants.REQUEST_ID.toString());
model.setRequestId(requestId); model.setRequestId(requestId);

@ -9,7 +9,6 @@ import com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.bean.ServiceBody; 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.dto.DyLineAndTerminalNoHeartDto; 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.TerminalInfoDto;
import com.shxy.xymanager_common.dto.TerminalsAndLineAndChannelDto; import com.shxy.xymanager_common.dto.TerminalsAndLineAndChannelDto;
import com.shxy.xymanager_common.entity.TerminalChannelMapper; import com.shxy.xymanager_common.entity.TerminalChannelMapper;
@ -192,7 +191,7 @@ 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); // 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); Integer retCode = ProcessExecUtils.exec(cmd);
// boolean reset = cma.reset(vo.getTermid().toString(), (short) 0x01); // boolean reset = cma.reset(vo.getTermid().toString(), (short) 0x01);
if (retCode == 0) { if (retCode == 0) {
@ -207,7 +206,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 = "/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); ProcessExecUtils.exec(cmd);
/* TerminalModel model = new TerminalModel();*/ /* TerminalModel model = new TerminalModel();*/
@ -253,11 +252,9 @@ 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 = "/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); Integer retCode = ProcessExecUtils.exec(cmd);
model.setRequestId(Integer.parseInt(Constants.REQUEST_ID.toString()));
model.setTermId(vo.getTermId()); model.setTermId(vo.getTermId());
Constants.REQUEST_ID.addAndGet(1);
if (retCode == 0) { if (retCode == 0) {
int result = terminalsDao.updateCmd(vo); int result = terminalsDao.updateCmd(vo);
if (result > 0) { if (result > 0) {
@ -290,10 +287,10 @@ public class TerminalServiceImpl implements TerminalService {
} }
@Override @Override
public ServiceBody<TerminalIdGetModel> terminalIdGet(TerminalIdUpdateVo vo) { public ServiceBody<GetModel> 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; String cmd = Constants.CMD+"termid --clientid=10 flag=0 --cmdid=" + vo.getCmdId() + "\t" + "--reqid=" + Constants.REQUEST_ID;
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
TerminalIdGetModel model = new TerminalIdGetModel(); GetModel model = new GetModel();
model.setRequestId(Integer.parseInt(Constants.REQUEST_ID.toString())); model.setRequestId(Integer.parseInt(Constants.REQUEST_ID.toString()));
Constants.REQUEST_ID.addAndGet(1); Constants.REQUEST_ID.addAndGet(1);
return Asserts.success(model); return Asserts.success(model);

@ -1,13 +1,12 @@
package com.shxy.xymanager_service.service; package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody; 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.SystemConfigModel;
import com.shxy.xymanager_common.model.UpperComputerInfoModel; import com.shxy.xymanager_common.model.UpperComputerInfoModel;
import com.shxy.xymanager_common.vo.SystemConfigReqVo; import com.shxy.xymanager_common.vo.SystemConfigReqVo;
import com.shxy.xymanager_common.vo.SystemConfigVo; import com.shxy.xymanager_common.vo.SystemConfigVo;
import com.shxy.xymanager_common.vo.TerminalUpperComputerVo; import com.shxy.xymanager_common.vo.TerminalUpperComputerVo;
import org.springframework.web.multipart.MultipartFile;
/** /**
* *
@ -21,7 +20,7 @@ public interface SystemConfigService {
* *
* @return * @return
*/ */
ServiceBody<CmaBackModel> getSystemConfig(String id); ServiceBody<GetModel> getSystemConfig(String id);
/** /**
@ -39,7 +38,7 @@ public interface SystemConfigService {
* *
* @return * @return
*/ */
ServiceBody<Integer> upperComputerGet(String cmdId); ServiceBody<GetModel> upperComputerGet(String cmdId);
ServiceBody<UpperComputerInfoModel> getUpperComputerInfo(TerminalUpperComputerVo vo); ServiceBody<UpperComputerInfoModel> getUpperComputerInfo(TerminalUpperComputerVo vo);

@ -69,7 +69,7 @@ public interface TerminalPhotoService {
* *
* @return * @return
*/ */
ServiceBody<TerminalStatusGetModel> getPhotoQueryParam(ReturnedPhotoParamsGetVo vo); ServiceBody<GetModel> getPhotoQueryParam(ReturnedPhotoParamsGetVo vo);
ServiceBody<String> addOrUpdatePhotoParams(PhotoParamsVo vo); ServiceBody<String> addOrUpdatePhotoParams(PhotoParamsVo vo);
@ -78,7 +78,7 @@ public interface TerminalPhotoService {
ServiceBody<TerminalScheduleRuleTimeListModel> selectPhotoTime(TerminalReqPhotoTimeVo vo); ServiceBody<TerminalScheduleRuleTimeListModel> selectPhotoTime(TerminalReqPhotoTimeVo vo);
ServiceBody<CmaBackModel> selectPhotoTimeGet(TerminalPhotoTimeGetVo vo); ServiceBody<GetModel> selectPhotoTimeGet(TerminalPhotoTimeGetVo vo);

@ -75,7 +75,7 @@ public interface TerminalService {
* @param vo * @param vo
* @return * @return
*/ */
ServiceBody<TerminalIdGetModel> terminalIdGet(TerminalIdUpdateVo vo); ServiceBody<GetModel> terminalIdGet(TerminalIdUpdateVo vo);
/** /**
* IDID * IDID

Loading…
Cancel
Save