Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 7591be90
由
LN
编写于
2026-01-26 15:36:31 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
SP出库优先外侧库位
1 个父辈
20406b58
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
30 行增加
和
7 行删除
src/main/java/com/neotel/smfcore/core/solder/handler/SpBoxHandler.java
src/main/java/com/neotel/smfcore/core/solder/rest/SpBoxController.java
src/main/java/com/neotel/smfcore/core/solder/handler/SpBoxHandler.java
查看文件 @
7591be9
...
...
@@ -102,6 +102,7 @@ public class SpBoxHandler extends BaseDeviceHandler {
@Override
public
StatusBean
handleClientRequest
(
StatusBean
statusBean
,
HttpServletRequest
request
)
{
String
cid
=
statusBean
.
getCid
();
int
isDuoSidePos
=
statusBean
.
getDuoSidePos
();
Storage
storage
=
dataCache
.
getStorage
(
cid
);
if
(
storage
!=
null
)
{
statusBean
.
setClientIp
(
request
.
getRemoteHost
());
...
...
@@ -343,19 +344,19 @@ public class SpBoxHandler extends BaseDeviceHandler {
if
(!
hasOutTask
)
{
if
(
isDuoSidePos
==
1
)
{
//先查找B结尾的,再查找F结尾的
log
.
info
(
"从"
+
storage
.
getName
()
+
"中为"
+
barcode
.
getBarcode
()
+
"寻找空的仓位,先查找B结尾的库位"
);
log
.
info
(
isDuoSidePos
+
"从"
+
storage
.
getName
()
+
"中为"
+
barcode
.
getBarcode
()
+
"寻找空的仓位,先查找B结尾的库位"
);
storagePos
=
storagePosManager
.
getSpEmptyPosByStorage
(
storage
,
barcode
,
operatingPosIds
,
"B"
);
if
(
storagePos
==
null
)
{
log
.
info
(
"从"
+
storage
.
getName
()
+
"中为"
+
barcode
.
getBarcode
()
+
"寻找空的仓位,未找到B结尾的库位,查找F结尾库位"
);
log
.
info
(
isDuoSidePos
+
"从"
+
storage
.
getName
()
+
"中为"
+
barcode
.
getBarcode
()
+
"寻找空的仓位,未找到B结尾的库位,查找F结尾库位"
);
storagePos
=
storagePosManager
.
getSpEmptyPosByStorage
(
storage
,
barcode
,
operatingPosIds
,
"F"
);
}
if
(
storagePos
==
null
){
log
.
info
(
"从"
+
storage
.
getName
()
+
"中为"
+
barcode
.
getBarcode
()
+
"寻找空的仓位,查找所有库位"
);
log
.
info
(
isDuoSidePos
+
"从"
+
storage
.
getName
()
+
"中为"
+
barcode
.
getBarcode
()
+
"寻找空的仓位,查找所有库位"
);
storagePos
=
storagePosManager
.
getEmptyPosByStorage
(
storage
,
barcode
,
operatingPosIds
);
}
}
else
{
log
.
info
(
"从"
+
storage
.
getName
()
+
"中为"
+
barcode
.
getBarcode
()
+
"寻找空的仓位"
);
log
.
info
(
isDuoSidePos
+
"从"
+
storage
.
getName
()
+
"中为"
+
barcode
.
getBarcode
()
+
"寻找空的仓位"
);
storagePos
=
storagePosManager
.
getEmptyPosByStorage
(
storage
,
barcode
,
operatingPosIds
);
}
...
...
@@ -368,7 +369,7 @@ public class SpBoxHandler extends BaseDeviceHandler {
if
(
storagePos
==
null
)
{
throw
new
ValidateException
(
"smfcore.error.storage.noPos"
,
"{0}的料格[{1}]已满,无法继续放入"
,
new
String
[]{
storage
.
getName
(),
barcode
.
getPlateSize
()
+
"x"
+
barcode
.
getHeight
()});
}
log
.
info
(
"["
+
barcode
.
getBarcode
()
+
"]寻找到"
+
storage
.
getName
()
+
"的空仓位["
+
storagePos
.
getPosName
()
+
"]"
);
log
.
info
(
isDuoSidePos
+
"["
+
barcode
.
getBarcode
()
+
"]寻找到"
+
storage
.
getName
()
+
"的空仓位["
+
storagePos
.
getPosName
()
+
"]"
);
return
storagePos
;
}
...
...
@@ -430,6 +431,7 @@ public class SpBoxHandler extends BaseDeviceHandler {
return
null
;
}
//锡膏料仓空闲
queueTasks
=
taskService
.
getQueueTasks
();
for
(
DataLog
task
:
queueTasks
)
{
...
...
src/main/java/com/neotel/smfcore/core/solder/rest/SpBoxController.java
查看文件 @
7591be9
...
...
@@ -7,6 +7,7 @@ import com.neotel.smfcore.common.bean.ResultBean;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.DateUtil
;
import
com.neotel.smfcore.common.utils.QueryHelp
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.api.SmfApi
;
import
com.neotel.smfcore.core.api.bean.CodeValidateParam
;
import
com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE
;
...
...
@@ -48,6 +49,7 @@ import org.springframework.web.bind.annotation.*;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.*
;
import
java.util.regex.Pattern
;
@Slf4j
@RestController
...
...
@@ -157,7 +159,21 @@ public class SpBoxController {
if
(
outDate
==
null
)
{
outDate
=
new
Date
();
}
List
<
StoragePos
>
solderPosList
=
findSolder
(
storageId
,
pn
,
num
);
//先查找外侧库位
List
<
StoragePos
>
solderPosList
=
findSolder
(
storageId
,
pn
,
num
,
"F"
);
int
fNum
=
solderPosList
.
size
();
int
bNum
=
0
;
int
oNum
=
num
-
fNum
;
if
(
oNum
>
0
)
{
List
<
StoragePos
>
oPos
=
findSolder
(
storageId
,
pn
,
oNum
,
""
);
if
(
oPos
.
size
()
>
0
)
{
bNum
=
oPos
.
size
();
solderPosList
.
addAll
(
oPos
);
}
}
log
.
info
(
"outSolder 锡膏定时出库,storageId="
+
storageId
+
",共需要出"
+
num
+
",查找到F库位="
+
fNum
+
",B库位="
+
bNum
);
setOutDate
(
solderPosList
,
outDate
);
}
return
ResultBean
.
newOkResult
(
""
);
...
...
@@ -246,7 +262,7 @@ public class SpBoxController {
return
query
;
}
private
List
<
StoragePos
>
findSolder
(
String
storageId
,
String
pn
,
int
num
)
{
private
List
<
StoragePos
>
findSolder
(
String
storageId
,
String
pn
,
int
num
,
String
endStr
)
{
Criteria
c
=
Criteria
.
where
(
"enabled"
).
is
(
true
).
and
(
"barcode"
).
exists
(
true
)
.
and
(
"barcode.solderStatus"
).
in
(
SOLDER_STATUS
.
RETREAT_STORAGE
,
SOLDER_STATUS
.
UNDER_REFRIGERATION
);
if
(!
Strings
.
isNullOrEmpty
(
storageId
))
{
...
...
@@ -261,6 +277,11 @@ public class SpBoxController {
Sort
sort
=
storagePosManager
.
getSortByCheckOutType
(
checkoutType
);
//优先使用二次入库的
q
.
with
(
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"barcode.solderStatus"
).
and
(
sort
));
if
(
StringUtils
.
isNotEmpty
(
endStr
))
{
String
regex
=
""
+
endStr
+
"$"
;
c
.
and
(
"posName"
).
regex
(
Pattern
.
compile
(
regex
));
}
return
storagePosManager
.
findByQuery
(
q
);
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论