From 6f14087a1690da6b077297d094a2740b0af4c76d Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 25 Apr 2022 10:23:47 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=A1=BA=E5=BA=8ForderNum=E7=B1=BB=E5=9E=8B=E4=B8=BA=E6=95=B4?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/common/core/domain/entity/SysDept.java | 9 +++++---- .../src/main/resources/mapper/system/SysDeptMapper.xml | 6 +++--- .../src/main/resources/mapper/system/SysMenuMapper.xml | 6 +++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java index 423ef685..693461b9 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.List; import javax.validation.constraints.Email; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -31,7 +32,7 @@ public class SysDept extends BaseEntity private String deptName; /** 显示顺序 */ - private String orderNum; + private Integer orderNum; /** 负责人 */ private String leader; @@ -96,13 +97,13 @@ public class SysDept extends BaseEntity this.deptName = deptName; } - @NotBlank(message = "显示顺序不能为空") - public String getOrderNum() + @NotNull(message = "显示顺序不能为空") + public Integer getOrderNum() { return orderNum; } - public void setOrderNum(String orderNum) + public void setOrderNum(Integer orderNum) { this.orderNum = orderNum; } diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml index 44bd8689..984f89cc 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -91,7 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" parent_id, dept_name, ancestors, - order_num, + order_num, leader, phone, email, @@ -103,7 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{parentId}, #{deptName}, #{ancestors}, - #{orderNum}, + #{orderNum}, #{leader}, #{phone}, #{email}, @@ -119,7 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" parent_id = #{parentId}, dept_name = #{deptName}, ancestors = #{ancestors}, - order_num = #{orderNum}, + order_num = #{orderNum}, leader = #{leader}, phone = #{phone}, email = #{email}, diff --git a/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml index 81e7b705..f11402c7 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml @@ -130,7 +130,7 @@ menu_name = #{menuName}, parent_id = #{parentId}, - order_num = #{orderNum}, + order_num = #{orderNum}, path = #{path}, component = #{component}, `query` = #{query}, @@ -153,7 +153,7 @@ menu_id, parent_id, menu_name, - order_num, + order_num, path, component, `query`, @@ -171,7 +171,7 @@ #{menuId}, #{parentId}, #{menuName}, - #{orderNum}, + #{orderNum}, #{path}, #{component}, #{query}, From 7414bc492e3b9cc4640d4bb1269d0908b9c346f7 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 25 Apr 2022 10:27:06 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=94=9F=E6=88=90=E6=A0=91=E9=80=89=E6=8B=A9=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/vm/vue/v3/index-tree.vue.vm | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm index 11bbe52e..862297c7 100644 --- a/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm +++ b/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm @@ -174,11 +174,13 @@ #set($dictType=$column.dictType) #if("" != $treeParentCode && $column.javaField == $treeParentCode) - #elseif($column.htmlType == "input") @@ -354,8 +356,8 @@ function getList() { } /** 查询${functionName}下拉树结构 */ -async function getTreeselect() { - await list${BusinessName}().then(response => { +function getTreeselect() { + list${BusinessName}().then(response => { ${businessName}Options.value = []; const data = { ${treeCode}: 0, ${treeName}: '顶级节点', children: [] }; data.children = proxy.handleTree(response.data, "${treeCode}", "${treeParentCode}"); @@ -404,9 +406,9 @@ function resetQuery() { } /** 新增按钮操作 */ -async function handleAdd(row) { +function handleAdd(row) { reset(); - await getTreeselect(); + getTreeselect(); if (row != null && row.${treeCode}) { form.value.${treeParentCode} = row.${treeCode}; } else { From cbe405f6eaf7631ac74023efa6cf0800e043e44d Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sun, 1 May 2022 20:22:25 +0800 Subject: [PATCH 3/8] ui code format --- ruoyi-ui/src/assets/styles/element-variables.scss | 2 +- ruoyi-ui/src/views/tool/gen/index.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ruoyi-ui/src/assets/styles/element-variables.scss b/ruoyi-ui/src/assets/styles/element-variables.scss index 039d1e48..5bf2fbb1 100644 --- a/ruoyi-ui/src/assets/styles/element-variables.scss +++ b/ruoyi-ui/src/assets/styles/element-variables.scss @@ -17,7 +17,7 @@ $--button-font-weight: 400; $--border-color-light: #dfe4ed; $--border-color-lighter: #e6ebf5; -$--table-border:1px solid#dfe6ec; +$--table-border: 1px solid #dfe6ec; /* icon font path, required */ $--font-path: '~element-ui/lib/theme-chalk/fonts'; diff --git a/ruoyi-ui/src/views/tool/gen/index.vue b/ruoyi-ui/src/views/tool/gen/index.vue index 381e30f6..4cd9e991 100644 --- a/ruoyi-ui/src/views/tool/gen/index.vue +++ b/ruoyi-ui/src/views/tool/gen/index.vue @@ -305,7 +305,7 @@ export default { return result.value || ' '; }, /** 复制代码成功 */ - clipboardSuccess(){ + clipboardSuccess() { this.$modal.msgSuccess("复制成功"); }, // 多选框选中数据 From 9476f7f61671f54fc288647594ce3db5ad621dd5 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sun, 1 May 2022 20:22:35 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E5=8D=87=E7=BA=A7spring-boot=E5=88=B0?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E7=89=88=E6=9C=AC2.5.13?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b693251f..65abb93b 100644 --- a/pom.xml +++ b/pom.xml @@ -43,7 +43,7 @@ org.springframework.boot spring-boot-dependencies - 2.5.12 + 2.5.13 pom import From 1c41b701dd3aa904020309223738a446e52882a8 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 9 May 2022 17:37:33 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E4=BC=98=E5=8C=96excel=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/common/utils/poi/ExcelUtil.java | 70 +++++++++++-------- 1 file changed, 41 insertions(+), 29 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java index 4fc3ff4f..e868511a 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java @@ -672,6 +672,46 @@ public class ExcelUtil style.setFont(totalFont); styles.put("total", style); + styles.putAll(annotationStyles(wb)); + + return styles; + } + + /** + * 根据Excel注解创建表格样式 + * + * @param wb 工作薄对象 + * @return 自定义样式列表 + */ + private Map annotationStyles(Workbook wb) + { + Map styles = new HashMap(); + for (Object[] os : fields) + { + Excel excel = (Excel) os[1]; + String key = "data_" + excel.align() + "_" + excel.color(); + if (!styles.containsKey(key)) + { + CellStyle style = wb.createCellStyle(); + style = wb.createCellStyle(); + style.setAlignment(excel.align()); + style.setVerticalAlignment(VerticalAlignment.CENTER); + style.setBorderRight(BorderStyle.THIN); + style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderLeft(BorderStyle.THIN); + style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderTop(BorderStyle.THIN); + style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderBottom(BorderStyle.THIN); + style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + Font dataFont = wb.createFont(); + dataFont.setFontName("Arial"); + dataFont.setFontHeightInPoints((short) 10); + dataFont.setColor(excel.color().index); + style.setFont(dataFont); + styles.put(key, style); + } + } return styles; } @@ -793,7 +833,7 @@ public class ExcelUtil { // 创建cell cell = row.createCell(column); - setDataCell(cell, attr); + cell.setCellStyle(styles.get("data_" + attr.align() + "_" + attr.color())); // 用于读取对象中的属性 Object value = getTargetValue(vo, field, attr); @@ -836,34 +876,6 @@ public class ExcelUtil return cell; } - /** - * 设置单元格样式 - * - * @param cell 单元格 - * @param excel 注解信息 - */ - public void setDataCell(Cell cell, Excel excel) - { - CellStyle style = wb.createCellStyle(); - style.setAlignment(HorizontalAlignment.CENTER); - style.setVerticalAlignment(VerticalAlignment.CENTER); - style.setBorderRight(BorderStyle.THIN); - style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); - style.setBorderLeft(BorderStyle.THIN); - style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); - style.setBorderTop(BorderStyle.THIN); - style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); - style.setBorderBottom(BorderStyle.THIN); - style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); - style.setAlignment(excel.align()); - Font dataFont = wb.createFont(); - dataFont.setFontName("Arial"); - dataFont.setFontHeightInPoints((short) 10); - dataFont.setColor(excel.color().index); - style.setFont(dataFont); - cell.setCellStyle(style); - } - /** * 设置 POI XSSFSheet 单元格提示或选择框 * From 0055f479cb5b4eeaa75f5e3ee324c963e3a76a5c Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 9 May 2022 20:27:09 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8=E9=97=AE?= =?UTF-8?q?=E9=A2=98(I55MR3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/views/system/dict/data.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ruoyi-ui/src/views/system/dict/data.vue b/ruoyi-ui/src/views/system/dict/data.vue index 2bd8cbb5..1d0be70a 100644 --- a/ruoyi-ui/src/views/system/dict/data.vue +++ b/ruoyi-ui/src/views/system/dict/data.vue @@ -191,7 +191,7 @@