装置设置
parent
82c8f568bb
commit
b680dace0f
@ -0,0 +1,47 @@
|
|||||||
|
package com.shxy.xymanager_admin.controller;
|
||||||
|
|
||||||
|
import com.shxy.xymanager_common.annotation.Log;
|
||||||
|
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.DyLineTreeAndChannelListModel;
|
||||||
|
import com.shxy.xymanager_common.model.TerminalAllChannelListModel;
|
||||||
|
import com.shxy.xymanager_common.model.TerminalChannelListModel;
|
||||||
|
import com.shxy.xymanager_common.model.TerminalChannelMapperListModel;
|
||||||
|
import com.shxy.xymanager_common.vo.*;
|
||||||
|
import com.shxy.xymanager_service.service.TermSetService;
|
||||||
|
import com.shxy.xymanager_service.service.TerminalChannelService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiResponse;
|
||||||
|
import io.swagger.annotations.ApiResponses;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
|
||||||
|
@Api(value = "装置cma控制", tags = "装置cma控制")
|
||||||
|
@RestController
|
||||||
|
@Slf4j
|
||||||
|
public class TermSetController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
TermSetService termSetService;
|
||||||
|
|
||||||
|
@ApiOperation(value = "装置cma控制", notes = "装置cma控制", httpMethod = "POST")
|
||||||
|
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
|
||||||
|
@RequestMapping("/alarmMark")
|
||||||
|
@Log(title = "装置cma控制", type = "查询")
|
||||||
|
public ResponseReult<Integer> alarmMark(@RequestBody @Validated TerminalIdVo vo) {
|
||||||
|
ServiceBody<Integer> serviceBody = termSetService.alarmMark(vo);
|
||||||
|
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
|
||||||
|
return ResponseReult.success(serviceBody.getData());
|
||||||
|
} else {
|
||||||
|
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
package com.shxy.xymanager_service.impl;
|
||||||
|
|
||||||
|
import com.shxy.xymanager_common.bean.ServiceBody;
|
||||||
|
import com.shxy.xymanager_common.constant.Constants;
|
||||||
|
import com.shxy.xymanager_common.exception.Asserts;
|
||||||
|
import com.shxy.xymanager_common.util.ProcessExecUtils;
|
||||||
|
import com.shxy.xymanager_common.vo.TerminalIdVo;
|
||||||
|
import com.shxy.xymanager_common.vo.TerminalReqPhotoTimeVo;
|
||||||
|
import com.shxy.xymanager_service.service.TermSetService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装置通过Cma控制
|
||||||
|
*
|
||||||
|
* @author 晶晶
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class TermSetServiceImpl implements TermSetService {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
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";
|
||||||
|
ProcessExecUtils.exec(cmd);
|
||||||
|
return Asserts.success(Integer.parseInt(Constants.REQUEST_ID.toString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
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";
|
||||||
|
ProcessExecUtils.exec(cmd);
|
||||||
|
return Asserts.success(Integer.parseInt(Constants.REQUEST_ID.toString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.shxy.xymanager_service.service;
|
||||||
|
|
||||||
|
import com.shxy.xymanager_common.bean.ServiceBody;
|
||||||
|
import com.shxy.xymanager_common.model.DyLineTreeAndChannelListModel;
|
||||||
|
import com.shxy.xymanager_common.model.TerminalAllChannelListModel;
|
||||||
|
import com.shxy.xymanager_common.model.TerminalChannelListModel;
|
||||||
|
import com.shxy.xymanager_common.model.TerminalChannelMapperListModel;
|
||||||
|
import com.shxy.xymanager_common.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装置控制接口
|
||||||
|
*
|
||||||
|
* @author 晶晶
|
||||||
|
*/
|
||||||
|
public interface TermSetService {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 声光报警
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ServiceBody<Integer> alarmMark(TerminalIdVo vo);
|
||||||
|
|
||||||
|
ServiceBody<Integer> selectPhotoTimeGet(TerminalIdVo vo);
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue