From 97fe316e4eee9a6edf56a3bfc9c8b98d8b4872dd Mon Sep 17 00:00:00 2001 From: lidongdong <1459917685@qq.com> Date: 星期二, 04 七月 2023 16:29:04 +0800 Subject: [PATCH] 修改街道新增报错 --- springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java index 4cfedb9..a580299 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java @@ -1258,12 +1258,12 @@ public R addUserBackstage(AdministratorsUserVO administratorsUserVO) { List<SysUserDO> list=userDao.selectList(new QueryWrapper<SysUserDO>().lambda(). + eq(SysUserDO::getAppId,administratorsUserVO.getAppid()). eq(SysUserDO::getAccount,administratorsUserVO.getAccount())); - if(list!=null || list.size()>0) + if(list!=null && list.size()>0) { return R.fail("账户已存在!"); } - ComActVO comActVO = userDao.selectCommunity(administratorsUserVO.getCommunityId()); if (nonNull(comActVO)) { @@ -1414,10 +1414,10 @@ } sysRoleDO.setRoleSort(0); sysRoleDO.setCreateBy(administratorsUserVO.getUserId()); - SysRoleDO sysRoleDO1 = roleDAO.selectOne( + List<SysRoleDO> sysRoleDO1 = roleDAO.selectList( new QueryWrapper<SysRoleDO>().lambda().eq(SysRoleDO::getRoleKey, sysRoleDO.getRoleKey())); - if (sysRoleDO1 != null) { - sysRoleDO = sysRoleDO1; + if (sysRoleDO1 != null && sysRoleDO1.size()>0 ) { + sysRoleDO = sysRoleDO1.get(0); roleId = sysRoleDO.getRoleId(); } else { roleDAO.insert(sysRoleDO); -- Gitblit v1.7.1