Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 39a100ce
由
LN
编写于
2026-04-14 15:50:18 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
X800需要点Start开始处理入库料串
1 个父辈
51973a92
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
64 行增加
和
5 行删除
src/main/java/com/neotel/smfcore/core/equipment/handler/impl/BaseEquipHandler.java
src/main/java/com/neotel/smfcore/core/equipment/rest/EquipViewController.java
src/main/java/com/neotel/smfcore/core/system/util/EquipStatusUtil.java
src/main/java/com/neotel/smfcore/core/equipment/handler/impl/BaseEquipHandler.java
查看文件 @
39a100c
...
...
@@ -14,6 +14,8 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.stereotype.Service
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Map
;
@Service
@Slf4j
public
class
BaseEquipHandler
implements
IEquipmentHandler
{
...
...
@@ -90,6 +92,8 @@ public class BaseEquipHandler implements IEquipmentHandler {
EquipStatusUtil
.
updateStatusBean
(
statusBean
);
Map
<
String
,
String
>
addOP
=
EquipStatusUtil
.
getAndRemoveOp
(
statusBean
.
getCid
());
statusBean
.
addOp
(
addOP
);
DeviceStateDurationUtil
.
onEquipStatusUpdate
(
statusBean
);
}
catch
(
Exception
e
)
{
log
.
error
(
"客户端故障消息处理出错"
,
e
);
...
...
src/main/java/com/neotel/smfcore/core/equipment/rest/EquipViewController.java
查看文件 @
39a100c
package
com
.
neotel
.
smfcore
.
core
.
equipment
.
rest
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.google.common.base.Strings
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.equipment.enums.EquipmentType
;
...
...
@@ -11,11 +13,7 @@ import com.neotel.smfcore.core.equipment.service.po.Equipment;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
com.neotel.smfcore.core.system.bean.MesInfoDto
;
import
com.neotel.smfcore.core.system.util.EquipStatusUtil
;
//import com.neotel.smfcore.custom.hanwha.handler.TMSCommunicator;
//import com.neotel.smfcore.custom.nexim.bean.NeximConfig;
//import com.neotel.smfcore.custom.nexim.config.NeximCacheConfig;
//import com.neotel.smfcore.custom.nexim.util.NeximUtil;
//import com.neotel.smfcore.custom.panacim.PanaApiController;
import
com.neotel.smfcore.security.annotation.AnonymousPutMapping
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
...
...
@@ -23,6 +21,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -341,4 +340,20 @@ public class EquipViewController {
return
dto
;
}
@ApiOperation
(
"保存界面的一些操作"
)
@AnonymousPutMapping
(
"saveOp"
)
public
ResultBean
saveOp
(
@RequestBody
Map
<
String
,
String
>
params
)
{
String
cid
=
params
.
get
(
"cid"
);
if
(!
Strings
.
isNullOrEmpty
(
cid
)){
String
opKey
=
params
.
get
(
"opKey"
);
String
opValue
=
params
.
get
(
"opValue"
);
log
.
info
(
"其他设备界面执行操作:"
+
opKey
+
"="
+
opValue
);
EquipStatusUtil
.
appendOp
(
cid
,
opKey
,
opValue
);
return
ResultBean
.
newOkResult
(
"smfcore.msg.ok"
,
"操作成功"
);
}
return
ResultBean
.
newOkResult
(
"smfcore.msg.noCid"
,
"操作失败,未找到cid"
);
}
}
src/main/java/com/neotel/smfcore/core/system/util/EquipStatusUtil.java
查看文件 @
39a100c
...
...
@@ -11,6 +11,7 @@ import com.neotel.smfcore.core.message.util.DeviceMessageUtil;
import
com.neotel.smfcore.core.system.bean.MesInfoDto
;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
@Slf4j
public
class
EquipStatusUtil
{
...
...
@@ -107,6 +108,9 @@ public class EquipStatusUtil {
return
lastAgvMesMap
.
get
(
""
);
}
/**
* 客户端上传的数据
*/
public
static
Map
<
String
,
Map
<
String
,
String
>>
dataMap
=
new
HashMap
<>();
public
static
void
updateData
(
String
cid
,
Map
<
String
,
String
>
data
)
{
if
(
dataMap
.
containsKey
(
cid
))
{
...
...
@@ -130,4 +134,40 @@ public class EquipStatusUtil {
}
return
data
;
}
/**
*存储料仓 出入库的一些操作,KEY=cid
*/
private
static
Map
<
String
,
Map
<
String
,
String
>>
storageOpMap
=
new
ConcurrentHashMap
<>();
/**
* 追加操作
* @param cid
* @param opKey
* @param opValue
*/
public
static
void
appendOp
(
String
cid
,
String
opKey
,
String
opValue
){
Map
<
String
,
String
>
opMap
=
storageOpMap
.
get
(
cid
);
if
(
opMap
==
null
){
opMap
=
new
ConcurrentHashMap
<>();
}
String
value
=
opMap
.
get
(
opKey
);
if
(
value
!=
null
){
value
=
value
+
"|"
+
opValue
;
}
else
{
value
=
opValue
;
}
opMap
.
put
(
opKey
,
value
);
storageOpMap
.
put
(
cid
,
opMap
);
}
public
static
Map
<
String
,
String
>
getAndRemoveOp
(
String
cid
){
Map
<
String
,
String
>
opMap
=
storageOpMap
.
get
(
cid
);
if
(
opMap
!=
null
){
storageOpMap
.
remove
(
cid
);
}
return
opMap
;
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论