Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit e3ed0308
由
hc
编写于
2024-07-06 16:11:25 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
add:gr手动入库缓存gr已入账信息接口
1 个父辈
9e618aba
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
101 行增加
和
67 行删除
src/main/java/com/neotel/smfcore/common/init/DataInitManager.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/manual/ManualGrPutInController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/GrUtil.java
src/main/java/com/neotel/smfcore/common/init/DataInitManager.java
查看文件 @
e3ed030
...
...
@@ -201,9 +201,9 @@ public class DataInitManager {
//手动入库
addNewFunctionMenu
(
1
,
manual
,
"manualWarehous"
,
"手动入库"
,
"manualWarehous"
,
"manualWarehous/index"
,
"manualWa"
,
functionMenuMap
);
// 手动GR入库虚拟仓
addNewFunctionMenu
(
2
,
manual
,
"manualGrStorage"
,
"
虚拟仓
手动GR入库"
,
"manualGrStorage"
,
"manualGrStorage/index"
,
"manualGrSto"
,
functionMenuMap
);
addNewFunctionMenu
(
2
,
manual
,
"manualGrStorage"
,
"手动GR入库"
,
"manualGrStorage"
,
"manualGrStorage/index"
,
"manualGrSto"
,
functionMenuMap
);
// 手动GR入库
addNewFunctionMenu
(
3
,
manual
,
"manualGrStorageVirtual"
,
"手动GR入库"
,
"manualGrStorageVirtual"
,
"manualGrStorageVirtual/index"
,
"manualGrStoVirt"
,
functionMenuMap
);
addNewFunctionMenu
(
3
,
manual
,
"manualGrStorageVirtual"
,
"
虚拟仓
手动GR入库"
,
"manualGrStorageVirtual"
,
"manualGrStorageVirtual/index"
,
"manualGrStoVirt"
,
functionMenuMap
);
Menu
doc
=
Menu
.
CreatePMenu
(
"单据操作"
,
5
,
"doc"
,
1
,
"docOp"
,
raw
);
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/manual/ManualGrPutInController.java
查看文件 @
e3ed030
...
...
@@ -8,7 +8,9 @@ import com.neotel.smfcore.common.utils.SecurityUtils;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.api.SmfApi
;
import
com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager
;
import
com.neotel.smfcore.core.barcode.service.manager.IComponentManager
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.service.po.Component
;
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
;
...
...
@@ -19,15 +21,19 @@ 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.luxsan.api.LuxsanApi
;
import
com.neotel.smfcore.custom.luxsan.api.bean.request.BrandQtyRequest
;
import
com.neotel.smfcore.custom.luxsan.api.bean.request.NewLabelToCellRequest
;
import
com.neotel.smfcore.custom.luxsan.api.bean.request.QueryGrStatusRequest
;
import
com.neotel.smfcore.custom.luxsan.api.bean.result.BrandQtyResult
;
import
com.neotel.smfcore.custom.luxsan.api.bean.result.NewLabelToCellResult
;
import
com.neotel.smfcore.custom.luxsan.api.bean.result.QueryGrStatusResult
;
import
com.neotel.smfcore.custom.luxsan.factory_c.common.util.CommonUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.GrUdNum
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.dto.QueryGrStatusDto
;
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.GrUtil
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -65,6 +71,9 @@ public class ManualGrPutInController {
@Autowired
private
DataCache
dataCache
;
@Autowired
private
IComponentManager
componentManager
;
@ApiOperation
(
"获取GR已过账的列表"
)
@RequestMapping
(
"/grStatus"
)
...
...
@@ -88,6 +97,14 @@ public class ManualGrPutInController {
return
ResultBean
.
newOkResult
(
QueryGrStatusDto
.
convertQueryGrStatusResultDto
(
queryGrStatusList
));
}
@ApiOperation
(
"缓存已过帐缓存信息"
)
@RequestMapping
(
"/bindGrUdQty"
)
@AnonymousAccess
public
ResultBean
bindGrUdQty
(
@RequestBody
GrUdNum
grUdNum
)
{
GrUtil
.
updateGrUdQty
(
grUdNum
.
getGrCode
(),
grUdNum
.
getGrItem
(),
grUdNum
.
getUdQty
(),
grUdNum
.
getLotQty
());
return
ResultBean
.
newOkResult
(
""
);
}
@ApiOperation
(
"获取料箱信息"
)
@RequestMapping
(
"/getBoxInfo"
)
@AnonymousAccess
...
...
@@ -104,12 +121,16 @@ public class ManualGrPutInController {
@AnonymousAccess
public
synchronized
ResultBean
reelToBox
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
String
binCode
=
paramMap
.
get
(
"binCode"
);
//料格信息
String
udCode
=
paramMap
.
get
(
"udCode"
);
//过账编码
String
codeStr
=
paramMap
.
get
(
"codeStr"
);
//条码信息
String
warhouseCode
=
paramMap
.
get
(
"warhouseCode"
);
//库别
String
grCode
=
paramMap
.
get
(
"grCode"
);
//GrCode
String
grCode
=
paramMap
.
get
(
"grCode"
);
//GrItem
String
grItem
=
paramMap
.
get
(
"grItem"
);
//GrCode
String
boxStr
=
paramMap
.
get
(
"boxStr"
);
//料箱信息
Integer
udQty
=
Double
.
valueOf
(
paramMap
.
get
(
"udQty"
)).
intValue
();
Integer
lotQty
=
Double
.
valueOf
(
paramMap
.
get
(
"lotQty"
)).
intValue
();
log
.
info
(
"人工GR入库,料格信息为:"
+
binCode
+
",过账编码为:"
+
udCode
+
"条码信息为:"
+
codeStr
);
...
...
@@ -132,10 +153,38 @@ public class ManualGrPutInController {
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"料箱信息"
});
}
Barcode
noDbBarcode
=
codeResolve
.
resolveCode
(
codeStr
);
if
(
noDbBarcode
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.noValidCode"
,
"条码无效"
);
}
int
w
=
7
;
int
h
=
8
;
Component
component
=
componentManager
.
findByPartNumberAndProvider
(
noDbBarcode
.
getPartNumber
(),
noDbBarcode
.
getProvider
());
if
(
component
==
null
)
{
BrandQtyResult
result
=
LuxsanApi
.
brandQtyUrl
(
new
BrandQtyRequest
(
noDbBarcode
.
getPartNumber
(),
noDbBarcode
.
getPartNumber
()));
if
(
result
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"未找到对应的尺寸信息"
);
}
w
=
result
.
getReel_size
();
if
(
w
==
7
)
{
h
=
8
;
}
else
if
(
w
==
13
)
{
h
=
24
;
}
else
if
(
w
==
15
)
{
h
=
32
;
}
}
else
{
w
=
component
.
getPlateSize
();
h
=
component
.
getHeight
();
}
//判断条码是否正常
Barcode
barcode
=
null
;
try
{
barcode
=
codeResolve
.
resolveOneValideBarcode
(
codeStr
);
barcode
=
codeResolve
.
resolveOneValideBarcode
(
"="
+
w
+
"x"
+
h
+
"="
+
codeStr
);
}
catch
(
ValidateException
ve
)
{
return
ResultBean
.
newErrorResult
(-
1
,
ve
.
getMsgKey
(),
ve
.
getDefaultMsg
());
}
...
...
@@ -190,6 +239,7 @@ public class ManualGrPutInController {
inPos
.
setBarcode
(
boxBarcode
);
storagePosManager
.
save
(
inPos
);
}
GrUtil
.
updateGrUdQty
(
grCode
,
grItem
,
udQty
,
lotQty
);
return
ResultBean
.
newOkResult
(
BoxHandleUtil
.
getBoxInfo
(
boxStr
));
}
}
...
...
@@ -278,79 +328,63 @@ public class ManualGrPutInController {
}
Barcode
boxBarcode
=
codeResolve
.
resolveOneValideBarcode
(
boxStr
);
//1.判断有没有正在执行的任务
List
<
DataLog
>
taskList
=
taskService
.
getAllTasks
();
StoragePos
newPos
=
null
;
if
(
boxBarcode
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.invalid"
,
"条码无效"
);
}
for
(
DataLog
dataLog
:
taskList
)
{
if
(
boxStr
.
startsWith
(
dataLog
.
getBarcode
()))
{
if
(!
dataLog
.
isFinished
()
&&
!
dataLog
.
isCancel
())
{
if
(
dataLog
.
isPutInTask
())
{
//return ResultBean.newOkResult(dataLog);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"有正在执行的入库任务,请确认"
);
}
else
{
log
.
info
(
boxStr
+
"有正在执行的出库任务,服务器更改状态为完成"
);
dataLog
.
setStatus
(
OP_STATUS
.
FINISHED
.
name
());
taskService
.
updateFinishedTask
(
dataLog
);
}
//1.判断是否有正在入库的任务
for
(
DataLog
dataLog
:
taskService
.
getAllTasks
())
{
if
(!
dataLog
.
isCancel
()
&&
!
dataLog
.
isFinished
()
&&
dataLog
.
getBarcode
().
equals
(
boxBarcode
.
getBarcode
()))
{
if
(
dataLog
.
isPutInTask
())
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"有正在执行的入库任务,请确认"
);
}
else
{
log
.
info
(
boxStr
+
"有正在执行的出库任务,服务器更改状态为完成"
);
dataLog
.
setStatus
(
OP_STATUS
.
FINISHED
.
name
());
taskService
.
updateFinishedTask
(
dataLog
);
}
}
}
if
(
posName
==
null
)
{
//2.获取空库位
newPos
=
BoxHandleUtil
.
locOnePos
(
boxBarcode
);
if
(
newPos
==
null
)
{
//2.判断传过来的库位是否为空,为空入到智能仓
if
(
StringUtils
.
isEmpty
(
posName
))
{
StoragePos
pos
=
BoxHandleUtil
.
locOnePos
(
boxBarcode
);
if
(
pos
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"未找到可用库位"
);
}
}
else
{
//2.判断库位是否存在
newPos
=
storagePosManager
.
getByPosName
(
posName
);
taskList
=
taskService
.
getAllTasks
();
for
(
DataLog
dataLog
:
taskList
)
{
if
(
dataLog
.
getPosName
().
equals
(
posName
))
{
if
(!
dataLog
.
isFinished
()
&&
!
dataLog
.
isCancel
())
{
//if (dataLog.isPutInTask()) {
return
ResultBean
.
newErrorResult
(-
1
,
""
,
posName
+
"有正在执行的任务,请确认"
);
//}
}
}
}
if
(
newPos
==
null
)
{
return
ResultBean
.
newErrorResult
(-
2
,
"smfcore.error.pos.notExist"
,
"[{0}]库位不存在"
,
new
String
[]{
posName
});
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
DataLog
dataLog
=
taskService
.
addPutInTaskToExecute
(
storage
,
boxBarcode
,
pos
,
TaskCurrentLoc
.
Manual_DischargeHole
);
return
ResultBean
.
newOkResult
(
""
);
}
//如果不为空,则入到虚拟仓
else
{
//判断虚拟仓库位是否存在
StoragePos
pos
=
storagePosManager
.
getByPosName
(
posName
);
if
(
pos
==
null
){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"对应的虚拟仓库位"
+
posName
+
"不存在"
);
}
//3.库位是否存了料箱
if
(
ObjectUtil
.
isNotNull
(
newPos
.
getBarcode
())
&&
!
newPos
.
getBarcode
().
getBarcode
().
equals
(
boxStr
))
{
return
ResultBean
.
newErrorResult
(-
4
,
"smfcore.error.pos.hasReel"
,
"库位[{0}]中已有物料,无法入库"
,
new
String
[]{
posName
}
);
String
storageId
=
pos
.
getStorageId
();
Storage
storage
=
dataCache
.
getStorageById
(
storageId
);
if
(
storage
==
null
||
!
storage
.
isVirtual
())
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
posName
+
"不属于虚拟仓的库位"
);
}
// 库位置空
if
(
ObjectUtil
.
isNotNull
(
newPos
.
getBarcode
()))
{
newPos
.
setBarcode
(
null
);
newPos
.
setUsed
(
false
);
Barcode
barcode
=
pos
.
getBarcode
();
if
(
barcode
!=
null
){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
posName
+
"已经存在料箱:"
+
barcode
.
getBarcode
());
}
}
String
oldPosName
=
boxBarcode
.
getPosName
();
//将料箱原来的库位置空
StoragePos
oldPos
=
null
;
if
(
oldPosName
!=
null
)
{
oldPos
=
storagePosManager
.
getByPosName
(
oldPosName
);
}
// 将原先库位清空,特别的当原先库位和当前库位相同时不清空
if
(
oldPos
!=
null
&&
!
oldPos
.
getPosName
().
equals
(
newPos
.
getPosName
()))
{
// 原先已被存储在oldPos
oldPos
.
setBarcode
(
null
);
oldPos
.
setUsed
(
false
);
}
//4.生成入库任务
taskService
.
addTaskToFinished
(
newPos
,
boxBarcode
,
SecurityUtils
.
getLoginUsername
());
// 入库成功后刷新旧的库位信息
if
(
oldPos
!=
null
&&
!
oldPos
.
isUsed
())
{
storagePosManager
.
save
(
oldPos
);
//判断当前箱子是否在其他库位中
StoragePos
oldPos
=
storagePosManager
.
getByBarcode
(
boxBarcode
.
getBarcode
());
if
(
oldPos
!=
null
){
oldPos
.
setBarcode
(
null
);
oldPos
.
setUsed
(
false
);
storagePosManager
.
save
(
oldPos
);
}
taskService
.
addTaskToFinished
(
pos
,
boxBarcode
,
"虚拟入库"
);
return
ResultBean
.
newOkResult
(
""
);
}
return
ResultBean
.
newOkResult
(
"ok"
);
}
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/GrUtil.java
查看文件 @
e3ed030
...
...
@@ -21,7 +21,7 @@ public class GrUtil {
GrUtil
.
dataCache
=
cache
;
}
p
rivate
synchronized
static
void
updateGrUdQty
(
String
grCode
,
String
grItem
,
int
udQty
,
int
lotQty
)
{
p
ublic
synchronized
static
void
updateGrUdQty
(
String
grCode
,
String
grItem
,
int
udQty
,
int
lotQty
)
{
Map
<
String
,
GrUdNum
>
cacheMap
=
dataCache
.
getCache
(
CACHE_GR_UDQTY
);
if
(
cacheMap
==
null
)
{
cacheMap
=
Maps
.
newConcurrentMap
();
...
...
@@ -31,7 +31,7 @@ public class GrUtil {
dataCache
.
updateCache
(
CACHE_GR_UDQTY
,
cacheMap
);
}
p
rivate
static
GrUdNum
getGrUdQty
(
String
grCode
,
String
grItem
){
p
ublic
static
GrUdNum
getGrUdQty
(
String
grCode
,
String
grItem
){
Map
<
String
,
GrUdNum
>
cacheMap
=
dataCache
.
getCache
(
CACHE_GR_UDQTY
);
if
(
cacheMap
==
null
)
{
cacheMap
=
Maps
.
newConcurrentMap
();
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论