Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 80382e20
由
LN
编写于
2024-04-26 17:16:45 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
SP仪表盘
1 个父辈
94964b9c
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
93 行增加
和
4 行删除
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/dashboard/bean/dto/second/MachineStatusDto.java
查看文件 @
80382e2
...
@@ -6,12 +6,16 @@ import lombok.Data;
...
@@ -6,12 +6,16 @@ import lombok.Data;
public
class
MachineStatusDto
{
public
class
MachineStatusDto
{
/**
/**
* 温度
* 温度
/回温温度
*/
*/
private
String
temperature
=
""
;
private
String
temperature
=
""
;
/**
* 冷藏温度
*/
private
String
codeTemperature
=
""
;
/**
/**
* 湿度
*
湿度
*/
*/
private
String
humidity
=
""
;
private
String
humidity
=
""
;
}
}
src/main/java/com/neotel/smfcore/core/dashboard/bean/dto/second/StorageCapacityDto.java
查看文件 @
80382e2
...
@@ -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
查看文件 @
80382e2
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
查看文件 @
80382e2
...
@@ -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
);
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论