Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 663a1e1f
由
LN
编写于
2025-10-13 14:46:27 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
sp1695接口
1 个父辈
bc3d5ec5
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
115 行增加
和
1 行删除
src/main/java/com/neotel/smfcore/core/device/rest/SpDeviceController.java
src/main/resources/messages.properties
src/main/java/com/neotel/smfcore/core/device/rest/SpDeviceController.java
0 → 100644
查看文件 @
663a1e1
package
com
.
neotel
.
smfcore
.
core
.
device
.
rest
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.neotel.smfcore.common.bean.ResultBean
;
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.core.system.util.TaskService
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.HashMap
;
import
java.util.Map
;
@Slf4j
@RestController
@Api
(
tags
=
"设备通信(SP料仓)"
)
public
class
SpDeviceController
{
@Autowired
private
DataCache
dataCache
;
@Autowired
private
IStoragePosManager
storagePosManager
;
@Autowired
private
TaskService
taskService
;
@ApiOperation
(
"查询指定库位的物料信息"
)
@RequestMapping
(
value
=
"/service/store/posReelInfo"
)
@ResponseBody
@AnonymousAccess
public
ResultBean
posReelInfo
(
HttpServletRequest
request
)
{
String
cid
=
request
.
getParameter
(
"cid"
);
String
posName
=
request
.
getParameter
(
"posName"
);
if
(
ObjectUtil
.
isEmpty
(
cid
)
||
ObjectUtil
.
isEmpty
(
posName
))
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.reelPosMove.paramerror"
,
"参数不完整"
);
}
Storage
storage
=
dataCache
.
getStorage
(
cid
);
if
(
storage
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"Storage"
,
cid
});
}
StoragePos
pos
=
storagePosManager
.
getByPosName
(
posName
);
if
(
pos
==
null
){
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"posName"
,
posName
});
}
if
(
pos
.
getBarcode
()
!=
null
)
{
Map
<
String
,
String
>
data
=
new
HashMap
<>();
data
.
put
(
"barcode"
,
pos
.
getBarcode
().
getBarcode
());
data
.
put
(
"plateW"
,
pos
.
getBarcode
().
getPlateSize
()
+
""
);
data
.
put
(
"plateH"
,
pos
.
getBarcode
().
getHeight
()
+
""
);
return
ResultBean
.
newOkResult
(
data
);
}
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.reelPosMove.posIsNull"
,
"库位[{1}]为空"
,
new
String
[]{
"posName"
,
posName
});
}
@ApiOperation
(
"锡膏料仓,客户端自动移库功能"
)
@RequestMapping
(
value
=
"/service/store/reelPosMove"
)
@ResponseBody
@AnonymousAccess
public
ResultBean
reelPosMove
(
HttpServletRequest
request
)
{
String
cid
=
request
.
getParameter
(
"cid"
);
//CID
String
barcode
=
request
.
getParameter
(
"barcode"
);
//条码
String
posName
=
request
.
getParameter
(
"posName"
);
//原库位号
String
targetPosName
=
request
.
getParameter
(
"targetPosName"
);
//目标库位号
if
(
ObjectUtil
.
isEmpty
(
cid
)
||
ObjectUtil
.
isEmpty
(
posName
))
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.reelPosMove.paramerror"
,
"参数不完整"
);
}
Storage
storage
=
dataCache
.
getStorage
(
cid
);
if
(
storage
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"Storage"
,
cid
});
}
StoragePos
pos
=
storagePosManager
.
getByPosName
(
posName
);
if
(
pos
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"posName"
,
posName
});
}
if
(
pos
.
getBarcode
()
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.reelPosMove.posIsNull"
,
"库位[{1}]为空"
,
new
String
[]{
"posName"
,
posName
});
}
if
(!
pos
.
getBarcode
().
getBarcode
().
equals
(
barcode
))
{
//原库位条码不匹配
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.reelPosMove.barcodeError"
,
"库位{0}条码为{1},与移库条码{1}不一致"
,
new
String
[]{
posName
,
pos
.
getBarcode
().
getBarcode
(),
barcode
});
}
StoragePos
targetPos
=
storagePosManager
.
getByPosName
(
targetPosName
);
if
(
targetPos
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"targetPosName"
,
targetPosName
});
}
if
(
targetPos
.
getBarcode
()!=
null
){
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"targetPosName"
,
targetPosName
});
}
Barcode
posBarcode
=
pos
.
getBarcode
();
taskService
.
addTaskToFinished
(
pos
,
pos
.
getBarcode
(),
"SpClient"
);
taskService
.
addTaskToFinished
(
targetPos
,
posBarcode
,
"SpClient"
);
return
ResultBean
.
newOkResult
(
"OK"
);
}
}
src/main/resources/messages.properties
查看文件 @
663a1e1
...
@@ -435,4 +435,6 @@ smfcore.equipment.view.ncgroup=Neo Counter
...
@@ -435,4 +435,6 @@ smfcore.equipment.view.ncgroup=Neo Counter
smfcore.virtual.boxInPos
=
[{0}]
\u
5DF2
\u5728\u
5E93
\u
4F4D[{1}]
\u
4E2D,
\u
8BF7
\u5148\u
53D6
\u
51FA
smfcore.virtual.boxInPos
=
[{0}]
\u
5DF2
\u5728\u
5E93
\u
4F4D[{1}]
\u
4E2D,
\u
8BF7
\u5148\u
53D6
\u
51FA
smfcore.virtual.quantityError
=
\u
53D6
\u
51FA
\u6570\u
91CF
\u
5E94
\u
4E3A[{0}]
smfcore.virtual.quantityError
=
\u
53D6
\u
51FA
\u6570\u
91CF
\u
5E94
\u
4E3A[{0}]
smfcode.virtual.enter
=
\u
8BF7
\u
626B
\u
63CF
\u6216\u
8F93
\u5165\u6761\u7801\u
540E
\u6309\u
56DE
\u
8F66
\u
786E
\u
8BA4
smfcode.virtual.enter
=
\u
8BF7
\u
626B
\u
63CF
\u6216\u
8F93
\u5165\u6761\u7801\u
540E
\u6309\u
56DE
\u
8F66
\u
786E
\u
8BA4
smfcore.auth.expire
=
\u6388\u6743\u
5DF2
\u
8FC7
\u
671F
\ No newline at end of file
\ No newline at end of file
smfcore.auth.expire
=
\u6388\u6743\u
5DF2
\u
8FC7
\u
671F
smfcore.reelPosMove.paramerror
=
\u
53C2
\u6570\u
4E0D
\u
5B8C
\u6574
smfcore.reelPosMove.posIsNull
=
\u
5E93
\u
4F4D[{1}]
\u
4E3A
\u
7A7A
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论