Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
SmdBox
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit d44fb8fe
由
zshaohui
编写于
2022-09-19 16:20:16 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
优化指令操作
1 个父辈
f06b450c
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
7 行增加
和
3 行删除
myproject/src/main/java/com/myproject/webapp/controller/CommandController.java
myproject/src/main/java/com/myproject/webapp/controller/CommandController.java
查看文件 @
d44fb8f
...
...
@@ -8,12 +8,16 @@ import com.myproject.webapp.controller.webService.StorageDataController;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
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.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Map
;
@RequestMapping
(
"/smf/rest/api"
)
@RestController
public
class
CommandController
{
@Autowired
private
ITaskService
taskService
;
...
...
@@ -25,7 +29,7 @@ public class CommandController {
* @param command
* @return
*/
@RequestMapping
(
value
=
"/opDeviceIo"
)
@RequestMapping
(
value
=
"/opDeviceIo"
,
method
=
RequestMethod
.
POST
)
public
ResultBean
opDeviceIo
(
@RequestBody
Command
command
)
{
String
cid
=
command
.
getCid
();
String
name
=
command
.
getName
();
...
...
@@ -33,7 +37,7 @@ public class CommandController {
log
.
info
(
"{}收到数据为:{}"
,
"opDeviceIo"
,
cid
+
"--"
+
"--"
+
name
+
"--"
+
value
);
if
(
"NEED_EMPTY"
.
equals
(
name
)
||
"TAKE_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
=
""
;
if
(
value
==
0
)
{
...
...
@@ -51,7 +55,7 @@ public class CommandController {
* @param params
* @return
*/
@RequestMapping
(
value
=
"/getStatus"
)
@RequestMapping
(
value
=
"/getStatus"
,
method
=
RequestMethod
.
POST
)
public
ResultBean
getStatus
(
@RequestBody
Map
<
String
,
String
>
params
)
{
String
cid
=
params
.
get
(
"cid"
);
String
name
=
params
.
get
(
"name"
);
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论