Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 4c1df6bf
由
孙克
编写于
2024-08-27 21:02:57 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
分配料串逻辑
1 个父辈
7cac54e1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
43 行增加
和
33 行删除
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/third/util/RawInLineUtil.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/third/util/RawInLineUtil.java
查看文件 @
4c1df6b
...
@@ -5,6 +5,7 @@ import com.neotel.smfcore.core.device.util.DataCache;
...
@@ -5,6 +5,7 @@ import com.neotel.smfcore.core.device.util.DataCache;
import
com.neotel.smfcore.custom.luxsan.factory_c.common.util.CacheNameUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.common.util.CacheNameUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.third.bean.RawInLineMaterialLoc
;
import
com.neotel.smfcore.custom.luxsan.factory_c.third.bean.RawInLineMaterialLoc
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.logging.log4j.util.Strings
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -41,7 +42,9 @@ public class RawInLineUtil {
...
@@ -41,7 +42,9 @@ public class RawInLineUtil {
materialLoc
=
new
RawInLineMaterialLoc
();
materialLoc
=
new
RawInLineMaterialLoc
();
}
}
materialLoc
.
setMaterial
(
material
);
materialLoc
.
setMaterial
(
material
);
materialLoc
.
setCurrentLoc
(
loc
);
if
(
StringUtils
.
isNotEmpty
(
loc
)){
materialLoc
.
setCurrentLoc
(
loc
);
}
if
(
StringUtils
.
isNotEmpty
(
destination
)){
if
(
StringUtils
.
isNotEmpty
(
destination
)){
materialLoc
.
setDestination
(
destination
);
materialLoc
.
setDestination
(
destination
);
}
}
...
@@ -69,41 +72,48 @@ public class RawInLineUtil {
...
@@ -69,41 +72,48 @@ public class RawInLineUtil {
}
}
private
static
String
getNextLoc
(
String
material
,
String
loc
)
{
private
static
String
getNextLoc
(
String
material
,
String
loc
)
{
log
.
info
(
"获取满料串:"
+
material
+
",当前位置为:"
+
loc
);
String
nextLoc
=
"forkLoc"
;
if
(
forkLoc
.
equals
(
loc
))
{
nextLoc
=
rawInLine01
;
}
else
if
(
rawInLine01
.
equals
(
loc
))
{
nextLoc
=
rawInLine02
;
}
else
if
(
rawInLine02
.
equals
(
loc
))
{
nextLoc
=
rawInLine03
;
}
else
if
(
rawInLine03
.
equals
(
loc
))
{
nextLoc
=
rawInLine04
;
}
else
if
(
rawInLine04
.
equals
(
loc
))
{
nextLoc
=
rawInLine05
;
}
else
if
(
rawInLine05
.
equals
(
loc
))
{
nextLoc
=
rawInLine06
;
}
Map
<
String
,
RawInLineMaterialLoc
>
destinationMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CHCHE_RAWIN_LINE_MATERIAL_DESTINATION
);
Map
<
String
,
RawInLineMaterialLoc
>
destinationMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CHCHE_RAWIN_LINE_MATERIAL_DESTINATION
);
int
count
=
0
;
if
(
loc
.
equals
(
forkLoc
)){
for
(
RawInLineMaterialLoc
materialLoc
:
destinationMap
.
values
())
{
int
count
=
0
;
if
(
nextLoc
.
equals
(
materialLoc
.
getDestination
()))
{
String
nextLoc
=
""
;
count
++;
for
(
RawInLineMaterialLoc
materialLoc
:
destinationMap
.
values
())
{
if
(
rawInLine01
.
equals
(
materialLoc
.
getDestination
()))
{
count
++;
}
}
if
(
count
>=
3
){
//1号已经3个, 分2号
nextLoc
=
rawInLine02
;
}
else
{
nextLoc
=
rawInLine01
;
}
updateDestinationMap
(
material
,
loc
,
nextLoc
);
return
nextLoc
;
}
else
{
int
count
=
0
;
for
(
RawInLineMaterialLoc
materialLoc
:
destinationMap
.
values
())
{
if
(
loc
.
equals
(
materialLoc
.
getDestination
()))
{
count
++;
}
}
if
(
count
>=
3
){
String
nextLoc
=
loc
;
if
(
rawInLine02
.
equals
(
loc
))
{
nextLoc
=
rawInLine03
;
}
else
if
(
rawInLine03
.
equals
(
loc
))
{
nextLoc
=
rawInLine04
;
}
else
if
(
rawInLine04
.
equals
(
loc
))
{
nextLoc
=
rawInLine05
;
}
else
if
(
rawInLine05
.
equals
(
loc
))
{
nextLoc
=
rawInLine06
;
}
log
.
info
(
"获取满料串:"
+
material
+
",当前位置["
+
loc
+
"]数量为:"
+
count
+
"超过3个,分配到下一位置"
+
nextLoc
);
updateDestinationMap
(
material
,
loc
,
nextLoc
);
return
nextLoc
;
}
else
{
return
loc
;
}
}
}
}
log
.
info
(
"获取满料串:"
+
material
+
",下一个位置为:"
+
nextLoc
+
",当前数量为:"
+
count
);
if
(
count
>=
5
)
{
updateDestinationMap
(
material
,
loc
,
loc
);
return
loc
;
}
updateDestinationMap
(
material
,
loc
,
nextLoc
);
return
nextLoc
;
}
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论