判重处理更新

master
chen 2 years ago
parent aae885b12e
commit f568a8dda0
  1. 3
      src/main/java/com/huoran/iasf/service/impl/DeptServiceImpl.java
  2. 8
      src/main/java/com/huoran/iasf/service/impl/RoleServiceImpl.java
  3. 4
      src/main/resources/application-dev.yml

@ -1,6 +1,5 @@
package com.huoran.iasf.service.impl; package com.huoran.iasf.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@ -67,7 +66,7 @@ public class DeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impleme
QueryWrapper<SysDept> queryWrapper = new QueryWrapper<>(); QueryWrapper<SysDept> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("name", sysDept.getName()); queryWrapper.eq("name", sysDept.getName());
queryWrapper.eq("pid", sysDept.getPid()); queryWrapper.eq("pid", sysDept.getPid());
if (StrUtil.isNotEmpty(sysDept.getId().toString())) { if (sysDept.getId()!=null) {
queryWrapper.last(" and id != " + sysDept.getId()); queryWrapper.last(" and id != " + sysDept.getId());
} }
List<SysDept> sysDepts = baseMapper.selectList(queryWrapper); List<SysDept> sysDepts = baseMapper.selectList(queryWrapper);

@ -1,6 +1,5 @@
package com.huoran.iasf.service.impl; package com.huoran.iasf.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -10,7 +9,10 @@ import com.huoran.iasf.entity.SysRole;
import com.huoran.iasf.entity.SysRolePermission; import com.huoran.iasf.entity.SysRolePermission;
import com.huoran.iasf.entity.SysUserRole; import com.huoran.iasf.entity.SysUserRole;
import com.huoran.iasf.mapper.SysRoleMapper; import com.huoran.iasf.mapper.SysRoleMapper;
import com.huoran.iasf.service.*; import com.huoran.iasf.service.HttpSessionService;
import com.huoran.iasf.service.RolePermissionService;
import com.huoran.iasf.service.RoleService;
import com.huoran.iasf.service.UserRoleService;
import com.huoran.iasf.vo.req.RolePermissionOperationReqVO; import com.huoran.iasf.vo.req.RolePermissionOperationReqVO;
import com.huoran.iasf.vo.resp.DeptRespNodeVO; import com.huoran.iasf.vo.resp.DeptRespNodeVO;
import com.huoran.iasf.vo.resp.PermissionRespNode; import com.huoran.iasf.vo.resp.PermissionRespNode;
@ -140,7 +142,7 @@ public class RoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impleme
public boolean checkDeptRepeat(SysRole vo) { public boolean checkDeptRepeat(SysRole vo) {
QueryWrapper<SysRole> queryWrapper = new QueryWrapper<>(); QueryWrapper<SysRole> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("name", vo.getName()); queryWrapper.eq("name", vo.getName());
if (StrUtil.isNotEmpty(vo.getId().toString())) { if (vo.getId()!=null) {
queryWrapper.last(" and id != " + vo.getId()); queryWrapper.last(" and id != " + vo.getId());
} }
List<SysRole> sysRoles = baseMapper.selectList(queryWrapper); List<SysRole> sysRoles = baseMapper.selectList(queryWrapper);

@ -6,9 +6,9 @@ spring:
datasource: datasource:
master: master:
username: root username: root
password: HuoRan@2021 password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://139.9.47.170:3306/iasf?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=GMT%2b8 url: jdbc:mysql://192.168.31.136:3306/iasf?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=GMT%2b8
cache: cache:
type: redis type: redis
redis: redis:

Loading…
Cancel
Save