Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 31af10b5
由
zshaohui
编写于
2024-09-11 17:23:44 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.西门子料盘设置接口请求数量
2.提供库存接口给西门子
1 个父辈
9641d485
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
46 行增加
和
2 行删除
src/main/java/com/neotel/smfcore/custom/siemens/SiemensApi.java
src/main/java/com/neotel/smfcore/custom/siemens/SiemensController.java
src/main/java/com/neotel/smfcore/custom/siemens/SiemensApi.java
查看文件 @
31af10b
...
@@ -176,7 +176,7 @@ public class SiemensApi extends BaseSmfApiListener {
...
@@ -176,7 +176,7 @@ public class SiemensApi extends BaseSmfApiListener {
barcode
.
setPlateSize
(
codebean
.
getReelWidth
());
barcode
.
setPlateSize
(
codebean
.
getReelWidth
());
barcode
.
setHeight
(
codebean
.
getReelHeight
());
barcode
.
setHeight
(
codebean
.
getReelHeight
());
barcode
.
setBarcode
(
codebean
.
getCodeStr
());
barcode
.
setBarcode
(
codebean
.
getCodeStr
());
barcode
.
setAmount
(
component
.
getAmount
());
barcode
.
setAmount
(
info
.
getQuantity
());
barcode
.
setFullCode
(
codebean
.
getCodeStr
());
barcode
.
setFullCode
(
codebean
.
getCodeStr
());
barcode
.
setPartNumber
(
component
.
getPartNumber
());
barcode
.
setPartNumber
(
component
.
getPartNumber
());
barcode
=
barcodeManager
.
saveBarcode
(
barcode
);
barcode
=
barcodeManager
.
saveBarcode
(
barcode
);
...
@@ -185,7 +185,7 @@ public class SiemensApi extends BaseSmfApiListener {
...
@@ -185,7 +185,7 @@ public class SiemensApi extends BaseSmfApiListener {
barcode
.
setPlateSize
(
codebean
.
getReelWidth
());
barcode
.
setPlateSize
(
codebean
.
getReelWidth
());
barcode
.
setHeight
(
codebean
.
getReelHeight
());
barcode
.
setHeight
(
codebean
.
getReelHeight
());
barcode
.
setBarcode
(
codebean
.
getCodeStr
());
barcode
.
setBarcode
(
codebean
.
getCodeStr
());
barcode
.
setAmount
(
component
.
getAmount
());
barcode
.
setAmount
(
info
.
getQuantity
());
barcode
.
setPartNumber
(
component
.
getPartNumber
());
barcode
.
setPartNumber
(
component
.
getPartNumber
());
log
.
info
(
"siemensCheckCode 修改 条码:["
+
barcode
.
getBarcode
()
+
"] pn为 ["
+
barcode
.
getPartNumber
()+
"] "
);
log
.
info
(
"siemensCheckCode 修改 条码:["
+
barcode
.
getBarcode
()
+
"] pn为 ["
+
barcode
.
getPartNumber
()+
"] "
);
}
}
...
...
src/main/java/com/neotel/smfcore/custom/siemens/SiemensController.java
查看文件 @
31af10b
...
@@ -18,7 +18,9 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -18,7 +18,9 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
@Api
(
tags
=
"西门子对接"
)
@Api
(
tags
=
"西门子对接"
)
...
@@ -81,4 +83,46 @@ public class SiemensController {
...
@@ -81,4 +83,46 @@ public class SiemensController {
return
resultMap
;
return
resultMap
;
}
}
@ApiOperation
(
"获取所有库存信息"
)
@RequestMapping
(
"/getAllInventory"
)
@AnonymousAccess
public
List
<
Map
<
String
,
String
>>
getAllInventory
(
@RequestBody
Map
<
String
,
String
>
paramMap
){
String
deviceID
=
paramMap
.
get
(
"DeviceID"
);
log
.
info
(
"收到获取库存信息指令,deviceID为:"
+
deviceID
);
List
<
String
>
deviceIdList
=
new
ArrayList
<>();
if
(
StringUtils
.
isEmpty
(
deviceID
)){
for
(
Storage
storage
:
dataCache
.
getAllStorage
().
values
())
{
deviceIdList
.
add
(
storage
.
getCid
());
}
}
else
{
String
[]
deviceIdStr
=
deviceID
.
split
(
","
);
for
(
String
id
:
deviceIdStr
)
{
deviceIdList
.
add
(
id
);
}
}
List
<
Map
<
String
,
String
>>
resultList
=
new
ArrayList
<>();
for
(
String
deviceId
:
deviceIdList
)
{
Map
<
String
,
StoragePos
>
usePosMap
=
dataCache
.
getUsedPosList
(
deviceId
);
if
(
usePosMap
!=
null
&&
!
usePosMap
.
isEmpty
()){
for
(
StoragePos
pos
:
usePosMap
.
values
())
{
if
(
pos
!=
null
){
Barcode
barcode
=
pos
.
getBarcode
();
if
(
barcode
!=
null
){
Map
<
String
,
String
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"LOTID"
,
barcode
.
getBarcode
());
resultMap
.
put
(
"DEVICEID"
,
deviceId
);
resultMap
.
put
(
"quantity"
,
barcode
.
getAmount
()+
""
);
resultList
.
add
(
resultMap
);
}
}
}
}
}
return
resultList
;
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论