Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 075d6826
由
张少辉
编写于
2026-03-19 14:46:09 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.成品仓入库功能提交
1 个父辈
b869b98a
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
309 行增加
和
7 行删除
src/main/java/com/neotel/smfcore/core/barcode/service/po/Barcode.java
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/electronicWarehouse/AgvElecDeviceController.java
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/electronicWarehouse/rest/ScanInBoxController.java
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/electronicWarehouse/rest/ScanOutBoxController.java
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/finishedGoodsWarehouse/controller/PutAwayController.java
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/momo/MomoApi.java
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/momo/bean/request/FgStockInRequest.java
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/momo/bean/response/FgGetPalletInfoResponse.java
src/main/resources/config/application.yml
src/main/java/com/neotel/smfcore/core/barcode/service/po/Barcode.java
查看文件 @
075d682
...
...
@@ -268,6 +268,9 @@ public class Barcode extends BasePo implements Serializable {
private
String
rowNumber
;
//是否为遏制料
private
boolean
hold
=
false
;
/**
* 自定义的附加信息
*/
...
...
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/electronicWarehouse/AgvElecDeviceController.java
查看文件 @
075d682
...
...
@@ -183,7 +183,7 @@ public class AgvElecDeviceController {
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"未找到对应的料仓信息"
);
}
if
(
storage
.
getCorrespondingWarehouse
()
!=
CORRESPONDING_WAREHOUSE
.
ELECTRONIC_WAREHOUSE_BOX
){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"请在设备管理里,配置
成品仓
信息"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"请在设备管理里,配置
电子仓CTU
信息"
);
}
DataLog
opTask
=
null
;
...
...
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/electronicWarehouse/rest/ScanInBoxController.java
查看文件 @
075d682
...
...
@@ -80,7 +80,7 @@ public class ScanInBoxController {
Barcode
barcode
=
codeBean
.
getBarcode
();
//此处需要判断是否是料盒
Component
component
=
componentManager
.
findOneByPN
(
barcode
.
getPartNumber
()
);
if
(
component
==
null
||(
component
.
getType
()!=
COMPONENT_TYPE
.
FIXTURE
)
){
if
(
component
==
null
/*||(component.getType()!=COMPONENT_TYPE.FIXTURE)*/
){
throw
new
ValidateException
(
"smfcore.materialBox.invalid"
,
"未找到料盒信息{0}"
,
new
String
[]{
code
});
}
//判断是否有任务,有任务直接完成,不清空库存信息
...
...
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/electronicWarehouse/rest/ScanOutBoxController.java
查看文件 @
075d682
...
...
@@ -80,7 +80,7 @@ public class ScanOutBoxController {
Barcode
barcode
=
codeBean
.
getBarcode
();
//此处需要判断是否是料盒
Component
component
=
componentManager
.
findOneByPN
(
barcode
.
getPartNumber
());
if
(
component
==
null
||
(
component
.
getType
()
!=
COMPONENT_TYPE
.
FIXTURE
)
)
{
if
(
component
==
null
/*|| (component.getType() != COMPONENT_TYPE.FIXTURE)*/
)
{
throw
new
ValidateException
(
"smfcore.materialBox.invalid"
,
"未找到料盒信息{0}"
,
new
String
[]{
code
});
}
//判断是否有任务,有任务直接完成,不清空库存信息
...
...
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/finishedGoodsWarehouse/controller/PutAwayController.java
查看文件 @
075d682
package
com
.
neotel
.
smfcore
.
custom
.
aiqingzhiyin1643
.
finishedGoodsWarehouse
.
controller
;
import
com.alibaba.excel.util.StringUtils
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.ReelLockPosUtil
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.utils.CodeResolve
;
import
com.neotel.smfcore.core.device.enums.OP
;
...
...
@@ -17,7 +18,8 @@ import com.neotel.smfcore.core.system.service.po.DataLog;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.custom.aiqingzhiyin1643.finishedGoodsWarehouse.bean.PutAwayLocInfo
;
import
com.neotel.smfcore.custom.aiqingzhiyin1643.finishedGoodsWarehouse.enums.PutAwayLocEnum
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
com.neotel.smfcore.custom.aiqingzhiyin1643.momo.MomoApi
;
import
com.neotel.smfcore.custom.aiqingzhiyin1643.momo.bean.response.FgGetPalletInfoResponse
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -26,6 +28,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -43,12 +46,19 @@ public class PutAwayController {
@Autowired
private
CodeResolve
codeResolve
;
@Autowired
private
DataCache
dataCache
;
@Autowired
private
MomoApi
momoApi
;
@Autowired
private
IBarcodeManager
barcodeManager
;
@ApiOperation
(
"获取入库位置及限高信息"
)
@RequestMapping
(
"/getLocHeightLimitInfo"
)
@AnonymousAccess
//
@AnonymousAccess
public
ResultBean
getLocHeightLimitInfo
()
{
// 1. 调用枚举方法,获取封装好的「实际位置+是否限高」列表
List
<
PutAwayLocInfo
>
locInfoList
=
PutAwayLocEnum
.
getAllLocInfo
();
...
...
@@ -58,7 +68,7 @@ public class PutAwayController {
// 确保Controller类添加@Slf4j(无Lombok则替换为LoggerFactory)
@ApiOperation
(
"扫描码拖条码进行入库"
)
@RequestMapping
(
"/scanDragBarcodePutaway"
)
@AnonymousAccess
//
@AnonymousAccess
public
ResultBean
scanDragBarcodePutaway
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
String
barcodeStr
=
paramMap
.
get
(
"barcode"
);
String
actualPosition
=
paramMap
.
get
(
"actualPosition"
);
...
...
@@ -130,6 +140,61 @@ public class PutAwayController {
// 4. 核心:找到的库位信息(仅ID+名称)
log
.
info
(
"找到可用库位:条码="
+
barcodeStr
+
",库位ID="
+
pos
.
getId
()
+
",库位名称="
+
pos
.
getPosName
()
+
",限高="
+
heightLimited
);
//5.获取码拖信息
FgGetPalletInfoResponse
palletInfo
=
momoApi
.
getFgPalletInfo
(
barcode
.
getBarcode
());
if
(!
palletInfo
.
getIsSuccess
()){
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.palletInfo"
,
"获取码拖信息失败"
,
new
String
[]{
palletInfo
.
getMessage
()});
}
List
<
FgGetPalletInfoResponse
.
PalletProductInfo
>
infoList
=
palletInfo
.
getData
();
if
(
infoList
==
null
||
infoList
.
isEmpty
()){
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.palletInfo.empty"
,
"获取到码拖数据为空"
);
}
//每次入库的时候,先更新一下barcode信息
barcode
.
setAmount
(
0
);
List
<
Barcode
>
subCodeList
=
barcode
.
getSubCodeList
();
if
(
subCodeList
!=
null
&&
!
subCodeList
.
isEmpty
()){
for
(
Barcode
subCode
:
subCodeList
)
{
subCode
.
setPosName
(
""
);
subCode
.
setHostBarcodeId
(
""
);
barcodeManager
.
save
(
subCode
);
}
}
barcode
.
setSubCodeList
(
new
ArrayList
<>());
barcode
=
barcodeManager
.
save
(
barcode
);
//构造barcode信息
int
amount
=
0
;
for
(
FgGetPalletInfoResponse
.
PalletProductInfo
palletProductInfo
:
infoList
)
{
String
container
=
palletProductInfo
.
getContainer
();
String
productNo
=
palletProductInfo
.
getProductNo
();
String
productName
=
palletProductInfo
.
getProductName
();
String
lotNo
=
palletProductInfo
.
getLotNo
();
Integer
quantity
=
palletProductInfo
.
getQuantity
();
Integer
hold
=
palletProductInfo
.
getHold
();
Barcode
subCode
=
barcodeManager
.
findByBarcode
(
container
);
if
(
subCode
!=
null
){
if
(
StringUtils
.
isNotEmpty
(
subCode
.
getPosName
())){
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.inPos"
,
"[{0}]已在库位{1}中"
,
new
String
[]{
container
,
subCode
.
getPosName
()});
}
}
else
{
subCode
=
new
Barcode
();
}
subCode
.
setBarcode
(
container
);
subCode
.
setPartNumber
(
productNo
);
subCode
.
setDescribe
(
productName
);
subCode
.
setBatch
(
lotNo
);
subCode
.
setAmount
(
quantity
);
subCode
.
setHold
(
hold
==
1
);
subCode
.
setPosName
(
barcode
.
getBarcode
());
subCode
.
setHostBarcodeId
(
barcode
.
getId
());
subCode
=
barcodeManager
.
save
(
subCode
);
barcode
.
UpdateSubCode
(
subCode
);
amount
=
amount
+
subCode
.
getAmount
();
}
barcode
.
setAmount
(
amount
);
barcode
=
barcodeManager
.
save
(
barcode
);
// 生成任务
DataLog
dataLog
=
new
DataLog
(
fgWarehouseStorage
,
barcode
,
pos
);
dataLog
.
setType
(
OP
.
PUT_IN
);
...
...
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/momo/MomoApi.java
查看文件 @
075d682
...
...
@@ -11,6 +11,7 @@ import com.neotel.smfcore.core.barcode.service.po.Barcode;
import
com.neotel.smfcore.core.storage.enums.CORRESPONDING_WAREHOUSE
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.custom.aiqingzhiyin1643.momo.bean.request.FgStockInRequest
;
import
com.neotel.smfcore.custom.aiqingzhiyin1643.momo.bean.request.GetNewContainerNoRequest
;
import
com.neotel.smfcore.custom.aiqingzhiyin1643.momo.bean.request.MergeContainerRequest
;
import
com.neotel.smfcore.custom.aiqingzhiyin1643.momo.bean.request.SplitContainerRequest
;
...
...
@@ -19,6 +20,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
springfox.documentation.spring.web.json.Json
;
import
java.util.*
;
...
...
@@ -44,6 +46,15 @@ public class MomoApi extends BaseSmfApiListener {
@Value
(
"${api.mergeContainerUrl}"
)
private
String
mergeContainerUrl
;
//成品仓相关的接口
@Value
(
"${api.fgGetPalletInfoUrl}"
)
private
String
fgGetPalletInfoUrl
;
@Value
(
"${api.fGStockINUrl}"
)
private
String
fGStockINUrl
;
@Autowired
private
IBarcodeManager
barcodeManager
;
...
...
@@ -74,6 +85,8 @@ public class MomoApi extends BaseSmfApiListener {
}
}
}
}
else
if
(
storage
.
getCorrespondingWarehouse
()
==
CORRESPONDING_WAREHOUSE
.
FINISHED_GOODS_WAREHOUSE
)
{
fgStockIn
(
barcode
);
}
}
}
...
...
@@ -295,6 +308,73 @@ public class MomoApi extends BaseSmfApiListener {
}
public
FgGetPalletInfoResponse
getFgPalletInfo
(
String
inContainer
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"InContainer"
,
inContainer
);
paramMap
.
put
(
"Account"
,
"smf"
);
log
.
info
(
"接口13:MOM获取成品仓托盘信息,请求参数为:{},地址为:{}"
,
JSON
.
toJSONString
(
paramMap
),
fgGetPalletInfoUrl
);
try
{
String
resultStr
=
HttpHelper
.
postJson
(
fgGetPalletInfoUrl
,
paramMap
);
log
.
info
(
"接口13:MOM获取成品仓托盘信息,返回参数为:{}"
,
resultStr
);
return
JSON
.
parseObject
(
resultStr
,
FgGetPalletInfoResponse
.
class
);
}
catch
(
Exception
e
)
{
log
.
error
(
"接口13:MOM获取成品仓托盘信息,请求异常:{}"
,
e
.
getMessage
());
FgGetPalletInfoResponse
response
=
new
FgGetPalletInfoResponse
();
response
.
setIsSuccess
(
false
);
response
.
setMessage
(
e
.
getMessage
());
return
response
;
}
}
/**
* {
* "Account":"查询人,仅记录,无权限控制逻辑",
* "WarehouseLocation":”上架库位”,(可以不传,MOM使用默认值)
* "PalletInfoModels":[
* {
* "InContainer":”托盘号”,
* "Container":”箱号”,
* “ProductNo”:”产品代码”,
* “ProductName“:”产品名称”,
* “LotNo”:批次号,
* “Quantity”:”箱中产品数量”
* }
* ]
* }
* @param barcode
*/
public
void
fgStockIn
(
Barcode
barcode
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"Account"
,
"SMF"
);
paramMap
.
put
(
"WarehouseLocation"
,
""
);
List
<
Map
<
String
,
Object
>>
palletInfoModels
=
new
ArrayList
<>();
List
<
Barcode
>
subCodeList
=
barcode
.
getSubCodeList
();
for
(
Barcode
subCode
:
subCodeList
)
{
Map
<
String
,
Object
>
subMap
=
new
HashMap
<>();
subMap
.
put
(
"InContainer"
,
barcode
.
getBarcode
());
subMap
.
put
(
"Container"
,
subCode
.
getBarcode
());
subMap
.
put
(
"ProductNo"
,
subCode
.
getPartNumber
());
subMap
.
put
(
"ProductName"
,
subCode
.
getDescribe
());
subMap
.
put
(
"LotNo"
,
subCode
.
getBatch
());
subMap
.
put
(
"Quantity"
,
subCode
.
getAmount
());
palletInfoModels
.
add
(
subMap
);
}
paramMap
.
put
(
"PalletInfoModels"
,
palletInfoModels
);
log
.
info
(
"接口14:MOM接收WMS的成品入库请求,请求参数为:{}"
,
JSON
.
toJSONString
(
paramMap
));
try
{
String
resultStr
=
HttpHelper
.
postJson
(
fGStockINUrl
,
paramMap
);
log
.
info
(
"接口14:MOM接收WMS的成品入库请求,返回参数为:{}"
,
resultStr
);
}
catch
(
ApiException
e
)
{
log
.
error
(
"接口14:MOM接收WMS的成品入库请求,请求异常:{}"
,
e
.
getMessage
());
}
}
@Override
public
boolean
isForThisApi
(
String
apiName
)
{
return
apiName
!=
null
&&
apiName
.
equalsIgnoreCase
(
"1643"
);
...
...
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/momo/bean/request/FgStockInRequest.java
0 → 100644
查看文件 @
075d682
package
com
.
neotel
.
smfcore
.
custom
.
aiqingzhiyin1643
.
momo
.
bean
.
request
;
import
lombok.Data
;
import
java.util.List
;
/**
* 成品入库请求入参类
* 封装入库接口的请求数据结构(移除Get/Set方法)
*/
@Data
public
class
FgStockInRequest
{
/**
* 查询人:仅记录,无权限控制逻辑
*/
private
String
account
;
/**
* 上架库位:可选字段,不传则MOM使用默认值
*/
private
String
warehouseLocation
;
/**
* 托盘信息模型列表
*/
private
List
<
PalletInfoModel
>
palletInfoModels
;
@Data
public
static
class
PalletInfoModel
{
/**
* 托盘号
*/
private
String
inContainer
;
/**
* 箱号
*/
private
String
container
;
/**
* 产品代码
*/
private
String
productNo
;
/**
* 产品名称
*/
private
String
productName
;
/**
* 批次号
*/
private
String
lotNo
;
/**
* 箱中产品数量
*/
private
Integer
quantity
;
}
}
\ No newline at end of file
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/momo/bean/response/FgGetPalletInfoResponse.java
0 → 100644
查看文件 @
075d682
package
com
.
neotel
.
smfcore
.
custom
.
aiqingzhiyin1643
.
momo
.
bean
.
response
;
import
lombok.Data
;
import
java.util.List
;
/**
* 托盘信息查询响应类
* 封装接口返回的完整响应数据结构(移除Get/Set方法)
*/
@Data
public
class
FgGetPalletInfoResponse
{
/**
* 错误码(为空表示无错误)
*/
private
String
errorCode
;
/**
* 请求是否成功(true=成功,false=失败)
*/
private
Boolean
isSuccess
;
/**
* 响应消息(如"OK")
*/
private
String
message
;
/**
* 响应结果码:"200"=成功,"403"=失败
*/
private
String
result
;
/**
* 调试信息(为空表示无调试内容)
*/
private
String
debugInfo
;
/**
* 核心数据:托盘-产品关联信息列表
*/
private
List
<
PalletProductInfo
>
data
;
/**
* 托盘-产品关联信息(Data列表的元素类型)
*/
@Data
public
static
class
PalletProductInfo
{
/**
* 托盘号
*/
private
String
inContainer
;
/**
* 箱号
*/
private
String
container
;
/**
* 产品代码
*/
private
String
productNo
;
/**
* 产品名称
*/
private
String
productName
;
/**
* 批次号
*/
private
String
lotNo
;
/**
* 箱中产品数量
*/
private
Integer
quantity
;
/**
* 遏制状态:1=在遏制中,0=未被遏制
*/
private
Integer
hold
;
}
}
\ No newline at end of file
src/main/resources/config/application.yml
查看文件 @
075d682
...
...
@@ -27,6 +27,12 @@ api:
#出库通知
stockOutUrl
:
http://10.42.49.150/Apriso/HttpServices/api/extensions/1/Storage/StockOut
#成品仓相关的接口
#获取成品仓托盘信息
fgGetPalletInfoUrl
:
http://10.42.49.150/Apriso/HttpServices/api/extensions/1/Storage/FGGetPalletInfo
#成品仓入库
fGStockINUrl
:
http://10.42.49.150/Apriso/HttpServices/api/extensions/1/Storage/FGStockIN
hella
:
#host: 127.0.0.1
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论