代码优化
This commit is contained in:
parent
26ecc8dd34
commit
32024a5ca3
@ -75,7 +75,7 @@
|
|||||||
- eladmin-common 公共模块
|
- eladmin-common 公共模块
|
||||||
- annotation 为系统自定义注解
|
- annotation 为系统自定义注解
|
||||||
- aspect 自定义注解的切面
|
- aspect 自定义注解的切面
|
||||||
- base 提供了Entity、DTO基类和mapstruct的通用mapper
|
- base 提供了 Entity 基类
|
||||||
- config 自定义权限实现、redis配置、swagger配置、Rsa配置等
|
- config 自定义权限实现、redis配置、swagger配置、Rsa配置等
|
||||||
- exception 项目统一异常的处理
|
- exception 项目统一异常的处理
|
||||||
- utils 系统通用工具类
|
- utils 系统通用工具类
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
- eladmin-common 公共模块
|
- eladmin-common 公共模块
|
||||||
- annotation 为系统自定义注解
|
- annotation 为系统自定义注解
|
||||||
- aspect 自定义注解的切面
|
- aspect 自定义注解的切面
|
||||||
- base 提供了Entity、DTO基类和mapstruct的通用mapper
|
- base 提供了 Entity 基类
|
||||||
- config 自定义权限实现、redis配置、swagger配置、Rsa配置等
|
- config 自定义权限实现、redis配置、swagger配置、Rsa配置等
|
||||||
- exception 项目统一异常的处理
|
- exception 项目统一异常的处理
|
||||||
- utils 系统通用工具类
|
- utils 系统通用工具类
|
||||||
|
@ -1,40 +0,0 @@
|
|||||||
package me.zhengjie.base;
|
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.lang.reflect.Field;
|
|
||||||
import java.sql.Timestamp;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Zheng Jie
|
|
||||||
* @date 2019年10月24日20:48:53
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
public class BaseDTO implements Serializable {
|
|
||||||
|
|
||||||
private String createBy;
|
|
||||||
|
|
||||||
private String updateBy;
|
|
||||||
|
|
||||||
private Timestamp createTime;
|
|
||||||
|
|
||||||
private Timestamp updateTime;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
ToStringBuilder builder = new ToStringBuilder(this);
|
|
||||||
Field[] fields = this.getClass().getDeclaredFields();
|
|
||||||
try {
|
|
||||||
for (Field f : fields) {
|
|
||||||
f.setAccessible(true);
|
|
||||||
builder.append(f.getName(), f.get(this)).append("\n");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
builder.append("toString builder encounter an error");
|
|
||||||
}
|
|
||||||
return builder.toString();
|
|
||||||
}
|
|
||||||
}
|
|
@ -69,9 +69,9 @@ public interface LocalStorageService extends IService<LocalStorage> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出数据
|
* 导出数据
|
||||||
* @param localStorageDtos 待导出的数据
|
* @param localStorages 待导出的数据
|
||||||
* @param response /
|
* @param response /
|
||||||
* @throws IOException /
|
* @throws IOException /
|
||||||
*/
|
*/
|
||||||
void download(List<LocalStorage> localStorageDtos, HttpServletResponse response) throws IOException;
|
void download(List<LocalStorage> localStorages, HttpServletResponse response) throws IOException;
|
||||||
}
|
}
|
@ -107,14 +107,14 @@ public class LocalStorageServiceImpl extends ServiceImpl<LocalStorageMapper, Loc
|
|||||||
@Override
|
@Override
|
||||||
public void download(List<LocalStorage> queryAll, HttpServletResponse response) throws IOException {
|
public void download(List<LocalStorage> queryAll, HttpServletResponse response) throws IOException {
|
||||||
List<Map<String, Object>> list = new ArrayList<>();
|
List<Map<String, Object>> list = new ArrayList<>();
|
||||||
for (LocalStorage localStorageDTO : queryAll) {
|
for (LocalStorage localStorage : queryAll) {
|
||||||
Map<String,Object> map = new LinkedHashMap<>();
|
Map<String,Object> map = new LinkedHashMap<>();
|
||||||
map.put("文件名", localStorageDTO.getRealName());
|
map.put("文件名", localStorage.getRealName());
|
||||||
map.put("备注名", localStorageDTO.getName());
|
map.put("备注名", localStorage.getName());
|
||||||
map.put("文件类型", localStorageDTO.getType());
|
map.put("文件类型", localStorage.getType());
|
||||||
map.put("文件大小", localStorageDTO.getSize());
|
map.put("文件大小", localStorage.getSize());
|
||||||
map.put("创建者", localStorageDTO.getCreateBy());
|
map.put("创建者", localStorage.getCreateBy());
|
||||||
map.put("创建日期", localStorageDTO.getCreateTime());
|
map.put("创建日期", localStorage.getCreateTime());
|
||||||
list.add(map);
|
list.add(map);
|
||||||
}
|
}
|
||||||
FileUtil.downloadExcel(list, response);
|
FileUtil.downloadExcel(list, response);
|
||||||
|
Loading…
Reference in New Issue
Block a user