Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 4980ef23
由
zshaohui
编写于
2024-09-14 11:19:54 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.增加抛送设备状态和心跳
2.pk修改线体
1 个父辈
4a9931d8
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
190 行增加
和
102 行删除
src/main/java/com/neotel/smfcore/core/barcode/service/po/Barcode.java
src/main/java/com/neotel/smfcore/core/equipment/handler/impl/BaseEquipHandler.java
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/PkCheckOutController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/kafka/service/KafkaService.java
src/main/java/com/neotel/smfcore/core/barcode/service/po/Barcode.java
查看文件 @
4980ef2
...
@@ -176,6 +176,7 @@ public class Barcode extends BasePo implements Serializable {
...
@@ -176,6 +176,7 @@ public class Barcode extends BasePo implements Serializable {
*/
*/
private
Map
<
String
,
String
>
extraDataMap
=
new
HashMap
<>();
private
Map
<
String
,
String
>
extraDataMap
=
new
HashMap
<>();
private
int
isVirtual
=
0
;
/**
/**
* 获取Barcode的一些额外属性
* 获取Barcode的一些额外属性
...
...
src/main/java/com/neotel/smfcore/core/equipment/handler/impl/BaseEquipHandler.java
查看文件 @
4980ef2
...
@@ -39,6 +39,7 @@ public class BaseEquipHandler implements IEquipmentHandler {
...
@@ -39,6 +39,7 @@ public class BaseEquipHandler implements IEquipmentHandler {
DeviceMessageUtil
.
addOnlineMessage
(
statusBean
.
getCid
(),
""
,
statusBean
.
getClientIp
());
DeviceMessageUtil
.
addOnlineMessage
(
statusBean
.
getCid
(),
""
,
statusBean
.
getClientIp
());
// EquipStatusUtil.updateClientMsg(statusBean.getCid(), "", "", "", null);
// EquipStatusUtil.updateClientMsg(statusBean.getCid(), "", "", "", null);
}
}
statusBean
.
setTime
(
System
.
currentTimeMillis
());
EquipStatusUtil
.
updateStatusBean
(
statusBean
);
EquipStatusUtil
.
updateStatusBean
(
statusBean
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"客户端故障消息处理出错"
,
e
);
log
.
error
(
"客户端故障消息处理出错"
,
e
);
...
...
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
查看文件 @
4980ef2
...
@@ -1201,11 +1201,16 @@ public class LiteOrderCache {
...
@@ -1201,11 +1201,16 @@ public class LiteOrderCache {
//找到符合条件的partNumber
//找到符合条件的partNumber
List
<
Barcode
>
barcodeList
=
new
ArrayList
<>();
List
<
Barcode
>
barcodeList
=
new
ArrayList
<>();
for
(
StoragePos
pos
:
storagePosList
)
{
for
(
StoragePos
pos
:
storagePosList
)
{
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
for
(
Barcode
barcode
:
pos
.
getBarcode
().
getSubCodeList
())
{
for
(
Barcode
barcode
:
pos
.
getBarcode
().
getSubCodeList
())
{
if
(
barcode
.
getPartNumber
().
equals
(
partNumber
))
{
if
(
barcode
.
getPartNumber
().
equals
(
partNumber
))
{
/*if (barcode.getExpireDate() == null) {
if
(
storage
!=
null
)
{
barcode.setExpireDate(new Date());
if
(
storage
.
isVirtual
())
{
}*/
barcode
.
setIsVirtual
(
1
);
}
}
barcodeList
.
add
(
barcode
);
barcodeList
.
add
(
barcode
);
}
}
}
}
...
@@ -1213,7 +1218,10 @@ public class LiteOrderCache {
...
@@ -1213,7 +1218,10 @@ public class LiteOrderCache {
//按排序找到最先过期入库的partNumber
//按排序找到最先过期入库的partNumber
if
(
barcodeList
!=
null
&&
!
barcodeList
.
isEmpty
())
{
if
(
barcodeList
!=
null
&&
!
barcodeList
.
isEmpty
())
{
List
<
String
>
posNameList
=
barcodeList
.
stream
().
sorted
(
Comparator
.
comparing
(
Barcode:
:
getCreateDate
,
Comparator
.
nullsFirst
(
Date:
:
compareTo
)).
reversed
()).
map
(
item
->
item
.
getPosName
()).
distinct
().
collect
(
Collectors
.
toList
());
barcodeList
=
barcodeList
.
stream
().
sorted
(
Comparator
.
comparing
(
Barcode:
:
getCreateDate
,
Comparator
.
nullsFirst
(
Date:
:
compareTo
)).
reversed
()).
collect
(
Collectors
.
toList
());
barcodeList
=
barcodeList
.
stream
().
sorted
(
Comparator
.
comparing
(
Barcode:
:
getIsVirtual
).
reversed
()).
collect
(
Collectors
.
toList
());
List
<
String
>
posNameList
=
barcodeList
.
stream
().
map
(
item
->
item
.
getPosName
()).
distinct
().
collect
(
Collectors
.
toList
());
for
(
String
posName
:
posNameList
)
{
for
(
String
posName
:
posNameList
)
{
for
(
StoragePos
pos
:
storagePosList
)
{
for
(
StoragePos
pos
:
storagePosList
)
{
if
(
StringUtils
.
isNotBlank
(
posName
))
{
if
(
StringUtils
.
isNotBlank
(
posName
))
{
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/PkCheckOutController.java
查看文件 @
4980ef2
...
@@ -5,6 +5,7 @@ import com.neotel.smfcore.common.utils.SecurityUtils;
...
@@ -5,6 +5,7 @@ import com.neotel.smfcore.common.utils.SecurityUtils;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager
;
import
com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
com.neotel.smfcore.core.order.LiteOrderCache
;
import
com.neotel.smfcore.core.order.LiteOrderCache
;
import
com.neotel.smfcore.core.order.enums.LITEORDER_SOURCE
;
import
com.neotel.smfcore.core.order.enums.LITEORDER_SOURCE
;
...
@@ -33,6 +34,7 @@ import org.springframework.web.bind.annotation.RequestParam;
...
@@ -33,6 +34,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@RestController
@RestController
...
@@ -54,6 +56,11 @@ public class PkCheckOutController {
...
@@ -54,6 +56,11 @@ public class PkCheckOutController {
@Autowired
@Autowired
private
IBarcodeManager
barcodeManager
;
private
IBarcodeManager
barcodeManager
;
@Autowired
private
DataCache
dataCache
;
private
static
final
String
Cache_Picking_NewLine
=
"Cache_Picking_NewLine"
;
@ApiOperation
(
"出库目的地"
)
@ApiOperation
(
"出库目的地"
)
@RequestMapping
(
"/checkLoc"
)
@RequestMapping
(
"/checkLoc"
)
...
@@ -89,7 +96,22 @@ public class PkCheckOutController {
...
@@ -89,7 +96,22 @@ public class PkCheckOutController {
queryPickingResult
.
setCheckOut
(
false
);
queryPickingResult
.
setCheckOut
(
false
);
}
}
queryPickingResult
.
setTargetLoc
(
liteOrder
.
getLoc
());
queryPickingResult
.
setTargetLoc
(
liteOrder
.
getLoc
());
if
(
StringUtils
.
isNotEmpty
(
liteOrder
.
getLine
())){
queryPickingResult
.
setLINE
(
liteOrder
.
getLine
());
}
}
}
Map
<
String
,
String
>
newLineCacheMap
=
dataCache
.
getCache
(
Cache_Picking_NewLine
);
if
(
newLineCacheMap
==
null
){
newLineCacheMap
=
new
ConcurrentHashMap
<>();
}
String
newLine
=
newLineCacheMap
.
get
(
pickingId
);
if
(
StringUtils
.
isNotEmpty
(
newLine
)){
queryPickingResult
.
setLINE
(
newLine
);
}
}
}
pickingResultList
=
pickingResultList
.
stream
().
sorted
(
Comparator
.
comparing
(
QueryPickingResult
::
getCREATE_AT
)).
collect
(
Collectors
.
toList
());
pickingResultList
=
pickingResultList
.
stream
().
sorted
(
Comparator
.
comparing
(
QueryPickingResult
::
getCREATE_AT
)).
collect
(
Collectors
.
toList
());
return
ResultBean
.
newOkResult
(
QueryPickingDto
.
convertQueryPickingResultDto
(
pickingResultList
));
return
ResultBean
.
newOkResult
(
QueryPickingDto
.
convertQueryPickingResultDto
(
pickingResultList
));
...
@@ -187,6 +209,14 @@ public class PkCheckOutController {
...
@@ -187,6 +209,14 @@ public class PkCheckOutController {
itemList
.
add
(
item
);
itemList
.
add
(
item
);
}
}
Map
<
String
,
String
>
newLineCacheMap
=
dataCache
.
getCache
(
Cache_Picking_NewLine
);
if
(
newLineCacheMap
==
null
){
newLineCacheMap
=
new
ConcurrentHashMap
<>();
}
if
(
StringUtils
.
isNotEmpty
(
newLineCacheMap
.
get
(
pickingId
))){
line
=
newLineCacheMap
.
get
(
pickingId
);
}
//5.创建工单
//5.创建工单
LiteOrder
newOrder
=
new
LiteOrder
();
LiteOrder
newOrder
=
new
LiteOrder
();
newOrder
.
setOrderNo
(
pickingId
);
newOrder
.
setOrderNo
(
pickingId
);
...
@@ -198,6 +228,9 @@ public class PkCheckOutController {
...
@@ -198,6 +228,9 @@ public class PkCheckOutController {
newOrder
.
setCheckType
(
LiteorderCheckType
.
PICKING_CHECKOUT
);
newOrder
.
setCheckType
(
LiteorderCheckType
.
PICKING_CHECKOUT
);
newOrder
=
liteOrderManager
.
createWithItems
(
newOrder
);
newOrder
=
liteOrderManager
.
createWithItems
(
newOrder
);
liteOrderCache
.
addOrderToMap
(
newOrder
);
liteOrderCache
.
addOrderToMap
(
newOrder
);
newLineCacheMap
.
remove
(
pickingId
);
dataCache
.
updateCache
(
Cache_Picking_NewLine
,
newLineCacheMap
);
}
}
//6.执行工单出库
//6.执行工单出库
...
@@ -234,4 +267,39 @@ public class PkCheckOutController {
...
@@ -234,4 +267,39 @@ public class PkCheckOutController {
}
}
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"工单:"
+
pickingId
+
"没有要出库的料箱"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"工单:"
+
pickingId
+
"没有要出库的料箱"
);
}
}
@ApiOperation
(
"修改pk线别"
)
@RequestMapping
(
"/updatePkLine"
)
@AnonymousAccess
public
ResultBean
updatePkLine
(
String
pkId
,
String
line
)
{
if
(
StringUtils
.
isEmpty
(
pkId
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"挑料单号不能为空"
);
}
if
(
StringUtils
.
isEmpty
(
line
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"线别不能为空"
);
}
//为了不改变原有逻辑,先临时加个缓存,等点击pk出库 生成工单的时候,再把新的线体设置进去
LiteOrder
liteOrder
=
liteOrderCache
.
getLiteOrder
(
pkId
);
if
(
liteOrder
==
null
)
{
liteOrder
=
liteOrderManager
.
findByOrderNo
(
pkId
);
}
if
(
liteOrder
!=
null
)
{
if
(!
liteOrder
.
isTaskFinished
()
&&
!
liteOrder
.
isNew
())
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
pkId
+
"正在执行中,不允许修改线体"
);
}
liteOrder
.
setLine
(
line
);
liteOrderManager
.
save
(
liteOrder
);
liteOrderCache
.
addOrderToMap
(
liteOrder
);
}
else
{
Map
<
String
,
String
>
newLineCacheMap
=
dataCache
.
getCache
(
Cache_Picking_NewLine
);
if
(
newLineCacheMap
==
null
){
newLineCacheMap
=
new
ConcurrentHashMap
<>();
}
newLineCacheMap
.
put
(
pkId
,
line
);
dataCache
.
updateCache
(
Cache_Picking_NewLine
,
newLineCacheMap
);
}
return
ResultBean
.
newOkResult
(
""
);
}
}
}
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/kafka/service/KafkaService.java
查看文件 @
4980ef2
...
@@ -51,104 +51,6 @@ public class KafkaService {
...
@@ -51,104 +51,6 @@ public class KafkaService {
/**
/**
* 抛送入料机构,分拣机构的设备状态信息,每1分钟抛送一次
*/
//@Scheduled(fixedRate = 1000 * 60 * 1)
public
void
setRawMaterialInOutMachineStatus
()
{
//获取所有的设备
List
<
String
>
rawMaterialList
=
StorageNameConfig
.
getRawMaterialList
();
for
(
String
machineId
:
rawMaterialList
)
{
String
currentStatus
=
"1"
;
//正常
List
<
EquipMsg
>
equipMsgList
=
new
ArrayList
<>();
EquipStatusBean
statusBean
=
EquipStatusUtil
.
getStatusBean
(
machineId
);
if
(
statusBean
==
null
){
currentStatus
=
"5"
;
}
else
{
int
status
=
statusBean
.
getStatus
();
//状态
if
(
2
==
status
||
3
==
status
)
{
currentStatus
=
"3"
;
//故障
}
if
(
0
==
status
)
{
currentStatus
=
"5"
;
}
equipMsgList
=
statusBean
.
getMsgList
();
}
if
(
equipMsgList
!=
null
&&
!
equipMsgList
.
isEmpty
()){
for
(
EquipMsg
equipMsg
:
equipMsgList
)
{
MachineStatus
machineStatus
=
new
MachineStatus
();
String
dateStr
=
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss.SSS"
);
machineStatus
.
setOccurrenceTime
(
dateStr
);
machineStatus
.
setMachineID
(
machineId
);
machineStatus
.
setTopicType
(
KafkaConfig
.
MACHINESTATUS_TOPIC
);
machineStatus
.
setCurrentStatus
(
currentStatus
);
machineStatus
.
setErrorCode
(
equipMsg
.
getErrorCode
());
machineStatus
.
setErrorMsg
(
equipMsg
.
getMsg
());
machineStatus
.
setClientIP
(
""
);
String
statusStr
=
JSON
.
toJSONString
(
machineStatus
);
log
.
info
(
machineId
+
"抛送设备状态主题为:"
+
KafkaConfig
.
MACHINESTATUS_TOPIC
+
"内容为:"
+
statusStr
);
ListenableFuture
future
=
kafkaTemplate
.
send
(
KafkaConfig
.
MACHINESTATUS_TOPIC
,
statusStr
);
log
.
info
(
machineId
+
"抛送设备状态返回结果为:"
+
JSON
.
toJSONString
(
future
));
}
}
else
{
MachineStatus
machineStatus
=
new
MachineStatus
();
String
dateStr
=
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss.SSS"
);
machineStatus
.
setOccurrenceTime
(
dateStr
);
machineStatus
.
setMachineID
(
machineId
);
machineStatus
.
setTopicType
(
KafkaConfig
.
MACHINESTATUS_TOPIC
);
machineStatus
.
setCurrentStatus
(
currentStatus
);
machineStatus
.
setErrorCode
(
""
);
machineStatus
.
setErrorMsg
(
""
);
machineStatus
.
setClientIP
(
""
);
String
statusStr
=
JSON
.
toJSONString
(
machineStatus
);
log
.
info
(
machineId
+
"抛送设备状态主题为:"
+
KafkaConfig
.
MACHINESTATUS_TOPIC
+
"内容为:"
+
statusStr
);
ListenableFuture
future
=
kafkaTemplate
.
send
(
KafkaConfig
.
MACHINESTATUS_TOPIC
,
statusStr
);
log
.
info
(
machineId
+
"抛送设备状态返回结果为:"
+
JSON
.
toJSONString
(
future
));
}
}
}
/**
* 抛送入料机构,分拣机构的心跳,每10s抛送一次
*/
//@Scheduled(fixedRate = 1000 * 10)
public
void
setRawMaterialInOutHeartbeat
()
{
//获取所有的设备
List
<
String
>
rawMaterialList
=
StorageNameConfig
.
getRawMaterialList
();
for
(
String
machineId
:
rawMaterialList
)
{
EquipStatusBean
equipStatus
=
EquipStatusUtil
.
getStatusBean
(
machineId
);
if
(
equipStatus
!=
null
)
{
if
(!
equipStatus
.
timeOut
())
{
int
status
=
equipStatus
.
getStatus
();
//状态
String
currentStatus
=
"1"
;
//正常
if
(
2
==
status
||
3
==
status
)
{
currentStatus
=
"3"
;
//故障
}
if
(
0
==
status
)
{
currentStatus
=
"5"
;
//离线
}
if
(
"1"
.
equals
(
currentStatus
))
{
Heartbeat
heartbeat
=
new
Heartbeat
();
String
dateStr
=
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss.SSS"
);
heartbeat
.
setOccurrenceTime
(
dateStr
);
heartbeat
.
setMachineID
(
machineId
);
heartbeat
.
setTopicType
(
KafkaConfig
.
HEARTBEAT_TOPIC
);
String
statusStr
=
JSON
.
toJSONString
(
heartbeat
);
log
.
info
(
"出料口主题为:"
+
KafkaConfig
.
HEARTBEAT_TOPIC
+
"内容为:"
+
statusStr
);
ListenableFuture
future
=
kafkaTemplate
.
send
(
KafkaConfig
.
HEARTBEAT_TOPIC
,
statusStr
);
log
.
info
(
"出料口返回结果为:"
+
JSON
.
toJSONString
(
future
));
}
}
}
}
}
/**
* 推送原材料仓的储位,出入库信息,每5分钟抛送一次
* 推送原材料仓的储位,出入库信息,每5分钟抛送一次
*/
*/
@Scheduled
(
fixedRate
=
1000
*
60
*
5
)
@Scheduled
(
fixedRate
=
1000
*
60
*
5
)
...
@@ -200,6 +102,114 @@ public class KafkaService {
...
@@ -200,6 +102,114 @@ public class KafkaService {
}
}
/**
* 原材料仓,入料和出料机构心跳信息
*/
@Scheduled
(
fixedRate
=
1000
*
30
)
public
void
setRawMaterialInOutHeartbeat
()
{
log
.
info
(
"开始推送原材料仓,入料和出料机构心跳信息"
);
List
<
String
>
rawMaterialList
=
StorageNameConfig
.
getRawMaterialList
();
for
(
String
machineId
:
rawMaterialList
)
{
EquipStatusBean
equipStatus
=
EquipStatusUtil
.
getStatusBean
(
machineId
);
if
(
equipStatus
!=
null
)
{
boolean
timeOut
=
equipStatus
.
timeOut
();
if
(!
timeOut
)
{
/**
* 正常 1
* 回原 13
* 报警 4
* 未启动 0
* 急停 2
*/
int
status
=
equipStatus
.
getStatus
();
//状态
String
currentStatus
=
"1"
;
//正常
if
(
4
==
status
||
0
==
status
||
2
==
status
)
{
currentStatus
=
"3"
;
}
if
(
"1"
.
equals
(
currentStatus
))
{
Heartbeat
heartbeat
=
new
Heartbeat
();
String
dateStr
=
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss.SSS"
);
heartbeat
.
setOccurrenceTime
(
dateStr
);
heartbeat
.
setMachineID
(
machineId
);
heartbeat
.
setTopicType
(
KafkaConfig
.
HEARTBEAT_TOPIC
);
String
statusStr
=
JSON
.
toJSONString
(
heartbeat
);
log
.
info
(
"原材料仓抛送心跳信息:"
+
KafkaConfig
.
HEARTBEAT_TOPIC
+
"内容为:"
+
statusStr
);
ListenableFuture
future
=
kafkaTemplate
.
send
(
KafkaConfig
.
HEARTBEAT_TOPIC
,
statusStr
);
log
.
info
(
"原材料仓抛送心跳信息结束为:"
+
JSON
.
toJSONString
(
future
));
}
}
}
}
log
.
info
(
"结束推送原材料仓,入料和出料机构心跳信息"
);
}
/**
* 原材料仓,入料和出料机构设备状态信息
*/
@Scheduled
(
fixedRate
=
1000
*
60
*
5
)
public
void
setRawMaterialInOutMachineStatus
()
{
log
.
info
(
"开始推送原材料仓,入料和出料机构设备状态信息"
);
List
<
String
>
rawMaterialList
=
StorageNameConfig
.
getRawMaterialList
();
for
(
String
machineId
:
rawMaterialList
)
{
List
<
EquipMsg
>
equipMsgList
=
new
ArrayList
<>();
String
currentStatus
=
"1"
;
//正常
EquipStatusBean
statusBean
=
EquipStatusUtil
.
getStatusBean
(
machineId
);
if
(
statusBean
==
null
){
currentStatus
=
"5"
;
}
else
{
if
(
statusBean
.
timeOut
()){
currentStatus
=
"5"
;
}
else
{
int
status
=
statusBean
.
getStatus
();
if
(
4
==
status
||
2
==
status
){
currentStatus
=
"3"
;
}
if
(
13
==
status
||
1
==
status
){
currentStatus
=
"1"
;
}
if
(
0
==
status
){
currentStatus
=
"5"
;
}
equipMsgList
=
statusBean
.
getMsgList
();
}
}
if
(
equipMsgList
!=
null
&&
!
equipMsgList
.
isEmpty
()){
for
(
EquipMsg
equipMsg
:
equipMsgList
)
{
MachineStatus
machineStatus
=
new
MachineStatus
();
String
dateStr
=
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss.SSS"
);
machineStatus
.
setOccurrenceTime
(
dateStr
);
machineStatus
.
setMachineID
(
machineId
);
machineStatus
.
setTopicType
(
KafkaConfig
.
MACHINESTATUS_TOPIC
);
machineStatus
.
setCurrentStatus
(
currentStatus
);
machineStatus
.
setErrorCode
(
equipMsg
.
getErrorCode
());
machineStatus
.
setErrorMsg
(
equipMsg
.
getMsg
());
machineStatus
.
setClientIP
(
""
);
String
statusStr
=
JSON
.
toJSONString
(
machineStatus
);
log
.
info
(
machineId
+
"抛送设备状态主题为:"
+
KafkaConfig
.
MACHINESTATUS_TOPIC
+
"内容为:"
+
statusStr
);
ListenableFuture
future
=
kafkaTemplate
.
send
(
KafkaConfig
.
MACHINESTATUS_TOPIC
,
statusStr
);
log
.
info
(
machineId
+
"抛送设备状态返回结果为:"
+
JSON
.
toJSONString
(
future
));
}
}
else
{
MachineStatus
machineStatus
=
new
MachineStatus
();
String
dateStr
=
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss.SSS"
);
machineStatus
.
setOccurrenceTime
(
dateStr
);
machineStatus
.
setMachineID
(
machineId
);
machineStatus
.
setTopicType
(
KafkaConfig
.
MACHINESTATUS_TOPIC
);
machineStatus
.
setCurrentStatus
(
currentStatus
);
machineStatus
.
setErrorCode
(
""
);
machineStatus
.
setErrorMsg
(
""
);
machineStatus
.
setClientIP
(
""
);
String
statusStr
=
JSON
.
toJSONString
(
machineStatus
);
log
.
info
(
machineId
+
"抛送设备状态主题为:"
+
KafkaConfig
.
MACHINESTATUS_TOPIC
+
"内容为:"
+
statusStr
);
ListenableFuture
future
=
kafkaTemplate
.
send
(
KafkaConfig
.
MACHINESTATUS_TOPIC
,
statusStr
);
log
.
info
(
machineId
+
"抛送设备状态返回结果为:"
+
JSON
.
toJSONString
(
future
));
}
}
log
.
info
(
"结束推送原材料仓,入料和出料机构设备状态信息"
);
}
public
int
getTodayInOutCount
(
List
<
String
>
storageIdList
,
int
type
)
{
public
int
getTodayInOutCount
(
List
<
String
>
storageIdList
,
int
type
)
{
Query
q
=
new
Query
();
Query
q
=
new
Query
();
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论