Commit 13d48ad7 by 周海峰

no message

parent 6063868a
......@@ -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);
}
}
......@@ -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);
}
......@@ -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 &lt;> #{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 &lt;> #{excludeId,jdbcType=INTEGER}
</if>
</select>
</mapper>
......@@ -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);
}
......@@ -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;
}
}
......@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论