liuguijing 2 years ago
commit 6b3ab20fc4

@ -13,4 +13,7 @@ public class TerminalIdAndGpsVo {
@ApiModelProperty(value = "开启关闭", example = "0--关闭 1--开启") @ApiModelProperty(value = "开启关闭", example = "0--关闭 1--开启")
private Integer gpsstatus; private Integer gpsstatus;
@ApiModelProperty(value = "图像监测装置 ID", example = "123455")
private Integer cmdId;
} }

@ -14,6 +14,7 @@ import com.shxy.xymanager_common.model.TerminalGpsModel;
import com.shxy.xymanager_common.model.TerminalListModel; import com.shxy.xymanager_common.model.TerminalListModel;
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.vo.*; import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.TerminalPositionsDao; import com.shxy.xymanager_dao.dao.TerminalPositionsDao;
import com.shxy.xymanager_dao.dao.TerminalStatusDao; import com.shxy.xymanager_dao.dao.TerminalStatusDao;
@ -62,12 +63,12 @@ public class TerminalGpsServiceImpl implements TerminalGpsService {
Integer status; Integer status;
Integer gpsstatus = vo.getGpsstatus(); Integer gpsstatus = vo.getGpsstatus();
if (gpsstatus == 0) { if (gpsstatus == 0) {
// set = cma.turnOnGps(vo.getTermid().toString());
status = CommonStatus.EFFECTIVE.value(); status = CommonStatus.EFFECTIVE.value();
} else { } else {
// set = cma.turnOffGps(vo.getTermid().toString());
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;
ProcessExecUtils.exec(cmd);
if (set) { if (set) {
TerminalStatus record = new TerminalStatus(); TerminalStatus record = new TerminalStatus();
record.setTermId(vo.getTermid()); record.setTermId(vo.getTermid());

@ -178,7 +178,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=47.96.238.157 --port=6891 --act=reset --cmdid=" +cmId +"\t"+"--mode=0"; String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --act=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) {

Loading…
Cancel
Save