|
@@ -32,14 +32,22 @@ public class SceneImportCtrl {
|
|
|
@ResponseBody
|
|
|
public ResponseBodyVO startImport(@RequestBody SceneImportPO po, HttpServletRequest request) {
|
|
|
try {
|
|
|
+ //路径校验
|
|
|
+ Boolean directory = sceneImportService.checkDirectory(po);
|
|
|
+ if(!directory){
|
|
|
+ po.setErrorMessage("路径错误: " + po.getDataDirectory());
|
|
|
+ po.setStatus(DictConstants.SCENE_IMPORT_STATUS_0);
|
|
|
+ sceneImportService.updateStatus(po);
|
|
|
+ return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE);
|
|
|
+ }
|
|
|
//开始上传
|
|
|
po.setStatus(DictConstants.SCENE_IMPORT_STATUS_1);
|
|
|
sceneImportService.updateStatus(po);
|
|
|
//上传
|
|
|
- Boolean b = sceneImportService.startImport(po);
|
|
|
- if(!b){
|
|
|
+ Boolean sceneType = sceneImportService.startImport(po);
|
|
|
+ if(!sceneType){
|
|
|
+ po.setErrorMessage("场景类型错误!");
|
|
|
po.setStatus(DictConstants.SCENE_IMPORT_STATUS_0);
|
|
|
- po.setErrorMessage("路径错误");
|
|
|
sceneImportService.updateStatus(po);
|
|
|
return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE);
|
|
|
}
|