|
@@ -3,6 +3,7 @@ package com.fdkankan.scene.service.impl;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
+import cn.hutool.core.img.ImgUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.core.util.ZipUtil;
|
|
|
import com.alibaba.csp.sentinel.util.StringUtil;
|
|
@@ -21,6 +22,7 @@ import com.fdkankan.common.constant.ConstantFilePath;
|
|
|
import com.fdkankan.common.constant.ConstantUrl;
|
|
|
import com.fdkankan.common.constant.ErrorCode;
|
|
|
import com.fdkankan.common.constant.FileBizType;
|
|
|
+import com.fdkankan.common.constant.ImageUtil;
|
|
|
import com.fdkankan.common.constant.OperationType;
|
|
|
import com.fdkankan.common.constant.PayStatus;
|
|
|
import com.fdkankan.common.constant.RecStatus;
|
|
@@ -93,6 +95,7 @@ import com.fdkankan.scene.vo.SceneProVO;
|
|
|
import com.fdkankan.scene.vo.SceneVO;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.google.common.collect.Sets;
|
|
|
+import java.awt.image.BufferedImage;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
import java.io.BufferedReader;
|
|
|
import java.io.File;
|
|
@@ -3536,6 +3539,9 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
if(!file.getOriginalFilename().endsWith(".zip")){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_7015);
|
|
|
}
|
|
|
+ if(!FileUtils.checkFileSizeIsLimit(file.getSize(), 50, "M")){
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_7023, "50M");
|
|
|
+ }
|
|
|
|
|
|
// ScenePro scenePro = this.findBySceneNum(num);
|
|
|
ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
@@ -3731,6 +3737,12 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
if(!FileUtils.checkFileSizeIsLimit(data.length(), 1.5, "M")){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5020);
|
|
|
}
|
|
|
+ BufferedImage read = ImgUtil.read(data);
|
|
|
+ int widthImg = read.getWidth();
|
|
|
+ int heightImg = read.getHeight();
|
|
|
+ if (widthImg > 2048 && heightImg > 2048) {
|
|
|
+ ImgUtil.scale(data, data, 2048, 2048, null);
|
|
|
+ }
|
|
|
}
|
|
|
if(data.getName().endsWith(".obj")){
|
|
|
if(objFlag){
|
|
@@ -3739,9 +3751,6 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
if(!data.getName().equals("mesh.obj")){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5060);
|
|
|
}
|
|
|
- if(!FileUtils.checkFileSizeIsLimit(data.length(), 20, "M")){
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_5020);
|
|
|
- }
|
|
|
|
|
|
objFlag = true;
|
|
|
FileUtils.copyFile(dataPath + data.getName(), filePath + "mesh.obj", true);
|