Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 03e586e2
由
zshaohui
编写于
2022-09-15 10:15:44 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.更新料口状态接口增加
2.修改料口状态查询接口
1 个父辈
a14c682b
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
129 行增加
和
39 行删除
src/main/java/com/neotel/smfcore/core/device/bean/XlcBoxDoorStatus.java
src/main/java/com/neotel/smfcore/core/device/enums/DoorStatus.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/XLCBoxHandler.java
src/main/java/com/neotel/smfcore/custom/neotelApi/rest/NeotelController.java
src/main/java/com/neotel/smfcore/core/device/bean/XlcBoxDoorStatus.java
0 → 100644
查看文件 @
03e586e
package
com
.
neotel
.
smfcore
.
core
.
device
.
bean
;
import
lombok.Getter
;
import
lombok.Setter
;
@Getter
@Setter
public
class
XlcBoxDoorStatus
{
/**
* 料口编号,1,2口为料箱出入口,3,4口为料串出入口
*/
private
int
doorIndex
;
/**
* 料口状态
*/
private
int
status
;
/**
* true=有料箱/料串, false=无料箱/料串
*/
private
boolean
hasContainer
;
/**
* 需求单号, 当状态为NEED_OUT时使用
*/
private
String
hSerial
;
}
src/main/java/com/neotel/smfcore/core/device/enums/DoorStatus.java
0 → 100644
查看文件 @
03e586e
package
com
.
neotel
.
smfcore
.
core
.
device
.
enums
;
import
com.neotel.smfcore.common.enums.RequestMethodEnum
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
@Getter
@AllArgsConstructor
public
enum
DoorStatus
{
/**
* 空闲
*/
IDLE
(
1
),
/**
* 入库中
*/
LOADING
(
2
),
/**
* 出库中
*/
UNLOADING
(
3
),
/**
* 需要空料串出库
*/
NEED_EMPTY
(
4
),
/**
* 满料串需要取走
*/
NEED_OUT
(
5
);
/**
* Request 类型
*/
private
final
int
status
;
public
static
DoorStatus
find
(
int
status
)
{
for
(
DoorStatus
value
:
DoorStatus
.
values
())
{
if
(
status
==
value
.
getStatus
())
{
return
value
;
}
}
return
null
;
}
}
src/main/java/com/neotel/smfcore/core/device/handler/impl/XLCBoxHandler.java
查看文件 @
03e586e
...
...
@@ -2,22 +2,20 @@ package com.neotel.smfcore.core.device.handler.impl;
import
com.google.common.base.Strings
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.
exception.ValidateException
;
import
com.neotel.smfcore.common.
utils.JsonUtil
;
import
com.neotel.smfcore.common.utils.QueryHelp
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.StorageConstants
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.device.bean.BoxStatusBean
;
import
com.neotel.smfcore.core.device.bean.NLShelfOperateBean
;
import
com.neotel.smfcore.core.device.bean.StatusBean
;
import
com.neotel.smfcore.core.device.bean.XlcBoxDoorStatus
;
import
com.neotel.smfcore.core.device.enums.BOX_STATUS
;
import
com.neotel.smfcore.core.device.enums.DoorStatus
;
import
com.neotel.smfcore.core.device.enums.OP
;
import
com.neotel.smfcore.core.device.enums.OP_STATUS
;
import
com.neotel.smfcore.core.device.rest.dto.XLCPosBarcodeDto
;
import
com.neotel.smfcore.core.device.rest.dto.XLCPosDetailDto
;
import
com.neotel.smfcore.core.storage.enums.DeviceType
;
import
com.neotel.smfcore.core.storage.rest.dto.CheckOutDto
;
import
com.neotel.smfcore.core.storage.rest.dto.StoragePosDto
;
import
com.neotel.smfcore.core.storage.rest.mapstruct.StoragePosMapper
;
import
com.neotel.smfcore.core.storage.rest.query.StoragePosQueryCriteria
;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
...
...
@@ -28,16 +26,18 @@ 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.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.
stereotype.Service
;
import
org.springframework.
util.ObjectUtils
;
import
org.springframework.
validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.
*
;
import
org.springframework.
web.bind.annotation.GetMapping
;
import
org.springframework.
web.bind.annotation.PostMapping
;
import
org.springframework.
web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.
RestController
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
//北京方仓
...
...
@@ -51,6 +51,7 @@ public class XLCBoxHandler extends BaseDeviceHandler {
@Autowired
private
StoragePosMapper
storagePosMapper
;
/**
* 当前出入库操作的库位(key为cid, value为当前执行的任务)
*/
...
...
@@ -58,6 +59,11 @@ public class XLCBoxHandler extends BaseDeviceHandler {
/**
* 料口状态信息(key为料口id,value为料口状态)
*/
private
static
Map
<
Integer
,
XlcBoxDoorStatus
>
xlcBoxDoorMap
=
new
ConcurrentHashMap
<>();
/**
* 获取当前正在执行的任务
*/
public
DataLog
getCurrentTask
(
String
cid
){
...
...
@@ -65,6 +71,28 @@ public class XLCBoxHandler extends BaseDeviceHandler {
}
/**
* 获取全部料口状态
*/
public
static
Collection
<
XlcBoxDoorStatus
>
getAllXlcBoxDoorStatus
(){
return
xlcBoxDoorMap
.
values
();
}
@ApiOperation
(
"更新料口状态"
)
@PostMapping
(
"/api/xlc/updateDoorInfo"
)
public
ResultBean
updateDoorInfo
(
@RequestBody
XlcBoxDoorStatus
doorStatus
)
{
log
.
info
(
"料口状态更新:"
+
JsonUtil
.
toJsonStr
(
doorStatus
));
if
(
doorStatus
.
getStatus
()
==
DoorStatus
.
NEED_OUT
.
getStatus
())
{
if
(
Strings
.
isNullOrEmpty
(
doorStatus
.
getHSerial
()))
{
return
ResultBean
.
newErrorResult
(-
2
,
"smfcore.valueCanotNull"
,
"需求单号不能为空:{}"
,
new
String
[]{
"hSerial"
});
}
}
xlcBoxDoorMap
.
put
(
doorStatus
.
getDoorIndex
(),
doorStatus
);
return
ResultBean
.
newOkResult
(
"ok"
);
}
@ApiOperation
(
"XLC方仓容量详情"
)
@GetMapping
(
"/api/boxkanban/xlcDetails"
)
@PreAuthorize
(
"@el.check('boxkanban:info')"
)
...
...
src/main/java/com/neotel/smfcore/custom/neotelApi/rest/NeotelController.java
查看文件 @
03e586e
...
...
@@ -10,6 +10,9 @@ import com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.device.bean.BoxStatusBean
;
import
com.neotel.smfcore.core.device.bean.StatusBean
;
import
com.neotel.smfcore.core.device.bean.XlcBoxDoorStatus
;
import
com.neotel.smfcore.core.device.enums.DoorStatus
;
import
com.neotel.smfcore.core.device.handler.impl.XLCBoxHandler
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.order.LiteOrderCache
;
import
com.neotel.smfcore.core.order.service.manager.ILiteOrderItemManager
;
...
...
@@ -227,34 +230,16 @@ public class NeotelController {
@ApiOperation
(
"6.6 料口状态查询"
)
@AnonymousPostMapping
(
"/doorInfo"
)
public
ResultBean
doorInfo
()
{
String
result
=
" [\n"
+
" {\n"
+
" \"doorIndex\": 1,\n"
+
" \"status\": \"IDLE\",\n"
+
" \"hasContainer\": false,\n"
+
" \"hSerial\": \"\"\n"
+
" },\n"
+
" {\n"
+
" \"doorIndex\": 2,\n"
+
" \"status\": \"IDLE\",\n"
+
" \"hasContainer\": true,\n"
+
" \"hSerial\": \"00001\"\n"
+
" },\n"
+
" {\n"
+
" \"doorIndex\": 3,\n"
+
" \"status\": \"NEED_EMPTY\",\n"
+
" \"hasContainer\": false,\n"
+
" \"hSerial\": \"\"\n"
+
" },\n"
+
" {\n"
+
" \"doorIndex\": 4,\n"
+
" \"status\": \"NEED_OUT\",\n"
+
" \"hasContainer\": true,\n"
+
" \"hSerial\": \"00002\"\n"
+
" }\n"
+
" ]"
;
List
<
Map
>
results
=
JsonUtil
.
toList
(
result
,
Map
.
class
);
Collection
<
XlcBoxDoorStatus
>
allXlcBoxDoorStatus
=
XLCBoxHandler
.
getAllXlcBoxDoorStatus
();
List
<
Map
<
String
,
Object
>>
results
=
new
ArrayList
<>();
for
(
XlcBoxDoorStatus
xlcBoxDoorStatus
:
allXlcBoxDoorStatus
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"doorIndex"
,
xlcBoxDoorStatus
.
getDoorIndex
());
resultMap
.
put
(
"status"
,
DoorStatus
.
find
(
xlcBoxDoorStatus
.
getDoorStatus
()));
resultMap
.
put
(
"hasContainer"
,
xlcBoxDoorStatus
.
isHasContainer
());
resultMap
.
put
(
"hSerial"
,
xlcBoxDoorStatus
.
getHSerial
());
results
.
add
(
resultMap
);
}
return
ResultBean
.
newOkResult
(
results
);
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论