Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit bb317590
由
zshaohui
编写于
2024-10-08 17:16:29 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.判断库位与料箱是否相同
2.料箱从货架中取出,料箱放到货架上,获取所有不在库的库位
1 个父辈
d618b12f
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
203 行增加
和
3 行删除
src/main/java/com/neotel/smfcore/common/init/DataInitManager.java
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/CtuDeviceController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/PkCheckOutController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/RawOutUtil.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/third/RawOutLineController.java
src/main/java/com/neotel/smfcore/common/init/DataInitManager.java
查看文件 @
bb31759
...
@@ -205,6 +205,8 @@ public class DataInitManager {
...
@@ -205,6 +205,8 @@ public class DataInitManager {
addNewFunctionMenu
(
10
,
raw
,
"inventoryHandle"
,
"库存处理"
,
"inventoryHandle"
,
"inventoryHandle/index"
,
"inventoryHandle"
,
functionMenuMap
);
addNewFunctionMenu
(
10
,
raw
,
"inventoryHandle"
,
"库存处理"
,
"inventoryHandle"
,
"inventoryHandle/index"
,
"inventoryHandle"
,
functionMenuMap
);
addNewFunctionMenu
(
11
,
raw
,
"checkHouse"
,
"检验库位"
,
"checkHouse"
,
"checkHouse/index"
,
"checkHouse"
,
functionMenuMap
);
Menu
manual
=
Menu
.
CreatePMenu
(
"手动出入库"
,
5
,
"manual"
,
2
,
"manual"
,
raw
);
Menu
manual
=
Menu
.
CreatePMenu
(
"手动出入库"
,
5
,
"manual"
,
2
,
"manual"
,
raw
);
//手动入库
//手动入库
...
...
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
查看文件 @
bb31759
...
@@ -579,7 +579,7 @@ public class DataCache {
...
@@ -579,7 +579,7 @@ public class DataCache {
* 修改库存,出库为负,入库为正
* 修改库存,出库为负,入库为正
*/
*/
public
int
updateInventory
(
StoragePos
pos
,
Barcode
barcode
){
public
int
updateInventory
(
StoragePos
pos
,
Barcode
barcode
){
Storage
storage
=
getStorageById
(
pos
.
getStorageId
());
/*
Storage storage = getStorageById(pos.getStorageId());
String cid = storage.getCid();
String cid = storage.getCid();
String partNumber = barcode.getPartNumber();
String partNumber = barcode.getPartNumber();
...
@@ -601,7 +601,8 @@ public class DataCache {
...
@@ -601,7 +601,8 @@ public class DataCache {
}
}
}
}
allStorage.put(cid, storage);
allStorage.put(cid, storage);
return
updateInventoryAmount
(
cid
,
partNumber
,
amount
);
return updateInventoryAmount(cid,partNumber,amount);*/
return
0
;
}
}
private
void
updateStorageInventory
(
String
cid
,
InventoryItem
inventoryItem
){
private
void
updateStorageInventory
(
String
cid
,
InventoryItem
inventoryItem
){
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
查看文件 @
bb31759
...
@@ -445,6 +445,49 @@ public class StoragePosController {
...
@@ -445,6 +445,49 @@ public class StoragePosController {
}
}
@ApiOperation
(
"判断库位与料箱是否相同"
)
@RequestMapping
(
"/checkPos"
)
@AnonymousAccess
public
ResultBean
checkPos
(
String
posName
,
String
boxStr
)
{
if
(
StringUtils
.
isEmpty
(
posName
)){
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"库位"
});
}
if
(
StringUtils
.
isEmpty
(
boxStr
)){
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"料箱"
});
}
//判断库位是否存在
StoragePos
pos
=
storagePosManager
.
getByPosName
(
posName
);
if
(
pos
==
null
){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
posName
+
"不存在"
);
}
Barcode
posBarcode
=
pos
.
getBarcode
();
if
(
posBarcode
==
null
){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
posName
+
"库位中不存在料箱"
);
}
//判断料箱号是否正确
Barcode
barcode
=
null
;
try
{
barcode
=
codeResolve
.
resolveOneValideBarcode
(
boxStr
);
}
catch
(
ValidateException
e
)
{
e
.
printStackTrace
();
}
if
(
barcode
==
null
){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"不是有效的料箱条码"
);
}
if
(!
barcode
.
getBarcode
().
equals
(
posBarcode
.
getBarcode
())){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
posName
+
"对应的料箱信息为:"
+
posBarcode
.
getBarcode
()+
"与输入的料箱信息:"
+
boxStr
+
"不一致"
);
}
return
ResultBean
.
newOkResult
(
""
);
}
private
Query
getPosFindCriteria
(
StoragePosFindCriteria
criteria
){
private
Query
getPosFindCriteria
(
StoragePosFindCriteria
criteria
){
if
(
ObjectUtil
.
isNotEmpty
(
criteria
.
getStorageId
())
&&
criteria
.
getStorageId
().
equals
(
"0"
))
{
if
(
ObjectUtil
.
isNotEmpty
(
criteria
.
getStorageId
())
&&
criteria
.
getStorageId
().
equals
(
"0"
))
{
criteria
.
setStorageId
(
null
);
criteria
.
setStorageId
(
null
);
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/CtuDeviceController.java
查看文件 @
bb31759
...
@@ -2,6 +2,7 @@ package com.neotel.smfcore.custom.luxsan.factory_c.rawstor.controller;
...
@@ -2,6 +2,7 @@ package com.neotel.smfcore.custom.luxsan.factory_c.rawstor.controller;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.neotel.smfcore.common.bean.ResultBean
;
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.ReelLockPosUtil
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.barcode.enums.BARCODE_STATUS
;
import
com.neotel.smfcore.core.barcode.enums.BARCODE_STATUS
;
...
@@ -813,4 +814,139 @@ public class CtuDeviceController {
...
@@ -813,4 +814,139 @@ public class CtuDeviceController {
}
}
return
ResultBean
.
newOkResult
(
resultList
);
return
ResultBean
.
newOkResult
(
resultList
);
}
}
@ApiOperation
(
"料箱从货架中取出"
)
@RequestMapping
(
"/boxOutFromShelf"
)
@AnonymousAccess
public
ResultBean
boxOutFromShelf
(
String
boxStr
)
{
log
.
info
(
"料箱:"
+
boxStr
+
"从货架中取出"
);
if
(
StringUtils
.
isEmpty
(
boxStr
))
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"料箱"
});
}
//判断料箱号是否正确
Barcode
barcode
=
null
;
try
{
barcode
=
codeResolve
.
resolveOneValideBarcode
(
boxStr
);
}
catch
(
ValidateException
e
)
{
e
.
printStackTrace
();
}
if
(
barcode
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"不是有效的料箱条码"
);
}
//判断料箱是否存在库位中
StoragePos
pos
=
storagePosManager
.
getByBarcode
(
boxStr
);
if
(
pos
==
null
){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"不存在库位中"
);
}
log
.
info
(
"料箱:"
+
boxStr
+
"从货架中取出,对应的库位信息为:"
+
pos
.
getPosName
());
barcode
=
pos
.
getBarcode
();
barcode
.
setStatus
(
BARCODE_STATUS
.
OUT_NORMAL
);
barcodeManager
.
save
(
barcode
);
pos
.
setBarcode
(
barcode
);
storagePosManager
.
save
(
pos
);
return
ResultBean
.
newOkResult
(
""
);
}
@ApiOperation
(
"料箱放到货架上"
)
@RequestMapping
(
"/boxIntoShelf"
)
@AnonymousAccess
public
ResultBean
boxIntoShelf
(
String
boxStr
,
String
posName
)
{
log
.
info
(
"料箱:"
+
boxStr
+
"放到库位:"
+
posName
);
if
(
StringUtils
.
isEmpty
(
boxStr
))
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"料箱"
});
}
if
(
StringUtils
.
isEmpty
(
posName
))
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"库位"
});
}
//判断料箱号是否正确
Barcode
barcode
=
null
;
try
{
barcode
=
codeResolve
.
resolveOneValideBarcode
(
boxStr
);
}
catch
(
ValidateException
e
)
{
e
.
printStackTrace
();
}
if
(
barcode
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"不是有效的料箱条码"
);
}
//判断库位是否存在
StoragePos
newPos
=
storagePosManager
.
getByPosName
(
posName
);
if
(
newPos
==
null
){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
posName
+
"对应的库位信息不存在"
);
}
//找到旧的库位
StoragePos
oldPos
=
BoxHandleUtil
.
locOnePos
(
barcode
);
if
(
oldPos
==
null
){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"对应的原有库位不存在"
);
}
//开始互换位置
Barcode
newBarcode
=
newPos
.
getBarcode
();
barcode
=
oldPos
.
getBarcode
();
newBarcode
.
setStatus
(
BARCODE_STATUS
.
OUT_NORMAL
);
newBarcode
.
setPosName
(
oldPos
.
getPosName
());
barcodeManager
.
save
(
newBarcode
);
oldPos
.
setBarcode
(
newBarcode
);
storagePosManager
.
save
(
oldPos
);
barcode
.
setStatus
(
BARCODE_STATUS
.
IN_STORE
);
barcode
.
setPosName
(
newPos
.
getPosName
());
barcodeManager
.
save
(
barcode
);
newPos
.
setBarcode
(
barcode
);
storagePosManager
.
save
(
newPos
);
//判断有没有任务
DataLog
dataLog
=
null
;
for
(
DataLog
task
:
taskService
.
getAllTasks
())
{
if
(
task
.
isPutInTask
()
&&
!
task
.
isCancel
()
&&
!
task
.
isFinished
()){
if
(
task
.
getBarcode
().
equals
(
barcode
.
getBarcode
())){
dataLog
=
task
;
break
;
}
}
}
if
(
dataLog
!=
null
){
dataLog
.
setPosName
(
newPos
.
getPosName
());
dataLog
.
setPosId
(
newPos
.
getId
());
taskService
.
moveTaskToFinished
(
dataLog
);
taskService
.
updateFinishedTask
(
dataLog
);
}
return
ResultBean
.
newOkResult
(
""
);
}
@ApiOperation
(
"获取所有不在库的库位"
)
@RequestMapping
(
"/getEmptyPos"
)
@AnonymousAccess
public
ResultBean
getEmptyPos
()
{
List
<
String
>
storageIdList
=
new
ArrayList
<>();
for
(
Storage
storage
:
dataCache
.
getAllStorage
().
values
())
{
if
(!
storage
.
isVirtual
())
{
storageIdList
.
add
(
storage
.
getId
());
}
}
List
<
String
>
resultList
=
new
ArrayList
<>();
Query
query
=
new
Query
(
Criteria
.
where
(
"storageId"
).
in
(
storageIdList
));
query
.
fields
().
include
(
"barcode.status"
,
"posName"
);
List
<
StoragePos
>
storagePosList
=
storagePosManager
.
findByQuery
(
query
);
if
(
storagePosList
!=
null
&&
!
storagePosList
.
isEmpty
())
{
for
(
StoragePos
pos
:
storagePosList
)
{
Barcode
barcode
=
pos
.
getBarcode
();
if
(
barcode
==
null
)
{
resultList
.
add
(
pos
.
getPosName
());
}
else
{
if
(
barcode
.
getStatus
()
!=
BARCODE_STATUS
.
IN_STORE
){
resultList
.
add
(
pos
.
getPosName
());
}
}
}
}
return
ResultBean
.
newOkResult
(
resultList
);
}
}
}
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/PkCheckOutController.java
查看文件 @
bb31759
...
@@ -26,6 +26,7 @@ import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.dto.QueryPickingD
...
@@ -26,6 +26,7 @@ import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.dto.QueryPickingD
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.enums.LiteorderCheckType
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.enums.LiteorderCheckType
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.CheckOutUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.CheckOutUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.common.util.CommonUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.common.util.CommonUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.RawOutUtil
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -147,7 +148,7 @@ public class PkCheckOutController {
...
@@ -147,7 +148,7 @@ public class PkCheckOutController {
//throw new ValidateException("","有正在执行的工单,不允许恢复");
//throw new ValidateException("","有正在执行的工单,不允许恢复");
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"有正在执行的工单"
+
resultStr
+
",不允许出库"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"有正在执行的工单"
+
resultStr
+
",不允许出库"
);
}
}
RawOutUtil
.
clearRawOutBox
();
String
line
=
""
;
String
line
=
""
;
List
<
QueryPickingResult
>
resultList
=
LuxsanApi
.
queryPicking
(
new
QueryPickingRequest
(
CommonUtil
.
plantCode
));
List
<
QueryPickingResult
>
resultList
=
LuxsanApi
.
queryPicking
(
new
QueryPickingRequest
(
CommonUtil
.
plantCode
));
for
(
QueryPickingResult
result
:
resultList
)
{
for
(
QueryPickingResult
result
:
resultList
)
{
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/RawOutUtil.java
查看文件 @
bb31759
...
@@ -59,4 +59,13 @@ public class RawOutUtil {
...
@@ -59,4 +59,13 @@ public class RawOutUtil {
cacheMap
.
remove
(
boxStr
);
cacheMap
.
remove
(
boxStr
);
dataCache
.
updateCache
(
CacheNameUtil
.
CACHE_RAWOUT_BOX
,
cacheMap
);
dataCache
.
updateCache
(
CacheNameUtil
.
CACHE_RAWOUT_BOX
,
cacheMap
);
}
}
public
static
void
clearRawOutBox
()
{
Map
<
String
,
String
>
cacheMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CACHE_RAWOUT_BOX
);
if
(
cacheMap
==
null
)
{
cacheMap
=
new
ConcurrentHashMap
<>();
}
cacheMap
.
clear
();
dataCache
.
updateCache
(
CacheNameUtil
.
CACHE_RAWOUT_BOX
,
cacheMap
);
}
}
}
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/third/RawOutLineController.java
查看文件 @
bb31759
...
@@ -48,4 +48,12 @@ public class RawOutLineController {
...
@@ -48,4 +48,12 @@ public class RawOutLineController {
}
}
return
ResultBean
.
newOkResult
(
boxNum
);
return
ResultBean
.
newOkResult
(
boxNum
);
}
}
@ApiOperation
(
"获取所有出库流水线的箱子数量详情"
)
@RequestMapping
(
"/getAllLineBoxNum"
)
@AnonymousAccess
public
ResultBean
getAllLineBoxNum
()
{
return
ResultBean
.
newOkResult
(
cacheBoxNumMap
.
values
());
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论