Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gf_back
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tianchao
gf_back
Commits
3ffa8923
Commit
3ffa8923
authored
Nov 22, 2024
by
ZWT
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
得到的
parent
ea8ed31a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
39 deletions
+6
-39
C02-system/pps-core-system/src/main/java/pps/core/system/service/SysDictionaryService.java
...in/java/pps/core/system/service/SysDictionaryService.java
+6
-39
No files found.
C02-system/pps-core-system/src/main/java/pps/core/system/service/SysDictionaryService.java
View file @
3ffa8923
package
pps.core.system.service
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.text.CharSequenceUtil
;
import
cn.hutool.core.util.ArrayUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.extra.pinyin.PinyinUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.github.pagehelper.PageHelper
;
...
...
@@ -604,8 +606,7 @@ public class SysDictionaryService {
SysOrganizationDictionaryMapper
orgDicmapper
=
context
.
getBean
(
SysOrganizationDictionaryMapper
.
class
);
SysOrganizationRelMapper
orgRelMapper
=
context
.
getBean
(
SysOrganizationRelMapper
.
class
);
List
<
SysDictionaryCache
>
list
=
SysDictionaryCache
.
list
(
context
,
input
.
getAlias
());
SysDictionaryEnt
sysDictionaryEnt
=
mapper
.
selectOne
(
new
QueryWrapper
<
SysDictionaryEnt
>()
.
lambda
()
SysDictionaryEnt
sysDictionaryEnt
=
mapper
.
selectOne
(
new
LambdaQueryWrapper
<
SysDictionaryEnt
>()
.
eq
(
SysDictionaryEnt:
:
getAlias
,
input
.
getAlias
())
.
gt
(
SysDictionaryEnt:
:
getEndTime
,
new
Date
()));
list
=
list
.
stream
().
filter
((
SysDictionaryCache
dic
)
->
CharSequenceUtil
.
equals
(
dic
.
getPid
(),
sysDictionaryEnt
.
getId
()))
...
...
@@ -613,8 +614,7 @@ public class SysDictionaryService {
if
(
CollUtil
.
isEmpty
(
list
))
{
list
=
SysDictionaryCache
.
list
(
context
,
input
.
getAlias
());
//查询alias字典
SysDictionaryEnt
sysDictionary
=
mapper
.
selectOne
(
new
QueryWrapper
<
SysDictionaryEnt
>()
.
lambda
()
SysDictionaryEnt
sysDictionary
=
mapper
.
selectOne
(
new
LambdaQueryWrapper
<
SysDictionaryEnt
>()
.
eq
(
SysDictionaryEnt:
:
getAlias
,
input
.
getAlias
())
.
gt
(
SysDictionaryEnt:
:
getEndTime
,
new
Date
()));
if
(
ObjectUtil
.
isNotNull
(
sysDictionary
))
{
...
...
@@ -675,41 +675,8 @@ public class SysDictionaryService {
}
}
}
if
(
ObjectUtil
.
isNotNull
(
sysDictionaryEnt
.
getIsOrg
())
&&
sysDictionaryEnt
.
getIsOrg
()
==
1
)
{
//查询当前登录人的组织机构层级路径
SysOrganizationRelEnt
sysOrganizationRelEnt
=
orgRelMapper
.
selectOne
(
new
QueryWrapper
<
SysOrganizationRelEnt
>()
.
lambda
()
.
eq
(
SysOrganizationRelEnt:
:
getOuId
,
input
.
getOuId
())
.
gt
(
SysOrganizationRelEnt:
:
getEndTime
,
new
Date
()));
//根据字典id查询
List
<
SysOrganizationDictionaryEnt
>
sysOrganizationDictionaryEnts
=
orgDicmapper
.
selectList
(
new
QueryWrapper
<
SysOrganizationDictionaryEnt
>()
.
lambda
()
.
eq
(
SysOrganizationDictionaryEnt:
:
getParentDicCode
,
sysDictionaryEnt
.
getId
())
.
gt
(
SysOrganizationDictionaryEnt:
:
getEndTime
,
new
Date
()));
String
ouIdPath
=
sysOrganizationRelEnt
.
getOuIdPath
();
String
ouId
=
sysOrganizationRelEnt
.
getOuId
();
if
(
CharSequenceUtil
.
isNotBlank
(
ouIdPath
))
{
List
<
String
>
dicIds
=
sysOrganizationDictionaryEnts
.
stream
().
map
(
p
->
{
if
(
CharSequenceUtil
.
contains
(
ouIdPath
,
p
.
getOuId
())
&&
p
.
getUseLowerLevel
()
==
1
)
{
return
p
.
getDicCode
();
}
else
if
(
CharSequenceUtil
.
contains
(
ouId
,
p
.
getOuId
()))
{
return
p
.
getDicCode
();
}
else
{
return
"1"
;
}
}).
collect
(
Collectors
.
toList
());
list
=
list
.
stream
().
filter
(
i
->
dicIds
.
contains
(
i
.
getId
())).
collect
(
Collectors
.
toList
());
}
}
list
.
sort
((
o1
,
o2
)
->
{
if
(
ObjectUtil
.
isAllNotEmpty
(
o1
.
getSort
(),
o2
.
getSort
()))
{
return
o1
.
getSort
()
-
o2
.
getSort
();
}
else
{
return
0
;
}
});
List
<
QuerySysDictionaryViewOutput
>
outputs
=
XCopyUtils
.
copyNewList
(
list
,
QuerySysDictionaryViewOutput
.
class
);
return
XListResult
.
success
(
outputs
);
list
.
sort
(
Comparator
.
comparing
(
SysDictionaryCache:
:
getSort
));
return
XListResult
.
success
(
BeanUtil
.
copyToList
(
list
,
QuerySysDictionaryViewOutput
.
class
));
}
@XText
(
"获取字典地区树"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment