Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
glinfo-api
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
林业通
glinfo-api
Commits
e5f6ff87
提交
e5f6ff87
authored
2月 21, 2022
作者:
linzhenjie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
净化器解析类调整
上级
9c7f7f34
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
2 行增加
和
23 行删除
+2
-23
FilterParse.java
...c/main/java/tech/glinfo/enbao/modules/mq/FilterParse.java
+1
-19
MqConsumer.java
...rc/main/java/tech/glinfo/enbao/modules/mq/MqConsumer.java
+1
-1
OtherShDeviceServiceImpl.java
...bao/modules/sh/service/impl/OtherShDeviceServiceImpl.java
+0
-3
没有找到文件。
appapi/src/main/java/tech/glinfo/enbao/modules/mq/FilterParse.java
浏览文件 @
e5f6ff87
...
@@ -2,18 +2,14 @@ package tech.glinfo.enbao.modules.mq;
...
@@ -2,18 +2,14 @@ package tech.glinfo.enbao.modules.mq;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
org.json.JSONObject
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
tech.glinfo.enbao.common.contants.Constants
;
import
tech.glinfo.enbao.common.utils.ByteUtils
;
import
tech.glinfo.enbao.common.utils.ByteUtils
;
import
tech.glinfo.enbao.common.utils.DateUtils
;
import
tech.glinfo.enbao.common.utils.DateUtils
;
import
tech.glinfo.enbao.common.utils.RedisUtils
;
import
tech.glinfo.enbao.common.utils.RedisUtils
;
import
tech.glinfo.enbao.common.utils.StringUtils
;
import
tech.glinfo.enbao.common.utils.StringUtils
;
import
tech.glinfo.enbao.modules.sh.entity.ShDeviceDataEntity
;
import
tech.glinfo.enbao.modules.sh.entity.ShDeviceEntity
;
import
tech.glinfo.enbao.modules.sh.entity.ShDeviceEntity
;
import
tech.glinfo.enbao.modules.sh.entity.ShInstructionParsingEntity
;
import
tech.glinfo.enbao.modules.sh.entity.ShInstructionParsingEntity
;
import
tech.glinfo.enbao.modules.sh.form.ProtocolContent
;
import
tech.glinfo.enbao.modules.sh.form.ProtocolContent
;
...
@@ -37,9 +33,6 @@ public class FilterParse implements IParse {
...
@@ -37,9 +33,6 @@ public class FilterParse implements IParse {
@Autowired
@Autowired
private
MqProducer
mqProducer
;
private
MqProducer
mqProducer
;
@Autowired
private
ShDeviceDataService
shDeviceDataService
;
@Override
@Override
public
Map
<
String
,
String
>
run
(
Object
o
,
Map
<
String
,
String
>
datas
)
{
public
Map
<
String
,
String
>
run
(
Object
o
,
Map
<
String
,
String
>
datas
)
{
ShDeviceEntity
device
=
(
ShDeviceEntity
)
o
;
ShDeviceEntity
device
=
(
ShDeviceEntity
)
o
;
...
@@ -76,22 +69,11 @@ public class FilterParse implements IParse {
...
@@ -76,22 +69,11 @@ public class FilterParse implements IParse {
ws
.
put
(
cmd
.
getName
(),
hex1
);
ws
.
put
(
cmd
.
getName
(),
hex1
);
length
+=
cmd
.
getLength
();
length
+=
cmd
.
getLength
();
}
}
//@TODO
由于当前设备没有上报灯光状态用updateFilterDeviceData,上报之后请切换到updateDeviceData
//@TODO
目前设备没有上传灯光状态
otherShDeviceService
.
updateFilterDeviceData
(
map
,
device
.
getId
());
otherShDeviceService
.
updateFilterDeviceData
(
map
,
device
.
getId
());
}
else
{
}
else
{
ws
=
datas
;
ws
=
datas
;
}
}
}
else
if
(
"84"
.
equals
(
cmd1
))
{
//设备使用期限
redisUtils
.
set
(
Constants
.
FILTER_UES_TIME
+
device
.
getNumbering
(),
datas
.
get
(
"content"
),
300
);
}
else
if
(
"93"
.
equals
(
cmd1
)
||
"95"
.
equals
(
cmd1
))
{
if
(
"95"
.
equals
(
cmd1
))
{
//灯光控制有问题
ShDeviceDataEntity
entity
=
shDeviceDataService
.
getOne
(
new
QueryWrapper
<
ShDeviceDataEntity
>().
eq
(
"device_id"
,
device
.
getId
()));
JSONObject
jsonObj
=
new
JSONObject
(
entity
.
getValue
());
String
light
=
jsonObj
.
has
(
"light"
)?
jsonObj
.
getString
(
"light"
):
"0"
;
jsonObj
.
put
(
"light"
,
light
.
equals
(
"0"
)?
"1"
:
"0"
);
entity
.
setValue
(
jsonObj
.
toString
());
shDeviceDataService
.
updateById
(
entity
);
}
}
else
{
}
else
{
ws
=
datas
;
ws
=
datas
;
}
}
...
...
appapi/src/main/java/tech/glinfo/enbao/modules/mq/MqConsumer.java
浏览文件 @
e5f6ff87
...
@@ -87,7 +87,7 @@ public class MqConsumer {
...
@@ -87,7 +87,7 @@ public class MqConsumer {
*/
*/
@JmsListener
(
destination
=
AppContants
.
SOCKETIO_TOPIC
,
containerFactory
=
"jmsListenerContainerTopic"
)
@JmsListener
(
destination
=
AppContants
.
SOCKETIO_TOPIC
,
containerFactory
=
"jmsListenerContainerTopic"
)
public
void
socketioTopic
(
String
message
)
{
public
void
socketioTopic
(
String
message
)
{
logger
.
info
(
"报文为:{},主题:{}"
,
message
,
AppContants
.
SOCKETIO_TOPIC
);
logger
.
info
(
"
socketio
报文为:{},主题:{}"
,
message
,
AppContants
.
SOCKETIO_TOPIC
);
try
{
try
{
Map
<
String
,
String
>
datas
=
(
Map
<
String
,
String
>)
JSON
.
parse
(
message
);
Map
<
String
,
String
>
datas
=
(
Map
<
String
,
String
>)
JSON
.
parse
(
message
);
socketIOService
.
pushMessageToDevice
(
datas
.
get
(
"deviceId"
),
message
);
socketIOService
.
pushMessageToDevice
(
datas
.
get
(
"deviceId"
),
message
);
...
...
appapi/src/main/java/tech/glinfo/enbao/modules/sh/service/impl/OtherShDeviceServiceImpl.java
浏览文件 @
e5f6ff87
...
@@ -139,13 +139,10 @@ public class OtherShDeviceServiceImpl extends ServiceImpl<OtherShDeviceDao, ShDe
...
@@ -139,13 +139,10 @@ public class OtherShDeviceServiceImpl extends ServiceImpl<OtherShDeviceDao, ShDe
ShDeviceDataEntity
dataEntity
=
new
ShDeviceDataEntity
();
ShDeviceDataEntity
dataEntity
=
new
ShDeviceDataEntity
();
dataEntity
.
setDeviceId
(
deviceId
);
dataEntity
.
setDeviceId
(
deviceId
);
if
(
entity
==
null
)
{
if
(
entity
==
null
)
{
map
.
put
(
"light"
,
"0"
);
dataEntity
.
setValue
(
JSON
.
toJSONString
(
map
));
dataEntity
.
setValue
(
JSON
.
toJSONString
(
map
));
shDeviceDataService
.
save
(
dataEntity
);
shDeviceDataService
.
save
(
dataEntity
);
}
else
{
}
else
{
dataEntity
.
setId
(
entity
.
getId
());
dataEntity
.
setId
(
entity
.
getId
());
JSONObject
jsonObj
=
new
JSONObject
(
entity
.
getValue
());
map
.
put
(
"light"
,
jsonObj
.
has
(
"light"
)?
jsonObj
.
getString
(
"light"
):
"0"
);
dataEntity
.
setValue
(
JSON
.
toJSONString
(
map
));
dataEntity
.
setValue
(
JSON
.
toJSONString
(
map
));
shDeviceDataService
.
updateById
(
dataEntity
);
shDeviceDataService
.
updateById
(
dataEntity
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论