Merge remote-tracking branch 'origin/master'

This commit is contained in:
zer0Black
2023-11-26 12:00:47 +08:00
94 changed files with 577 additions and 513 deletions
@@ -2,7 +2,7 @@ package com.jero.modules.message.entity;
import com.jero.common.aspect.annotation.Dict;
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 com.baomidou.mybatisplus.annotation.TableName;
@@ -1,7 +1,7 @@
package com.jero.modules.message.entity;
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;
@@ -5,7 +5,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.jero.common.system.base.entity.JeroEntity;
import org.jeecgframework.poi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
@Data
@TableName("oss_file")
@@ -9,6 +9,8 @@ import com.jero.common.constant.CommonConstant;
import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.query.QueryGenerator;
import com.jero.common.util.ImportExcelUtil;
import com.jero.common.util.SpringContextUtils;
import com.jero.config.easypoi.EasyPoiDictHandlerImpl;
import com.jero.modules.quartz.entity.QuartzJob;
import com.jero.modules.quartz.service.IQuartzJobService;
import io.swagger.annotations.Api;
@@ -16,11 +18,11 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.springframework.beans.factory.annotation.Autowired;
@@ -204,12 +206,14 @@ public class QuartzJobController {
// Step.1 组装查询条件
QueryWrapper<QuartzJob> queryWrapper = QueryGenerator.initQueryWrapper(quartzJob, request.getParameterMap());
// Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
List<QuartzJob> pageList = quartzJobService.list(queryWrapper);
// 导出文件名称
mv.addObject(JeroController.FILE_NAME, "定时任务列表");
mv.addObject(JeroController.CLASS, QuartzJob.class);
mv.addObject(JeroController.PARAMS, new ExportParams("定时任务列表数据", "导出人:Jero", "导出信息"));
ExportParams exportParams = new ExportParams("定时任务列表数据", "导出人:Jero", "导出信息");
exportParams.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
mv.addObject(JeroController.PARAMS, exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
@@ -232,6 +236,7 @@ public class QuartzJobController {
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
@@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jero.common.aspect.annotation.Dict;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
@@ -52,7 +52,7 @@ public class QuartzJob implements Serializable {
@Excel(name="描述",width=40)
private java.lang.String description;
/**状态 0正常 -1停止*/
@Excel(name="状态",width=15,dicCode="quartz_status")
@Excel(name="状态",width=15, dict="quartz_status")
@Dict(dicCode = "quartz_status")
private java.lang.Integer status;
@@ -10,7 +10,9 @@ import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.query.QueryGenerator;
import com.jero.common.system.vo.DictModel;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.SpringContextUtils;
import com.jero.common.util.oConvertUtils;
import com.jero.config.easypoi.EasyPoiDictHandlerImpl;
import com.jero.modules.system.entity.SysCategory;
import com.jero.modules.system.model.TreeSelectModel;
import com.jero.modules.system.service.ISysCategoryService;
@@ -19,11 +21,11 @@ import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -189,7 +191,7 @@ public class SysCategoryController {
QueryWrapper<SysCategory> queryWrapper = QueryGenerator.initQueryWrapper(sysCategory, request.getParameterMap());
List<SysCategory> pageList = sysCategoryService.list(queryWrapper);
// Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
// 过滤选中数据
String selections = request.getParameter("selections");
if(oConvertUtils.isEmpty(selections)) {
@@ -203,7 +205,9 @@ public class SysCategoryController {
mv.addObject(JeroController.FILE_NAME, "分类字典列表");
mv.addObject(JeroController.CLASS, SysCategory.class);
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
mv.addObject(JeroController.PARAMS, new ExportParams("分类字典列表数据", "导出人:"+user.getRealname(), "导出信息"));
ExportParams exportParams = new ExportParams("分类字典列表数据", "导出人:"+user.getRealname(), "导出信息");
exportParams.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
mv.addObject(JeroController.PARAMS, exportParams);
return mv;
}
@@ -12,8 +12,10 @@ import com.jero.common.system.util.JwtUtil;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.system.vo.SysDepartTreeModel;
import com.jero.common.util.ImportExcelUtil;
import com.jero.common.util.SpringContextUtils;
import com.jero.common.util.YouBianCodeUtil;
import com.jero.common.util.oConvertUtils;
import com.jero.config.easypoi.EasyPoiDictHandlerImpl;
import com.jero.modules.system.entity.SysDepart;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.mapper.SysDepartMapper;
@@ -25,11 +27,11 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.data.redis.core.RedisTemplate;
@@ -315,7 +317,7 @@ public class SysDepartController {
// Step.1 组装查询条件
QueryWrapper<SysDepart> queryWrapper = QueryGenerator.initQueryWrapper(sysDepart, request.getParameterMap());
//Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
List<SysDepart> pageList = sysDepartService.list(queryWrapper);
//按字典排序
Collections.sort(pageList,(SysDepart arg0, SysDepart arg1)-> arg0.getOrgCode().compareTo(arg1.getOrgCode()));
@@ -323,7 +325,9 @@ public class SysDepartController {
mv.addObject(JeroController.FILE_NAME, "部门列表");
mv.addObject(JeroController.CLASS, SysDepart.class);
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
mv.addObject(JeroController.PARAMS, new ExportParams("部门列表数据", "导出人:"+user.getRealname(), "导出信息"));
ExportParams exportParams = new ExportParams("部门列表数据", "导出人:"+user.getRealname(), "导出信息");
exportParams.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
mv.addObject(JeroController.PARAMS, exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
@@ -348,6 +352,7 @@ public class SysDepartController {
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
@@ -15,8 +15,10 @@ import com.jero.common.system.query.QueryGenerator;
import com.jero.common.system.vo.DictModel;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.ImportExcelUtil;
import com.jero.common.util.SpringContextUtils;
import com.jero.common.util.SqlInjectionUtil;
import com.jero.common.util.oConvertUtils;
import com.jero.config.easypoi.EasyPoiDictHandlerImpl;
import com.jero.modules.system.entity.SuccessAndErrorLines;
import com.jero.modules.system.entity.SysDict;
import com.jero.modules.system.entity.SysDictItem;
@@ -32,12 +34,11 @@ import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecgframework.poi.excel.ExcelImportCheckUtil;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
@@ -440,14 +441,14 @@ public class SysDictController {
// Step.1 组装查询条件
QueryWrapper<SysDict> queryWrapper = QueryGenerator.initQueryWrapper(sysDict, request.getParameterMap());
//Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
List<SysDictPage> pageList = new ArrayList<>();
List<SysDict> sysDictList = sysDictService.list(queryWrapper);
for (SysDict dictMain : sysDictList) {
SysDictPage vo = new SysDictPage();
BeanUtils.copyProperties(dictMain, vo);
// 查询机票
// 查询子列表
List<SysDictItem> sysDictItemList = sysDictItemService.selectItemsByMainId(dictMain.getId());
vo.setSysDictItemList(sysDictItemList);
pageList.add(vo);
@@ -459,7 +460,9 @@ public class SysDictController {
mv.addObject(JeroController.CLASS, SysDictPage.class);
// 自定义表格参数
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
mv.addObject(JeroController.PARAMS, new ExportParams("数据字典列表", "导出人:"+user.getRealname(), "数据字典"));
ExportParams exportParams = new ExportParams("数据字典列表", "导出人:"+user.getRealname(), "数据字典");
exportParams.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
mv.addObject(JeroController.PARAMS, exportParams);
// 导出数据列表
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
@@ -474,15 +477,11 @@ public class SysDictController {
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
params.setTitleRows(2);
params.setHeadRows(2);
params.setNeedSave(true);
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<String> errorMessage = new ArrayList<>();
@@ -13,6 +13,8 @@ import javax.servlet.http.HttpServletResponse;
import com.jero.common.api.vo.Results;
import com.jero.common.system.base.controller.JeroController;
import com.jero.common.util.SpringContextUtils;
import com.jero.config.easypoi.EasyPoiDictHandlerImpl;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -28,10 +30,10 @@ import com.jero.modules.system.service.ISysPermissionDataRuleService;
import com.jero.modules.system.service.ISysPermissionService;
import com.jero.modules.system.service.ISysRolePermissionService;
import com.jero.modules.system.service.ISysRoleService;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -238,13 +240,15 @@ public class SysRoleController {
// Step.1 组装查询条件
QueryWrapper<SysRole> queryWrapper = QueryGenerator.initQueryWrapper(sysRole, request.getParameterMap());
//Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
List<SysRole> pageList = sysRoleService.list(queryWrapper);
//导出文件名称
mv.addObject(JeroController.FILE_NAME,"角色列表");
mv.addObject(JeroController.CLASS,SysRole.class);
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
mv.addObject(JeroController.PARAMS,new ExportParams("角色列表数据","导出人:"+user.getRealname(),"导出信息"));
ExportParams exportParams = new ExportParams("角色列表数据","导出人:"+user.getRealname(),"导出信息");
exportParams.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
mv.addObject(JeroController.PARAMS, exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST,pageList);
return mv;
}
@@ -263,6 +267,7 @@ public class SysRoleController {
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
@@ -8,16 +8,18 @@ import com.jero.common.api.vo.Results;
import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.query.QueryGenerator;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.SpringContextUtils;
import com.jero.config.easypoi.EasyPoiDictHandlerImpl;
import com.jero.modules.system.entity.SysUserAgent;
import com.jero.modules.system.service.ISysUserAgentService;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.apache.shiro.SecurityUtils;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
@@ -186,14 +188,14 @@ public class SysUserAgentController {
// Step.1 组装查询条件
QueryWrapper<SysUserAgent> queryWrapper = QueryGenerator.initQueryWrapper(sysUserAgent, request.getParameterMap());
//Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
List<SysUserAgent> pageList = sysUserAgentService.list(queryWrapper);
//导出文件名称
mv.addObject(JeroController.FILE_NAME, "用户代理人设置列表");
mv.addObject(JeroController.CLASS, SysUserAgent.class);
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
ExportParams exportParams = new ExportParams("用户代理人设置列表数据", "导出人:"+user.getRealname(), "导出信息");
exportParams.setImageBasePath(upLoadPath);
exportParams.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
mv.addObject(JeroController.PARAMS, exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
@@ -214,6 +216,7 @@ public class SysUserAgentController {
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
@@ -21,6 +21,7 @@ import com.jero.common.system.query.QueryGenerator;
import com.jero.common.system.util.JwtUtil;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.*;
import com.jero.config.easypoi.EasyPoiDictHandlerImpl;
import com.jero.modules.base.service.BaseCommonService;
import com.jero.modules.system.dto.SysUserDTO;
import com.jero.modules.system.dto.SysUserRoleDTO;
@@ -40,11 +41,11 @@ import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -57,6 +58,7 @@ import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
@@ -210,7 +212,7 @@ public class SysUserController {
// 密码加盐
String password = CommonUtils.decryptBtRsaPriKey(user.getPassword(), rsaPrivateKey);
user.setCreateTime(new Date());//设置创建时间
String salt = oConvertUtils.randomGen(8);
String salt = RandomUtil.randomString(8);
user.setSalt(salt);
String passwordEncode = PasswordUtil.encrypt(user.getUsername(), password, salt);
user.setPassword(passwordEncode);
@@ -516,7 +518,7 @@ public class SysUserController {
// Step.1 组装查询条件
QueryWrapper<SysUser> queryWrapper = QueryGenerator.initQueryWrapper(sysUser, request.getParameterMap());
//Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
//update-begin--Author:kangxiaolin Date:20180825 for[03]用户导出,如果选择数据则只导出相关数据--------------------
String selections = request.getParameter("selections");
if(!oConvertUtils.isEmpty(selections)){
@@ -534,7 +536,7 @@ public class SysUserController {
mv.addObject(JeroController.CLASS, SysUser.class);
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
ExportParams exportParams = new ExportParams("用户列表数据", "导出人:"+user.getRealname(), "导出信息");
exportParams.setImageBasePath(upLoadPath);
exportParams.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
mv.addObject(JeroController.PARAMS, exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
@@ -559,6 +561,7 @@ public class SysUserController {
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
@@ -571,7 +574,7 @@ public class SysUserController {
sysUserExcel.setPassword("hzwlsoft.com");
}
// 密码加密加盐
String salt = oConvertUtils.randomGen(8);
String salt = RandomUtil.randomString(8);
sysUserExcel.setSalt(salt);
String passwordEncode = PasswordUtil.encrypt(sysUserExcel.getUsername(), sysUserExcel.getPassword(), salt);
sysUserExcel.setPassword(passwordEncode);
@@ -695,19 +698,19 @@ public class SysUserController {
String oldpassword = json.getString("oldpassword");
String password = json.getString("password");
String confirmpassword = json.getString("confirmpassword");
String RSAPublicKey = json.getString(RSA_PUBLIC_KEY);
String rsaPublicKey = json.getString(RSA_PUBLIC_KEY);
LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
if(!sysUser.getUsername().equals(username)){
return Results.error("只允许修改自己的密码!");
}
String RSAPrivateKey = String.valueOf(redisUtil.get(RSAPublicKey));
String rsaPrivateKey = String.valueOf(redisUtil.get(rsaPublicKey));
try {
oldpassword = CommonUtils.decryptBtRsaPriKey(oldpassword, RSAPrivateKey);
password = CommonUtils.decryptBtRsaPriKey(password, RSAPrivateKey);
confirmpassword = CommonUtils.decryptBtRsaPriKey(confirmpassword, RSAPrivateKey);
oldpassword = CommonUtils.decryptBtRsaPriKey(oldpassword, rsaPrivateKey);
password = CommonUtils.decryptBtRsaPriKey(password, rsaPrivateKey);
confirmpassword = CommonUtils.decryptBtRsaPriKey(confirmpassword, rsaPrivateKey);
}catch (Exception e){
SysUserController.log.error(e.getMessage(),e);
}
@@ -1025,7 +1028,7 @@ public class SysUserController {
try {
user.setCreateTime(new Date());// 设置创建时间
String salt = oConvertUtils.randomGen(8);
String salt = RandomUtil.randomString(8);
String passwordEncode = PasswordUtil.encrypt(username, password, salt);
user.setSalt(salt);
user.setUsername(username);
@@ -1105,7 +1108,7 @@ public class SysUserController {
result.setSuccess(false);
return result;
} else {
String salt = oConvertUtils.randomGen(8);
String salt = RandomUtil.randomString(8);
sysUser.setSalt(salt);
String passwordEncode = PasswordUtil.encrypt(sysUser.getUsername(), password, salt);
sysUser.setPassword(passwordEncode);
@@ -1231,7 +1234,7 @@ public class SysUserController {
/**
* 彻底删除用户
*
* @param userIds 被删除的用户ID,多个id用半角逗号分割
* @param sysUser
* @return
*/
@PostMapping("/deleteRecycleBin")
@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jero.common.aspect.annotation.Dict;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
@@ -58,26 +58,26 @@ public class SysAnnouncement implements Serializable {
/**
* 优先级(L低,M中,H高)
*/
@Excel(name = "优先级", width = 15, dicCode = "priority")
@Excel(name = "优先级", width = 15, dict = "priority")
@Dict(dicCode = "priority")
private java.lang.String priority;
/**
* 消息类型1:通知公告2:系统消息
*/
@Excel(name = "消息类型", width = 15, dicCode = "msg_category")
@Excel(name = "消息类型", width = 15, dict = "msg_category")
@Dict(dicCode = "msg_category")
private java.lang.String msgCategory;
/**
* 通告对象类型(USER:指定用户,ALL:全体用户)
*/
@Excel(name = "通告对象类型", width = 15, dicCode = "msg_type")
@Excel(name = "通告对象类型", width = 15, dict = "msg_type")
@Dict(dicCode = "msg_type")
private java.lang.String msgType;
/**
* 发布状态(0未发布,1已发布,2已撤销)
*/
@Excel(name = "发布状态", width = 15, dicCode = "send_status")
@Excel(name = "发布状态", width = 15, dict = "send_status")
@Dict(dicCode = "send_status")
private java.lang.String sendStatus;
/**
@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
@@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
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 java.util.Date;
@@ -10,7 +10,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
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;
/**
@@ -54,7 +54,7 @@ public class SysDataSource {
* 数据库类型
*/
@Dict(dicCode = "database_type")
@Excel(name = "数据库类型", width = 15, dicCode = "database_type")
@Excel(name = "数据库类型", width = 15, dict = "database_type")
@ApiModelProperty(value = "数据库类型")
private java.lang.String dbType;
/**
@@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
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 java.io.Serializable;
@@ -46,7 +46,7 @@ public class SysDepart implements Serializable {
@Excel(name="描述",width=15)
private String description;
/**机构类别 1公司,2组织机构,2岗位*/
@Excel(name="机构类别",width=15,dicCode="org_category")
@Excel(name="机构类别",width=15, dict="org_category")
private String orgCategory;
/**机构类型*/
private String orgType;
@@ -8,7 +8,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
/**
* @Description: 部门权限表
@@ -6,7 +6,7 @@ import com.jero.common.aspect.annotation.Dict;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import java.io.Serializable;
import java.util.Date;
@@ -58,7 +58,7 @@ public class SysDictItem implements Serializable {
/**
* 排序
*/
@Excel(name = "排序", width = 15,type=4)
@Excel(name = "排序", width = 15,type = 10)
private Integer sortOrder;
@@ -7,7 +7,7 @@ import com.jero.common.aspect.annotation.Dict;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import java.io.Serializable;
import java.util.Date;
@@ -65,7 +65,7 @@ public class SysDictItemCore implements Serializable {
/**
* 排序
*/
@Excel(name = "排序", width = 15,type=4)
@Excel(name = "排序", width = 15, type = 10)
private Integer sortOrder;
@@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
/**
@@ -10,7 +10,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
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 java.io.Serializable;
@@ -6,7 +6,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
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 java.io.Serializable;
@@ -8,7 +8,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
/**
* @Description: 第三方登录账号表
@@ -10,7 +10,7 @@ import com.jero.common.aspect.annotation.Dict;
import lombok.Data;
import lombok.EqualsAndHashCode;
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 java.io.Serializable;
@@ -78,7 +78,7 @@ public class SysUser implements Serializable {
/**
* 性别(1:男 2:女)
*/
@Excel(name = "性别", width = 15,dicCode="sex")
@Excel(name = "性别", width = 15, dict="sex")
@Dict(dicCode = "sex")
private Integer sex;
@@ -108,14 +108,14 @@ public class SysUser implements Serializable {
/**
* 状态(1:正常 2:冻结 )
*/
@Excel(name = "状态", width = 15,dicCode="user_status")
@Excel(name = "状态", width = 15, dict="user_status")
@Dict(dicCode = "user_status")
private Integer status;
/**
* 删除状态(0,正常,1已删除)
*/
@Excel(name = "删除状态", width = 15,dicCode="del_flag")
@Excel(name = "删除状态", width = 15, dict="del_flag")
@TableLogic
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")
private String departIds;
@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
@@ -5,7 +5,7 @@ import com.jero.common.api.vo.Results;
import com.jero.common.exception.JeroBootException;
import com.jero.modules.system.entity.SysRole;
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;
/**
@@ -1,26 +1,26 @@
package com.jero.modules.system.service.impl;
import lombok.extern.slf4j.Slf4j;
import com.jero.common.util.CommonUtils;
import org.jeecgframework.poi.excel.imports.base.ImportFileServiceI;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
/**
* excel导入 实现类
*/
@Slf4j
@Service
public class ImportFileServiceImpl implements ImportFileServiceI {
@Value("${jero.path.upload}")
private String upLoadPath;
@Value(value="${jero.uploadType}")
private String uploadType;
@Override
public String doUpload(byte[] data) {
return CommonUtils.uploadOnlineImage(data, upLoadPath, "import", uploadType);
}
}
//package com.jero.modules.system.service.impl;
//
//import lombok.extern.slf4j.Slf4j;
//import com.jero.common.util.CommonUtils;
//import cn.afterturn.easypoi.excel.imports.base.ImportFileServiceI;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.stereotype.Service;
//
///**
// * excel导入 实现类
// */
//@Slf4j
//@Service
//public class ImportFileServiceImpl implements ImportFileServiceI {
//
// @Value("${jero.path.upload}")
// private String upLoadPath;
//
// @Value(value="${jero.uploadType}")
// private String uploadType;
//
// @Override
// public String doUpload(byte[] data) {
// 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.SysUserMapper;
import com.jero.modules.system.service.ISysRoleService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -1,5 +1,6 @@
package com.jero.modules.system.service.impl;
import cn.hutool.core.util.RandomUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.constant.CommonConstant;
@@ -71,7 +72,7 @@ public class SysThirdAccountServiceImpl extends ServiceImpl<SysThirdAccountMappe
user.setUsername(thirdUserUuid);
user.setPhone(phone);
//设置初始密码
String salt = oConvertUtils.randomGen(8);
String salt = RandomUtil.randomString(8);
user.setSalt(salt);
String passwordEncode = PasswordUtil.encrypt(user.getUsername(), "123456", salt);
user.setPassword(passwordEncode);
@@ -1,5 +1,6 @@
package com.jero.modules.system.service.impl;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -95,7 +96,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
@Override
@CacheEvict(value = {CacheConstant.SYS_USERS_CACHE}, allEntries = true)
public Results<T> changePassword(SysUser sysUser) {
String salt = oConvertUtils.randomGen(8);
String salt = RandomUtil.randomString(8);
sysUser.setSalt(salt);
String password = sysUser.getPassword();
String passwordEncode = PasswordUtil.encrypt(sysUser.getUsername(), password, salt);
@@ -2,8 +2,8 @@ package com.jero.modules.system.vo;
import lombok.Data;
import com.jero.modules.system.entity.SysDictItem;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelCollection;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import java.util.List;
@@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -12,11 +12,11 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import com.jero.common.system.vo.LoginUser;
import org.apache.shiro.SecurityUtils;
import com.jero.common.api.vo.Results;
@@ -230,10 +230,13 @@ public class ${entityName}Controller {
}
// 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.CLASS, ${entityName}Page.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("${tableVo.ftlDescription}数据", "导出人:"+sysUser.getRealname(), "${tableVo.ftlDescription}"));
ExportParams exportParams = new ExportParams("${tableVo.ftlDescription}数据", "导出人:"+sysUser.getRealname(), "${tableVo.ftlDescription}");
exportParams.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
mv.addObject(NormalExcelConstants.PARAMS, exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
@@ -252,6 +255,7 @@ public class ${entityName}Controller {
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
@@ -8,7 +8,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
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.ApiModelProperty;
import java.io.UnsupportedEncodingException;
@@ -6,9 +6,9 @@ import ${bussiPackage}.${entityPackage}.entity.${entityName};
import ${bussiPackage}.${entityPackage}.entity.${sub.entityName};
</#list>
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelEntity;
import org.jeecgframework.poi.excel.annotation.ExcelCollection;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@@ -20,11 +20,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import com.jero.common.system.base.controller.JeroController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -27,11 +27,11 @@ import io.swagger.annotations.ApiOperation;
import com.jero.common.aspect.annotation.AutoLog;
import org.apache.shiro.SecurityUtils;
import com.jero.common.system.vo.LoginUser;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import java.io.IOException;
@@ -250,10 +250,13 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
}
// 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.CLASS, ${sub.entityName}.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("${sub.ftlDescription}报表", "导出人:" + sysUser.getRealname(), "${sub.ftlDescription}"));
ExportParams exportParams = new ExportParams("${sub.ftlDescription}报表", "导出人:" + sysUser.getRealname(), "${sub.ftlDescription}");
exportParams.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
mv.addObject(NormalExcelConstants.PARAMS, exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
return mv;
}
@@ -269,6 +272,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
@@ -6,7 +6,7 @@ import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import org.jeecgframework.poi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
@@ -10,7 +10,7 @@ import com.jero.common.aspect.annotation.Dict;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -12,11 +12,11 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import com.jero.common.system.vo.LoginUser;
import org.apache.shiro.SecurityUtils;
import com.jero.common.api.vo.Results;
@@ -225,10 +225,13 @@ public class ${entityName}Controller {
}
// 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.CLASS, ${entityName}Page.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("${tableVo.ftlDescription}数据", "导出人:"+sysUser.getRealname(), "${tableVo.ftlDescription}"));
ExportParams exportParams = new ExportParams("${tableVo.ftlDescription}数据", "导出人:"+sysUser.getRealname(), "${tableVo.ftlDescription}");
exportParams.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
mv.addObject(NormalExcelConstants.PARAMS, exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
@@ -247,6 +250,7 @@ public class ${entityName}Controller {
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
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 com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
@@ -6,9 +6,9 @@ import ${bussiPackage}.${entityPackage}.entity.${entityName};
import ${bussiPackage}.${entityPackage}.entity.${sub.entityName};
</#list>
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelEntity;
import org.jeecgframework.poi.excel.annotation.ExcelCollection;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@@ -12,11 +12,11 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import com.jero.common.system.vo.LoginUser;
import org.apache.shiro.SecurityUtils;
import com.jero.common.api.vo.Results;
@@ -230,10 +230,13 @@ public class ${entityName}Controller {
}
// 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.CLASS, ${entityName}Page.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("${tableVo.ftlDescription}数据", "导出人:"+sysUser.getRealname(), "${tableVo.ftlDescription}"));
ExportParams exportParams = new ExportParams("${tableVo.ftlDescription}数据", "导出人:"+sysUser.getRealname(), "${tableVo.ftlDescription}");
exportParams.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
mv.addObject(NormalExcelConstants.PARAMS, exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
@@ -252,6 +255,7 @@ public class ${entityName}Controller {
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -6,9 +6,9 @@ import ${bussiPackage}.${entityPackage}.entity.${entityName};
import ${bussiPackage}.${entityPackage}.entity.${sub.entityName};
</#list>
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelEntity;
import org.jeecgframework.poi.excel.annotation.ExcelCollection;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@@ -12,11 +12,11 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import com.jero.common.system.vo.LoginUser;
import org.apache.shiro.SecurityUtils;
import com.jero.common.api.vo.Results;
@@ -221,10 +221,13 @@ public class ${entityName}Controller {
}
// 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.CLASS, ${entityName}Page.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("${tableVo.ftlDescription}数据", "导出人:"+sysUser.getRealname(), "${tableVo.ftlDescription}"));
ExportParams exportParams = new ExportParams("${tableVo.ftlDescription}数据", "导出人:"+sysUser.getRealname(), "${tableVo.ftlDescription}");
exportParams.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
mv.addObject(NormalExcelConstants.PARAMS, exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
@@ -243,6 +246,7 @@ public class ${entityName}Controller {
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -6,9 +6,9 @@ import ${bussiPackage}.${entityPackage}.entity.${entityName};
import ${bussiPackage}.${entityPackage}.entity.${sub.entityName};
</#list>
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelEntity;
import org.jeecgframework.poi.excel.annotation.ExcelCollection;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@@ -18,11 +18,11 @@ import java.util.Date;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.extern.slf4j.Slf4j;
import com.jero.common.system.base.controller.JeroController;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -13,7 +13,7 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
/**
* @Description: ${tableVo.ftlDescription}
@@ -22,11 +22,11 @@ import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -8,7 +8,7 @@ import lombok.Data;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
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.ApiModelProperty;
@@ -12,11 +12,11 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.jero.common.system.vo.LoginUser;
import org.apache.shiro.SecurityUtils;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import com.jero.common.api.vo.Results;
import com.jero.common.system.query.QueryGenerator;
@@ -200,10 +200,13 @@ public class ${entityName}Controller {
pageList.add(vo);
}
//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.CLASS, ${entityName}Page.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("${tableVo.ftlDescription}数据", "导出人:"+sysUser.getRealname(), "${tableVo.ftlDescription}"));
ExportParams exportParams = new ExportParams("${tableVo.ftlDescription}数据", "导出人:"+sysUser.getRealname(), "${tableVo.ftlDescription}");
exportParams.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
mv.addObject(NormalExcelConstants.PARAMS, exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
@@ -222,6 +225,7 @@ public class ${entityName}Controller {
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -6,8 +6,8 @@ import ${bussiPackage}.${entityPackage}.entity.${entityName};
import ${bussiPackage}.${entityPackage}.entity.${sub.entityName};
</#list>
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelCollection;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@@ -11,11 +11,11 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.SecurityUtils;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.api.vo.Results;
import com.jero.common.system.query.QueryGenerator;
@@ -288,10 +288,13 @@ ${sub.entityName?uncap_first}.get${key}()!=null<#rt/>
pageList.add(vo);
}
//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.CLASS, ${entityName}Page.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("${tableVo.ftlDescription}数据", "导出人:"+sysUser.getRealname(), "${tableVo.ftlDescription}"));
ExportParams exportParams = new ExportParams("${tableVo.ftlDescription}数据", "导出人:"+sysUser.getRealname(), "${tableVo.ftlDescription}");
exportParams.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
mv.addObject(NormalExcelConstants.PARAMS, exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
@@ -310,6 +313,7 @@ ${sub.entityName?uncap_first}.get${key}()!=null<#rt/>
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
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.ApiModelProperty;
@@ -6,8 +6,8 @@ import ${bussiPackage}.${entityPackage}.entity.${entityName};
import ${bussiPackage}.${entityPackage}.entity.${sub.entityName};
</#list>
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelCollection;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import io.swagger.annotations.ApiModel;