Commit d44fb8fe zshaohui

优化指令操作

1 个父辈 f06b450c
...@@ -8,12 +8,16 @@ import com.myproject.webapp.controller.webService.StorageDataController; ...@@ -8,12 +8,16 @@ import com.myproject.webapp.controller.webService.StorageDataController;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map; import java.util.Map;
@RequestMapping("/smf/rest/api") @RequestMapping("/smf/rest/api")
@RestController
public class CommandController { public class CommandController {
@Autowired @Autowired
private ITaskService taskService; private ITaskService taskService;
...@@ -25,7 +29,7 @@ public class CommandController { ...@@ -25,7 +29,7 @@ public class CommandController {
* @param command * @param command
* @return * @return
*/ */
@RequestMapping(value = "/opDeviceIo") @RequestMapping(value = "/opDeviceIo",method = RequestMethod.POST)
public ResultBean opDeviceIo(@RequestBody Command command) { public ResultBean opDeviceIo(@RequestBody Command command) {
String cid = command.getCid(); String cid = command.getCid();
String name = command.getName(); String name = command.getName();
...@@ -33,7 +37,7 @@ public class CommandController { ...@@ -33,7 +37,7 @@ public class CommandController {
log.info("{}收到数据为:{}", "opDeviceIo", cid + "--" + "--" + name + "--" + value); log.info("{}收到数据为:{}", "opDeviceIo", cid + "--" + "--" + name + "--" + value);
if ("NEED_EMPTY".equals(name) || "TAKE_STATUS".equals(name) if ("NEED_EMPTY".equals(name) || "TAKE_STATUS".equals(name)
|| "OUT_STATUS".equals(name) || "IN_STATUS".equals(name)) { || "OUT_STATUS".equals(name) || "IN_STATUS".equals(name)) {
return ResultBean.newErrorResult(-1,"No Implementation"); return ResultBean.newErrorResult(-1, "No Implementation");
} }
String opValue = ""; String opValue = "";
if (value == 0) { if (value == 0) {
...@@ -51,7 +55,7 @@ public class CommandController { ...@@ -51,7 +55,7 @@ public class CommandController {
* @param params * @param params
* @return * @return
*/ */
@RequestMapping(value = "/getStatus") @RequestMapping(value = "/getStatus",method = RequestMethod.POST)
public ResultBean getStatus(@RequestBody Map<String, String> params) { public ResultBean getStatus(@RequestBody Map<String, String> params) {
String cid = params.get("cid"); String cid = params.get("cid");
String name = params.get("name"); String name = params.get("name");
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!