Merge remote-tracking branch 'origin/master'
commit
b830b60d34
@ -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,18 @@
|
|||||||
|
package com.shxy.xymanager_common.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DyLineAndTerminalWithHeartDto {
|
||||||
|
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private Integer dyValue;
|
||||||
|
|
||||||
|
private List<LineAndTerminalWithHeartDto> list;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.shxy.xymanager_common.dto;
|
||||||
|
|
||||||
|
import com.shxy.xymanager_common.entity.Terminals;
|
||||||
|
import com.shxy.xymanager_common.entity.TerminalsWithHeart;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class LineAndTerminalWithHeartDto {
|
||||||
|
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private String bsManufacturer;
|
||||||
|
|
||||||
|
private Integer dyLevel;
|
||||||
|
|
||||||
|
private List<TerminalsWithHeart> list;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
package com.shxy.xymanager_common.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TerminalsWithHeart implements Serializable {
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private Integer lineid;
|
||||||
|
|
||||||
|
private Integer towerid;
|
||||||
|
|
||||||
|
private String cmdid;
|
||||||
|
|
||||||
|
private Short orgId;
|
||||||
|
|
||||||
|
private String equipName;
|
||||||
|
|
||||||
|
private String displayName;
|
||||||
|
|
||||||
|
private String model;
|
||||||
|
|
||||||
|
private String essentialInfoVersion;
|
||||||
|
|
||||||
|
private Byte hasPan;
|
||||||
|
|
||||||
|
private String bsManufacturer;
|
||||||
|
|
||||||
|
private Date bsProductionDate;
|
||||||
|
|
||||||
|
private String bsIdentifier;
|
||||||
|
|
||||||
|
private Double latitude;
|
||||||
|
|
||||||
|
private Double longitude;
|
||||||
|
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
private Long lastheartbeat;
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.shxy.xymanager_common.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "通道编号对象", description = "通道编号对象")
|
||||||
|
public class TerminalChannelIdVo {
|
||||||
|
@NotNull(message = "通道编号不能缺少")
|
||||||
|
@ApiModelProperty(value = "通道编号", example = "123")
|
||||||
|
private Integer id;
|
||||||
|
}
|
@ -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