Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 9ce41b7f
由
孙克
编写于
2024-05-10 10:31:05 +0800
浏览文件
选项
浏览文件
标签
下载
差异文件
Merge branch 'master' of
http://106.15.194.121:8083/sunke/smf-core
2 个父辈
f4f1beb5
d17f8be5
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
161 行增加
和
11 行删除
src/main/java/com/neotel/smfcore/core/dashboard/bean/dto/second/MachineStatusDto.java
src/main/java/com/neotel/smfcore/core/dashboard/bean/dto/second/StorageCapacityDto.java
src/main/java/com/neotel/smfcore/core/dashboard/bean/dto/sp/SpBoxStatusDto.java
src/main/java/com/neotel/smfcore/core/dashboard/second/SecondDashboardController.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLMShelfHandler.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLSMShelfHandler.java
src/main/java/com/neotel/smfcore/core/system/util/DevicesStatusUtil.java
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
src/main/java/com/neotel/smfcore/core/dashboard/bean/dto/second/MachineStatusDto.java
查看文件 @
9ce41b7
...
@@ -6,9 +6,13 @@ import lombok.Data;
...
@@ -6,9 +6,13 @@ import lombok.Data;
public
class
MachineStatusDto
{
public
class
MachineStatusDto
{
/**
/**
* 温度
* 温度
/回温温度
*/
*/
private
String
temperature
=
""
;
private
String
temperature
=
""
;
/**
* 冷藏温度
*/
private
String
codeTemperature
=
""
;
/**
/**
* 湿度
* 湿度
...
...
src/main/java/com/neotel/smfcore/core/dashboard/bean/dto/second/StorageCapacityDto.java
查看文件 @
9ce41b7
...
@@ -6,13 +6,25 @@ import lombok.Data;
...
@@ -6,13 +6,25 @@ import lombok.Data;
public
class
StorageCapacityDto
{
public
class
StorageCapacityDto
{
/**
/**
*
容量
*
百分比容量(SP:冷藏区使用百分比)
*/
*/
private
int
capacity
;
private
int
capacity
;
/**
/**
* 百分比容量
* 百分比容量
(SP:冷藏区总容量)
*/
*/
private
int
perCapacity
;
private
int
perCapacity
;
/**
* SP:回温区使用百分比
*/
private
int
warmCapacity
;
/**
* SP:回温区总容量
*/
private
int
warmPerCapacity
;
}
}
src/main/java/com/neotel/smfcore/core/dashboard/bean/dto/sp/SpBoxStatusDto.java
0 → 100644
查看文件 @
9ce41b7
package
com
.
neotel
.
smfcore
.
core
.
dashboard
.
bean
.
dto
.
sp
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
SpBoxStatusDto
implements
Serializable
{
@ApiModelProperty
(
"单台BOX状态,0=离线,1=正常运行中, 2=急停,3=故障,4=警告,5=调试中,6入库执行中,7入仓位完成,8入库失败, 9出库执行中,10出仓位完成,11出库失败,12移栽出库,13 重置中,14 扫码入库失败 "
)
private
int
status
=
0
;
@ApiModelProperty
(
"出库队列数量 "
)
private
int
outJobCount
=
0
;
}
src/main/java/com/neotel/smfcore/core/dashboard/second/SecondDashboardController.java
查看文件 @
9ce41b7
...
@@ -4,10 +4,12 @@ import cn.hutool.core.date.DateUnit;
...
@@ -4,10 +4,12 @@ import cn.hutool.core.date.DateUnit;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.core.agv.bean.AgvInfo
;
import
com.neotel.smfcore.core.agv.bean.AgvInfo
;
import
com.neotel.smfcore.core.barcode.enums.SOLDER_STATUS
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.dashboard.bean.dto.second.MachineStatusDto
;
import
com.neotel.smfcore.core.dashboard.bean.dto.second.MachineStatusDto
;
import
com.neotel.smfcore.core.dashboard.bean.dto.second.StorageCapacityDto
;
import
com.neotel.smfcore.core.dashboard.bean.dto.second.StorageCapacityDto
;
import
com.neotel.smfcore.core.dashboard.bean.dto.second.UpcomingExpirationsDto
;
import
com.neotel.smfcore.core.dashboard.bean.dto.second.UpcomingExpirationsDto
;
import
com.neotel.smfcore.core.dashboard.bean.dto.sp.SpBoxStatusDto
;
import
com.neotel.smfcore.core.device.bean.BoxStatusBean
;
import
com.neotel.smfcore.core.device.bean.BoxStatusBean
;
import
com.neotel.smfcore.core.device.bean.StatusBean
;
import
com.neotel.smfcore.core.device.bean.StatusBean
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.device.util.DataCache
;
...
@@ -24,6 +26,8 @@ import io.swagger.annotations.ApiOperation;
...
@@ -24,6 +26,8 @@ import io.swagger.annotations.ApiOperation;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
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.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
@@ -64,6 +68,7 @@ public class SecondDashboardController {
...
@@ -64,6 +68,7 @@ public class SecondDashboardController {
for
(
BoxStatusBean
boxStatusBean
:
boxStatusBeans
)
{
for
(
BoxStatusBean
boxStatusBean
:
boxStatusBeans
)
{
dto
.
setHumidity
(
boxStatusBean
.
getHumidity
());
dto
.
setHumidity
(
boxStatusBean
.
getHumidity
());
dto
.
setTemperature
(
boxStatusBean
.
getTemperature
());
dto
.
setTemperature
(
boxStatusBean
.
getTemperature
());
dto
.
setCodeTemperature
(
boxStatusBean
.
getCodeAirTemp
());
}
}
}
}
}
}
...
@@ -86,6 +91,29 @@ public class SecondDashboardController {
...
@@ -86,6 +91,29 @@ public class SecondDashboardController {
int
emptySlots
=
storage
.
getEmptySlots
();
int
emptySlots
=
storage
.
getEmptySlots
();
int
capacity
=
totalSlots
-
emptySlots
;
int
capacity
=
totalSlots
-
emptySlots
;
int
perCapacity
=
(
capacity
*
100
)/
totalSlots
;
int
perCapacity
=
(
capacity
*
100
)/
totalSlots
;
int
warmCapacity
=
0
;
int
warmPerCapacity
=
0
;
if
(
storage
.
isSolderPaste
())
{
warmPerCapacity
=
dataCache
.
getSpUsePosCount
(
storage
.
getCid
(),
DataCache
.
warmPosCount
);
perCapacity
=
dataCache
.
getSpUsePosCount
(
storage
.
getCid
(),
DataCache
.
coldingPosCount
);
Integer
warmUseCount
=
dataCache
.
getSpUsePosCount
(
storage
.
getCid
(),
DataCache
.
warmPosUseCount
);
Integer
coldingUseCount
=
dataCache
.
getSpUsePosCount
(
storage
.
getCid
(),
DataCache
.
coldingPosUseCount
);
if
(
coldingUseCount
<=
0
||
perCapacity
<=
0
){
perCapacity
=
0
;
}
else
{
perCapacity
=
(
coldingUseCount
*
100
)
/
perCapacity
;
}
if
(
warmUseCount
<=
0
||
warmPerCapacity
<=
0
){
warmCapacity
=
0
;
}
else
{
warmCapacity
=
(
warmUseCount
*
100
)
/
warmPerCapacity
;
}
}
dto
.
setWarmPerCapacity
(
warmPerCapacity
);
dto
.
setWarmCapacity
(
warmCapacity
);
dto
.
setCapacity
(
capacity
);
dto
.
setCapacity
(
capacity
);
dto
.
setPerCapacity
(
perCapacity
);
dto
.
setPerCapacity
(
perCapacity
);
}
}
...
@@ -157,4 +185,34 @@ public class SecondDashboardController {
...
@@ -157,4 +185,34 @@ public class SecondDashboardController {
}
}
return
ResultBean
.
newOkResult
(
agvCacheList
);
return
ResultBean
.
newOkResult
(
agvCacheList
);
}
}
@ApiOperation
(
"sp看板状态"
)
@RequestMapping
(
"/spInfo"
)
@AnonymousAccess
public
ResultBean
spInfo
(
@RequestParam
(
"storageId"
)
String
storageId
)
{
SpBoxStatusDto
dto
=
new
SpBoxStatusDto
();
Storage
storage
=
dataCache
.
getStorageById
(
storageId
);
if
(
storage
!=
null
)
{
StatusBean
statusBean
=
DevicesStatusUtil
.
getStatusBean
(
storage
.
getCid
());
if
(
statusBean
!=
null
)
{
if
(
statusBean
.
timeOut
())
{
dto
.
setStatus
(
0
);
}
else
{
dto
.
setStatus
(
statusBean
.
getStatus
());
}
}
if
(
storage
.
isSolderPaste
())
{
Criteria
c
=
Criteria
.
where
(
"storageId"
).
is
(
storageId
)
.
and
(
"enabled"
).
is
(
true
)
.
and
(
"used"
).
is
(
true
)
.
and
(
"barcode.solderStatus"
).
nin
(
null
,
""
,
SOLDER_STATUS
.
NONE
.
name
(),
SOLDER_STATUS
.
UNDER_REFRIGERATION
.
name
(),
SOLDER_STATUS
.
RETREAT_STORAGE
.
name
());
List
<
StoragePos
>
taskPosList
=
storagePosManager
.
findByQuery
(
new
Query
(
c
));
dto
.
setOutJobCount
(
taskPosList
.
size
());
}
}
return
ResultBean
.
newOkResult
(
dto
);
}
}
}
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLMShelfHandler.java
查看文件 @
9ce41b7
...
@@ -188,6 +188,10 @@ public class NLMShelfHandler extends BaseDeviceHandler {
...
@@ -188,6 +188,10 @@ public class NLMShelfHandler extends BaseDeviceHandler {
return
;
return
;
}
}
String
allLightOnStr
=
""
;
String
allLightOnStr
=
""
;
for
(
final
String
posName
:
posNameList
)
{
DevicesStatusUtil
.
clearOp
(
cid
,
"close"
,
posName
);
}
for
(
final
String
posName
:
posNameList
)
{
for
(
final
String
posName
:
posNameList
)
{
String
lightOnStr
=
posName
+
"="
+
color
;
String
lightOnStr
=
posName
+
"="
+
color
;
DevicesStatusUtil
.
appendOp
(
cid
,
"open"
,
lightOnStr
);
DevicesStatusUtil
.
appendOp
(
cid
,
"open"
,
lightOnStr
);
...
@@ -200,14 +204,33 @@ public class NLMShelfHandler extends BaseDeviceHandler {
...
@@ -200,14 +204,33 @@ public class NLMShelfHandler extends BaseDeviceHandler {
@Override
@Override
public
void
run
()
{
public
void
run
()
{
try
{
try
{
String
allCloseStr
=
""
;
final
List
<
String
>
myPos
=
new
ArrayList
<>(
posNameList
);
for
(
final
String
posName
:
posNameList
)
{
Thread
.
sleep
(
delayCloseTime
);
Thread
.
sleep
(
delayCloseTime
);
String
allCloseStr
=
""
;
for
(
final
String
posName
:
myPos
)
{
// log.info(storage.getName() + "[" + cid + "]库位[" + posName + "]灭灯");
// log.info(storage.getName() + "[" + cid + "]库位[" + posName + "]灭灯");
boolean
hasOut
=
false
;
//如果有出库任务,不灭灯
List
<
DataLog
>
logs
=
taskService
.
getAllTasks
();
for
(
DataLog
log
:
logs
)
{
if
(
log
.
getPosName
().
equals
(
posName
)
&&
log
.
isCheckOutTask
())
{
hasOut
=
true
;
break
;
}
}
if
(
hasOut
){
log
.
info
(
storage
.
getName
()
+
"["
+
cid
+
"]库位["
+
posName
+
"]有出库任务,不需要自动灭灯"
);
}
else
{
DevicesStatusUtil
.
appendOp
(
cid
,
"close"
,
posName
);
DevicesStatusUtil
.
appendOp
(
cid
,
"close"
,
posName
);
allCloseStr
+=
posName
+
","
;
allCloseStr
+=
posName
+
","
;
}
}
log
.
info
(
storage
.
getName
()
+
"["
+
cid
+
"]库位["
+
allCloseStr
+
"]灭灯"
);
}
if
(!
ObjectUtil
.
isEmpty
(
allCloseStr
)){
log
.
info
(
storage
.
getName
()
+
"["
+
cid
+
"]库位["
+
allCloseStr
+
"]自动灭灯"
);
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
}
}
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLSMShelfHandler.java
查看文件 @
9ce41b7
...
@@ -110,8 +110,12 @@ public class NLSMShelfHandler extends BaseDeviceHandler{
...
@@ -110,8 +110,12 @@ public class NLSMShelfHandler extends BaseDeviceHandler{
// log.info("操作合并库位["+pos.getPosName()+"]" + opKey);
// log.info("操作合并库位["+pos.getPosName()+"]" + opKey);
}
}
for
(
String
posName
:
relatedPosNames
){
for
(
String
posName
:
relatedPosNames
){
if
(
opKey
==
"open"
){
DevicesStatusUtil
.
clearOp
(
task
.
getCid
(),
"close"
,
posName
);
}
statusBean
.
addData
(
opKey
,
posName
+
"="
+
color
);
statusBean
.
addData
(
opKey
,
posName
+
"="
+
color
);
}
}
}
}
return
statusBean
;
return
statusBean
;
...
...
src/main/java/com/neotel/smfcore/core/system/util/DevicesStatusUtil.java
查看文件 @
9ce41b7
...
@@ -18,10 +18,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -18,10 +18,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentHashMap
;
/**
/**
...
@@ -278,6 +275,36 @@ public class DevicesStatusUtil {
...
@@ -278,6 +275,36 @@ public class DevicesStatusUtil {
opMap
.
put
(
opKey
,
value
);
opMap
.
put
(
opKey
,
value
);
storageOpMap
.
put
(
cid
,
opMap
);
storageOpMap
.
put
(
cid
,
opMap
);
}
}
public
static
void
clearOp
(
String
cid
,
String
opKey
,
String
opValue
)
{
try
{
Map
<
String
,
String
>
opMap
=
storageOpMap
.
get
(
cid
);
if
(
opMap
==
null
)
{
return
;
}
String
value
=
opMap
.
get
(
opKey
);
if
(
ObjectUtil
.
isEmpty
(
value
))
{
return
;
}
else
if
(!
value
.
contains
(
opValue
))
{
return
;
}
else
if
(
value
.
equals
(
opValue
)){
opMap
.
remove
(
opKey
);
}
else
{
String
t1
=
"|"
+
opValue
;
String
t2
=
opValue
+
"|"
;
if
(
opValue
.
contains
(
t1
))
{
opValue
=
opValue
.
replace
(
t1
,
""
);
}
if
(
opValue
.
contains
(
t2
))
{
opValue
=
opValue
.
replace
(
t2
,
""
);
}
opMap
.
put
(
opKey
,
opValue
);
}
storageOpMap
.
put
(
cid
,
opMap
);
}
catch
(
Exception
exception
)
{
log
.
error
(
"出错:"
+
exception
.
toString
());
}
}
public
static
Map
<
String
,
String
>
getAndRemoveOp
(
String
cid
){
public
static
Map
<
String
,
String
>
getAndRemoveOp
(
String
cid
){
Map
<
String
,
String
>
opMap
=
storageOpMap
.
get
(
cid
);
Map
<
String
,
String
>
opMap
=
storageOpMap
.
get
(
cid
);
...
...
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
查看文件 @
9ce41b7
...
@@ -532,7 +532,14 @@ public class TaskService {
...
@@ -532,7 +532,14 @@ public class TaskService {
statusBean
.
setOp
(
OP
.
CHECKOUT
);
statusBean
.
setOp
(
OP
.
CHECKOUT
);
String
posName
=
task
.
getPosName
();
String
posName
=
task
.
getPosName
();
Barcode
codeObj
=
barcodeManager
.
findByBarcode
(
task
.
getBarcode
());
Barcode
codeObj
=
null
;
StoragePos
storagePos
=
storagePosManager
.
getByBarcode
(
task
.
getBarcode
());
if
(
storagePos
!=
null
){
codeObj
=
storagePos
.
getBarcode
();
}
if
(
codeObj
==
null
)
{
codeObj
=
barcodeManager
.
findByBarcode
(
task
.
getBarcode
());
}
int
plateW
=
0
;
int
plateW
=
0
;
int
plateH
=
0
;
int
plateH
=
0
;
//是否是单盘出库,批量上下料使用
//是否是单盘出库,批量上下料使用
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论