Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 19c7060e
由
zshaohui
编写于
2023-01-03 16:25:42 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
分配库位 A/B面 交叉分配
1 个父辈
ee86c62e
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
46 行增加
和
3 行删除
src/main/java/com/neotel/smfcore/core/storage/service/manager/IStoragePosManager.java
src/main/java/com/neotel/smfcore/core/storage/service/manager/impl/StoragePosManagerImpl.java
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
src/main/java/com/neotel/smfcore/core/storage/service/manager/IStoragePosManager.java
查看文件 @
19c7060
...
...
@@ -41,7 +41,7 @@ public interface IStoragePosManager extends IBaseManager<StoragePos> {
StoragePos
getEmptyPosByStorage
(
Storage
storage
,
Barcode
barcode
,
Collection
<
String
>
excludePosIds
)
throws
ValidateException
;
StoragePos
getEmptyPosByStorage
(
Storage
storage
,
Barcode
barcode
,
Collection
<
String
>
excludePosIds
,
String
lastPosId
)
throws
ValidateException
;
StoragePos
getEmptyPosByStorage
(
Storage
storage
,
Barcode
barcode
,
Collection
<
String
>
excludePosIds
,
String
lastPosId
,
String
logotype
)
throws
ValidateException
;
List
<
StoragePos
>
findNotEmpty
();
...
...
src/main/java/com/neotel/smfcore/core/storage/service/manager/impl/StoragePosManagerImpl.java
查看文件 @
19c7060
...
...
@@ -7,6 +7,8 @@ import com.google.common.collect.Maps;
import
com.neotel.smfcore.common.bean.PageData
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.PointUtil
;
import
com.neotel.smfcore.common.utils.QueryHelp
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.barcode.bean.PlateSizeBean
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.storage.bean.InventoryItem
;
...
...
@@ -30,6 +32,7 @@ import org.springframework.stereotype.Service;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.regex.Pattern
;
@Service
@Slf4j
...
...
@@ -373,7 +376,7 @@ public class StoragePosManagerImpl implements IStoragePosManager {
}
@Override
public
StoragePos
getEmptyPosByStorage
(
Storage
storage
,
Barcode
barcode
,
Collection
<
String
>
excludePosIds
,
String
lastPosId
)
throws
ValidateException
{
public
StoragePos
getEmptyPosByStorage
(
Storage
storage
,
Barcode
barcode
,
Collection
<
String
>
excludePosIds
,
String
lastPosId
,
String
logotype
)
throws
ValidateException
{
Criteria
c
=
Criteria
.
where
(
"storageId"
).
is
(
storage
.
getId
());
...
...
@@ -395,6 +398,12 @@ public class StoragePosManagerImpl implements IStoragePosManager {
if
(
excludePosIds
!=
null
&&
!
excludePosIds
.
isEmpty
())
{
c
=
c
.
and
(
"id"
).
nin
(
excludePosIds
);
}
//分AB面
if
(
StringUtils
.
isNotBlank
(
logotype
)){
c
=
c
.
and
(
"posName"
).
regex
(
Pattern
.
compile
(
QueryHelp
.
escapeExprSpecialWord
(
logotype
),
Pattern
.
CASE_INSENSITIVE
));
}
Query
query
=
new
Query
(
c
);
String
msg
=
""
;
...
...
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
查看文件 @
19c7060
...
...
@@ -32,6 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
/**
* Created by sunke on 2021/7/13.
...
...
@@ -56,6 +57,12 @@ public class TaskService {
private
SmfApi
smfApi
;
/**
* key 为料仓id
* value 为A,B面
*/
private
static
Map
<
String
,
String
>
logotypeMap
=
new
ConcurrentHashMap
<>();
/**
* 任务队列,Key 为dataLog的ID,value 为本区域待执行的任务
*/
private
static
Map
<
String
,
DataLog
>
taskMap
=
Maps
.
newConcurrentMap
();
...
...
@@ -661,7 +668,34 @@ public class TaskService {
try
{
Collection
<
String
>
operatingPosIds
=
excludePosIds
();
log
.
debug
(
"尝试从["
+
storage
.
getCid
()
+
"]中为["
+
barcode
.
getBarcode
()
+
"]查找空位"
);
StoragePos
pos
=
storagePosManager
.
getEmptyPosByStorage
(
storage
,
barcode
,
operatingPosIds
,
lastPosId
);
StoragePos
pos
=
null
;
if
(!
storage
.
isXLC
())
{
//如果为空的话 先查询A面
String
logotype
=
""
;
if
(
logotypeMap
.
get
(
storage
.
getCid
())
==
null
)
{
logotype
=
"AA"
;
}
else
{
logotype
=
logotypeMap
.
get
(
storage
.
getCid
());
}
if
(
"AA"
.
equals
(
logotype
))
{
logotype
=
"BB"
;
}
else
{
logotype
=
"AA"
;
}
pos
=
storagePosManager
.
getEmptyPosByStorage
(
storage
,
barcode
,
operatingPosIds
,
lastPosId
,
logotype
);
if
(
pos
==
null
)
{
if
(
"AA"
.
equals
(
logotype
))
{
logotype
=
"BB"
;
}
else
{
logotype
=
"AA"
;
}
}
pos
=
storagePosManager
.
getEmptyPosByStorage
(
storage
,
barcode
,
operatingPosIds
,
lastPosId
,
logotype
);
logotypeMap
.
put
(
storage
.
getCid
(),
logotype
);
}
if
(
pos
==
null
)
{
pos
=
storagePosManager
.
getEmptyPosByStorage
(
storage
,
barcode
,
operatingPosIds
,
lastPosId
,
null
);
}
if
(
pos
!=
null
)
{
return
pos
;
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论