Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yichengstreet-be
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yichengstreet
yichengstreet-be
Commits
031bc9ad
Commit
031bc9ad
authored
Mar 11, 2025
by
luben
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-lb' into 'dev'
Dev lb See merge request
!103
parents
2a432808
cff2dd19
Pipeline
#143108
passed with stages
in 6 minutes and 55 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
88 additions
and
9 deletions
+88
-9
RegionController.java
.../java/com/ruoyi/web/controller/grid/RegionController.java
+38
-3
GridRegionFacadeService.java
...om/ruoyi/system/service/grid/GridRegionFacadeService.java
+50
-6
No files found.
ruoyi-admin/src/main/java/com/ruoyi/web/controller/grid/RegionController.java
View file @
031bc9ad
...
...
@@ -7,10 +7,12 @@ import com.ruoyi.common.core.controller.BaseController;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.zqt.ZQTImportExcelUtil
;
import
com.ruoyi.system.domain.grid.GridRegion
;
import
com.ruoyi.system.domain.grid.GridRegionExample
;
import
com.ruoyi.system.domain.grid.GridRegionUser
;
import
com.ruoyi.system.domain.grid.GridRegionUserExample
;
import
com.ruoyi.system.domain.grid.vo.GridDxbVO
;
import
com.ruoyi.system.domain.grid.vo.GridTreeNode
;
import
com.ruoyi.system.mapper.grid.GridRegionMapper
;
...
...
@@ -67,10 +69,27 @@ public class RegionController extends BaseController {
@RequestParam
(
"pageSize"
)
Integer
pageSize
)
{
try
{
AjaxResult
result
=
new
AjaxResult
();
SysUser
user
=
SecurityUtils
.
getLoginUser
().
getUser
();
//网格
GridRegionUserExample
example
=
new
GridRegionUserExample
();
GridRegionUserExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andUserIdEqualTo
(
user
.
getUserId
());
// criteria.andUserIdEqualTo("2");
criteria
.
andIsValidEqualTo
(
"1"
);
List
<
GridRegionUser
>
relationship
=
gridRegionUserService
.
selectByExample
(
example
);
String
region
=
relationship
.
stream
().
map
(
GridRegionUser:
:
getWgId
).
collect
(
Collectors
.
joining
(
","
));
List
<
String
>
regions
=
Arrays
.
asList
(
region
.
split
(
","
));
List
<
String
>
regionList
=
new
ArrayList
<>();
if
(!
regions
.
get
(
0
).
equals
(
"320282001"
)){
regionList
.
add
(
"320282001"
);
}
regionList
.
addAll
(
regions
);
if
(
wgType
.
equals
(
"0"
)){
gridRegionFacadeService
.
getRolesWhereTypeZero
(
wgName
,
wgCode
,
wgType
,
level
,
wgPurpose
,
pageNum
,
pageSize
,
result
);
}
else
{
gridRegionFacadeService
.
getRoles
(
wgName
,
wgCode
,
wgType
,
level
,
wgPurpose
,
pageNum
,
pageSize
,
result
);
gridRegionFacadeService
.
getRoles
(
wgName
,
wgCode
,
wgType
,
level
,
wgPurpose
,
pageNum
,
pageSize
,
result
,
regionList
);
}
return
JSON
.
toJSONString
(
result
);
}
catch
(
Exception
e
)
{
...
...
@@ -552,8 +571,24 @@ public class RegionController extends BaseController {
@RequestMapping
(
value
=
"/getWsTreeNode"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
AjaxResult
getWsTreeNode
(
@RequestParam
(
"wgType"
)
String
wgType
,
String
isShow
,
@RequestParam
(
value
=
"isAll"
,
required
=
false
)
String
isAll
)
{
// SysUser user = SecurityUtils.getLoginUser().getUser();
//网格
GridRegionUserExample
example
=
new
GridRegionUserExample
();
GridRegionUserExample
.
Criteria
criteria
=
example
.
createCriteria
();
// criteria.andUserIdEqualTo(user.getUserId());
criteria
.
andUserIdEqualTo
(
"2"
);
criteria
.
andIsValidEqualTo
(
"1"
);
List
<
GridRegionUser
>
relationship
=
gridRegionUserService
.
selectByExample
(
example
);
String
region
=
relationship
.
stream
().
map
(
GridRegionUser:
:
getWgId
).
collect
(
Collectors
.
joining
(
","
));
List
<
String
>
regions
=
Arrays
.
asList
(
region
.
split
(
","
));
List
<
String
>
regionList
=
new
ArrayList
<>();
if
(!
regions
.
get
(
0
).
equals
(
"320282001"
)){
regionList
.
add
(
"320282001"
);
}
regionList
.
addAll
(
regions
);
if
(
wgType
.
equals
(
"0"
)){
return
AjaxResult
.
success
(
gridRegionFacadeService
.
getWsTreeNodeIncludeTwoPointFive
(
null
,
null
,
null
));
return
AjaxResult
.
success
(
gridRegionFacadeService
.
getWsTreeNodeIncludeTwoPointFive
(
null
,
null
,
null
,
regionList
));
}
SysUser
sysUser
=
getLoginUser
().
getUser
();
...
...
@@ -566,7 +601,7 @@ public class RegionController extends BaseController {
}
wgCodeList
=
list
.
stream
().
map
(
GridRegionUser:
:
getWgId
).
collect
(
Collectors
.
toList
());
}
return
AjaxResult
.
success
(
gridRegionFacadeService
.
getWsTreeNode
(
wgType
,
wgCodeList
,
isShow
));
return
AjaxResult
.
success
(
gridRegionFacadeService
.
getWsTreeNode
(
wgType
,
wgCodeList
,
isShow
,
regions
));
}
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/grid/GridRegionFacadeService.java
View file @
031bc9ad
...
...
@@ -247,7 +247,7 @@ public class GridRegionFacadeService {
return
gridRegion
;
}
public
void
getRoles
(
String
wgName
,
String
wgCode
,
String
wgType
,
String
level
,
String
purpose
,
Integer
pageNum
,
Integer
pageSize
,
AjaxResult
result
)
{
public
void
getRoles
(
String
wgName
,
String
wgCode
,
String
wgType
,
String
level
,
String
purpose
,
Integer
pageNum
,
Integer
pageSize
,
AjaxResult
result
,
List
<
String
>
regions
)
{
if
(
null
==
pageNum
||
pageNum
<=
0
)
{
pageNum
=
1
;
}
...
...
@@ -295,10 +295,26 @@ public class GridRegionFacadeService {
result
.
buildSuccess
(
"success"
,
appPageModel
);
return
;
}
List
<
GridRegion
>
res
=
new
ArrayList
<>();
if
(!(
regions
.
size
()==
1
&&
regions
.
get
(
0
).
equals
(
"320282001"
))){
Map
<
String
,
Integer
>
map
=
new
HashMap
<>();
for
(
String
region:
regions
){
map
.
put
(
region
,
1
);
}
for
(
GridRegion
region:
roles
){
if
(
map
.
containsKey
(
region
.
getWgCode
())){
res
.
add
(
region
);
}
}
}
else
{
res
=
roles
;
}
appPageModel
.
setCurPage
(
pageNum
);
appPageModel
.
setRecordCount
(
count
);
appPageModel
.
setRecordCount
(
res
.
size
()
);
appPageModel
.
setPageCount
((
long
)
Math
.
ceil
(
1.0
*
count
/
pageSize
));
List
<
GridRegionWithCompanyItem
>
itemList
=
BeanCopyUtil
.
bathToBean
(
r
ol
es
,
GridRegionWithCompanyItem
.
class
);
List
<
GridRegionWithCompanyItem
>
itemList
=
BeanCopyUtil
.
bathToBean
(
res
,
GridRegionWithCompanyItem
.
class
);
itemList
.
forEach
(
e
->
{
GridCompanyLandExample
gridCompanyLandExample
=
new
GridCompanyLandExample
();
GridCompanyLandExample
.
Criteria
gridCompanyLandExampleCriteria
=
gridCompanyLandExample
.
createCriteria
();
...
...
@@ -769,7 +785,7 @@ public class GridRegionFacadeService {
return
;
}
public
List
<
GridTreeNode
>
getWsTreeNode
(
String
wgType
,
List
<
String
>
wgList
,
String
isShow
)
{
public
List
<
GridTreeNode
>
getWsTreeNode
(
String
wgType
,
List
<
String
>
wgList
,
String
isShow
,
List
<
String
>
regions
)
{
GridRegionSearchParam
param
=
new
GridRegionSearchParam
();
param
.
setWgType
(
wgType
);
if
(!
CollectionUtils
.
isEmpty
(
wgList
)){
...
...
@@ -779,7 +795,21 @@ public class GridRegionFacadeService {
param
.
setShow
(
false
);
}
List
<
GridRegion
>
gridRegionList
=
gridRegionMapper
.
getByParams
(
param
);
return
convertFrRegion
(
gridRegionList
,
wgList
);
List
<
GridTreeNode
>
res
=
convertFrRegion
(
gridRegionList
,
wgList
);
List
<
GridTreeNode
>
degree_second
=
new
ArrayList
<>();
if
(!(
regions
.
size
()==
1
&&
regions
.
get
(
0
).
equals
(
"320282001"
))){
Map
<
String
,
Integer
>
map
=
new
HashMap
<>();
for
(
String
region:
regions
){
map
.
put
(
region
,
1
);
}
for
(
GridTreeNode
region:
res
.
get
(
0
).
getChild
()){
if
(
map
.
containsKey
(
region
.
getCode
())){
degree_second
.
add
(
region
);
}
}
res
.
get
(
0
).
setChild
(
degree_second
);
}
return
res
;
}
private
List
<
GridTreeNode
>
convertFrRegion
(
List
<
GridRegion
>
gridRegionList
,
List
<
String
>
wgCodes
)
{
...
...
@@ -1139,7 +1169,7 @@ public class GridRegionFacadeService {
return
gridRegionList
;
}
public
List
<
GridTreeNode
>
getWsTreeNodeIncludeTwoPointFive
(
String
wgType
,
List
<
String
>
wgList
,
String
isShow
)
{
public
List
<
GridTreeNode
>
getWsTreeNodeIncludeTwoPointFive
(
String
wgType
,
List
<
String
>
wgList
,
String
isShow
,
List
<
String
>
regions
)
{
//获取一级树
List
<
GridRegion
>
gridRegionList
=
gridRegionMapper
.
getRegionByTypeAndCode
(
"1"
,
new
ArrayList
<>(),
"1"
);
List
<
GridTreeNode
>
res
=
new
ArrayList
<>();
...
...
@@ -1237,6 +1267,20 @@ public class GridRegionFacadeService {
gridTreeNode
.
setChild
(
secondFiveTree
);
}
List
<
GridTreeNode
>
degree_second
=
new
ArrayList
<>();
if
(!(
regions
.
size
()==
1
&&
regions
.
get
(
0
).
equals
(
"320282001"
))){
Map
<
String
,
Integer
>
map
=
new
HashMap
<>();
for
(
String
region:
regions
){
map
.
put
(
region
,
1
);
}
for
(
GridTreeNode
region:
res
.
get
(
0
).
getChild
()){
if
(
map
.
containsKey
(
region
.
getCode
())){
degree_second
.
add
(
region
);
}
}
res
.
get
(
0
).
setChild
(
degree_second
);
}
return
res
;
}
...
...
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