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