Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 69a85b13
由
zshaohui
编写于
2024-09-27 17:28:17 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
每天7点 19点抛送货架使用情况 到中控
1 个父辈
353f6454
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
49 行增加
和
11 行删除
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/CDeviceController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/kafka/config/KafkaConfig.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/kafka/service/KafkaService.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/CDeviceController.java
查看文件 @
69a85b1
...
...
@@ -1320,8 +1320,8 @@ public class CDeviceController {
}
if
(
checkType
==
LiteorderCheckType
.
PICKING_CHECKOUT
){
try
{
//
LuxsanApi.pickingIssue(new PickingIssueRequest(CommonUtil.plantCode, orderNo, pkItemId, barcode.getPartNumber()
//
, barcode.getWarehouseCode(), brand, face, batchCode, Arrays.asList(barcode.getBarcode())));
LuxsanApi
.
pickingIssue
(
new
PickingIssueRequest
(
CommonUtil
.
plantCode
,
orderNo
,
pkItemId
,
barcode
.
getPartNumber
()
,
barcode
.
getWarehouseCode
(),
brand
,
face
,
batchCode
,
Arrays
.
asList
(
barcode
.
getBarcode
())));
}
catch
(
Exception
e
)
{
saveMessage
(
MessageType
.
ERROR
.
name
(),
currentLoc
,
"通知WMS失败:"
+
e
.
getMessage
()+
"隔口号为"
+
boxPar
);
log
.
info
(
barcode
.
getBarcode
()+
"通知WMS失败:"
+
e
.
getMessage
()+
"隔口号为"
+
boxPar
);
...
...
@@ -1330,8 +1330,8 @@ public class CDeviceController {
}
else
{
//人工出库,
try
{
//
LuxsanApi.pickingIssue(new PickingIssueRequest(CommonUtil.plantCode, "SMFW" + System.currentTimeMillis(), "0", barcode.getPartNumber()
//
, barcode.getWarehouseCode(), "", "", "", Arrays.asList(barcode.getBarcode())));
LuxsanApi
.
pickingIssue
(
new
PickingIssueRequest
(
CommonUtil
.
plantCode
,
"SMFW"
+
System
.
currentTimeMillis
(),
"0"
,
barcode
.
getPartNumber
()
,
barcode
.
getWarehouseCode
(),
""
,
""
,
""
,
Arrays
.
asList
(
barcode
.
getBarcode
())));
}
catch
(
Exception
e
)
{
saveMessage
(
MessageType
.
ERROR
.
name
(),
currentLoc
,
"通知WMS失败:"
+
e
.
getMessage
()+
"隔口号为"
+
boxPar
);
log
.
info
(
barcode
.
getBarcode
()+
"通知WMS失败:"
+
e
.
getMessage
()+
"隔口号为"
+
boxPar
);
...
...
@@ -1386,7 +1386,7 @@ public class CDeviceController {
resultMap
.
put
(
"platSize"
,
barcode
.
getPlateSize
()+
""
);
resultMap
.
put
(
"height"
,
barcode
.
getHeight
()+
""
);
//
kafkaService.sendMachineParameterStackerAndBox(stacker,currentLoc,0,boxBarcode.getBarcode(),barcode.getAmount(),4);
kafkaService
.
sendMachineParameterStackerAndBox
(
stacker
,
currentLoc
,
0
,
boxBarcode
.
getBarcode
(),
barcode
.
getAmount
(),
4
);
return
ResultBean
.
newOkResult
(
resultMap
);
}
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/kafka/config/KafkaConfig.java
查看文件 @
69a85b1
...
...
@@ -16,4 +16,6 @@ public class KafkaConfig {
* MachineParameter
*/
public
static
final
String
MACHINEPARAMETER_TOPIC
=
"MachineParameter"
;
public
static
final
String
SMARTWH_TOPIC
=
"SmartWH"
;
}
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/kafka/service/KafkaService.java
查看文件 @
69a85b1
...
...
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
import
com.alibaba.fastjson.JSON
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.barcode.enums.BARCODE_STATUS
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.device.enums.OP
;
import
com.neotel.smfcore.core.device.enums.OP_STATUS
;
import
com.neotel.smfcore.core.device.util.DataCache
;
...
...
@@ -12,6 +13,7 @@ import com.neotel.smfcore.core.equipment.bean.EquipMsg;
import
com.neotel.smfcore.core.equipment.bean.EquipStatusBean
;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.core.system.service.manager.IDataLogManager
;
import
com.neotel.smfcore.core.system.util.EquipStatusUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.kafka.bean.*
;
...
...
@@ -26,10 +28,7 @@ import org.springframework.scheduling.annotation.Scheduled;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.concurrent.ListenableFuture
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
//@Async
...
...
@@ -134,9 +133,9 @@ public class KafkaService {
heartbeat
.
setMachineID
(
machineId
);
heartbeat
.
setTopicType
(
KafkaConfig
.
HEARTBEAT_TOPIC
);
String
statusStr
=
JSON
.
toJSONString
(
heartbeat
);
log
.
info
(
"原材料仓抛送心跳信息:"
+
KafkaConfig
.
HEARTBEAT_TOPIC
+
"内容为:"
+
statusStr
);
//
log.info("原材料仓抛送心跳信息:" + KafkaConfig.HEARTBEAT_TOPIC + "内容为:" + statusStr);
ListenableFuture
future
=
kafkaTemplate
.
send
(
KafkaConfig
.
HEARTBEAT_TOPIC
,
statusStr
);
log
.
info
(
"原材料仓抛送心跳信息结束为:"
+
JSON
.
toJSONString
(
future
));
//
log.info("原材料仓抛送心跳信息结束为:" + JSON.toJSONString(future));
}
}
}
...
...
@@ -210,6 +209,43 @@ public class KafkaService {
log
.
info
(
"结束推送原材料仓,入料和出料机构设备状态信息"
);
}
@Scheduled
(
cron
=
"0 0 7,19 * * ? "
)
//@Scheduled(fixedRate = 1000 * 5)
public
void
setPosUseInfo
(){
List
<
String
>
storageIdList
=
new
ArrayList
<>();
for
(
Storage
storage
:
dataCache
.
getAllStorage
().
values
())
{
if
(!
storage
.
isVirtual
())
{
storageIdList
.
add
(
storage
.
getId
());
}
}
Query
query
=
new
Query
(
Criteria
.
where
(
"storageId"
).
in
(
storageIdList
));
query
.
fields
().
include
(
"barcode.status"
,
"posName"
);
List
<
Map
<
String
,
String
>>
dataList
=
new
ArrayList
<>();
List
<
StoragePos
>
storagePosList
=
storagePosManager
.
findByQuery
(
query
);
for
(
StoragePos
pos
:
storagePosList
)
{
Map
<
String
,
String
>
dataMap
=
new
HashMap
<>();
dataMap
.
put
(
"Storage"
,
pos
.
getPosName
());
dataMap
.
put
(
"Status"
,
0
+
""
);
Barcode
barcode
=
pos
.
getBarcode
();
if
(
barcode
!=
null
){
if
(
barcode
.
getStatus
()
==
BARCODE_STATUS
.
IN_STORE
){
dataMap
.
put
(
"Status"
,
1
+
""
);
}
}
dataList
.
add
(
dataMap
);
}
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"MachineID"
,
StorageNameConfig
.
rawMaterialTower
);
paramMap
.
put
(
"data"
,
dataList
);
String
statusStr
=
JSON
.
toJSONString
(
paramMap
);
log
.
info
(
"原材料仓抛送货架使用情况:"
+
KafkaConfig
.
SMARTWH_TOPIC
+
"内容为:"
+
statusStr
);
ListenableFuture
future
=
kafkaTemplate
.
send
(
KafkaConfig
.
SMARTWH_TOPIC
,
statusStr
);
log
.
info
(
"原材料仓抛送货架使用情况:"
+
JSON
.
toJSONString
(
future
));
}
public
static
Map
<
String
,
StackerKafkaCache
>
stackerInMap
=
new
ConcurrentHashMap
<>();
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论