|
@@ -63,42 +63,46 @@ public class RepairMixtureHandler {
|
|
|
List<ScenePlusExt> list = scenePlusExtService.list(new LambdaQueryWrapper<ScenePlusExt>().eq(ScenePlusExt::getLocation, 6));
|
|
|
if(CollUtil.isNotEmpty(list)){
|
|
|
list.stream().forEach(scenePlusExt -> {
|
|
|
- Integer shootCount = 0;
|
|
|
- Integer mixture = Objects.isNull(scenePlusExt.getMixture()) ? 0 : scenePlusExt.getMixture();
|
|
|
- String homePath = SceneUtil.getHomePath(scenePlusExt.getDataSource());
|
|
|
- JSONObject dataFdageObj = JSON.parseObject(fYunFileService.getFileContent(homePath.concat("data.fdage")));
|
|
|
- if(Objects.nonNull(dataFdageObj)){
|
|
|
- JSONArray points = dataFdageObj.getJSONArray("points");
|
|
|
- if(CollUtil.isNotEmpty(points)){
|
|
|
- shootCount = points.size();
|
|
|
- }
|
|
|
- }
|
|
|
- if(Objects.nonNull(shootCount) && shootCount > 0){
|
|
|
- if(scenePlusExt.getLocation() == 6){
|
|
|
- mixture = CommonStatus.YES.code().intValue();
|
|
|
+ try {
|
|
|
+ Integer shootCount = 0;
|
|
|
+ Integer mixture = Objects.isNull(scenePlusExt.getMixture()) ? 0 : scenePlusExt.getMixture();
|
|
|
+ String homePath = SceneUtil.getHomePath(scenePlusExt.getDataSource());
|
|
|
+ JSONObject dataFdageObj = JSON.parseObject(fYunFileService.getFileContent(homePath.concat("data.fdage")));
|
|
|
+ if(Objects.nonNull(dataFdageObj)){
|
|
|
+ JSONArray points = dataFdageObj.getJSONArray("points");
|
|
|
+ if(CollUtil.isNotEmpty(points)){
|
|
|
+ shootCount = points.size();
|
|
|
+ }
|
|
|
}
|
|
|
- }else{
|
|
|
- String slamDataStr = fYunFileService.getFileContent(homePath.concat("slam_data.json"));
|
|
|
- JSONObject slamDataObj = JSON.parseObject(slamDataStr);
|
|
|
- if(Objects.nonNull(slamDataObj)){
|
|
|
- JSONArray viewsInfo = slamDataObj.getJSONArray("views_info");
|
|
|
- if(CollUtil.isNotEmpty(viewsInfo)){
|
|
|
- shootCount = viewsInfo.stream().mapToInt(info -> {
|
|
|
- return ((JSONObject) info).getJSONArray("list_pose").size();
|
|
|
- }).sum();
|
|
|
+ if(Objects.nonNull(shootCount) && shootCount > 0){
|
|
|
+ if(scenePlusExt.getLocation() == 6){
|
|
|
+ mixture = CommonStatus.YES.code().intValue();
|
|
|
}
|
|
|
+ }else{
|
|
|
+ String slamDataStr = fYunFileService.getFileContent(homePath.concat("slam_data.json"));
|
|
|
+ JSONObject slamDataObj = JSON.parseObject(slamDataStr);
|
|
|
+ if(Objects.nonNull(slamDataObj)){
|
|
|
+ JSONArray viewsInfo = slamDataObj.getJSONArray("views_info");
|
|
|
+ if(CollUtil.isNotEmpty(viewsInfo)){
|
|
|
+ shootCount = viewsInfo.stream().mapToInt(info -> {
|
|
|
+ return ((JSONObject) info).getJSONArray("list_pose").size();
|
|
|
+ }).sum();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ mixture = CommonStatus.NO.code().intValue();
|
|
|
}
|
|
|
- mixture = CommonStatus.NO.code().intValue();
|
|
|
- }
|
|
|
- scenePlusExt.setMixture(mixture);
|
|
|
- scenePlusExt.setShootCount(shootCount);
|
|
|
- scenePlusExtService.updateById(scenePlusExt);
|
|
|
+ scenePlusExt.setMixture(mixture);
|
|
|
+ scenePlusExt.setShootCount(shootCount);
|
|
|
+ scenePlusExtService.updateById(scenePlusExt);
|
|
|
|
|
|
- ScenePlus scenePlus = scenePlusService.getById(scenePlusExt.getPlusId());
|
|
|
+ ScenePlus scenePlus = scenePlusService.getById(scenePlusExt.getPlusId());
|
|
|
|
|
|
- String url = laserHost + "/laser/4dage/mixture/{sceneCode}";
|
|
|
- url = url.replace("{sceneCode}", scenePlus.getNum());
|
|
|
- HttpUtil.post(url, "");
|
|
|
+ String url = laserHost + "/laser/4dage/mixture/{sceneCode}";
|
|
|
+ url = url.replace("{sceneCode}", scenePlus.getNum());
|
|
|
+ HttpUtil.post(url, "");
|
|
|
+ }catch (Exception e){
|
|
|
+ log.error("修复mixture失败,num:{}", scenePlusExt.getWebSite(), e);
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
|