dengsixing 11 月之前
父節點
當前提交
98f196768b

+ 10 - 0
src/main/java/com/fdkankan/common/annotation/NotResponseAdvice.java

@@ -0,0 +1,10 @@
+package com.fdkankan.common.annotation;
+
+import java.lang.annotation.*;
+
+@Target({ElementType.PARAMETER, ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface NotResponseAdvice {
+    String description() default "";
+}

+ 71 - 0
src/main/java/com/fdkankan/common/response/BaseResponseAdvice.java

@@ -0,0 +1,71 @@
+package com.fdkankan.common.response;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.common.annotation.NotResponseAdvice;
+import com.fdkankan.scene.bean.ResultData;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.core.MethodParameter;
+import org.springframework.http.MediaType;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.server.ServerHttpRequest;
+import org.springframework.http.server.ServerHttpResponse;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
+
+import java.util.Objects;
+
+@ConditionalOnMissingBean(name = "customResponseAdvice")
+@RestControllerAdvice
+@Slf4j
+public class BaseResponseAdvice implements ResponseBodyAdvice<Object> {
+
+    @Value("${language:zh_CN}")
+    private String language;
+
+    @Override
+    public boolean supports(MethodParameter methodParameter, Class<? extends HttpMessageConverter<?>> aClass) {
+        NotResponseAdvice methodAnnotation = methodParameter.getMethodAnnotation(NotResponseAdvice.class);
+        if(Objects.nonNull(methodAnnotation)){
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public Object beforeBodyWrite(Object body, MethodParameter methodParameter,
+        MediaType mediaType, Class<? extends HttpMessageConverter<?>> aClass,
+        ServerHttpRequest serverHttpRequest, ServerHttpResponse serverHttpResponse) {
+//        if(serverHttpRequest.getURI().getPath().contains("feign")){
+//            return body;
+//        }
+//        log.info("响应拦截成功。。。");
+//        List<String> strings = serverHttpRequest.getHeaders().get("Accept-Language");
+//        System.out.println(strings.get(0));
+
+        //admin监控请求,直接返回
+        if(serverHttpRequest.getURI().getPath().contains("actuator")){
+            return body;
+        }
+
+        if(body instanceof String){
+            return JSONObject.toJSONString(ResultData.ok(body));
+        }
+        if (body instanceof ResultData) {
+            return getI18n((ResultData) body);
+        } else {
+            return getI18n(ResultData.ok(body));
+        }
+    }
+
+    private ResultData getI18n(ResultData data){
+        if("zh_CN".equals(language)){
+           return data;
+        }
+        data.setMessage(null);
+        return data;
+    }
+
+}

+ 42 - 41
src/main/java/com/fdkankan/redis/util/RedisClient.java

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.scene.httpclient.CustomHttpClient;
 import com.fdkankan.scene.httpclient.CustomHttpClient;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 import com.google.common.collect.Sets;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
@@ -14,6 +15,7 @@ import javax.annotation.Resource;
 import java.util.*;
 import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
+@Slf4j
 @Component
 @Component
 public class RedisClient {
 public class RedisClient {
 
 
@@ -59,13 +61,13 @@ public class RedisClient {
         Map<String, Object> params = new HashMap<>();
         Map<String, Object> params = new HashMap<>();
         params.put("key", this.genKey(key));
         params.put("key", this.genKey(key));
         JSONObject jsonObject = customHttpClient.postJson(url, params);
         JSONObject jsonObject = customHttpClient.postJson(url, params);
-        if(Objects.isNull(jsonObject) || !"0".equals(jsonObject.getString("status"))){
-            throw new RuntimeException("redis delKey error");
-        }
-        Boolean success = jsonObject.getBoolean("data");
-        if(!success){
-            throw new RuntimeException("redis delKey failed");
-        }
+//        if(Objects.isNull(jsonObject) || !"0".equals(jsonObject.getString("status"))){
+//            throw new RuntimeException("redis delKey error");
+//        }
+//        Boolean success = jsonObject.getBoolean("data");
+//        if(!success){
+//            throw new RuntimeException("redis delKey failed");
+//        }
     }
     }
 
 
     public void add(String key, String value){
     public void add(String key, String value){
@@ -74,9 +76,9 @@ public class RedisClient {
          params.put("key", this.genKey(key));
          params.put("key", this.genKey(key));
          params.put("value", value);
          params.put("value", value);
          JSONObject jsonObject = customHttpClient.postJson(url, params);
          JSONObject jsonObject = customHttpClient.postJson(url, params);
-         if(Objects.isNull(jsonObject) || !"0".equals(jsonObject.getString("status"))){
-             throw new RuntimeException("redis add string error");
-         }
+//         if(Objects.isNull(jsonObject) || !"0".equals(jsonObject.getString("status"))){
+//             throw new RuntimeException("redis add string error");
+//         }
     }
     }
 
 
     public String get(String key){
     public String get(String key){
@@ -84,9 +86,9 @@ public class RedisClient {
         Map<String, Object> params = new HashMap<>();
         Map<String, Object> params = new HashMap<>();
         params.put("key", this.genKey(key));
         params.put("key", this.genKey(key));
         JSONObject jsonObject = customHttpClient.postJson(url, params);
         JSONObject jsonObject = customHttpClient.postJson(url, params);
-        if(Objects.isNull(jsonObject) || !"0".equals(jsonObject.getString("status"))){
-            throw new RuntimeException("redis get string error");
-        }
+//        if(Objects.isNull(jsonObject) || !"0".equals(jsonObject.getString("status"))){
+//            throw new RuntimeException("redis get string error");
+//        }
         return jsonObject.getString("data");
         return jsonObject.getString("data");
     }
     }
 
 
@@ -96,9 +98,9 @@ public class RedisClient {
         params.put("key", this.genKey(key));
         params.put("key", this.genKey(key));
         params.put("values", JSON.toJSONString(values));
         params.put("values", JSON.toJSONString(values));
         JSONObject jsonObject = customHttpClient.postJson(url, params);
         JSONObject jsonObject = customHttpClient.postJson(url, params);
-        if(Objects.isNull(jsonObject) || !"0".equals(jsonObject.getString("status"))){
-            throw new RuntimeException("redis add set error");
-        }
+//        if(Objects.isNull(jsonObject) || !"0".equals(jsonObject.getString("status"))){
+//            throw new RuntimeException("redis add set error");
+//        }
     }
     }
 
 
     public Set<String> sGet(String key){
     public Set<String> sGet(String key){
@@ -106,9 +108,9 @@ public class RedisClient {
         Map<String, Object> params = new HashMap<>();
         Map<String, Object> params = new HashMap<>();
         params.put("key", this.genKey(key));
         params.put("key", this.genKey(key));
         JSONObject jsonObject = customHttpClient.postJson(url, params);
         JSONObject jsonObject = customHttpClient.postJson(url, params);
-        if(Objects.isNull(jsonObject) || !"0".equals(jsonObject.getString("status"))){
-            throw new RuntimeException("redis set getall error");
-        }
+//        if(Objects.isNull(jsonObject) || !"0".equals(jsonObject.getString("status"))){
+//            throw new RuntimeException("redis set getall error");
+//        }
         List<String> data = jsonObject.getJSONArray("data").toJavaList(String.class);
         List<String> data = jsonObject.getJSONArray("data").toJavaList(String.class);
         return new HashSet<>(data);
         return new HashSet<>(data);
     }
     }
@@ -119,9 +121,9 @@ public class RedisClient {
         params.put("key", this.genKey(key));
         params.put("key", this.genKey(key));
         params.put("values", values);
         params.put("values", values);
         JSONObject jsonObject = customHttpClient.postJson(url, params);
         JSONObject jsonObject = customHttpClient.postJson(url, params);
-        if(Objects.isNull(jsonObject) || !"0".equals(jsonObject.getString("status"))){
-            throw new RuntimeException("redis set srem error");
-        }
+//        if(Objects.isNull(jsonObject) || !"0".equals(jsonObject.getString("status"))){
+//            throw new RuntimeException("redis set srem error");
+//        }
     }
     }
 
 
     public void hmset(String key, Map<String, String> values){
     public void hmset(String key, Map<String, String> values){
@@ -130,9 +132,10 @@ public class RedisClient {
         params.put("key", this.genKey(key));
         params.put("key", this.genKey(key));
         params.put("values", values);
         params.put("values", values);
         JSONObject jsonObject = customHttpClient.postJson(url, params);
         JSONObject jsonObject = customHttpClient.postJson(url, params);
-        if(Objects.isNull(jsonObject) || !"0".equals(jsonObject.getString("status"))){
-            throw new RuntimeException("redis hash add error");
-        }
+        log.info("hash set result:{}", jsonObject);
+//        if(Objects.isNull(jsonObject) || !"0".equals(jsonObject.getString("status"))){
+//            throw new RuntimeException("redis hash add error");
+//        }
     }
     }
 
 
 
 
@@ -141,14 +144,12 @@ public class RedisClient {
         Map<String, Object> params = new HashMap<>();
         Map<String, Object> params = new HashMap<>();
         params.put("key", this.genKey(key));
         params.put("key", this.genKey(key));
         JSONObject jsonObject = customHttpClient.postJson(url, params);
         JSONObject jsonObject = customHttpClient.postJson(url, params);
-        if(Objects.isNull(jsonObject) || !"0".equals(jsonObject.getString("status"))){
-            throw new RuntimeException("redis hash hscan error");
-        }
+
         JSONObject data = jsonObject.getJSONObject("data");
         JSONObject data = jsonObject.getJSONObject("data");
         // 转换为Map<String, String>
         // 转换为Map<String, String>
         Map<String, String> map = new HashMap<>();
         Map<String, String> map = new HashMap<>();
         for (String k : data.keySet()) {
         for (String k : data.keySet()) {
-            map.put(key, jsonObject.getString(key));
+            map.put(k, data.getString(k));
         }
         }
         return map;
         return map;
     }
     }
@@ -167,9 +168,9 @@ public class RedisClient {
         Map<String, Object> params = new HashMap<>();
         Map<String, Object> params = new HashMap<>();
         params.put("key", this.genKey(key));
         params.put("key", this.genKey(key));
         JSONObject jsonObject = customHttpClient.postJson(url, params);
         JSONObject jsonObject = customHttpClient.postJson(url, params);
-        if(Objects.isNull(jsonObject) || !"0".equals(jsonObject.getString("status"))){
-            throw new RuntimeException("redis hash get hvals error");
-        }
+//        if(Objects.isNull(jsonObject) || !"0".equals(jsonObject.getString("status"))){
+//            throw new RuntimeException("redis hash get hvals error");
+//        }
         List<String> data = jsonObject.getJSONArray("data").toJavaList(String.class);
         List<String> data = jsonObject.getJSONArray("data").toJavaList(String.class);
         return data;
         return data;
     }
     }
@@ -184,9 +185,9 @@ public class RedisClient {
             params.put("field", field);
             params.put("field", field);
             String url = host + url_hash_hdel;
             String url = host + url_hash_hdel;
             JSONObject jsonObject = customHttpClient.postJson(url, params);
             JSONObject jsonObject = customHttpClient.postJson(url, params);
-            if(Objects.isNull(jsonObject) || !"0".equals(jsonObject.getString("status"))){
-                throw new RuntimeException("redis hash hdel error");
-            }
+//            if(Objects.isNull(jsonObject) || !"0".equals(jsonObject.getString("status"))){
+//                throw new RuntimeException("redis hash hdel error");
+//            }
         });
         });
     }
     }
 
 
@@ -197,9 +198,9 @@ public class RedisClient {
         Map<String, Object> params = new HashMap<>();
         Map<String, Object> params = new HashMap<>();
         params.put("keyValueBatch", keyValMap);
         params.put("keyValueBatch", keyValMap);
         JSONObject jsonObject = customHttpClient.postJson(url, params);
         JSONObject jsonObject = customHttpClient.postJson(url, params);
-        if(Objects.isNull(jsonObject) || !"0".equals(jsonObject.getString("status"))){
-            throw new RuntimeException("redis list rPushBatch error");
-        }
+//        if(Objects.isNull(jsonObject) || !"0".equals(jsonObject.getString("status"))){
+//            throw new RuntimeException("redis list rPushBatch error");
+//        }
     }
     }
 
 
     public List<String> lGet(String key, long start, long end){
     public List<String> lGet(String key, long start, long end){
@@ -209,9 +210,9 @@ public class RedisClient {
         params.put("Start", start);
         params.put("Start", start);
         params.put("End", end);
         params.put("End", end);
         JSONObject jsonObject = customHttpClient.postJson(url, params);
         JSONObject jsonObject = customHttpClient.postJson(url, params);
-        if(Objects.isNull(jsonObject) || !"0".equals(jsonObject.getString("status"))){
-            throw new RuntimeException("redis list get error");
-        }
+//        if(Objects.isNull(jsonObject) || !"0".equals(jsonObject.getString("status"))){
+//            throw new RuntimeException("redis list get error");
+//        }
 
 
         return jsonObject.getJSONArray("data").toJavaList(String.class);
         return jsonObject.getJSONArray("data").toJavaList(String.class);
     }
     }

+ 14 - 3
src/main/java/com/fdkankan/scene/controller/OssFileMappingController.java

@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.*;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.IOException;
+import java.util.Objects;
 
 
 /**
 /**
  * 场景编辑管理
  * 场景编辑管理
@@ -20,12 +21,22 @@ public class OssFileMappingController {
     @Autowired
     @Autowired
     private SceneService sceneService;
     private SceneService sceneService;
 
 
-    @GetMapping("/{num}/{dir}/{fileName}")
-    public void outFileByKey2(@PathVariable("num") String num, @PathVariable("dir") String dir,
-                              @PathVariable("fileName") String fileName,
+    @GetMapping("/**")
+    public void outFileByKey2(Integer subgroup,
                               HttpServletRequest request,
                               HttpServletRequest request,
                               HttpServletResponse response) throws IOException {
                               HttpServletResponse response) throws IOException {
         String key = request.getServletPath().replaceFirst("/", "").replace("scene_edit_data", "scene_view_data");
         String key = request.getServletPath().replaceFirst("/", "").replace("scene_edit_data", "scene_view_data");
+        if(Objects.nonNull(subgroup)){
+            String[] split = key.split("/");
+            StringBuilder keyBuilder = new StringBuilder();
+            for (int i = 0; i < split.length; i++){
+                keyBuilder.append(split[i]);
+                if(i == 1){
+                    keyBuilder.append("-" + subgroup);
+                }
+            }
+            key = keyBuilder.toString();
+        }
         sceneService.outFileByKey2(key, response);
         sceneService.outFileByKey2(key, response);
     }
     }
 
 

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

@@ -269,22 +269,21 @@ public class SceneEditController{
 //    public ResultData deleteStyles(@RequestBody @Validated DeleteStylesParamVO param) throws Exception {
 //    public ResultData deleteStyles(@RequestBody @Validated DeleteStylesParamVO param) throws Exception {
 //        return sceneEditInfoService.deleteStyles(param);
 //        return sceneEditInfoService.deleteStyles(param);
 //    }
 //    }
-//
-//    /**
-//     * <p>
-//            场景关联列表
-//     * </p>
-//     * @author dengsixing
-//     * @date 2022/8/1
-//     * @param num
-//     * @return com.fdkankan.web.response.ResultData
-//     **/
-//    @CheckPermit
-//    @PostMapping(value = "/linkPan/list")
-//    public ResultData listLinkPan(@RequestParam(value = "num") String num) throws Exception {
-//        return sceneEditInfoService.listLinkPan(num);
-//    }
-//
+
+    /**
+     * <p>
+            场景关联列表
+     * </p>
+     * @author dengsixing
+     * @date 2022/8/1
+     * @param num
+     * @return com.fdkankan.web.response.ResultData
+     **/
+    @PostMapping(value = "/linkPan/list")
+    public ResultData listLinkPan(@RequestParam(value = "num") String num) throws Exception {
+        return sceneEditInfoService.listLinkPan(num);
+    }
+
     /**
     /**
      * <p>
      * <p>
      保存户型图
      保存户型图

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

@@ -77,8 +77,8 @@ public interface SceneEditInfoService extends IService<SceneEditInfo> {
 //    ResultData uploadLinkPan(String num, String sid, String fileName, MultipartFile file) throws Exception;
 //    ResultData uploadLinkPan(String num, String sid, String fileName, MultipartFile file) throws Exception;
 //
 //
 //    ResultData saveLinkPan(SaveLinkPanParamVO param) throws Exception;
 //    ResultData saveLinkPan(SaveLinkPanParamVO param) throws Exception;
-//
-//    ResultData listLinkPan(String num) throws Exception;
+
+    ResultData listLinkPan(String num) throws Exception;
 //
 //
 //    ResultData deleteLinkPan(DeleteLinkPanParamVO param) throws Exception;
 //    ResultData deleteLinkPan(DeleteLinkPanParamVO param) throws Exception;
 //
 //

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

@@ -20,6 +20,7 @@ import com.fdkankan.scene.entity.*;
 import com.fdkankan.scene.mapper.SceneEditInfoMapper;
 import com.fdkankan.scene.mapper.SceneEditInfoMapper;
 import com.fdkankan.scene.service.*;
 import com.fdkankan.scene.service.*;
 import com.fdkankan.scene.vo.*;
 import com.fdkankan.scene.vo.*;
+import com.google.common.collect.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
@@ -466,7 +467,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<SceneEditInfoMapper, S
         for (SceneFileMapping sceneFileMapping : mappings) {
         for (SceneFileMapping sceneFileMapping : mappings) {
             keyMap.put(sceneFileMapping.getKey(), "service/scene/file?key=" + sceneFileMapping.getKey());
             keyMap.put(sceneFileMapping.getKey(), "service/scene/file?key=" + sceneFileMapping.getKey());
         }
         }
-        sceneInfoVO.setMapping(keyMap);
+//        sceneInfoVO.setMapping(keyMap);
 
 
         //马赛克列表
         //马赛克列表
         sceneInfoVO.setMosaicList(this.getMosaicList(num));
         sceneInfoVO.setMosaicList(this.getMosaicList(num));
@@ -2150,20 +2151,20 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<SceneEditInfoMapper, S
 //        });
 //        });
 //
 //
 //    }
 //    }
-//
-//    @Override
-//    public ResultData listLinkPan(String num) throws Exception {
-//
+
+    @Override
+    public ResultData listLinkPan(String num) throws Exception {
+
 //        this.syncLinPanFromFileToRedis(num);
 //        this.syncLinPanFromFileToRedis(num);
-//
+
 //        this.syncLinkPanStylesFromFileToRedis(num);
 //        this.syncLinkPanStylesFromFileToRedis(num);
-//
-//        JSONObject result = new JSONObject();
-//
+
+        JSONObject result = new JSONObject();
+
 //        //查询场景关联数据
 //        //查询场景关联数据
 //        String key = String.format(RedisKey.SCENE_LINKPAN_DATA, num);
 //        String key = String.format(RedisKey.SCENE_LINKPAN_DATA, num);
 //        Map<String, String> allTagsMap = redisUtil.hmget(key);
 //        Map<String, String> allTagsMap = redisUtil.hmget(key);
-//        List<JSONObject> tags = Lists.newArrayList();
+        List<JSONObject> tags = Lists.newArrayList();
 //        List<TagBean> tagBeanList = new ArrayList<>();
 //        List<TagBean> tagBeanList = new ArrayList<>();
 //        if(CollUtil.isNotEmpty(allTagsMap)){
 //        if(CollUtil.isNotEmpty(allTagsMap)){
 //            allTagsMap.entrySet().stream().forEach(entry -> {
 //            allTagsMap.entrySet().stream().forEach(entry -> {
@@ -2183,10 +2184,10 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<SceneEditInfoMapper, S
 //                return tag;
 //                return tag;
 //            }).collect(Collectors.toList());
 //            }).collect(Collectors.toList());
 //        }
 //        }
-//        result.put("tags", tags);
+        result.put("tags", tags);
 //
 //
 //        //封装styles数据
 //        //封装styles数据
-//        List<JSONObject> styles = Lists.newArrayList();
+        List<JSONObject> styles = Lists.newArrayList();
 //        key = String.format(RedisKey.SCENE_LINKPAN_STYLES, num);
 //        key = String.format(RedisKey.SCENE_LINKPAN_STYLES, num);
 //        Map<String, String> styleMap = redisUtil.hmget(key);
 //        Map<String, String> styleMap = redisUtil.hmget(key);
 //        if(CollUtil.isNotEmpty(styleMap)) {
 //        if(CollUtil.isNotEmpty(styleMap)) {
@@ -2199,10 +2200,10 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<SceneEditInfoMapper, S
 //        //图标按写入时间排序
 //        //图标按写入时间排序
 //        styles = this.sortStyles(styles);
 //        styles = this.sortStyles(styles);
 //
 //
-//        result.put("styles", styles);
-//
-//        return ResultData.ok(result);
-//    }
+        result.put("styles", styles);
+
+        return ResultData.ok(result);
+    }
 //
 //
 //    private List<JSONObject> sortStyles(List<JSONObject> styles){
 //    private List<JSONObject> sortStyles(List<JSONObject> styles){
 //
 //

+ 1 - 1
src/main/java/com/fdkankan/scene/service/impl/SceneServiceImpl.java

@@ -86,7 +86,7 @@ public class SceneServiceImpl extends ServiceImpl<SceneMapper, Scene> implements
         for (SceneFileMapping sceneFileMapping : mappingList) {
         for (SceneFileMapping sceneFileMapping : mappingList) {
             keyMap.put(sceneFileMapping.getKey(), "service/scene/file?key=" + sceneFileMapping.getKey());
             keyMap.put(sceneFileMapping.getKey(), "service/scene/file?key=" + sceneFileMapping.getKey());
         }
         }
-        sceneInfoVO.setMapping(keyMap);
+//        sceneInfoVO.setMapping(keyMap);
 
 
         return ResultData.ok(sceneInfoVO);
         return ResultData.ok(sceneInfoVO);
     }
     }

+ 5 - 3
src/main/java/com/fdkankan/scene/service/impl/SceneUploadServiceImpl.java

@@ -105,10 +105,12 @@ public class SceneUploadServiceImpl implements ISceneUploadService {
             String fileName = file.getOriginalFilename();
             String fileName = file.getOriginalFilename();
             // 获取文件后缀
             // 获取文件后缀
             String prefix = fileName.substring(fileName.lastIndexOf("."));
             String prefix = fileName.substring(fileName.lastIndexOf("."));
-            String path = String.format(ConstantFilePath.SCENE_TMP_PATH_V4, num).concat(UUID.randomUUID().toString()).concat(prefix);
+//            String path = String.format(ConstantFilePath.SCENE_TMP_PATH_V4, num).concat(UUID.randomUUID().toString()).concat(prefix);
 //            File newFile = File.createTempFile(UUID.randomUUID().toString() ,prefix);
 //            File newFile = File.createTempFile(UUID.randomUUID().toString() ,prefix);
-            FileUtil.mkParentDirs(path);
-            file.transferTo(new File(path));
+            File tempFile = FileUtil.createTempFile(prefix, true);
+            String path = tempFile.getAbsolutePath();
+//            FileUtil.mkParentDirs(path);
+            file.transferTo(tempFile);
             String realFileName = fileName;
             String realFileName = fileName;
             if(files.size() ==1 && StringUtils.isNotBlank(sendFileName)){
             if(files.size() ==1 && StringUtils.isNotBlank(sendFileName)){
                 realFileName = sendFileName ;
                 realFileName = sendFileName ;

+ 1 - 1
src/main/java/com/fdkankan/scene/vo/SceneInfoVO.java

@@ -255,7 +255,7 @@ public class SceneInfoVO {
      */
      */
     private JSONObject started;
     private JSONObject started;
 
 
-    private Map<String, String> mapping;
+//    private Map<String, String> mapping;
 
 
 
 
 }
 }