Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit d4aa3ee7
由
zshaohui
编写于
2024-07-15 09:43:48 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.增加退库上架
2.取消任务,同时更新储位信息
1 个父辈
1fef67f3
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
176 行增加
和
4 行删除
src/main/java/com/neotel/smfcore/common/init/DataInitManager.java
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
src/main/java/com/neotel/smfcore/custom/luxsan/api/bean/request/BackToWarehouseRequest.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/MaterialUtil.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/wipstor/controller/OdnCheckOutExpController.java
src/main/java/com/neotel/smfcore/common/init/DataInitManager.java
查看文件 @
d4aa3ee
...
...
@@ -196,6 +196,9 @@ public class DataInitManager {
addNewFunctionMenu
(
4
,
raw
,
"storageTransfer"
,
"储位转移"
,
"storageTransfer"
,
"storageTransfer/index"
,
"transfer"
,
functionMenuMap
);
addNewFunctionMenu
(
8
,
raw
,
"returnInventoryAndPutShelves"
,
"退货上架"
,
"returnInventoryAndPutShelves"
,
"returnInventoryAndPutShelves/index"
,
""
,
functionMenuMap
);
Menu
manual
=
Menu
.
CreatePMenu
(
"手动出入库"
,
5
,
"manual"
,
2
,
"manual"
,
raw
);
//手动入库
...
...
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
查看文件 @
d4aa3ee
...
...
@@ -345,6 +345,7 @@ public class TaskService {
}
else
if
(
barcode
!=
null
&&
task
.
getBarcode
().
equals
(
barcode
.
getBarcode
()))
{
barcode
=
clearOut
(
barcode
);
storagePos
.
setBarcode
(
barcode
);
storagePosManager
.
save
(
storagePos
);
//disablePos(task.getBarcode(),storagePos);
}
}
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/api/bean/request/BackToWarehouseRequest.java
查看文件 @
d4aa3ee
package
com
.
neotel
.
smfcore
.
custom
.
luxsan
.
api
.
bean
.
request
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
...
...
@@ -8,6 +10,8 @@ import java.util.List;
* 电子料入退库 请求
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
BackToWarehouseRequest
{
/**
...
...
@@ -20,6 +24,9 @@ public class BackToWarehouseRequest {
*/
private
String
BIN_CODE
;
//退回大库: return 退回料塔: return_tower
private
String
RETURN_TYPE
;
/**
* 料卷清单
*/
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/CDeviceController.java
查看文件 @
d4aa3ee
...
...
@@ -26,13 +26,11 @@ 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.BackToWarehouseResult
;
import
com.neotel.smfcore.custom.luxsan.api.bean.result.BinMoveResult
;
import
com.neotel.smfcore.custom.luxsan.api.bean.result.NewLabelToCellResult
;
import
com.neotel.smfcore.custom.luxsan.api.bean.result.TicketUpResult
;
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.*
;
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
;
...
...
@@ -125,6 +123,10 @@ public class CDeviceController {
log
.
info
(
codeStr
+
":绑定单据转库信息为:"
+
JSON
.
toJSONString
(
ticketTransfer
));
resultMap
.
put
(
"w"
,
ticketTransfer
.
getW
());
resultMap
.
put
(
"h"
,
ticketTransfer
.
getH
());
}
else
if
(
MaterialUtil
.
returnTower
(
codeStr
)){
ReturnTower
returnTower
=
MaterialUtil
.
getReturnTowerInfo
(
codeStr
);
resultMap
.
put
(
"w"
,
returnTower
.
getW
());
resultMap
.
put
(
"h"
,
returnTower
.
getH
());
}
return
ResultBean
.
newOkResult
(
resultMap
);
}
...
...
@@ -213,6 +215,7 @@ public class CDeviceController {
//绑定gr
if
(
MaterialUtil
.
bindGr
(
materialStr
))
{
log
.
info
(
materialStr
+
"绑定Gr入库,barcode为:"
+
barcode
.
getBarcode
());
BindGrInfo
bindGrInfo
=
MaterialUtil
.
getBindGrInfo
(
materialStr
);
NewLabelToCellResult
cell
=
LuxsanApi
.
newLabelToCell
(
new
NewLabelToCellRequest
(
CommonUtil
.
plantCode
,
...
...
@@ -228,6 +231,7 @@ public class CDeviceController {
//储位移转
else
if
(
MaterialUtil
.
storTransfer
(
materialStr
)){
log
.
info
(
materialStr
+
"绑定储位移转,barcode为:"
+
barcode
.
getBarcode
());
BinMoveResult
binMoveResult
=
LuxsanApi
.
binMove
(
new
BinMoveRequest
(
CommonUtil
.
plantCode
,
binCodeStr
,
Arrays
.
asList
(
barcode
.
getBarcode
()),
barcode
.
getAmount
(),
barcode
.
getLabelId
()));
if
(
StringUtils
.
isNotEmpty
(
binMoveResult
.
getGR_DATE
())){
Date
grDate
=
DateUtil
.
getNoTimeDate
(
binMoveResult
.
getGR_DATE
());
...
...
@@ -238,6 +242,7 @@ public class CDeviceController {
//311单据转库
else
if
(
MaterialUtil
.
ticketTransfer
(
materialStr
))
{
log
.
info
(
materialStr
+
"绑定单据转库,barcode为:"
+
barcode
.
getBarcode
());
TicketTransfer
transfer
=
MaterialUtil
.
getTicketTransferInfo
(
materialStr
);
TicketPickRequest
request
=
new
TicketPickRequest
();
request
.
setPLANT_CODE
(
CommonUtil
.
plantCode
);
...
...
@@ -258,11 +263,22 @@ public class CDeviceController {
//单据退库上架
else
if
(
MaterialUtil
.
ticketReturn
(
materialStr
)){
log
.
info
(
materialStr
+
"绑定单据退库上架,barcode为:"
+
barcode
.
getBarcode
());
TicketReturn
ticketReturn
=
MaterialUtil
.
getTicketReturnInfo
(
materialStr
);
TicketUpResult
ticketUp
=
LuxsanApi
.
ticketUp
(
new
TicketUpRequest
(
CommonUtil
.
plantCode
,
ticketReturn
.
getTicket
(),
ticketReturn
.
getTicketItem
(),
binCodeStr
,
Arrays
.
asList
(
barcode
.
getBarcode
()),
barcode
.
getAmount
()));
barcode
.
setLabelId
(
ticketUp
.
getLABEL_ID
());
}
//退库上架
else
if
(
MaterialUtil
.
returnTower
(
materialStr
)){
log
.
info
(
materialStr
+
"绑定退库上架,barcode为:"
+
barcode
.
getBarcode
());
BackToWarehouseRequest
request
=
new
BackToWarehouseRequest
();
request
.
setBIN_CODE
(
binCodeStr
);
request
.
setPLANT_CODE
(
CommonUtil
.
plantCode
);
request
.
setRETURN_TYPE
(
"return"
);
request
.
setREEL_LIST
(
Arrays
.
asList
(
barcode
.
getBarcode
()));
LuxsanApi
.
backToWarehouse
(
request
);
}
barcode
.
setPosName
(
binCodeStr
);
barcode
.
setWarehouseCode
(
warhouseCode
);
...
...
@@ -335,6 +351,11 @@ public class CDeviceController {
Map
<
String
,
TicketTransfer
>
cacheMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CHCHE_TICKET_TRANSFER
);
cacheMap
.
remove
(
materialStr
);
dataCache
.
updateCache
(
CacheNameUtil
.
CHCHE_TICKET_TRANSFER
,
cacheMap
);
}
else
if
(
MaterialUtil
.
returnTower
(
materialStr
)){
log
.
info
(
materialStr
+
"绑定退库,需清空"
);
Map
<
String
,
ReturnTower
>
cacheMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CHCHE_RETURN_TOWER
);
cacheMap
.
remove
(
materialStr
);
dataCache
.
updateCache
(
CacheNameUtil
.
CHCHE_RETURN_TOWER
,
cacheMap
);
}
return
ResultBean
.
newOkResult
(
""
);
}
...
...
@@ -717,6 +738,10 @@ public class CDeviceController {
partNumber
=
bindGrInfo
.
getMaterialCode
();
provider
=
bindGrInfo
.
getBrand
();
dateStr
=
bindGrInfo
.
getGrDate
();
}
else
if
(
MaterialUtil
.
returnTower
(
stackerId
)){
ReturnTower
returnTower
=
MaterialUtil
.
getReturnTowerInfo
(
stackerId
);
partNumber
=
returnTower
.
getMaterialStr
();
provider
=
returnTower
.
getProvider
();
}
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/MaterialUtil.java
查看文件 @
d4aa3ee
...
...
@@ -37,6 +37,9 @@ public class MaterialUtil {
}
else
if
(
ticketTransfer
(
materialStr
)){
TicketTransfer
ticketTransfer
=
getTicketTransferInfo
(
materialStr
);
return
StringUtils
.
isNotEmpty
(
ticketTransfer
.
getDstWarehouseCode
())
?
ticketTransfer
.
getDstWarehouseCode
()
:
ticketTransfer
.
getSrcWarehouseCode
();
}
else
if
(
returnTower
(
materialStr
)){
ReturnTower
returnTowerInfo
=
getReturnTowerInfo
(
materialStr
);
return
returnTowerInfo
.
getWarehouseCode
();
}
return
""
;
}
...
...
@@ -141,6 +144,17 @@ public class MaterialUtil {
return
false
;
}
public
static
ReturnTower
getReturnTowerInfo
(
String
materialStr
)
{
Map
<
String
,
ReturnTower
>
cacheMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CHCHE_RETURN_TOWER
);
if
(
cacheMap
!=
null
)
{
if
(
cacheMap
.
get
(
materialStr
)
!=
null
)
{
return
cacheMap
.
get
(
materialStr
);
}
}
return
null
;
}
public
static
String
getMaterialSize
(
String
materialStr
)
{
String
size
=
"7"
;
if
(
bindGr
(
materialStr
)){
...
...
@@ -155,6 +169,9 @@ public class MaterialUtil {
}
else
if
(
ticketTransfer
(
materialStr
)){
TicketTransfer
ticketTransfer
=
getTicketTransferInfo
(
materialStr
);
size
=
ticketTransfer
.
getW
()
+
""
;
}
else
if
(
returnTower
(
materialStr
)){
ReturnTower
returnTower
=
getReturnTowerInfo
(
materialStr
);
size
=
returnTower
.
getW
()
+
""
;
}
return
size
;
}
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/wipstor/controller/OdnCheckOutExpController.java
0 → 100644
查看文件 @
d4aa3ee
package
com
.
neotel
.
smfcore
.
custom
.
luxsan
.
factory_c
.
wipstor
.
controller
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.utils.StringUtils
;
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
;
import
com.neotel.smfcore.core.device.enums.OP_STATUS
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.storage.enums.CHECKOUT_TYPE
;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
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.manager.IDataLogManager
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.List
;
@RestController
@RequestMapping
(
"/odnCheckOut"
)
public
class
OdnCheckOutExpController
{
@Autowired
private
CodeResolve
codeResolve
;
@Autowired
private
IDataLogManager
dataLogManager
;
@Autowired
private
IStoragePosManager
storagePosManager
;
@Autowired
private
DataCache
dataCache
;
@Autowired
private
TaskService
taskService
;
@ApiOperation
(
"异常情况重新出库个箱子"
)
@AnonymousAccess
@RequestMapping
(
"/checkReplaceBox"
)
public
ResultBean
checkReplaceBox
(
String
boxStr
){
Barcode
barcode
=
codeResolve
.
resolveOneValideBarcode
(
"=2x2="
+
boxStr
);
if
(
barcode
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.invalid"
,
"条码无效"
);
}
DataLog
dataLog
=
dataLogManager
.
findOne
(
new
Query
(
Criteria
.
where
(
"barcode"
).
is
(
barcode
.
getBarcode
()))
.
with
(
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"createDate"
)));
if
(
dataLog
==
null
||
!
dataLog
.
isCancel
()){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"未找到对应的取消任务"
);
}
if
(
StringUtils
.
isEmpty
(
dataLog
.
getSourceId
())){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"不是对应的odn出库任务"
);
}
String
pn
=
barcode
.
getPn
();
String
warehouseCode
=
barcode
.
getWarehouseCode
();
int
qty
=
barcode
.
getQty
();
List
<
String
>
storageIdList
=
new
ArrayList
<>();
for
(
Storage
storage
:
dataCache
.
getAllStorage
().
values
())
{
storageIdList
.
add
(
storage
.
getId
());
}
Collection
<
String
>
excludePosIds
=
taskService
.
excludePosIds
();
CHECKOUT_TYPE
checkOutType
=
dataCache
.
getCheckOutType
();
boolean
tag
=
true
;
StoragePos
pos
=
null
;
while
(
tag
){
StoragePos
storagePos
=
storagePosManager
.
findPartNumberInStorages
(
storageIdList
,
pn
,
excludePosIds
,
checkOutType
,
warehouseCode
);
if
(
storagePos
==
null
){
tag
=
false
;
break
;
}
Barcode
posBarcode
=
storagePos
.
getBarcode
();
if
(
posBarcode
.
getQty
()
==
qty
){
pos
=
storagePos
;
tag
=
false
;
}
else
{
excludePosIds
.
add
(
storagePos
.
getId
());
}
}
if
(
pos
==
null
){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"未找到可以替代的料箱"
);
}
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
DataLog
newTask
=
new
DataLog
(
storage
,
pos
.
getBarcode
(),
pos
);
newTask
.
setType
(
OP
.
CHECKOUT
);
newTask
.
setSourceName
(
dataLog
.
getSourceName
());
newTask
.
setSourceId
(
dataLog
.
getSourceId
());
newTask
.
setSubSourceId
(
dataLog
.
getSubSourceId
());
newTask
.
setOdn
(
true
);
newTask
.
setCartonId
(
pos
.
getBarcode
().
getCartonId
());
newTask
.
setWarehouseCode
(
pos
.
getBarcode
().
getWarehouseCode
());
taskService
.
addTaskToExecute
(
newTask
);
return
ResultBean
.
newOkResult
(
""
);
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论