Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 0814fb99
由
zshaohui
编写于
2024-08-13 13:26:36 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
按库别分库位
1 个父辈
e9775495
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
47 行增加
和
41 行删除
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
src/main/java/com/neotel/smfcore/custom/luxsan/api/bean/request/QueryBinRequest.java
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/util/BinCacheUtil.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/BoxHandleUtil.java
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
查看文件 @
0814fb9
...
...
@@ -447,7 +447,7 @@ public class LiteOrderCache {
try
{
String
binCode
=
""
;
Map
<
String
,
String
>
binCacheMap
=
BinCacheUtil
.
binCodeCacheMap
(
orderItem
.
getSrcWarehouse
());
Map
<
String
,
String
>
binCacheMap
=
BinCacheUtil
.
binCodeCacheMap
(
orderItem
.
getSrcWarehouse
()
,
""
);
for
(
String
code
:
binCacheMap
.
keySet
())
{
binCode
=
code
;
break
;
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/api/bean/request/QueryBinRequest.java
查看文件 @
0814fb9
...
...
@@ -32,4 +32,9 @@ public class QueryBinRequest {
* 储位库别
*/
private
String
WAREHOUSE_CODE
;
/**
* 隔口信息
*/
private
String
BIN_CODE
;
}
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/CDeviceController.java
查看文件 @
0814fb9
...
...
@@ -666,7 +666,7 @@ public class CDeviceController {
barcodeManager
.
saveBarcode
(
barcode
);
//更新料串缓存信息
MaterialLocUtil
.
updateMaterialLoc
(
materialStr
,
""
,
barcode
);
MaterialLocUtil
.
updateMaterialLoc
(
materialStr
,
""
,
null
);
Map
<
String
,
String
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"binCode"
,
boxStr
);
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/BinCacheUtil.java
查看文件 @
0814fb9
...
...
@@ -38,50 +38,21 @@ public class BinCacheUtil {
BinCacheUtil
.
taskService
=
service
;
}
public
static
long
time
=
0
l
;
public
static
Map
<
String
,
String
>
cacheBinCodeMap
=
null
;
public
static
boolean
canPutInBinCode
(
String
binCode
,
String
warehouseCode
)
{
if
(
cacheBinCodeMap
==
null
||
time
==
0
l
||
System
.
currentTimeMillis
()
-
time
>
1000
*
60
*
10
){
cacheBinCodeMap
=
binCodeCacheMap
(
warehouseCode
);
time
=
System
.
currentTimeMillis
();
log
.
info
(
"获取可用料箱,缓存可能为空,时间可能为空,当前时间与上一次时间相差10分钟:"
+(
System
.
currentTimeMillis
()
-
time
));
}
//判断code是否相同
String
code
=
cacheBinCodeMap
.
get
(
binCode
);
if
(
StringUtils
.
isEmpty
(
code
)){
log
.
info
(
binCode
+
"未找到,重新调用接口,库别为:"
+
warehouseCode
);
Map
<
String
,
String
>
map
=
binCodeCacheMap
(
warehouseCode
);
cacheBinCodeMap
.
putAll
(
map
);
}
code
=
cacheBinCodeMap
.
get
(
binCode
);
Map
<
String
,
String
>
binCodeMap
=
binCodeCacheMap
(
warehouseCode
,
binCode
);
String
code
=
binCodeMap
.
get
(
binCode
);
if
(
StringUtils
.
isNotEmpty
(
code
))
{
if
(
code
.
equals
(
warehouseCode
))
{
//binCodeUpdateTime = System.currentTimeMillis();
return
true
;
}
/* else {
LuxsanApi.updateBin(new UpdateBinRequest(CommonUtil.plantCode, binCode, warehouseCode, BinEnum.STORAGE_TYPE_C));
cacheMap.put(binCode, warehouseCode);
dataCache.updateCache(CacheNameUtil.CHCHE_QUERY_BIN, cacheMap);
binCodeUpdateTime = System.currentTimeMillis();
return
true
;
}
*/
}
}
return
false
;
}
public
static
List
<
String
>
getBoxList
(
String
wareHouseCode
)
{
public
static
List
<
String
>
getBoxList
(
String
wareHouseCode
,
String
binCodeStr
)
{
List
<
String
>
boxList
=
new
ArrayList
<>();
Map
<
String
,
String
>
cacheMap
=
binCodeCacheMap
(
wareHouseCode
);
Map
<
String
,
String
>
cacheMap
=
binCodeCacheMap
(
wareHouseCode
,
binCodeStr
);
for
(
String
bincode
:
cacheMap
.
keySet
())
{
String
cacheWH
=
cacheMap
.
get
(
bincode
);
if
(
StringUtils
.
isNotEmpty
(
cacheWH
)
&&
cacheWH
.
equals
(
wareHouseCode
))
{
...
...
@@ -95,16 +66,16 @@ public class BinCacheUtil {
}
public
static
Map
<
String
,
String
>
binCodeCacheMap
(
String
warehouseCode
)
{
public
static
Map
<
String
,
String
>
binCodeCacheMap
(
String
warehouseCode
,
String
binCode
)
{
Map
<
String
,
String
>
cacheMap
=
new
HashMap
<>();
List
<
QueryBinResult
>
resultList
=
LuxsanApi
.
queryBin
(
new
QueryBinRequest
(
CommonUtil
.
plantCode
,
BinEnum
.
STORAGE_TYPE_C
,
BinEnum
.
BIN_STATUS_0
,
warehouseCode
));
List
<
QueryBinResult
>
resultList
=
LuxsanApi
.
queryBin
(
new
QueryBinRequest
(
CommonUtil
.
plantCode
,
BinEnum
.
STORAGE_TYPE_C
,
BinEnum
.
BIN_STATUS_0
,
warehouseCode
,
binCode
));
if
(
resultList
!=
null
&&
!
resultList
.
isEmpty
())
{
for
(
QueryBinResult
result
:
resultList
)
{
cacheMap
.
put
(
result
.
getBIN_CODE
(),
result
.
getWAREHOUSE_CODE
());
}
}
List
<
QueryBinResult
>
useBinResultList
=
LuxsanApi
.
queryBin
(
new
QueryBinRequest
(
CommonUtil
.
plantCode
,
BinEnum
.
STORAGE_TYPE_C
,
BinEnum
.
BIN_STATUS_1
,
warehouseCode
));
List
<
QueryBinResult
>
useBinResultList
=
LuxsanApi
.
queryBin
(
new
QueryBinRequest
(
CommonUtil
.
plantCode
,
BinEnum
.
STORAGE_TYPE_C
,
BinEnum
.
BIN_STATUS_1
,
warehouseCode
,
binCode
));
if
(
useBinResultList
!=
null
&&
!
useBinResultList
.
isEmpty
())
{
for
(
QueryBinResult
result
:
useBinResultList
)
{
cacheMap
.
put
(
result
.
getBIN_CODE
(),
result
.
getWAREHOUSE_CODE
());
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/BoxHandleUtil.java
查看文件 @
0814fb9
...
...
@@ -20,6 +20,7 @@ import com.neotel.smfcore.core.storage.service.po.StoragePos;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType
;
import
com.neotel.smfcore.custom.luxsan.api.LuxsanApi
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.enums.TaskCurrentLoc
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -182,7 +183,7 @@ public class BoxHandleUtil {
}
//判断有没有可用的料箱
List
<
String
>
boxList
=
BinCacheUtil
.
getBoxList
(
wareHouseCode
);
List
<
String
>
boxList
=
BinCacheUtil
.
getBoxList
(
wareHouseCode
,
""
);
if
(
boxList
==
null
||
boxList
.
isEmpty
())
{
log
.
info
(
wareHouseCode
+
"未找到可用料箱"
);
return
null
;
...
...
@@ -354,10 +355,34 @@ public class BoxHandleUtil {
}
public
static
StoragePos
locOnePos
(
Barcode
boxBarcode
)
{
//默认只差第一个隔口
String
barcode
=
boxBarcode
.
getBarcode
();
String
binCodeStr
=
barcode
+
"-01"
;
Map
<
String
,
String
>
cacheMap
=
BinCacheUtil
.
binCodeCacheMap
(
""
,
binCodeStr
);
String
warehouseCode
=
cacheMap
.
get
(
binCodeStr
);
log
.
info
(
binCodeStr
+
"查到的库别为:"
+
warehouseCode
);
if
(
StringUtils
.
isEmpty
(
warehouseCode
)){
return
null
;
}
boxBarcode
.
setWarehouseCode
(
warehouseCode
);
//判断信息是否在已经在库位中(出入库只改变料箱位置状态,不从StoragePos表中清除)
StoragePos
pos
=
storagePosManager
.
getByBarcode
(
boxBarcode
.
getBarcode
());
if
(
pos
!=
null
)
{
return
pos
;
if
(
warehouseCode
.
equals
(
pos
.
getWareHouseCode
())){
return
pos
;
}
else
{
log
.
info
(
barcode
+
"对应的库别为:"
+
warehouseCode
+
",与当前库位:"
+
pos
.
getPosName
()+
"的库别:"
+
pos
.
getWareHouseCode
()+
"不一致,清空原来库位"
);
pos
.
setBarcode
(
null
);
pos
.
setUsed
(
false
);
storagePosManager
.
save
(
pos
);
}
}
List
<
String
>
cidList
=
new
ArrayList
<>();
...
...
@@ -370,6 +395,11 @@ public class BoxHandleUtil {
}
pos
=
taskService
.
findEmptyPosForPutIn
(
storageList
,
boxBarcode
,
""
,
""
);
if
(
pos
==
null
){
boxBarcode
.
setWarehouseCode
(
""
);
pos
=
taskService
.
findEmptyPosForPutIn
(
storageList
,
boxBarcode
,
""
,
""
);
}
if
(
pos
==
null
)
{
log
.
info
(
boxBarcode
.
getBarcode
()
+
"未找到可用库位"
);
return
null
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论