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
13d48ad7
Commit
13d48ad7
authored
Feb 04, 2026
by
周海峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
6063868a
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
108 行增加
和
12 行删除
+108
-12
src/main/java/com/metro/auth/platform/controller/PlatformApplicationsController.java
+28
-0
src/main/java/com/metro/auth/platform/mapper/PlatformApplicationsMapper.java
+16
-0
src/main/java/com/metro/auth/platform/mapper/PlatformApplicationsMapper.xml
+18
-0
src/main/java/com/metro/auth/platform/service/PlatformApplicationsService.java
+16
-0
src/main/java/com/metro/auth/platform/service/PlatformApplicationsServiceImpl.java
+28
-10
src/main/java/com/metro/auth/platform/service/PlatformRoleServiceImpl.java
+2
-2
没有找到文件。
src/main/java/com/metro/auth/platform/controller/PlatformApplicationsController.java
View file @
13d48ad7
...
...
@@ -98,4 +98,32 @@ public class PlatformApplicationsController {
List
<
PlatformApplications
>
list
=
platformApplicationsService
.
getPlatformApplicationsListByUserid
(
userid
);
return
ResultJson
.
ok
(
list
);
}
/**
* 验证应用唯一标识是否唯一
* @param appid 应用唯一标识
* @param excludeId 排除的记录ID(编辑时使用)
* @return true-唯一,false-已存在
*/
@GetMapping
(
"/platformapplications/checkAppidUnique"
)
public
ResultJson
checkAppidUnique
(
@RequestParam
(
required
=
true
)
String
appid
,
@RequestParam
(
required
=
false
)
Integer
excludeId
)
{
boolean
isUnique
=
platformApplicationsService
.
checkAppidUnique
(
appid
,
excludeId
);
return
ResultJson
.
ok
(
isUnique
);
}
/**
* 验证待办标识是否唯一
* @param mailtype 待办标识
* @param excludeId 排除的记录ID(编辑时使用)
* @return true-唯一,false-已存在
*/
@GetMapping
(
"/platformapplications/checkMailtypeUnique"
)
public
ResultJson
checkMailtypeUnique
(
@RequestParam
(
required
=
true
)
String
mailtype
,
@RequestParam
(
required
=
false
)
Integer
excludeId
)
{
boolean
isUnique
=
platformApplicationsService
.
checkMailtypeUnique
(
mailtype
,
excludeId
);
return
ResultJson
.
ok
(
isUnique
);
}
}
src/main/java/com/metro/auth/platform/mapper/PlatformApplicationsMapper.java
View file @
13d48ad7
...
...
@@ -114,4 +114,20 @@ public interface PlatformApplicationsMapper {
int
insertRoleApplication
(
PlatformRoleApplication
platformRoleApplication
);
List
<
PlatformApplications
>
getPlatformApplicationsListByRoleAppList
(
List
<
String
>
roleid
);
/**
* 验证应用唯一标识是否唯一
* @param appid 应用唯一标识
* @param excludeId 排除的记录ID(编辑时使用)
* @return 数量
*/
int
checkAppidUnique
(
@Param
(
"appid"
)
String
appid
,
@Param
(
"excludeId"
)
Integer
excludeId
);
/**
* 验证待办标识是否唯一
* @param mailtype 待办标识
* @param excludeId 排除的记录ID(编辑时使用)
* @return 数量
*/
int
checkMailtypeUnique
(
@Param
(
"mailtype"
)
String
mailtype
,
@Param
(
"excludeId"
)
Integer
excludeId
);
}
src/main/java/com/metro/auth/platform/mapper/PlatformApplicationsMapper.xml
View file @
13d48ad7
...
...
@@ -365,4 +365,22 @@
insert into platform_role_application (id, roleid, applicationid)
values (#{id,jdbcType=VARCHAR}, #{roleid,jdbcType=VARCHAR}, #{applicationid,jdbcType=VARCHAR})
</insert>
<!-- 验证应用唯一标识是否唯一 -->
<select
id=
"checkAppidUnique"
resultType=
"int"
>
select count(*) from platform_applications
where appid = #{appid,jdbcType=VARCHAR}
<if
test=
"excludeId != null"
>
and id
<
> #{excludeId,jdbcType=INTEGER}
</if>
</select>
<!-- 验证待办标识是否唯一 -->
<select
id=
"checkMailtypeUnique"
resultType=
"int"
>
select count(*) from platform_applications
where mailtype = #{mailtype,jdbcType=VARCHAR}
<if
test=
"excludeId != null"
>
and id
<
> #{excludeId,jdbcType=INTEGER}
</if>
</select>
</mapper>
src/main/java/com/metro/auth/platform/service/PlatformApplicationsService.java
View file @
13d48ad7
...
...
@@ -30,4 +30,20 @@ public interface PlatformApplicationsService {
* @return 更新数量
*/
int
updateWechatNum
(
List
<
PlatformApplications
>
list
);
/**
* 验证应用唯一标识是否唯一
* @param appid 应用唯一标识
* @param excludeId 排除的记录ID(编辑时使用)
* @return true-唯一,false-已存在
*/
boolean
checkAppidUnique
(
String
appid
,
Integer
excludeId
);
/**
* 验证待办标识是否唯一
* @param mailtype 待办标识
* @param excludeId 排除的记录ID(编辑时使用)
* @return true-唯一,false-已存在
*/
boolean
checkMailtypeUnique
(
String
mailtype
,
Integer
excludeId
);
}
src/main/java/com/metro/auth/platform/service/PlatformApplicationsServiceImpl.java
View file @
13d48ad7
...
...
@@ -47,16 +47,16 @@ public class PlatformApplicationsServiceImpl implements PlatformApplicationsServ
public
int
savaApp
(
PlatformApplications
platformApplications
)
throws
Exception
{
// 判断待办唯一标识是否重复
if
(
"1"
.
equals
(
platformApplications
.
getOpenmail
())
&&
StringUtils
.
isEmpty
(
platformApplications
.
getMailtype
()))
{
throw
new
Exception
(
"启用
待办标识不能为空"
);
}
if
(
StringUtils
.
isNotEmpty
(
platformApplications
.
getMailtype
()))
{
//所有应用
List
<
PlatformApplications
>
attlist
=
platformApplicationsMapper
.
selectListByMailType
(
platformApplications
.
getMailtype
(),
platformApplications
.
getId
());
if
(
attlist
.
size
()
>
0
)
{
throw
new
Exception
(
"启用
待办标识不能重复,请重新设置"
);
}
}
//
if ("1".equals(platformApplications.getOpenmail()) && StringUtils.isEmpty(platformApplications.getMailtype())) {
// throw new Exception("
待办标识不能为空");
//
}
//
if (StringUtils.isNotEmpty(platformApplications.getMailtype())) {
//
//所有应用
//
List<PlatformApplications> attlist = platformApplicationsMapper.selectListByMailType(platformApplications.getMailtype(), platformApplications.getId());
//
if (attlist.size() > 0) {
// throw new Exception("
待办标识不能重复,请重新设置");
//
}
//
}
int
count
=
0
;
...
...
@@ -191,4 +191,22 @@ public class PlatformApplicationsServiceImpl implements PlatformApplicationsServ
return
alllist
;
}
@Override
public
boolean
checkAppidUnique
(
String
appid
,
Integer
excludeId
)
{
if
(
StringUtils
.
isEmpty
(
appid
))
{
return
false
;
}
int
count
=
platformApplicationsMapper
.
checkAppidUnique
(
appid
,
excludeId
);
return
count
==
0
;
}
@Override
public
boolean
checkMailtypeUnique
(
String
mailtype
,
Integer
excludeId
)
{
if
(
StringUtils
.
isEmpty
(
mailtype
))
{
return
true
;
}
int
count
=
platformApplicationsMapper
.
checkMailtypeUnique
(
mailtype
,
excludeId
);
return
count
==
0
;
}
}
src/main/java/com/metro/auth/platform/service/PlatformRoleServiceImpl.java
View file @
13d48ad7
...
...
@@ -120,7 +120,7 @@ public class PlatformRoleServiceImpl implements PlatformRoleService{
if
(
platformSysRole
.
getGroup
()
!=
null
&&
!
platformSysRole
.
getGroup
().
isEmpty
())
{
String
[]
appid
=
platformSysRole
.
getGroup
().
split
(
","
);
//不选者可见菜单权限时的处理
if
(
appid
!=
null
&&
appid
.
length
>
0
){
if
(
appid
.
length
>
0
){
Arrays
.
stream
(
appid
).
forEach
(
t
->{
PlatformRoleApplication
platformRoleApplication
=
new
PlatformRoleApplication
();
platformRoleApplication
.
setId
(
StrUtil
.
makePramykey
());
...
...
@@ -133,7 +133,7 @@ public class PlatformRoleServiceImpl implements PlatformRoleService{
// 处理App端应用权限
if
(
platformSysRole
.
getGroupApp
()
!=
null
&&
!
platformSysRole
.
getGroupApp
().
isEmpty
())
{
String
[]
appidApp
=
platformSysRole
.
getGroupApp
().
split
(
","
);
if
(
appidApp
!=
null
&&
appidApp
.
length
>
0
){
if
(
appidApp
.
length
>
0
){
Arrays
.
stream
(
appidApp
).
forEach
(
t
->{
com
.
metro
.
auth
.
platform
.
domain
.
auth
.
PlatformRoleApplicationApp
platformRoleApplicationApp
=
new
com
.
metro
.
auth
.
platform
.
domain
.
auth
.
PlatformRoleApplicationApp
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论