package com.ld.igds.inout.controller;
|
|
import com.ld.igds.constant.RespCodeEnum;
|
import com.ld.igds.data.PageResponse;
|
import com.ld.igds.inout.manager.CheckManager;
|
import com.ld.igds.io.dto.CheckResultParam;
|
import com.ld.igds.io.sample.data.SampleDto;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.RestController;
|
|
/**
|
* 扦样机和化验接口
|
*
|
* @author: andy.jia
|
* @description:
|
* @version:
|
* @data:2020年3月22日
|
*
|
*/
|
@Slf4j
|
@RestController
|
@RequestMapping("api/check")
|
public class CheckController {
|
|
@Autowired
|
private CheckManager manager;
|
|
/**
|
*
|
* @param param
|
* 扦样机器信息
|
* @return
|
*/
|
@RequestMapping("/check-exe")
|
public @ResponseBody
|
PageResponse<String> checkExe(@RequestBody SampleDto param) {
|
|
if (null == param.getIp()) {
|
return new PageResponse<>(RespCodeEnum.CODE_1007.getCode(),
|
"扦样机信息配置不完整,请核查!!");
|
}
|
|
String result = manager.checkExe(param);
|
|
if (null != result) {
|
return new PageResponse<>(RespCodeEnum.CODE_1007.getCode(), result);
|
}
|
return new PageResponse<String>(RespCodeEnum.CODE_0000, "执行命令已经成功发送!!");
|
}
|
|
/**
|
*
|
* @param param
|
* 扦样机器信息
|
* @return
|
*/
|
@RequestMapping("/stop")
|
public @ResponseBody
|
PageResponse<String> stop(@RequestBody SampleDto param) {
|
|
if (null == param.getIp()) {
|
return new PageResponse<>(RespCodeEnum.CODE_1007.getCode(),
|
"扦样机信息配置不完整,请核查!!");
|
}
|
|
String result = manager.stop(param);
|
|
if (null != result) {
|
return new PageResponse<>(RespCodeEnum.CODE_1007.getCode(), result);
|
}
|
return new PageResponse<String>(RespCodeEnum.CODE_0000, "执行命令已经成功发送!!");
|
}
|
|
/**
|
*
|
* @param param
|
* 扦样机器信息
|
* @return
|
*/
|
@RequestMapping("/reset")
|
public @ResponseBody
|
PageResponse<String> reset(@RequestBody SampleDto param) {
|
|
if (null == param.getIp()) {
|
return new PageResponse<>(RespCodeEnum.CODE_1007.getCode(),
|
"扦样机信息配置不完整,请核查!!");
|
}
|
|
String result = manager.reset(param);
|
|
if (null != result) {
|
return new PageResponse<>(RespCodeEnum.CODE_1007.getCode(), result);
|
}
|
return new PageResponse<String>(RespCodeEnum.CODE_0000, "执行命令已经成功发送!!");
|
}
|
|
|
/**
|
*
|
* @param param
|
* 扦样机器急停复位
|
* @return
|
*/
|
@RequestMapping("/reset-stop")
|
public @ResponseBody
|
PageResponse<String> resetStop(@RequestBody SampleDto param) {
|
|
if (null == param.getIp()) {
|
return new PageResponse<>(RespCodeEnum.CODE_1007.getCode(),
|
"扦样机信息配置不完整,请核查!!");
|
}
|
|
String result = manager.resetStop(param);
|
|
if (null != result) {
|
return new PageResponse<>(RespCodeEnum.CODE_1007.getCode(), result);
|
}
|
return new PageResponse<String>(RespCodeEnum.CODE_0000, "执行命令已经成功发送!!");
|
}
|
|
}
|