From 1ae0f06ddc9f0ac1aed22079d9248fc7bba4c64e Mon Sep 17 00:00:00 2001 From: Parker Date: Mon, 8 Feb 2021 19:40:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=94=AF=E4=B8=80=E9=AA=8C=E8=AF=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/web/system/options/OptionsApi.java | 2 +- .../wrapper/system/options/OptionsModel.java | 2 +- .../column/mapper/TableColumnMapper.java | 8 +- .../column/mapper/xml/TableColumnMapper.xml | 14 ---- .../service/impl/TableColumnServiceImpl.java | 40 ++++++++-- .../creater/table/mapper/TableMapper.java | 6 -- .../creater/table/mapper/xml/TableMapper.xml | 13 --- .../table/service/impl/TableServiceImpl.java | 35 +++++++- .../area/service/impl/SysAreaServiceImpl.java | 8 +- .../system/dict/mapper/DictDetailMapper.java | 6 -- .../system/dict/mapper/DictMapper.java | 6 -- .../dict/mapper/xml/DictDetailMapper.xml | 40 ---------- .../system/dict/mapper/xml/DictMapper.xml | 30 ------- .../service/impl/DictDetailServiceImpl.java | 36 ++++++++- .../dict/service/impl/DictServiceImpl.java | 36 ++++++++- .../menu/service/impl/MenuServiceImpl.java | 5 +- .../system/options/entity/SysOptions.java | 2 +- .../options/mapper/SysOptionsMapper.java | 2 +- .../options/mapper/xml/SysOptionsMapper.xml | 2 +- .../options/service/ISysOptionsService.java | 2 +- .../service/impl/SysOptionsServiceImpl.java | 2 +- .../options/web/SysOptionsRestController.java | 2 +- .../org/service/impl/SysOrgServiceImpl.java | 5 +- .../role/service/impl/RoleServiceImpl.java | 3 +- .../service/impl/TenantServiceImpl.java | 5 +- .../system/user/mapper/UserMapper.java | 14 ---- .../system/user/mapper/xml/UserMapper.xml | 27 ------- .../user/service/impl/UserServiceImpl.java | 80 +++++++++++++++++-- 28 files changed, 220 insertions(+), 213 deletions(-) diff --git a/opsli-api/src/main/java/org/opsli/api/web/system/options/OptionsApi.java b/opsli-api/src/main/java/org/opsli/api/web/system/options/OptionsApi.java index 49e6eea..d03421e 100644 --- a/opsli-api/src/main/java/org/opsli/api/web/system/options/OptionsApi.java +++ b/opsli-api/src/main/java/org/opsli/api/web/system/options/OptionsApi.java @@ -34,7 +34,7 @@ import org.opsli.api.wrapper.system.options.OptionsModel; /** * @BelongsProject: opsli-boot - * @BelongsPackage: org.opsli.api.web.sys.options + * @BelongsPackage: org.opsli.api.web.system.options * @Author: Parker * @CreateTime: 2021-02-07 18:24:38 diff --git a/opsli-api/src/main/java/org/opsli/api/wrapper/system/options/OptionsModel.java b/opsli-api/src/main/java/org/opsli/api/wrapper/system/options/OptionsModel.java index 422adf3..8d56c97 100644 --- a/opsli-api/src/main/java/org/opsli/api/wrapper/system/options/OptionsModel.java +++ b/opsli-api/src/main/java/org/opsli/api/wrapper/system/options/OptionsModel.java @@ -33,7 +33,7 @@ import org.springframework.format.annotation.DateTimeFormat; /** * @BelongsProject: opsli-boot - * @BelongsPackage: org.opsli.api.wrapper.sys.options + * @BelongsPackage: org.opsli.api.wrapper.system.options * @Author: Parker * @CreateTime: 2021-02-07 18:24:38 diff --git a/opsli-modulars/opsli-modulars-creater/src/main/java/org/opsli/modulars/creater/column/mapper/TableColumnMapper.java b/opsli-modulars/opsli-modulars-creater/src/main/java/org/opsli/modulars/creater/column/mapper/TableColumnMapper.java index 1afd40b..a0403c6 100644 --- a/opsli-modulars/opsli-modulars-creater/src/main/java/org/opsli/modulars/creater/column/mapper/TableColumnMapper.java +++ b/opsli-modulars/opsli-modulars-creater/src/main/java/org/opsli/modulars/creater/column/mapper/TableColumnMapper.java @@ -18,7 +18,6 @@ package org.opsli.modulars.creater.column.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; import org.opsli.modulars.creater.column.entity.CreaterTableColumn; -import org.opsli.modulars.creater.table.entity.CreaterTable; /** @@ -30,11 +29,6 @@ import org.opsli.modulars.creater.table.entity.CreaterTable; @Mapper public interface TableColumnMapper extends BaseMapper { - /** - * 唯一验证 - * @param entity - * @return - */ - Integer uniqueVerificationByFieldName(CreaterTableColumn entity); + } diff --git a/opsli-modulars/opsli-modulars-creater/src/main/java/org/opsli/modulars/creater/column/mapper/xml/TableColumnMapper.xml b/opsli-modulars/opsli-modulars-creater/src/main/java/org/opsli/modulars/creater/column/mapper/xml/TableColumnMapper.xml index fd5eca4..0b75fb6 100644 --- a/opsli-modulars/opsli-modulars-creater/src/main/java/org/opsli/modulars/creater/column/mapper/xml/TableColumnMapper.xml +++ b/opsli-modulars/opsli-modulars-creater/src/main/java/org/opsli/modulars/creater/column/mapper/xml/TableColumnMapper.xml @@ -3,18 +3,4 @@ - - diff --git a/opsli-modulars/opsli-modulars-creater/src/main/java/org/opsli/modulars/creater/column/service/impl/TableColumnServiceImpl.java b/opsli-modulars/opsli-modulars-creater/src/main/java/org/opsli/modulars/creater/column/service/impl/TableColumnServiceImpl.java index 3080cf9..4e94272 100644 --- a/opsli-modulars/opsli-modulars-creater/src/main/java/org/opsli/modulars/creater/column/service/impl/TableColumnServiceImpl.java +++ b/opsli-modulars/opsli-modulars-creater/src/main/java/org/opsli/modulars/creater/column/service/impl/TableColumnServiceImpl.java @@ -17,13 +17,13 @@ package org.opsli.modulars.creater.column.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import org.apache.commons.lang3.StringUtils; -import org.opsli.core.utils.ValidationUtil; -import org.opsli.common.exception.ServiceException; +import org.opsli.common.constants.MyBatisConstants; import org.opsli.core.base.service.impl.CrudServiceImpl; import org.opsli.core.creater.exception.CreaterException; import org.opsli.core.creater.msg.CreaterMsg; import org.opsli.core.persistence.querybuilder.GenQueryBuilder; import org.opsli.core.persistence.querybuilder.QueryBuilder; +import org.opsli.core.utils.ValidationUtil; import org.opsli.modulars.creater.column.entity.CreaterTableColumn; import org.opsli.modulars.creater.column.mapper.TableColumnMapper; import org.opsli.modulars.creater.column.service.ITableColumnService; @@ -58,9 +58,8 @@ public class TableColumnServiceImpl extends CrudServiceImpl 0){ // 重复 throw new CreaterException(CreaterMsg.EXCEPTION_TABLE_COLUMN_FIELD_NAME_REPEAT); @@ -88,8 +87,7 @@ public class TableColumnServiceImpl extends CrudServiceImpl 0){ // 重复 throw new CreaterException(CreaterMsg.EXCEPTION_TABLE_COLUMN_FIELD_NAME_REPEAT); @@ -121,9 +119,8 @@ public class TableColumnServiceImpl extends CrudServiceImpl 0){ // 重复 throw new CreaterException(CreaterMsg.EXCEPTION_TABLE_COLUMN_FIELD_NAME_REPEAT); @@ -172,6 +169,33 @@ public class TableColumnServiceImpl extends CrudServiceImpl wrapper = new QueryWrapper<>(); + + // code 唯一 + wrapper.eq("table_id", model.getTableId()) + .eq("field_name", model.getFieldName()); + + // 重复校验排除自身 + if(StringUtils.isNotEmpty(model.getId())){ + wrapper.notIn(MyBatisConstants.FIELD_ID, model.getId()); + } + + return super.count(wrapper); + } } diff --git a/opsli-modulars/opsli-modulars-creater/src/main/java/org/opsli/modulars/creater/table/mapper/TableMapper.java b/opsli-modulars/opsli-modulars-creater/src/main/java/org/opsli/modulars/creater/table/mapper/TableMapper.java index 5956a56..260e7ea 100644 --- a/opsli-modulars/opsli-modulars-creater/src/main/java/org/opsli/modulars/creater/table/mapper/TableMapper.java +++ b/opsli-modulars/opsli-modulars-creater/src/main/java/org/opsli/modulars/creater/table/mapper/TableMapper.java @@ -31,12 +31,6 @@ import java.util.List; @Mapper public interface TableMapper extends BaseMapper { - /** - * 唯一验证 - * @param entity - * @return - */ - Integer uniqueVerificationByTableName(CreaterTable entity); /** * 更新同步状态 为 已同步 diff --git a/opsli-modulars/opsli-modulars-creater/src/main/java/org/opsli/modulars/creater/table/mapper/xml/TableMapper.xml b/opsli-modulars/opsli-modulars-creater/src/main/java/org/opsli/modulars/creater/table/mapper/xml/TableMapper.xml index b3bb5ae..e141d5b 100644 --- a/opsli-modulars/opsli-modulars-creater/src/main/java/org/opsli/modulars/creater/table/mapper/xml/TableMapper.xml +++ b/opsli-modulars/opsli-modulars-creater/src/main/java/org/opsli/modulars/creater/table/mapper/xml/TableMapper.xml @@ -3,19 +3,6 @@ - - - select count(0) - from sys_dict_detail a - where - ( - a.dict_name = #{dictName} - or - a.dict_value = #{dictValue} - ) - and a.type_code = #{typeCode} - and a.deleted = 0 - - and a.id != #{id} - - - \ No newline at end of file diff --git a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/dict/mapper/xml/DictMapper.xml b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/dict/mapper/xml/DictMapper.xml index 11bdbdb..8a5f95e 100644 --- a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/dict/mapper/xml/DictMapper.xml +++ b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/dict/mapper/xml/DictMapper.xml @@ -2,35 +2,5 @@ - - - a.id as id, - - a.type_code as dictTypeCode, - a.type_name as dictTypeName, - a.iz_lock as izLock, - a.remark as remark, - - a.create_by as createBy, - a.create_time as createTime, - a.update_by as updateBy, - a.update_time as updateTime, - a.version as version, - a.deleted as deleted - - - - - - \ No newline at end of file diff --git a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/dict/service/impl/DictDetailServiceImpl.java b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/dict/service/impl/DictDetailServiceImpl.java index 9007126..8d50d99 100644 --- a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/dict/service/impl/DictDetailServiceImpl.java +++ b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/dict/service/impl/DictDetailServiceImpl.java @@ -24,6 +24,7 @@ import org.opsli.api.wrapper.system.dict.DictDetailModel; import org.opsli.api.wrapper.system.dict.DictModel; import org.opsli.api.wrapper.system.dict.DictWrapper; import org.opsli.common.constants.MyBatisConstants; +import org.opsli.common.enums.DictType; import org.opsli.common.exception.ServiceException; import org.opsli.common.utils.HumpUtil; import org.opsli.core.base.service.impl.CrudServiceImpl; @@ -72,9 +73,8 @@ public class DictDetailServiceImpl extends CrudServiceImpl 0){ // 重复 throw new ServiceException(SystemMsg.EXCEPTION_DICT_DETAIL_UNIQUE); @@ -116,9 +116,8 @@ public class DictDetailServiceImpl extends CrudServiceImpl 0){ // 重复 throw new ServiceException(SystemMsg.EXCEPTION_DICT_DETAIL_UNIQUE); @@ -397,6 +396,35 @@ public class DictDetailServiceImpl extends CrudServiceImpl wrapper = new QueryWrapper<>(); + + // name 唯一 + wrapper.eq(MyBatisConstants.FIELD_DELETE_LOGIC, DictType.NO_YES_NO.getCode()) + .eq("type_code", model.getTypeCode()); + + // 名称 或者 Val 重复 + wrapper.and(wra -> + wra.eq("dict_name", + model.getDictName()).or().eq("dict_value", model.getDictValue())); + + // 重复校验排除自身 + if(StringUtils.isNotEmpty(model.getId())){ + wrapper.notIn(MyBatisConstants.FIELD_ID, model.getId()); + } + + return super.count(wrapper); + } + // ================ /** diff --git a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/dict/service/impl/DictServiceImpl.java b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/dict/service/impl/DictServiceImpl.java index 986bea9..906d0c3 100644 --- a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/dict/service/impl/DictServiceImpl.java +++ b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/dict/service/impl/DictServiceImpl.java @@ -15,9 +15,12 @@ */ package org.opsli.modulars.system.dict.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import org.apache.commons.lang3.StringUtils; import org.opsli.api.wrapper.system.dict.DictDetailModel; import org.opsli.api.wrapper.system.dict.DictModel; +import org.opsli.common.constants.MyBatisConstants; +import org.opsli.common.enums.DictType; import org.opsli.common.exception.ServiceException; import org.opsli.core.base.service.impl.CrudServiceImpl; import org.opsli.modulars.system.SystemMsg; @@ -54,9 +57,8 @@ public class DictServiceImpl extends CrudServiceImpl 0){ // 重复 throw new ServiceException(SystemMsg.EXCEPTION_DICT_UNIQUE); @@ -72,9 +74,8 @@ public class DictServiceImpl extends CrudServiceImpl 0){ // 重复 throw new ServiceException(SystemMsg.EXCEPTION_DICT_UNIQUE); @@ -156,6 +157,33 @@ public class DictServiceImpl extends CrudServiceImpl wrapper = new QueryWrapper<>(); + + // code 唯一 + wrapper.eq(MyBatisConstants.FIELD_DELETE_LOGIC, DictType.NO_YES_NO.getCode()) + .eq("type_code", model.getTypeCode()); + + // 重复校验排除自身 + if(StringUtils.isNotEmpty(model.getId())){ + wrapper.notIn(MyBatisConstants.FIELD_ID, model.getId()); + } + + return super.count(wrapper); + } + } diff --git a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/menu/service/impl/MenuServiceImpl.java b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/menu/service/impl/MenuServiceImpl.java index 65a3cec..9019ef0 100644 --- a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/menu/service/impl/MenuServiceImpl.java +++ b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/menu/service/impl/MenuServiceImpl.java @@ -19,9 +19,9 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.convert.Convert; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import org.apache.commons.lang3.StringUtils; -import org.opsli.api.wrapper.system.area.SysAreaModel; import org.opsli.api.wrapper.system.menu.MenuModel; import org.opsli.common.constants.MyBatisConstants; +import org.opsli.common.enums.DictType; import org.opsli.common.exception.ServiceException; import org.opsli.common.utils.HumpUtil; import org.opsli.core.base.service.impl.CrudServiceImpl; @@ -31,7 +31,6 @@ import org.opsli.core.persistence.querybuilder.QueryBuilder; import org.opsli.core.utils.MenuUtil; import org.opsli.core.utils.UserUtil; import org.opsli.modulars.system.SystemMsg; -import org.opsli.modulars.system.area.entity.SysArea; import org.opsli.modulars.system.menu.entity.SysMenu; import org.opsli.modulars.system.menu.mapper.MenuMapper; import org.opsli.modulars.system.menu.service.IMenuService; @@ -167,7 +166,7 @@ public class MenuServiceImpl extends CrudServiceImpl wrapper = new QueryWrapper<>(); // code 唯一 - wrapper.eq(MyBatisConstants.FIELD_DELETE_LOGIC, "0") + wrapper.eq(MyBatisConstants.FIELD_DELETE_LOGIC, DictType.NO_YES_NO.getCode()) .eq("menu_code", model.getMenuCode()); // 重复校验排除自身 diff --git a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/options/entity/SysOptions.java b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/options/entity/SysOptions.java index c6198f2..f568782 100644 --- a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/options/entity/SysOptions.java +++ b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/options/entity/SysOptions.java @@ -27,7 +27,7 @@ import org.opsli.core.base.entity.BaseEntity; /** * @BelongsProject: opsli-boot - * @BelongsPackage: org.opsli.modulars.sys.options.entity + * @BelongsPackage: org.opsli.modulars.system.options.entity * @Author: Parker * @CreateTime: 2021-02-07 18:24:38 * @Description: 系统参数 diff --git a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/options/mapper/SysOptionsMapper.java b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/options/mapper/SysOptionsMapper.java index f81a324..e99103f 100644 --- a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/options/mapper/SysOptionsMapper.java +++ b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/options/mapper/SysOptionsMapper.java @@ -27,7 +27,7 @@ import org.opsli.modulars.system.options.entity.SysOptions; /** * @BelongsProject: opsli-boot -* @BelongsPackage: org.opsli.modulars.sys.options.mapper +* @BelongsPackage: org.opsli.modulars.system.options.mapper * @Author: Parker * @CreateTime: 2021-02-07 18:24:38 diff --git a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/options/mapper/xml/SysOptionsMapper.xml b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/options/mapper/xml/SysOptionsMapper.xml index db38d25..907c8f5 100644 --- a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/options/mapper/xml/SysOptionsMapper.xml +++ b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/options/mapper/xml/SysOptionsMapper.xml @@ -1,6 +1,6 @@ - + diff --git a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/options/service/ISysOptionsService.java b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/options/service/ISysOptionsService.java index b2ff5f5..f53a9a5 100644 --- a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/options/service/ISysOptionsService.java +++ b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/options/service/ISysOptionsService.java @@ -28,7 +28,7 @@ import org.opsli.api.wrapper.system.options.OptionsModel; /** * @BelongsProject: opsli-boot -* @BelongsPackage: org.opsli.modulars.sys.options.service +* @BelongsPackage: org.opsli.modulars.system.options.service * @Author: Parker * @CreateTime: 2021-02-07 18:24:38 diff --git a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/options/service/impl/SysOptionsServiceImpl.java b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/options/service/impl/SysOptionsServiceImpl.java index 6247159..0a33887 100644 --- a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/options/service/impl/SysOptionsServiceImpl.java +++ b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/options/service/impl/SysOptionsServiceImpl.java @@ -42,7 +42,7 @@ import java.util.List; /** * @BelongsProject: opsli-boot -* @BelongsPackage: org.opsli.modulars.sys.options.service.impl +* @BelongsPackage: org.opsli.modulars.system.options.service.impl * @Author: Parker * @CreateTime: 2021-02-07 18:24:38 diff --git a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/options/web/SysOptionsRestController.java b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/options/web/SysOptionsRestController.java index b44f7b4..a2dada6 100644 --- a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/options/web/SysOptionsRestController.java +++ b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/options/web/SysOptionsRestController.java @@ -46,7 +46,7 @@ import java.lang.reflect.Method; /** * @BelongsProject: opsli-boot -* @BelongsPackage: org.opsli.modulars.sys.options.web +* @BelongsPackage: org.opsli.modulars.system.options.web * @CreateTime: 2021-02-07 18:24:38 * @Description: 系统参数 Controller * diff --git a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/org/service/impl/SysOrgServiceImpl.java b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/org/service/impl/SysOrgServiceImpl.java index 3d0336c..d5e24f0 100644 --- a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/org/service/impl/SysOrgServiceImpl.java +++ b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/org/service/impl/SysOrgServiceImpl.java @@ -23,6 +23,7 @@ import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; import org.opsli.api.wrapper.system.org.SysOrgModel; import org.opsli.common.constants.MyBatisConstants; +import org.opsli.common.enums.DictType; import org.opsli.common.exception.ServiceException; import org.opsli.common.utils.HumpUtil; import org.opsli.core.base.entity.HasChildren; @@ -230,7 +231,7 @@ public class SysOrgServiceImpl extends CrudServiceImpl wrapper = new QueryWrapper<>(); - wrapper.eq(MyBatisConstants.FIELD_DELETE_LOGIC, "0") + wrapper.eq(MyBatisConstants.FIELD_DELETE_LOGIC, DictType.NO_YES_NO.getCode()) .eq("org_code", model.getOrgCode()); // 重复校验排除自身 @@ -259,7 +260,7 @@ public class SysOrgServiceImpl extends CrudServiceImpl wrapper = new QueryWrapper<>(); wrapper.in(HumpUtil.humpToUnderline(MyBatisConstants.FIELD_PARENT_ID), parentIds) - .eq(MyBatisConstants.FIELD_DELETE_LOGIC, "0") + .eq(MyBatisConstants.FIELD_DELETE_LOGIC, DictType.NO_YES_NO.getCode()) .groupBy(HumpUtil.humpToUnderline(MyBatisConstants.FIELD_PARENT_ID)); return mapper.hasChildren(wrapper); diff --git a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/role/service/impl/RoleServiceImpl.java b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/role/service/impl/RoleServiceImpl.java index 6d9802d..d2a30a2 100644 --- a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/role/service/impl/RoleServiceImpl.java +++ b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/role/service/impl/RoleServiceImpl.java @@ -19,6 +19,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import org.apache.commons.lang3.StringUtils; import org.opsli.api.wrapper.system.role.RoleModel; import org.opsli.common.constants.MyBatisConstants; +import org.opsli.common.enums.DictType; import org.opsli.common.exception.ServiceException; import org.opsli.core.base.service.impl.CrudServiceImpl; import org.opsli.core.persistence.querybuilder.chain.TenantHandler; @@ -91,7 +92,7 @@ public class RoleServiceImpl extends CrudServiceImpl wrapper = new QueryWrapper<>(); // code 唯一 - wrapper.eq(MyBatisConstants.FIELD_DELETE_LOGIC, "0") + wrapper.eq(MyBatisConstants.FIELD_DELETE_LOGIC, DictType.NO_YES_NO.getCode()) .eq("role_code", model.getRoleCode()); // 重复校验排除自身 diff --git a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/tenant/service/impl/TenantServiceImpl.java b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/tenant/service/impl/TenantServiceImpl.java index a80fe15..201e49d 100644 --- a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/tenant/service/impl/TenantServiceImpl.java +++ b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/tenant/service/impl/TenantServiceImpl.java @@ -20,15 +20,14 @@ import cn.hutool.core.convert.Convert; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.google.common.collect.Lists; import org.apache.commons.lang3.StringUtils; -import org.opsli.api.wrapper.system.menu.MenuModel; import org.opsli.api.wrapper.system.tenant.TenantModel; import org.opsli.common.constants.MyBatisConstants; +import org.opsli.common.enums.DictType; import org.opsli.common.exception.ServiceException; import org.opsli.core.base.service.impl.CrudServiceImpl; import org.opsli.core.msg.CoreMsg; import org.opsli.core.utils.TenantUtil; import org.opsli.modulars.system.SystemMsg; -import org.opsli.modulars.system.menu.entity.SysMenu; import org.opsli.modulars.system.tenant.entity.SysTenant; import org.opsli.modulars.system.tenant.mapper.TenantMapper; import org.opsli.modulars.system.tenant.service.ITenantService; @@ -194,7 +193,7 @@ public class TenantServiceImpl extends CrudServiceImpl wrapper = new QueryWrapper<>(); // name 唯一 - wrapper.eq(MyBatisConstants.FIELD_DELETE_LOGIC, "0") + wrapper.eq(MyBatisConstants.FIELD_DELETE_LOGIC, DictType.NO_YES_NO.getCode()) .eq("tenant_name", model.getTenantName()); // 重复校验排除自身 diff --git a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/user/mapper/UserMapper.java b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/user/mapper/UserMapper.java index abdfd15..57bbc3e 100644 --- a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/user/mapper/UserMapper.java +++ b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/user/mapper/UserMapper.java @@ -37,20 +37,6 @@ import java.util.List; @Mapper public interface UserMapper extends BaseMapper { - /** - * 唯一验证 - 用户名 - * @param entity - * @return - */ - Integer uniqueVerificationByUsername(SysUser entity); - - /** - * 唯一验证 - 工号 - * @param entity - * @return - */ - Integer uniqueVerificationByNo(SysUser entity); - /** * 根据用户ID 获得当前角色编码集合 diff --git a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/user/mapper/xml/UserMapper.xml b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/user/mapper/xml/UserMapper.xml index 3898d70..5143e14 100644 --- a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/user/mapper/xml/UserMapper.xml +++ b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/user/mapper/xml/UserMapper.xml @@ -51,33 +51,6 @@ - - - - -