From c813046594b82230cd2cb61622d68a4981096e08 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期一, 02 八月 2021 19:28:41 +0800 Subject: [PATCH] update 日常校验 统一重构到 StringUtils 便于维护扩展 --- ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java index 495c2e9..82d09e8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java @@ -1,6 +1,5 @@ package com.ruoyi.system.service.impl; -import cn.hutool.core.lang.Validator; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; @@ -93,10 +92,10 @@ */ @Override public String checkPostNameUnique(SysPost post) { - Long postId = Validator.isNull(post.getPostId()) ? -1L : post.getPostId(); + Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); SysPost info = getOne(new LambdaQueryWrapper<SysPost>() .eq(SysPost::getPostName, post.getPostName()).last("limit 1")); - if (Validator.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) { + if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; @@ -110,10 +109,10 @@ */ @Override public String checkPostCodeUnique(SysPost post) { - Long postId = Validator.isNull(post.getPostId()) ? -1L : post.getPostId(); + Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); SysPost info = getOne(new LambdaQueryWrapper<SysPost>() .eq(SysPost::getPostCode, post.getPostCode()).last("limit 1")); - if (Validator.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) { + if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; -- Gitblit v1.9.3