diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/BeanCopyUtils.java b/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/BeanCopyUtils.java
deleted file mode 100644
index 8032b93..0000000
--- a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/BeanCopyUtils.java
+++ /dev/null
@@ -1,184 +0,0 @@
-package org.nl.common.utils;
-
-import cn.hutool.core.collection.CollUtil;
-import cn.hutool.core.lang.SimpleCache;
-import cn.hutool.core.map.MapUtil;
-import cn.hutool.core.util.ObjectUtil;
-import cn.hutool.core.util.ReflectUtil;
-import cn.hutool.core.util.StrUtil;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import org.springframework.cglib.beans.BeanCopier;
-import org.springframework.cglib.beans.BeanMap;
-import org.springframework.cglib.core.Converter;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * bean深拷贝工具(基于 cglib 性能优异)
- *
- * 重点 cglib 不支持 拷贝到链式对象
- * 例如: 源对象 拷贝到 目标(链式对象)
- * 请区分好`浅拷贝`和`深拷贝`再做使用
- *
- * @author Lion Li
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public class BeanCopyUtils {
-
- /**
- * 单对象基于class创建拷贝
- *
- * @param source 数据来源实体
- * @param desc 描述对象 转换后的对象
- * @return desc
- */
- public static V copy(T source, Class desc) {
- if (ObjectUtil.isNull(source)) {
- return null;
- }
- if (ObjectUtil.isNull(desc)) {
- return null;
- }
- final V target = ReflectUtil.newInstanceIfPossible(desc);
- return copy(source, target);
- }
-
- /**
- * 单对象基于对象创建拷贝
- *
- * @param source 数据来源实体
- * @param desc 转换后的对象
- * @return desc
- */
- public static V copy(T source, V desc) {
- if (ObjectUtil.isNull(source)) {
- return null;
- }
- if (ObjectUtil.isNull(desc)) {
- return null;
- }
- BeanCopier beanCopier = BeanCopierCache.INSTANCE.get(source.getClass(), desc.getClass(), null);
- beanCopier.copy(source, desc, null);
- return desc;
- }
-
- /**
- * 列表对象基于class创建拷贝
- *
- * @param sourceList 数据来源实体列表
- * @param desc 描述对象 转换后的对象
- * @return desc
- */
- public static List copyList(List sourceList, Class desc) {
- if (ObjectUtil.isNull(sourceList)) {
- return null;
- }
- if (CollUtil.isEmpty(sourceList)) {
- return CollUtil.newArrayList();
- }
- return StreamUtils.toList(sourceList, source -> {
- V target = ReflectUtil.newInstanceIfPossible(desc);
- copy(source, target);
- return target;
- });
- }
-
- /**
- * bean拷贝到map
- *
- * @param bean 数据来源实体
- * @return map对象
- */
- @SuppressWarnings("unchecked")
- public static Map copyToMap(T bean) {
- if (ObjectUtil.isNull(bean)) {
- return null;
- }
- return BeanMap.create(bean);
- }
-
- /**
- * map拷贝到bean
- *
- * @param map 数据来源
- * @param beanClass bean类
- * @return bean对象
- */
- public static T mapToBean(Map map, Class beanClass) {
- if (MapUtil.isEmpty(map)) {
- return null;
- }
- if (ObjectUtil.isNull(beanClass)) {
- return null;
- }
- T bean = ReflectUtil.newInstanceIfPossible(beanClass);
- return mapToBean(map, bean);
- }
-
- /**
- * map拷贝到bean
- *
- * @param map 数据来源
- * @param bean bean对象
- * @return bean对象
- */
- public static T mapToBean(Map map, T bean) {
- if (MapUtil.isEmpty(map)) {
- return null;
- }
- if (ObjectUtil.isNull(bean)) {
- return null;
- }
- BeanMap.create(bean).putAll(map);
- return bean;
- }
-
- /**
- * BeanCopier属性缓存
- * 缓存用于防止多次反射造成的性能问题
- *
- * @author Looly
- * @since 5.4.1
- */
- public enum BeanCopierCache {
- /**
- * BeanCopier属性缓存单例
- */
- INSTANCE;
-
- private final SimpleCache cache = new SimpleCache<>();
-
- /**
- * 获得类与转换器生成的key在{@link BeanCopier}的Map中对应的元素
- *
- * @param srcClass 源Bean的类
- * @param targetClass 目标Bean的类
- * @param converter 转换器
- * @return Map中对应的BeanCopier
- */
- public BeanCopier get(Class> srcClass, Class> targetClass, Converter converter) {
- final String key = genKey(srcClass, targetClass, converter);
- return cache.get(key, () -> BeanCopier.create(srcClass, targetClass, converter != null));
- }
-
- /**
- * 获得类与转换器生成的key
- *
- * @param srcClass 源Bean的类
- * @param targetClass 目标Bean的类
- * @param converter 转换器
- * @return 属性名和Map映射的key
- */
- private String genKey(Class> srcClass, Class> targetClass, Converter converter) {
- final StringBuilder key = StrUtil.builder()
- .append(srcClass.getName()).append('#').append(targetClass.getName());
- if(null != converter){
- key.append('#').append(converter.getClass().getName());
- }
- return key.toString();
- }
- }
-
-}
diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/DateUtils.java b/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/DateUtils.java
deleted file mode 100644
index 2489656..0000000
--- a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/DateUtils.java
+++ /dev/null
@@ -1,164 +0,0 @@
-package org.nl.common.utils;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import org.apache.commons.lang3.time.DateFormatUtils;
-
-import java.lang.management.ManagementFactory;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.time.*;
-import java.util.Date;
-
-/**
- * 时间工具类
- *
- * @author ruoyi
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
-
- public static final String YYYY = "yyyy";
-
- public static final String YYYY_MM = "yyyy-MM";
-
- public static final String YYYY_MM_DD = "yyyy-MM-dd";
-
- public static final String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
-
- public static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
-
- private static final String[] PARSE_PATTERNS = {
- "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
- "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
- "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
-
- /**
- * 获取当前Date型日期
- *
- * @return Date() 当前日期
- */
- public static Date getNowDate() {
- return new Date();
- }
-
- /**
- * 获取当前日期, 默认格式为yyyy-MM-dd
- *
- * @return String
- */
- public static String getDate() {
- return dateTimeNow(YYYY_MM_DD);
- }
-
- public static String getTime() {
- return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
- }
-
- public static String dateTimeNow() {
- return dateTimeNow(YYYYMMDDHHMMSS);
- }
-
- public static String dateTimeNow(final String format) {
- return parseDateToStr(format, new Date());
- }
-
- public static String dateTime(final Date date) {
- return parseDateToStr(YYYY_MM_DD, date);
- }
-
- public static String parseDateToStr(final String format, final Date date) {
- return new SimpleDateFormat(format).format(date);
- }
-
- public static Date dateTime(final String format, final String ts) {
- try {
- return new SimpleDateFormat(format).parse(ts);
- } catch (ParseException e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * 日期路径 即年/月/日 如2018/08/08
- */
- public static String datePath() {
- Date now = new Date();
- return DateFormatUtils.format(now, "yyyy/MM/dd");
- }
-
- /**
- * 日期路径 即年/月/日 如20180808
- */
- public static String dateTime() {
- Date now = new Date();
- return DateFormatUtils.format(now, "yyyyMMdd");
- }
-
- /**
- * 日期型字符串转化为日期 格式
- */
- public static Date parseDate(Object str) {
- if (str == null) {
- return null;
- }
- try {
- return parseDate(str.toString(), PARSE_PATTERNS);
- } catch (ParseException e) {
- return null;
- }
- }
-
- /**
- * 获取服务器启动时间
- */
- public static Date getServerStartDate() {
- long time = ManagementFactory.getRuntimeMXBean().getStartTime();
- return new Date(time);
- }
-
- /**
- * 计算相差天数
- */
- public static int differentDaysByMillisecond(Date date1, Date date2) {
- return Math.abs((int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24)));
- }
-
- /**
- * 计算两个时间差
- */
- public static String getDatePoor(Date endDate, Date nowDate) {
- long nd = 1000 * 24 * 60 * 60;
- long nh = 1000 * 60 * 60;
- long nm = 1000 * 60;
- // long ns = 1000;
- // 获得两个时间的毫秒时间差异
- long diff = endDate.getTime() - nowDate.getTime();
- // 计算差多少天
- long day = diff / nd;
- // 计算差多少小时
- long hour = diff % nd / nh;
- // 计算差多少分钟
- long min = diff % nd % nh / nm;
- // 计算差多少秒//输出结果
- // long sec = diff % nd % nh % nm / ns;
- return day + "天" + hour + "小时" + min + "分钟";
- }
-
- /**
- * 增加 LocalDateTime ==> Date
- */
- public static Date toDate(LocalDateTime temporalAccessor) {
- ZonedDateTime zdt = temporalAccessor.atZone(ZoneId.systemDefault());
- return Date.from(zdt.toInstant());
- }
-
- /**
- * 增加 LocalDate ==> Date
- */
- public static Date toDate(LocalDate temporalAccessor) {
- LocalDateTime localDateTime = LocalDateTime.of(temporalAccessor, LocalTime.of(0, 0, 0));
- ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault());
- return Date.from(zdt.toInstant());
- }
-}
diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/MessageUtils.java b/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/MessageUtils.java
deleted file mode 100644
index 483025c..0000000
--- a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/MessageUtils.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.nl.common.utils;
-
-import com.ruoyi.common.utils.spring.SpringUtils;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import org.springframework.context.MessageSource;
-import org.springframework.context.i18n.LocaleContextHolder;
-
-/**
- * 获取i18n资源文件
- *
- * @author Lion Li
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public class MessageUtils {
-
- private static final MessageSource MESSAGE_SOURCE = SpringUtils.getBean(MessageSource.class);
-
- /**
- * 根据消息键和参数 获取消息 委托给spring messageSource
- *
- * @param code 消息键
- * @param args 参数
- * @return 获取国际化翻译值
- */
- public static String message(String code, Object... args) {
- return MESSAGE_SOURCE.getMessage(code, args, LocaleContextHolder.getLocale());
- }
-}
diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/ServletUtils.java b/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/ServletUtils.java
deleted file mode 100644
index 261dfe3..0000000
--- a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/ServletUtils.java
+++ /dev/null
@@ -1,203 +0,0 @@
-package org.nl.common.utils;
-
-import cn.hutool.core.convert.Convert;
-import cn.hutool.extra.servlet.ServletUtil;
-import cn.hutool.http.HttpStatus;
-import com.ruoyi.common.constant.Constants;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import org.springframework.http.MediaType;
-import org.springframework.web.context.request.RequestAttributes;
-import org.springframework.web.context.request.RequestContextHolder;
-import org.springframework.web.context.request.ServletRequestAttributes;
-
-import javax.servlet.ServletRequest;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.net.URLEncoder;
-import java.nio.charset.StandardCharsets;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 客户端工具类
- *
- * @author ruoyi
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public class ServletUtils extends ServletUtil {
-
- /**
- * 获取String参数
- */
- public static String getParameter(String name) {
- return getRequest().getParameter(name);
- }
-
- /**
- * 获取String参数
- */
- public static String getParameter(String name, String defaultValue) {
- return Convert.toStr(getRequest().getParameter(name), defaultValue);
- }
-
- /**
- * 获取Integer参数
- */
- public static Integer getParameterToInt(String name) {
- return Convert.toInt(getRequest().getParameter(name));
- }
-
- /**
- * 获取Integer参数
- */
- public static Integer getParameterToInt(String name, Integer defaultValue) {
- return Convert.toInt(getRequest().getParameter(name), defaultValue);
- }
-
- /**
- * 获取Boolean参数
- */
- public static Boolean getParameterToBool(String name) {
- return Convert.toBool(getRequest().getParameter(name));
- }
-
- /**
- * 获取Boolean参数
- */
- public static Boolean getParameterToBool(String name, Boolean defaultValue) {
- return Convert.toBool(getRequest().getParameter(name), defaultValue);
- }
-
- /**
- * 获得所有请求参数
- *
- * @param request 请求对象{@link ServletRequest}
- * @return Map
- */
- public static Map getParams(ServletRequest request) {
- final Map map = request.getParameterMap();
- return Collections.unmodifiableMap(map);
- }
-
- /**
- * 获得所有请求参数
- *
- * @param request 请求对象{@link ServletRequest}
- * @return Map
- */
- public static Map getParamMap(ServletRequest request) {
- Map params = new HashMap<>();
- for (Map.Entry entry : getParams(request).entrySet()) {
- params.put(entry.getKey(), StringUtils.join(entry.getValue(), ","));
- }
- return params;
- }
-
- /**
- * 获取request
- */
- public static HttpServletRequest getRequest() {
- return getRequestAttributes().getRequest();
- }
-
- /**
- * 获取response
- */
- public static HttpServletResponse getResponse() {
- return getRequestAttributes().getResponse();
- }
-
- /**
- * 获取session
- */
- public static HttpSession getSession() {
- return getRequest().getSession();
- }
-
- public static ServletRequestAttributes getRequestAttributes() {
- RequestAttributes attributes = RequestContextHolder.getRequestAttributes();
- return (ServletRequestAttributes) attributes;
- }
-
- /**
- * 将字符串渲染到客户端
- *
- * @param response 渲染对象
- * @param string 待渲染的字符串
- */
- public static void renderString(HttpServletResponse response, String string) {
- try {
- response.setStatus(HttpStatus.HTTP_OK);
- response.setContentType(MediaType.APPLICATION_JSON_VALUE);
- response.setCharacterEncoding(StandardCharsets.UTF_8.toString());
- response.getWriter().print(string);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * 是否是Ajax异步请求
- *
- * @param request
- */
- public static boolean isAjaxRequest(HttpServletRequest request) {
-
- String accept = request.getHeader("accept");
- if (accept != null && accept.contains(MediaType.APPLICATION_JSON_VALUE)) {
- return true;
- }
-
- String xRequestedWith = request.getHeader("X-Requested-With");
- if (xRequestedWith != null && xRequestedWith.contains("XMLHttpRequest")) {
- return true;
- }
-
- String uri = request.getRequestURI();
- if (StringUtils.equalsAnyIgnoreCase(uri, ".json", ".xml")) {
- return true;
- }
-
- String ajax = request.getParameter("__ajax");
- return StringUtils.equalsAnyIgnoreCase(ajax, "json", "xml");
- }
-
- public static String getClientIP() {
- return getClientIP(getRequest());
- }
-
- /**
- * 内容编码
- *
- * @param str 内容
- * @return 编码后的内容
- */
- public static String urlEncode(String str) {
- try {
- return URLEncoder.encode(str, Constants.UTF8);
- } catch (UnsupportedEncodingException e) {
- return StringUtils.EMPTY;
- }
- }
-
- /**
- * 内容解码
- *
- * @param str 内容
- * @return 解码后的内容
- */
- public static String urlDecode(String str) {
- try {
- return URLDecoder.decode(str, Constants.UTF8);
- } catch (UnsupportedEncodingException e) {
- return StringUtils.EMPTY;
- }
- }
-
-}
diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/StreamUtils.java b/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/StreamUtils.java
deleted file mode 100644
index 2fe5b62..0000000
--- a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/StreamUtils.java
+++ /dev/null
@@ -1,251 +0,0 @@
-package org.nl.common.utils;
-
-import cn.hutool.core.collection.CollUtil;
-import cn.hutool.core.map.MapUtil;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-
-import java.util.*;
-import java.util.function.BiFunction;
-import java.util.function.Function;
-import java.util.function.Predicate;
-import java.util.stream.Collectors;
-
-/**
- * stream 流工具类
- *
- * @author Lion Li
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public class StreamUtils {
-
- /**
- * 将collection过滤
- *
- * @param collection 需要转化的集合
- * @param function 过滤方法
- * @return 过滤后的list
- */
- public static List filter(Collection collection, Predicate function) {
- if (CollUtil.isEmpty(collection)) {
- return CollUtil.newArrayList();
- }
- return collection.stream().filter(function).collect(Collectors.toList());
- }
-
- /**
- * 将collection拼接
- *
- * @param collection 需要转化的集合
- * @param function 拼接方法
- * @return 拼接后的list
- */
- public static String join(Collection collection, Function function) {
- return join(collection, function, ",");
- }
-
- /**
- * 将collection拼接
- *
- * @param collection 需要转化的集合
- * @param function 拼接方法
- * @param delimiter 拼接符
- * @return 拼接后的list
- */
- public static String join(Collection collection, Function function, CharSequence delimiter) {
- if (CollUtil.isEmpty(collection)) {
- return StringUtils.EMPTY;
- }
- return collection.stream().map(function).filter(Objects::nonNull).collect(Collectors.joining(delimiter));
- }
-
- /**
- * 将collection排序
- *
- * @param collection 需要转化的集合
- * @param comparing 排序方法
- * @return 排序后的list
- */
- public static List sorted(Collection collection, Comparator comparing) {
- if (CollUtil.isEmpty(collection)) {
- return CollUtil.newArrayList();
- }
- return collection.stream().sorted(comparing).collect(Collectors.toList());
- }
-
- /**
- * 将collection转化为类型不变的map
- * {@code Collection ----> Map}
- *
- * @param collection 需要转化的集合
- * @param key V类型转化为K类型的lambda方法
- * @param collection中的泛型
- * @param map中的key类型
- * @return 转化后的map
- */
- public static Map toIdentityMap(Collection collection, Function key) {
- if (CollUtil.isEmpty(collection)) {
- return MapUtil.newHashMap();
- }
- return collection.stream().collect(Collectors.toMap(key, Function.identity(), (l, r) -> l));
- }
-
- /**
- * 将Collection转化为map(value类型与collection的泛型不同)
- * {@code Collection -----> Map }
- *
- * @param collection 需要转化的集合
- * @param key E类型转化为K类型的lambda方法
- * @param value E类型转化为V类型的lambda方法
- * @param collection中的泛型
- * @param map中的key类型
- * @param map中的value类型
- * @return 转化后的map
- */
- public static Map toMap(Collection collection, Function key, Function value) {
- if (CollUtil.isEmpty(collection)) {
- return MapUtil.newHashMap();
- }
- return collection.stream().collect(Collectors.toMap(key, value, (l, r) -> l));
- }
-
- /**
- * 将collection按照规则(比如有相同的班级id)分类成map
- * {@code Collection -------> Map> }
- *
- * @param collection 需要分类的集合
- * @param key 分类的规则
- * @param collection中的泛型
- * @param map中的key类型
- * @return 分类后的map
- */
- public static Map> groupByKey(Collection collection, Function key) {
- if (CollUtil.isEmpty(collection)) {
- return MapUtil.newHashMap();
- }
- return collection
- .stream()
- .collect(Collectors.groupingBy(key, LinkedHashMap::new, Collectors.toList()));
- }
-
- /**
- * 将collection按照两个规则(比如有相同的年级id,班级id)分类成双层map
- * {@code Collection ---> Map>> }
- *
- * @param collection 需要分类的集合
- * @param key1 第一个分类的规则
- * @param key2 第二个分类的规则
- * @param 集合元素类型
- * @param 第一个map中的key类型
- * @param 第二个map中的key类型
- * @return 分类后的map
- */
- public static Map>> groupBy2Key(Collection collection, Function key1, Function key2) {
- if (CollUtil.isEmpty(collection)) {
- return MapUtil.newHashMap();
- }
- return collection
- .stream()
- .collect(Collectors.groupingBy(key1, LinkedHashMap::new, Collectors.groupingBy(key2, LinkedHashMap::new, Collectors.toList())));
- }
-
- /**
- * 将collection按照两个规则(比如有相同的年级id,班级id)分类成双层map
- * {@code Collection ---> Map> }
- *
- * @param collection 需要分类的集合
- * @param key1 第一个分类的规则
- * @param key2 第二个分类的规则
- * @param 第一个map中的key类型
- * @param 第二个map中的key类型
- * @param collection中的泛型
- * @return 分类后的map
- */
- public static Map> group2Map(Collection collection, Function key1, Function key2) {
- if (CollUtil.isEmpty(collection) || key1 == null || key2 == null) {
- return MapUtil.newHashMap();
- }
- return collection
- .stream()
- .collect(Collectors.groupingBy(key1, LinkedHashMap::new, Collectors.toMap(key2, Function.identity(), (l, r) -> l)));
- }
-
- /**
- * 将collection转化为List集合,但是两者的泛型不同
- * {@code Collection ------> List }
- *
- * @param collection 需要转化的集合
- * @param function collection中的泛型转化为list泛型的lambda表达式
- * @param collection中的泛型
- * @param List中的泛型
- * @return 转化后的list
- */
- public static List toList(Collection collection, Function function) {
- if (CollUtil.isEmpty(collection)) {
- return CollUtil.newArrayList();
- }
- return collection
- .stream()
- .map(function)
- .filter(Objects::nonNull)
- .collect(Collectors.toList());
- }
-
- /**
- * 将collection转化为Set集合,但是两者的泛型不同
- * {@code Collection ------> Set }
- *
- * @param collection 需要转化的集合
- * @param function collection中的泛型转化为set泛型的lambda表达式
- * @param collection中的泛型
- * @param Set中的泛型
- * @return 转化后的Set
- */
- public static Set toSet(Collection collection, Function function) {
- if (CollUtil.isEmpty(collection) || function == null) {
- return CollUtil.newHashSet();
- }
- return collection
- .stream()
- .map(function)
- .filter(Objects::nonNull)
- .collect(Collectors.toSet());
- }
-
-
- /**
- * 合并两个相同key类型的map
- *
- * @param map1 第一个需要合并的 map
- * @param map2 第二个需要合并的 map
- * @param merge 合并的lambda,将key value1 value2合并成最终的类型,注意value可能为空的情况
- * @param map中的key类型
- * @param 第一个 map的value类型
- * @param 第二个 map的value类型
- * @param 最终map的value类型
- * @return 合并后的map
- */
- public static Map merge(Map map1, Map map2, BiFunction merge) {
- if (MapUtil.isEmpty(map1) && MapUtil.isEmpty(map2)) {
- return MapUtil.newHashMap();
- } else if (MapUtil.isEmpty(map1)) {
- map1 = MapUtil.newHashMap();
- } else if (MapUtil.isEmpty(map2)) {
- map2 = MapUtil.newHashMap();
- }
- Set key = new HashSet<>();
- key.addAll(map1.keySet());
- key.addAll(map2.keySet());
- Map map = new HashMap<>();
- for (K t : key) {
- X x = map1.get(t);
- Y y = map2.get(t);
- V z = merge.apply(x, y);
- if (z != null) {
- map.put(t, z);
- }
- }
- return map;
- }
-
-}
diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/StringUtils.java b/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/StringUtils.java
deleted file mode 100644
index 074e1ae..0000000
--- a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/StringUtils.java
+++ /dev/null
@@ -1,273 +0,0 @@
-package org.nl.common.utils;
-
-import cn.hutool.core.collection.CollUtil;
-import cn.hutool.core.lang.Validator;
-import cn.hutool.core.util.StrUtil;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import org.springframework.util.AntPathMatcher;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-/**
- * 字符串工具类
- *
- * @author Lion Li
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public class StringUtils extends org.apache.commons.lang3.StringUtils {
-
- /**
- * 获取参数不为空值
- *
- * @param str defaultValue 要判断的value
- * @return value 返回值
- */
- public static String blankToDefault(String str, String defaultValue) {
- return StrUtil.blankToDefault(str, defaultValue);
- }
-
- /**
- * * 判断一个字符串是否为空串
- *
- * @param str String
- * @return true:为空 false:非空
- */
- public static boolean isEmpty(String str) {
- return StrUtil.isEmpty(str);
- }
-
- /**
- * * 判断一个字符串是否为非空串
- *
- * @param str String
- * @return true:非空串 false:空串
- */
- public static boolean isNotEmpty(String str) {
- return !isEmpty(str);
- }
-
- /**
- * 去空格
- */
- public static String trim(String str) {
- return StrUtil.trim(str);
- }
-
- /**
- * 截取字符串
- *
- * @param str 字符串
- * @param start 开始
- * @return 结果
- */
- public static String substring(final String str, int start) {
- return substring(str, start, str.length());
- }
-
- /**
- * 截取字符串
- *
- * @param str 字符串
- * @param start 开始
- * @param end 结束
- * @return 结果
- */
- public static String substring(final String str, int start, int end) {
- return StrUtil.sub(str, start, end);
- }
-
- /**
- * 格式化文本, {} 表示占位符
- * 此方法只是简单将占位符 {} 按照顺序替换为参数
- * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可
- * 例:
- * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b
- * 转义{}: format("this is \\{} for {}", "a", "b") -> this is {} for a
- * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b
- *
- * @param template 文本模板,被替换的部分用 {} 表示
- * @param params 参数值
- * @return 格式化后的文本
- */
- public static String format(String template, Object... params) {
- return StrUtil.format(template, params);
- }
-
- /**
- * 是否为http(s)://开头
- *
- * @param link 链接
- * @return 结果
- */
- public static boolean ishttp(String link) {
- return Validator.isUrl(link);
- }
-
- /**
- * 字符串转set
- *
- * @param str 字符串
- * @param sep 分隔符
- * @return set集合
- */
- public static Set str2Set(String str, String sep) {
- return new HashSet<>(str2List(str, sep, true, false));
- }
-
- /**
- * 字符串转list
- *
- * @param str 字符串
- * @param sep 分隔符
- * @param filterBlank 过滤纯空白
- * @param trim 去掉首尾空白
- * @return list集合
- */
- public static List str2List(String str, String sep, boolean filterBlank, boolean trim) {
- List list = new ArrayList<>();
- if (isEmpty(str)) {
- return list;
- }
-
- // 过滤空白字符串
- if (filterBlank && isBlank(str)) {
- return list;
- }
- String[] split = str.split(sep);
- for (String string : split) {
- if (filterBlank && isBlank(string)) {
- continue;
- }
- if (trim) {
- string = trim(string);
- }
- list.add(string);
- }
-
- return list;
- }
-
- /**
- * 查找指定字符串是否包含指定字符串列表中的任意一个字符串同时串忽略大小写
- *
- * @param cs 指定字符串
- * @param searchCharSequences 需要检查的字符串数组
- * @return 是否包含任意一个字符串
- */
- public static boolean containsAnyIgnoreCase(CharSequence cs, CharSequence... searchCharSequences) {
- return StrUtil.containsAnyIgnoreCase(cs, searchCharSequences);
- }
-
- /**
- * 驼峰转下划线命名
- */
- public static String toUnderScoreCase(String str) {
- return StrUtil.toUnderlineCase(str);
- }
-
- /**
- * 是否包含字符串
- *
- * @param str 验证字符串
- * @param strs 字符串组
- * @return 包含返回true
- */
- public static boolean inStringIgnoreCase(String str, String... strs) {
- return StrUtil.equalsAnyIgnoreCase(str, strs);
- }
-
- /**
- * 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld
- *
- * @param name 转换前的下划线大写方式命名的字符串
- * @return 转换后的驼峰式命名的字符串
- */
- public static String convertToCamelCase(String name) {
- return StrUtil.upperFirst(StrUtil.toCamelCase(name));
- }
-
- /**
- * 驼峰式命名法 例如:user_name->userName
- */
- public static String toCamelCase(String s) {
- return StrUtil.toCamelCase(s);
- }
-
- /**
- * 查找指定字符串是否匹配指定字符串列表中的任意一个字符串
- *
- * @param str 指定字符串
- * @param strs 需要检查的字符串数组
- * @return 是否匹配
- */
- public static boolean matches(String str, List strs) {
- if (isEmpty(str) || CollUtil.isEmpty(strs)) {
- return false;
- }
- for (String pattern : strs) {
- if (isMatch(pattern, str)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * 判断url是否与规则配置:
- * ? 表示单个字符;
- * * 表示一层路径内的任意字符串,不可跨层级;
- * ** 表示任意层路径;
- *
- * @param pattern 匹配规则
- * @param url 需要匹配的url
- * @return
- */
- public static boolean isMatch(String pattern, String url) {
- AntPathMatcher matcher = new AntPathMatcher();
- return matcher.match(pattern, url);
- }
-
- /**
- * 数字左边补齐0,使之达到指定长度。注意,如果数字转换为字符串后,长度大于size,则只保留 最后size个字符。
- *
- * @param num 数字对象
- * @param size 字符串指定长度
- * @return 返回数字的字符串格式,该字符串为指定长度。
- */
- public static final String padl(final Number num, final int size) {
- return padl(num.toString(), size, '0');
- }
-
- /**
- * 字符串左补齐。如果原始字符串s长度大于size,则只保留最后size个字符。
- *
- * @param s 原始字符串
- * @param size 字符串指定长度
- * @param c 用于补齐的字符
- * @return 返回指定长度的字符串,由原字符串左补齐或截取得到。
- */
- public static final String padl(final String s, final int size, final char c) {
- final StringBuilder sb = new StringBuilder(size);
- if (s != null) {
- final int len = s.length();
- if (s.length() <= size) {
- for (int i = size - len; i > 0; i--) {
- sb.append(c);
- }
- sb.append(s);
- } else {
- return s.substring(len - size, len);
- }
- } else {
- for (int i = size; i > 0; i--) {
- sb.append(c);
- }
- }
- return sb.toString();
- }
-
-}
diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/Threads.java b/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/Threads.java
deleted file mode 100644
index bd36ae3..0000000
--- a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/Threads.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package org.nl.common.utils;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-
-import java.util.concurrent.*;
-
-/**
- * 线程相关工具类.
- *
- * @author ruoyi
- */
-@Slf4j
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public class Threads {
-
- /**
- * sleep等待,单位为毫秒
- */
- public static void sleep(long milliseconds) {
- try {
- Thread.sleep(milliseconds);
- } catch (InterruptedException e) {
- return;
- }
- }
-
- /**
- * 停止线程池
- * 先使用shutdown, 停止接收新任务并尝试完成所有已存在任务.
- * 如果超时, 则调用shutdownNow, 取消在workQueue中Pending的任务,并中断所有阻塞函数.
- * 如果仍然超時,則強制退出.
- * 另对在shutdown时线程本身被调用中断做了处理.
- */
- public static void shutdownAndAwaitTermination(ExecutorService pool) {
- if (pool != null && !pool.isShutdown()) {
- pool.shutdown();
- try {
- if (!pool.awaitTermination(120, TimeUnit.SECONDS)) {
- pool.shutdownNow();
- if (!pool.awaitTermination(120, TimeUnit.SECONDS)) {
- log.info("Pool did not terminate");
- }
- }
- } catch (InterruptedException ie) {
- pool.shutdownNow();
- Thread.currentThread().interrupt();
- }
- }
- }
-
- /**
- * 打印线程异常信息
- */
- public static void printException(Runnable r, Throwable t) {
- if (t == null && r instanceof Future>) {
- try {
- Future> future = (Future>) r;
- if (future.isDone()) {
- future.get();
- }
- } catch (CancellationException ce) {
- t = ce;
- } catch (ExecutionException ee) {
- t = ee.getCause();
- } catch (InterruptedException ie) {
- Thread.currentThread().interrupt();
- }
- }
- if (t != null) {
- log.error(t.getMessage(), t);
- }
- }
-}
diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/TreeBuildUtils.java b/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/TreeBuildUtils.java
deleted file mode 100644
index 68a85ae..0000000
--- a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/TreeBuildUtils.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.nl.common.utils;
-
-import cn.hutool.core.collection.CollUtil;
-import cn.hutool.core.lang.tree.Tree;
-import cn.hutool.core.lang.tree.TreeNodeConfig;
-import cn.hutool.core.lang.tree.TreeUtil;
-import cn.hutool.core.lang.tree.parser.NodeParser;
-import com.ruoyi.common.utils.reflect.ReflectUtils;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-
-import java.util.List;
-
-/**
- * 扩展 hutool TreeUtil 封装系统树构建
- *
- * @author Lion Li
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public class TreeBuildUtils extends TreeUtil {
-
- /**
- * 根据前端定制差异化字段
- */
- public static final TreeNodeConfig DEFAULT_CONFIG = TreeNodeConfig.DEFAULT_CONFIG.setNameKey("label");
-
- public static List> build(List list, NodeParser nodeParser) {
- if (CollUtil.isEmpty(list)) {
- return null;
- }
- K k = ReflectUtils.invokeGetter(list.get(0), "parentId");
- return TreeUtil.build(list, k, DEFAULT_CONFIG, nodeParser);
- }
-
-}
diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/ValidatorUtils.java b/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/ValidatorUtils.java
deleted file mode 100644
index 1015ad7..0000000
--- a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/ValidatorUtils.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.nl.common.utils;
-
-import com.ruoyi.common.utils.spring.SpringUtils;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-
-import javax.validation.ConstraintViolation;
-import javax.validation.ConstraintViolationException;
-import javax.validation.Validator;
-import java.util.Set;
-
-/**
- * Validator 校验框架工具
- *
- * @author Lion Li
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public class ValidatorUtils {
-
- private static final Validator VALID = SpringUtils.getBean(Validator.class);
-
- public static void validate(T object, Class>... groups) {
- Set> validate = VALID.validate(object, groups);
- if (!validate.isEmpty()) {
- throw new ConstraintViolationException("参数校验异常", validate);
- }
- }
-
-}
diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/email/MailUtils.java b/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/email/MailUtils.java
deleted file mode 100644
index 512612d..0000000
--- a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/email/MailUtils.java
+++ /dev/null
@@ -1,470 +0,0 @@
-//package org.nl.common.utils.email;
-//
-//import cn.hutool.core.collection.CollUtil;
-//import cn.hutool.core.io.IoUtil;
-//import cn.hutool.core.map.MapUtil;
-//import cn.hutool.core.util.CharUtil;
-//import cn.hutool.core.util.StrUtil;
-//import cn.hutool.extra.mail.Mail;
-//import cn.hutool.extra.mail.MailAccount;
-//import cn.hutool.extra.mail.UserPassAuthenticator;
-//import com.ruoyi.common.utils.StringUtils;
-//import com.ruoyi.common.utils.spring.SpringUtils;
-//import lombok.AccessLevel;
-//import lombok.NoArgsConstructor;
-//
-//import javax.mail.Authenticator;
-//import javax.mail.Session;
-//import java.io.File;
-//import java.io.InputStream;
-//import java.util.Collection;
-//import java.util.List;
-//import java.util.Map;
-//
-//
-///**
-// * 邮件工具类
-// */
-//@NoArgsConstructor(access = AccessLevel.PRIVATE)
-//public class MailUtils {
-//
-// private static final MailAccount ACCOUNT = SpringUtils.getBean(MailAccount.class);
-//
-// /**
-// * 获取邮件发送实例
-// */
-// public static MailAccount getMailAccount() {
-// return ACCOUNT;
-// }
-//
-// /**
-// * 获取邮件发送实例 (自定义发送人以及授权码)
-// *
-// * @param user 发送人
-// * @param pass 授权码
-// */
-// public static MailAccount getMailAccount(String from, String user, String pass) {
-// ACCOUNT.setFrom(StringUtils.blankToDefault(from, ACCOUNT.getFrom()));
-// ACCOUNT.setUser(StringUtils.blankToDefault(user, ACCOUNT.getUser()));
-// ACCOUNT.setPass(StringUtils.blankToDefault(pass, ACCOUNT.getPass()));
-// return ACCOUNT;
-// }
-//
-// /**
-// * 使用配置文件中设置的账户发送文本邮件,发送给单个或多个收件人
-// * 多个收件人可以使用逗号“,”分隔,也可以通过分号“;”分隔
-// *
-// * @param to 收件人
-// * @param subject 标题
-// * @param content 正文
-// * @param files 附件列表
-// * @return message-id
-// * @since 3.2.0
-// */
-// public static String sendText(String to, String subject, String content, File... files) {
-// return send(to, subject, content, false, files);
-// }
-//
-// /**
-// * 使用配置文件中设置的账户发送HTML邮件,发送给单个或多个收件人
-// * 多个收件人可以使用逗号“,”分隔,也可以通过分号“;”分隔
-// *
-// * @param to 收件人
-// * @param subject 标题
-// * @param content 正文
-// * @param files 附件列表
-// * @return message-id
-// * @since 3.2.0
-// */
-// public static String sendHtml(String to, String subject, String content, File... files) {
-// return send(to, subject, content, true, files);
-// }
-//
-// /**
-// * 使用配置文件中设置的账户发送邮件,发送单个或多个收件人
-// * 多个收件人可以使用逗号“,”分隔,也可以通过分号“;”分隔
-// *
-// * @param to 收件人
-// * @param subject 标题
-// * @param content 正文
-// * @param isHtml 是否为HTML
-// * @param files 附件列表
-// * @return message-id
-// */
-// public static String send(String to, String subject, String content, boolean isHtml, File... files) {
-// return send(splitAddress(to), subject, content, isHtml, files);
-// }
-//
-// /**
-// * 使用配置文件中设置的账户发送邮件,发送单个或多个收件人
-// * 多个收件人、抄送人、密送人可以使用逗号“,”分隔,也可以通过分号“;”分隔
-// *
-// * @param to 收件人,可以使用逗号“,”分隔,也可以通过分号“;”分隔
-// * @param cc 抄送人,可以使用逗号“,”分隔,也可以通过分号“;”分隔
-// * @param bcc 密送人,可以使用逗号“,”分隔,也可以通过分号“;”分隔
-// * @param subject 标题
-// * @param content 正文
-// * @param isHtml 是否为HTML
-// * @param files 附件列表
-// * @return message-id
-// * @since 4.0.3
-// */
-// public static String send(String to, String cc, String bcc, String subject, String content, boolean isHtml, File... files) {
-// return send(splitAddress(to), splitAddress(cc), splitAddress(bcc), subject, content, isHtml, files);
-// }
-//
-// /**
-// * 使用配置文件中设置的账户发送文本邮件,发送给多人
-// *
-// * @param tos 收件人列表
-// * @param subject 标题
-// * @param content 正文
-// * @param files 附件列表
-// * @return message-id
-// */
-// public static String sendText(Collection tos, String subject, String content, File... files) {
-// return send(tos, subject, content, false, files);
-// }
-//
-// /**
-// * 使用配置文件中设置的账户发送HTML邮件,发送给多人
-// *
-// * @param tos 收件人列表
-// * @param subject 标题
-// * @param content 正文
-// * @param files 附件列表
-// * @return message-id
-// * @since 3.2.0
-// */
-// public static String sendHtml(Collection tos, String subject, String content, File... files) {
-// return send(tos, subject, content, true, files);
-// }
-//
-// /**
-// * 使用配置文件中设置的账户发送邮件,发送给多人
-// *
-// * @param tos 收件人列表
-// * @param subject 标题
-// * @param content 正文
-// * @param isHtml 是否为HTML
-// * @param files 附件列表
-// * @return message-id
-// */
-// public static String send(Collection tos, String subject, String content, boolean isHtml, File... files) {
-// return send(tos, null, null, subject, content, isHtml, files);
-// }
-//
-// /**
-// * 使用配置文件中设置的账户发送邮件,发送给多人
-// *
-// * @param tos 收件人列表
-// * @param ccs 抄送人列表,可以为null或空
-// * @param bccs 密送人列表,可以为null或空
-// * @param subject 标题
-// * @param content 正文
-// * @param isHtml 是否为HTML
-// * @param files 附件列表
-// * @return message-id
-// * @since 4.0.3
-// */
-// public static String send(Collection tos, Collection ccs, Collection bccs, String subject, String content, boolean isHtml, File... files) {
-// return send(getMailAccount(), true, tos, ccs, bccs, subject, content, null, isHtml, files);
-// }
-//
-// // ------------------------------------------------------------------------------------------------------------------------------- Custom MailAccount
-//
-// /**
-// * 发送邮件给多人
-// *
-// * @param mailAccount 邮件认证对象
-// * @param to 收件人,多个收件人逗号或者分号隔开
-// * @param subject 标题
-// * @param content 正文
-// * @param isHtml 是否为HTML格式
-// * @param files 附件列表
-// * @return message-id
-// * @since 3.2.0
-// */
-// public static String send(MailAccount mailAccount, String to, String subject, String content, boolean isHtml, File... files) {
-// return send(mailAccount, splitAddress(to), subject, content, isHtml, files);
-// }
-//
-// /**
-// * 发送邮件给多人
-// *
-// * @param mailAccount 邮件帐户信息
-// * @param tos 收件人列表
-// * @param subject 标题
-// * @param content 正文
-// * @param isHtml 是否为HTML格式
-// * @param files 附件列表
-// * @return message-id
-// */
-// public static String send(MailAccount mailAccount, Collection tos, String subject, String content, boolean isHtml, File... files) {
-// return send(mailAccount, tos, null, null, subject, content, isHtml, files);
-// }
-//
-// /**
-// * 发送邮件给多人
-// *
-// * @param mailAccount 邮件帐户信息
-// * @param tos 收件人列表
-// * @param ccs 抄送人列表,可以为null或空
-// * @param bccs 密送人列表,可以为null或空
-// * @param subject 标题
-// * @param content 正文
-// * @param isHtml 是否为HTML格式
-// * @param files 附件列表
-// * @return message-id
-// * @since 4.0.3
-// */
-// public static String send(MailAccount mailAccount, Collection tos, Collection ccs, Collection bccs, String subject, String content, boolean isHtml, File... files) {
-// return send(mailAccount, false, tos, ccs, bccs, subject, content, null, isHtml, files);
-// }
-//
-// /**
-// * 使用配置文件中设置的账户发送HTML邮件,发送给单个或多个收件人
-// * 多个收件人可以使用逗号“,”分隔,也可以通过分号“;”分隔
-// *
-// * @param to 收件人
-// * @param subject 标题
-// * @param content 正文
-// * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER
-// * @param files 附件列表
-// * @return message-id
-// * @since 3.2.0
-// */
-// public static String sendHtml(String to, String subject, String content, Map imageMap, File... files) {
-// return send(to, subject, content, imageMap, true, files);
-// }
-//
-// /**
-// * 使用配置文件中设置的账户发送邮件,发送单个或多个收件人
-// * 多个收件人可以使用逗号“,”分隔,也可以通过分号“;”分隔
-// *
-// * @param to 收件人
-// * @param subject 标题
-// * @param content 正文
-// * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER
-// * @param isHtml 是否为HTML
-// * @param files 附件列表
-// * @return message-id
-// */
-// public static String send(String to, String subject, String content, Map imageMap, boolean isHtml, File... files) {
-// return send(splitAddress(to), subject, content, imageMap, isHtml, files);
-// }
-//
-// /**
-// * 使用配置文件中设置的账户发送邮件,发送单个或多个收件人
-// * 多个收件人、抄送人、密送人可以使用逗号“,”分隔,也可以通过分号“;”分隔
-// *
-// * @param to 收件人,可以使用逗号“,”分隔,也可以通过分号“;”分隔
-// * @param cc 抄送人,可以使用逗号“,”分隔,也可以通过分号“;”分隔
-// * @param bcc 密送人,可以使用逗号“,”分隔,也可以通过分号“;”分隔
-// * @param subject 标题
-// * @param content 正文
-// * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER
-// * @param isHtml 是否为HTML
-// * @param files 附件列表
-// * @return message-id
-// * @since 4.0.3
-// */
-// public static String send(String to, String cc, String bcc, String subject, String content, Map imageMap, boolean isHtml, File... files) {
-// return send(splitAddress(to), splitAddress(cc), splitAddress(bcc), subject, content, imageMap, isHtml, files);
-// }
-//
-// /**
-// * 使用配置文件中设置的账户发送HTML邮件,发送给多人
-// *
-// * @param tos 收件人列表
-// * @param subject 标题
-// * @param content 正文
-// * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER
-// * @param files 附件列表
-// * @return message-id
-// * @since 3.2.0
-// */
-// public static String sendHtml(Collection tos, String subject, String content, Map imageMap, File... files) {
-// return send(tos, subject, content, imageMap, true, files);
-// }
-//
-// /**
-// * 使用配置文件中设置的账户发送邮件,发送给多人
-// *
-// * @param tos 收件人列表
-// * @param subject 标题
-// * @param content 正文
-// * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER
-// * @param isHtml 是否为HTML
-// * @param files 附件列表
-// * @return message-id
-// */
-// public static String send(Collection tos, String subject, String content, Map imageMap, boolean isHtml, File... files) {
-// return send(tos, null, null, subject, content, imageMap, isHtml, files);
-// }
-//
-// /**
-// * 使用配置文件中设置的账户发送邮件,发送给多人
-// *
-// * @param tos 收件人列表
-// * @param ccs 抄送人列表,可以为null或空
-// * @param bccs 密送人列表,可以为null或空
-// * @param subject 标题
-// * @param content 正文
-// * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER
-// * @param isHtml 是否为HTML
-// * @param files 附件列表
-// * @return message-id
-// * @since 4.0.3
-// */
-// public static String send(Collection tos, Collection ccs, Collection bccs, String subject, String content, Map imageMap, boolean isHtml, File... files) {
-// return send(getMailAccount(), true, tos, ccs, bccs, subject, content, imageMap, isHtml, files);
-// }
-//
-// // ------------------------------------------------------------------------------------------------------------------------------- Custom MailAccount
-//
-// /**
-// * 发送邮件给多人
-// *
-// * @param mailAccount 邮件认证对象
-// * @param to 收件人,多个收件人逗号或者分号隔开
-// * @param subject 标题
-// * @param content 正文
-// * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER
-// * @param isHtml 是否为HTML格式
-// * @param files 附件列表
-// * @return message-id
-// * @since 3.2.0
-// */
-// public static String send(MailAccount mailAccount, String to, String subject, String content, Map imageMap, boolean isHtml, File... files) {
-// return send(mailAccount, splitAddress(to), subject, content, imageMap, isHtml, files);
-// }
-//
-// /**
-// * 发送邮件给多人
-// *
-// * @param mailAccount 邮件帐户信息
-// * @param tos 收件人列表
-// * @param subject 标题
-// * @param content 正文
-// * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER
-// * @param isHtml 是否为HTML格式
-// * @param files 附件列表
-// * @return message-id
-// * @since 4.6.3
-// */
-// public static String send(MailAccount mailAccount, Collection tos, String subject, String content, Map imageMap, boolean isHtml, File... files) {
-// return send(mailAccount, tos, null, null, subject, content, imageMap, isHtml, files);
-// }
-//
-// /**
-// * 发送邮件给多人
-// *
-// * @param mailAccount 邮件帐户信息
-// * @param tos 收件人列表
-// * @param ccs 抄送人列表,可以为null或空
-// * @param bccs 密送人列表,可以为null或空
-// * @param subject 标题
-// * @param content 正文
-// * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER
-// * @param isHtml 是否为HTML格式
-// * @param files 附件列表
-// * @return message-id
-// * @since 4.6.3
-// */
-// public static String send(MailAccount mailAccount, Collection tos, Collection ccs, Collection bccs, String subject, String content, Map imageMap,
-// boolean isHtml, File... files) {
-// return send(mailAccount, false, tos, ccs, bccs, subject, content, imageMap, isHtml, files);
-// }
-//
-// /**
-// * 根据配置文件,获取邮件客户端会话
-// *
-// * @param mailAccount 邮件账户配置
-// * @param isSingleton 是否单例(全局共享会话)
-// * @return {@link Session}
-// * @since 5.5.7
-// */
-// public static Session getSession(MailAccount mailAccount, boolean isSingleton) {
-// Authenticator authenticator = null;
-// if (mailAccount.isAuth()) {
-// authenticator = new UserPassAuthenticator(mailAccount.getUser(), mailAccount.getPass());
-// }
-//
-// return isSingleton ? Session.getDefaultInstance(mailAccount.getSmtpProps(), authenticator) //
-// : Session.getInstance(mailAccount.getSmtpProps(), authenticator);
-// }
-//
-// // ------------------------------------------------------------------------------------------------------------------------ Private method start
-//
-// /**
-// * 发送邮件给多人
-// *
-// * @param mailAccount 邮件帐户信息
-// * @param useGlobalSession 是否全局共享Session
-// * @param tos 收件人列表
-// * @param ccs 抄送人列表,可以为null或空
-// * @param bccs 密送人列表,可以为null或空
-// * @param subject 标题
-// * @param content 正文
-// * @param imageMap 图片与占位符,占位符格式为cid:${cid}
-// * @param isHtml 是否为HTML格式
-// * @param files 附件列表
-// * @return message-id
-// * @since 4.6.3
-// */
-// private static String send(MailAccount mailAccount, boolean useGlobalSession, Collection tos, Collection ccs, Collection bccs, String subject, String content,
-// Map imageMap, boolean isHtml, File... files) {
-// final Mail mail = Mail.create(mailAccount).setUseGlobalSession(useGlobalSession);
-//
-// // 可选抄送人
-// if (CollUtil.isNotEmpty(ccs)) {
-// mail.setCcs(ccs.toArray(new String[0]));
-// }
-// // 可选密送人
-// if (CollUtil.isNotEmpty(bccs)) {
-// mail.setBccs(bccs.toArray(new String[0]));
-// }
-//
-// mail.setTos(tos.toArray(new String[0]));
-// mail.setTitle(subject);
-// mail.setContent(content);
-// mail.setHtml(isHtml);
-// mail.setFiles(files);
-//
-// // 图片
-// if (MapUtil.isNotEmpty(imageMap)) {
-// for (Map.Entry entry : imageMap.entrySet()) {
-// mail.addImage(entry.getKey(), entry.getValue());
-// // 关闭流
-// IoUtil.close(entry.getValue());
-// }
-// }
-//
-// return mail.send();
-// }
-//
-// /**
-// * 将多个联系人转为列表,分隔符为逗号或者分号
-// *
-// * @param addresses 多个联系人,如果为空返回null
-// * @return 联系人列表
-// */
-// private static List splitAddress(String addresses) {
-// if (StrUtil.isBlank(addresses)) {
-// return null;
-// }
-//
-// List result;
-// if (StrUtil.contains(addresses, CharUtil.COMMA)) {
-// result = StrUtil.splitTrim(addresses, CharUtil.COMMA);
-// } else if (StrUtil.contains(addresses, ';')) {
-// result = StrUtil.splitTrim(addresses, ';');
-// } else {
-// result = CollUtil.newArrayList(addresses);
-// }
-// return result;
-// }
-// // ------------------------------------------------------------------------------------------------------------------------ Private method end
-//
-//}
diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/file/FileUtils.java b/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/file/FileUtils.java
deleted file mode 100644
index 710fb91..0000000
--- a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/file/FileUtils.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.nl.common.utils.file;
-
-import cn.hutool.core.io.FileUtil;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-
-import javax.servlet.http.HttpServletResponse;
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.nio.charset.StandardCharsets;
-
-/**
- * 文件处理工具类
- *
- * @author Lion Li
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public class FileUtils extends FileUtil {
-
- /**
- * 下载文件名重新编码
- *
- * @param response 响应对象
- * @param realFileName 真实文件名
- */
- public static void setAttachmentResponseHeader(HttpServletResponse response, String realFileName) throws UnsupportedEncodingException {
- String percentEncodedFileName = percentEncode(realFileName);
-
- StringBuilder contentDispositionValue = new StringBuilder();
- contentDispositionValue.append("attachment; filename=")
- .append(percentEncodedFileName)
- .append(";")
- .append("filename*=")
- .append("utf-8''")
- .append(percentEncodedFileName);
-
- response.addHeader("Access-Control-Expose-Headers", "Content-Disposition,download-filename");
- response.setHeader("Content-disposition", contentDispositionValue.toString());
- response.setHeader("download-filename", percentEncodedFileName);
- }
-
- /**
- * 百分号编码工具方法
- *
- * @param s 需要百分号编码的字符串
- * @return 百分号编码后的字符串
- */
- public static String percentEncode(String s) throws UnsupportedEncodingException {
- String encode = URLEncoder.encode(s, StandardCharsets.UTF_8.toString());
- return encode.replaceAll("\\+", "%20");
- }
-}
diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/file/MimeTypeUtils.java b/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/file/MimeTypeUtils.java
deleted file mode 100644
index abdbf60..0000000
--- a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/file/MimeTypeUtils.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.nl.common.utils.file;
-
-/**
- * 媒体类型工具类
- *
- * @author ruoyi
- */
-public class MimeTypeUtils {
- public static final String IMAGE_PNG = "image/png";
-
- public static final String IMAGE_JPG = "image/jpg";
-
- public static final String IMAGE_JPEG = "image/jpeg";
-
- public static final String IMAGE_BMP = "image/bmp";
-
- public static final String IMAGE_GIF = "image/gif";
-
- public static final String[] IMAGE_EXTENSION = {"bmp", "gif", "jpg", "jpeg", "png"};
-
- public static final String[] FLASH_EXTENSION = {"swf", "flv"};
-
- public static final String[] MEDIA_EXTENSION = {"swf", "flv", "mp3", "wav", "wma", "wmv", "mid", "avi", "mpg",
- "asf", "rm", "rmvb"};
-
- public static final String[] VIDEO_EXTENSION = {"mp4", "avi", "rmvb"};
-
- public static final String[] DEFAULT_ALLOWED_EXTENSION = {
- // 图片
- "bmp", "gif", "jpg", "jpeg", "png",
- // word excel powerpoint
- "doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt",
- // 压缩文件
- "rar", "zip", "gz", "bz2",
- // 视频格式
- "mp4", "avi", "rmvb",
- // pdf
- "pdf"};
-
-}
diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/ip/AddressUtils.java b/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/ip/AddressUtils.java
deleted file mode 100644
index 88c61aa..0000000
--- a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/ip/AddressUtils.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.nl.common.utils.ip;
-
-import cn.hutool.core.lang.Dict;
-import cn.hutool.core.net.NetUtil;
-import cn.hutool.http.HtmlUtil;
-import cn.hutool.http.HttpUtil;
-import com.ruoyi.common.config.RuoYiConfig;
-import com.ruoyi.common.constant.Constants;
-import com.ruoyi.common.utils.JsonUtils;
-import com.ruoyi.common.utils.StringUtils;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-
-/**
- * 获取地址类
- *
- * @author Lion Li
- */
-@Slf4j
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public class AddressUtils {
-
- // IP地址查询
- public static final String IP_URL = "http://whois.pconline.com.cn/ipJson.jsp";
-
- // 未知地址
- public static final String UNKNOWN = "XX XX";
-
- public static String getRealAddressByIP(String ip) {
- String address = UNKNOWN;
- if (StringUtils.isBlank(ip)) {
- return address;
- }
- // 内网不查询
- ip = "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : HtmlUtil.cleanHtmlTag(ip);
- if (NetUtil.isInnerIP(ip)) {
- return "内网IP";
- }
- if (RuoYiConfig.isAddressEnabled()) {
- try {
- String rspStr = HttpUtil.createGet(IP_URL)
- .body("ip=" + ip + "&json=true", Constants.GBK)
- .execute()
- .body();
- if (StringUtils.isEmpty(rspStr)) {
- log.error("获取地理位置异常 {}", ip);
- return UNKNOWN;
- }
- Dict obj = JsonUtils.parseMap(rspStr);
- String region = obj.getStr("pro");
- String city = obj.getStr("city");
- return String.format("%s %s", region, city);
- } catch (Exception e) {
- log.error("获取地理位置异常 {}", ip);
- }
- }
- return UNKNOWN;
- }
-}
diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/poi/ExcelUtil.java b/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/poi/ExcelUtil.java
deleted file mode 100644
index 2e0c82b..0000000
--- a/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/poi/ExcelUtil.java
+++ /dev/null
@@ -1,266 +0,0 @@
-package org.nl.common.utils.poi;
-
-import cn.hutool.core.collection.CollUtil;
-import cn.hutool.core.io.resource.ClassPathResource;
-import cn.hutool.core.util.IdUtil;
-import com.alibaba.excel.EasyExcel;
-import com.alibaba.excel.ExcelWriter;
-import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder;
-import com.alibaba.excel.write.metadata.WriteSheet;
-import com.alibaba.excel.write.metadata.fill.FillConfig;
-import com.alibaba.excel.write.metadata.fill.FillWrapper;
-import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
-import com.ruoyi.common.convert.ExcelBigNumberConvert;
-import com.ruoyi.common.excel.CellMergeStrategy;
-import com.ruoyi.common.excel.DefaultExcelListener;
-import com.ruoyi.common.excel.ExcelListener;
-import com.ruoyi.common.excel.ExcelResult;
-import com.ruoyi.common.utils.StringUtils;
-import com.ruoyi.common.utils.file.FileUtils;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Excel相关处理
- *
- * @author Lion Li
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public class ExcelUtil {
-
- /**
- * 同步导入(适用于小数据量)
- *
- * @param is 输入流
- * @return 转换后集合
- */
- public static List importExcel(InputStream is, Class clazz) {
- return EasyExcel.read(is).head(clazz).autoCloseStream(false).sheet().doReadSync();
- }
-
-
- /**
- * 使用校验监听器 异步导入 同步返回
- *
- * @param is 输入流
- * @param clazz 对象类型
- * @param isValidate 是否 Validator 检验 默认为是
- * @return 转换后集合
- */
- public static ExcelResult importExcel(InputStream is, Class clazz, boolean isValidate) {
- DefaultExcelListener listener = new DefaultExcelListener<>(isValidate);
- EasyExcel.read(is, clazz, listener).sheet().doRead();
- return listener.getExcelResult();
- }
-
- /**
- * 使用自定义监听器 异步导入 自定义返回
- *
- * @param is 输入流
- * @param clazz 对象类型
- * @param listener 自定义监听器
- * @return 转换后集合
- */
- public static ExcelResult importExcel(InputStream is, Class clazz, ExcelListener listener) {
- EasyExcel.read(is, clazz, listener).sheet().doRead();
- return listener.getExcelResult();
- }
-
- /**
- * 导出excel
- *
- * @param list 导出数据集合
- * @param sheetName 工作表的名称
- * @param clazz 实体类
- * @param response 响应体
- */
- public static void exportExcel(List list, String sheetName, Class clazz, HttpServletResponse response) {
- exportExcel(list, sheetName, clazz, false, response);
- }
-
- /**
- * 导出excel
- *
- * @param list 导出数据集合
- * @param sheetName 工作表的名称
- * @param clazz 实体类
- * @param merge 是否合并单元格
- * @param response 响应体
- */
- public static void exportExcel(List list, String sheetName, Class clazz, boolean merge, HttpServletResponse response) {
- try {
- resetResponse(sheetName, response);
- ServletOutputStream os = response.getOutputStream();
- ExcelWriterSheetBuilder builder = EasyExcel.write(os, clazz)
- .autoCloseStream(false)
- // 自动适配
- .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
- // 大数值自动转换 防止失真
- .registerConverter(new ExcelBigNumberConvert())
- .sheet(sheetName);
- if (merge) {
- // 合并处理器
- builder.registerWriteHandler(new CellMergeStrategy(list, true));
- }
- builder.doWrite(list);
- } catch (IOException e) {
- throw new RuntimeException("导出Excel异常");
- }
- }
-
- /**
- * 单表多数据模板导出 模板格式为 {.属性}
- *
- * @param filename 文件名
- * @param templatePath 模板路径 resource 目录下的路径包括模板文件名
- * 例如: excel/temp.xlsx
- * 重点: 模板文件必须放置到启动类对应的 resource 目录下
- * @param data 模板需要的数据
- */
- public static void exportTemplate(List