Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
84250d5f
提交
84250d5f
authored
9月 08, 2021
作者:
133
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(用户模块): 添加直属单位查询接口
添加直属单位查询接口
上级
1a0be0eb
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
29 行增加
和
2 行删除
+29
-2
DeviceModelSort.java
...rc/main/java/com/tykj/dev/misc/utils/DeviceModelSort.java
+13
-2
UnitsController.java
...j/dev/device/user/subject/controller/UnitsController.java
+5
-0
UnitsService.java
...om/tykj/dev/device/user/subject/service/UnitsService.java
+4
-0
UnitsServiceImpl.java
...ev/device/user/subject/service/impl/UnitsServiceImpl.java
+7
-0
没有找到文件。
dev-misc/src/main/java/com/tykj/dev/misc/utils/DeviceModelSort.java
浏览文件 @
84250d5f
...
@@ -3,6 +3,7 @@ package com.tykj.dev.misc.utils;
...
@@ -3,6 +3,7 @@ package com.tykj.dev.misc.utils;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -19,6 +20,7 @@ import java.util.stream.Collectors;
...
@@ -19,6 +20,7 @@ import java.util.stream.Collectors;
* @createTime 2021年07月14日 13:45:00
* @createTime 2021年07月14日 13:45:00
*/
*/
@Component
@Component
@Slf4j
public
class
DeviceModelSort
{
public
class
DeviceModelSort
{
public
static
Map
<
String
,
Integer
>
mapModelSort
;
public
static
Map
<
String
,
Integer
>
mapModelSort
;
...
@@ -70,7 +72,11 @@ public class DeviceModelSort {
...
@@ -70,7 +72,11 @@ public class DeviceModelSort {
* @return 排序过后的型号列表
* @return 排序过后的型号列表
*/
*/
public
static
List
<
String
>
unitToSort
(
List
<
String
>
unitList
)
{
public
static
List
<
String
>
unitToSort
(
List
<
String
>
unitList
)
{
return
unitList
.
stream
().
sorted
(
Comparator
.
comparing
(
DeviceModelSort:
:
toUnitSort
)).
collect
(
Collectors
.
toList
());
return
unitList
.
stream
()
.
map
(
s
->
new
SortedModel
(
toUnitSort
(
s
),
s
))
.
sorted
(
Comparator
.
comparing
(
SortedModel:
:
getId
).
thenComparing
(
SortedModel:
:
getValue
))
.
map
(
SortedModel:
:
getValue
)
.
collect
(
Collectors
.
toList
());
}
}
/**
/**
...
@@ -80,7 +86,12 @@ public class DeviceModelSort {
...
@@ -80,7 +86,12 @@ public class DeviceModelSort {
* @return 排序号码
* @return 排序号码
*/
*/
public
static
Integer
toUnitSort
(
String
unitName
)
{
public
static
Integer
toUnitSort
(
String
unitName
)
{
return
mapUnitSort
.
get
(
unitName
);
if
(
mapUnitSort
.
containsKey
(
unitName
)){
return
mapUnitSort
.
get
(
unitName
);
}
else
{
log
.
info
(
"单位名称没找到排序:{}"
,
unitName
);
return
9999
;
}
}
}
}
}
dev-user/src/main/java/com/tykj/dev/device/user/subject/controller/UnitsController.java
浏览文件 @
84250d5f
...
@@ -65,6 +65,11 @@ public class UnitsController {
...
@@ -65,6 +65,11 @@ public class UnitsController {
return
ResponseEntity
.
ok
(
unitsService
.
findLeftNavigation1
(
securityUser
));
return
ResponseEntity
.
ok
(
unitsService
.
findLeftNavigation1
(
securityUser
));
}
}
@GetMapping
(
value
=
"/areaDirectlyUnder"
)
@ApiOperation
(
value
=
"查询直属代管单位列表"
,
notes
=
"查询直属代管单位列表"
)
public
ResponseEntity
selectOrganizationUnits2
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
)
{
return
ResponseEntity
.
ok
(
unitsService
.
findLeftNavigation2
(
securityUser
));
}
@GetMapping
(
value
=
"/findAll/GreaterThanEqual/{level}"
)
@GetMapping
(
value
=
"/findAll/GreaterThanEqual/{level}"
)
@ApiOperation
(
value
=
"根据当前用户的单位等级,查询所有的下级单位以及自己单位"
,
notes
=
"单位集合"
)
@ApiOperation
(
value
=
"根据当前用户的单位等级,查询所有的下级单位以及自己单位"
,
notes
=
"单位集合"
)
...
...
dev-user/src/main/java/com/tykj/dev/device/user/subject/service/UnitsService.java
浏览文件 @
84250d5f
...
@@ -140,6 +140,10 @@ public interface UnitsService extends PublicService<Units> {
...
@@ -140,6 +140,10 @@ public interface UnitsService extends PublicService<Units> {
*/
*/
LeftNavigation
findLeftNavigation1
(
SecurityUser
securityUser
);
LeftNavigation
findLeftNavigation1
(
SecurityUser
securityUser
);
/**
* 直属单位侧面导航栏接口
*/
LeftNavigation
findLeftNavigation2
(
SecurityUser
securityUser
);
/**
/**
* 左边侧面导航栏接口 不包括直属单位
* 左边侧面导航栏接口 不包括直属单位
*/
*/
...
...
dev-user/src/main/java/com/tykj/dev/device/user/subject/service/impl/UnitsServiceImpl.java
浏览文件 @
84250d5f
...
@@ -330,6 +330,13 @@ public class UnitsServiceImpl implements UnitsService {
...
@@ -330,6 +330,13 @@ public class UnitsServiceImpl implements UnitsService {
return
leftNavigation
;
return
leftNavigation
;
}
}
@Override
public
LeftNavigation
findLeftNavigation2
(
SecurityUser
securityUser
)
{
List
<
LeftNavigation
>
leftNavigationList2
=
unitsDao
.
findAllByType
(
2
).
stream
().
filter
(
units1
->
!
units1
.
getName
().
equals
(
"省应急小组"
)&&
!
units1
.
getName
().
equals
(
"省机科技管理处"
)&&
!
units1
.
getName
().
equals
(
"省机通信报务处"
)).
map
(
Units:
:
toLeftNavigation
).
collect
(
Collectors
.
toList
());
LeftNavigation
leftNavigation2
=
new
LeftNavigation
(
0
,
"省直属"
,
leftNavigationList2
,
UUID
.
randomUUID
().
toString
(),
1
,
22
,
null
);
return
leftNavigation2
;
}
@Override
@Override
public
LeftNavigation
findLeftNavigationNotDirectlyUnit
(
SecurityUser
securityUser
)
{
public
LeftNavigation
findLeftNavigationNotDirectlyUnit
(
SecurityUser
securityUser
)
{
LeftNavigation
leftNavigation
=
new
LeftNavigation
();
LeftNavigation
leftNavigation
=
new
LeftNavigation
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论