Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
471c68b1
提交
471c68b1
authored
10月 12, 2021
作者:
zjm
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(配套设备): 添加形态的筛选且添加形态中文字段供前端使用
添加形态的筛选且添加形态中文字段供前端使用
上级
d7778fcc
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
21 行增加
和
2 行删除
+21
-2
ConfigCache.java
.../src/main/java/com/tykj/dev/config/cache/ConfigCache.java
+7
-1
MatchingDeviceController.java
.../device/matching/controller/MatchingDeviceController.java
+8
-1
MatchingDeviceLibrary.java
.../device/matching/subject/domin/MatchingDeviceLibrary.java
+6
-0
没有找到文件。
dev-config/src/main/java/com/tykj/dev/config/cache/ConfigCache.java
浏览文件 @
471c68b1
...
@@ -32,6 +32,8 @@ public class ConfigCache {
...
@@ -32,6 +32,8 @@ public class ConfigCache {
private
Map
<
Integer
,
String
>
storageLocationMap
;
private
Map
<
Integer
,
String
>
storageLocationMap
;
private
Map
<
Integer
,
String
>
matchingTypeMap
;
public
ConfigCache
(
List
<
SystemConfig
>
systemConfigs
){
public
ConfigCache
(
List
<
SystemConfig
>
systemConfigs
){
this
.
lifeStatusMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"lifeStatus"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
lifeStatusMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"lifeStatus"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
...
@@ -45,7 +47,7 @@ public class ConfigCache {
...
@@ -45,7 +47,7 @@ public class ConfigCache {
this
.
positionMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"position"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
positionMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"position"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
allotTypeMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"allotType"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
allotTypeMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"allotType"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
storageLocationMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"storageLocation"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
storageLocationMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"storageLocation"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
matchingTypeMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"matchingType"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
}
}
public
Map
<
Integer
,
String
>
getMatchingRangeMap
()
{
public
Map
<
Integer
,
String
>
getMatchingRangeMap
()
{
...
@@ -92,6 +94,9 @@ public class ConfigCache {
...
@@ -92,6 +94,9 @@ public class ConfigCache {
return
storageLocationMap
;
return
storageLocationMap
;
}
}
public
Map
<
Integer
,
String
>
getMatchingTypeMap
()
{
return
matchingTypeMap
;
}
public
ConfigCache
refresh
(
List
<
SystemConfig
>
systemConfigs
){
public
ConfigCache
refresh
(
List
<
SystemConfig
>
systemConfigs
){
this
.
lifeStatusMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"lifeStatus"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
lifeStatusMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"lifeStatus"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
...
@@ -105,6 +110,7 @@ public class ConfigCache {
...
@@ -105,6 +110,7 @@ public class ConfigCache {
this
.
positionMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"position"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
positionMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"position"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
allotTypeMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"allotType"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
allotTypeMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"allotType"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
storageLocationMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"storageLocation"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
storageLocationMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"storageLocation"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
matchingTypeMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"matchingType"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
return
this
;
return
this
;
}
}
}
}
dev-matching/src/main/java/com/tykj/dev/device/matching/controller/MatchingDeviceController.java
浏览文件 @
471c68b1
...
@@ -354,8 +354,15 @@ public class MatchingDeviceController {
...
@@ -354,8 +354,15 @@ public class MatchingDeviceController {
Page
<
MatchingDeviceLibrary
>
deviceLibraryEntities
=
PageUtil
.
getPerPage
(
matchingDeviceSelectVo
.
getPage
(),
Page
<
MatchingDeviceLibrary
>
deviceLibraryEntities
=
PageUtil
.
getPerPage
(
matchingDeviceSelectVo
.
getPage
(),
matchingDeviceSelectVo
.
getSize
(),
matchingDeviceLibraryList
,
matchingDeviceSelectVo
.
getPageable
());
matchingDeviceSelectVo
.
getSize
(),
matchingDeviceLibraryList
,
matchingDeviceSelectVo
.
getPageable
());
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
matchingDeviceLibraryList
=
matchingDeviceLibraryList
.
stream
().
map
(
MatchingDeviceLibrary:
:
setConfigName
).
collect
(
Collectors
.
toList
());
map
.
put
(
"pages"
,
deviceLibraryEntities
);
map
.
put
(
"pages"
,
deviceLibraryEntities
);
ConfigCache
configCache
=
SpringUtils
.
getBean
(
"initConfigCache"
);
List
<
String
>
types
=
matchingDeviceLibraryList
.
stream
().
map
(
MatchingDeviceLibrary:
:
getType
).
collect
(
Collectors
.
toList
());
List
<
String
>
finalTypes
=
types
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
assert
configCache
!=
null
;
Map
<
Integer
,
String
>
matchingTypeMap
=
configCache
.
getMatchingTypeMap
().
entrySet
().
stream
().
filter
(
map1
->
finalTypes
.
contains
(
map1
.
getKey
().
toString
())).
collect
(
Collectors
.
toMap
(
Map
.
Entry
::
getKey
,
Map
.
Entry
::
getValue
));
map
.
put
(
"type"
,
matchingTypeMap
);
//修改 增加排序
//修改 增加排序
//做一下去重
//做一下去重
List
<
String
>
models
=
matchingDeviceLibraryList
.
stream
().
map
(
MatchingDeviceLibrary:
:
getModel
).
collect
(
Collectors
.
toList
());
List
<
String
>
models
=
matchingDeviceLibraryList
.
stream
().
map
(
MatchingDeviceLibrary:
:
getModel
).
collect
(
Collectors
.
toList
());
...
...
dev-matching/src/main/java/com/tykj/dev/device/matching/subject/domin/MatchingDeviceLibrary.java
浏览文件 @
471c68b1
...
@@ -125,10 +125,16 @@ public class MatchingDeviceLibrary {
...
@@ -125,10 +125,16 @@ public class MatchingDeviceLibrary {
@Transient
@Transient
private
String
lifeStatusName
;
private
String
lifeStatusName
;
@ApiModelProperty
(
value
=
"形态名称"
)
@Transient
private
String
typeName
;
public
MatchingDeviceLibrary
setConfigName
(){
public
MatchingDeviceLibrary
setConfigName
(){
ConfigCache
configCache
=
SpringUtils
.
getBean
(
"initConfigCache"
);
ConfigCache
configCache
=
SpringUtils
.
getBean
(
"initConfigCache"
);
if
(
configCache
!=
null
)
{
if
(
configCache
!=
null
)
{
setLifeStatusName
(
configCache
.
getLifeStatusMap
().
get
(
this
.
lifeStatus
)==
null
?
"-"
:
configCache
.
getLifeStatusMap
().
get
(
this
.
lifeStatus
));
setLifeStatusName
(
configCache
.
getLifeStatusMap
().
get
(
this
.
lifeStatus
)==
null
?
"-"
:
configCache
.
getLifeStatusMap
().
get
(
this
.
lifeStatus
));
setTypeName
(
configCache
.
getMatchingTypeMap
().
get
(
Integer
.
valueOf
(
this
.
type
))==
null
?
"-"
:
configCache
.
getMatchingTypeMap
().
get
(
Integer
.
valueOf
(
this
.
type
)));
}
}
return
this
;
return
this
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论