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
3d24ba98
Commit
3d24ba98
authored
Apr 23, 2025
by
luben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
8999fd07
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
4 deletions
+52
-4
RegionController.java
.../java/com/ruoyi/web/controller/grid/RegionController.java
+27
-3
Position.java
.../src/main/java/com/ruoyi/system/domain/grid/Position.java
+9
-0
GridRegionMapper.java
...n/java/com/ruoyi/system/mapper/grid/GridRegionMapper.java
+4
-0
GridRegionMapper.xml
...ystem/src/main/resources/mapper/grid/GridRegionMapper.xml
+12
-1
No files found.
ruoyi-admin/src/main/java/com/ruoyi/web/controller/grid/RegionController.java
View file @
3d24ba98
...
...
@@ -581,13 +581,13 @@ 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
();
//
SysUser user = SecurityUtils.getLoginUser().getUser();
//网格
GridRegionUserExample
example
=
new
GridRegionUserExample
();
GridRegionUserExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andUserIdEqualTo
(
user
.
getUserId
());
//
criteria.andUserIdEqualTo(user.getUserId());
//
criteria.andUserIdEqualTo("1");
criteria
.
andUserIdEqualTo
(
"1"
);
criteria
.
andIsValidEqualTo
(
"1"
);
List
<
GridRegionUser
>
relationship
=
gridRegionUserService
.
selectByExample
(
example
);
...
...
@@ -967,4 +967,28 @@ public class RegionController extends BaseController {
return
AjaxResult
.
success
(
gridRegionMapper
.
getFourRegionList
(
wgCode
));
}
@PostMapping
(
"/position"
)
public
AjaxResult
getVideoPosition
(
@RequestBody
Position
position
)
{
List
<
String
>
list
=
Arrays
.
asList
(
position
.
getIds
());
//需要两个数组,index_now记录当前传入数组的channelId在数据库中的position
//此处为了考虑按照类型分类后产生的不完整排序
int
[]
index_now
=
new
int
[
list
.
size
()];
// System.out.println(Arrays.toString(index_now));
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++){
String
channelId
=
list
.
get
(
i
);
int
position_now
=
gridRegionMapper
.
positionById
(
channelId
);
index_now
[
i
]
=
position_now
;
}
Arrays
.
sort
(
index_now
);
// System.out.println(Arrays.toString(index_now));
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++){
gridRegionMapper
.
position
(
list
.
get
(
i
),
index_now
[
i
]);
}
return
AjaxResult
.
success
();
}
}
ruoyi-system/src/main/java/com/ruoyi/system/domain/grid/Position.java
0 → 100644
View file @
3d24ba98
package
com
.
ruoyi
.
system
.
domain
.
grid
;
import
lombok.Data
;
@Data
public
class
Position
{
private
String
[]
ids
;
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/grid/GridRegionMapper.java
View file @
3d24ba98
...
...
@@ -78,4 +78,8 @@ public interface GridRegionMapper {
String
getJzAreaByCode
(
@Param
(
"code"
)
String
code
);
List
<
GridRegion
>
getFourRegionList
(
@RequestParam
(
"wgCode"
)
String
wgCode
);
int
positionById
(
@Param
(
"id"
)
String
id
);
int
position
(
@Param
(
"id"
)
String
id
,
@Param
(
"position"
)
int
position
);
}
\ No newline at end of file
ruoyi-system/src/main/resources/mapper/grid/GridRegionMapper.xml
View file @
3d24ba98
...
...
@@ -598,7 +598,7 @@
#{wgCode}
</foreach>
</if>
order by wg_code asc
order by
position,
wg_code asc
</select>
<select
id=
"countByParams"
resultType=
"java.lang.Integer"
>
select
...
...
@@ -740,7 +740,18 @@
<include
refid=
"Base_Column_List"
/>
from grid_region where is_valid = '1'
and wg_parent_id = #{wgCode}
order by position asc
</select>
<select
id=
"positionById"
parameterType=
"String"
resultType=
"integer"
>
select position
from grid_region
where id = #{id}
</select>
<update
id=
"position"
>
UPDATE grid_region
SET position = #{position} where id = #{id}
</update>
</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