diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..25b312e
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,18 @@
+# http://editorconfig.org
+root = true
+
+# 空格替代Tab缩进在各种编辑工具下效果一致
+[*]
+indent_style = space
+indent_size = 4
+charset = utf-8
+end_of_line = lf
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.{json,yml,yaml}]
+indent_size = 2
+
+[*.md]
+insert_final_newline = false
+trim_trailing_whitespace = false
diff --git a/pom.xml b/pom.xml
index 6a95a85..7594b36 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,8 +28,8 @@
1.4.6
5.3.3
2.0.34
- 6.4.3
- 2.11.0
+ 6.4.4
+ 2.13.0
3.2.2
5.2.3
3.3.2
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/CaptchaController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/CaptchaController.java
index 99a0dc6..9cbfe3e 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/CaptchaController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/CaptchaController.java
@@ -70,11 +70,6 @@ public class CaptchaController
}
RedisUtils.setCacheObject(verifyKey, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
-// AjaxResult ajax = AjaxResult.success();
-// ajax.put("uuid", uuid);
-// ajax.put("img", captcha.getImageBase64());
-// return ajax;
-
captchaVo.setUuid(uuid);
captchaVo.setImg(captcha.getImageBase64());
return AjaxResult.success(captchaVo);
diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml
index d222cfc..cf0206c 100644
--- a/ruoyi-admin/src/main/resources/application.yml
+++ b/ruoyi-admin/src/main/resources/application.yml
@@ -118,7 +118,7 @@ pagehelper:
# SpringDoc配置
springdoc:
#需要扫描的包,可以配置多个,使用逗号分割
- packages-to-scan: com.ruoyi.demo
+ packages-to-scan: com.ruoyi
paths-to-exclude: #配置不包含在swagger文档中的api
- /api/test/**
- /api/mockito/data
@@ -145,13 +145,22 @@ springdoc:
name: 数据小王子
email: 738981257@qq.com
url: https://gitee.com/dataprince/ruoyi-flex
- components:
+ components:
# 鉴权方式配置
- security-schemes:
- apiKey:
- type: APIKEY
- in: HEADER
- name: ${sa-token.token-name}
+ security-schemes:
+ apiKey:
+ type: APIKEY
+ in: HEADER
+ name: ${sa-token.token-name}
+ group-configs:
+ - group: 1.演示模块
+ packages-to-scan: com.ruoyi.demo
+ - group: 2.通用模块
+ packages-to-scan: com.ruoyi.common
+ - group: 3.系统模块
+ packages-to-scan: com.ruoyi.system
+ - group: 4.代码生成模块
+ packages-to-scan: com.ruoyi.generator
# 防止XSS攻击
xss:
diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelHandlerAdapter.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelHandlerAdapter.java
index ef51756..f4364e7 100644
--- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelHandlerAdapter.java
+++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelHandlerAdapter.java
@@ -1,19 +1,24 @@
package com.ruoyi.common.core.utils.poi;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Workbook;
+
/**
* Excel数据格式处理适配器
- *
+ *
* @author ruoyi
*/
public interface ExcelHandlerAdapter
{
/**
* 格式化
- *
+ *
* @param value 单元格数据值
* @param args excel注解args参数组
+ * @param cell 单元格对象
+ * @param wb 工作簿对象
*
* @return 处理后的值
*/
- Object format(Object value, String[] args);
+ Object format(Object value, String[] args, Cell cell, Workbook wb);
}
diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java
index 93aacdb..498d2c4 100644
--- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java
+++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java
@@ -88,13 +88,12 @@ import com.ruoyi.common.core.utils.reflect.ReflectUtils;
*
* @author ruoyi
*/
-public class ExcelUtil
-{
+public class ExcelUtil {
private static final Logger log = LoggerFactory.getLogger(ExcelUtil.class);
public static final String FORMULA_REGEX_STR = "=|-|\\+|@";
- public static final String[] FORMULA_STR = { "=", "-", "+", "@" };
+ public static final String[] FORMULA_STR = {"=", "-", "+", "@"};
/**
* 用于dictType属性数据存储,避免重复查缓存
@@ -196,8 +195,7 @@ public class ExcelUtil
*/
public String[] excludeFields;
- public ExcelUtil(Class clazz)
- {
+ public ExcelUtil(Class clazz) {
this.clazz = clazz;
}
@@ -207,15 +205,12 @@ public class ExcelUtil
* @param fields 列属性名 示例[单个"name"/多个"id","name"]
* @throws Exception
*/
- public void hideColumn(String... fields)
- {
+ public void hideColumn(String... fields) {
this.excludeFields = fields;
}
- public void init(List list, String sheetName, String title, Excel.Type type)
- {
- if (list == null)
- {
+ public void init(List list, String sheetName, String title, Excel.Type type) {
+ if (list == null) {
list = new ArrayList();
}
this.list = list;
@@ -231,15 +226,12 @@ public class ExcelUtil
/**
* 创建excel第一行标题
*/
- public void createTitle()
- {
- if (StringUtils.isNotEmpty(title))
- {
+ public void createTitle() {
+ if (StringUtils.isNotEmpty(title)) {
subMergedFirstRowNum++;
subMergedLastRowNum++;
int titleLastCol = this.fields.size() - 1;
- if (isSubList())
- {
+ if (isSubList()) {
titleLastCol = titleLastCol + subFields.size() - 1;
}
Row titleRow = sheet.createRow(rownum == 0 ? rownum++ : 0);
@@ -254,16 +246,13 @@ public class ExcelUtil
/**
* 创建对象的子列表名称
*/
- public void createSubHead()
- {
- if (isSubList())
- {
+ public void createSubHead() {
+ if (isSubList()) {
subMergedFirstRowNum++;
subMergedLastRowNum++;
Row subRow = sheet.createRow(rownum);
int excelNum = 0;
- for (Object[] objects : fields)
- {
+ for (Object[] objects : fields) {
Excel attr = (Excel) objects[1];
Cell headCell1 = subRow.createCell(excelNum);
headCell1.setCellValue(attr.name());
@@ -272,8 +261,7 @@ public class ExcelUtil
}
int headFirstRow = excelNum - 1;
int headLastRow = headFirstRow + subFields.size() - 1;
- if (headLastRow > headFirstRow)
- {
+ if (headLastRow > headFirstRow) {
sheet.addMergedRegion(new CellRangeAddress(rownum, rownum, headFirstRow, headLastRow));
}
rownum++;
@@ -286,20 +274,18 @@ public class ExcelUtil
* @param is 输入流
* @return 转换后集合
*/
- public List importExcel(InputStream is) throws Exception
- {
+ public List importExcel(InputStream is) throws Exception {
return importExcel(is, 0);
}
/**
* 对excel表单默认第一个索引名转换成list
*
- * @param is 输入流
+ * @param is 输入流
* @param titleNum 标题占用行数
* @return 转换后集合
*/
- public List importExcel(InputStream is, int titleNum) throws Exception
- {
+ public List importExcel(InputStream is, int titleNum) throws Exception {
return importExcel(StringUtils.EMPTY, is, titleNum);
}
@@ -307,77 +293,62 @@ public class ExcelUtil
* 对excel表单指定表格索引名转换成list
*
* @param sheetName 表格索引名
- * @param titleNum 标题占用行数
- * @param is 输入流
+ * @param titleNum 标题占用行数
+ * @param is 输入流
* @return 转换后集合
*/
- public List importExcel(String sheetName, InputStream is, int titleNum) throws Exception
- {
+ public List importExcel(String sheetName, InputStream is, int titleNum) throws Exception {
this.type = Excel.Type.IMPORT;
this.wb = WorkbookFactory.create(is);
List list = new ArrayList();
// 如果指定sheet名,则取指定sheet中的内容 否则默认指向第1个sheet
Sheet sheet = StringUtils.isNotEmpty(sheetName) ? wb.getSheet(sheetName) : wb.getSheetAt(0);
- if (sheet == null)
- {
+ if (sheet == null) {
throw new IOException("文件sheet不存在");
}
boolean isXSSFWorkbook = !(wb instanceof HSSFWorkbook);
Map pictures;
- if (isXSSFWorkbook)
- {
+ if (isXSSFWorkbook) {
pictures = getSheetPictures07((XSSFSheet) sheet, (XSSFWorkbook) wb);
- }
- else
- {
+ } else {
pictures = getSheetPictures03((HSSFSheet) sheet, (HSSFWorkbook) wb);
}
// 获取最后一个非空行的行下标,比如总行数为n,则返回的为n-1
int rows = sheet.getLastRowNum();
- if (rows > 0)
- {
+ if (rows > 0) {
// 定义一个map用于存放excel列的序号和field.
Map cellMap = new HashMap();
// 获取表头
Row heard = sheet.getRow(titleNum);
- for (int i = 0; i < heard.getPhysicalNumberOfCells(); i++)
- {
+ for (int i = 0; i < heard.getPhysicalNumberOfCells(); i++) {
Cell cell = heard.getCell(i);
- if (StringUtils.isNotNull(cell))
- {
+ if (StringUtils.isNotNull(cell)) {
String value = this.getCellValue(heard, i).toString();
cellMap.put(value, i);
- }
- else
- {
+ } else {
cellMap.put(null, i);
}
}
// 有数据时才处理 得到类的所有field.
List