去除autopoi,引入easypoi

This commit is contained in:
lixuetao
2023-11-17 23:35:42 +08:00
parent 95e52713fe
commit b84fded287
87 changed files with 355 additions and 436 deletions
@@ -178,16 +178,23 @@
</dependency> </dependency>
<!-- AutoPoi Excel工具类--> <!-- AutoPoi Excel工具类-->
<!-- <dependency>-->
<!-- <groupId>org.jeecgframework</groupId>-->
<!-- <artifactId>autopoi-web</artifactId>-->
<!-- <version>${autopoi-web.version}</version>-->
<!-- <exclusions>-->
<!-- <exclusion>-->
<!-- <groupId>commons-codec</groupId>-->
<!-- <artifactId>commons-codec</artifactId>-->
<!-- </exclusion>-->
<!-- </exclusions>-->
<!-- </dependency>-->
<!-- EasyPoi Excel工具类-->
<dependency> <dependency>
<groupId>org.jeecgframework</groupId> <groupId>cn.afterturn</groupId>
<artifactId>autopoi-web</artifactId> <artifactId>easypoi-spring-boot-starter</artifactId>
<version>${autopoi-web.version}</version> <version>4.4.0</version>
<exclusions>
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<!-- mini文件存储服务 --> <!-- mini文件存储服务 -->
@@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
@@ -11,12 +11,12 @@ import com.jero.common.util.oConvertUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.PropertyUtils; import org.apache.commons.beanutils.PropertyUtils;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.jeecgframework.poi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.entity.enmus.ExcelType; import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@@ -70,13 +70,10 @@ public class JeroController<T, S extends IService<T>> {
} }
// Step.3 AutoPoi 导出Excel // Step.3 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
mv.addObject(FILE_NAME, title); //此处设置的filename无效 ,前端会重更新设置一下 mv.addObject(FILE_NAME, title); //此处设置的filename无效 ,前端会重更新设置一下
mv.addObject(CLASS, clazz); mv.addObject(CLASS, clazz);
//update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
ExportParams exportParams=new ExportParams(title + "报表", "导出人:" + sysUser.getRealname(), title); ExportParams exportParams=new ExportParams(title + "报表", "导出人:" + sysUser.getRealname(), title);
exportParams.setImageBasePath(upLoadPath);
//update-end--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
mv.addObject(PARAMS,exportParams); mv.addObject(PARAMS,exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, exportList); mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
return mv; return mv;
@@ -89,11 +86,10 @@ public class JeroController<T, S extends IService<T>> {
* @param object 实体类 * @param object 实体类
* @param clazz 实体类class * @param clazz 实体类class
* @param title 标题 * @param title 标题
* @param exportFields 导出字段自定义
* @param pageNum 每个sheet的数据条数 * @param pageNum 每个sheet的数据条数
* @param request * @param request
*/ */
protected ModelAndView exportXlsSheet(HttpServletRequest request, T object, Class<T> clazz, String title,String exportFields,Integer pageNum) { protected ModelAndView exportXlsSheet(HttpServletRequest request, T object, Class<T> clazz, String title,Integer pageNum) {
// Step.1 组装查询条件 // Step.1 组装查询条件
QueryWrapper<T> queryWrapper = QueryGenerator.initQueryWrapper(object, request.getParameterMap()); QueryWrapper<T> queryWrapper = QueryGenerator.initQueryWrapper(object, request.getParameterMap());
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
@@ -116,7 +112,7 @@ public class JeroController<T, S extends IService<T>> {
exportList = records; exportList = records;
} }
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
ExportParams exportParams=new ExportParams(title + "报表", "导出人:" + sysUser.getRealname(), title+i,upLoadPath); ExportParams exportParams=new ExportParams(title + "报表", "导出人:" + sysUser.getRealname(), title+i);
exportParams.setType(ExcelType.XSSF); exportParams.setType(ExcelType.XSSF);
//map.put("title",exportParams);//表格Title //map.put("title",exportParams);//表格Title
map.put(PARAMS,exportParams);//表格Title map.put(PARAMS,exportParams);//表格Title
@@ -125,23 +121,12 @@ public class JeroController<T, S extends IService<T>> {
listMap.add(map); listMap.add(map);
} }
// Step.4 AutoPoi 导出Excel // Step.4 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
mv.addObject(FILE_NAME, title); //此处设置的filename无效 ,前端会重更新设置一下 mv.addObject(FILE_NAME, title); //此处设置的filename无效 ,前端会重更新设置一下
mv.addObject(NormalExcelConstants.MAP_LIST, listMap); mv.addObject(NormalExcelConstants.MAP_LIST, listMap);
return mv; return mv;
} }
/**
* 根据权限导出excel,传入导出字段参数
*
* @param request
*/
protected ModelAndView exportXls(HttpServletRequest request, T object, Class<T> clazz, String title,String exportFields) {
ModelAndView mv = this.exportXls(request,object,clazz,title);
mv.addObject(NormalExcelConstants.EXPORT_FIELDS,exportFields);
return mv;
}
/** /**
* 获取对象ID * 获取对象ID
* *
@@ -1,7 +1,7 @@
package com.jero.common.system.base.entity; package com.jero.common.system.base.entity;
import java.io.Serializable; import java.io.Serializable;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
@@ -1,5 +1,6 @@
package com.jero.common.system.vo; package com.jero.common.system.vo;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
@@ -7,7 +8,6 @@ import com.jero.common.aspect.annotation.Dict;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
@@ -58,7 +58,7 @@ public class SysDictItemCore implements Serializable {
/** /**
* 排序 * 排序
*/ */
@Excel(name = "排序", width = 15,type=4) @Excel(name = "排序", width = 15, type=4)
private Integer sortOrder; private Integer sortOrder;
@@ -11,6 +11,7 @@ import java.util.regex.Pattern;
import javax.sql.DataSource; import javax.sql.DataSource;
import cn.afterturn.easypoi.util.PoiPublicUtil;
import cn.hutool.crypto.asymmetric.KeyType; import cn.hutool.crypto.asymmetric.KeyType;
import cn.hutool.crypto.asymmetric.RSA; import cn.hutool.crypto.asymmetric.RSA;
import com.jero.common.constant.CommonConstant; import com.jero.common.constant.CommonConstant;
@@ -18,7 +19,6 @@ import com.jero.common.constant.DataBaseConstant;
import com.jero.common.exception.JeroBootException; import com.jero.common.exception.JeroBootException;
import com.jero.common.util.filter.FileTypeFilter; import com.jero.common.util.filter.FileTypeFilter;
import com.jero.common.util.oss.OssBootUtil; import com.jero.common.util.oss.OssBootUtil;
import org.jeecgframework.poi.util.PoiPublicUtil;
import org.springframework.util.FileCopyUtils; import org.springframework.util.FileCopyUtils;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@@ -1,28 +1,28 @@
package com.jero.config; //package com.jero.config;
//
import org.jeecgframework.core.util.ApplicationContextUtil; //import org.jeecgframework.core.util.ApplicationContextUtil;
import org.springframework.context.annotation.Bean; //import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; //import org.springframework.context.annotation.Configuration;
//
/** ///**
* @Author: Scott // * @Author: Scott
* @Date: 2018/2/7 // * @Date: 2018/2/7
* @description: autopoi 配置类 // * @description: autopoi 配置类
*/ // */
//
@Configuration //@Configuration
public class AutoPoiConfig { //public class AutoPoiConfig {
//
/** // /**
* excel注解字典参数支持(导入导出字典值,自动翻译) // * excel注解字典参数支持(导入导出字典值,自动翻译)
* 举例: @Excel(name = "性别", width = 15, dicCode = "sex") // * 举例: @Excel(name = "性别", width = 15, dicCode = "sex")
* 1、导出的时候会根据字典配置,把值1,2翻译成:男、女; // * 1、导出的时候会根据字典配置,把值1,2翻译成:男、女;
* 2、导入的时候,会把男、女翻译成1,2存进数据库; // * 2、导入的时候,会把男、女翻译成1,2存进数据库;
* @return // * @return
*/ // */
@Bean // @Bean
public ApplicationContextUtil applicationContextUtil() { // public ApplicationContextUtil applicationContextUtil() {
return new org.jeecgframework.core.util.ApplicationContextUtil(); // return new org.jeecgframework.core.util.ApplicationContextUtil();
} // }
//
} //}
@@ -1,65 +1,65 @@
package com.jero.config; //package com.jero.config;
//
import lombok.extern.slf4j.Slf4j; //import lombok.extern.slf4j.Slf4j;
import com.jero.common.api.CommonAPI; //import com.jero.common.api.CommonAPI;
import com.jero.common.system.vo.DictModel; //import com.jero.common.system.vo.DictModel;
import com.jero.common.util.oConvertUtils; //import com.jero.common.util.oConvertUtils;
import org.jeecgframework.dict.service.AutoPoiDictServiceI; //import org.jeecgframework.dict.service.AutoPoiDictServiceI;
import org.springframework.context.annotation.Lazy; //import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; //import org.springframework.stereotype.Service;
//
import javax.annotation.Resource; //import javax.annotation.Resource;
import java.util.ArrayList; //import java.util.ArrayList;
import java.util.List; //import java.util.List;
//
/** ///**
* 描述:AutoPoi Excel注解支持字典参数设置 // * 描述:AutoPoi Excel注解支持字典参数设置
* 举例: @Excel(name = "性别", width = 15, dicCode = "sex") // * 举例: @Excel(name = "性别", width = 15, dicCode = "sex")
* 1、导出的时候会根据字典配置,把值1,2翻译成:男、女; // * 1、导出的时候会根据字典配置,把值1,2翻译成:男、女;
* 2、导入的时候,会把男、女翻译成1,2存进数据库; // * 2、导入的时候,会把男、女翻译成1,2存进数据库;
* // *
* @Author:scott // * @Author:scott
* @since2019-04-09 // * @since2019-04-09
* @Version:1.0 // * @Version:1.0
*/ // */
@Slf4j //@Slf4j
@Service //@Service
public class AutoPoiDictConfig implements AutoPoiDictServiceI { //public class AutoPoiDictConfig implements AutoPoiDictServiceI {
@Lazy // @Lazy
@Resource // @Resource
private CommonAPI commonAPI; // private CommonAPI commonAPI;
//
/** // /**
* 通过字典查询easypoi,所需字典文本 // * 通过字典查询easypoi,所需字典文本
* // *
* @Author:scott // * @Author:scott
* @since2019-04-09 // * @since2019-04-09
* @return // * @return
*/ // */
@Override // @Override
public String[] queryDict(String dicTable, String dicCode, String dicText) { // public String[] queryDict(String dicTable, String dicCode, String dicText) {
List<String> dictReplaces = new ArrayList<>(); // List<String> dictReplaces = new ArrayList<>();
List<DictModel> dictList = null; // List<DictModel> dictList = null;
// step.1 如果没有字典表则使用系统字典表 // // step.1 如果没有字典表则使用系统字典表
if (oConvertUtils.isEmpty(dicTable)) { // if (oConvertUtils.isEmpty(dicTable)) {
dictList = commonAPI.queryDictItemsByCode(dicCode); // dictList = commonAPI.queryDictItemsByCode(dicCode);
} else { // } else {
try { // try {
dicText = oConvertUtils.getString(dicText, dicCode); // dicText = oConvertUtils.getString(dicText, dicCode);
dictList = commonAPI.queryTableDictItemsByCode(dicTable, dicText, dicCode); // dictList = commonAPI.queryTableDictItemsByCode(dicTable, dicText, dicCode);
} catch (Exception e) { // } catch (Exception e) {
log.error(e.getMessage(),e); // log.error(e.getMessage(),e);
} // }
} // }
for (DictModel t : dictList) { // for (DictModel t : dictList) {
if(t!=null){ // if(t!=null){
dictReplaces.add(t.getText() + "_" + t.getValue()); // dictReplaces.add(t.getText() + "_" + t.getValue());
} // }
} // }
if (!dictReplaces.isEmpty()) { // if (!dictReplaces.isEmpty()) {
log.info("---AutoPoi--Get_DB_Dict------"+ dictReplaces.toString()); // log.info("---AutoPoi--Get_DB_Dict------"+ dictReplaces.toString());
return dictReplaces.toArray(new String[dictReplaces.size()]); // return dictReplaces.toArray(new String[dictReplaces.size()]);
} // }
return new String[0]; // return new String[0];
} // }
} //}
@@ -10,7 +10,7 @@ import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.Objects; import java.util.Objects;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@ApiModel(description = "onl_auth_data", value = "onl_auth_data对象") @ApiModel(description = "onl_auth_data", value = "onl_auth_data对象")
@@ -11,7 +11,7 @@ import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.Objects; import java.util.Objects;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@ApiModel(description = "onl_auth_page", value = "onl_auth_page对象") @ApiModel(description = "onl_auth_page", value = "onl_auth_page对象")
@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import java.io.Serializable; import java.io.Serializable;
@@ -40,11 +40,11 @@ import com.jero.generater.modules.online.config.util.DbTableUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.jeecgframework.poi.excel.ExcelExportUtil; import cn.afterturn.easypoi.excel.ExcelExportUtil;
import org.jeecgframework.poi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@@ -660,8 +660,6 @@ public class OnlCgformApiController {
Entry<String, MultipartFile> var20 = var53.next(); Entry<String, MultipartFile> var20 = var53.next();
MultipartFile var21 = var20.getValue(); MultipartFile var21 = var20.getValue();
ImportParams var22 = new ImportParams(); ImportParams var22 = new ImportParams();
var22.setImageList(var12);
var22.setDataHanlder(new CgFormExcelHandler(var10, this.upLoadPath, this.uploadType));
List<Map<String, Object>> var23 = ExcelImportUtil.importExcel(var21.getInputStream(), Map.class, var22); List<Map<String, Object>> var23 = ExcelImportUtil.importExcel(var21.getInputStream(), Map.class, var22);
if (var23 != null) { if (var23 != null) {
Object var24 = ""; Object var24 = "";
@@ -899,7 +897,8 @@ public class OnlCgformApiController {
if ("image".equals(var1.get(var4).getFieldShowType())) { if ("image".equals(var1.get(var4).getFieldShowType())) {
var6.setType(2); var6.setType(2);
var6.setExportImageType(3); var6.setExportImageType(3);
var6.setImageBasePath(this.upLoadPath); // TODO 处理图片路径的问题
// var6.setImageBasePath(this.upLoadPath);
var6.setHeight(50.0D); var6.setHeight(50.0D);
var6.setWidth(60.0D); var6.setWidth(60.0D);
} else { } else {
@@ -5,11 +5,12 @@ import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import cn.afterturn.easypoi.handler.impl.ExcelDataHandlerDefaultImpl;
import cn.afterturn.easypoi.util.PoiPublicUtil;
import com.jero.common.system.api.ISysBaseAPI; import com.jero.common.system.api.ISysBaseAPI;
import com.jero.common.util.SpringContextUtils; import com.jero.common.util.SpringContextUtils;
import com.jero.generater.modules.online.cgform.entity.OnlCgformField; import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
import org.jeecgframework.poi.handler.impl.ExcelDataHandlerDefaultImpl;
import org.jeecgframework.poi.util.PoiPublicUtil;
public class CgFormExcelHandler extends ExcelDataHandlerDefaultImpl { public class CgFormExcelHandler extends ExcelDataHandlerDefaultImpl {
Map<String, OnlCgformField> a; Map<String, OnlCgformField> a;
@@ -38,23 +39,6 @@ public class CgFormExcelHandler extends ExcelDataHandlerDefaultImpl {
return var2; return var2;
} }
@Override
public void setMapValue(Map<String, Object> map, String originKey, Object value) {
String var4 = this.a(originKey);
if (value instanceof Double) {
map.put(var4, PoiPublicUtil.doubleToString((Double)value));
} else if (value instanceof byte[]) {
byte[] var5 = ((byte[])value);
String var6 = CgformUtil.a(var5, this.c, this.d, this.e);
if (var6 != null) {
map.put(var4, var6);
}
} else {
map.put(var4, value == null ? "" : value.toString());
}
}
private String a(String var1) { private String a(String var1) {
return this.a.containsKey(var1) ? "$mainTable$" + this.a.get(var1).getDbFieldName() : "$subTable$" + var1; return this.a.containsKey(var1) ? "$mainTable$" + this.a.get(var1).getDbFieldName() : "$subTable$" + var1;
} }
@@ -29,7 +29,7 @@ import com.jero.generater.modules.online.config.util.DbTableUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.jeecgframework.poi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@@ -24,9 +24,9 @@ import com.jero.generater.modules.online.cgreport.util.SqlUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.jeecgframework.poi.excel.ExcelExportUtil; import cn.afterturn.easypoi.excel.ExcelExportUtil;
import org.jeecgframework.poi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -360,13 +360,12 @@ public class OnlCgreportAPI {
var53 = var12.get(var52); var53 = var12.get(var52);
((List)var53).add(var15); ((List)var53).add(var15);
} else { } else {
ExcelExportEntity var23 = new ExcelExportEntity(var52, var52, true); ExcelExportEntity var23 = new ExcelExportEntity(var52, var52);
var13.add(var23); var13.add(var23);
((List)var53).add(var15); ((List)var53).add(var15);
} }
var12.put(var52, var53); var12.put(var52, var53);
var16.setColspan(true);
} }
var13.add(var16); var13.add(var16);
@@ -382,8 +381,6 @@ public class OnlCgreportAPI {
Entry<String, Object> var39 = var37.next(); Entry<String, Object> var39 = var37.next();
var42 = var39.getKey(); var42 = var39.getKey();
List<String> var43 = (List)var39.getValue(); List<String> var43 = (List)var39.getValue();
getVar48(var13, var42, var43);
} }
if (!var36.isEmpty()) { if (!var36.isEmpty()) {
@@ -418,15 +415,6 @@ public class OnlCgreportAPI {
} }
} }
private void getVar48(ArrayList<ExcelExportEntity> var13, String var42, List<String> var43) {
for (ExcelExportEntity o : var13) {
ExcelExportEntity var48 = o;
if (var42.equals(var48.getName()) && var48.isColspan()) {
var48.setSubColumnList(var43);
}
}
}
private void getVar16(ExcelExportEntity var16, List<DictModel> var19) { private void getVar16(ExcelExportEntity var16, List<DictModel> var19) {
if (var19 != null && !var19.isEmpty()) { if (var19 != null && !var19.isEmpty()) {
ArrayList<String> var20 = new ArrayList<>(); ArrayList<String> var20 = new ArrayList<>();
@@ -154,10 +154,8 @@ public class JeroDemoController extends JeroController<JeroDemo, IJeroDemoServic
@RequestMapping(value = "/exportXls") @RequestMapping(value = "/exportXls")
@PermissionData(pageComponent = "jero/JeroDemoList") @PermissionData(pageComponent = "jero/JeroDemoList")
public ModelAndView exportXls(HttpServletRequest request, JeroDemo jeroDemo) { public ModelAndView exportXls(HttpServletRequest request, JeroDemo jeroDemo) {
//获取导出表格字段
String exportFields = JeroDemoService.getExportFields();
//分sheet导出表格字段 //分sheet导出表格字段
return super.exportXlsSheet(request, jeroDemo, JeroDemo.class, "单表模型",exportFields,500); return super.exportXlsSheet(request, jeroDemo, JeroDemo.class, "单表模型",500);
} }
/** /**
@@ -18,11 +18,11 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.jeecgframework.poi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@@ -178,7 +178,7 @@ public class JeroOrderMainController extends JeroController<JeroOrderMain, IJero
// Step.1 组装查询条件 // Step.1 组装查询条件
QueryWrapper<JeroOrderMain> queryWrapper = QueryGenerator.initQueryWrapper(jeroOrderMain, request.getParameterMap()); QueryWrapper<JeroOrderMain> queryWrapper = QueryGenerator.initQueryWrapper(jeroOrderMain, request.getParameterMap());
//Step.2 AutoPoi 导出Excel //Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
//获取当前用户 //获取当前用户
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
@@ -14,11 +14,11 @@ import com.jero.modules.demo.test.service.IJoaDemoService;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
import org.jeecgframework.poi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@@ -181,7 +181,7 @@ public class JoaDemoController {
} }
//Step.2 AutoPoi 导出Excel //Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
List<JoaDemo> pageList = joaDemoService.list(queryWrapper); List<JoaDemo> pageList = joaDemoService.list(queryWrapper);
//导出文件名称 //导出文件名称
mv.addObject(JeroController.FILE_NAME, "流程测试列表"); mv.addObject(JeroController.FILE_NAME, "流程测试列表");
@@ -3,7 +3,7 @@ package com.jero.modules.demo.test.entity;
import java.io.Serializable; import java.io.Serializable;
import com.jero.common.system.base.entity.JeroEntity; import com.jero.common.system.base.entity.JeroEntity;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
@@ -56,7 +56,7 @@ public class JeroDemo extends JeroEntity implements Serializable {
private java.lang.Double bonusMoney; private java.lang.Double bonusMoney;
/** 性别 {男:1,女:2} */ /** 性别 {男:1,女:2} */
@ApiModelProperty(value = "性别") @ApiModelProperty(value = "性别")
@Excel(name = "性别", width = 15, dicCode = "sex") @Excel(name = "性别", width = 15, dict = "sex")
private java.lang.String sex; private java.lang.String sex;
/** 年龄 */ /** 年龄 */
@ApiModelProperty(value = "年龄",example = "0") @ApiModelProperty(value = "年龄",example = "0")
@@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
/** /**
@@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
/** /**
@@ -2,7 +2,7 @@ package com.jero.modules.demo.test.entity;
import java.io.Serializable; import java.io.Serializable;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
@@ -25,9 +25,4 @@ public interface IJeroDemoService extends JeroService<JeroDemo> {
*/ */
IPage<JeroDemo> queryListWithPermission(int pageSize, int pageNo); IPage<JeroDemo> queryListWithPermission(int pageSize, int pageNo);
/**
* 根据用户权限获取导出字段
* @return
*/
String getExportFields();
} }
@@ -81,33 +81,4 @@ public class JeroDemoServiceImpl extends ServiceImpl<JeroDemoMapper, JeroDemo> i
return this.baseMapper.queryListWithPermission(page, sql); return this.baseMapper.queryListWithPermission(page, sql);
} }
@Override
public String getExportFields() {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//权限配置列导出示例
//1.配置前缀与菜单中配置的列前缀一致
List<String> noAuthList = new ArrayList<>();
List<String> exportFieldsList = new ArrayList<>();
String permsPrefix = "testdemo:";
//查询配置菜单有效字段
List<String> allAuth = this.jeroDemoMapper.queryAllAuth(permsPrefix);
//查询已授权字段
List<String> userAuth = this.jeroDemoMapper.queryUserAuth(sysUser.getId(),permsPrefix);
//列出未授权字段
for(String perms : allAuth){
if(!userAuth.contains(perms)){
noAuthList.add(perms.substring(permsPrefix.length()));
}
}
//实体类中字段与未授权字段比较,列出需导出字段
Field[] fileds = JeroDemo.class.getDeclaredFields();
List<Field> list = new ArrayList<>(Arrays.asList(fileds));
for(Field field : list){
if(!noAuthList.contains(field.getName())){
exportFieldsList.add(field.getName());
}
}
return !exportFieldsList.isEmpty() ? String.join(",", exportFieldsList) : "";
}
} }
@@ -4,8 +4,8 @@ import java.util.List;
import com.jero.modules.demo.test.entity.JeroOrderCustomer; import com.jero.modules.demo.test.entity.JeroOrderCustomer;
import com.jero.modules.demo.test.entity.JeroOrderTicket; import com.jero.modules.demo.test.entity.JeroOrderTicket;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelCollection; import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import lombok.Data; import lombok.Data;
@@ -2,7 +2,7 @@ package com.jero.modules.message.entity;
import com.jero.common.aspect.annotation.Dict; import com.jero.common.aspect.annotation.Dict;
import com.jero.common.system.base.entity.JeroEntity; import com.jero.common.system.base.entity.JeroEntity;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
@@ -1,7 +1,7 @@
package com.jero.modules.message.entity; package com.jero.modules.message.entity;
import com.jero.common.system.base.entity.JeroEntity; import com.jero.common.system.base.entity.JeroEntity;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
@@ -5,7 +5,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import com.jero.common.system.base.entity.JeroEntity; import com.jero.common.system.base.entity.JeroEntity;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
@Data @Data
@TableName("oss_file") @TableName("oss_file")
@@ -16,11 +16,11 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
import org.jeecgframework.poi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import org.quartz.Scheduler; import org.quartz.Scheduler;
import org.quartz.SchedulerException; import org.quartz.SchedulerException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -204,7 +204,7 @@ public class QuartzJobController {
// Step.1 组装查询条件 // Step.1 组装查询条件
QueryWrapper<QuartzJob> queryWrapper = QueryGenerator.initQueryWrapper(quartzJob, request.getParameterMap()); QueryWrapper<QuartzJob> queryWrapper = QueryGenerator.initQueryWrapper(quartzJob, request.getParameterMap());
// Step.2 AutoPoi 导出Excel // Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
List<QuartzJob> pageList = quartzJobService.list(queryWrapper); List<QuartzJob> pageList = quartzJobService.list(queryWrapper);
// 导出文件名称 // 导出文件名称
mv.addObject(JeroController.FILE_NAME, "定时任务列表"); mv.addObject(JeroController.FILE_NAME, "定时任务列表");
@@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.jero.common.aspect.annotation.Dict; import com.jero.common.aspect.annotation.Dict;
import lombok.Data; import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
@@ -52,7 +52,7 @@ public class QuartzJob implements Serializable {
@Excel(name="描述",width=40) @Excel(name="描述",width=40)
private java.lang.String description; private java.lang.String description;
/**状态 0正常 -1停止*/ /**状态 0正常 -1停止*/
@Excel(name="状态",width=15,dicCode="quartz_status") @Excel(name="状态",width=15, dict="quartz_status")
@Dict(dicCode = "quartz_status") @Dict(dicCode = "quartz_status")
private java.lang.Integer status; private java.lang.Integer status;
@@ -19,11 +19,11 @@ import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecgframework.poi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@@ -189,7 +189,7 @@ public class SysCategoryController {
QueryWrapper<SysCategory> queryWrapper = QueryGenerator.initQueryWrapper(sysCategory, request.getParameterMap()); QueryWrapper<SysCategory> queryWrapper = QueryGenerator.initQueryWrapper(sysCategory, request.getParameterMap());
List<SysCategory> pageList = sysCategoryService.list(queryWrapper); List<SysCategory> pageList = sysCategoryService.list(queryWrapper);
// Step.2 AutoPoi 导出Excel // Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
// 过滤选中数据 // 过滤选中数据
String selections = request.getParameter("selections"); String selections = request.getParameter("selections");
if(oConvertUtils.isEmpty(selections)) { if(oConvertUtils.isEmpty(selections)) {
@@ -25,11 +25,11 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecgframework.poi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
@@ -315,7 +315,7 @@ public class SysDepartController {
// Step.1 组装查询条件 // Step.1 组装查询条件
QueryWrapper<SysDepart> queryWrapper = QueryGenerator.initQueryWrapper(sysDepart, request.getParameterMap()); QueryWrapper<SysDepart> queryWrapper = QueryGenerator.initQueryWrapper(sysDepart, request.getParameterMap());
//Step.2 AutoPoi 导出Excel //Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
List<SysDepart> pageList = sysDepartService.list(queryWrapper); List<SysDepart> pageList = sysDepartService.list(queryWrapper);
//按字典排序 //按字典排序
Collections.sort(pageList,(SysDepart arg0, SysDepart arg1)-> arg0.getOrgCode().compareTo(arg1.getOrgCode())); Collections.sort(pageList,(SysDepart arg0, SysDepart arg1)-> arg0.getOrgCode().compareTo(arg1.getOrgCode()));
@@ -32,12 +32,11 @@ import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecgframework.poi.excel.ExcelImportCheckUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.ExcelImportUtil; import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import cn.afterturn.easypoi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
@@ -440,14 +439,14 @@ public class SysDictController {
// Step.1 组装查询条件 // Step.1 组装查询条件
QueryWrapper<SysDict> queryWrapper = QueryGenerator.initQueryWrapper(sysDict, request.getParameterMap()); QueryWrapper<SysDict> queryWrapper = QueryGenerator.initQueryWrapper(sysDict, request.getParameterMap());
//Step.2 AutoPoi 导出Excel //Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
List<SysDictPage> pageList = new ArrayList<>(); List<SysDictPage> pageList = new ArrayList<>();
List<SysDict> sysDictList = sysDictService.list(queryWrapper); List<SysDict> sysDictList = sysDictService.list(queryWrapper);
for (SysDict dictMain : sysDictList) { for (SysDict dictMain : sysDictList) {
SysDictPage vo = new SysDictPage(); SysDictPage vo = new SysDictPage();
BeanUtils.copyProperties(dictMain, vo); BeanUtils.copyProperties(dictMain, vo);
// 查询机票 // 查询子列表
List<SysDictItem> sysDictItemList = sysDictItemService.selectItemsByMainId(dictMain.getId()); List<SysDictItem> sysDictItemList = sysDictItemService.selectItemsByMainId(dictMain.getId());
vo.setSysDictItemList(sysDictItemList); vo.setSysDictItemList(sysDictItemList);
pageList.add(vo); pageList.add(vo);
@@ -478,11 +477,6 @@ public class SysDictController {
params.setHeadRows(2); params.setHeadRows(2);
params.setNeedSave(true); params.setNeedSave(true);
try { try {
//导入Excel格式校验,看匹配的字段文本概率
Boolean t = ExcelImportCheckUtil.check(file.getInputStream(), SysDictPage.class, params);
if(Boolean.FALSE.equals(t)){
throw new JeroBootException("导入Excel校验失败 ");
}
List<SysDictPage> list = ExcelImportUtil.importExcel(file.getInputStream(), SysDictPage.class, params); List<SysDictPage> list = ExcelImportUtil.importExcel(file.getInputStream(), SysDictPage.class, params);
// 错误信息 // 错误信息
List<String> errorMessage = new ArrayList<>(); List<String> errorMessage = new ArrayList<>();
@@ -28,10 +28,10 @@ import com.jero.modules.system.service.ISysPermissionDataRuleService;
import com.jero.modules.system.service.ISysPermissionService; import com.jero.modules.system.service.ISysPermissionService;
import com.jero.modules.system.service.ISysRolePermissionService; import com.jero.modules.system.service.ISysRolePermissionService;
import com.jero.modules.system.service.ISysRoleService; import com.jero.modules.system.service.ISysRoleService;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@@ -238,7 +238,7 @@ public class SysRoleController {
// Step.1 组装查询条件 // Step.1 组装查询条件
QueryWrapper<SysRole> queryWrapper = QueryGenerator.initQueryWrapper(sysRole, request.getParameterMap()); QueryWrapper<SysRole> queryWrapper = QueryGenerator.initQueryWrapper(sysRole, request.getParameterMap());
//Step.2 AutoPoi 导出Excel //Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
List<SysRole> pageList = sysRoleService.list(queryWrapper); List<SysRole> pageList = sysRoleService.list(queryWrapper);
//导出文件名称 //导出文件名称
mv.addObject(JeroController.FILE_NAME,"角色列表"); mv.addObject(JeroController.FILE_NAME,"角色列表");
@@ -13,11 +13,11 @@ import com.jero.modules.system.service.ISysUserAgentService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.jeecgframework.poi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@@ -186,14 +186,13 @@ public class SysUserAgentController {
// Step.1 组装查询条件 // Step.1 组装查询条件
QueryWrapper<SysUserAgent> queryWrapper = QueryGenerator.initQueryWrapper(sysUserAgent, request.getParameterMap()); QueryWrapper<SysUserAgent> queryWrapper = QueryGenerator.initQueryWrapper(sysUserAgent, request.getParameterMap());
//Step.2 AutoPoi 导出Excel //Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
List<SysUserAgent> pageList = sysUserAgentService.list(queryWrapper); List<SysUserAgent> pageList = sysUserAgentService.list(queryWrapper);
//导出文件名称 //导出文件名称
mv.addObject(JeroController.FILE_NAME, "用户代理人设置列表"); mv.addObject(JeroController.FILE_NAME, "用户代理人设置列表");
mv.addObject(JeroController.CLASS, SysUserAgent.class); mv.addObject(JeroController.CLASS, SysUserAgent.class);
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
ExportParams exportParams = new ExportParams("用户代理人设置列表数据", "导出人:"+user.getRealname(), "导出信息"); ExportParams exportParams = new ExportParams("用户代理人设置列表数据", "导出人:"+user.getRealname(), "导出信息");
exportParams.setImageBasePath(upLoadPath);
mv.addObject(JeroController.PARAMS, exportParams); mv.addObject(JeroController.PARAMS, exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, pageList); mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv; return mv;
@@ -40,11 +40,11 @@ import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecgframework.poi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@@ -516,7 +516,7 @@ public class SysUserController {
// Step.1 组装查询条件 // Step.1 组装查询条件
QueryWrapper<SysUser> queryWrapper = QueryGenerator.initQueryWrapper(sysUser, request.getParameterMap()); QueryWrapper<SysUser> queryWrapper = QueryGenerator.initQueryWrapper(sysUser, request.getParameterMap());
//Step.2 AutoPoi 导出Excel //Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
//update-begin--Author:kangxiaolin Date:20180825 for[03]用户导出,如果选择数据则只导出相关数据-------------------- //update-begin--Author:kangxiaolin Date:20180825 for[03]用户导出,如果选择数据则只导出相关数据--------------------
String selections = request.getParameter("selections"); String selections = request.getParameter("selections");
if(!oConvertUtils.isEmpty(selections)){ if(!oConvertUtils.isEmpty(selections)){
@@ -534,7 +534,6 @@ public class SysUserController {
mv.addObject(JeroController.CLASS, SysUser.class); mv.addObject(JeroController.CLASS, SysUser.class);
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
ExportParams exportParams = new ExportParams("用户列表数据", "导出人:"+user.getRealname(), "导出信息"); ExportParams exportParams = new ExportParams("用户列表数据", "导出人:"+user.getRealname(), "导出信息");
exportParams.setImageBasePath(upLoadPath);
mv.addObject(JeroController.PARAMS, exportParams); mv.addObject(JeroController.PARAMS, exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, pageList); mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv; return mv;
@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.jero.common.aspect.annotation.Dict; import com.jero.common.aspect.annotation.Dict;
import lombok.Data; import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
@@ -58,26 +58,26 @@ public class SysAnnouncement implements Serializable {
/** /**
* 优先级(L低,M中,H高) * 优先级(L低,M中,H高)
*/ */
@Excel(name = "优先级", width = 15, dicCode = "priority") @Excel(name = "优先级", width = 15, dict = "priority")
@Dict(dicCode = "priority") @Dict(dicCode = "priority")
private java.lang.String priority; private java.lang.String priority;
/** /**
* 消息类型1:通知公告2:系统消息 * 消息类型1:通知公告2:系统消息
*/ */
@Excel(name = "消息类型", width = 15, dicCode = "msg_category") @Excel(name = "消息类型", width = 15, dict = "msg_category")
@Dict(dicCode = "msg_category") @Dict(dicCode = "msg_category")
private java.lang.String msgCategory; private java.lang.String msgCategory;
/** /**
* 通告对象类型(USER:指定用户,ALL:全体用户) * 通告对象类型(USER:指定用户,ALL:全体用户)
*/ */
@Excel(name = "通告对象类型", width = 15, dicCode = "msg_type") @Excel(name = "通告对象类型", width = 15, dict = "msg_type")
@Dict(dicCode = "msg_type") @Dict(dicCode = "msg_type")
private java.lang.String msgType; private java.lang.String msgType;
/** /**
* 发布状态(0未发布,1已发布,2已撤销) * 发布状态(0未发布,1已发布,2已撤销)
*/ */
@Excel(name = "发布状态", width = 15, dicCode = "send_status") @Excel(name = "发布状态", width = 15, dict = "send_status")
@Dict(dicCode = "send_status") @Dict(dicCode = "send_status")
private java.lang.String sendStatus; private java.lang.String sendStatus;
/** /**
@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
@@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.util.Date;
@@ -10,7 +10,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import com.jero.common.aspect.annotation.Dict; import com.jero.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
/** /**
@@ -54,7 +54,7 @@ public class SysDataSource {
* 数据库类型 * 数据库类型
*/ */
@Dict(dicCode = "database_type") @Dict(dicCode = "database_type")
@Excel(name = "数据库类型", width = 15, dicCode = "database_type") @Excel(name = "数据库类型", width = 15, dict = "database_type")
@ApiModelProperty(value = "数据库类型") @ApiModelProperty(value = "数据库类型")
private java.lang.String dbType; private java.lang.String dbType;
/** /**
@@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import com.jero.common.aspect.annotation.Dict; import com.jero.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
@@ -46,7 +46,7 @@ public class SysDepart implements Serializable {
@Excel(name="描述",width=15) @Excel(name="描述",width=15)
private String description; private String description;
/**机构类别 1公司,2组织机构,2岗位*/ /**机构类别 1公司,2组织机构,2岗位*/
@Excel(name="机构类别",width=15,dicCode="org_category") @Excel(name="机构类别",width=15, dict="org_category")
private String orgCategory; private String orgCategory;
/**机构类型*/ /**机构类型*/
private String orgType; private String orgType;
@@ -8,7 +8,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
/** /**
* @Description: 部门权限表 * @Description: 部门权限表
@@ -6,7 +6,7 @@ import com.jero.common.aspect.annotation.Dict;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
@@ -7,7 +7,7 @@ import com.jero.common.aspect.annotation.Dict;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
@@ -65,7 +65,7 @@ public class SysDictItemCore implements Serializable {
/** /**
* 排序 * 排序
*/ */
@Excel(name = "排序", width = 15,type=4) @Excel(name = "排序", width = 15, type=4)
private Integer sortOrder; private Integer sortOrder;
@@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
/** /**
@@ -10,7 +10,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import com.jero.common.aspect.annotation.Dict; import com.jero.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
@@ -6,7 +6,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
@@ -8,7 +8,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
/** /**
* @Description: 第三方登录账号表 * @Description: 第三方登录账号表
@@ -10,7 +10,7 @@ import com.jero.common.aspect.annotation.Dict;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
@@ -78,7 +78,7 @@ public class SysUser implements Serializable {
/** /**
* 性别(1:男 2:女) * 性别(1:男 2:女)
*/ */
@Excel(name = "性别", width = 15,dicCode="sex") @Excel(name = "性别", width = 15, dict="sex")
@Dict(dicCode = "sex") @Dict(dicCode = "sex")
private Integer sex; private Integer sex;
@@ -108,14 +108,14 @@ public class SysUser implements Serializable {
/** /**
* 状态(1:正常 2:冻结 ) * 状态(1:正常 2:冻结 )
*/ */
@Excel(name = "状态", width = 15,dicCode="user_status") @Excel(name = "状态", width = 15, dict="user_status")
@Dict(dicCode = "user_status") @Dict(dicCode = "user_status")
private Integer status; private Integer status;
/** /**
* 删除状态(0,正常,1已删除) * 删除状态(0,正常,1已删除)
*/ */
@Excel(name = "删除状态", width = 15,dicCode="del_flag") @Excel(name = "删除状态", width = 15, dict="del_flag")
@TableLogic @TableLogic
private Integer delFlag; private Integer delFlag;
@@ -164,7 +164,7 @@ public class SysUser implements Serializable {
/** /**
* 负责部门 * 负责部门
*/ */
@Excel(name="负责部门",width = 15,dictTable ="sys_depart",dicText = "depart_name",dicCode = "id") @Excel(name="负责部门",width = 15, dict ="sys_depart,depart_name,id")
@Dict(dictTable ="sys_depart",dicText = "depart_name",dicCode = "id") @Dict(dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
private String departIds; private String departIds;
@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
@@ -5,7 +5,7 @@ import com.jero.common.api.vo.Results;
import com.jero.common.exception.JeroBootException; import com.jero.common.exception.JeroBootException;
import com.jero.modules.system.entity.SysRole; import com.jero.modules.system.entity.SysRole;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
import org.jeecgframework.poi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
/** /**
@@ -1,26 +1,26 @@
package com.jero.modules.system.service.impl; //package com.jero.modules.system.service.impl;
//
import lombok.extern.slf4j.Slf4j; //import lombok.extern.slf4j.Slf4j;
import com.jero.common.util.CommonUtils; //import com.jero.common.util.CommonUtils;
import org.jeecgframework.poi.excel.imports.base.ImportFileServiceI; //import cn.afterturn.easypoi.excel.imports.base.ImportFileServiceI;
import org.springframework.beans.factory.annotation.Value; //import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; //import org.springframework.stereotype.Service;
//
/** ///**
* excel导入 实现类 // * excel导入 实现类
*/ // */
@Slf4j //@Slf4j
@Service //@Service
public class ImportFileServiceImpl implements ImportFileServiceI { //public class ImportFileServiceImpl implements ImportFileServiceI {
//
@Value("${jero.path.upload}") // @Value("${jero.path.upload}")
private String upLoadPath; // private String upLoadPath;
//
@Value(value="${jero.uploadType}") // @Value(value="${jero.uploadType}")
private String uploadType; // private String uploadType;
//
@Override // @Override
public String doUpload(byte[] data) { // public String doUpload(byte[] data) {
return CommonUtils.uploadOnlineImage(data, upLoadPath, "import", uploadType); // return CommonUtils.uploadOnlineImage(data, upLoadPath, "import", uploadType);
} // }
} //}
@@ -9,8 +9,8 @@ import com.jero.modules.system.entity.SysRole;
import com.jero.modules.system.mapper.SysRoleMapper; import com.jero.modules.system.mapper.SysRoleMapper;
import com.jero.modules.system.mapper.SysUserMapper; import com.jero.modules.system.mapper.SysUserMapper;
import com.jero.modules.system.service.ISysRoleService; import com.jero.modules.system.service.ISysRoleService;
import org.jeecgframework.poi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@@ -2,8 +2,8 @@ package com.jero.modules.system.vo;
import lombok.Data; import lombok.Data;
import com.jero.modules.system.entity.SysDictItem; import com.jero.modules.system.entity.SysDictItem;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelCollection; import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import java.util.List; import java.util.List;
@@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import com.jero.common.aspect.annotation.Dict; import com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@@ -12,11 +12,11 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.jeecgframework.poi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import com.jero.common.api.vo.Results; import com.jero.common.api.vo.Results;
@@ -230,7 +230,7 @@ public class ${entityName}Controller {
} }
// Step.4 AutoPoi 导出Excel // Step.4 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
mv.addObject(NormalExcelConstants.FILE_NAME, "${tableVo.ftlDescription}列表"); mv.addObject(NormalExcelConstants.FILE_NAME, "${tableVo.ftlDescription}列表");
mv.addObject(NormalExcelConstants.CLASS, ${entityName}Page.class); mv.addObject(NormalExcelConstants.CLASS, ${entityName}Page.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("${tableVo.ftlDescription}数据", "导出人:"+sysUser.getRealname(), "${tableVo.ftlDescription}")); mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("${tableVo.ftlDescription}数据", "导出人:"+sysUser.getRealname(), "${tableVo.ftlDescription}"));
@@ -8,7 +8,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import com.jero.common.aspect.annotation.Dict; import com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
@@ -6,9 +6,9 @@ import ${bussiPackage}.${entityPackage}.entity.${entityName};
import ${bussiPackage}.${entityPackage}.entity.${sub.entityName}; import ${bussiPackage}.${entityPackage}.entity.${sub.entityName};
</#list> </#list>
import lombok.Data; import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelEntity; import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import org.jeecgframework.poi.excel.annotation.ExcelCollection; import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.util.Date;
@@ -20,11 +20,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import com.jero.common.system.base.controller.JeroController; import com.jero.common.system.base.controller.JeroController;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import com.jero.common.aspect.annotation.Dict; import com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@@ -27,11 +27,11 @@ import io.swagger.annotations.ApiOperation;
import com.jero.common.aspect.annotation.AutoLog; import com.jero.common.aspect.annotation.AutoLog;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
import org.jeecgframework.poi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.multipart.MultipartHttpServletRequest;
import java.io.IOException; import java.io.IOException;
@@ -250,7 +250,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
} }
// Step.3 AutoPoi 导出Excel // Step.3 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
mv.addObject(NormalExcelConstants.FILE_NAME, "${sub.ftlDescription}"); //此处设置的filename无效 ,前端会重更新设置一下 mv.addObject(NormalExcelConstants.FILE_NAME, "${sub.ftlDescription}"); //此处设置的filename无效 ,前端会重更新设置一下
mv.addObject(NormalExcelConstants.CLASS, ${sub.entityName}.class); mv.addObject(NormalExcelConstants.CLASS, ${sub.entityName}.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("${sub.ftlDescription}报表", "导出人:" + sysUser.getRealname(), "${sub.ftlDescription}")); mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("${sub.ftlDescription}报表", "导出人:" + sysUser.getRealname(), "${sub.ftlDescription}"));
@@ -6,7 +6,7 @@ import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data; import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@@ -10,7 +10,7 @@ import com.jero.common.aspect.annotation.Dict;
import lombok.Data; import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import java.util.Date; import java.util.Date;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@@ -12,11 +12,11 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.jeecgframework.poi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import com.jero.common.api.vo.Results; import com.jero.common.api.vo.Results;
@@ -225,7 +225,7 @@ public class ${entityName}Controller {
} }
// Step.4 AutoPoi 导出Excel // Step.4 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
mv.addObject(NormalExcelConstants.FILE_NAME, "${tableVo.ftlDescription}列表"); mv.addObject(NormalExcelConstants.FILE_NAME, "${tableVo.ftlDescription}列表");
mv.addObject(NormalExcelConstants.CLASS, ${entityName}Page.class); mv.addObject(NormalExcelConstants.CLASS, ${entityName}Page.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("${tableVo.ftlDescription}数据", "导出人:"+sysUser.getRealname(), "${tableVo.ftlDescription}")); mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("${tableVo.ftlDescription}数据", "导出人:"+sysUser.getRealname(), "${tableVo.ftlDescription}"));
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import com.jero.common.aspect.annotation.Dict; import com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import java.util.Date; import java.util.Date;
import com.jero.common.aspect.annotation.Dict; import com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
@@ -6,9 +6,9 @@ import ${bussiPackage}.${entityPackage}.entity.${entityName};
import ${bussiPackage}.${entityPackage}.entity.${sub.entityName}; import ${bussiPackage}.${entityPackage}.entity.${sub.entityName};
</#list> </#list>
import lombok.Data; import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelEntity; import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import org.jeecgframework.poi.excel.annotation.ExcelCollection; import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.util.Date;
@@ -12,11 +12,11 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.jeecgframework.poi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import com.jero.common.api.vo.Results; import com.jero.common.api.vo.Results;
@@ -230,7 +230,7 @@ public class ${entityName}Controller {
} }
// Step.4 AutoPoi 导出Excel // Step.4 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
mv.addObject(NormalExcelConstants.FILE_NAME, "${tableVo.ftlDescription}列表"); mv.addObject(NormalExcelConstants.FILE_NAME, "${tableVo.ftlDescription}列表");
mv.addObject(NormalExcelConstants.CLASS, ${entityName}Page.class); mv.addObject(NormalExcelConstants.CLASS, ${entityName}Page.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("${tableVo.ftlDescription}数据", "导出人:"+sysUser.getRealname(), "${tableVo.ftlDescription}")); mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("${tableVo.ftlDescription}数据", "导出人:"+sysUser.getRealname(), "${tableVo.ftlDescription}"));
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import com.jero.common.aspect.annotation.Dict; import com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import java.util.Date; import java.util.Date;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@@ -6,9 +6,9 @@ import ${bussiPackage}.${entityPackage}.entity.${entityName};
import ${bussiPackage}.${entityPackage}.entity.${sub.entityName}; import ${bussiPackage}.${entityPackage}.entity.${sub.entityName};
</#list> </#list>
import lombok.Data; import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelEntity; import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import org.jeecgframework.poi.excel.annotation.ExcelCollection; import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.util.Date;
@@ -12,11 +12,11 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.jeecgframework.poi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import com.jero.common.api.vo.Results; import com.jero.common.api.vo.Results;
@@ -221,7 +221,7 @@ public class ${entityName}Controller {
} }
// Step.4 AutoPoi 导出Excel // Step.4 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
mv.addObject(NormalExcelConstants.FILE_NAME, "${tableVo.ftlDescription}列表"); mv.addObject(NormalExcelConstants.FILE_NAME, "${tableVo.ftlDescription}列表");
mv.addObject(NormalExcelConstants.CLASS, ${entityName}Page.class); mv.addObject(NormalExcelConstants.CLASS, ${entityName}Page.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("${tableVo.ftlDescription}数据", "导出人:"+sysUser.getRealname(), "${tableVo.ftlDescription}")); mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("${tableVo.ftlDescription}数据", "导出人:"+sysUser.getRealname(), "${tableVo.ftlDescription}"));
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import com.jero.common.aspect.annotation.Dict; import com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import java.util.Date; import java.util.Date;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@@ -6,9 +6,9 @@ import ${bussiPackage}.${entityPackage}.entity.${entityName};
import ${bussiPackage}.${entityPackage}.entity.${sub.entityName}; import ${bussiPackage}.${entityPackage}.entity.${sub.entityName};
</#list> </#list>
import lombok.Data; import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelEntity; import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import org.jeecgframework.poi.excel.annotation.ExcelCollection; import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.util.Date;
@@ -18,11 +18,11 @@ import java.util.Date;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import com.jero.common.system.base.controller.JeroController; import com.jero.common.system.base.controller.JeroController;
import org.jeecgframework.poi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@@ -13,7 +13,7 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
/** /**
* @Description: ${tableVo.ftlDescription} * @Description: ${tableVo.ftlDescription}
@@ -22,11 +22,11 @@ import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import org.jeecgframework.poi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -8,7 +8,7 @@ import lombok.Data;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@@ -12,11 +12,11 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.jeecgframework.poi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import com.jero.common.api.vo.Results; import com.jero.common.api.vo.Results;
import com.jero.common.system.query.QueryGenerator; import com.jero.common.system.query.QueryGenerator;
@@ -200,7 +200,7 @@ public class ${entityName}Controller {
pageList.add(vo); pageList.add(vo);
} }
//Step.3 调用AutoPoi导出Excel //Step.3 调用AutoPoi导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
mv.addObject(NormalExcelConstants.FILE_NAME, "${tableVo.ftlDescription}"); mv.addObject(NormalExcelConstants.FILE_NAME, "${tableVo.ftlDescription}");
mv.addObject(NormalExcelConstants.CLASS, ${entityName}Page.class); mv.addObject(NormalExcelConstants.CLASS, ${entityName}Page.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("${tableVo.ftlDescription}数据", "导出人:"+sysUser.getRealname(), "${tableVo.ftlDescription}")); mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("${tableVo.ftlDescription}数据", "导出人:"+sysUser.getRealname(), "${tableVo.ftlDescription}"));
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import java.util.Date; import java.util.Date;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@@ -6,8 +6,8 @@ import ${bussiPackage}.${entityPackage}.entity.${entityName};
import ${bussiPackage}.${entityPackage}.entity.${sub.entityName}; import ${bussiPackage}.${entityPackage}.entity.${sub.entityName};
</#list> </#list>
import lombok.Data; import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelCollection; import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.util.Date;
@@ -11,11 +11,11 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.jeecgframework.poi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
import com.jero.common.api.vo.Results; import com.jero.common.api.vo.Results;
import com.jero.common.system.query.QueryGenerator; import com.jero.common.system.query.QueryGenerator;
@@ -288,7 +288,7 @@ ${sub.entityName?uncap_first}.get${key}()!=null<#rt/>
pageList.add(vo); pageList.add(vo);
} }
//Step.3 调用AutoPoi导出Excel //Step.3 调用AutoPoi导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
mv.addObject(NormalExcelConstants.FILE_NAME, "${tableVo.ftlDescription}"); mv.addObject(NormalExcelConstants.FILE_NAME, "${tableVo.ftlDescription}");
mv.addObject(NormalExcelConstants.CLASS, ${entityName}Page.class); mv.addObject(NormalExcelConstants.CLASS, ${entityName}Page.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("${tableVo.ftlDescription}数据", "导出人:"+sysUser.getRealname(), "${tableVo.ftlDescription}")); mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("${tableVo.ftlDescription}数据", "导出人:"+sysUser.getRealname(), "${tableVo.ftlDescription}"));
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@@ -6,8 +6,8 @@ import ${bussiPackage}.${entityPackage}.entity.${entityName};
import ${bussiPackage}.${entityPackage}.entity.${sub.entityName}; import ${bussiPackage}.${entityPackage}.entity.${sub.entityName};
</#list> </#list>
import lombok.Data; import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelCollection; import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
+1 -1
View File
@@ -39,7 +39,7 @@
<shiro.version>1.8.0</shiro.version> <shiro.version>1.8.0</shiro.version>
<java-jwt.version>3.11.0</java-jwt.version> <java-jwt.version>3.11.0</java-jwt.version>
<shiro-redis.version>3.1.0</shiro-redis.version> <shiro-redis.version>3.1.0</shiro-redis.version>
<autopoi-web.version>1.3.6</autopoi-web.version> <!-- <autopoi-web.version>1.4.6</autopoi-web.version>-->
<minio.version>8.0.3</minio.version> <minio.version>8.0.3</minio.version>
<justauth-spring-boot-starter.version>1.3.4</justauth-spring-boot-starter.version> <justauth-spring-boot-starter.version>1.3.4</justauth-spring-boot-starter.version>
<dom4j.version>1.6.1</dom4j.version> <dom4j.version>1.6.1</dom4j.version>