|
@@ -1,11 +1,15 @@
|
|
package com.fdkankan.fusion.service.impl;
|
|
package com.fdkankan.fusion.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
+import com.fdkankan.fusion.common.FilePath;
|
|
|
|
+import com.fdkankan.fusion.common.util.OBJToGLBUtil;
|
|
import com.fdkankan.fusion.entity.CaseNumEntity;
|
|
import com.fdkankan.fusion.entity.CaseNumEntity;
|
|
import com.fdkankan.fusion.mapper.ICaseNumMapper;
|
|
import com.fdkankan.fusion.mapper.ICaseNumMapper;
|
|
import com.fdkankan.fusion.request.SceneNumParam;
|
|
import com.fdkankan.fusion.request.SceneNumParam;
|
|
import com.fdkankan.fusion.service.ICaseNumService;
|
|
import com.fdkankan.fusion.service.ICaseNumService;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
+import com.fdkankan.fyun.oss.UploadToOssUtil;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
@@ -24,6 +28,9 @@ import java.util.stream.Collectors;
|
|
@Service
|
|
@Service
|
|
public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntity> implements ICaseNumService {
|
|
public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntity> implements ICaseNumService {
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ UploadToOssUtil uploadToOssUtil;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public List<CaseNumEntity> getByCaseId(Integer caseId) {
|
|
public List<CaseNumEntity> getByCaseId(Integer caseId) {
|
|
LambdaQueryWrapper<CaseNumEntity> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<CaseNumEntity> wrapper = new LambdaQueryWrapper<>();
|
|
@@ -48,6 +55,7 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
|
|
caseNumEntity.setCaseId(caseId);
|
|
caseNumEntity.setCaseId(caseId);
|
|
caseNumEntity.setNumType(sceneNumParam.getType());
|
|
caseNumEntity.setNumType(sceneNumParam.getType());
|
|
caseNumEntity.setNum(num);
|
|
caseNumEntity.setNum(num);
|
|
|
|
+ caseNumEntity.setGlbUrl(getGlbUrl(sceneNumParam.getType(),num));
|
|
newCaseNums.add(caseNumEntity);
|
|
newCaseNums.add(caseNumEntity);
|
|
}
|
|
}
|
|
if(newCaseNums.size() >0){
|
|
if(newCaseNums.size() >0){
|
|
@@ -55,6 +63,20 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private String getGlbUrl(Integer type, String num) {
|
|
|
|
+ if(type == 0 || type == 1){ //看看,看见
|
|
|
|
+ String objPath = FilePath.OBJ_PATH+"/"+num;
|
|
|
|
+ String glbPath = FilePath.GLB_PATH+"/"+num;
|
|
|
|
+ String glbOssPath = FilePath.GLB_OSS_PATH +"/" + num;
|
|
|
|
+ uploadToOssUtil.downFormAli(String.format(FilePath.OBJ_OSS_PATH,num),objPath);
|
|
|
|
+
|
|
|
|
+ OBJToGLBUtil.objToGlb(FilePath.OBJ_PATH+"/"+num,glbPath);
|
|
|
|
+ uploadToOssUtil.upload(glbPath,glbOssPath);
|
|
|
|
+ return glbOssPath;
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public void deleteByCaseId(Integer caseId) {
|
|
public void deleteByCaseId(Integer caseId) {
|
|
LambdaQueryWrapper<CaseNumEntity> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<CaseNumEntity> wrapper = new LambdaQueryWrapper<>();
|