Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 1449ec19
由
张少辉
编写于
2026-03-10 13:08:54 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.双库位功能修改
1 个父辈
e230cfd4
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
118 行增加
和
11 行删除
src/main/java/com/neotel/smfcore/core/device/handler/impl/BaseDeviceHandler.java
src/main/java/com/neotel/smfcore/core/device/rest/DualPosNameDeviceController.java
src/main/java/com/neotel/smfcore/core/storage/rest/MaterialBoxController.java
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/custom/aiqingzhiyin1643/momo/MomoApi.java
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/structuralWarehouse/controller/AgvDeviceController.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/BaseDeviceHandler.java
查看文件 @
1449ec1
...
...
@@ -251,7 +251,19 @@ public class BaseDeviceHandler implements IDeviceHandler {
throw
new
ValidateException
(
"smfcore.error.pos.hasReel"
,
"库位[{0}]中已有物料,无法入库"
,
new
String
[]{
posName
});
}
if
(!
storage
.
canPutInPos
(
barcodeSave
.
getPlateSize
(),
barcodeSave
.
getHeight
(),
storagePos
.
getW
(),
storagePos
.
getH
()))
{
int
w
=
barcodeSave
.
getPlateSize
();
if
(
"ATAA000508"
.
equals
(
barcodeSave
.
getPartNumber
())
||
"ATAA000892"
.
equals
(
barcodeSave
.
getPartNumber
())
||
"ATAA000507"
.
equals
(
barcodeSave
.
getPartNumber
())
||
"ATAA000502"
.
equals
(
barcodeSave
.
getPartNumber
())
||
"ATAA000893"
.
equals
(
barcodeSave
.
getPartNumber
())
)
{
w
=
15
;
}
if
(!
storage
.
canPutInPos
(
w
,
barcodeSave
.
getHeight
(),
storagePos
.
getW
(),
storagePos
.
getH
()))
{
String
reelSize
=
barcodeSave
.
getPlateSize
()
+
"x"
+
barcodeSave
.
getHeight
();
String
posSize
=
storagePos
.
getW
()
+
"x"
+
storagePos
.
getH
();
throw
new
ValidateException
(
"smfcore.error.pos.sizeNotMatch"
,
"料盘尺寸[{0}}]与库位{1}尺寸[{2}]不符,无法入库"
,
new
String
[]{
reelSize
,
posName
,
posSize
});
...
...
src/main/java/com/neotel/smfcore/core/device/rest/DualPosNameDeviceController.java
0 → 100644
查看文件 @
1449ec1
此文件的差异被折叠,
点击展开。
src/main/java/com/neotel/smfcore/core/storage/rest/MaterialBoxController.java
查看文件 @
1449ec1
...
...
@@ -16,6 +16,8 @@ import com.neotel.smfcore.core.barcode.utils.CodeResolve;
import
com.neotel.smfcore.core.device.enums.OP
;
import
com.neotel.smfcore.core.device.enums.OP_STATUS
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.inList.service.po.InList
;
import
com.neotel.smfcore.core.inList.service.po.InListItem
;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.core.system.service.manager.IDataLogManager
;
...
...
@@ -228,10 +230,15 @@ public class MaterialBoxController {
throw
new
ValidateException
(
"smfcore.materialBox.inPos"
,
"物料已在库位{0}中"
,
new
String
[]{
pos
.
getPosName
()});
}
//通知momo,退库接口
StockReturnResponse
response
=
momoApi
.
stockReturn
(
barcode
);
if
(!
response
.
getIsSuccess
()){
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.momo.stockOutError"
,
response
.
getErrorMessage
(),
new
String
[]{});
//判断是不是对接momo
boolean
isDocking
=
dataCache
.
isElectronicWarehouseDocking
();
if
(
isDocking
)
{
//通知momo,退库接口
StockReturnResponse
response
=
momoApi
.
stockReturn
(
barcode
);
if
(!
response
.
getIsSuccess
()){
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.momo.stockOutError"
,
response
.
getErrorMessage
(),
new
String
[]{});
}
}
//设置barcode的入库时间
...
...
src/main/java/com/neotel/smfcore/core/storage/service/manager/IStoragePosManager.java
查看文件 @
1449ec1
...
...
@@ -104,4 +104,6 @@ public interface IStoragePosManager extends IBaseManager<StoragePos> {
StoragePos
getByPidBarcode
(
String
reelId
);
StoragePos
findFgWarehouseForPutIn
(
Storage
fgWarehouseStorage
,
Barcode
barcode
,
Collection
<
String
>
strings
,
boolean
heightLimited
);
StoragePos
dualPosNameGetEmptyPosByStorage
(
Storage
storage
,
Barcode
barcode
,
Collection
<
String
>
operatingPosIds
,
String
lastPosId
,
String
needMovePosName
,
String
endStr
,
List
<
String
>
needExcludePosName
);
}
src/main/java/com/neotel/smfcore/core/storage/service/manager/impl/StoragePosManagerImpl.java
查看文件 @
1449ec1
...
...
@@ -439,6 +439,78 @@ public class StoragePosManagerImpl implements IStoragePosManager {
return
pos
;
}
private
static
boolean
max
=
true
;
@Override
public
StoragePos
dualPosNameGetEmptyPosByStorage
(
Storage
storage
,
Barcode
barcode
,
Collection
<
String
>
excludePosIds
,
String
lastPosId
,
String
needMovePosName
,
String
endStr
,
List
<
String
>
needExcludePosNameList
)
{
Criteria
c
=
Criteria
.
where
(
"storageId"
).
is
(
storage
.
getId
());
int
w
=
barcode
.
getPlateSize
();
int
h
=
barcode
.
getHeight
();
if
(
"ATAA000508"
.
equals
(
barcode
.
getPartNumber
())
||
"ATAA000892"
.
equals
(
barcode
.
getPartNumber
())
||
"ATAA000507"
.
equals
(
barcode
.
getPartNumber
())
||
"ATAA000502"
.
equals
(
barcode
.
getPartNumber
())
||
"ATAA000893"
.
equals
(
barcode
.
getPartNumber
())
)
{
w
=
15
;
}
COMPATIBLE_TYPE
compatibleType
=
storage
.
getCompatibleType
();
if
(
compatibleType
==
COMPATIBLE_TYPE
.
EXACT_MATCH
)
{
//完全匹配
c
=
c
.
and
(
"w"
).
is
(
w
).
and
(
"h"
).
is
(
h
);
}
else
if
(
compatibleType
==
COMPATIBLE_TYPE
.
FULLY_COMPATIBLE
)
{
//同厚度兼容
c
=
c
.
and
(
"w"
).
gte
(
w
).
and
(
"h"
).
gte
(
h
);
//除7寸外,完全兼容
}
else
if
(
compatibleType
==
COMPATIBLE_TYPE
.
SIZE_COMPATIBLE
)
{
//同尺寸兼容
c
=
c
.
and
(
"w"
).
is
(
w
).
and
(
"h"
).
gte
(
h
);
//宽度等于料盘宽度,高度大于等于料盘高度
}
c
=
c
.
and
(
"enabled"
).
is
(
true
)
//可用
.
and
(
"used"
).
is
(
false
);
//未使用
//去除的仓位
if
(
excludePosIds
!=
null
&&
!
excludePosIds
.
isEmpty
())
{
c
=
c
.
and
(
"id"
).
nin
(
excludePosIds
);
}
if
(
StringUtils
.
isNotEmpty
(
needMovePosName
)
&&
StringUtils
.
isNotEmpty
(
endStr
))
{
Criteria
posNameCriteria
=
new
Criteria
();
String
regex
=
""
+
endStr
+
"$"
;
posNameCriteria
.
andOperator
(
Criteria
.
where
(
"posName"
).
ne
(
needMovePosName
),
Criteria
.
where
(
"posName"
).
regex
(
Pattern
.
compile
(
regex
)));
c
.
andOperator
(
posNameCriteria
);
}
if
(
needExcludePosNameList
!=
null
&&
!
needExcludePosNameList
.
isEmpty
()){
c
.
and
(
"posName"
).
nin
(
needExcludePosNameList
);
}
Query
query
=
new
Query
(
c
);
String
msg
=
""
;
// if (lastPosId == null || lastPosId.equals("")) {
//优先放入最合适的位置(根据尺寸),相同尺寸按优先级排序
if
(
max
){
query
.
with
(
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"w"
).
and
(
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"h"
)).
and
(
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"priority"
)));
max
=
true
;
}
else
{
query
.
with
(
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"w"
).
and
(
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"h"
)).
and
(
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"priority"
)));
max
=
false
;
}
StoragePos
pos
=
storagePosDao
.
findOne
(
query
);
if
((!
ObjectUtil
.
isNotEmpty
(
msg
)
)&&
(
pos
!=
null
))
{
Point
targetP
=
PointUtil
.
getPosPoint
(
lastPosId
,
false
);
log
.
debug
(
msg
+
"结果:["
+
pos
.
getPosName
()
+
"]["
+
targetP
.
getX
()
+
","
+
targetP
.
getY
()
+
"]"
);
}
return
pos
;
}
@Override
public
PageData
<
StoragePos
>
findByPage
(
Query
query
,
Pageable
pageable
)
{
int
totalCount
=
storagePosDao
.
countByQuery
(
query
);
...
...
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
查看文件 @
1449ec1
此文件的差异被折叠,
点击展开。
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/momo/MomoApi.java
查看文件 @
1449ec1
...
...
@@ -96,7 +96,8 @@ public class MomoApi extends BaseSmfApiListener {
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
barcodeStr
);
String
stockoutNo
=
barcode
.
getStockoutNo
();
if
(
StringUtils
.
isNotEmpty
(
stockoutNo
))
{
stockOut
(
barcode
);
barcode
.
setPartNumber
(
task
.
getPartNumber
());
stockOut
(
barcode
,
barcode
.
getAmount
());
}
}
}
...
...
@@ -248,7 +249,7 @@ public class MomoApi extends BaseSmfApiListener {
* @param barcode 条码对象
* @return StockoutResponse MOM接口返回的响应结果(异常时返回null/封装错误信息)
*/
public
StockoutResponse
stockOut
(
Barcode
barcode
)
{
public
StockoutResponse
stockOut
(
Barcode
barcode
,
int
opQty
)
{
// 1. 空值校验:条码/出库单号为空时,直接返回null并记录日志
if
(
barcode
==
null
||
StringUtils
.
isEmpty
(
barcode
.
getStockoutNo
()))
{
log
.
warn
(
"接口5:MOM接收WMS的出库结果-参数无效,barcode={},stockoutNo={}"
,
...
...
@@ -264,7 +265,12 @@ public class MomoApi extends BaseSmfApiListener {
?
barcode
.
getPidBarcode
()
:
barcode
.
getBarcode
());
itemMap
.
put
(
"ProductName"
,
barcode
.
getDescription
());
itemMap
.
put
(
"ProductNo"
,
barcode
.
getPartNumber
());
itemMap
.
put
(
"QuantityOnHand"
,
barcode
.
getAmount
());
if
(
barcode
.
getAmount
()
!=
0
){
itemMap
.
put
(
"QuantityOnHand"
,
barcode
.
getAmount
());
}
else
{
itemMap
.
put
(
"QuantityOnHand"
,
opQty
);
}
itemMap
.
put
(
"StockoutNoLine"
,
barcode
.
getStockoutNoLine
());
detailItems
.
add
(
itemMap
);
paramMap
.
put
(
"DetailItems"
,
detailItems
);
...
...
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/structuralWarehouse/controller/AgvDeviceController.java
查看文件 @
1449ec1
...
...
@@ -391,12 +391,20 @@ public class AgvDeviceController {
if
(
StringUtils
.
isNotEmpty
(
barcode
.
getStockoutNo
()))
{
if
(
barcode
.
getAmount
()
==
0
)
{
StockoutResponse
stockoutResponse
=
momoApi
.
stockOut
(
barcode
);
StockoutResponse
stockoutResponse
=
momoApi
.
stockOut
(
barcode
,
opQty
);
if
(!
stockoutResponse
.
getIsSuccess
())
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.momo.stockOutError"
,
stockoutResponse
.
getErrorMessage
(),
new
String
[]{});
}
}
else
{
GetNewContainerNoResponse
newContainerNo
=
momoApi
.
getNewContainerNo
(
new
GetNewContainerNoRequest
(
barcode
.
getProvider
()));
String
provider
=
barcode
.
getProvider
();
String
pidBarcodeStr
=
barcode
.
getPidBarcode
();
if
(
StringUtils
.
isNotEmpty
(
pidBarcodeStr
)){
Barcode
pidBarcode
=
barcodeManager
.
findByBarcode
(
pidBarcodeStr
);
if
(
pidBarcode
!=
null
){
provider
=
pidBarcode
.
getProvider
();
}
}
GetNewContainerNoResponse
newContainerNo
=
momoApi
.
getNewContainerNo
(
new
GetNewContainerNoRequest
(
provider
));
if
(!
"200"
.
equals
(
newContainerNo
.
getResult
()))
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.momo.newBarcodeContentError"
,
"获取新的条码内容失败[{0}]"
,
new
String
[]{
newContainerNo
.
getMessage
()});
}
...
...
@@ -414,7 +422,7 @@ public class AgvDeviceController {
splitBarcode
.
setBarcode
(
newContainerNo
.
getData
());
splitBarcode
.
setAmount
(
opQty
);
splitBarcode
.
setNeedStockNum
(
0
);
StockoutResponse
stockoutResponse
=
momoApi
.
stockOut
(
splitBarcode
);
StockoutResponse
stockoutResponse
=
momoApi
.
stockOut
(
splitBarcode
,
opQty
);
if
(!
stockoutResponse
.
getIsSuccess
())
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.momo.stockOutError"
,
stockoutResponse
.
getErrorMessage
(),
new
String
[]{});
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论