Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 8fde5746
由
zshaohui
编写于
2023-11-16 16:34:41 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.工单出库获取出料口,顺序打乱
2.黑灯工厂,设备状态5的时候不发送 3.料仓出库的时候,比如:出料口MU1_1,不出MU1_2,出其他的
1 个父辈
b9f95030
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
29 行增加
和
34 行删除
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
src/main/java/com/neotel/smfcore/custom/lizhen/innerBox/rest/InnerBoxRestController.java
src/main/java/com/neotel/smfcore/custom/lizhen/innerBox/util/StorageExportUtil.java
src/main/java/com/neotel/smfcore/custom/lizhen/kafka/service/KafkaService.java
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
查看文件 @
8fde574
...
...
@@ -606,9 +606,15 @@ public class TaskService {
if
(!
Strings
.
isNullOrEmpty
(
posName
))
{
//有库位号
if
(
outTask
==
null
||
task
.
getCreateDate
().
before
(
outTask
.
getCreateDate
()))
{
if
(
hasExport
)
{
if
(
StringUtils
.
isNotBlank
(
exportStr
)
&&
!
exportStr
.
equals
(
task
.
getExport
()))
{
if
(
StringUtils
.
isNotBlank
(
exportStr
))
{
String
export
=
task
.
getExport
();
if
(
StringUtils
.
isNotBlank
(
export
)){
String
resultExport
=
exportStr
.
substring
(
0
,
exportStr
.
length
()-
1
);
if
(!
export
.
startsWith
(
resultExport
))
{
outTask
=
task
;
}
}
}
}
else
{
outTask
=
task
;
}
...
...
@@ -619,7 +625,11 @@ public class TaskService {
return
outTask
;
}
public
static
void
main
(
String
[]
args
)
{
String
export
=
"MU1_1"
;
export
=
export
.
substring
(
0
,
export
.
length
()-
1
);
System
.
out
.
println
(
export
);
}
/**
* 出库处理
...
...
@@ -661,7 +671,7 @@ public class TaskService {
log
.
warn
(
"出库无料仓位"
+
storage
.
getName
()
+
"["
+
posName
+
"]"
);
}
statusBean
.
addPosInfo
(
task
.
getBarcode
(),
posName
,
plateW
,
plateH
,
isSingleOut
);
log
.
info
(
"出库"
+
storage
.
getName
()
+
"["
+
posName
+
"]物料["
+
task
.
getBarcode
()
+
"]"
+
isSingleOut
+
"发送到客户端"
+
cid
);
log
.
info
(
"出库"
+
storage
.
getName
()
+
"["
+
posName
+
"]物料["
+
task
.
getBarcode
()
+
"]"
+
isSingleOut
+
"发送到客户端"
+
cid
+
",出料口为:"
+
task
.
getExport
()
);
}
// }
String
posId
=
statusBean
.
getData
().
get
(
"posId"
);
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/innerBox/rest/InnerBoxRestController.java
查看文件 @
8fde574
...
...
@@ -444,6 +444,7 @@ public class InnerBoxRestController {
List
<
DataLog
>
allTasks
=
taskService
.
getAllTasks
();
for
(
DataLog
dataLog
:
allTasks
)
{
if
(
dataLog
.
isCheckOutTask
()
&&
dataLog
.
getBarcode
().
equals
(
codeBean
.
getBarcode
().
getBarcode
()))
{
resultMap
.
put
(
"cid"
,
dataLog
.
getCid
());
resultMap
.
put
(
"export"
,
""
);
//如果sourceName和subSourceId都不为空时,则返回目标位置
String
sourceName
=
dataLog
.
getSourceName
();
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/innerBox/util/StorageExportUtil.java
查看文件 @
8fde574
...
...
@@ -11,9 +11,7 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.stereotype.Component
;
import
javax.annotation.PostConstruct
;
import
java.util.LinkedHashSet
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
...
...
@@ -60,7 +58,7 @@ public class StorageExportUtil {
//出料口名称
private
final
static
String
[]
exportStrArr
=
new
String
[]{
"MU1_1"
,
"MU1_2"
,
"MU2_1"
,
"MU3_1"
,
"MU4_1"
,
"MU4_2"
,
"MU5_1"
,
"MU5_2"
}
;
private
final
static
List
<
String
>
exportStrArr
=
Arrays
.
asList
(
"MU1_1"
,
"MU4_1"
,
"MU2_1"
,
"MU5_1"
,
"MU1_2"
,
"MU4_2"
,
"MU5_2"
,
"MU3_1"
)
;
//料仓前缀
public
static
final
String
EXPORT_PREFIX
=
"Storage_Export"
;
...
...
@@ -120,40 +118,31 @@ public class StorageExportUtil {
}
//判断是否为新工单
if
(
StringUtils
.
isBlank
(
exportStr
))
{
//按key进行升序排列
Set
<
Map
.
Entry
<
String
,
StorageExport
>>
sortMap
=
exportMap
.
entrySet
().
stream
().
sorted
(
Map
.
Entry
.
comparingByKey
()).
collect
(
Collectors
.
toCollection
(
LinkedHashSet:
:
new
));
for
(
Map
.
Entry
<
String
,
StorageExport
>
entry
:
sortMap
)
{
//判断是否有禁用工位信息
/*if (StringUtils.isNotBlank(disableExport)) {
if (disableExport.contains(entry.getKey())) {
continue;
}
}*/
for
(
String
export
:
exportStrArr
)
{
StorageExport
storageExport
=
exportMap
.
get
(
export
);
//分配工单时候,手动出库排除
if
(
StringUtils
.
isNotBlank
(
manualCheckoutExport
)){
if
(
e
ntry
.
getKey
()
.
startsWith
(
manualCheckoutExport
)){
if
(
e
xport
.
startsWith
(
manualCheckoutExport
)){
continue
;
}
}
//迈征的排除
if
(
StringUtils
.
isNotBlank
(
maizhengExport
)){
if
(
e
ntry
.
getKey
()
.
startsWith
(
maizhengExport
)){
if
(
e
xport
.
startsWith
(
maizhengExport
)){
continue
;
}
}
if
(
e
ntry
.
getKey
()
.
contains
(
StorageExportUtil
.
OUT_STATION
))
{
if
(
e
xport
.
contains
(
StorageExportUtil
.
OUT_STATION
))
{
continue
;
}
StorageExport
export
=
entry
.
getValue
();
if
(
e
xport
.
isDisable
())
{
if
(
storageE
xport
.
isDisable
())
{
continue
;
}
if
(
StringUtils
.
isBlank
(
export
.
getHSerial
()))
{
exportStr
=
entry
.
getKey
();
if
(
StringUtils
.
isBlank
(
storageExport
.
getHSerial
()))
{
exportStr
=
export
;
break
;
}
}
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/kafka/service/KafkaService.java
查看文件 @
8fde574
...
...
@@ -3,7 +3,6 @@ package com.neotel.smfcore.custom.lizhen.kafka.service;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.google.common.collect.Maps
;
import
com.neotel.smfcore.common.utils.JsonUtil
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.device.bean.StatusBean
;
import
com.neotel.smfcore.core.device.enums.BOX_STATUS
;
...
...
@@ -13,20 +12,14 @@ import com.neotel.smfcore.core.system.util.DevicesStatusUtil;
import
com.neotel.smfcore.custom.lizhen.kafka.bean.Heartbeat
;
import
com.neotel.smfcore.custom.lizhen.kafka.bean.MachineStatus
;
import
com.neotel.smfcore.custom.lizhen.kafka.config.KafkaConfig
;
import
io.jsonwebtoken.impl.crypto.MacProvider
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.kafka.clients.producer.ProducerRecord
;
import
org.apache.kafka.common.protocol.Message
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.kafka.core.KafkaTemplate
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.concurrent.ListenableFuture
;
import
java.util.*
;
import
java.util.concurrent.ExecutionException
;
import
java.util.stream.Collectors
;
//@Async
...
...
@@ -94,6 +87,7 @@ public class KafkaService {
continue
;
}
if
(
"1"
.
equals
(
currentStatus
)
||
"3"
.
equals
(
currentStatus
))
{
MachineStatus
status
=
new
MachineStatus
();
String
dateStr
=
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss.SSS"
);
status
.
setOccurrenceTime
(
dateStr
);
...
...
@@ -107,7 +101,8 @@ public class KafkaService {
log
.
info
(
"主题为:"
+
KafkaConfig
.
MACHINESTATUS_TOPIC
+
"内容为:"
+
statusStr
);
ListenableFuture
future
=
kafkaTemplate
.
send
(
KafkaConfig
.
MACHINESTATUS_TOPIC
,
statusStr
);
log
.
info
(
"返回结果为:"
+
JSON
.
toJSONString
(
future
));
statusMap
.
put
(
machineId
,
currentStatus
);
statusMap
.
put
(
machineId
,
currentStatus
);
}
}
log
.
info
(
"发送设备状态结束"
);
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论