Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit ae524b11
由
zshaohui
编写于
2024-06-17 17:52:07 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
pk出库时,先调用接口 判断是否ng
1 个父辈
6d3c0d5d
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
109 行增加
和
17 行删除
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/util/BoxUtil.java
src/main/java/com/neotel/smfcore/custom/luxsan/api/LuxsanApi.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/CDeviceController.java
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/util/BoxUtil.java
查看文件 @
ae524b1
...
...
@@ -47,7 +47,7 @@ public class BoxUtil {
public
static
String
getBoxStr
(
String
str
)
{
String
boxStr
=
""
;
if
(
StringUtils
.
isNotBlank
(
str
))
{
if
(
str
.
startsWith
(
"C
S"
)
||
str
.
startsWith
(
"CM"
)
||
str
.
startsWith
(
"CB
"
))
{
if
(
str
.
startsWith
(
"C
07"
)
||
str
.
startsWith
(
"C13"
)
||
str
.
startsWith
(
"C15
"
))
{
if
(
str
.
endsWith
(
"A"
)
||
str
.
endsWith
(
"B"
))
{
boxStr
=
str
.
substring
(
0
,
str
.
length
()
-
1
);
}
else
if
(
str
.
indexOf
(
"-"
)
!=
-
1
)
{
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/api/LuxsanApi.java
查看文件 @
ae524b1
...
...
@@ -266,10 +266,10 @@ public class LuxsanApi extends DefaultSmfApiListener {
String
resultStr
=
HttpHelper
.
postJson
(
pickingIssueUrl
,
request
);
log
.
info
(
"pickingIssue接口返回结果为:"
+
resultStr
);
/*
LuxsanApiResult apiResult = JSONObject.parseObject(resultStr, LuxsanApiResult.class);
LuxsanApiResult
apiResult
=
JSONObject
.
parseObject
(
resultStr
,
LuxsanApiResult
.
class
);
if
(
LuxsanApiEnum
.
ERROR
.
equals
(
apiResult
.
getMSGTY
()))
{
throw
new
ValidateException
(
"smfcore.api.error"
,
"接口请求失败[{0}]"
,
new
String
[]{
apiResult
.
getMSGTX
()});
}
*/
}
}
catch
(
ApiException
e
)
{
log
.
error
(
"pickingIssue请求失败:"
+
e
.
getMessage
());
throw
new
ValidateException
(
"smfcore.api.error"
,
"接口请求失败[{0}]"
,
new
String
[]{
e
.
getMessage
()});
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/CDeviceController.java
查看文件 @
ae524b1
package
com
.
neotel
.
smfcore
.
custom
.
luxsan
.
factory_c
.
rawstor
.
controller
;
import
cn.hutool.extra.spring.SpringUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.neotel.smfcore.common.bean.ReelLockPosInfo
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.DateUtil
;
import
com.neotel.smfcore.common.utils.ReelLockPosUtil
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.api.SmfApi
;
import
com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager
;
...
...
@@ -26,6 +23,7 @@ import com.neotel.smfcore.core.storage.service.po.Storage;
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.agvBox.util.BoxUtil
;
import
com.neotel.smfcore.custom.luxsan.api.LuxsanApi
;
import
com.neotel.smfcore.custom.luxsan.api.bean.request.*
;
import
com.neotel.smfcore.custom.luxsan.api.bean.result.BinMoveResult
;
...
...
@@ -33,10 +31,8 @@ import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.BindGrInfo;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.StorTransfer
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.TicketReturn
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.TicketTransfer
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.dto.CtuTask
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.dto.ValidBin
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.enums.LiteorderCheckType
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.enums.TaskCurrentLoc
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.BinCacheUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.BoxHandleUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.MaterialUtil
;
...
...
@@ -46,8 +42,6 @@ import com.neotel.smfcore.security.annotation.AnonymousAccess;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.logging.log4j.util.Strings
;
import
org.ehcache.impl.internal.concurrent.ConcurrentHashMap
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -473,7 +467,11 @@ public class CDeviceController {
//4.开始生成出库任务
log
.
info
(
barcode
.
getBarcode
()
+
"从"
+
boxStr
+
"出库,序列号为:"
+
seq
);
DataLog
dataLog
=
new
DataLog
(
new
Storage
(),
barcode
,
new
StoragePos
());
if
(!
barcode
.
isOut
()){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getPosName
()+
"没有要出库的料盘"
);
}
String
orderItemId
=
barcode
.
getOrderItemId
();
LiteOrderItem
orderItem
=
null
;
...
...
@@ -502,6 +500,52 @@ public class CDeviceController {
}
}
//通知WMS
if
(
checkType
==
LiteorderCheckType
.
PICKING_CHECKOUT
){
try
{
LuxsanApi
.
pickingIssue
(
new
PickingIssueRequest
(
CommonUtil
.
plantCode
,
orderNo
,
pkItemId
,
barcode
.
getPartNumber
()
,
barcode
.
getWarehouseCode
(),
brand
,
face
,
batchCode
,
Arrays
.
asList
(
barcode
.
getBarcode
())));
}
catch
(
Exception
e
)
{
log
.
info
(
barcode
.
getBarcode
()
+
"PK发料失败:"
+
e
.
getMessage
()
+
",隔口:"
+
barcode
.
getPosName
()
+
"需要清空出库信息"
);
List
<
Barcode
>
newSubCodeList
=
new
ArrayList
<>();
for
(
Barcode
subCode
:
boxBarcode
.
getSubCodeList
())
{
if
(
subCode
.
isOut
()){
if
(
barcode
.
getPosName
().
equals
(
subCode
.
getPosName
())){
newSubCodeList
.
add
(
subCode
);
}
}
}
for
(
Barcode
subCode
:
newSubCodeList
)
{
if
(
subCode
.
isOut
()){
if
(
barcode
.
getPosName
().
equals
(
subCode
.
getPosName
())){
String
itemId
=
subCode
.
getOrderItemId
();
subCode
.
setOut
(
false
);
subCode
.
setSelectMsg
(
null
);
subCode
.
setOrderItemId
(
null
);
barcodeManager
.
save
(
subCode
);
boxBarcode
.
updateSubCodes
(
subCode
);
//生成任务
generateTask
(
subCode
,
OP_STATUS
.
CANCEL
.
name
(),
subCode
.
getAmount
(),
OP
.
CHECKOUT
,
itemId
,
""
,
0
,
false
);
log
.
info
(
subCode
.
getBarcode
()+
"隔口为:"
+
subCode
.
getPosName
()+
"需清除出库标记"
);
}
}
}
barcodeManager
.
save
(
boxBarcode
);
if
(
inPos
!=
null
){
inPos
.
setBarcode
(
boxBarcode
);
storagePosManager
.
save
(
inPos
);
}
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getBarcode
()
+
"请求PK发料失败,隔口:"
+
barcode
.
getPosName
()
+
"出库信息已清空"
);
}
}
DataLog
dataLog
=
new
DataLog
(
new
Storage
(),
barcode
,
new
StoragePos
());
dataLog
.
setSubSourceId
(
orderItemId
);
dataLog
.
setSourceId
(
orderId
);
...
...
@@ -529,12 +573,6 @@ public class CDeviceController {
barcode
.
setOrderItemId
(
""
);
barcode
.
setBarSource
(
""
);
barcodeManager
.
saveBarcode
(
barcode
);
//通知WMS
if
(
checkType
==
LiteorderCheckType
.
PICKING_CHECKOUT
){
LuxsanApi
.
pickingIssue
(
new
PickingIssueRequest
(
CommonUtil
.
plantCode
,
orderNo
,
pkItemId
,
barcode
.
getPartNumber
()
,
barcode
.
getWarehouseCode
(),
brand
,
face
,
batchCode
,
Arrays
.
asList
(
barcode
.
getBarcode
())));
}
return
ResultBean
.
newOkResult
(
""
);
}
...
...
@@ -873,4 +911,58 @@ public class CDeviceController {
dataLog
.
setWarehouseCode
(
barcode
.
getWarehouseCode
());
taskService
.
updateQueueTask
(
dataLog
);
}
private
DataLog
generateTask
(
Barcode
barcode
,
String
opStatus
,
int
opQty
,
int
opType
,
String
orderItemId
,
String
name
,
int
extendType
,
boolean
isBoxOut
)
{
//生成任务
DataLog
task
=
new
DataLog
();
task
.
setStatus
(
opStatus
);
task
.
setPartNumber
(
barcode
.
getPartNumber
());
task
.
setBarcode
(
barcode
.
getBarcode
());
task
.
setNum
(
opQty
);
task
.
setType
(
opType
);
task
.
setPosName
(
barcode
.
getPosName
());
//task.setOperator(SecurityUtils.getCurrentUsername());
task
.
setDateCode
(
barcode
.
getDateCode
());
task
.
setBatchInfo
(
barcode
.
getBatch
());
task
.
setProvider
(
barcode
.
getProvider
());
task
.
setProviderNumber
(
barcode
.
getProviderNumber
());
task
.
setKeeperCode
(
barcode
.
getKeeperCode
());
//task.setReelPosName(barcode.getPosName());
task
.
setSubSourceId
(
orderItemId
);
task
.
setWarehouseCode
(
barcode
.
getWarehouseCode
());
task
.
setStationName
(
name
);
task
.
setExtendType
(
extendType
);
if
(
StringUtils
.
isNotBlank
(
orderItemId
))
{
LiteOrderItem
orderItem
=
liteOrderItemManager
.
get
(
orderItemId
);
if
(
orderItem
!=
null
)
{
task
.
setSourceName
(
orderItem
.
getOrderNo
());
task
.
setLine
(
orderItem
.
getLine
());
task
.
setMo
(
orderItem
.
getMo
());
task
.
setSide
(
orderItem
.
getSide
());
task
.
setPlantCode
(
orderItem
.
getPlantCode
());
task
.
setOrderNo
(
orderItem
.
getOrderNo
());
task
.
setSubSourceId
(
orderItem
.
getId
());
task
.
setManualUpload
(
orderItem
.
isManualUpload
());
}
}
//如果是出库任务,增加库位
if
(
task
.
isCheckOutTask
())
{
String
boxStr
=
BoxUtil
.
getBoxStr
(
barcode
.
getPosName
());
String
posName
=
taskService
.
getPosName
(
boxStr
);
if
(
StringUtils
.
isNotBlank
(
posName
))
{
task
.
setStoragePosName
(
posName
);
}
}
task
.
setBoxOut
(
isBoxOut
);
if
(
barcode
.
getPutInTime
()
!=
-
1
)
{
task
.
setFristPutInDate
(
new
Date
(
barcode
.
getPutInTime
()));
}
else
{
task
.
setFristPutInDate
(
barcode
.
getPutInDate
());
}
task
.
setDescribe
(
barcode
.
getDescribe
());
taskService
.
updateFinishedTask
(
task
);
return
task
;
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论