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

jni
18616268358 2 years ago
parent 387926551a
commit 4fbef35acc

@ -5,6 +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.GetModel;
import com.shxy.xymanager_common.model.TerminalGpsModel; import com.shxy.xymanager_common.model.TerminalGpsModel;
import com.shxy.xymanager_common.vo.*; import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_service.service.TerminalGpsService; import com.shxy.xymanager_service.service.TerminalGpsService;
@ -59,8 +60,8 @@ public class TerminalGPSController 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("/getTermGPSPosition") @RequestMapping("/getTermGPSPosition")
@Log(title = "获取GPS位置触发", type = "查询") @Log(title = "获取GPS位置触发", type = "查询")
public ResponseReult<Integer> getReturnedTermGPS(@RequestBody @Validated TerminalGpsVo vo) { public ResponseReult<GetModel> getReturnedTermGPS(@RequestBody @Validated TerminalGpsVo vo) {
ServiceBody<Integer> serviceBody = terminalGpsService.getReturnedGPS(vo); ServiceBody<GetModel> serviceBody = terminalGpsService.getReturnedGPS(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) { if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData()); return ResponseReult.success(serviceBody.getData());
} else { } else {

@ -58,7 +58,7 @@ public class SystemConfigServiceImpl implements SystemConfigService {
param.setHeartbeatTime(vo.getHeartBeatTime()); param.setHeartbeatTime(vo.getHeartBeatTime());
systemConfigDao.updateSystemConfig(param); systemConfigDao.updateSystemConfig(param);
String cmd =Constants.CMD+"sampling --cmdid="+vo.getCmdId()+ "\t"+ "--heartbeat=" + vo.getHeartBeatTime(); String cmd =Constants.CMD+"sampling --flag =1 --cmdid="+vo.getCmdId()+ "\t"+ "--heartbeat=" + vo.getHeartBeatTime();
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
return Asserts.success("修改成功"); return Asserts.success("修改成功");
} }

@ -41,7 +41,7 @@ public class TermSetServiceImpl implements TermSetService {
@Override @Override
public ServiceBody<Integer> selectPhotoTimeGet(TerminalIdVo vo) { public ServiceBody<Integer> selectPhotoTimeGet(TerminalIdVo vo) {
String cmd = Constants.CMD+"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()));
} }

@ -14,10 +14,7 @@ import com.shxy.xymanager_common.entity.TerminalStatus;
import com.shxy.xymanager_common.entity.Terminals; import com.shxy.xymanager_common.entity.Terminals;
import com.shxy.xymanager_common.enums.CommonStatus; import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.exception.Asserts; import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.SystemConfigModel; import com.shxy.xymanager_common.model.*;
import com.shxy.xymanager_common.model.TerminalGpsModel;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.model.TerminalModel;
import com.shxy.xymanager_common.page.PageUtils; import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.util.MyDateUtils; import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_common.util.ProcessExecUtils; import com.shxy.xymanager_common.util.ProcessExecUtils;
@ -79,7 +76,7 @@ public class TerminalGpsServiceImpl implements TerminalGpsService {
} else { } else {
status = CommonStatus.DELETE.value(); status = CommonStatus.DELETE.value();
} }
String cmd = Constants.CMD+"gpsctrl --cmdid="+vo.getCmdId() +"\t" +"--ctrl="+ status; String cmd = Constants.CMD+"gpsctrl --flag=1 --cmdid="+vo.getCmdId() +"\t" +"--ctrl="+ status;
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
if (set) { if (set) {
TerminalStatus record = new TerminalStatus(); TerminalStatus record = new TerminalStatus();
@ -129,10 +126,13 @@ public class TerminalGpsServiceImpl implements TerminalGpsService {
} }
@Override @Override
public ServiceBody<Integer> getReturnedGPS(TerminalGpsVo vo) { public ServiceBody<GetModel> getReturnedGPS(TerminalGpsVo vo) {
String cmd = Constants.CMD+"gpsinfo --cmdid="+vo.getCmdId()+ "\t" +"--clientid=10 --reqid="+ Constants.REQUEST_ID; GetModel model = new GetModel();
String cmd = Constants.CMD+"gpsinfo --flag=0 --cmdid="+vo.getCmdId()+ "\t" +"--clientid=10 --reqid="+ Constants.REQUEST_ID;
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
return Asserts.success(Constants.REQUEST_ID.addAndGet(1)); model.setRequestId(Integer.parseInt(Constants.REQUEST_ID.toString()));
Constants.REQUEST_ID.addAndGet(1);
return Asserts.success(model);
} }
} }

@ -404,7 +404,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
span1 = (short) 0; span1 = (short) 0;
span2 = span; span2 = span;
} }
String cmd = Constants.CMD+"schedule --cmdid=" + dtoList.get(j).getCmid() + "\t" + "--channel=" + vo.getChannel() + "\t" String cmd = Constants.CMD+"schedule --flag=1 --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);
@ -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 = Constants.CMD+"imgparams --clientid=10 --cmdid=" + vo.getCmdId() + "\t" + "--color=" + vo.getColor() + "\t" + "--resolution=" + vo.getResolution() + "\t" String cmd = Constants.CMD+"imgparams --flag=1 --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("设置成功");

@ -191,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 = Constants.CMD+"reset --cmdid=" + cmId + "\t" + "--mode=0"; String cmd = Constants.CMD+"reset --flag=1 --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) {
@ -252,7 +252,7 @@ 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 = Constants.CMD+"termid --cmdid=" + vo.getCmdId() + "\t" + "--newcmdid=" + vo.getNewCmdId() ; String cmd = Constants.CMD+"termid --flag=1 --cmdid=" + vo.getCmdId() + "\t" + "--newcmdid=" + vo.getNewCmdId() ;
Integer retCode = ProcessExecUtils.exec(cmd); Integer retCode = ProcessExecUtils.exec(cmd);
model.setTermId(vo.getTermId()); model.setTermId(vo.getTermId());
if (retCode == 0) { if (retCode == 0) {
@ -288,7 +288,7 @@ public class TerminalServiceImpl implements TerminalService {
@Override @Override
public ServiceBody<GetModel> terminalIdGet(TerminalIdUpdateVo vo) { public ServiceBody<GetModel> terminalIdGet(TerminalIdUpdateVo vo) {
String cmd = Constants.CMD+"termid --clientid=10 flag=0 --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);
GetModel model = new GetModel(); GetModel model = new GetModel();
model.setRequestId(Integer.parseInt(Constants.REQUEST_ID.toString())); model.setRequestId(Integer.parseInt(Constants.REQUEST_ID.toString()));

@ -1,6 +1,7 @@
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.GetModel;
import com.shxy.xymanager_common.model.TerminalGpsModel; import com.shxy.xymanager_common.model.TerminalGpsModel;
import com.shxy.xymanager_common.vo.*; import com.shxy.xymanager_common.vo.*;
@ -26,6 +27,6 @@ public interface TerminalGpsService {
*/ */
ServiceBody<TerminalGpsModel> getTermGPS(TerminalIdVo vo); ServiceBody<TerminalGpsModel> getTermGPS(TerminalIdVo vo);
ServiceBody<Integer> getReturnedGPS(TerminalGpsVo vo); ServiceBody<GetModel> getReturnedGPS(TerminalGpsVo vo);
} }

Loading…
Cancel
Save