|
@@ -16,6 +16,7 @@ import com.gis.mapper.IBaseMapper;
|
|
import com.gis.service.SceneService;
|
|
import com.gis.service.SceneService;
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.github.pagehelper.PageInfo;
|
|
import lombok.extern.log4j.Log4j2;
|
|
import lombok.extern.log4j.Log4j2;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -26,7 +27,7 @@ import java.util.Set;
|
|
/**
|
|
/**
|
|
* Created by owen on 2020/3/11 0011 16:16
|
|
* Created by owen on 2020/3/11 0011 16:16
|
|
*/
|
|
*/
|
|
-@Log4j2
|
|
|
|
|
|
+@Slf4j
|
|
@Service
|
|
@Service
|
|
public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implements SceneService {
|
|
public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implements SceneService {
|
|
|
|
|
|
@@ -44,10 +45,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
return entityMapper.findBySceneCode(m);
|
|
return entityMapper.findBySceneCode(m);
|
|
}
|
|
}
|
|
|
|
|
|
-// @Override
|
|
|
|
-// public List<SceneEntity> search(ScenePageDto param) {
|
|
|
|
-// return entityMapper.search(param);
|
|
|
|
-// }
|
|
|
|
|
|
+
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Result<SceneEntity> search(PageDto param) {
|
|
public Result<SceneEntity> search(PageDto param) {
|
|
@@ -73,8 +71,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
String visionModelDataName = "vision.modeldata";
|
|
String visionModelDataName = "vision.modeldata";
|
|
// 注意网络下载会有缓存,必须加时间戳
|
|
// 注意网络下载会有缓存,必须加时间戳
|
|
// log.info("网络下载文件地址: {}", urlPath);
|
|
// log.info("网络下载文件地址: {}", urlPath);
|
|
-// String localBasePath = FILE_PATH + sceneCode;
|
|
|
|
- String localBasePath = configConstant.serverBasePath + sceneCode;
|
|
|
|
|
|
+ String localBasePath = configConstant.serverBasePath + entity.getPath();
|
|
|
|
|
|
// 2. 将vision.modeldata 转 vision.json
|
|
// 2. 将vision.modeldata 转 vision.json
|
|
String visionModelDataPath = localBasePath + "/" + visionModelDataName;
|
|
String visionModelDataPath = localBasePath + "/" + visionModelDataName;
|
|
@@ -82,7 +79,6 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
log.error("vision.modeldata不存在 : {}", visionModelDataPath);
|
|
log.error("vision.modeldata不存在 : {}", visionModelDataPath);
|
|
return Result.failure("vision.modeldata不存在");
|
|
return Result.failure("vision.modeldata不存在");
|
|
}
|
|
}
|
|
-// log.info(visionModelDataName+ "下载完成");
|
|
|
|
|
|
|
|
|
|
|
|
String visionJsonPath = localBasePath + "/vision.json";
|
|
String visionJsonPath = localBasePath + "/vision.json";
|
|
@@ -155,12 +151,12 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
return Result.failure("场景不存在");
|
|
return Result.failure("场景不存在");
|
|
}
|
|
}
|
|
|
|
|
|
- String basePath = configConstant.serverBasePath + sceneCode;
|
|
|
|
|
|
+ String basePath = configConstant.serverBasePath + entity.getPath();
|
|
|
|
+ log.info("basePath: {}", basePath);
|
|
|
|
|
|
|
|
|
|
// 处理someData.json
|
|
// 处理someData.json
|
|
|
|
|
|
-// String someDataPath = entity.getPath() + "/someData.json";
|
|
|
|
String someDataPath = basePath + "/someData.json";
|
|
String someDataPath = basePath + "/someData.json";
|
|
if (!FileUtil.isFile(someDataPath)) {
|
|
if (!FileUtil.isFile(someDataPath)) {
|
|
log.error("someData.json文件不存在");
|
|
log.error("someData.json文件不存在");
|
|
@@ -383,7 +379,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
}
|
|
}
|
|
|
|
|
|
log.info("out data.js : {}", dataJsJson);
|
|
log.info("out data.js : {}", dataJsJson);
|
|
- String basePath = configConstant.serverBasePath + entity.getSceneCode();
|
|
|
|
|
|
+ String basePath = configConstant.serverBasePath + entity.getPath();
|
|
|
|
|
|
String dataPath = basePath + "/hot/js/data.js";
|
|
String dataPath = basePath + "/hot/js/data.js";
|
|
FileUtil.writeUtf8String(dataJsJson.toJSONString(), dataPath);
|
|
FileUtil.writeUtf8String(dataJsJson.toJSONString(), dataPath);
|