Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit d192273c
由
zshaohui
编写于
2023-07-31 10:14:01 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
mesApi增加亮灯颜色
1 个父辈
8bef213a
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
55 行增加
和
3 行删除
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLPShelfHandler.java
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
src/main/java/com/neotel/smfcore/custom/smdbox/MesApiController.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLPShelfHandler.java
查看文件 @
d192273
...
@@ -5,6 +5,7 @@ import com.google.common.base.Strings;
...
@@ -5,6 +5,7 @@ import com.google.common.base.Strings;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.api.bean.CodeValidateParam
;
import
com.neotel.smfcore.core.api.bean.CodeValidateParam
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.device.bean.StatusBean
;
import
com.neotel.smfcore.core.device.bean.StatusBean
;
...
@@ -228,10 +229,17 @@ public class NLPShelfHandler extends BaseDeviceHandler {
...
@@ -228,10 +229,17 @@ public class NLPShelfHandler extends BaseDeviceHandler {
dataLogList
.
add
(
queueTask
);
dataLogList
.
add
(
queueTask
);
outMap
.
put
(
queueTask
.
getSourceId
(),
dataLogList
);
outMap
.
put
(
queueTask
.
getSourceId
(),
dataLogList
);
}
else
{
}
else
{
color
=
ORDER_COLOR
.
BLUE
;
if
(
StringUtils
.
isNotBlank
(
rgb
)){
log
.
info
(
queueTask
.
getPosName
()
+
"发送亮灯任务:"
+
"#"
+
rgb
);
statusBean
.
addData
(
"open"
,
queueTask
.
getPosName
()
+
"=#"
+
rgb
);
}
else
{
color
=
ORDER_COLOR
.
BLUE
;
}
}
}
}
}
statusBean
.
addData
(
"open"
,
queueTask
.
getPosName
()
+
"="
+
color
.
name
());
if
(
color
!=
null
){
statusBean
.
addData
(
"open"
,
queueTask
.
getPosName
()
+
"="
+
color
.
name
());
}
log
.
info
(
"库位["
+
queueTask
.
getPosName
()
+
"]+亮灯:"
+
color
.
name
());
log
.
info
(
"库位["
+
queueTask
.
getPosName
()
+
"]+亮灯:"
+
color
.
name
());
}
}
}
}
...
...
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
查看文件 @
d192273
...
@@ -549,6 +549,10 @@ public class TaskService {
...
@@ -549,6 +549,10 @@ public class TaskService {
public
synchronized
String
checkout
(
StoragePos
pos
,
boolean
forceOut
,
String
subSourceId
,
boolean
isSingleOut
)
{
public
synchronized
String
checkout
(
StoragePos
pos
,
boolean
forceOut
,
String
subSourceId
,
boolean
isSingleOut
)
{
return
checkout
(
pos
,
forceOut
,
subSourceId
,
isSingleOut
,
""
);
}
public
synchronized
String
checkout
(
StoragePos
pos
,
boolean
forceOut
,
String
subSourceId
,
boolean
isSingleOut
,
String
rgbCode
)
{
Barcode
barcode
=
pos
.
getBarcode
();
Barcode
barcode
=
pos
.
getBarcode
();
if
(
barcode
!=
null
)
{
if
(
barcode
!=
null
)
{
...
@@ -589,6 +593,12 @@ public class TaskService {
...
@@ -589,6 +593,12 @@ public class TaskService {
task
.
setType
(
OP
.
CHECKOUT
);
task
.
setType
(
OP
.
CHECKOUT
);
task
.
setStatus
(
OP_STATUS
.
WAIT
.
name
());
task
.
setStatus
(
OP_STATUS
.
WAIT
.
name
());
task
.
setSingleOut
(
isSingleOut
);
task
.
setSingleOut
(
isSingleOut
);
//判断颜色是否为空
if
(
StringUtils
.
isNotBlank
(
rgbCode
)){
task
.
setLightColor
(
rgbCode
);
}
//工单出库任务
//工单出库任务
if
(!
Strings
.
isNullOrEmpty
(
subSourceId
))
{
if
(!
Strings
.
isNullOrEmpty
(
subSourceId
))
{
// LiteOrderItem liteOrderItem = liteOrderItemDao.findOneById(subSourceId);
// LiteOrderItem liteOrderItem = liteOrderItemDao.findOneById(subSourceId);
...
...
src/main/java/com/neotel/smfcore/custom/smdbox/MesApiController.java
查看文件 @
d192273
...
@@ -30,6 +30,7 @@ import io.swagger.annotations.Api;
...
@@ -30,6 +30,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.core.util.Integers
;
import
org.apache.logging.log4j.core.util.Integers
;
...
@@ -38,6 +39,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -38,6 +39,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.PostConstruct
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.*
;
import
java.util.*
;
...
@@ -69,6 +71,31 @@ public class MesApiController {
...
@@ -69,6 +71,31 @@ public class MesApiController {
@Autowired
@Autowired
protected
CodeResolve
codeResolve
;
protected
CodeResolve
codeResolve
;
private
Map
<
String
,
String
>
colorMap
=
Maps
.
newConcurrentMap
();
@PostConstruct
private
void
initColor
()
{
colorMap
.
put
(
"FF0000"
,
"Red"
);
colorMap
.
put
(
"FFC0CB"
,
"Pink"
);
colorMap
.
put
(
"C71585"
,
"Medium Violet Red"
);
colorMap
.
put
(
"FF8C00"
,
"Dark Orange"
);
colorMap
.
put
(
"FFFF00"
,
"Yellow"
);
colorMap
.
put
(
"BDB76B"
,
"Dark Khaki"
);
colorMap
.
put
(
"E6E6FA"
,
"Lavender"
);
colorMap
.
put
(
"9370DB"
,
"Medium Purple"
);
colorMap
.
put
(
"800080"
,
"Purple"
);
colorMap
.
put
(
"ADFF2F"
,
"Green Yellow"
);
colorMap
.
put
(
"98FB98"
,
"Pale Green"
);
colorMap
.
put
(
"008000"
,
"Green"
);
colorMap
.
put
(
"808000"
,
"Olive"
);
colorMap
.
put
(
"00FFFF"
,
"Aqua"
);
colorMap
.
put
(
"7FFFD4"
,
"Aquamarine"
);
colorMap
.
put
(
"B0C4DE"
,
"Light Steel Blue"
);
colorMap
.
put
(
"0000FF"
,
"Blue"
);
colorMap
.
put
(
"FFE4C4"
,
"Bisque"
);
colorMap
.
put
(
"f4A460"
,
"Sandy Brown"
);
}
//http://localhost/myproject/rest/api/v2/mes/inventory?LOC=1
//http://localhost/myproject/rest/api/v2/mes/inventory?LOC=1
@ApiOperation
(
"查询有料仓位"
)
@ApiOperation
(
"查询有料仓位"
)
@RequestMapping
(
value
=
"/inventory"
)
@RequestMapping
(
value
=
"/inventory"
)
...
@@ -217,11 +244,18 @@ public class MesApiController {
...
@@ -217,11 +244,18 @@ public class MesApiController {
try
{
try
{
String
[]
REEL_IDS
=
request
.
getParameterValues
(
"RIS"
);
String
[]
REEL_IDS
=
request
.
getParameterValues
(
"RIS"
);
String
rgbCode
=
request
.
getParameter
(
"rgbCode"
);
//亮灯颜色
if
(
REEL_IDS
==
null
||
REEL_IDS
.
length
==
0
){
if
(
REEL_IDS
==
null
||
REEL_IDS
.
length
==
0
){
return
"Error: RI 为必须项"
;
return
"Error: RI 为必须项"
;
}
}
//判断亮灯颜色是否在这20种内
if
(
StringUtils
.
isBlank
(
colorMap
.
get
(
rgbCode
))
||
StringUtils
.
isBlank
(
rgbCode
)){
return
"Error :rgbCode不在指定范围内"
;
//return "Error: rgbCode 不在颜色范围内";
}
ArrayList
<
StoragePos
>
poses
=
Lists
.
newArrayList
();
ArrayList
<
StoragePos
>
poses
=
Lists
.
newArrayList
();
for
(
String
REEL_ID
:
REEL_IDS
)
{
for
(
String
REEL_ID
:
REEL_IDS
)
{
StoragePos
pos
=
storagePosManager
.
getByBarcode
(
REEL_ID
);
StoragePos
pos
=
storagePosManager
.
getByBarcode
(
REEL_ID
);
...
@@ -232,7 +266,7 @@ public class MesApiController {
...
@@ -232,7 +266,7 @@ public class MesApiController {
}
}
for
(
StoragePos
pos
:
poses
)
{
for
(
StoragePos
pos
:
poses
)
{
log
.
info
(
"出库位置仓位【"
+
pos
.
getPosName
()+
"】"
);
log
.
info
(
"出库位置仓位【"
+
pos
.
getPosName
()+
"】"
);
taskService
.
checkout
(
pos
,
false
,
null
,
false
);
taskService
.
checkout
(
pos
,
false
,
null
,
false
,
rgbCode
);
}
}
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论