Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
auth-master
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
吴超
auth-master
Commits
3a1726f3
Commit
3a1726f3
authored
Feb 01, 2026
by
周海峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
4f916bff
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
70 行增加
和
4 行删除
+70
-4
doc/sql/update.sql
+14
-2
src/main/java/com/metro/auth/platform/controller/PlatformApplicationsController.java
+15
-0
src/main/java/com/metro/auth/platform/domain/auth/PlatformApplications.java
+13
-0
src/main/java/com/metro/auth/platform/mapper/PlatformApplicationsMapper.xml
+4
-2
src/main/java/com/metro/auth/platform/service/PlatformApplicationsService.java
+7
-0
src/main/java/com/metro/auth/platform/service/PlatformApplicationsServiceImpl.java
+17
-0
没有找到文件。
doc/sql/update.sql
View file @
3a1726f3
...
@@ -50,4 +50,17 @@ VALUES ('1', '系统公告', 'menu_announcement', 1, 1),
...
@@ -50,4 +50,17 @@ VALUES ('1', '系统公告', 'menu_announcement', 1, 1),
(
'6'
,
'网上培训'
,
'menu_wangshang'
,
6
,
1
),
(
'6'
,
'网上培训'
,
'menu_wangshang'
,
6
,
1
),
(
'7'
,
'廉政文化'
,
'menu_lianzheng'
,
7
,
1
),
(
'7'
,
'廉政文化'
,
'menu_lianzheng'
,
7
,
1
),
(
'8'
,
'员工天地'
,
'menu_yuangong'
,
8
,
1
),
(
'8'
,
'员工天地'
,
'menu_yuangong'
,
8
,
1
),
(
'9'
,
'常用表格'
,
'menu_biaoge'
,
9
,
1
);
(
'9'
,
'常用表格'
,
'menu_biaoge'
,
9
,
1
);
\ No newline at end of file
-- 如果是新建表,添加字段
ALTER
TABLE
platform_applications
ADD
COLUMN
wechat_num
VARCHAR
(
50
)
DEFAULT
NULL
COMMENT
'组内排序编号'
;
-- 如果是更新已有数据,将现有数据的 wechat_num 初始化为当前排序
UPDATE
platform_applications
SET
wechat_num
=
(
SELECT
t
.
num
FROM
(
SELECT
id
,
ROW_NUMBER
()
OVER
(
ORDER
BY
addtime
,
id
)
AS
num
FROM
platform_applications
)
t
WHERE
t
.
id
=
platform_applications
.
id
);
src/main/java/com/metro/auth/platform/controller/PlatformApplicationsController.java
View file @
3a1726f3
...
@@ -67,6 +67,21 @@ public class PlatformApplicationsController {
...
@@ -67,6 +67,21 @@ public class PlatformApplicationsController {
}
}
}
}
/**
* 批量更新组内应用排序(wechatNum 字段)
* @param list 包含 id 与 wechatNum 字段的应用列表
* @return 操作结果
*/
@PostMapping
(
"/platformapplications/updateWechatNum"
)
public
ResultJson
updateWechatNum
(
@RequestBody
List
<
PlatformApplications
>
list
)
{
int
count
=
platformApplicationsService
.
updateWechatNum
(
list
);
if
(
count
>=
0
)
{
return
ResultJson
.
ok
();
}
else
{
return
ResultJson
.
failure
(
ResultCode
.
RESPONSE_ERROR
);
}
}
@GetMapping
(
"/platformapplications/listbyrole/{roleid}"
)
@GetMapping
(
"/platformapplications/listbyrole/{roleid}"
)
public
ResultJson
listbyrole
(
@PathVariable
String
roleid
){
public
ResultJson
listbyrole
(
@PathVariable
String
roleid
){
List
<
PlatformApplications
>
list
=
platformApplicationsService
.
getPlatformApplicationsListByRole
(
roleid
);
List
<
PlatformApplications
>
list
=
platformApplicationsService
.
getPlatformApplicationsListByRole
(
roleid
);
...
...
src/main/java/com/metro/auth/platform/domain/auth/PlatformApplications.java
View file @
3a1726f3
...
@@ -110,6 +110,19 @@ public class PlatformApplications implements Serializable {
...
@@ -110,6 +110,19 @@ public class PlatformApplications implements Serializable {
*/
*/
private
String
num
;
private
String
num
;
/**
* 组内排序编号
*/
private
String
wechatNum
;
public
String
getWechatNum
()
{
return
wechatNum
;
}
public
void
setWechatNum
(
String
wechatNum
)
{
this
.
wechatNum
=
wechatNum
;
}
public
String
getNum
()
{
public
String
getNum
()
{
return
num
;
return
num
;
}
}
...
...
src/main/java/com/metro/auth/platform/mapper/PlatformApplicationsMapper.xml
View file @
3a1726f3
...
@@ -98,7 +98,7 @@
...
@@ -98,7 +98,7 @@
</sql>
</sql>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, title, img, href, addtime, tishi, databasename, databasepassword, databasecon, qyflag, appid, secret,
id, title, img, href, addtime, tishi, databasename, databasepassword, databasecon, qyflag, appid, secret,
openmail, mailtype, group_code, wechat_url, num
openmail, mailtype, group_code, wechat_url, num
, wechat_num
</sql>
</sql>
<select
id=
"selectByExample"
parameterType=
"com.metro.auth.platform.domain.auth.PlatformApplicationsExample"
<select
id=
"selectByExample"
parameterType=
"com.metro.auth.platform.domain.auth.PlatformApplicationsExample"
resultMap=
"BaseResultMap"
>
resultMap=
"BaseResultMap"
>
...
@@ -302,7 +302,9 @@
...
@@ -302,7 +302,9 @@
<if
test=
"num != null"
>
<if
test=
"num != null"
>
num = #{num,jdbcType=VARCHAR},
num = #{num,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"wechatNum != null"
>
wechat_num = #{wechatNum,jdbcType=VARCHAR},
</if>
</set>
</set>
where id = #{id,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</update>
...
...
src/main/java/com/metro/auth/platform/service/PlatformApplicationsService.java
View file @
3a1726f3
...
@@ -23,4 +23,11 @@ public interface PlatformApplicationsService {
...
@@ -23,4 +23,11 @@ public interface PlatformApplicationsService {
* @return 更新数量
* @return 更新数量
*/
*/
int
updateOrder
(
List
<
PlatformApplications
>
list
);
int
updateOrder
(
List
<
PlatformApplications
>
list
);
/**
* 批量更新组内应用排序(wechatNum 字段)
* @param list 包含 id 与 wechatNum 的应用列表
* @return 更新数量
*/
int
updateWechatNum
(
List
<
PlatformApplications
>
list
);
}
}
src/main/java/com/metro/auth/platform/service/PlatformApplicationsServiceImpl.java
View file @
3a1726f3
...
@@ -105,6 +105,23 @@ public class PlatformApplicationsServiceImpl implements PlatformApplicationsServ
...
@@ -105,6 +105,23 @@ public class PlatformApplicationsServiceImpl implements PlatformApplicationsServ
}
}
@Override
@Override
public
int
updateWechatNum
(
List
<
PlatformApplications
>
list
)
{
int
updated
=
0
;
if
(
list
==
null
||
list
.
isEmpty
())
{
return
updated
;
}
for
(
PlatformApplications
item
:
list
)
{
if
(
item
.
getId
()
!=
null
)
{
PlatformApplications
record
=
new
PlatformApplications
();
record
.
setId
(
item
.
getId
());
record
.
setWechatNum
(
item
.
getWechatNum
());
updated
+=
platformApplicationsMapper
.
updateByPrimaryKeySelective
(
record
);
}
}
return
updated
;
}
@Override
public
List
<
PlatformApplications
>
getPlatformApplicationsListByUserid
(
String
userid
)
{
public
List
<
PlatformApplications
>
getPlatformApplicationsListByUserid
(
String
userid
)
{
// 1. 查询所有启用的应用
// 1. 查询所有启用的应用
PlatformApplicationsExample
example
=
new
PlatformApplicationsExample
();
PlatformApplicationsExample
example
=
new
PlatformApplicationsExample
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论