|
@@ -27,6 +27,7 @@ import org.jeecg.modules.system.model.SysDepartTreeModel;
|
|
import org.jeecg.modules.system.service.ISysDepartService;
|
|
import org.jeecg.modules.system.service.ISysDepartService;
|
|
import org.jeecg.modules.system.service.ISysUserDepartService;
|
|
import org.jeecg.modules.system.service.ISysUserDepartService;
|
|
import org.jeecg.modules.system.service.ISysUserService;
|
|
import org.jeecg.modules.system.service.ISysUserService;
|
|
|
|
+import org.jeecg.modules.system.util.ExcelImportHandleUtil;
|
|
import org.jeecg.modules.system.vo.SysDepartExportVo;
|
|
import org.jeecg.modules.system.vo.SysDepartExportVo;
|
|
import org.jeecg.modules.system.vo.lowapp.ExportDepartVo;
|
|
import org.jeecg.modules.system.vo.lowapp.ExportDepartVo;
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
@@ -45,6 +46,7 @@ import org.springframework.web.servlet.ModelAndView;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
|
+import java.io.InputStream;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -419,7 +421,8 @@ public class SysDepartController {
|
|
params.setHeadRows(1);
|
|
params.setHeadRows(1);
|
|
params.setNeedSave(true);
|
|
params.setNeedSave(true);
|
|
try {
|
|
try {
|
|
- listSysDeparts = ExcelImportUtil.importExcel(file.getInputStream(), SysDepartExportVo.class, params);
|
|
|
|
|
|
+ InputStream inputStream = ExcelImportHandleUtil.fileStreamProcessing(file, 3, 0);
|
|
|
|
+ listSysDeparts = ExcelImportUtil.importExcel(inputStream, SysDepartExportVo.class, params);
|
|
sysDepartService.initializationImportSysDepart(listSysDeparts, errorMessageList);
|
|
sysDepartService.initializationImportSysDepart(listSysDeparts, errorMessageList);
|
|
return ImportExcelUtil.imporReturnRes(errorMessageList.size(), listSysDeparts.size() - errorMessageList.size(), errorMessageList);
|
|
return ImportExcelUtil.imporReturnRes(errorMessageList.size(), listSysDeparts.size() - errorMessageList.size(), errorMessageList);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -504,7 +507,8 @@ public class SysDepartController {
|
|
//update-end---author:wangshuai---date:2023-10-20---for: 注释掉原来的导入部门的逻辑---
|
|
//update-end---author:wangshuai---date:2023-10-20---for: 注释掉原来的导入部门的逻辑---
|
|
|
|
|
|
//update-begin---author:wangshuai---date:2023-10-19---for:【QQYUN-5482】系统的部门导入导出也可以改成敲敲云模式的部门路径---
|
|
//update-begin---author:wangshuai---date:2023-10-19---for:【QQYUN-5482】系统的部门导入导出也可以改成敲敲云模式的部门路径---
|
|
- listSysDeparts = ExcelImportUtil.importExcel(file.getInputStream(), SysDepartExportVo.class, params);
|
|
|
|
|
|
+ InputStream inputStream = ExcelImportHandleUtil.fileStreamProcessing(file, 3, 0);
|
|
|
|
+ listSysDeparts = ExcelImportUtil.importExcel(inputStream, SysDepartExportVo.class, params);
|
|
sysDepartService.importSysDepart(listSysDeparts,errorMessageList);
|
|
sysDepartService.importSysDepart(listSysDeparts,errorMessageList);
|
|
//update-end---author:wangshuai---date:2023-10-19---for:【QQYUN-5482】系统的部门导入导出也可以改成敲敲云模式的部门路径---
|
|
//update-end---author:wangshuai---date:2023-10-19---for:【QQYUN-5482】系统的部门导入导出也可以改成敲敲云模式的部门路径---
|
|
|
|
|
|
@@ -700,7 +704,8 @@ public class SysDepartController {
|
|
params.setHeadRows(1);
|
|
params.setHeadRows(1);
|
|
params.setNeedSave(true);
|
|
params.setNeedSave(true);
|
|
try {
|
|
try {
|
|
- listSysDeparts = ExcelImportUtil.importExcel(file.getInputStream(), ExportDepartVo.class, params);
|
|
|
|
|
|
+ InputStream inputStream = ExcelImportHandleUtil.fileStreamProcessing(file, 3, 0);
|
|
|
|
+ listSysDeparts = ExcelImportUtil.importExcel(inputStream, ExportDepartVo.class, params);
|
|
sysDepartService.importExcel(listSysDeparts,errorMessageList);
|
|
sysDepartService.importExcel(listSysDeparts,errorMessageList);
|
|
//清空部门缓存
|
|
//清空部门缓存
|
|
Set keys3 = redisTemplate.keys(CacheConstant.SYS_DEPARTS_CACHE + "*");
|
|
Set keys3 = redisTemplate.keys(CacheConstant.SYS_DEPARTS_CACHE + "*");
|