|
@@ -266,14 +266,14 @@ public class RetrievalFacade extends RetrievalServiceImpl {
|
|
|
*/
|
|
|
public RetrievalExcelImDTO retrievalExcelIm(MultipartFile file) {
|
|
|
List<AddTagRetrievalVO> addTagRetrievalVOList = new ArrayList<>();
|
|
|
- List<String> messages = new ArrayList<>();
|
|
|
+ StringBuffer sbf = new StringBuffer();
|
|
|
InputStream inputStream = null;
|
|
|
Workbook wb = null;
|
|
|
try {
|
|
|
if (!file.isEmpty()) {
|
|
|
inputStream = file.getInputStream();
|
|
|
if (inputStream.available() > 512000) {
|
|
|
- messages.add("文件最大支持500KB!");
|
|
|
+ sbf.append("文件最大支持500KB!").append("<br/>");
|
|
|
} else {
|
|
|
String fileName = file.getOriginalFilename();
|
|
|
if (fileName.lastIndexOf(".") != -1) {
|
|
@@ -299,7 +299,7 @@ public class RetrievalFacade extends RetrievalServiceImpl {
|
|
|
retrievalType = getValue(row.getCell(3)).trim().replace(" ", "");
|
|
|
if (StringUtil.isEmpty(questionName) || StringUtil.isEmpty(retrievalName)
|
|
|
|| StringUtil.isEmpty(retrievalSpell) || StringUtil.isEmpty(retrievalType)) {
|
|
|
- messages.add("第" + count + "行数据不完整!");
|
|
|
+ sbf.append("第" + count + "行数据不完整!").append("<br/>");
|
|
|
continue;
|
|
|
}
|
|
|
|
|
@@ -331,17 +331,17 @@ public class RetrievalFacade extends RetrievalServiceImpl {
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- messages.add("非excel文件无法解析!");
|
|
|
+ sbf.append("非excel文件无法解析!").append("<br/>");
|
|
|
}
|
|
|
} else {
|
|
|
- messages.add("未知文件无法解析!");
|
|
|
+ sbf.append("未知文件无法解析!").append("<br/>");
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- messages.add("无文件上传!");
|
|
|
+ sbf.append("无文件上传!").append("<br/>");
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- messages.add("解析失败!");
|
|
|
+ sbf.append("解析失败!").append("<br/>");
|
|
|
} finally {
|
|
|
try {
|
|
|
if (wb != null) {
|
|
@@ -353,13 +353,16 @@ public class RetrievalFacade extends RetrievalServiceImpl {
|
|
|
} catch (Exception e) {
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if(sbf.length()>0){
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,sbf.toString());
|
|
|
+ }
|
|
|
|
|
|
addTagRetrievalVOList.forEach(i -> {
|
|
|
addTagRetrieval(i);
|
|
|
});
|
|
|
|
|
|
RetrievalExcelImDTO retrievalExcelImDTO = new RetrievalExcelImDTO();
|
|
|
- retrievalExcelImDTO.setMessages(messages);
|
|
|
return retrievalExcelImDTO;
|
|
|
}
|
|
|
|