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
d01a1e09
Commit
d01a1e09
authored
Mar 03, 2025
by
luben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
8de719b0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
6 deletions
+30
-6
RegionController.java
.../java/com/ruoyi/web/controller/grid/RegionController.java
+25
-3
GridRegionMapper.java
...n/java/com/ruoyi/system/mapper/grid/GridRegionMapper.java
+1
-1
GridRegionMapper.xml
...ystem/src/main/resources/mapper/grid/GridRegionMapper.xml
+4
-2
No files found.
ruoyi-admin/src/main/java/com/ruoyi/web/controller/grid/RegionController.java
View file @
d01a1e09
...
@@ -25,6 +25,7 @@ import org.apache.poi.ss.usermodel.Row;
...
@@ -25,6 +25,7 @@ import org.apache.poi.ss.usermodel.Row;
import
org.apache.poi.ss.usermodel.Sheet
;
import
org.apache.poi.ss.usermodel.Sheet
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
...
@@ -716,9 +717,30 @@ public class RegionController extends BaseController {
...
@@ -716,9 +717,30 @@ public class RegionController extends BaseController {
if
(!
StringUtils
.
isBlank
(
wgCode
)){
if
(!
StringUtils
.
isBlank
(
wgCode
)){
wgCodeLikes
=
Arrays
.
asList
(
wgCode
.
split
(
","
));
wgCodeLikes
=
Arrays
.
asList
(
wgCode
.
split
(
","
));
}
}
List
<
GridTreeNode
>
treeNodeList
=
new
ArrayList
<>();
List
<
GridRegion
>
gridRegionList
=
gridRegionMapper
.
getThirdRegion
(
wgType
,
wgCodeLikes
,
name
);
List
<
GridRegion
>
gridRegionList
=
gridRegionMapper
.
getSecondOrThirdRegion
(
wgType
,
wgCodeLikes
,
null
,
"2"
);
return
AjaxResult
.
success
(
gridRegionList
);
for
(
GridRegion
gridRegion
:
gridRegionList
){
List
<
String
>
parent
=
new
ArrayList
<>();
parent
.
add
(
gridRegion
.
getWgCode
());
List
<
GridRegion
>
children
=
gridRegionMapper
.
getSecondOrThirdRegion
(
wgType
,
parent
,
name
,
"3"
);
GridTreeNode
treeNode
=
new
GridTreeNode
();
BeanUtils
.
copyProperties
(
gridRegion
,
treeNode
);
treeNode
.
setName
(
gridRegion
.
getWgName
());
treeNode
.
setId
(
gridRegion
.
getId
());
treeNode
.
setCode
(
gridRegion
.
getWgCode
());
treeNode
.
setParentId
(
gridRegion
.
getWgParentId
());
for
(
GridRegion
child
:
children
){
GridTreeNode
childTreeNode
=
new
GridTreeNode
();
BeanUtils
.
copyProperties
(
child
,
childTreeNode
);
childTreeNode
.
setName
(
child
.
getWgName
());
childTreeNode
.
setId
(
child
.
getId
());
childTreeNode
.
setCode
(
child
.
getWgCode
());
childTreeNode
.
setParentId
(
child
.
getWgParentId
());
treeNode
.
getChild
().
add
(
childTreeNode
);
}
treeNodeList
.
add
(
treeNode
);
}
return
AjaxResult
.
success
(
treeNodeList
);
}
}
@RequestMapping
(
value
=
"/getOneOrTwoRegion"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/getOneOrTwoRegion"
,
method
=
RequestMethod
.
GET
)
...
...
ruoyi-system/src/main/java/com/ruoyi/system/mapper/grid/GridRegionMapper.java
View file @
d01a1e09
...
@@ -46,5 +46,5 @@ public interface GridRegionMapper {
...
@@ -46,5 +46,5 @@ public interface GridRegionMapper {
Integer
countByParams
(
GridRegionSearchParam
param
);
Integer
countByParams
(
GridRegionSearchParam
param
);
List
<
GridRegion
>
get
ThirdRegion
(
@Param
(
"wgType"
)
String
wgType
,
@Param
(
"wgCodeLikes"
)
List
<
String
>
wgCodeLikes
,
@Param
(
"name"
)
String
name
);
List
<
GridRegion
>
get
SecondOrThirdRegion
(
@Param
(
"wgType"
)
String
wgType
,
@Param
(
"wgCodeLikes"
)
List
<
String
>
wgCodeLikes
,
@Param
(
"name"
)
String
name
,
@Param
(
"level"
)
String
level
);
}
}
\ No newline at end of file
ruoyi-system/src/main/resources/mapper/grid/GridRegionMapper.xml
View file @
d01a1e09
...
@@ -612,7 +612,7 @@
...
@@ -612,7 +612,7 @@
and level = #{level}
and level = #{level}
</if>
</if>
</select>
</select>
<select
id=
"getThirdRegion"
resultType=
"com.ruoyi.system.domain.grid.GridRegion"
>
<select
id=
"get
SecondOr
ThirdRegion"
resultType=
"com.ruoyi.system.domain.grid.GridRegion"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from grid_region where is_valid = '1'
from grid_region where is_valid = '1'
...
@@ -622,6 +622,8 @@
...
@@ -622,6 +622,8 @@
wg_code like CONCAT(#{wgCode}, '%')
wg_code like CONCAT(#{wgCode}, '%')
</foreach>
</foreach>
)
)
</if>
<if
test=
"level !=2"
>
and (
and (
<foreach
collection=
"wgCodeLikes"
item=
"wgCode"
open=
"("
close=
")"
separator=
"and"
>
<foreach
collection=
"wgCodeLikes"
item=
"wgCode"
open=
"("
close=
")"
separator=
"and"
>
wg_code != #{wgCode}
wg_code != #{wgCode}
...
@@ -634,6 +636,6 @@
...
@@ -634,6 +636,6 @@
<if
test=
"name != null and name != ''"
>
<if
test=
"name != null and name != ''"
>
and wg_name = #{name}
and wg_name = #{name}
</if>
</if>
and level =
3
and level =
#{level}
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
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