|
@@ -1,4 +1,4 @@
|
|
|
-package com.dtm.order.shop.Controller;
|
|
|
|
|
|
|
+package com.dtm.web.controller.order.shop;
|
|
|
|
|
|
|
|
import com.dtm.common.annotation.Anonymous;
|
|
import com.dtm.common.annotation.Anonymous;
|
|
|
import com.dtm.order.shop.service.ShopAnalysisService;
|
|
import com.dtm.order.shop.service.ShopAnalysisService;
|
|
@@ -8,8 +8,8 @@ import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
@@ -68,19 +68,19 @@ public class ShopDataImportController {
|
|
|
|
|
|
|
|
if (importedCount <= 0) {
|
|
if (importedCount <= 0) {
|
|
|
response.put("success", false);
|
|
response.put("success", false);
|
|
|
- response.put("message", "上传导入失败,请检查文件编码或列格式(需为CSV且前10列可解析)。");
|
|
|
|
|
|
|
+ response.put("message", "Upload import failed. Check encoding or CSV columns.");
|
|
|
response.put("debug", shopAnalysisService.getLastUploadDebug());
|
|
response.put("debug", shopAnalysisService.getLastUploadDebug());
|
|
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(response);
|
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(response);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
response.put("success", true);
|
|
response.put("success", true);
|
|
|
- response.put("message", "上传并导入成功。");
|
|
|
|
|
|
|
+ response.put("message", "Upload and import succeeded.");
|
|
|
response.put("importedRows", importedCount);
|
|
response.put("importedRows", importedCount);
|
|
|
response.put("debug", shopAnalysisService.getLastUploadDebug());
|
|
response.put("debug", shopAnalysisService.getLastUploadDebug());
|
|
|
return ResponseEntity.ok(response);
|
|
return ResponseEntity.ok(response);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
response.put("success", false);
|
|
response.put("success", false);
|
|
|
- response.put("message", "上传导入失败: " + e.getMessage());
|
|
|
|
|
|
|
+ response.put("message", "Upload import failed: " + e.getMessage());
|
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(response);
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(response);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -273,8 +273,4 @@ public class ShopDataImportController {
|
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(response);
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(response);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+}
|