|
|
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.fdkankan.common.constant.CommonStatus;
|
|
|
import com.fdkankan.common.constant.ErrorCode;
|
|
|
import com.fdkankan.common.constant.FileBizType;
|
|
|
+import com.fdkankan.common.constant.ServerCode;
|
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
|
import com.fdkankan.common.util.FileUtils;
|
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
@@ -23,12 +24,17 @@ import com.fdkankan.scene.bean.TagBean;
|
|
|
import com.fdkankan.scene.entity.SceneEditInfoExt;
|
|
|
import com.fdkankan.scene.entity.ScenePlus;
|
|
|
import com.fdkankan.scene.entity.ScenePlusExt;
|
|
|
+import com.fdkankan.scene.httpclient.ShapesHttpClient;
|
|
|
+import com.fdkankan.scene.httpclient.callback.CommonErrorCallback;
|
|
|
+import com.fdkankan.scene.httpclient.callback.CommonSuccessCallback;
|
|
|
import com.fdkankan.scene.service.*;
|
|
|
import com.fdkankan.scene.vo.BaseJsonArrayParamVO;
|
|
|
+import com.fdkankan.scene.vo.BaseSceneParamVO;
|
|
|
import com.fdkankan.scene.vo.DeleteFileParamVO;
|
|
|
import com.fdkankan.scene.vo.DeleteSidListParamVO;
|
|
|
import com.fdkankan.web.response.ResultData;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
@@ -41,6 +47,9 @@ public class SceneDrawServiceImpl implements ISceneDrawService {
|
|
|
|
|
|
private final String SCENE_DRAW_JSON_NAME = "sceneDraw.json";
|
|
|
|
|
|
+ @Value("${4dkk.fdService.basePath}")
|
|
|
+ private String fdServiceHost;
|
|
|
+
|
|
|
@Autowired
|
|
|
private IScenePlusService scenePlusService;
|
|
|
@Autowired
|
|
|
@@ -55,6 +64,8 @@ public class SceneDrawServiceImpl implements ISceneDrawService {
|
|
|
private ISceneEditInfoService sceneEditInfoService;
|
|
|
@Resource
|
|
|
private FYunFileServiceInterface fYunFileService;
|
|
|
+ @Resource
|
|
|
+ private ShapesHttpClient shapesHttpClient;
|
|
|
|
|
|
@Override
|
|
|
public void saveSceneDraw(BaseJsonArrayParamVO param) throws Exception {
|
|
|
@@ -181,11 +192,11 @@ public class SceneDrawServiceImpl implements ISceneDrawService {
|
|
|
List<JSONObject> tags = new ArrayList<>();
|
|
|
this.syncFileToRedis(num);
|
|
|
|
|
|
- //获取裁剪模型数据
|
|
|
+ List<TagBean> sortList = new ArrayList<>();
|
|
|
String key = String.format(RedisKey.SCENE_DRAW, num);
|
|
|
List<String> list = redisUtil.hgetValues(key);
|
|
|
if(CollUtil.isNotEmpty(list)){
|
|
|
- List<TagBean> sortList = list.stream().map(str -> {
|
|
|
+ List<TagBean> drawList = list.stream().map(str -> {
|
|
|
JSONObject jsonObject = JSON.parseObject(str);
|
|
|
TagBean tagBean = new TagBean();
|
|
|
tagBean.setCreateTime(jsonObject.getLong("createTime"));
|
|
|
@@ -193,10 +204,25 @@ public class SceneDrawServiceImpl implements ISceneDrawService {
|
|
|
tagBean.setTag(jsonObject);
|
|
|
return tagBean;
|
|
|
}).collect(Collectors.toList());
|
|
|
- sortList.sort(Comparator.comparingLong(TagBean::getCreateTime).reversed());
|
|
|
- tags = sortList.stream().map(item -> item.getTag()).collect(Collectors.toList());
|
|
|
+ sortList.addAll(drawList);
|
|
|
+ }
|
|
|
+
|
|
|
+ BaseSceneParamVO sceneParamVO = new BaseSceneParamVO();
|
|
|
+ sceneParamVO.setNum(num);
|
|
|
+ List<JSONObject> shapesReps = shapesHttpClient.shapesSegList(fdServiceHost, sceneParamVO, new CommonSuccessCallback(), new CommonErrorCallback()).getData();
|
|
|
+ if(CollUtil.isNotEmpty(shapesReps)){
|
|
|
+ List<TagBean> shapeList = shapesReps.stream().map(v -> {
|
|
|
+ TagBean tagBean = new TagBean();
|
|
|
+ tagBean.setCreateTime(v.getDate("updateTime").getTime());
|
|
|
+ tagBean.setTag(v);
|
|
|
+ return tagBean;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ sortList.addAll(shapeList);
|
|
|
}
|
|
|
|
|
|
+ sortList.sort(Comparator.comparingLong(TagBean::getCreateTime).reversed());
|
|
|
+ tags = sortList.stream().map(item -> item.getTag()).collect(Collectors.toList());
|
|
|
+
|
|
|
return tags;
|
|
|
}
|
|
|
|