Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 935687a6
由
张少辉
编写于
2026-01-09 16:34:08 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.根据料串或者条码获取目的地信息
1 个父辈
bf146829
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
51 行增加
和
3 行删除
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/third/MaterialRestController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/third/MaterialRestController.java
查看文件 @
935687a
...
...
@@ -2,7 +2,10 @@ package com.neotel.smfcore.custom.luxsan.factory_c.third;
import
com.alibaba.fastjson.JSON
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.exception.ValidateException
;
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.util.DataCache
;
import
com.neotel.smfcore.core.order.LiteOrderCache
;
import
com.neotel.smfcore.custom.luxsan.factory_c.third.bean.MaterialLoc
;
...
...
@@ -17,9 +20,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.HashMap
;
import
java.util.Locale
;
import
java.util.Map
;
import
java.util.*
;
@Slf4j
@RestController
...
...
@@ -29,6 +30,9 @@ public class MaterialRestController {
@Autowired
private
LiteOrderCache
liteOrderCache
;
@Autowired
private
CodeResolve
codeResolve
;
@ApiOperation
(
"更新料串位置"
)
@RequestMapping
(
"/updateLoc"
)
@AnonymousAccess
...
...
@@ -128,4 +132,48 @@ public class MaterialRestController {
resultMap
.
put
(
"reelList"
,
materialLoc
.
getReelList
());
return
ResultBean
.
newOkResult
(
resultMap
);
}
@ApiOperation
(
"根据条码或者料串号获取目的地信息"
)
@RequestMapping
(
"/getDestinationByCodeOrStacker"
)
//@AnonymousAccess
public
ResultBean
getDestinationByCodeOrStacker
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
String
code
=
paramMap
.
get
(
"code"
);
if
(
StringUtils
.
isEmpty
(
code
))
{
return
ResultBean
.
newOkResult
(
"条码信息或者料串号不能为空"
);
}
MaterialLoc
materialLoc
=
MaterialLocUtil
.
getStacker
(
code
);
if
(
materialLoc
!=
null
&&
StringUtils
.
isNotEmpty
(
materialLoc
.
getDestination
()))
{
return
ResultBean
.
newOkResult
(
"目的地信息为:"
+
materialLoc
.
getDestination
());
}
//解析条码信息
Barcode
barcode
=
null
;
try
{
barcode
=
codeResolve
.
resolveOneValideBarcode
(
code
);
}
catch
(
ValidateException
e
)
{
return
ResultBean
.
newOkResult
(
"未找到对应的目的地信息,请检查信息是否输入正确"
);
}
MaterialLoc
codeMaterialLoc
=
null
;
Collection
<
MaterialLoc
>
allStackerLoc
=
MaterialLocUtil
.
getAllStackerLoc
();
if
(
allStackerLoc
!=
null
&&
!
allStackerLoc
.
isEmpty
())
{
for
(
MaterialLoc
loc
:
allStackerLoc
)
{
List
<
Map
<
String
,
Object
>>
reelList
=
loc
.
getReelList
();
if
(
reelList
!=
null
){
for
(
Map
<
String
,
Object
>
map
:
reelList
)
{
String
cacheBarcode
=
map
.
get
(
"barcode"
)
==
null
?
""
:
map
.
get
(
"barcode"
).
toString
();
if
(
barcode
.
getBarcode
().
equals
(
cacheBarcode
)){
codeMaterialLoc
=
loc
;
}
}
}
if
(
codeMaterialLoc
!=
null
){
break
;
}
}
}
if
(
codeMaterialLoc
==
null
||
StringUtils
.
isEmpty
(
codeMaterialLoc
.
getDestination
())){
return
ResultBean
.
newOkResult
(
"未找到对应的目的地信息"
);
}
return
ResultBean
.
newOkResult
(
"目的地信息为:"
+
codeMaterialLoc
.
getDestination
());
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论