|
|
@@ -15,20 +15,10 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fdkankan.common.constant.*;
|
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
|
-import com.fdkankan.common.util.CmdUtils;
|
|
|
-import com.fdkankan.common.util.FileUtils;
|
|
|
-import com.fdkankan.common.exception.BusinessException;
|
|
|
import com.fdkankan.common.util.FileUtils;
|
|
|
import com.fdkankan.model.constants.ConstantFileName;
|
|
|
import com.fdkankan.model.constants.ConstantFilePath;
|
|
|
import com.fdkankan.model.constants.UploadFilePath;
|
|
|
-import com.fdkankan.common.exception.BusinessException;
|
|
|
-import com.fdkankan.scene.bean.SceneBean;
|
|
|
-import com.fdkankan.scene.config.FdkkLaserConfig;
|
|
|
-import com.fdkankan.scene.constant.CmdConstant;
|
|
|
-import com.fdkankan.scene.util.CmdBuildUtil;
|
|
|
-import com.fdkankan.scene.util.SystemUtil;
|
|
|
-import com.fdkankan.web.response.ResultData;
|
|
|
import com.fdkankan.model.utils.ComputerUtil;
|
|
|
import com.fdkankan.model.utils.ConvertUtils;
|
|
|
import com.fdkankan.model.utils.CreateObjUtil;
|
|
|
@@ -40,18 +30,14 @@ import com.fdkankan.scene.bean.IconBean;
|
|
|
import com.fdkankan.scene.bean.LaserSceneBean;
|
|
|
import com.fdkankan.scene.bean.SceneBean;
|
|
|
import com.fdkankan.scene.bean.TagBean;
|
|
|
+import com.fdkankan.scene.config.FdkkLaserConfig;
|
|
|
import com.fdkankan.scene.constant.ConstantFileLocPath;
|
|
|
-import com.fdkankan.scene.entity.SceneEditInfo;
|
|
|
-import com.fdkankan.scene.entity.ScenePlus;
|
|
|
-import com.fdkankan.scene.entity.ScenePlusExt;
|
|
|
-import com.fdkankan.scene.entity.ScenePro;
|
|
|
import com.fdkankan.scene.entity.*;
|
|
|
import com.fdkankan.scene.mapper.ISceneProMapper;
|
|
|
import com.fdkankan.scene.oss.OssUtil;
|
|
|
import com.fdkankan.scene.service.*;
|
|
|
-import com.fdkankan.scene.vo.*;
|
|
|
-import com.fdkankan.web.response.ResultData;
|
|
|
-import com.fdkankan.scene.service.*;
|
|
|
+import com.fdkankan.scene.util.CmdBuildUtil;
|
|
|
+import com.fdkankan.scene.util.SystemUtil;
|
|
|
import com.fdkankan.scene.vo.*;
|
|
|
import com.fdkankan.web.response.ResultData;
|
|
|
import com.google.common.collect.Lists;
|
|
|
@@ -65,7 +51,6 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
import org.w3c.dom.Document;
|
|
|
import org.w3c.dom.Element;
|
|
|
|
|
|
-import javax.annotation.Resource;
|
|
|
import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
@@ -75,13 +60,6 @@ import java.util.Map.Entry;
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
-import java.io.File;
|
|
|
-import java.io.IOException;
|
|
|
-import java.nio.charset.StandardCharsets;
|
|
|
-import java.util.*;
|
|
|
-import java.util.Map.Entry;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-
|
|
|
/**
|
|
|
* <p>
|
|
|
* pro场景表 服务实现类
|
|
|
@@ -209,15 +187,14 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
FileUtil.mkdir(workPath);
|
|
|
|
|
|
//保存到本地
|
|
|
- String origFilePath = workPath + "/" + sid + "." + extName;
|
|
|
+ String origFilePath = workPath + File.separator + sid + "." + extName;
|
|
|
file.transferTo(new File(origFilePath));
|
|
|
|
|
|
- String ossPath = String.format(UploadFilePath.USER_EDIT_PATH, num) + "hotspot/" + sid + "/";
|
|
|
+ String ossPath = String.format(UploadFilePath.USER_EDIT_PATH, num) + "hotspot" + File.separator + sid + File.separator;
|
|
|
Map<String, String> uploadMap = new HashMap<>();
|
|
|
|
|
|
//切图
|
|
|
- String fragmentCmd = fdkkLaserConfig.buildCallPath + File.separator + "vips" + File.separator + "bin" + File.separator + "vips dzsave --tile-size " + tileSize + " " + origFilePath + " " + workPath;
|
|
|
- CmdUtils.callLine(fragmentCmd);
|
|
|
+ CmdBuildUtil.vips(tileSize, origFilePath, workPath);
|
|
|
if(!ComputerUtil.checkComputeCompleted(dziPath, 5, 200)){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5052);
|
|
|
}
|
|
|
@@ -235,9 +212,8 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
width = Integer.valueOf(sizeElement.getAttribute("Width"));
|
|
|
Integer maxSize = height > width ? height : width;
|
|
|
if(maxSize > size){
|
|
|
- String thumbnailPath = workPath + "/" + thumbnailName;
|
|
|
- String scaleCmd = CmdConstant.VIPSTHUMBNAIL_WIN.replace("@inPath", origFilePath).replace("@size",String.valueOf(size)).replace("@thumbnailPath", thumbnailPath);
|
|
|
- CmdUtils.callLine(scaleCmd);
|
|
|
+ String thumbnailPath = workPath + File.separator + thumbnailName;
|
|
|
+ CmdBuildUtil.vipsThumbnail(origFilePath, size, thumbnailPath);
|
|
|
if(!ComputerUtil.checkComputeCompleted(thumbnailPath, 5, 200)){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5052);
|
|
|
}
|
|
|
@@ -273,7 +249,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
ScenePlus scenePlus = scenePlusService.getScenePlusByNum(param.getNum());
|
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
param.getSidList().stream().forEach(sid->{
|
|
|
- String ossPath = String.format(UploadFilePath.USER_EDIT_PATH, param.getNum()) + "hotspot/" + sid + "/";
|
|
|
+ String ossPath = String.format(UploadFilePath.USER_EDIT_PATH, param.getNum()) + "hotspot" + File.separator + sid + File.separator;
|
|
|
if(CollUtil.isNotEmpty(ossUtil.listFiles(scenePlusExt.getYunFileBucket(), ossPath))){
|
|
|
try {
|
|
|
ossUtil.deleteObject(scenePlusExt.getYunFileBucket(), ossPath);
|