diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxJsfzbacsServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxJsfzbacsServiceImpl.java index fc68cc6da..3ff4f6d07 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxJsfzbacsServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxJsfzbacsServiceImpl.java @@ -326,7 +326,7 @@ public class OtaBaCxJsfzbacsServiceImpl extends ServiceImpl uploadFiles1(File attFile, String[] strs, IOSSFileService ossFileService) throws Exception { List res = new ArrayList<>(); for (int i = 0; i < strs.length; i++) { - File file = ImportFileUtil.findFile(attFile, strs[i]); - if (null == file) { - throw new JeroBootException("找不到文件:" + strs[i]); - } - OSSFile ossFile = ossFileService.uploadLocalOfCos(ImportFileUtil.createMfileByFile(file), "", null, null); - if (ObjectUtils.isNotEmpty(ossFile)) { - res.add(ossFile); + if (StringUtils.isNotEmpty(strs[i])) { + File file = ImportFileUtil.findFile(attFile, strs[i]); + if (null == file) { + throw new JeroBootException("找不到文件:" + strs[i]); + } + OSSFile ossFile = ossFileService.uploadLocalOfCos(ImportFileUtil.createMfileByFile(file), "", null, null); + if (ObjectUtils.isNotEmpty(ossFile)) { + res.add(ossFile); + } } } return res; @@ -224,16 +235,18 @@ public class ImportFileUtil { public static String uploadFiles(File attFile, String[] strs, IOSSFileService ossFileService) throws Exception { String res = ""; for (int i = 0; i < strs.length; i++) { - File file = ImportFileUtil.findFile(attFile, strs[i]); - if (null == file) { - throw new JeroBootException("找不到文件:" + strs[i]); - } - OSSFile ossFile = ossFileService.uploadLocalOfCos(ImportFileUtil.createMfileByFile(file), "", null, null); - if (ObjectUtils.isNotEmpty(ossFile)) { - if (i >= strs.length - 1) { - res += ossFile.getId(); - } else { - res += ossFile.getId() + ","; + if (StringUtils.isNotEmpty(strs[i])) { + File file = ImportFileUtil.findFile(attFile, strs[i]); + if (null == file) { + throw new JeroBootException("找不到文件:" + strs[i]); + } + OSSFile ossFile = ossFileService.uploadLocalOfCos(ImportFileUtil.createMfileByFile(file), "", null, null); + if (ObjectUtils.isNotEmpty(ossFile)) { + if (i >= strs.length - 1) { + res += ossFile.getId(); + } else { + res += ossFile.getId() + ","; + } } } }