Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
eaa52237
提交
eaa52237
authored
11月 17, 2020
作者:
邓砥奕
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[装备模块]添加统计详情,使用状态出库门禁不报警
上级
40d06ab7
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
19 行增加
和
1 行删除
+19
-1
DeviceLibraryController.java
...ev/device/library/controller/DeviceLibraryController.java
+8
-0
DeviceLibraryServiceImpl.java
...device/library/service/impl/DeviceLibraryServiceImpl.java
+3
-0
DeviceStatisticsVo.java
...ykj/dev/device/library/subject/vo/DeviceStatisticsVo.java
+6
-0
AccessController.java
...n/java/com/tykj/dev/rfid/controller/AccessController.java
+2
-1
没有找到文件。
dev-library/src/main/java/com/tykj/dev/device/library/controller/DeviceLibraryController.java
浏览文件 @
eaa52237
...
@@ -51,6 +51,14 @@ public class DeviceLibraryController {
...
@@ -51,6 +51,14 @@ public class DeviceLibraryController {
@Autowired
@Autowired
private
DeviceLogService
deviceLogService
;
private
DeviceLogService
deviceLogService
;
@ApiOperation
(
value
=
"根据装备id查询装备详情"
,
notes
=
"根据装备id查询装备详情"
)
@PostMapping
(
"/selectByIds"
)
public
ResponseEntity
selectByIds
(
@RequestBody
List
<
Integer
>
ids
){
List
<
DeviceLibrary
>
deviceLibraries
=
new
ArrayList
<>();
ids
.
forEach
(
integer
->
deviceLibraries
.
add
(
deviceLibraryService
.
getOne
(
integer
)));
return
ResponseEntity
.
ok
(
deviceLibraries
);
}
@ApiOperation
(
value
=
"模糊查询装备分页"
,
notes
=
"可以通过这个接口查询装备"
)
@ApiOperation
(
value
=
"模糊查询装备分页"
,
notes
=
"可以通过这个接口查询装备"
)
@PostMapping
(
"/selectDevicePage"
)
@PostMapping
(
"/selectDevicePage"
)
public
ResponseEntity
selectDevicePage
(
@RequestBody
DeviceLibrarySelectVo
deviceLibrarySelectVo
)
{
public
ResponseEntity
selectDevicePage
(
@RequestBody
DeviceLibrarySelectVo
deviceLibrarySelectVo
)
{
...
...
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/DeviceLibraryServiceImpl.java
浏览文件 @
eaa52237
...
@@ -139,6 +139,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
...
@@ -139,6 +139,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
//按型号遍历统计各种状态的装备数量
//按型号遍历统计各种状态的装备数量
for
(
String
model
:
list
)
{
for
(
String
model
:
list
)
{
DeviceStatisticsVo
deviceStatisticsVo
=
new
DeviceStatisticsVo
();
DeviceStatisticsVo
deviceStatisticsVo
=
new
DeviceStatisticsVo
();
List
<
Integer
>
deviceIds
=
new
ArrayList
<>();
deviceStatisticsVo
.
setModel
(
model
);
deviceStatisticsVo
.
setModel
(
model
);
int
num
=
0
;
int
num
=
0
;
int
inLibraryNum
=
0
;
int
inLibraryNum
=
0
;
...
@@ -151,6 +152,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
...
@@ -151,6 +152,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
//遍历核心装备,按照相同型号的装备生命状态统计
//遍历核心装备,按照相同型号的装备生命状态统计
for
(
DeviceLibrary
d2
:
libraryEntities
)
{
for
(
DeviceLibrary
d2
:
libraryEntities
)
{
if
(
d2
.
getModel
().
equals
(
model
))
{
if
(
d2
.
getModel
().
equals
(
model
))
{
deviceIds
.
add
(
d2
.
getId
());
deviceStatisticsVo
.
setName
(
d2
.
getName
());
deviceStatisticsVo
.
setName
(
d2
.
getName
());
num
++;
num
++;
switch
(
d2
.
getLifeStatus
())
{
switch
(
d2
.
getLifeStatus
())
{
...
@@ -191,6 +193,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
...
@@ -191,6 +193,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
}
}
//添加统计vo
//添加统计vo
if
(
num
>
0
)
{
if
(
num
>
0
)
{
deviceStatisticsVo
.
setDeviceIds
(
deviceIds
);
deviceStatisticsVo
.
setDeviceNumber
(
num
);
deviceStatisticsVo
.
setDeviceNumber
(
num
);
deviceStatisticsVo
.
setAllotNum
(
allotNum
);
deviceStatisticsVo
.
setAllotNum
(
allotNum
);
deviceStatisticsVo
.
setInLibraryNum
(
inLibraryNum
);
deviceStatisticsVo
.
setInLibraryNum
(
inLibraryNum
);
...
...
dev-library/src/main/java/com/tykj/dev/device/library/subject/vo/DeviceStatisticsVo.java
浏览文件 @
eaa52237
...
@@ -4,6 +4,9 @@ import io.swagger.annotations.ApiModel;
...
@@ -4,6 +4,9 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
/**
* @author dengdiyi
* @author dengdiyi
*/
*/
...
@@ -43,4 +46,7 @@ public class DeviceStatisticsVo {
...
@@ -43,4 +46,7 @@ public class DeviceStatisticsVo {
@ApiModelProperty
(
value
=
"使用数量"
,
example
=
"10"
)
@ApiModelProperty
(
value
=
"使用数量"
,
example
=
"10"
)
private
Integer
useNum
;
private
Integer
useNum
;
@ApiModelProperty
(
value
=
"该型号所有装备Id列表"
)
private
List
<
Integer
>
deviceIds
=
new
ArrayList
<>();
}
}
dev-rfid/src/main/java/com/tykj/dev/rfid/controller/AccessController.java
浏览文件 @
eaa52237
...
@@ -137,7 +137,8 @@ public class AccessController {
...
@@ -137,7 +137,8 @@ public class AccessController {
outPutCardIds
.
forEach
(
s
->
deviceLibraries
.
addAll
(
deviceLibraryDao
.
getAllByRfidCardId
(
s
)));
outPutCardIds
.
forEach
(
s
->
deviceLibraries
.
addAll
(
deviceLibraryDao
.
getAllByRfidCardId
(
s
)));
//获取最近1分钟报警的Id
//获取最近1分钟报警的Id
List
<
Integer
>
ids
=
getLatestWarningDeviceIds
();
List
<
Integer
>
ids
=
getLatestWarningDeviceIds
();
List
<
Integer
>
idList
=
deviceLibraries
.
stream
().
map
(
DeviceLibrary:
:
getId
).
collect
(
Collectors
.
toList
());
//排除使用状态中的装备,映射成id
List
<
Integer
>
idList
=
deviceLibraries
.
stream
().
filter
(
deviceLibrary
->
deviceLibrary
.
getLifeStatus
()!=
14
).
map
(
DeviceLibrary:
:
getId
).
collect
(
Collectors
.
toList
());
ids
.
retainAll
(
idList
);
ids
.
retainAll
(
idList
);
idList
.
removeAll
(
ids
);
idList
.
removeAll
(
ids
);
if
(
idList
.
size
()>
0
)
{
if
(
idList
.
size
()>
0
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论