lyhzzz hai 1 ano
pai
achega
e86321df11

+ 1 - 2
src/main/java/com/cdf/controller/back/ExcelController.java

@@ -39,8 +39,7 @@ public class ExcelController extends BaseLogController{
     @PostMapping("/checkFile")
     public ResultData checkFile(@RequestBody UploadHotsParam param){
         param.setToken(getToken());
-        hotsService.checkFile(param);
-        return ResultData.ok();
+        return ResultData.ok(hotsService.checkFile(param));
     }
 
     @PostMapping("/uploadExcel")

+ 3 - 3
src/main/java/com/cdf/service/impl/ExcelService.java

@@ -127,7 +127,7 @@ public class ExcelService {
         excelWriter.finish();
     }
 
-    public void checkFile(UploadHotsParam param) {
+    public List<String> checkFile(UploadHotsParam param) {
         if(StringUtils.isBlank(param.getFilePath()) || param.getType() == null){
             throw new BusinessException(ResultCode.PARAM_MISS);
         }
@@ -163,9 +163,9 @@ public class ExcelService {
         }
 
         if(!errorList.isEmpty()){
-            resultError = String.join(",", errorList);
-            throw new BusinessException(ResultCode.UPLOAD_EXCEL_ERROR.code,resultError);
+            return errorList;
         }
+        return errorList;
     }