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
0f4807a3
Commit
0f4807a3
authored
Jul 30, 2025
by
luben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat
parent
43526442
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
0 deletions
+52
-0
RegionController.java
.../java/com/ruoyi/web/controller/grid/RegionController.java
+34
-0
GridRegionMapper.java
...n/java/com/ruoyi/system/mapper/grid/GridRegionMapper.java
+2
-0
GridRegionMapper.xml
...ystem/src/main/resources/mapper/grid/GridRegionMapper.xml
+16
-0
No files found.
ruoyi-admin/src/main/java/com/ruoyi/web/controller/grid/RegionController.java
View file @
0f4807a3
...
@@ -2,6 +2,7 @@ package com.ruoyi.web.controller.grid;
...
@@ -2,6 +2,7 @@ package com.ruoyi.web.controller.grid;
import
com.alibaba.fastjson2.JSON
;
import
com.alibaba.fastjson2.JSON
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.AjaxResult
;
...
@@ -1055,4 +1056,37 @@ public class RegionController extends BaseController {
...
@@ -1055,4 +1056,37 @@ public class RegionController extends BaseController {
}
}
}
}
@RequestMapping
(
value
=
"/getThreeByUser"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
AjaxResult
getThreeByUser
(
@RequestParam
(
"wgType"
)
String
wgType
,
@RequestParam
(
"pageNum"
)
Integer
pageNum
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
)
{
AjaxResult
result
=
new
AjaxResult
();
SysUser
user
=
SecurityUtils
.
getLoginUser
().
getUser
();
//网格
GridRegionUserExample
example
=
new
GridRegionUserExample
();
GridRegionUserExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andUserIdEqualTo
(
user
.
getUserId
());
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
<>();
List
<
GridRegion
>
gridRegions
=
new
ArrayList
<>();
PageHelper
.
startPage
(
pageNum
,
pageSize
);
//3.20权限bug
if
(
regions
.
get
(
0
).
equals
(
"320282001"
)){
// regionList.add("320282001");
gridRegions
=
gridRegionMapper
.
getAllLevelThree
(
null
,
wgType
);
}
else
{
regionList
.
addAll
(
regions
);
gridRegions
=
gridRegionMapper
.
getAllLevelThree
(
regionList
,
wgType
);
}
PageInfo
<
GridRegion
>
pageInfo
=
new
PageInfo
<>(
gridRegions
);
return
AjaxResult
.
success
(
pageInfo
);
}
}
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/grid/GridRegionMapper.java
View file @
0f4807a3
...
@@ -96,4 +96,6 @@ public interface GridRegionMapper {
...
@@ -96,4 +96,6 @@ public interface GridRegionMapper {
int
selectMaxPosition
();
int
selectMaxPosition
();
GridRegion
selectByWgName
(
@Param
(
"wgName"
)
String
wgName
);
GridRegion
selectByWgName
(
@Param
(
"wgName"
)
String
wgName
);
List
<
GridRegion
>
getAllLevelThree
(
@Param
(
"wgCodeLikes"
)
List
<
String
>
wgCodeLikes
,
@Param
(
"wgType"
)
String
wgType
);
}
}
ruoyi-system/src/main/resources/mapper/grid/GridRegionMapper.xml
View file @
0f4807a3
...
@@ -798,4 +798,20 @@
...
@@ -798,4 +798,20 @@
where wg_name = #{wgName} and is_valid = '1' limit 1
where wg_name = #{wgName} and is_valid = '1' limit 1
</select>
</select>
<select
id=
"getAllLevelThree"
resultType=
"com.ruoyi.system.domain.grid.GridRegion"
>
select
<include
refid=
"Base_Column_List"
/>
from grid_region where is_valid = '1'
and wg_type = #{wgType}
<if
test=
"wgCodeLikes != null and wgCodeLikes.size() > 0"
>
and (
<foreach
collection=
"wgCodeLikes"
item=
"wgCode"
open=
"("
close=
")"
separator=
"or"
>
wg_parent_id = #{wgCode}
</foreach>
)
</if>
and level = 3
order by position asc
</select>
</mapper>
</mapper>
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