optimize imports

This commit is contained in:
mazhicheng 2020-03-21 15:29:46 +08:00
parent 9a884528b1
commit f5a12b8da1
20 changed files with 27 additions and 45 deletions

View File

@ -1,15 +1,15 @@
package com.diboot.file.controller;
import com.diboot.file.entity.UploadFile;
import com.diboot.file.excel.listener.FixedHeadExcelListener;
import com.diboot.file.util.ExcelHelper;
import com.diboot.file.util.FileHelper;
import com.diboot.core.config.BaseConfig;
import com.diboot.core.exception.BusinessException;
import com.diboot.core.util.S;
import com.diboot.core.util.V;
import com.diboot.core.vo.JsonResult;
import com.diboot.core.vo.Status;
import com.diboot.file.entity.UploadFile;
import com.diboot.file.excel.listener.FixedHeadExcelListener;
import com.diboot.file.util.ExcelHelper;
import com.diboot.file.util.FileHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.multipart.MultipartFile;

View File

@ -1,9 +1,6 @@
package com.diboot.file.controller;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.diboot.file.entity.UploadFile;
import com.diboot.file.service.UploadFileService;
import com.diboot.file.util.FileHelper;
import com.diboot.core.controller.BaseController;
import com.diboot.core.exception.BusinessException;
import com.diboot.core.util.S;
@ -11,6 +8,9 @@ import com.diboot.core.util.V;
import com.diboot.core.vo.JsonResult;
import com.diboot.core.vo.Pagination;
import com.diboot.core.vo.Status;
import com.diboot.file.entity.UploadFile;
import com.diboot.file.service.UploadFileService;
import com.diboot.file.util.FileHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.multipart.MultipartFile;

View File

@ -1,14 +1,11 @@
package com.diboot.file.excel.cache;
import com.alibaba.excel.metadata.CellData;
import com.diboot.core.binding.annotation.BindDict;
import com.diboot.core.exception.BusinessException;
import com.diboot.core.service.DictionaryService;
import com.diboot.core.util.BeanUtils;
import com.diboot.core.util.ContextHelper;
import com.diboot.core.util.V;
import com.diboot.core.vo.KeyValue;
import com.diboot.core.vo.Status;
import com.diboot.file.excel.BaseExcelModel;
import lombok.extern.slf4j.Slf4j;

View File

@ -5,12 +5,12 @@ import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.excel.exception.ExcelDataConvertException;
import com.alibaba.excel.metadata.Head;
import com.alibaba.excel.read.metadata.property.ExcelReadHeadProperty;
import com.diboot.file.excel.BaseExcelModel;
import com.diboot.core.exception.BusinessException;
import com.diboot.core.util.BeanUtils;
import com.diboot.core.util.S;
import com.diboot.core.util.V;
import com.diboot.core.vo.Status;
import com.diboot.file.excel.BaseExcelModel;
import com.diboot.file.excel.cache.DictTempCache;
import lombok.extern.slf4j.Slf4j;

View File

@ -1,7 +1,7 @@
package com.diboot.file.mapper;
import com.diboot.file.entity.UploadFile;
import com.diboot.core.mapper.BaseCrudMapper;
import com.diboot.file.entity.UploadFile;
import org.apache.ibatis.annotations.Mapper;
/**

View File

@ -1,7 +1,7 @@
package com.diboot.file.service;
import com.diboot.file.entity.UploadFile;
import com.diboot.core.service.BaseService;
import com.diboot.file.entity.UploadFile;
import java.util.List;

View File

@ -2,10 +2,10 @@ package com.diboot.file.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.diboot.core.service.impl.BaseServiceImpl;
import com.diboot.file.entity.UploadFile;
import com.diboot.file.mapper.UploadFileMapper;
import com.diboot.file.service.UploadFileService;
import com.diboot.core.service.impl.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;

View File

@ -2,13 +2,13 @@ package com.diboot.file.util;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
import com.diboot.file.excel.BaseExcelModel;
import com.diboot.file.excel.listener.DynamicHeadExcelListener;
import com.diboot.file.excel.listener.FixedHeadExcelListener;
import com.diboot.core.exception.BusinessException;
import com.diboot.core.util.BeanUtils;
import com.diboot.core.util.V;
import com.diboot.core.vo.Status;
import com.diboot.file.excel.BaseExcelModel;
import com.diboot.file.excel.listener.DynamicHeadExcelListener;
import com.diboot.file.excel.listener.FixedHeadExcelListener;
import lombok.extern.slf4j.Slf4j;
import java.io.File;

View File

@ -1,10 +1,10 @@
package com.diboot.file.util;
import com.diboot.file.config.Cons;
import com.diboot.core.exception.BusinessException;
import com.diboot.core.util.D;
import com.diboot.core.util.PropertiesUtils;
import com.diboot.core.vo.Status;
import com.diboot.file.config.Cons;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;

View File

@ -1,8 +1,8 @@
package com.diboot.file.util;
import com.diboot.file.config.Cons;
import com.diboot.core.util.D;
import com.diboot.core.util.S;
import com.diboot.file.config.Cons;
import lombok.extern.slf4j.Slf4j;
import net.coobird.thumbnailator.Thumbnails;
import net.coobird.thumbnailator.geometry.Positions;

View File

@ -1,12 +1,10 @@
package com.diboot.file.example.custom.listener;
import com.diboot.file.excel.listener.FixedHeadExcelListener;
import com.diboot.core.util.BeanUtils;
import com.diboot.core.util.JSON;
import com.diboot.file.example.custom.Department;
import com.diboot.file.example.custom.DepartmentExcelModel;
import com.diboot.file.example.custom.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import com.diboot.file.excel.listener.FixedHeadExcelListener;
import org.springframework.stereotype.Component;
import java.util.List;

View File

@ -1,8 +1,8 @@
package com.diboot.file.example.test;
import com.diboot.core.util.JSON;
import com.diboot.file.excel.listener.DynamicHeadExcelListener;
import com.diboot.file.util.ExcelHelper;
import com.diboot.core.util.JSON;
import org.junit.Assert;
import org.junit.Test;

View File

@ -1,9 +1,9 @@
package com.diboot.file.example.test;
import com.diboot.file.example.ApplicationTest;
import com.diboot.file.util.ExcelHelper;
import com.diboot.file.util.FileHelper;
import com.diboot.file.example.ApplicationTest;
import org.junit.Assert;
import org.junit.Test;

View File

@ -1,10 +1,10 @@
package com.diboot.file.example.test;
import com.diboot.core.util.JSON;
import com.diboot.file.util.ExcelHelper;
import com.diboot.core.vo.Status;
import com.diboot.file.example.custom.DepartmentExcelModel;
import com.diboot.file.example.custom.listener.DepartmentImportListener;
import com.diboot.file.util.ExcelHelper;
import org.junit.Assert;
import org.junit.Test;

View File

@ -1,9 +1,9 @@
package com.diboot.file.example.test;
import com.diboot.file.entity.UploadFile;
import com.diboot.file.service.UploadFileService;
import com.diboot.file.example.ApplicationTest;
import com.diboot.file.example.custom.Department;
import com.diboot.file.service.UploadFileService;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

View File

@ -14,7 +14,6 @@ import com.diboot.iam.service.IamRolePermissionService;
import com.diboot.iam.service.IamUserRoleService;
import com.diboot.iam.util.IamSecurityUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;

View File

@ -4,8 +4,6 @@ import com.diboot.core.mapper.BaseCrudMapper;
import com.diboot.iam.entity.IamRolePermission;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 角色权限关联Mapper
* @author mazc@dibo.ltd

View File

@ -6,7 +6,6 @@ import com.diboot.core.exception.BusinessException;
import com.diboot.core.util.BeanUtils;
import com.diboot.core.util.S;
import com.diboot.core.util.V;
import com.diboot.core.vo.JsonResult;
import com.diboot.core.vo.Status;
import com.diboot.iam.config.Cons;
import com.diboot.iam.dto.IamFrontendPermissionDTO;
@ -63,10 +62,11 @@ public class IamFrontendPermissionServiceImpl extends BaseIamServiceImpl<IamFron
}
// 批量创建按钮/权限列表
List<IamFrontendPermissionDTO> permissionList = iamFrontendPermissionDTO.getPermissionList();
if (V.isEmpty(permissionList)){
List<IamFrontendPermissionDTO> permissionDTOList = iamFrontendPermissionDTO.getPermissionList();
if (V.isEmpty(permissionDTOList)){
return;
}
List<IamFrontendPermission> permissionList = BeanUtils.convertList(permissionDTOList, IamFrontendPermission.class);
// 设置每一条按钮/权限的parentId与接口列表
permissionList.forEach(p -> {
p.setParentId(iamFrontendPermissionDTO.getId());
@ -98,7 +98,7 @@ public class IamFrontendPermissionServiceImpl extends BaseIamServiceImpl<IamFron
.filter(p -> V.notEmpty(p.getId()))
.collect(Collectors.toList());
// 需要新建的列表
List<IamFrontendPermissionDTO> createPermissionList = permissionList.stream()
List<IamFrontendPermissionDTO> createPermissionDTOList = permissionList.stream()
.filter(p -> V.isEmpty(p.getId()))
.collect(Collectors.toList());
List<Long> updatePermissionIdList = updatePermissionList.stream()
@ -120,7 +120,8 @@ public class IamFrontendPermissionServiceImpl extends BaseIamServiceImpl<IamFron
this.deleteEntities(deleteWrapper);
}
// 批量新建按钮/权限列表
if (V.notEmpty(createPermissionList)) {
if (V.notEmpty(createPermissionDTOList)) {
List<IamFrontendPermission> createPermissionList = BeanUtils.convertList(createPermissionDTOList, IamFrontendPermission.class);
this.createEntities(createPermissionList);
}
// 批量更新按钮/权限列表

View File

@ -16,7 +16,6 @@ import com.diboot.iam.service.IamFrontendPermissionService;
import com.diboot.iam.service.IamUserRoleService;
import com.diboot.iam.service.IamUserService;
import com.diboot.iam.util.IamSecurityUtils;
import com.diboot.iam.vo.IamFrontendPermissionVO;
import com.diboot.iam.vo.IamRoleVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

View File

@ -1,10 +1,6 @@
package com.diboot.iam.starter;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.alibaba.fastjson.support.config.FastJsonConfig;
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
import com.diboot.core.service.impl.DictionaryServiceImpl;
import com.diboot.core.util.D;
import com.diboot.core.util.DateConverter;
import com.diboot.core.util.V;
import com.diboot.iam.config.Cons;
@ -21,7 +17,6 @@ import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
@ -30,15 +25,10 @@ import org.springframework.context.annotation.DependsOn;
import org.springframework.core.annotation.Order;
import org.springframework.core.env.Environment;
import org.springframework.format.FormatterRegistry;
import org.springframework.http.MediaType;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import javax.servlet.Filter;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**