diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaCxAqcsController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaCxAqcsController.java index 42067c84f..f4d652ed7 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaCxAqcsController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaCxAqcsController.java @@ -214,7 +214,11 @@ public class OtaBaCxAqcsController extends JeroController importData(@RequestParam(value = "file", required = false) MultipartFile file, @@ -213,7 +213,11 @@ public class OtaBaSjSjyxpgController extends JeroController setDefault(String otaId) { List list = this.getByOtaId(otaId); Date now = new Date(); @@ -224,7 +225,7 @@ public class OtaBaSjSjfzbhServiceImpl extends ServiceImpl upLoadFiles = ImportFileUtil.importZip(file, cut, uploadPath); - parseFileList(upLoadFiles, otaId, cut,errMsg); + parseFileList(upLoadFiles, otaId, cut, errMsg); } @Override @@ -243,7 +244,7 @@ public class OtaBaSjSjfzbhServiceImpl extends ServiceImpl(); } - List newList = parseFile(upFile, otaId, cut,errMsg); + List newList = parseFile(upFile, otaId, cut, errMsg); ComparisonUtil cu = new ComparisonUtil(); List reList = cu.comparisonListRecord(otaId, OtaModuleEnum.SJ_SJJSMCBH, OtaTitleEnum.GNMC.getName(), oldList, newList, sysDictService); deleteByOtaId(otaId); @@ -283,7 +284,7 @@ public class OtaBaSjSjfzbhServiceImpl extends ServiceImpl { } } - public void checkError(T clazz, StringBuilder errMsg, ISysDictService sysDictService, String cut) { + public void checkError(T clazz, StringBuilder errMsg, ISysDictService sysDictService, String cut,int row) { Field[] fields = clazz.getClass().getDeclaredFields(); for (Field field : fields) { OtaTitleEnum ote = OtaTitleEnum.getOtaTitleEnum(field.getName()); @@ -200,17 +200,29 @@ public class ComparisonUtil { String str = val.toString(); if ("0".equals(ote.getType())) { if (str.length() > ote.getLen()) { - errMsg.append(title + " 的长度超过了 " + ote.getLen() + ", "); + if (row > 0) { + errMsg.append("第" + row + "行 " + title + " 的长度超过了 " + ote.getLen() + ", "); + } else { + errMsg.append(title + " 的长度超过了 " + ote.getLen() + ", "); + } field.set(clazz, null); } } else if ("1".equals(ote.getType())) { if (!"1".equals(str) && !"2".equals(str)) { - errMsg.append(title + " 必须填写有或无, "); + if (row > 0) { + errMsg.append("第" + row + "行 " + title + " 必须填写有或无, "); + }else{ + errMsg.append(title + " 必须填写有或无, "); + } field.set(clazz, null); } } else if ("2".equals(ote.getType())) { if (!"1".equals(str) && !"2".equals(str)) { - errMsg.append(title + " 必须填写是或否, "); + if (row > 0) { + errMsg.append("第" + row + "行 " + title + " 必须填写是或否, "); + }else{ + errMsg.append(title + " 必须填写是或否, "); + } field.set(clazz, null); } } else if ("3".equals(ote.getType())) { @@ -220,7 +232,11 @@ public class ComparisonUtil { for (String s : strs) { String res = sysDictService.queryDictTextByKeyEn(ote.getType(), s, cut); if (StringUtils.isEmpty(res)) { - errMsg.append(title + " 填写了无法识别的选项, "); + if (row > 0) { + errMsg.append("第" + row + "行 " + title + " 填写了无法识别的选项, "); + }else{ + errMsg.append(title + " 填写了无法识别的选项, "); + } field.set(clazz, null); } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/utils/ImportFileUtil.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/utils/ImportFileUtil.java index d19156c8a..a18d98c10 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/utils/ImportFileUtil.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/utils/ImportFileUtil.java @@ -71,7 +71,7 @@ public class ImportFileUtil { throw new JeroBootException("Please upload a zip file or rar file"); } } - String path = uploadPath + File.separator + "modal" + File.separator + System.currentTimeMillis()+ File.separator + filenameorg; + String path = uploadPath + File.separator + "modal" + File.separator + System.currentTimeMillis() + File.separator + filenameorg; File saveDirectory = new File(path); if (!saveDirectory.isDirectory()) { saveDirectory.mkdir(); @@ -166,7 +166,7 @@ public class ImportFileUtil { public static String getCellValueHaveOrNot(Cell cell, Workbook workbook) throws Exception { - String res = "3"; + String res = ""; String str = getCellValue(cell, workbook); if (StringUtils.isNotEmpty(str)) { if (str.equals("有")) { @@ -179,7 +179,7 @@ public class ImportFileUtil { } public static String getCellValueHaveOrNotInt(Integer val) throws Exception { - String res = "3"; + String res = ""; if (ObjectUtils.isNotEmpty(val)) { if (val.equals(1)) { res = "有"; @@ -191,7 +191,7 @@ public class ImportFileUtil { } public static String getCellValueYesOrNo(Cell cell, Workbook workbook) throws Exception { - String res = "3"; + String res = ""; String str = getCellValue(cell, workbook); if (StringUtils.isNotEmpty(str)) { if (str.equals("是")) { @@ -204,7 +204,7 @@ public class ImportFileUtil { } public static String getCellValueYesOrNoInt(Integer val) throws Exception { - String res = "3"; + String res = ""; if (ObjectUtils.isNotEmpty(val)) { if (val.equals(1)) { res = "是"; @@ -216,7 +216,7 @@ public class ImportFileUtil { } public static String getCellValueHaveOrNot(String str) throws Exception { - String res = "3"; + String res = ""; if (StringUtils.isNotEmpty(str)) { if (str.equals("1")) { res = "有"; @@ -228,7 +228,7 @@ public class ImportFileUtil { } public static String getCellValueYesOrNo(String str) throws Exception { - String res = "3"; + String res = ""; if (StringUtils.isNotEmpty(str)) { if (str.equals("1")) { res = "是"; @@ -356,7 +356,7 @@ public class ImportFileUtil { return res; } - public static String uploadFiles(File attFile, String[] strs, IOSSFileService ossFileService, StringBuilder errMsg, String title, String cut) throws Exception { + public static String uploadFiles(File attFile, String[] strs, IOSSFileService ossFileService, StringBuilder errMsg, String title, String cut, int row) throws Exception { String res = ""; //已导入文件数,用于判断超过20 int inFile = 0; @@ -368,16 +368,28 @@ public class ImportFileUtil { if (StringUtils.isNotEmpty(strs[i])) { File file = ImportFileUtil.findFile(attFile, strs[i]); if (null == file) { - errMsg.append(title + " 找不到文件:" + strs[i] + ", "); + if (row > 0) { + errMsg.append("第" + row + "行 " + title + " 找不到文件:" + strs[i] + ", "); + } else { + errMsg.append(title + " 找不到文件:" + strs[i] + ", "); + } continue; } if (!file.getName().endsWith(".doc") && !file.getName().endsWith(".docx") && !file.getName().endsWith(".pdf") && !file.getName().endsWith(".DOC") && !file.getName().endsWith(".DOCX") && !file.getName().endsWith(".PDF")) { - errMsg.append(title + " 只支持doc/docx/pdf格式, "); + if (row > 0) { + errMsg.append("第" + row + "行 " + title + " 只支持doc/docx/pdf格式, "); + } else { + errMsg.append(title + " 只支持doc/docx/pdf格式, "); + } continue; } if (file.length() > 50 * 1024 * 1024) { - errMsg.append(title + " 上传文件不可以超过50MB, "); + if (row > 0) { + errMsg.append("第" + row + "行 " + title + " 上传文件不可以超过50MB, "); + } else { + errMsg.append(title + " 上传文件不可以超过50MB, "); + } continue; } OSSFile ossFile = ossFileService.uploadLocalOfCos(ImportFileUtil.createMfileByFile(file), "", null, null); diff --git a/jero-web/src/views/documentManage/library/docDetail/index.vue b/jero-web/src/views/documentManage/library/docDetail/index.vue index 7d1380177..e9fad8099 100644 --- a/jero-web/src/views/documentManage/library/docDetail/index.vue +++ b/jero-web/src/views/documentManage/library/docDetail/index.vue @@ -43,7 +43,7 @@ -
+
@@ -168,14 +168,14 @@
-
-
- {{item.name}} -
-
+ + + + + + + +
\ No newline at end of file