|
@@ -58,6 +58,8 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
|
|
|
ICaseTagService caseTagService;
|
|
|
@Autowired
|
|
|
ICaseTagPointService caseTagPointService;
|
|
|
+ @Autowired
|
|
|
+ ThreadService threadService;
|
|
|
|
|
|
@Override
|
|
|
public List<CaseNumEntity> getByCaseId(Integer caseId) {
|
|
@@ -96,12 +98,12 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
|
|
|
model.setModelDateType("obj");
|
|
|
model.setType(param.getType());
|
|
|
model.setModelType("pointcloud"); //深时点云类型
|
|
|
- if(param.getType() == 0 || param.getType() == 1 || param.getType() == 4 || param.getType() == 6){ //看看,看见
|
|
|
- model.setModelObjUrl(String.format(FilePath.OBJ_LOCAL_PATH,environment ,num) +"/mesh.obj");
|
|
|
- model.setModelGlbUrl(getGlbUrl(param.getType(),num,model));
|
|
|
- model.setModelType("b3dm");
|
|
|
- model.setModelDateType("b3dm");
|
|
|
- }
|
|
|
+// if(param.getType() == 0 || param.getType() == 1 || param.getType() == 4 || param.getType() == 6){ //看看,看见
|
|
|
+// model.setModelObjUrl(String.format(FilePath.OBJ_LOCAL_PATH,environment ,num) +"/mesh.obj");
|
|
|
+// model.setModelGlbUrl(getGlbUrl(param.getType(),num,model));
|
|
|
+// model.setModelType("b3dm");
|
|
|
+// model.setModelDateType("b3dm");
|
|
|
+// }
|
|
|
model.setNum(num);
|
|
|
model.setCreateStatus(1);
|
|
|
modelList.add(model);
|
|
@@ -119,34 +121,9 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
|
|
|
|
|
|
|
|
|
private String getGlbUrl(Integer type, String num,Model model) {
|
|
|
- String objPath = String.format(FilePath.OBJ_LOCAL_PATH ,environment,num);
|
|
|
-
|
|
|
- try {
|
|
|
- if(type == 0 || type == 1 || type == 4 || type == 6){ //看看,看见
|
|
|
-
|
|
|
- ShellUtil.yunDownload(String.format(FilePath.OBJ_OSS_PATH, num)+"/data/mesh" ,objPath);
|
|
|
- List<String> localGlbPaths = new ArrayList<>();
|
|
|
- List<String> ossGlbPaths = new ArrayList<>();
|
|
|
- File localFile = new File(objPath);
|
|
|
- this.toGlB(localFile,localGlbPaths);
|
|
|
- model.setModelSize(FileWriterUtil.setFileSize(localFile.length()));
|
|
|
-
|
|
|
- if(!localGlbPaths.isEmpty()){
|
|
|
- for (String localGlbPath : localGlbPaths) {
|
|
|
- File file = new File(localGlbPath);
|
|
|
- //model.setModelSize(FileWriterUtil.setFileSize(file.length()));
|
|
|
- String ossPath = localGlbPath.replace("/mnt/","");
|
|
|
- ShellUtil.yunUpload(localGlbPath,ossPath);
|
|
|
- ossGlbPaths.add(queryPath +ossPath+"/tileset.json");
|
|
|
- }
|
|
|
- return JSONArray.toJSONString(ossGlbPaths);
|
|
|
- }
|
|
|
+ if(type == 0 || type == 1 || type == 4 || type == 6){ //看看,看见
|
|
|
|
|
|
- }
|
|
|
- }catch (Exception e){
|
|
|
- log.info("obj-to-b3dm-error:{},{}",num,model.getModelId(),e);
|
|
|
- }finally {
|
|
|
- FileUtil.del(new File(objPath).getParentFile().getPath());
|
|
|
+ threadService.objToB3dm(num,model.getModelId());
|
|
|
}
|
|
|
|
|
|
return null;
|