From 2af534eea471f4adb104906c7a814bcc66d4d68d Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期一, 13 九月 2021 13:03:58 +0800 Subject: [PATCH] Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue into dev --- ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java index cfd8e1f..e334158 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java @@ -1,7 +1,6 @@ package com.ruoyi.system.service.impl; import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.lang.Validator; import com.ruoyi.common.utils.StringUtils; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; @@ -10,7 +9,7 @@ import com.ruoyi.common.core.domain.entity.SysDictType; import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.exception.CustomException; +import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.DictUtils; import com.ruoyi.common.utils.PageUtils; import com.ruoyi.system.mapper.SysDictDataMapper; @@ -51,10 +50,10 @@ .like(StringUtils.isNotBlank(dictType.getDictName()), SysDictType::getDictName, dictType.getDictName()) .eq(StringUtils.isNotBlank(dictType.getStatus()), SysDictType::getStatus, dictType.getStatus()) .like(StringUtils.isNotBlank(dictType.getDictType()), SysDictType::getDictType, dictType.getDictType()) - .apply(Validator.isNotEmpty(params.get("beginTime")), + .apply(StringUtils.isNotEmpty(params.get("beginTime")), "date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')", params.get("beginTime")) - .apply(Validator.isNotEmpty(params.get("endTime")), + .apply(StringUtils.isNotEmpty(params.get("endTime")), "date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')", params.get("endTime")); return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw)); @@ -73,10 +72,10 @@ .like(StringUtils.isNotBlank(dictType.getDictName()), SysDictType::getDictName, dictType.getDictName()) .eq(StringUtils.isNotBlank(dictType.getStatus()), SysDictType::getStatus, dictType.getStatus()) .like(StringUtils.isNotBlank(dictType.getDictType()), SysDictType::getDictType, dictType.getDictType()) - .apply(Validator.isNotEmpty(params.get("beginTime")), + .apply(StringUtils.isNotEmpty(params.get("beginTime")), "date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')", params.get("beginTime")) - .apply(Validator.isNotEmpty(params.get("endTime")), + .apply(StringUtils.isNotEmpty(params.get("endTime")), "date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')", params.get("endTime"))); } @@ -145,7 +144,7 @@ SysDictType dictType = selectDictTypeById(dictId); if (dictDataMapper.selectCount(new LambdaQueryWrapper<SysDictData>() .eq(SysDictData::getDictType, dictType.getDictType())) > 0) { - throw new CustomException(String.format("%1$s宸插垎閰�,涓嶈兘鍒犻櫎", dictType.getDictName())); + throw new ServiceException(String.format("%1$s宸插垎閰�,涓嶈兘鍒犻櫎", dictType.getDictName())); } DictUtils.removeDictCache(dictType.getDictType()); } @@ -225,11 +224,11 @@ */ @Override public String checkDictTypeUnique(SysDictType dict) { - Long dictId = Validator.isNull(dict.getDictId()) ? -1L : dict.getDictId(); + Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId(); SysDictType dictType = getOne(new LambdaQueryWrapper<SysDictType>() .eq(SysDictType::getDictType, dict.getDictType()) .last("limit 1")); - if (Validator.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) { + if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; -- Gitblit v1.9.3