Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit ad15d697
由
zshaohui
编写于
2024-08-08 11:58:38 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
UID出库 先通知WMS 再生成出库任务
1 个父辈
7d9cd8a4
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
54 行增加
和
13 行删除
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
src/main/java/com/neotel/smfcore/custom/lizhen/LizhenApi.java
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
查看文件 @
ad15d69
package
com
.
neotel
.
smfcore
.
core
.
storage
.
rest
;
package
com
.
neotel
.
smfcore
.
core
.
storage
.
rest
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.google.common.base.Strings
;
import
com.google.common.base.Strings
;
import
com.google.common.collect.Lists
;
import
com.neotel.smfcore.common.base.IExcelDownLoad
;
import
com.neotel.smfcore.common.base.IExcelDownLoad
;
import
com.neotel.smfcore.common.bean.PageData
;
import
com.neotel.smfcore.common.bean.PageData
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.bean.ResultBean
;
...
@@ -35,7 +35,7 @@ import com.neotel.smfcore.core.system.service.po.DataLog;
...
@@ -35,7 +35,7 @@ import com.neotel.smfcore.core.system.service.po.DataLog;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.custom.lizhen.LizhenApi
;
import
com.neotel.smfcore.custom.lizhen.LizhenApi
;
import
com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType
;
import
com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType
;
import
com.neotel.smfcore.custom.siemens.SiemensApi
;
import
java.lang.String
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
@@ -743,14 +743,14 @@ public class StoragePosController {
...
@@ -743,14 +743,14 @@ public class StoragePosController {
for
(
String
pid
:
pids
)
{
for
(
String
pid
:
pids
)
{
StoragePos
pos
=
storagePosManager
.
get
(
pid
);
StoragePos
pos
=
storagePosManager
.
get
(
pid
);
if
(
pos
==
null
){
if
(
pos
==
null
){
throw
new
ValidateException
(
"smfcore.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"pid"
,
pid
});
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"pid"
,
pid
});
}
}
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
if
(
storage
==
null
){
if
(
storage
==
null
){
throw
new
ValidateException
(
"smfcore.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"storageId"
,
pos
.
getStorageId
()});
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"storageId"
,
pos
.
getStorageId
()});
}
}
if
(
excludePosIds
.
contains
(
pos
.
getId
())){
if
(
excludePosIds
.
contains
(
pos
.
getId
())){
throw
new
ValidateException
(
"smfcore.error.pos.inQueue"
,
"位置:[{0}}]已在操作队列中,操作失败"
,
new
String
[]{
pos
.
getPosName
()});
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.pos.inQueue"
,
"位置:[{0}}]已在操作队列中,操作失败"
,
new
String
[]{
pos
.
getPosName
()});
}
}
needOutPosList
.
add
(
pos
);
needOutPosList
.
add
(
pos
);
}
}
...
@@ -775,22 +775,58 @@ public class StoragePosController {
...
@@ -775,22 +775,58 @@ public class StoragePosController {
String
barcodeStr
=
barcode
.
getBarcode
();
String
barcodeStr
=
barcode
.
getBarcode
();
if
(
checkReelList
!=
null
&&
!
checkReelList
.
isEmpty
()){
if
(
checkReelList
!=
null
&&
!
checkReelList
.
isEmpty
()){
if
(
checkReelList
.
contains
(
barcodeStr
)){
if
(
checkReelList
.
contains
(
barcodeStr
)){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcodeStr
+
"已经被禁用,库位为:"
+
pos
.
getPosName
());
return
ResultBean
.
newErrorResult
(-
2
,
""
,
barcodeStr
+
"已经被禁用,库位为:"
+
pos
.
getPosName
());
}
}
}
}
}
}
}
}
//生成出库任务
//生成出库任务
List
<
String
>
messageList
=
new
ArrayList
<>();
for
(
StoragePos
pos
:
needOutPosList
){
for
(
StoragePos
pos
:
needOutPosList
){
String
message
=
""
;
Barcode
barcode
=
pos
.
getBarcode
();
String
barcodeStr
=
barcode
.
getBarcode
();
String
posName
=
pos
.
getPosName
();
//生成出库任务
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
log
.
info
(
"出库料仓【"
+
storage
.
getName
()
+
"_"
+
storage
.
getCid
()
+
"】位置仓位【"
+
pos
.
getPosName
()
+
"】"
);
DataLog
task
=
new
DataLog
(
storage
,
pos
.
getBarcode
(),
pos
);
String
outResult
=
taskService
.
checkout
(
storage
,
pos
,
isSingleOut
,
SecurityUtils
.
getCurrentUsername
(),
null
,
ExtendType
.
MANUAL_CHECKOUT
);
task
.
setItemNo
(
1
);
if
(!
Strings
.
isNullOrEmpty
(
outResult
))
{
task
.
setPickingId
(
""
);
throw
new
ValidateException
(
"smfcore.error"
,
outResult
);
task
.
setType
(
OP
.
CHECKOUT
);
task
.
setStorageId
(
storage
.
getId
());
task
.
setPutInDate
(
barcode
.
getPutInDate
());
task
.
setSingleOut
(
isSingleOut
);
task
.
setWarehouseCode
(
barcode
.
getWarehouseCode
());
task
.
setDescribe
(
barcode
.
getDescribe
());
task
.
setBatchInfo
(
barcode
.
getBatch
());
task
.
setDateCode
(
barcode
.
getDateCode
());
task
.
setProvider
(
barcode
.
getProvider
());
task
.
setProviderNumber
(
barcode
.
getProviderNumber
());
task
.
setKeeperCode
(
barcode
.
getKeeperCode
());
task
.
setOperator
(
SecurityUtils
.
getLoginUsername
());
String
resultStr
=
lizhenApi
.
towerIssue
(
task
);
if
(
StringUtils
.
isEmpty
(
resultStr
)){
barcode
.
setAskPutIn
(
false
);
barcodeManager
.
save
(
barcode
);
pos
.
setBarcode
(
barcode
);
storagePosManager
.
save
(
pos
);
taskService
.
updateQueueTask
(
task
);
}
else
{
messageList
.
add
(
"条码:"
+
barcodeStr
+
"调用tower发料失败:"
+
resultStr
);
continue
;
}
}
}
}
if
(
messageList
!=
null
&&
!
messageList
.
isEmpty
()){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
JSON
.
toJSONString
(
messageList
));
}
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/LizhenApi.java
查看文件 @
ad15d69
...
@@ -290,7 +290,7 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -290,7 +290,7 @@ public class LizhenApi extends DefaultSmfApiListener {
*/
*/
@Override
@Override
public
void
outTaskStatusChange
(
String
outNotifyUrl
,
DataLog
task
)
{
public
void
outTaskStatusChange
(
String
outNotifyUrl
,
DataLog
task
)
{
if
(
task
.
isFinished
()
&&
StringUtils
.
isEmpty
(
task
.
getSourceId
()))
{
/*
if (task.isFinished() && StringUtils.isEmpty(task.getSourceId())) {
Map<String, Object> paramMap = new HashMap<>();
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("PLANT_CODE", CommonUtil.plantCode);
paramMap.put("PLANT_CODE", CommonUtil.plantCode);
paramMap.put("PICKING_ID", "SMFT"+System.currentTimeMillis());
paramMap.put("PICKING_ID", "SMFT"+System.currentTimeMillis());
...
@@ -318,13 +318,18 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -318,13 +318,18 @@ public class LizhenApi extends DefaultSmfApiListener {
e.printStackTrace();
e.printStackTrace();
log.info(task.getBarcode() + "出库通知,调用Tower发料,异常为:" + e.getMessage());
log.info(task.getBarcode() + "出库通知,调用Tower发料,异常为:" + e.getMessage());
}
}
}
}
*/
}
}
public
String
towerIssue
(
DataLog
task
)
{
public
String
towerIssue
(
DataLog
task
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"PLANT_CODE"
,
CommonUtil
.
plantCode
);
paramMap
.
put
(
"PLANT_CODE"
,
CommonUtil
.
plantCode
);
paramMap
.
put
(
"PICKING_ID"
,
task
.
getPickingId
());
if
(
StringUtils
.
isEmpty
(
task
.
getPickingId
())){
paramMap
.
put
(
"PICKING_ID"
,
"SMFT"
+
System
.
currentTimeMillis
());
}
else
{
paramMap
.
put
(
"PICKING_ID"
,
task
.
getPickingId
());
}
paramMap
.
put
(
"ITEM_NO"
,
task
.
getItemNo
());
paramMap
.
put
(
"ITEM_NO"
,
task
.
getItemNo
());
paramMap
.
put
(
"MATERIAL_CODE"
,
task
.
getPartNumber
());
paramMap
.
put
(
"MATERIAL_CODE"
,
task
.
getPartNumber
());
paramMap
.
put
(
"WAREHOUSE_CODE"
,
task
.
getWarehouseCode
());
paramMap
.
put
(
"WAREHOUSE_CODE"
,
task
.
getWarehouseCode
());
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论