|
@@ -93,16 +93,23 @@ public class AiServiceImpl implements IAiService {
|
|
|
//生成ai.json
|
|
|
List<SceneMarkShape> sceneMarkShapes = sceneMarkShapeService.findByNumAndType(scenePlus.getNum(), DetectType.PANO.getCode());
|
|
|
if(CollUtil.isNotEmpty(sceneMarkShapes)){
|
|
|
- List<JSONObject> collect = sceneMarkShapes.stream().map(v -> {
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put("index", FileUtil.getPrefix(v.getImagePath()));
|
|
|
- jsonObject.put("shapes", v.getShapes());
|
|
|
- return jsonObject;
|
|
|
- }).collect(Collectors.toList());
|
|
|
-
|
|
|
+ for (SceneMarkShape sceneMarkShape : sceneMarkShapes) {
|
|
|
+ if (ObjectUtil.isNotEmpty(sceneMarkShape.getShapes())){
|
|
|
+ for (JSONObject shape : sceneMarkShape.getShapes()) {
|
|
|
+ String category = shape.getString("category");
|
|
|
+ SceneShapeEnum sceneShapeEnum = sceneShapeEnumService.findByClassName(category);
|
|
|
+ if (ObjectUtil.isNotNull(sceneShapeEnum)){
|
|
|
+ shape.put("name",sceneShapeEnum.getName());
|
|
|
+ }
|
|
|
+ if (category.contains("Tag_")){
|
|
|
+ shape.put("category","Tag");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
String ajJsonKey = String.format(UploadFilePath.IMG_VIEW_PATH, scenePlus.getNum()) + "ai.json";
|
|
|
- fYunFileService.uploadFile(JSON.toJSONString(collect).getBytes(StandardCharsets.UTF_8), ajJsonKey);
|
|
|
+ fYunFileService.uploadFile(JSON.toJSONString(sceneMarkShapes).getBytes(StandardCharsets.UTF_8), ajJsonKey);
|
|
|
|
|
|
scenePlusExt.setHasAi(CommonStatus.YES.code().intValue());
|
|
|
}
|