Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit d8332d1b
由
zshaohui
编写于
2024-08-26 16:29:56 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.按隔口清理数据
1 个父辈
7369c809
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
87 行增加
和
0 行删除
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/manual/ManualHandlBoxController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/manual/ManualHandlBoxController.java
0 → 100644
查看文件 @
d8332d1
package
com
.
neotel
.
smfcore
.
custom
.
luxsan
.
factory_c
.
rawstor
.
controller
.
manual
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.device.util.DataCache
;
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.security.annotation.AnonymousAccess
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
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.List
;
@Slf4j
@RestController
@RequestMapping
(
"/manualHandlBox"
)
public
class
ManualHandlBoxController
{
@Autowired
private
IBarcodeManager
barcodeManager
;
@Autowired
private
IStoragePosManager
storagePosManager
;
@Autowired
private
DataCache
dataCache
;
@ApiOperation
(
"清理料箱隔口信息"
)
@RequestMapping
(
"/clearBoxPar"
)
@AnonymousAccess
public
synchronized
ResultBean
clearBoxPar
(
String
boxPar
)
{
log
.
info
(
"收到清理料箱隔口信息为:"
+
boxPar
);
Barcode
barcode
=
barcodeManager
.
findOne
(
new
Query
(
Criteria
.
where
(
"subCodeList.posName"
).
is
(
boxPar
)));
if
(
barcode
==
null
){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxPar
+
"对应的料箱信息不存在"
);
}
String
posName
=
""
;
StoragePos
pos
=
storagePosManager
.
findOne
(
new
Query
(
Criteria
.
where
(
"barcode.subCodeList.posName"
).
is
(
boxPar
)));
if
(
pos
!=
null
)
{
barcode
=
pos
.
getBarcode
();
posName
=
pos
.
getPosName
();
}
log
.
info
(
"收到清理料箱隔口信息为:"
+
boxPar
+
"库位为:"
+
posName
+
",料箱号为:"
+
barcode
.
getBarcode
());
//获取要清空的隔口号
List
<
Barcode
>
needRemoveBarcodeList
=
new
ArrayList
<>();
List
<
Barcode
>
subCodeList
=
barcode
.
getSubCodeList
();
if
(
subCodeList
!=
null
&&
!
subCodeList
.
isEmpty
())
{
for
(
Barcode
subCode
:
subCodeList
)
{
if
(
boxPar
.
equals
(
subCode
.
getPosName
()))
{
needRemoveBarcodeList
.
add
(
subCode
);
}
}
}
if
(
needRemoveBarcodeList
!=
null
&&
!
needRemoveBarcodeList
.
isEmpty
())
{
for
(
Barcode
needRemoveBarcode
:
needRemoveBarcodeList
)
{
barcode
.
removeFromSubCodes
(
needRemoveBarcode
);
log
.
info
(
"收到清理料箱隔口信息为:"
+
boxPar
+
"料盘信息为:"
+
needRemoveBarcode
.
getBarcode
()
+
",所在料格为:"
+
needRemoveBarcode
.
getPosName
());
needRemoveBarcode
.
setPosName
(
""
);
needRemoveBarcode
.
setSelectMsg
(
null
);
needRemoveBarcode
.
setOut
(
false
);
barcodeManager
.
save
(
needRemoveBarcode
);
}
barcode
=
barcodeManager
.
save
(
barcode
);
if
(
pos
!=
null
)
{
pos
.
setBarcode
(
barcode
);
storagePosManager
.
save
(
pos
);
}
return
ResultBean
.
newOkResult
(
""
);
}
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxPar
+
"未找到可以清理的数据"
);
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论