dengsixing 6 mēneši atpakaļ
vecāks
revīzija
c9457a62bf

+ 6 - 0
pom.xml

@@ -153,6 +153,12 @@
             <version>5.7.17</version>
         </dependency>
 
+        <dependency>
+            <groupId>org.owasp.esapi</groupId>
+            <artifactId>esapi</artifactId>
+            <version>2.1.0.1</version>
+        </dependency>
+
     </dependencies>
 
 

+ 20 - 0
src/main/java/com/fdkankan/SceneApplication.java

@@ -1,6 +1,7 @@
 package com.fdkankan;
 
 import com.dtflys.forest.springboot.annotation.ForestScan;
+import com.fdkankan.common.util.ESAPIUtil;
 import com.yomahub.tlog.core.enhance.bytes.AspectLogEnhance;
 import lombok.extern.slf4j.Slf4j;
 import org.mybatis.spring.annotation.MapperScan;
@@ -10,6 +11,10 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.cloud.openfeign.EnableFeignClients;
 import org.springframework.scheduling.annotation.EnableScheduling;
 
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
 @SpringBootApplication
 @EnableDiscoveryClient
 @EnableFeignClients
@@ -25,6 +30,21 @@ public class SceneApplication{
 
     public static void main(String[] args) {
         SpringApplication.run(SceneApplication.class, args);
+
+//        String active = System.getProperty("spring.profiles.active");
+//        String esapiPropertiesName = "ESAPI.properties";
+//        if("local".equals(active)){
+//            esapiPropertiesName = "ESAPI-local.properties";
+//        }
+//        InputStream resourceAsStream = ESAPIUtil.class.getClassLoader().getResourceAsStream(esapiPropertiesName);
+//        ESAPIUtil.properties = new Properties();
+//        try {
+//            ESAPIUtil.properties.load(resourceAsStream);
+//            ESAPIUtil.rootPath = (String)ESAPIUtil.properties.get("workDir");
+//        } catch (IOException e) {
+//            throw new RuntimeException(e);
+//        }
+
     }
 
 }

+ 47 - 47
src/main/java/com/fdkankan/common/util/ComputerUtil.java

@@ -20,52 +20,52 @@ public class ComputerUtil {
 
     private static Logger log = LoggerFactory.getLogger(ComputerUtil.class.getName());
 
-    /**
-     * 循环检测算法是否计算成功
-     * @param uploadJsonPath uploadjson路径
-     * @param maxCheckTimes 循环次数
-     * @param waitTime 每次检测间隔时间,毫秒
-     * @return boolean
-     * @throws Exception
-     */
-    public static boolean checkComputeCompleted(String uploadJsonPath, int maxCheckTimes, long waitTime) throws Exception{
-        int checkTimes = 1;
-        boolean exist = false;
-        do {
-            if(new File(uploadJsonPath).exists()){
-                exist = true;
-                break;
-            }
-            Thread.sleep(waitTime);
-            ++checkTimes;
-        }while (checkTimes <= maxCheckTimes);
+//    /**
+//     * 循环检测算法是否计算成功
+//     * @param uploadJsonPath uploadjson路径
+//     * @param maxCheckTimes 循环次数
+//     * @param waitTime 每次检测间隔时间,毫秒
+//     * @return boolean
+//     * @throws Exception
+//     */
+//    public static boolean checkComputeCompleted(String uploadJsonPath, int maxCheckTimes, long waitTime) throws Exception{
+//        int checkTimes = 1;
+//        boolean exist = false;
+//        do {
+//            if(new File(uploadJsonPath).exists()){
+//                exist = true;
+//                break;
+//            }
+//            Thread.sleep(waitTime);
+//            ++checkTimes;
+//        }while (checkTimes <= maxCheckTimes);
+//
+//        return exist;
+//    }
 
-        return exist;
-    }
-
-    /**
-     * 获取计算完需要上传的文件数组
-     * @param uploadJsonPath uploadjson路径
-     * @param maxCheckTimes 校验upload.json文件是否存在循环次数
-     * @param waitTime 每次检测间隔时间,毫秒
-     * @return boolean
-     * @throws Exception
-     */
-    public static JSONArray getUploadArray(String uploadJsonPath, int maxCheckTimes, long waitTime) throws Exception{
-        boolean buildCompeleted = ComputerUtil.checkComputeCompleted(uploadJsonPath, maxCheckTimes, waitTime);
-        if(!buildCompeleted){
-            throw new BusinessException(ErrorCode.FAILURE_CODE_7013);
-        }
-        String uploadData = FileUtil.readUtf8String(uploadJsonPath);
-        JSONObject uploadJson;
-        JSONArray array = null;
-        if(StrUtil.isNotEmpty(uploadData)) {
-            uploadJson = JSONObject.parseObject(uploadData);
-            array = uploadJson.getJSONArray("upload");
-        }
-        if(CollUtil.isEmpty(array)){
-            throw new BusinessException(ErrorCode.FAILURE_CODE_7013);
-        }
-        return array;
-    }
+//    /**
+//     * 获取计算完需要上传的文件数组
+//     * @param uploadJsonPath uploadjson路径
+//     * @param maxCheckTimes 校验upload.json文件是否存在循环次数
+//     * @param waitTime 每次检测间隔时间,毫秒
+//     * @return boolean
+//     * @throws Exception
+//     */
+//    public static JSONArray getUploadArray(String uploadJsonPath, int maxCheckTimes, long waitTime) throws Exception{
+//        boolean buildCompeleted = ComputerUtil.checkComputeCompleted(uploadJsonPath, maxCheckTimes, waitTime);
+//        if(!buildCompeleted){
+//            throw new BusinessException(ErrorCode.FAILURE_CODE_7013);
+//        }
+//        String uploadData = FileUtil.readUtf8String(uploadJsonPath);
+//        JSONObject uploadJson;
+//        JSONArray array = null;
+//        if(StrUtil.isNotEmpty(uploadData)) {
+//            uploadJson = JSONObject.parseObject(uploadData);
+//            array = uploadJson.getJSONArray("upload");
+//        }
+//        if(CollUtil.isEmpty(array)){
+//            throw new BusinessException(ErrorCode.FAILURE_CODE_7013);
+//        }
+//        return array;
+//    }
 }

+ 75 - 0
src/main/java/com/fdkankan/common/util/ESAPIUtil.java

@@ -0,0 +1,75 @@
+package com.fdkankan.common.util;
+
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.lang.UUID;
+import org.owasp.esapi.ESAPI;
+import org.owasp.esapi.codecs.MySQLCodec;
+import org.owasp.esapi.errors.EncodingException;
+import org.owasp.esapi.errors.ValidationException;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+public class ESAPIUtil {
+
+    public static Properties properties;
+
+    public static final String rootPath;
+
+    static {
+        String active = System.getProperty("spring.profiles.active");
+        String esapiPropertiesName = "ESAPI.properties";
+        if("local".equals(active)){
+            esapiPropertiesName = "ESAPI-local.properties";
+        }
+        InputStream resourceAsStream = ESAPIUtil.class.getClassLoader().getResourceAsStream(esapiPropertiesName);
+        properties = new Properties();
+        try {
+            properties.load(resourceAsStream);
+            rootPath = (String)properties.get("workDir");
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    public static String validFilePath(String inputPath, String rootPath) throws ValidationException {
+        return ESAPI.validator().getValidDirectoryPath(inputPath, inputPath, new File(rootPath), false);
+    }
+
+    public static String validFilePath(String inputPath) throws ValidationException {
+        return validFilePath(inputPath,rootPath);
+    }
+
+    public static String validMysqlParam(String param){
+        return ESAPI.encoder().encodeForSQL(new MySQLCodec(MySQLCodec.Mode.STANDARD),param);
+    }
+
+    public static String getRealPath(String dir){
+        return rootPath + dir;
+    }
+
+    public static String encode(String inputData) throws EncodingException {
+        //HTML encode
+        inputData = ESAPI.encoder().encodeForHTML(inputData);
+//HTML attribute encode
+        inputData = ESAPI.encoder().encodeForHTMLAttribute(inputData);
+//JavaScript encode
+        inputData = ESAPI.encoder().encodeForJavaScript(inputData);
+//CSS encode
+        inputData = ESAPI.encoder().encodeForCSS(inputData);
+//URL encode
+        inputData =  ESAPI.encoder().encodeForURL(inputData);
+        return inputData;
+    }
+
+    public static void main(String[] args) throws ValidationException {
+        String suffix = "." + FileUtil.getSuffix("aaa/bbb/ccc.txt");
+        File tempFile = FileUtil.createTempFile(UUID.fastUUID().toString(), suffix, new File("/temp"), true);
+        System.out.println(System.getProperty("user.dir"));
+        System.out.println(ESAPIUtil.validFilePath(System.getProperty("user.dir") + "\\temp", "/temp"));
+        FileUtil.writeBytes("123123".getBytes(), tempFile);
+    }
+
+}

+ 5 - 1
src/main/java/com/fdkankan/common/util/FdfsUtil.java

@@ -1,12 +1,14 @@
 package com.fdkankan.common.util;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.lang.UUID;
 import cn.hutool.http.HttpRequest;
 import cn.hutool.http.HttpResponse;
 import com.alibaba.fastjson.JSON;
 import com.fdkankan.scene.bean.TietaResBean;
 import lombok.extern.slf4j.Slf4j;
+import org.owasp.esapi.errors.ValidationException;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
@@ -56,7 +58,7 @@ public class FdfsUtil {
         return tietaResBean.getData();
     }
 
-    public Map<String, String> uploadFile(String nonce, String timestamp, String signature, String filePath){
+    public Map<String, String> uploadFile(String nonce, String timestamp, String signature, String filePath) throws ValidationException {
 
         Map<String, String> headers = new HashMap<>();
         headers.put(timestamp_key, timestamp);
@@ -66,6 +68,8 @@ public class FdfsUtil {
 
         Map<String, Object> test = new HashMap<>();
         test.put("visibilityLevel", "1003");
+        String parentPath = FileUtil.getParent(filePath, 1);
+        ESAPIUtil.validFilePath(parentPath);
         test.put("file", new File(filePath));
         test.put("userId", "111111");
         HttpRequest httpRequest = HttpRequest.post(address.concat(api_uploadFile)).form(test).addHeaders(headers).timeout(120000);

+ 29 - 13
src/main/java/com/fdkankan/scene/controller/SceneController.java

@@ -1,32 +1,36 @@
 package com.fdkankan.scene.controller;
 
 
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.lang.UUID;
 import cn.hutool.http.HttpResponse;
 import cn.hutool.http.HttpUtil;
+import com.alibaba.fastjson.JSON;
 import com.fdkankan.common.constant.SceneInfoReqType;
+import com.fdkankan.common.util.ESAPIUtil;
 import com.fdkankan.common.util.FdfsUtil;
 import com.fdkankan.scene.annotation.CheckToken;
 import com.fdkankan.scene.annotation.InitEditInfo;
 import com.fdkankan.scene.annotation.VrLog;
 import com.fdkankan.scene.bean.ResultData;
 import com.fdkankan.scene.httpclient.CustomHttpClient;
-import com.fdkankan.scene.service.SceneEditInfoService;
-import com.fdkankan.scene.service.SceneFileMappingService;
-import com.fdkankan.scene.service.SceneService;
-import com.fdkankan.scene.service.SystemSecretService;
+import com.fdkankan.scene.service.*;
 import com.fdkankan.scene.vo.SceneCheckKeyParamVO;
 import com.fdkankan.scene.vo.SceneInfoParamVO;
 import com.fdkankan.scene.vo.SceneInfoVO;
+import org.owasp.esapi.ESAPI;
+import org.owasp.esapi.errors.ValidationException;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.io.Resource;
 import org.springframework.http.ResponseEntity;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
+import javax.annotation.Resource;
 import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.websocket.server.PathParam;
+import java.io.File;
 import java.io.IOException;
 import java.util.Map;
 
@@ -50,6 +54,8 @@ public class SceneController extends BaseController{
     private FdfsUtil fdfsUtil;
     @Autowired
     private SystemSecretService systemSecretService;
+    @Resource
+    private FYunFileService fYunFileService;
     /**
      * <p>
      获取场景详情
@@ -66,8 +72,14 @@ public class SceneController extends BaseController{
     public ResultData getInfo(@Validated SceneInfoParamVO param) throws Exception{
         param.setReqType(SceneInfoReqType.VIEW.code());
 //        param.setSubgroup(this.getSubgroup());
+//        ESAPI.encoder().encodeForHTML(JSON.toJSONString(param));
+//        ESAPI.encoder().encodeForHTMLAttribute(JSON.toJSONString(param));
+//        ESAPI.encoder().encodeForJavaScript(JSON.toJSONString(param));
+//        ESAPI.encoder().encodeForHTML(JSON.toJSONString(param));
+//        ESAPI.encoder().encodeForCSS(JSON.toJSONString(param));
+//        ESAPI.encoder().encodeForURL(JSON.toJSONString(param));
         response.setHeader("Set-Cookie","cookiename=cookievalue; path=/; Domain=domainvaule; Max-age=seconds; HttpOnly");
-        SceneInfoVO sceneInfo = sceneEditInfoService.getSceneInfo(param);
+        SceneInfoVO sceneInfo = sceneEditInfoService.getSceneInfo(param.getNum(), param.getSubgroup(), param.getUpTimeKey(), (byte)1);
         return ResultData.ok(sceneInfo);
     }
 
@@ -95,15 +107,19 @@ public class SceneController extends BaseController{
     }
 
 
-    @PostMapping("testUploadFile")
-    public ResultData testUploadFile(String path){
-        Map<String, String> stringStringMap = fdfsUtil.uploadFile(path);
-        return ResultData.ok(stringStringMap);
-    }
+//    @PostMapping("testUploadFile")
+//    public ResultData testUploadFile(String path){
+//        Map<String, String> stringStringMap = fdfsUtil.uploadFile(path);
+//        return ResultData.ok(stringStringMap);
+//    }
 
     @GetMapping("/test")
-    public ResultData test(){
-        return ResultData.ok(systemSecretService.list());
+    public ResultData test() throws ValidationException {
+//        String s = ESAPIUtil.validFilePath("D:\\test");
+        fYunFileService.uploadFile("111", 0, "123456", "123456".getBytes(), "123123.txt");
+//        ESAPIUtil.getRealPath();
+//        String s = ESAPIUtil.validFilePath();
+        return ResultData.ok();
     }
 }
 

+ 15 - 14
src/main/java/com/fdkankan/scene/controller/SceneEditController.java

@@ -1,6 +1,7 @@
 package com.fdkankan.scene.controller;
 
 import com.fdkankan.common.constant.SceneInfoReqType;
+import com.fdkankan.common.util.ESAPIUtil;
 import com.fdkankan.scene.annotation.CheckToken;
 import com.fdkankan.scene.annotation.InitEditInfo;
 import com.fdkankan.scene.bean.ResultData;
@@ -267,7 +268,7 @@ public class SceneEditController extends BaseController{
     public SceneInfoVO getInfo(@Validated SceneInfoParamVO param) throws Exception{
         param.setReqType(SceneInfoReqType.EDIT.code());
         response.setHeader("Set-Cookie","cookiename=cookievalue; path=/; Domain=domainvaule; Max-age=seconds; HttpOnly");
-        return sceneEditInfoService.getSceneInfo(param);
+        return sceneEditInfoService.getSceneInfo(param.getNum(), param.getSubgroup(), param.getUpTimeKey(), (byte)2);
     }
 
     /**
@@ -280,11 +281,11 @@ public class SceneEditController extends BaseController{
      * @param file
      * @return java.util.List<java.lang.String>
      **/
-    @PostMapping(value = "/uploadPanorama")
-    public ResultData uploadPanorama(@RequestParam(value = "num") String num,
-        @RequestParam("file") MultipartFile file) throws Exception {
-        return sceneEditInfoService.uploadPanorama(num, this.getSubgroup(), this.getUpTime(), file);
-    }
+//    @PostMapping(value = "/uploadPanorama")
+//    public ResultData uploadPanorama(@RequestParam(value = "num") String num,
+//        @RequestParam("file") MultipartFile file) throws Exception {
+//        return sceneEditInfoService.uploadPanorama(num, this.getSubgroup(), this.getUpTime(), file);
+//    }
 
     /**
      * <p>
@@ -294,12 +295,12 @@ public class SceneEditController extends BaseController{
      * @date 2022/2/16
      * @return java.util.List<java.lang.String>
      **/
-    @PostMapping(value = "/downloadPanorama")
-    public ResultData downloadPanorama(@RequestBody @Validated FileParamVO param) throws Exception {
-        param.setSubgroup(this.getSubgroup());
-        param.setUpTimeKey(this.getUpTime());
-        return sceneEditInfoService.downloadPanorama(param);
-    }
+//    @PostMapping(value = "/downloadPanorama")
+//    public ResultData downloadPanorama(@RequestBody @Validated FileParamVO param) throws Exception {
+//        param.setSubgroup(this.getSubgroup());
+//        param.setUpTimeKey(this.getUpTime());
+//        return sceneEditInfoService.downloadPanorama(param);
+//    }
 
 //    /**
 //     * <p>
@@ -329,7 +330,7 @@ public class SceneEditController extends BaseController{
 //    }
 
     @RequestMapping(value = "/upload/files", method = RequestMethod.POST)
-    public String uploads(@RequestParam(value = "base64",required = false) String base64,
+    public String uploads(@RequestParam(value = "base64",required = false) String imgStr,
         @RequestParam(value = "fileName",required = false) String fileName,
         @RequestParam(value = "bizType",required = false) String bizType,
         @RequestParam(value = "files",required = false) MultipartFile[] files,
@@ -339,7 +340,7 @@ public class SceneEditController extends BaseController{
         Integer subgroup = this.getSubgroup();
         String upTime = this.getUpTime();
         response.setHeader("Set-Cookie","cookiename=cookievalue; path=/; Domain=domainvaule; Max-age=seconds; HttpOnly");
-        return sceneUploadService.uploads(base64,fileName,bizType,files,num,type,uploadPath, subgroup, upTime);
+        return sceneUploadService.uploads(imgStr,fileName,bizType,files,num,type,uploadPath, subgroup, upTime);
     }
 
     /**

+ 4 - 4
src/main/java/com/fdkankan/scene/service/SceneEditInfoService.java

@@ -28,7 +28,7 @@ public interface SceneEditInfoService extends IService<SceneEditInfo> {
 //
 //    ResultData publicScene(SceneEditInfoParamVO param) throws Exception;
 //
-    SceneInfoVO getSceneInfo(SceneInfoParamVO param) throws Exception;
+    SceneInfoVO getSceneInfo(String num, Integer subgroup, String upTimeKey, byte reqType) throws Exception;
 //
 ////    ResultData saveUpload(SaveUploadParamVO param) throws Exception;
 
@@ -48,9 +48,9 @@ public interface SceneEditInfoService extends IService<SceneEditInfo> {
 
     void upgradeSceneJsonVersion(String num, Integer subgroup, String upTime, Integer cacheKeyHasTime, int version, Integer imgVersion) throws IOException ;
 
-    ResultData uploadPanorama(String num, Integer subgroup, String upTime, MultipartFile file) throws Exception;
-
-    ResultData downloadPanorama(FileParamVO param) throws Exception;
+//    ResultData uploadPanorama(String num, Integer subgroup, String upTime, MultipartFile file) throws Exception;
+//
+//    ResultData downloadPanorama(FileParamVO param) throws Exception;
 
     void saveTagsToSceneEditInfo(String num, Integer subgroup, String upTime, Integer cacheKeyHasTime, SceneEditInfo sceneEditInfo);
 

+ 27 - 19
src/main/java/com/fdkankan/scene/service/impl/FYunFileServiceImpl.java

@@ -5,6 +5,7 @@ import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.io.IoUtil;
 import cn.hutool.core.lang.UUID;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fdkankan.common.util.ESAPIUtil;
 import com.fdkankan.common.util.FdfsUtil;
 import com.fdkankan.scene.entity.SceneFileMapping;
 import com.fdkankan.scene.httpclient.CustomHttpClient;
@@ -47,21 +48,29 @@ public class FYunFileServiceImpl implements FYunFileService {
     @Override
     public void uploadFile(String num, Integer subgroup, String upTime, byte[] data, String key) {
         String suffix = "." + FileUtil.getSuffix(key);
-        File tempFile = FileUtil.createTempFile(UUID.fastUUID().toString(), suffix, new File("/temp"), true);
+        File tempFile = FileUtil.createTempFile(UUID.fastUUID().toString(), suffix, new File(ESAPIUtil.getRealPath("temp")), true);
         FileUtil.writeBytes(data, tempFile);
-        Map<String, String> mapping = fdfsUtil.uploadFile(tempFile.getAbsolutePath());
-        //添加记录
-        SceneFileMapping sceneFileMapping =  sceneFileMappingService.getByKey(key, subgroup, upTime);
-        if(Objects.isNull(sceneFileMapping)){
-            sceneFileMapping = new SceneFileMapping();
+        try {
+            Map<String, String> mapping = fdfsUtil.uploadFile(tempFile.getAbsolutePath());
+            //添加记录
+            SceneFileMapping sceneFileMapping =  sceneFileMappingService.getByKey(key, subgroup, upTime);
+            if(Objects.isNull(sceneFileMapping)){
+                sceneFileMapping = new SceneFileMapping();
+            }
+            sceneFileMapping.setNum(num);
+            sceneFileMapping.setFileid(mapping.get("file_id"));
+            sceneFileMapping.setUrl(mapping.get("http_url"));
+            sceneFileMapping.setKey(key);
+            sceneFileMapping.setSubgroup(subgroup);
+            sceneFileMapping.setUpTime(upTime);
+            sceneFileMappingService.saveOrUpdate(sceneFileMapping);
+        }catch (Exception e){
+            throw e;
+        }finally {
+            FileUtil.del(tempFile);
         }
-        sceneFileMapping.setNum(num);
-        sceneFileMapping.setFileid(mapping.get("file_id"));
-        sceneFileMapping.setUrl(mapping.get("http_url"));
-        sceneFileMapping.setKey(key);
-        sceneFileMapping.setSubgroup(subgroup);
-        sceneFileMapping.setUpTime(upTime);
-        sceneFileMappingService.saveOrUpdate(sceneFileMapping);
+
+
     }
 
     @Override
@@ -86,12 +95,6 @@ public class FYunFileServiceImpl implements FYunFileService {
         sceneFileMappingService.delByNumAndKey(num, subgroup, upTime, key);
     }
 
-    public static void main(String[] args) {
-        String suffix = "." + FileUtil.getSuffix("/sxx/ttt/adf.json");
-        File tempFile = FileUtil.createTempFile(UUID.fastUUID().toString(), suffix, new File("D:\\test2"), true);
-        FileUtil.writeBytes("nihsd灌灌灌灌".getBytes(StandardCharsets.UTF_8), tempFile);
-    }
-
     @Override
     public String downloadFile(String num, Integer subgroup, String upTime, String key, String dir, String fileName) {
         SceneFileMapping sceneFileMapping = sceneFileMappingService.getByKey(key, subgroup,upTime);
@@ -116,4 +119,9 @@ public class FYunFileServiceImpl implements FYunFileService {
         });
 
     }
+
+    public static void main(String[] args) {
+        String suffix = "." + FileUtil.getSuffix("sdf/sdfsdf.txt");
+        System.out.println(suffix);
+    }
 }

+ 286 - 286
src/main/java/com/fdkankan/scene/service/impl/SceneEditInfoServiceImpl.java

@@ -190,23 +190,23 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<SceneEditInfoMapper, S
         fYunFileService.uploadFile(num, subgroup, upTime, JSON.toJSONBytes(jsonArray), userEditPath + "filter.json");
     }
     @Override
-    public SceneInfoVO getSceneInfo(SceneInfoParamVO param) throws Exception{
-        SceneInfoReqType sceneInfoReqType = SceneInfoReqType.get(param.getReqType());
-        if(Objects.isNull(param.getSubgroup())){
-            param.setSubgroup(0);
+    public SceneInfoVO getSceneInfo(String num, Integer subgroup, String upTimeKey, byte reqType) throws Exception{
+        SceneInfoReqType sceneInfoReqType = SceneInfoReqType.get(reqType);
+        if(Objects.isNull(subgroup)){
+            subgroup = 0;
         }
         SceneInfoVO sceneInfo = null;
         switch (sceneInfoReqType){
             //如果是编辑页面请求,查数据库
             case EDIT:
-                sceneInfo = this.getSceneInfo4Edit(param.getNum(), param.getSubgroup(), param.getUpTimeKey());
+                sceneInfo = this.getSceneInfo4Edit(num, subgroup, upTimeKey);
                 //俊波要求这两个字段编辑页一定是1
                 sceneInfo.getControls().setShowDollhouse(CommonStatus.YES.code());
                 sceneInfo.getControls().setShowFloorplan(CommonStatus.YES.code());
                 break;
             //如果是查看页面请求,查redis
             case VIEW:
-                sceneInfo = this.getSceneInfo4Edit(param.getNum(), param.getSubgroup(), param.getUpTimeKey());
+                sceneInfo = this.getSceneInfo4Edit(num, subgroup, upTimeKey);
                 sceneInfo.setScenePassword(null);
                 //俊波要求这两个字段查看页一定是0
                 sceneInfo.getControls().setShowDollhouse(CommonStatus.NO.code());
@@ -510,287 +510,287 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<SceneEditInfoMapper, S
 
     }
 
-    @Override
-    public ResultData uploadPanorama(String num, Integer subgroup, String upTime, MultipartFile file) throws Exception {
-
-        if(!file.getOriginalFilename().endsWith(".zip") && !file.getOriginalFilename().endsWith(".jpg")){
-            throw new BusinessException(ErrorCode.FAILURE_CODE_7007, "jpg或者zip");
-        }
-
-        Scene scenePlus = sceneService.getByNum(num, subgroup, upTime);
-        if(scenePlus == null){
-            throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
-        }
-
-        //查询是否存在等待中的异步操作记录,如果存在,抛出业务异常,终止操作
-        sceneAsynOperLogService.checkSceneAsynOper(scenePlus.getId(), null, SceneAsynModuleType.UPLOAD_DOWNLOAD.code() , SceneAsynFuncType.PANORAMIC_IMAGE.code());
-
-        //清除全景图异步操作记录,防止再次下载的时候请求到旧的压缩包
-        sceneAsynOperLogService.cleanLog(scenePlus.getId(), SceneAsynModuleType.UPLOAD_DOWNLOAD.code(), SceneAsynFuncType.PANORAMIC_IMAGE.code());
-
-        //原始计算根目录
-        String numStr = RedisKey.getNumStr(num, subgroup, upTime, scenePlus.getCacheKeyHasTime());
-        String path = String.format(ConstantFilePath.SCENE_USER_PATH_V4, numStr);
-        //全景图计算根目录
-        String target = path + "_images";
-        //解压缩文件存放目录
-        String targetImagesPath = target + "/extras/images/";
-        //压缩文件保存目录
-        String zipTargetFilePath = targetImagesPath + file.getOriginalFilename();
-
-        //先删除本地文件
-        FileUtil.del(targetImagesPath);
-        File targetFile = new File(zipTargetFilePath);
-        if(!targetFile.getParentFile().exists()){
-            targetFile.getParentFile().mkdirs();
-        }
-        file.transferTo(targetFile);
-
-        //如果是压缩包上传,需要解压缩
-        int async = CommonStatus.NO.code();
-        if(file.getOriginalFilename().endsWith(".zip")){
-
-            //标记为异步处理
-            async = CommonStatus.YES.code();
-
-            //解压zip包
-            ZipUtil.unzip(zipTargetFilePath,targetImagesPath, CharsetUtil.CHARSET_GBK);
-            //删除压缩包
-            FileUtil.del(zipTargetFilePath);
-        }
-
-        //判断文件夹目录结构,图片必须放在压缩包根目录下,不支持空文件夹或其他格式文件上传
-        File[] files = new File(targetImagesPath).listFiles();
-        Arrays.stream(files).forEach(item->{
-            if(item.isDirectory()){
-                throw new BusinessException(ErrorCode.FAILURE_CODE_7018);
-            }
-        });
-
-        //获取解压后的文件列表
-        List<String> uploadFileList = FileUtils.getFileList(targetImagesPath);
-        if(CollUtil.isEmpty(uploadFileList)){
-            throw new BusinessException(ErrorCode.FAILURE_CODE_5062);
-        }
-
-        //判断是否有可用的jpg文件
-        boolean existJpg = false;
-        if(CollUtil.isNotEmpty(uploadFileList)){
-            existJpg = uploadFileList.stream().anyMatch(str -> {
-                if(str.endsWith(".jpg")){
-                    return true;
-                }
-                return false;
-            });
-        }
-        if(!existJpg){
-            throw new BusinessException(ErrorCode.FAILURE_CODE_5062);
-        }
-
-        //比对图片列表,不存在的要返回名称集合
-        List<SceneFileMapping> sceneFileMappings = sceneFileMappingService.getByScene(num, subgroup, upTime);
-        List<SceneFileMapping> panList = sceneFileMappings.stream().filter(v -> v.getKey().contains("images/pan/high/")).collect(Collectors.toList());
-        Map<String, SceneFileMapping> panMap = panList.stream().collect(Collectors.toMap(v -> FileUtil.getName(v.getKey()), v -> v));
-        List<String> panoramaImageList = panList.stream().map(v -> FileUtil.getName(v.getKey())).collect(Collectors.toList());
-
-        List<String> notExistFileList = uploadFileList.stream().filter(filePath -> {
-            filePath = filePath.substring(filePath.lastIndexOf(File.separator) + 1);
-            if(CollUtil.isEmpty(panoramaImageList) || panoramaImageList.contains(filePath)){
-                return false;
-            }
-            return true;
-        }).collect(Collectors.toList());
-
-        if(CollUtil.isNotEmpty(notExistFileList)){
-            //删除错误文件
-            notExistFileList.parallelStream().forEach(filePath->{
-                FileUtil.del(filePath);
-            });
-        }
-
-        //判断成功的图片,如果成功图片为0,就直接返回,不需要执行算法
-        uploadFileList = FileUtils.getFileList(targetImagesPath);
-        if(CollUtil.isEmpty(uploadFileList)){
-            if(CollUtil.isNotEmpty(notExistFileList)){
-                notExistFileList = notExistFileList.stream().map(filePath -> {
-                    return filePath.substring(filePath.lastIndexOf(File.separator) + 1);
-                }).collect(Collectors.toList());
-            }
-            return ResultData.ok(new UploadPanoramaVO(0,0, notExistFileList));
-        }
-
-        //上传
-        Map<String, String> map = new HashMap<>();
-
-        String imgViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, num);
-
-        //如果部分成功,则需要返回成功数量和失败列表
-        if(CollUtil.isNotEmpty(notExistFileList)){
-            notExistFileList = notExistFileList.stream().map(filePath -> {
-                return filePath.substring(filePath.lastIndexOf(File.separator) + 1);
-            }).collect(Collectors.toList());
-        }
-
-        UploadPanoramaVO uploadPanoramaVO = new UploadPanoramaVO();
-        uploadPanoramaVO.setAsyn(async);
-        if(async == CommonStatus.YES.code().intValue()){
-            List<String> finalUploadFileList = uploadFileList;
-            List<String> finalNotExistFileList = notExistFileList;
-            CompletableFuture.runAsync(() -> {
-                SceneAsynOperLog sceneAsynOperLog = new SceneAsynOperLog();
-                sceneAsynOperLog.setNum(num);
-                sceneAsynOperLog.setOperType(SceneAsynOperType.UPLOAD.code());
-                sceneAsynOperLog.setModule(SceneAsynModuleType.UPLOAD_DOWNLOAD.code());
-                sceneAsynOperLog.setFunc(SceneAsynFuncType.PANORAMIC_IMAGE.code());
-                if(CollUtil.isNotEmpty(finalNotExistFileList)){
-                    Map<String, Object> extData = new HashMap<>();
-                    extData.put("successCnt", finalUploadFileList.size());
-                    extData.put("failList", finalNotExistFileList);
-                    sceneAsynOperLog.setExtData(JSON.toJSONString(extData));
-                }
-                sceneAsynOperLogService.save(sceneAsynOperLog);
-                try {
-                    this.uploadPanoramaHandler(num,subgroup,upTime,target,imgViewPath, finalUploadFileList,targetImagesPath);
-                    sceneAsynOperLog.setState(CommonOperStatus.SUCCESS.code());
-                } catch (Exception e) {
-                    log.error("上传全景图报错,num:" + num, e);
-                    sceneAsynOperLog.setState(CommonOperStatus.FAILD.code());
-                }
-                sceneAsynOperLogService.updateById(sceneAsynOperLog);
-            });
-        }else{
-            this.uploadPanoramaHandler(num,subgroup,upTime,target,imgViewPath,uploadFileList,targetImagesPath);
-            if(CollUtil.isNotEmpty(notExistFileList)){
-                uploadPanoramaVO.setSuccessCnt(uploadFileList.size());
-                uploadPanoramaVO.setFailList(notExistFileList);
-            }
-        }
-
-        FileUtil.del(target);
-        return ResultData.ok(uploadPanoramaVO);
-    }
-
-    public void uploadPanoramaHandler(String num, Integer subgroup, String upTime, String target, String imgViewPath, List<String> uploadFileList, String targetImagesPath) throws Exception {
-
-        Map<String, String> map = new HashMap<>();
-        String resultPath = target + File.separator + "results/";
-        FileUtil.mkdir(resultPath);
-
-        //4K
-        String highPath = resultPath + "pan/high/";
-        //512
-        String lowPath = resultPath + "pan/low/";
-        List<String> origImgs = FileUtil.listFileNames(targetImagesPath);
-        for (String origImg : origImgs) {
-            FileUtil.copy(targetImagesPath + origImg, highPath + origImg, true);
-            map.put(highPath + origImg, imgViewPath + "pan/high/" + origImg);
-            ImgUtil.scale(new File(highPath + origImg), new File(lowPath + origImg), 0.125f);
-            map.put(lowPath + origImg, imgViewPath + "pan/low/" + origImg);
-        }
-
-        if(map.size()>0) {
-            fYunFileService.uploadMulFiles(num, subgroup, upTime, map);
-        }
-
-        //更新数据库版本号
-        Scene scenePlus = sceneService.getByNum(num, subgroup, upTime);
-        SceneEditInfo sceneEditInfo = this.getByScenePlusId(scenePlus.getId());
-        this.upgradeVersionAndImgVersionById(sceneEditInfo.getId());
-        //更新scenejson缓存和oss文件版本号
-        this.upgradeSceneJsonVersion(num, subgroup, upTime, scenePlus.getCacheKeyHasTime(), sceneEditInfo.getVersion() + 1, sceneEditInfo.getImgVersion() + 1);
-    }
-
-    @Override
-    public ResultData downloadPanorama(FileParamVO param) throws Exception {
-
-        String num = param.getNum();
-        Integer subgroup = param.getSubgroup();
-        String upTimeKey = param.getUpTimeKey();
-        String fileName = param.getFileName();
-
-        Scene scenePlus = sceneService.getByNum(num, subgroup, upTimeKey);
-        if(Objects.isNull(scenePlus)){
-            throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
-        }
-
-        //查询是否存在等待中的异步操作记录,如果存在,抛出业务异常,终止操作
-        sceneAsynOperLogService.checkSceneAsynOper(scenePlus.getId(),null, SceneAsynModuleType.UPLOAD_DOWNLOAD.code() , SceneAsynFuncType.PANORAMIC_IMAGE.code());
-
-        String numStr = RedisKey.getNumStr(num, subgroup, upTimeKey, scenePlus.getCacheKeyHasTime());
-        String cachePath = String.format(ConstantFilePath.SCENE_CACHE, numStr);
-        String localImagesPath =  String.format(ConstantFilePath.SCENE_CACHE_IMAGES, numStr);
-
-        String cacheFormat = "downloads/scene/%s/caches/";
-        String cacheImageFormat = "downloads/scene/%s/caches/images/";
-
-        List<SceneFileMapping> sceneFileMappings = sceneFileMappingService.getByScene(num, subgroup, upTimeKey);
-        List<SceneFileMapping> panList = sceneFileMappings.stream().filter(v -> v.getKey().contains("images/pan/high/")).collect(Collectors.toList());
-        Map<String, SceneFileMapping> panMap = panList.stream().collect(Collectors.toMap(v -> FileUtil.getName(v.getKey()), v -> v));
-
+//    @Override
+//    public ResultData uploadPanorama(String num, Integer subgroup, String upTime, MultipartFile file) throws Exception {
+//
+//        if(!file.getOriginalFilename().endsWith(".zip") && !file.getOriginalFilename().endsWith(".jpg")){
+//            throw new BusinessException(ErrorCode.FAILURE_CODE_7007, "jpg或者zip");
+//        }
+//
+//        Scene scenePlus = sceneService.getByNum(num, subgroup, upTime);
+//        if(scenePlus == null){
+//            throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
+//        }
+//
+//        //查询是否存在等待中的异步操作记录,如果存在,抛出业务异常,终止操作
+//        sceneAsynOperLogService.checkSceneAsynOper(scenePlus.getId(), null, SceneAsynModuleType.UPLOAD_DOWNLOAD.code() , SceneAsynFuncType.PANORAMIC_IMAGE.code());
+//
+//        //清除全景图异步操作记录,防止再次下载的时候请求到旧的压缩包
+//        sceneAsynOperLogService.cleanLog(scenePlus.getId(), SceneAsynModuleType.UPLOAD_DOWNLOAD.code(), SceneAsynFuncType.PANORAMIC_IMAGE.code());
+//
+//        //原始计算根目录
+//        String numStr = RedisKey.getNumStr(num, subgroup, upTime, scenePlus.getCacheKeyHasTime());
+//        String path = String.format(ConstantFilePath.SCENE_USER_PATH_V4, numStr);
+//        //全景图计算根目录
+//        String target = path + "_images";
+//        //解压缩文件存放目录
+//        String targetImagesPath = target + "/extras/images/";
+//        //压缩文件保存目录
+//        String zipTargetFilePath = targetImagesPath + file.getOriginalFilename();
+//
+//        //先删除本地文件
+//        FileUtil.del(targetImagesPath);
+//        File targetFile = new File(zipTargetFilePath);
+//        if(!targetFile.getParentFile().exists()){
+//            targetFile.getParentFile().mkdirs();
+//        }
+//        file.transferTo(targetFile);
+//
+//        //如果是压缩包上传,需要解压缩
+//        int async = CommonStatus.NO.code();
+//        if(file.getOriginalFilename().endsWith(".zip")){
+//
+//            //标记为异步处理
+//            async = CommonStatus.YES.code();
+//
+//            //解压zip包
+//            ZipUtil.unzip(zipTargetFilePath,targetImagesPath, CharsetUtil.CHARSET_GBK);
+//            //删除压缩包
+//            FileUtil.del(zipTargetFilePath);
+//        }
+//
+//        //判断文件夹目录结构,图片必须放在压缩包根目录下,不支持空文件夹或其他格式文件上传
+//        File[] files = new File(targetImagesPath).listFiles();
+//        Arrays.stream(files).forEach(item->{
+//            if(item.isDirectory()){
+//                throw new BusinessException(ErrorCode.FAILURE_CODE_7018);
+//            }
+//        });
+//
+//        //获取解压后的文件列表
+//        List<String> uploadFileList = FileUtils.getFileList(targetImagesPath);
+//        if(CollUtil.isEmpty(uploadFileList)){
+//            throw new BusinessException(ErrorCode.FAILURE_CODE_5062);
+//        }
+//
+//        //判断是否有可用的jpg文件
+//        boolean existJpg = false;
+//        if(CollUtil.isNotEmpty(uploadFileList)){
+//            existJpg = uploadFileList.stream().anyMatch(str -> {
+//                if(str.endsWith(".jpg")){
+//                    return true;
+//                }
+//                return false;
+//            });
+//        }
+//        if(!existJpg){
+//            throw new BusinessException(ErrorCode.FAILURE_CODE_5062);
+//        }
+//
+//        //比对图片列表,不存在的要返回名称集合
+//        List<SceneFileMapping> sceneFileMappings = sceneFileMappingService.getByScene(num, subgroup, upTime);
+//        List<SceneFileMapping> panList = sceneFileMappings.stream().filter(v -> v.getKey().contains("images/pan/high/")).collect(Collectors.toList());
+//        Map<String, SceneFileMapping> panMap = panList.stream().collect(Collectors.toMap(v -> FileUtil.getName(v.getKey()), v -> v));
 //        List<String> panoramaImageList = panList.stream().map(v -> FileUtil.getName(v.getKey())).collect(Collectors.toList());
-
-        Map<String, Object> map = new HashMap<>();
-
-        //标记是否是异步操作,默认是同步操作
-        //如果入参文件名不为空,则是单个文件下载,不需要打包
-        if(StrUtil.isNotEmpty(fileName)){
-            if(!panMap.keySet().contains(fileName)){
-                throw new BusinessException(ErrorCode.FAILURE_CODE_5063);
-            }
-            String url = panMap.get(fileName).getKey();
-            String downloadName = fileName;
-            map.put("asyn", CommonStatus.NO.code());
-            map.put("fileUrl", url);
-            map.put("fileName", downloadName);
-            return ResultData.ok(map);
-        }else{
-            //清除旧的下载记录
-            sceneAsynOperLogService.cleanLog(scenePlus.getId(), SceneAsynModuleType.UPLOAD_DOWNLOAD.code(), SceneAsynFuncType.PANORAMIC_IMAGE.code(), SceneAsynOperType.DOWNLOAD.code());
-
-            //开始异步执行下载全景图压缩包操作
-            CompletableFuture.runAsync(() -> {
-                SceneEditInfo sceneEditInfo = this.getByScenePlusId(scenePlus.getId());
-                SceneAsynOperLog sceneAsynOperLog = new SceneAsynOperLog();
-                sceneAsynOperLog.setNum(num);
-                sceneAsynOperLog.setSceneId(scenePlus.getId());
-                sceneAsynOperLog.setOperType(SceneAsynOperType.DOWNLOAD.code());
-                sceneAsynOperLog.setModule(SceneAsynModuleType.UPLOAD_DOWNLOAD.code());
-                sceneAsynOperLog.setFunc(SceneAsynFuncType.PANORAMIC_IMAGE.code());
-                sceneAsynOperLog.setVersion(sceneEditInfo.getImgVersion());
-                sceneAsynOperLogService.save(sceneAsynOperLog);
-                try {
-
-                    //下载到本地目录
-                    FileUtil.del(localImagesPath);
-                    for (SceneFileMapping sceneFileMapping : panList) {
-                        customHttpClient.downloadFile(sceneFileMapping.getUrl(), localImagesPath, fileName);
-
-                    }
-
-                    String downloadName = num + "_images.zip";
-                    //打包
-                    String zipPath = cachePath + downloadName;
-                    ZipUtil.zip(localImagesPath, zipPath);
-                    //上传压缩包
-                    fYunFileService.uploadFile(num, subgroup,upTimeKey,zipPath, String.format(cacheFormat, num) + downloadName);
-                    String url = String.format(cacheFormat, num) + downloadName;
-                    //删除本地压缩包
-                    FileUtil.del(zipPath);
-                    //删除本地目录
-                    FileUtil.del(localImagesPath);
-                    sceneAsynOperLog.setState(CommonOperStatus.SUCCESS.code());
-                    sceneAsynOperLog.setUrl(url);
-                }catch (Exception e){
-                    sceneAsynOperLog.setState(CommonOperStatus.FAILD.code());
-                    log.error("下载全景图压缩包失败,num:" + num, e);
-                }
-                sceneAsynOperLogService.saveOrUpdate(sceneAsynOperLog);
-            });
-
-            map.put("asyn", CommonStatus.YES.code());
-            return ResultData.ok(map);
-        }
-    }
+//
+//        List<String> notExistFileList = uploadFileList.stream().filter(filePath -> {
+//            filePath = filePath.substring(filePath.lastIndexOf(File.separator) + 1);
+//            if(CollUtil.isEmpty(panoramaImageList) || panoramaImageList.contains(filePath)){
+//                return false;
+//            }
+//            return true;
+//        }).collect(Collectors.toList());
+//
+//        if(CollUtil.isNotEmpty(notExistFileList)){
+//            //删除错误文件
+//            notExistFileList.parallelStream().forEach(filePath->{
+//                FileUtil.del(filePath);
+//            });
+//        }
+//
+//        //判断成功的图片,如果成功图片为0,就直接返回,不需要执行算法
+//        uploadFileList = FileUtils.getFileList(targetImagesPath);
+//        if(CollUtil.isEmpty(uploadFileList)){
+//            if(CollUtil.isNotEmpty(notExistFileList)){
+//                notExistFileList = notExistFileList.stream().map(filePath -> {
+//                    return filePath.substring(filePath.lastIndexOf(File.separator) + 1);
+//                }).collect(Collectors.toList());
+//            }
+//            return ResultData.ok(new UploadPanoramaVO(0,0, notExistFileList));
+//        }
+//
+//        //上传
+//        Map<String, String> map = new HashMap<>();
+//
+//        String imgViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, num);
+//
+//        //如果部分成功,则需要返回成功数量和失败列表
+//        if(CollUtil.isNotEmpty(notExistFileList)){
+//            notExistFileList = notExistFileList.stream().map(filePath -> {
+//                return filePath.substring(filePath.lastIndexOf(File.separator) + 1);
+//            }).collect(Collectors.toList());
+//        }
+//
+//        UploadPanoramaVO uploadPanoramaVO = new UploadPanoramaVO();
+//        uploadPanoramaVO.setAsyn(async);
+//        if(async == CommonStatus.YES.code().intValue()){
+//            List<String> finalUploadFileList = uploadFileList;
+//            List<String> finalNotExistFileList = notExistFileList;
+//            CompletableFuture.runAsync(() -> {
+//                SceneAsynOperLog sceneAsynOperLog = new SceneAsynOperLog();
+//                sceneAsynOperLog.setNum(num);
+//                sceneAsynOperLog.setOperType(SceneAsynOperType.UPLOAD.code());
+//                sceneAsynOperLog.setModule(SceneAsynModuleType.UPLOAD_DOWNLOAD.code());
+//                sceneAsynOperLog.setFunc(SceneAsynFuncType.PANORAMIC_IMAGE.code());
+//                if(CollUtil.isNotEmpty(finalNotExistFileList)){
+//                    Map<String, Object> extData = new HashMap<>();
+//                    extData.put("successCnt", finalUploadFileList.size());
+//                    extData.put("failList", finalNotExistFileList);
+//                    sceneAsynOperLog.setExtData(JSON.toJSONString(extData));
+//                }
+//                sceneAsynOperLogService.save(sceneAsynOperLog);
+//                try {
+//                    this.uploadPanoramaHandler(num,subgroup,upTime,target,imgViewPath, finalUploadFileList,targetImagesPath);
+//                    sceneAsynOperLog.setState(CommonOperStatus.SUCCESS.code());
+//                } catch (Exception e) {
+//                    log.error("上传全景图报错,num:" + num, e);
+//                    sceneAsynOperLog.setState(CommonOperStatus.FAILD.code());
+//                }
+//                sceneAsynOperLogService.updateById(sceneAsynOperLog);
+//            });
+//        }else{
+//            this.uploadPanoramaHandler(num,subgroup,upTime,target,imgViewPath,uploadFileList,targetImagesPath);
+//            if(CollUtil.isNotEmpty(notExistFileList)){
+//                uploadPanoramaVO.setSuccessCnt(uploadFileList.size());
+//                uploadPanoramaVO.setFailList(notExistFileList);
+//            }
+//        }
+//
+//        FileUtil.del(target);
+//        return ResultData.ok(uploadPanoramaVO);
+//    }
+//
+//    public void uploadPanoramaHandler(String num, Integer subgroup, String upTime, String target, String imgViewPath, List<String> uploadFileList, String targetImagesPath) throws Exception {
+//
+//        Map<String, String> map = new HashMap<>();
+//        String resultPath = target + File.separator + "results/";
+//        FileUtil.mkdir(resultPath);
+//
+//        //4K
+//        String highPath = resultPath + "pan/high/";
+//        //512
+//        String lowPath = resultPath + "pan/low/";
+//        List<String> origImgs = FileUtil.listFileNames(targetImagesPath);
+//        for (String origImg : origImgs) {
+//            FileUtil.copy(targetImagesPath + origImg, highPath + origImg, true);
+//            map.put(highPath + origImg, imgViewPath + "pan/high/" + origImg);
+//            ImgUtil.scale(new File(highPath + origImg), new File(lowPath + origImg), 0.125f);
+//            map.put(lowPath + origImg, imgViewPath + "pan/low/" + origImg);
+//        }
+//
+//        if(map.size()>0) {
+//            fYunFileService.uploadMulFiles(num, subgroup, upTime, map);
+//        }
+//
+//        //更新数据库版本号
+//        Scene scenePlus = sceneService.getByNum(num, subgroup, upTime);
+//        SceneEditInfo sceneEditInfo = this.getByScenePlusId(scenePlus.getId());
+//        this.upgradeVersionAndImgVersionById(sceneEditInfo.getId());
+//        //更新scenejson缓存和oss文件版本号
+//        this.upgradeSceneJsonVersion(num, subgroup, upTime, scenePlus.getCacheKeyHasTime(), sceneEditInfo.getVersion() + 1, sceneEditInfo.getImgVersion() + 1);
+//    }
+//
+//    @Override
+//    public ResultData downloadPanorama(FileParamVO param) throws Exception {
+//
+//        String num = param.getNum();
+//        Integer subgroup = param.getSubgroup();
+//        String upTimeKey = param.getUpTimeKey();
+//        String fileName = param.getFileName();
+//
+//        Scene scenePlus = sceneService.getByNum(num, subgroup, upTimeKey);
+//        if(Objects.isNull(scenePlus)){
+//            throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
+//        }
+//
+//        //查询是否存在等待中的异步操作记录,如果存在,抛出业务异常,终止操作
+//        sceneAsynOperLogService.checkSceneAsynOper(scenePlus.getId(),null, SceneAsynModuleType.UPLOAD_DOWNLOAD.code() , SceneAsynFuncType.PANORAMIC_IMAGE.code());
+//
+//        String numStr = RedisKey.getNumStr(num, subgroup, upTimeKey, scenePlus.getCacheKeyHasTime());
+//        String cachePath = String.format(ConstantFilePath.SCENE_CACHE, numStr);
+//        String localImagesPath =  String.format(ConstantFilePath.SCENE_CACHE_IMAGES, numStr);
+//
+//        String cacheFormat = "downloads/scene/%s/caches/";
+//        String cacheImageFormat = "downloads/scene/%s/caches/images/";
+//
+//        List<SceneFileMapping> sceneFileMappings = sceneFileMappingService.getByScene(num, subgroup, upTimeKey);
+//        List<SceneFileMapping> panList = sceneFileMappings.stream().filter(v -> v.getKey().contains("images/pan/high/")).collect(Collectors.toList());
+//        Map<String, SceneFileMapping> panMap = panList.stream().collect(Collectors.toMap(v -> FileUtil.getName(v.getKey()), v -> v));
+//
+////        List<String> panoramaImageList = panList.stream().map(v -> FileUtil.getName(v.getKey())).collect(Collectors.toList());
+//
+//        Map<String, Object> map = new HashMap<>();
+//
+//        //标记是否是异步操作,默认是同步操作
+//        //如果入参文件名不为空,则是单个文件下载,不需要打包
+//        if(StrUtil.isNotEmpty(fileName)){
+//            if(!panMap.keySet().contains(fileName)){
+//                throw new BusinessException(ErrorCode.FAILURE_CODE_5063);
+//            }
+//            String url = panMap.get(fileName).getKey();
+//            String downloadName = fileName;
+//            map.put("asyn", CommonStatus.NO.code());
+//            map.put("fileUrl", url);
+//            map.put("fileName", downloadName);
+//            return ResultData.ok(map);
+//        }else{
+//            //清除旧的下载记录
+//            sceneAsynOperLogService.cleanLog(scenePlus.getId(), SceneAsynModuleType.UPLOAD_DOWNLOAD.code(), SceneAsynFuncType.PANORAMIC_IMAGE.code(), SceneAsynOperType.DOWNLOAD.code());
+//
+//            //开始异步执行下载全景图压缩包操作
+//            CompletableFuture.runAsync(() -> {
+//                SceneEditInfo sceneEditInfo = this.getByScenePlusId(scenePlus.getId());
+//                SceneAsynOperLog sceneAsynOperLog = new SceneAsynOperLog();
+//                sceneAsynOperLog.setNum(num);
+//                sceneAsynOperLog.setSceneId(scenePlus.getId());
+//                sceneAsynOperLog.setOperType(SceneAsynOperType.DOWNLOAD.code());
+//                sceneAsynOperLog.setModule(SceneAsynModuleType.UPLOAD_DOWNLOAD.code());
+//                sceneAsynOperLog.setFunc(SceneAsynFuncType.PANORAMIC_IMAGE.code());
+//                sceneAsynOperLog.setVersion(sceneEditInfo.getImgVersion());
+//                sceneAsynOperLogService.save(sceneAsynOperLog);
+//                try {
+//
+//                    //下载到本地目录
+//                    FileUtil.del(localImagesPath);
+//                    for (SceneFileMapping sceneFileMapping : panList) {
+//                        customHttpClient.downloadFile(sceneFileMapping.getUrl(), localImagesPath, fileName);
+//
+//                    }
+//
+//                    String downloadName = num + "_images.zip";
+//                    //打包
+//                    String zipPath = cachePath + downloadName;
+//                    ZipUtil.zip(localImagesPath, zipPath);
+//                    //上传压缩包
+//                    fYunFileService.uploadFile(num, subgroup,upTimeKey,zipPath, String.format(cacheFormat, num) + downloadName);
+//                    String url = String.format(cacheFormat, num) + downloadName;
+//                    //删除本地压缩包
+//                    FileUtil.del(zipPath);
+//                    //删除本地目录
+//                    FileUtil.del(localImagesPath);
+//                    sceneAsynOperLog.setState(CommonOperStatus.SUCCESS.code());
+//                    sceneAsynOperLog.setUrl(url);
+//                }catch (Exception e){
+//                    sceneAsynOperLog.setState(CommonOperStatus.FAILD.code());
+//                    log.error("下载全景图压缩包失败,num:" + num, e);
+//                }
+//                sceneAsynOperLogService.saveOrUpdate(sceneAsynOperLog);
+//            });
+//
+//            map.put("asyn", CommonStatus.YES.code());
+//            return ResultData.ok(map);
+//        }
+//    }
 
     @Override
     public void saveTagsToSceneEditInfo(String num, Integer subgroup, String upTime, Integer cacheKeyHasTime, SceneEditInfo sceneEditInfo){

+ 6 - 4
src/main/java/com/fdkankan/scene/service/impl/SceneUploadServiceImpl.java

@@ -2,12 +2,14 @@ package com.fdkankan.scene.service.impl;
 
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.lang.UUID;
 import cn.hutool.core.util.StrUtil;
 import com.fdkankan.common.constant.ConstantFilePath;
 import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.constant.UploadFilePath;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.common.util.BASE64DecodedMultipartFile;
+import com.fdkankan.common.util.ESAPIUtil;
 import com.fdkankan.common.util.FdfsUtil;
 import com.fdkankan.redis.constant.RedisKey;
 import com.fdkankan.scene.bean.ResultData;
@@ -101,10 +103,10 @@ public class SceneUploadServiceImpl implements ISceneUploadService {
         for (MultipartFile file : files) {
             String fileName = file.getOriginalFilename();
             // 获取文件后缀
-            String prefix = fileName.substring(fileName.lastIndexOf("."));
-//            String path = String.format(ConstantFilePath.SCENE_TMP_PATH_V4, num).concat(UUID.randomUUID().toString()).concat(prefix);
-//            File tempFile = File.createTempFile(num + "-tmp-" + System.currentTimeMillis() + "-" + files.indexOf(file),prefix);
-            File tempFile = FileUtil.createTempFile(prefix, true);
+//            String prefix = fileName.substring(fileName.lastIndexOf("."));
+            String suffix = "." + FileUtil.getSuffix(fileName);
+            File tempFile = FileUtil.createTempFile(UUID.fastUUID().toString(), suffix, new File(ESAPIUtil.getRealPath("temp")), true);
+//            File tempFile = FileUtil.createTempFile(prefix, true);
             String path = tempFile.getAbsolutePath();
 //            FileUtil.mkParentDirs(path);
             file.transferTo(tempFile);

+ 152 - 0
src/main/resources/ESAPI-local.properties

@@ -0,0 +1,152 @@
+workDir=D:\\workPath\\
+# 是否要打印配置属性,默认为true
+ESAPI.printProperties=true
+
+ESAPI.AccessControl=org.owasp.esapi.reference.DefaultAccessController
+ESAPI.Authenticator=org.owasp.esapi.reference.FileBasedAuthenticator
+ESAPI.Encoder=org.owasp.esapi.reference.DefaultEncoder
+ESAPI.Encryptor=org.owasp.esapi.reference.crypto.JavaEncryptor
+ESAPI.Executor=org.owasp.esapi.reference.DefaultExecutor
+ESAPI.HTTPUtilities=org.owasp.esapi.reference.DefaultHTTPUtilities
+ESAPI.IntrusionDetector=org.owasp.esapi.reference.DefaultIntrusionDetector
+ESAPI.Logger=org.owasp.esapi.reference.JavaLogFactory
+ESAPI.Randomizer=org.owasp.esapi.reference.DefaultRandomizer
+ESAPI.Validator=org.owasp.esapi.reference.DefaultValidator
+
+
+#===========================================================================
+# ESAPI Encoder
+Encoder.AllowMultipleEncoding=false
+Encoder.AllowMixedEncoding=false
+Encoder.DefaultCodecList=HTMLEntityCodec,PercentCodec,JavaScriptCodec
+
+
+#===========================================================================
+# ESAPI 加密模块
+Encryptor.PreferredJCEProvider=
+Encryptor.EncryptionAlgorithm=AES
+Encryptor.CipherTransformation=AES/CBC/PKCS5Padding
+Encryptor.cipher_modes.combined_modes=GCM,CCM,IAPM,EAX,OCB,CWC
+Encryptor.cipher_modes.additional_allowed=CBC
+Encryptor.EncryptionKeyLength=128
+Encryptor.ChooseIVMethod=random
+Encryptor.fixedIV=0x000102030405060708090a0b0c0d0e0f
+Encryptor.CipherText.useMAC=true
+Encryptor.PlainText.overwrite=true
+Encryptor.HashAlgorithm=SHA-512
+Encryptor.HashIterations=1024
+Encryptor.DigitalSignatureAlgorithm=SHA1withDSA
+Encryptor.DigitalSignatureKeyLength=1024
+Encryptor.RandomAlgorithm=SHA1PRNG
+Encryptor.CharacterEncoding=UTF-8
+Encryptor.KDF.PRF=HmacSHA256
+
+#===========================================================================
+# ESAPI Http工具
+
+HttpUtilities.UploadDir=D:\\ESAPI\\upload
+#HttpUtilities.UploadTempDir=D:\\temp
+# Force flags on cookies, if you use HttpUtilities to set cookies
+HttpUtilities.ForceHttpOnlySession=false
+HttpUtilities.ForceSecureSession=false
+HttpUtilities.ForceHttpOnlyCookies=true
+HttpUtilities.ForceSecureCookies=true
+# Maximum size of HTTP headers
+HttpUtilities.MaxHeaderSize=4096
+# File upload configuration
+HttpUtilities.ApprovedUploadExtensions=.zip,.pdf,.doc,.docx,.ppt,.pptx,.tar,.gz,.tgz,.rar,.war,.jar,.ear,.xls,.rtf,.properties,.java,.class,.txt,.xml,.jsp,.jsf,.exe,.dll
+HttpUtilities.MaxUploadFileBytes=500000000
+# Using UTF-8 throughout your stack is highly recommended. That includes your database driver,
+# container, and any other technologies you may be using. Failure to do this may expose you
+# to Unicode transcoding injection attacks. Use of UTF-8 does not hinder internationalization.
+HttpUtilities.ResponseContentType=text/html; charset=UTF-8
+# This is the name of the cookie used to represent the HTTP session
+# Typically this will be the default "JSESSIONID"
+HttpUtilities.HttpSessionIdName=JSESSIONID
+
+
+
+#===========================================================================
+# ESAPI Executor
+Executor.WorkingDirectory=
+Executor.ApprovedExecutables=
+
+
+#===========================================================================
+# ESAPI Logging
+# Set the application name if these logs are combined with other applications
+Logger.ApplicationName=ExampleApplication
+# If you use an HTML log viewer that does not properly HTML escape log data, you can set LogEncodingRequired to true
+Logger.LogEncodingRequired=false
+# Determines whether ESAPI should log the application name. This might be clutter in some single-server/single-app environments.
+Logger.LogApplicationName=true
+# Determines whether ESAPI should log the server IP and port. This might be clutter in some single-server environments.
+Logger.LogServerIP=true
+# LogFileName, the name of the logging file. Provide a full directory path (e.g., C:\\ESAPI\\ESAPI_logging_file) if you
+# want to place it in a specific directory.
+Logger.LogFileName=ESAPI_logging_file
+# MaxLogFileSize, the max size (in bytes) of a single log file before it cuts over to a new one (default is 10,000,000)
+Logger.MaxLogFileSize=10000000
+
+
+#===========================================================================
+# ESAPI Intrusion Detection
+IntrusionDetector.Disable=false
+IntrusionDetector.event.test.count=2
+IntrusionDetector.event.test.interval=10
+IntrusionDetector.event.test.actions=disable,log
+
+IntrusionDetector.org.owasp.esapi.errors.IntrusionException.count=1
+IntrusionDetector.org.owasp.esapi.errors.IntrusionException.interval=1
+IntrusionDetector.org.owasp.esapi.errors.IntrusionException.actions=log,disable,logout
+
+IntrusionDetector.org.owasp.esapi.errors.IntegrityException.count=10
+IntrusionDetector.org.owasp.esapi.errors.IntegrityException.interval=5
+IntrusionDetector.org.owasp.esapi.errors.IntegrityException.actions=log,disable,logout
+
+IntrusionDetector.org.owasp.esapi.errors.AuthenticationHostException.count=2
+IntrusionDetector.org.owasp.esapi.errors.AuthenticationHostException.interval=10
+IntrusionDetector.org.owasp.esapi.errors.AuthenticationHostException.actions=log,logout
+
+
+#===========================================================================
+# ESAPI 校验器
+#校验器的配置文件
+Validator.ConfigurationFile=validation.properties
+
+# Validators used by ESAPI
+Validator.AccountName=^[a-zA-Z0-9]{3,20}$
+Validator.SystemCommand=^[a-zA-Z\\-\\/]{1,64}$
+Validator.RoleName=^[a-z]{1,20}$
+
+#the word TEST below should be changed to your application
+#name - only relative URL's are supported
+Validator.Redirect=^\\/test.*$
+
+# Global HTTP Validation Rules
+# Values with Base64 encoded data (e.g. encrypted state) will need at least [a-zA-Z0-9\/+=]
+Validator.HTTPScheme=^(http|https)$
+Validator.HTTPServerName=^[a-zA-Z0-9_.\\-]*$
+Validator.HTTPParameterName=^[a-zA-Z0-9_]{1,32}$
+Validator.HTTPParameterValue=^[a-zA-Z0-9.\\-\\/+=@_ ]*$
+Validator.HTTPCookieName=^[a-zA-Z0-9\\-_]{1,32}$
+Validator.HTTPCookieValue=^[a-zA-Z0-9\\-\\/+=_ ]*$
+
+# Note that max header name capped at 150 in SecurityRequestWrapper!
+Validator.HTTPHeaderName=^[a-zA-Z0-9\\-_]{1,50}$
+Validator.HTTPHeaderValue=^[a-zA-Z0-9()\\-=\\*\\.\\?;,+\\/:&_ ]*$
+Validator.HTTPContextPath=^\\/?[a-zA-Z0-9.\\-\\/_]*$
+Validator.HTTPServletPath=^[a-zA-Z0-9.\\-\\/_]*$
+Validator.HTTPPath=^[a-zA-Z0-9.\\-_]*$
+Validator.HTTPQueryString=^[a-zA-Z0-9()\\-=\\*\\.\\?;,+\\/:&_ %]*$
+Validator.HTTPURI=^[a-zA-Z0-9()\\-=\\*\\.\\?;,+\\/:&_ ]*$
+Validator.HTTPURL=^.*$
+Validator.HTTPJSESSIONID=^[A-Z0-9]{10,30}$
+
+# Validation of file related input
+Validator.FileName=^[a-zA-Z0-9!@#$%^&{}\\[\\]()_+\\-=,.~'` ]{1,255}$
+Validator.DirectoryName=^[a-zA-Z0-9:/\\\\!@#$%^&{}\\[\\]()_+\\-=,.~'` ]{1,255}$
+
+# Validation of dates. Controls whether or not 'lenient' dates are accepted.
+# See DataFormat.setLenient(boolean flag) for further details.
+Validator.AcceptLenientDates=false

+ 152 - 0
src/main/resources/ESAPI.properties

@@ -0,0 +1,152 @@
+workDir=/app/4dkankan/
+# 是否要打印配置属性,默认为true
+ESAPI.printProperties=true
+
+ESAPI.AccessControl=org.owasp.esapi.reference.DefaultAccessController
+ESAPI.Authenticator=org.owasp.esapi.reference.FileBasedAuthenticator
+ESAPI.Encoder=org.owasp.esapi.reference.DefaultEncoder
+ESAPI.Encryptor=org.owasp.esapi.reference.crypto.JavaEncryptor
+ESAPI.Executor=org.owasp.esapi.reference.DefaultExecutor
+ESAPI.HTTPUtilities=org.owasp.esapi.reference.DefaultHTTPUtilities
+ESAPI.IntrusionDetector=org.owasp.esapi.reference.DefaultIntrusionDetector
+ESAPI.Logger=org.owasp.esapi.reference.JavaLogFactory
+ESAPI.Randomizer=org.owasp.esapi.reference.DefaultRandomizer
+ESAPI.Validator=org.owasp.esapi.reference.DefaultValidator
+
+
+#===========================================================================
+# ESAPI Encoder
+Encoder.AllowMultipleEncoding=false
+Encoder.AllowMixedEncoding=false
+Encoder.DefaultCodecList=HTMLEntityCodec,PercentCodec,JavaScriptCodec
+
+
+#===========================================================================
+# ESAPI 加密模块
+Encryptor.PreferredJCEProvider=
+Encryptor.EncryptionAlgorithm=AES
+Encryptor.CipherTransformation=AES/CBC/PKCS5Padding
+Encryptor.cipher_modes.combined_modes=GCM,CCM,IAPM,EAX,OCB,CWC
+Encryptor.cipher_modes.additional_allowed=CBC
+Encryptor.EncryptionKeyLength=128
+Encryptor.ChooseIVMethod=random
+Encryptor.fixedIV=0x000102030405060708090a0b0c0d0e0f
+Encryptor.CipherText.useMAC=true
+Encryptor.PlainText.overwrite=true
+Encryptor.HashAlgorithm=SHA-512
+Encryptor.HashIterations=1024
+Encryptor.DigitalSignatureAlgorithm=SHA1withDSA
+Encryptor.DigitalSignatureKeyLength=1024
+Encryptor.RandomAlgorithm=SHA1PRNG
+Encryptor.CharacterEncoding=UTF-8
+Encryptor.KDF.PRF=HmacSHA256
+
+#===========================================================================
+# ESAPI Http工具
+
+HttpUtilities.UploadDir=D:\\ESAPI\\upload
+#HttpUtilities.UploadTempDir=D:\\temp
+# Force flags on cookies, if you use HttpUtilities to set cookies
+HttpUtilities.ForceHttpOnlySession=false
+HttpUtilities.ForceSecureSession=false
+HttpUtilities.ForceHttpOnlyCookies=true
+HttpUtilities.ForceSecureCookies=true
+# Maximum size of HTTP headers
+HttpUtilities.MaxHeaderSize=4096
+# File upload configuration
+HttpUtilities.ApprovedUploadExtensions=.zip,.pdf,.doc,.docx,.ppt,.pptx,.tar,.gz,.tgz,.rar,.war,.jar,.ear,.xls,.rtf,.properties,.java,.class,.txt,.xml,.jsp,.jsf,.exe,.dll
+HttpUtilities.MaxUploadFileBytes=500000000
+# Using UTF-8 throughout your stack is highly recommended. That includes your database driver,
+# container, and any other technologies you may be using. Failure to do this may expose you
+# to Unicode transcoding injection attacks. Use of UTF-8 does not hinder internationalization.
+HttpUtilities.ResponseContentType=text/html; charset=UTF-8
+# This is the name of the cookie used to represent the HTTP session
+# Typically this will be the default "JSESSIONID"
+HttpUtilities.HttpSessionIdName=JSESSIONID
+
+
+
+#===========================================================================
+# ESAPI Executor
+Executor.WorkingDirectory=
+Executor.ApprovedExecutables=
+
+
+#===========================================================================
+# ESAPI Logging
+# Set the application name if these logs are combined with other applications
+Logger.ApplicationName=ExampleApplication
+# If you use an HTML log viewer that does not properly HTML escape log data, you can set LogEncodingRequired to true
+Logger.LogEncodingRequired=false
+# Determines whether ESAPI should log the application name. This might be clutter in some single-server/single-app environments.
+Logger.LogApplicationName=true
+# Determines whether ESAPI should log the server IP and port. This might be clutter in some single-server environments.
+Logger.LogServerIP=true
+# LogFileName, the name of the logging file. Provide a full directory path (e.g., C:\\ESAPI\\ESAPI_logging_file) if you
+# want to place it in a specific directory.
+Logger.LogFileName=ESAPI_logging_file
+# MaxLogFileSize, the max size (in bytes) of a single log file before it cuts over to a new one (default is 10,000,000)
+Logger.MaxLogFileSize=10000000
+
+
+#===========================================================================
+# ESAPI Intrusion Detection
+IntrusionDetector.Disable=false
+IntrusionDetector.event.test.count=2
+IntrusionDetector.event.test.interval=10
+IntrusionDetector.event.test.actions=disable,log
+
+IntrusionDetector.org.owasp.esapi.errors.IntrusionException.count=1
+IntrusionDetector.org.owasp.esapi.errors.IntrusionException.interval=1
+IntrusionDetector.org.owasp.esapi.errors.IntrusionException.actions=log,disable,logout
+
+IntrusionDetector.org.owasp.esapi.errors.IntegrityException.count=10
+IntrusionDetector.org.owasp.esapi.errors.IntegrityException.interval=5
+IntrusionDetector.org.owasp.esapi.errors.IntegrityException.actions=log,disable,logout
+
+IntrusionDetector.org.owasp.esapi.errors.AuthenticationHostException.count=2
+IntrusionDetector.org.owasp.esapi.errors.AuthenticationHostException.interval=10
+IntrusionDetector.org.owasp.esapi.errors.AuthenticationHostException.actions=log,logout
+
+
+#===========================================================================
+# ESAPI 校验器
+#校验器的配置文件
+Validator.ConfigurationFile=validation.properties
+
+# Validators used by ESAPI
+Validator.AccountName=^[a-zA-Z0-9]{3,20}$
+Validator.SystemCommand=^[a-zA-Z\\-\\/]{1,64}$
+Validator.RoleName=^[a-z]{1,20}$
+
+#the word TEST below should be changed to your application
+#name - only relative URL's are supported
+Validator.Redirect=^\\/test.*$
+
+# Global HTTP Validation Rules
+# Values with Base64 encoded data (e.g. encrypted state) will need at least [a-zA-Z0-9\/+=]
+Validator.HTTPScheme=^(http|https)$
+Validator.HTTPServerName=^[a-zA-Z0-9_.\\-]*$
+Validator.HTTPParameterName=^[a-zA-Z0-9_]{1,32}$
+Validator.HTTPParameterValue=^[a-zA-Z0-9.\\-\\/+=@_ ]*$
+Validator.HTTPCookieName=^[a-zA-Z0-9\\-_]{1,32}$
+Validator.HTTPCookieValue=^[a-zA-Z0-9\\-\\/+=_ ]*$
+
+# Note that max header name capped at 150 in SecurityRequestWrapper!
+Validator.HTTPHeaderName=^[a-zA-Z0-9\\-_]{1,50}$
+Validator.HTTPHeaderValue=^[a-zA-Z0-9()\\-=\\*\\.\\?;,+\\/:&_ ]*$
+Validator.HTTPContextPath=^\\/?[a-zA-Z0-9.\\-\\/_]*$
+Validator.HTTPServletPath=^[a-zA-Z0-9.\\-\\/_]*$
+Validator.HTTPPath=^[a-zA-Z0-9.\\-_]*$
+Validator.HTTPQueryString=^[a-zA-Z0-9()\\-=\\*\\.\\?;,+\\/:&_ %]*$
+Validator.HTTPURI=^[a-zA-Z0-9()\\-=\\*\\.\\?;,+\\/:&_ ]*$
+Validator.HTTPURL=^.*$
+Validator.HTTPJSESSIONID=^[A-Z0-9]{10,30}$
+
+# Validation of file related input
+Validator.FileName=^[a-zA-Z0-9!@#$%^&{}\\[\\]()_+\\-=,.~'` ]{1,255}$
+Validator.DirectoryName=^[a-zA-Z0-9:/\\\\!@#$%^&{}\\[\\]()_+\\-=,.~'` ]{1,255}$
+
+# Validation of dates. Controls whether or not 'lenient' dates are accepted.
+# See DataFormat.setLenient(boolean flag) for further details.
+Validator.AcceptLenientDates=false

+ 73 - 0
src/main/resources/application-local.yml

@@ -0,0 +1,73 @@
+spring:
+  application:
+    name: chntzcgl-zcszhgl-vr
+    syscode: CT00017
+  cloud:
+    nacos:
+      discovery:
+        server-addr: 10.180.22.20:8848
+        access-key: 856fc5859800857975ecb986b2d61363
+  datasource:
+    dynamic:
+      primary: vr
+      strict: false
+      datasource:
+        vr:
+          url: jdbc:postgresql://10.180.145.98:5432/chinatower_vr
+          username: res_vr
+          password: qawsed@123.
+          driver-class-name: org.postgresql.Driver
+          hikari:
+            maximum-pool-size: 20 #连接池最大连接数
+            minimum-idle: 5 #连接池最小连接数
+            connection-timeout: 30000
+            idle-timeout: 600000
+            max-lifetime: 1800000
+            connection-test-query: SELECT 1 FROM DUAL
+        3d:
+          url: jdbc:postgresql://10.180.145.98:5432/chinatower_3d?currentSchema=chinatower_3d
+          username: res_vr
+          password: qawsed@123.
+          driver-class-name: org.postgresql.Driver
+          hikari:
+            maximum-pool-size: 20 #连接池最大连接数
+            minimum-idle: 5 #连接池最小连接数
+            connection-timeout: 30000
+            idle-timeout: 600000
+            max-lifetime: 1800000
+            connection-test-query: SELECT 1 FROM DUAL
+mybatis-plus:
+  mapper-locations: classpath:mapper/*Mapper.xml
+  configuration:
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+
+tieta:
+  sysCode: CT00017
+  serverName: scene
+  checkToken:
+    syscode: CHNTZCGL_ZCSZHGL
+  device-address: http://10.180.41.34:9528
+
+redis:
+  host: http://10.180.22.54:8081
+
+tlog:
+  enable-invoke-time-print: true
+
+gateway:
+  url: http://10.180.22.22:8097
+
+fdfs:
+  sysCode: CT00017
+  address: http://10.180.22.41:8761
+  api:
+    getSignature: /ChinatowerFileService/getSignature
+    uploadFile: /ChinatowerFileService/uploadFile/
+
+
+
+
+
+
+
+

+ 7 - 0
src/main/resources/validation.properties

@@ -0,0 +1,7 @@
+# 校验某个字段的正则表达式
+Validator.SafeString=^[.\\p{Alnum}\\p{Space}]{0,1024}$
+Validator.Email=^[A-Za-z0-9._%'-]+@[A-Za-z0-9.-]+\\.[a-zA-Z]{2,4}$
+Validator.IPAddress=^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$
+Validator.URL=^(ht|f)tp(s?)\\:\\/\\/[0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])*(:(0-9)*)*(\\/?)([a-zA-Z0-9\\-\\.\\?\\,\\:\\'\\/\\\\\\+=&amp;%\\$#_]*)?$
+Validator.CreditCard=^(\\d{4}[- ]?){3}\\d{4}$
+Validator.SSN=^(?!000)([0-6]\\d{2}|7([0-6]\\d|7[012]))([ -]?)(?!00)\\d\\d\\3(?!0000)\\d{4}$