|
@@ -23,6 +23,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -89,17 +90,28 @@ public class SceneMarkShapeBoxServiceImpl extends ServiceImpl<MarkShapeBoxMapper
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public Map<String, Object> getShapBox(String num) {
|
|
|
|
|
|
+ public Map<String, Object> getShapBox(String num, Integer showOrig) {
|
|
SceneMarkShapeBox sceneMarkShapeBox = this.findBySceneNum(num);
|
|
SceneMarkShapeBox sceneMarkShapeBox = this.findBySceneNum(num);
|
|
if(Objects.isNull(sceneMarkShapeBox)){
|
|
if(Objects.isNull(sceneMarkShapeBox)){
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
Map<String, Object> result = new HashMap<>();
|
|
Map<String, Object> result = new HashMap<>();
|
|
result.put("boundingBox", sceneMarkShapeBox.getBoundingBox());
|
|
result.put("boundingBox", sceneMarkShapeBox.getBoundingBox());
|
|
- if(Objects.nonNull(sceneMarkShapeBox.getExternalBoxes())){
|
|
|
|
- result.put("result", sceneMarkShapeBox.getExternalBoxes());
|
|
|
|
- }else {
|
|
|
|
- result.put("result", sceneMarkShapeBox.getBoxes());
|
|
|
|
|
|
+ if(Objects.nonNull(showOrig) && showOrig == 1){
|
|
|
|
+ List<SceneMarkShape> shapes = sceneMarkShapeService.findByNum(num);
|
|
|
|
+ List<Map<String, Object>> shapeList = shapes.stream().map(v -> {
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
+ map.put("imagePath", v.getImagePath());
|
|
|
|
+ map.put("shapes", v.getShapes());
|
|
|
|
+ return map;
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
+ result.put("result", shapeList);
|
|
|
|
+ }else{
|
|
|
|
+ if(Objects.nonNull(sceneMarkShapeBox.getExternalBoxes())){
|
|
|
|
+ result.put("result", sceneMarkShapeBox.getExternalBoxes());
|
|
|
|
+ }else {
|
|
|
|
+ result.put("result", sceneMarkShapeBox.getBoxes());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|