From 1a058fb39c0afeb5ad3b7c412db992fa90d29e44 Mon Sep 17 00:00:00 2001 From: itcast Date: Wed, 26 Jul 2023 10:03:35 +0800 Subject: [PATCH 1/4] Changes --- .../fieldx/controller/FieldxController.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/controller/FieldxController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/controller/FieldxController.java index e8fb418..d7dfab5 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/controller/FieldxController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/controller/FieldxController.java @@ -8,6 +8,7 @@ import java.util.stream.Collectors; import javax.servlet.http.HttpServletRequest; import com.aliyuncs.utils.StringUtils; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; @@ -436,6 +437,7 @@ public class FieldxController extends JeecgController { if (StringUtils.isEmpty(String.valueOf(cell))) { break; } + ExcelInfo excelInfo = new ExcelInfo(); excelInfo.setcells(cells); Fieldx222 fieldx222 = new Fieldx222(); @@ -455,6 +457,7 @@ public class FieldxController extends JeecgController { fieldx222Service.remove(null); return Result.error("序号为" + (r - 2) + "的中文名称不能为空"); } + fieldx222.setFieldName(excelInfo.getFieldName()); Fieldx222 fieldx2221=fieldx222Service.query().eq("field_name",excelInfo.getFieldName()).one(); if(fieldx2221!=null){ message.put("isError", "true"); @@ -466,6 +469,17 @@ public class FieldxController extends JeecgController { } fieldx222.setFieldName(excelInfo.getFieldName()); + LambdaQueryWrapper queryWrapper=new LambdaQueryWrapper<>(); + queryWrapper.eq(Fieldx::getTableId,fieldx222.getTableId()).eq(Fieldx::getFieldName,fieldx222.getFieldName()); + List list=fieldxService.list(queryWrapper); + if(list!=null&&list.size()!=0){ + message.put("isError", "true"); + message.put("status","序号为" + (r - 2) + "的字段名此表已存在不能重复"); + message.put("closeable","true"); + webSocketUtils.sendMessage(loginUser.getId(), message); + fieldx222Service.remove(null); + return Result.error("序号为" + (r - 2) + "的字段名此表已存在不能重复"); + } if (StringUtil.isBlank(excelInfo.getFieldEnName())) { message.put("isError", "true"); message.put("status","序号为" + (r - 2) + "的”英文名称”不能为空"); From 217b41a9b73b2ed9519d39ab44948cd215d228b5 Mon Sep 17 00:00:00 2001 From: lijinyu <3023846734@qq.com> Date: Wed, 26 Jul 2023 10:28:31 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=A8=A1=E5=9D=97=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=8A=9F=E8=83=BD=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modulex/service/impl/ModulexServiceImpl.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java index a62b731..a99f21c 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java @@ -390,6 +390,9 @@ public class ModulexServiceImpl extends ServiceImpl impl if (j == 2) { for (int k = 0; k < physicalNumberOfCells; k++) { Cell cell = row.getCell(k); + if(cell==null){ + propertyNames.add(null); + } String name = cell.getStringCellValue(); propertyNames.add(name); } @@ -707,8 +710,14 @@ public class ModulexServiceImpl extends ServiceImpl impl webSocketUtils.sendMessage(loginUser.getId(), message); return Result.error("导入失败,责任人信息查询不到"); } - String strip = org.apache.commons.lang.StringUtils.strip(list.toString(), "[]"); - modulex.setManagerUsers(strip); +// String strip = org.apache.commons.lang.StringUtils.strip(list.toString(), "[]"); + String s = ""; + for (int j = 0; j < list.size(); j++) { + s = s + list.get(j); + if (j < list.size() - 1) + s = s + ","; + } + modulex.setManagerUsers(s); } } String workLevel = modulexTemplate.getWorkLevel(); From e9cc7c6ac8d03fcc96d3e7c36b915997d35ff4c0 Mon Sep 17 00:00:00 2001 From: itcast Date: Wed, 26 Jul 2023 10:33:54 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ant-design-vue-jeecg/src/views/modulex/ModulexList.vue | 2 +- .../src/main/java/org/jeecg/modules/fieldx/entity/Fieldx.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/modulex/ModulexList.vue b/ant-design-vue-jeecg/src/views/modulex/ModulexList.vue index 1642c37..e1c9c7d 100644 --- a/ant-design-vue-jeecg/src/views/modulex/ModulexList.vue +++ b/ant-design-vue-jeecg/src/views/modulex/ModulexList.vue @@ -575,7 +575,7 @@ export default { '表名(非空): 请填写实体表的名称', '中文名称(非空): 请填写字段名称', '英文名称(非空): 请填写字段名称的英语名称', - '数据类型(非空): 请填写数据类型,{char,varchar,int}这些等等,具体可以查看数据字典', + '数据类型(非空): 请填写数据类型,大写{CHAR,VARCHAR,INT}这些等等,具体可以查看数据字典', '数据长度: 请填写该字段对应的长度', '浮点精度: 请填写浮点精度', '显示形式: 请填写该字段显示的形式', diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/entity/Fieldx.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/entity/Fieldx.java index d511012..98a281e 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/entity/Fieldx.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/entity/Fieldx.java @@ -41,7 +41,7 @@ public class Fieldx implements Serializable { @Dict(dictTable="tablex",dicText = "table_name",dicCode = "id") private java.lang.String tableId; /**中文名称*/ - @Excel(name = "中文名称", width = 15) + @Excel(name = "中文名称", width = 15,dicCode = "field_name") @ApiModelProperty(value = "中文名称") private java.lang.String fieldName; /**英文名称*/ From 67e31657d244d1fe86d7afe7c27f5f7282a172b6 Mon Sep 17 00:00:00 2001 From: lijinyu <3023846734@qq.com> Date: Wed, 26 Jul 2023 10:49:20 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=A8=A1=E5=9D=97=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=8A=9F=E8=83=BD=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/modulex/service/impl/ModulexServiceImpl.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java index a99f21c..0245d2a 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java @@ -428,6 +428,13 @@ public class ModulexServiceImpl extends ServiceImpl impl int annual = 0; for (int k = 0; k < physicalNumberOfCells; k++) { Cell cell = row.getCell(k); + if(cell==null){ + message.put("isError", "true"); + message.put("status","表格中有空白单元格,"+"请重新导入"); + message.put("closeable","true"); + webSocketUtils.sendMessage(loginUser.getId(), message); + return Result.error("数据匹配读取失败,"+"请重新导入"); + } String value = cell.getStringCellValue(); switch (k){ case 0: