Browse Source

合并主干修复的bug

xiewenjie 3 năm trước cách đây
mục cha
commit
b61c300c34
30 tập tin đã thay đổi với 332 bổ sung407 xóa
  1. 4 5
      pom.xml
  2. 0 4
      sxz-application/src/main/resources/application-dev.properties
  3. 0 1
      sxz-application/src/main/resources/application-devuat.properties
  4. 0 1
      sxz-application/src/main/resources/application-prod.properties
  5. 0 1
      sxz-application/src/main/resources/application-uat.properties
  6. 0 5
      sxz-base/pom.xml
  7. 119 0
      sxz-base/src/main/java/com/fdkk/sxz/Interceptor/QueryStringEscapeInterceptor.java
  8. 1 1
      sxz-base/src/main/java/com/fdkk/sxz/constant/CodeConstant.java
  9. 15 0
      sxz-base/src/main/java/com/fdkk/sxz/util/EscapeUtil.java
  10. 3 38
      sxz-base/src/main/java/com/fdkk/sxz/util/OkHttpUtils.java
  11. 9 11
      sxz-core/src/main/java/com/fdkk/sxz/other/listener/RunBuild.java
  12. 28 9
      sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/ManagerController.java
  13. 2 1
      sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/SceneController.java
  14. 4 3
      sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/SceneStyleController.java
  15. 28 10
      sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/custom/ComponetManagerController.java
  16. 4 2
      sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/custom/CustomManagerController.java
  17. 1 8
      sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/testController.java
  18. 1 1
      sxz-core/src/main/java/com/fdkk/sxz/webApi/service/IModelUploadService.java
  19. 8 0
      sxz-core/src/main/java/com/fdkk/sxz/webApi/service/custom/ICustomComponentClassifyService.java
  20. 35 1
      sxz-core/src/main/java/com/fdkk/sxz/webApi/service/custom/impl/CustomComponentClassifyServiceImpl.java
  21. 12 0
      sxz-core/src/main/java/com/fdkk/sxz/webApi/service/custom/impl/CustomComponentServiceImpl.java
  22. 5 5
      sxz-core/src/main/java/com/fdkk/sxz/webApi/service/custom/impl/CustomProductFirstclassifyServiceImpl.java
  23. 37 23
      sxz-core/src/main/java/com/fdkk/sxz/webApi/service/custom/impl/CustomProductServiceImpl.java
  24. 9 6
      sxz-core/src/main/java/com/fdkk/sxz/webApi/service/impl/ModelUploadServiceImpl.java
  25. 4 0
      sxz-core/src/main/java/com/fdkk/sxz/webApi/service/impl/RenovationPartsDetailServiceImpl.java
  26. 0 199
      sxz-core/src/main/java/com/fdkk/sxz/webApi/socketController/ComponentSocket.java
  27. 0 49
      sxz-core/src/main/java/com/fdkk/sxz/webApi/socketController/testJacache.java
  28. 0 23
      sxz-modules/src/main/java/com/fdkk/sxz/enums/ModelUploadType.java
  29. 1 0
      sxz-modules/src/main/java/com/fdkk/sxz/vo/request/RequestCustom.java
  30. 2 0
      sxz-modules/src/main/java/com/fdkk/sxz/vo/response/ResponseCustomComponent.java

+ 4 - 5
pom.xml

@@ -345,11 +345,10 @@
                 </exclusion>
             </exclusions>
         </dependency>
-
-        <dependency>
-            <groupId>org.yeauty</groupId>
-            <artifactId>netty-websocket-spring-boot-starter</artifactId>
-            <version>0.12.0</version>
+        <dependency><!-- Ehcache 3.x //-->
+            <groupId>org.ehcache</groupId>
+            <artifactId>ehcache</artifactId>
+            <version>3.4.0</version>
         </dependency>
         <!-- 钉钉告警 -->
         <!--		<dependency>-->

+ 0 - 4
sxz-application/src/main/resources/application-dev.properties

@@ -86,7 +86,3 @@ max.obj.url=http://192.168.0.75:8080/
 dingding.warning.address=https://oapi.dingtalk.com/robot/send?access_token=13ae02d6821a56ce86c3e6ad98d0260896eba5888a9bd18aed141c39f11299a8
 #缓存接口日志时间(单位小时)
 logsTimeOut=4
-
-
-ws.port=8889
-

+ 0 - 1
sxz-application/src/main/resources/application-devuat.properties

@@ -85,4 +85,3 @@ max.obj.url=http://192.168.0.75:8080/
 dingding.warning.address=https://oapi.dingtalk.com/robot/send?access_token=13ae02d6821a56ce86c3e6ad98d0260896eba5888a9bd18aed141c39f11299a8
 #缓存接口日志时间(单位小时)
 logsTimeOut=4
-ws.port=8889

+ 0 - 1
sxz-application/src/main/resources/application-prod.properties

@@ -85,4 +85,3 @@ model.build.url=http://101.66.188.5:8100/
 max.obj.url=http://120.78.65.189:8080/
 #缓存接口日志时间(单位小时)
 logsTimeOut=4
-ws.port=8889

+ 0 - 1
sxz-application/src/main/resources/application-uat.properties

@@ -85,4 +85,3 @@ max.obj.url=http://192.168.0.75:8080/
 dingding.warning.address=https://oapi.dingtalk.com/robot/send?access_token=13ae02d6821a56ce86c3e6ad98d0260896eba5888a9bd18aed141c39f11299a8
 #缓存接口日志时间(单位小时)
 logsTimeOut=4
-ws.port=8889

+ 0 - 5
sxz-base/pom.xml

@@ -250,11 +250,6 @@
             <groupId>net.oschina.j2cache</groupId>
             <artifactId>j2cache-core</artifactId>
         </dependency>
-        <!-- websocket -->
-        <dependency>
-            <groupId>org.yeauty</groupId>
-            <artifactId>netty-websocket-spring-boot-starter</artifactId>
-        </dependency>
     </dependencies>
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

+ 119 - 0
sxz-base/src/main/java/com/fdkk/sxz/Interceptor/QueryStringEscapeInterceptor.java

@@ -0,0 +1,119 @@
+package com.fdkk.sxz.Interceptor;
+
+
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.fdkk.sxz.util.EscapeUtil;
+import org.apache.ibatis.cache.CacheKey;
+import org.apache.ibatis.executor.Executor;
+import org.apache.ibatis.mapping.BoundSql;
+import org.apache.ibatis.mapping.MappedStatement;
+import org.apache.ibatis.plugin.*;
+import org.apache.ibatis.session.ResultHandler;
+import org.apache.ibatis.session.RowBounds;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Properties;
+import java.util.Set;
+
+
+@Component
+@Intercepts(
+        { @Signature(type = Executor.class, method = "query", args =
+                { MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class }),
+                @Signature(type = Executor.class, method = "query", args =
+                        { MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class, CacheKey.class, BoundSql.class }) })
+public class QueryStringEscapeInterceptor implements Interceptor
+{
+
+    @Override
+    public Object intercept(Invocation invocation) throws Throwable {
+        // 拦截sql
+        Object[] args = invocation.getArgs();
+        MappedStatement statement = (MappedStatement)args[0];
+        Object parameterObject = args[1];
+        BoundSql boundSql = statement.getBoundSql(parameterObject);
+        String sql = boundSql.getSql();
+        // 处理特殊字符
+        modifyLikeSql(sql, parameterObject, boundSql);
+        // 返回
+        return invocation.proceed();
+    }
+
+    @Override
+    public Object plugin(Object target) {
+        return Plugin.wrap(target, this);
+    }
+
+    @Override
+    public void setProperties(Properties properties) {
+
+    }
+
+    @SuppressWarnings("unchecked")
+    public static String modifyLikeSql(String sql, Object parameterObject, BoundSql boundSql) {
+        if (parameterObject instanceof HashMap) {
+        } else {
+            return sql;
+        }
+        if (!sql.toLowerCase().contains(" like ") || !sql.toLowerCase().contains("?")) {
+            return sql;
+        }
+        // 获取关键字的个数(去重)
+        String[] strList = sql.split("\\?");
+        Set<String> keyNames = new HashSet<>();
+        for (int i = 0; i < strList.length; i++) {
+            if (strList[i].toLowerCase().contains(" like ")) {
+                String keyName = boundSql.getParameterMappings().get(i).getProperty();
+                keyNames.add(keyName);
+            }
+        }
+        // 对关键字进行特殊字符“清洗”,如果有特殊字符的,在特殊字符前添加转义字符(\)
+        for (String keyName : keyNames) {
+            HashMap parameter = (HashMap)parameterObject;
+            if (keyName.contains("ew.paramNameValuePairs.") && sql.toLowerCase().contains(" like ?")) {
+                // 第一种情况:在业务层进行条件构造产生的模糊查询关键字
+                if (parameter.get("ew") instanceof QueryWrapper){
+                    QueryWrapper wrapper = (QueryWrapper)parameter.get("ew");
+                    parameter = (HashMap)wrapper.getParamNameValuePairs();
+                }
+                else if (parameter.get("ew") instanceof LambdaQueryWrapper){
+                    LambdaQueryWrapper lambdaQueryWrapper = (LambdaQueryWrapper)parameter.get("ew");
+                    parameter = (HashMap)lambdaQueryWrapper.getParamNameValuePairs();
+                }
+                String[] keyList = keyName.split("\\.");
+                // ew.paramNameValuePairs.MPGENVAL1,截取字符串之后,获取第三个,即为参数名
+                Object a = parameter.get(keyList[2]);
+                if (a instanceof String && (a.toString().contains("_") || a.toString().contains("\\") || a.toString()
+                        .contains("%"))) {
+                    parameter.put(keyList[2],
+                            "%" + EscapeUtil.escapeChar(a.toString().substring(1, a.toString().length() - 1)) + "%");
+                }
+            } else if (!keyName.contains("ew.paramNameValuePairs.") && sql.toLowerCase().contains(" like ?")) {
+                // 第二种情况:未使用条件构造器,但是在service层进行了查询关键字与模糊查询符`%`手动拼接
+                Object a = parameter.get(keyName);
+                if (a instanceof String && (a.toString().contains("_") || a.toString().contains("\\") || a.toString()
+                        .contains("%"))) {
+                    parameter.put(keyName,
+                            "%" + EscapeUtil.escapeChar(a.toString().substring(1, a.toString().length() - 1)) + "%");
+                }
+            } else {
+                // 第三种情况:在Mapper类的注解SQL中进行了模糊查询的拼接
+                Object a = parameter.get(keyName);
+                if (a instanceof String && (a.toString().contains("_") || a.toString().contains("\\") || a.toString()
+                        .contains("%"))) {
+                    parameter.put(keyName, EscapeUtil.escapeChar(a.toString()));
+                }
+            }
+        }
+        return sql;
+    }
+}

+ 1 - 1
sxz-base/src/main/java/com/fdkk/sxz/constant/CodeConstant.java

@@ -53,7 +53,7 @@ public class CodeConstant {
     public static final String FAILURE_MSG_4015 = "更新模型库,syncmodel接口失败";
 
     public static final int FAILURE_CODE_4016 = 4016;
-    public static final String FAILURE_MSG_4016 = "全景图预览渲染中,请稍后重试";
+    public static final String FAILURE_MSG_4016 = "普通图预览渲染中,请稍后再试";
 
     public static final int INVALID_RE_VCODE_10000011= 10000011;
     public static final String FAILURE_MSG_10000011 = "验证码错误";

+ 15 - 0
sxz-base/src/main/java/com/fdkk/sxz/util/EscapeUtil.java

@@ -0,0 +1,15 @@
+package com.fdkk.sxz.util;
+
+import cn.hutool.core.util.StrUtil;
+
+public class EscapeUtil {
+    //mysql的模糊查询时特殊字符转义
+    public static String escapeChar(String before){
+        if(StrUtil.isNotBlank(before)){
+            before = before.replaceAll("\\\\", "\\\\\\\\");
+            before = before.replaceAll("_", "\\\\_");
+            before = before.replaceAll("%", "\\\\%");
+        }
+        return before ;
+    }
+}

+ 3 - 38
sxz-base/src/main/java/com/fdkk/sxz/util/OkHttpUtils.java

@@ -118,42 +118,6 @@ public class OkHttpUtils {
         return null;
     }
 
-
-    public static JSONObject httpPostFormReturnJson(String url, Map<String, String> paramsMap, Map<String, String> headers) {
-        if (url == null || "".equals(url)) {
-            log.error("url为null!");
-            return null;
-        }
-        // 添加请求类型
-        MultipartBody.Builder builder = new MultipartBody.Builder();
-        builder.setType(MediaType.parse("multipart/form-data"));
-
-        // 追加表单信息
-        paramsMap.forEach((String key, String value) -> builder.addFormDataPart(key, value));
-
-        RequestBody formBody = builder.build();
-
-        Request.Builder requestBuilder = new Request.Builder().url(url);
-        if (headers != null && headers.size() > 0) {
-            headers.forEach((k, v) -> requestBuilder.addHeader(k, v));
-        }
-
-        Request request = requestBuilder.post(formBody).build();
-        try {
-            Response response = okHttpClient.newCall(request).execute();
-            if (response.code() == 200) {
-                log.info("http PostForm 请求成功; [url={}, requestContent={}]", url, paramsMap.toString());
-                return JSON.parseObject(response.body().string());
-            } else {
-                log.warn("Http PostForm 请求失败; [ errorCode = {}, url={}, param={}]", response.code(), url, paramsMap.toString());
-            }
-        } catch (IOException e) {
-            throw new RuntimeException("同步http请求失败,url:" + url, e);
-        }
-        return null;
-    }
-
-
     /**
      * get请求
      * 对于小文档,响应体上的string()方法非常方便和高效。
@@ -218,8 +182,9 @@ public class OkHttpUtils {
         try {
             Response response = okHttpClient.newCall(request).execute();
             if (response.code() == 200) {
-                log.info("http Post 请求成功; [url={}, requestContent={}]", url, json);
-                return response.body().string();
+                String returnStr = response.body().string();
+                log.info("http Post 请求成功; [url={}, requestContent={},return={}]", url, json,returnStr);
+                return returnStr;
             } else {
                 log.warn("Http POST 请求失败; [ errorCode = {}, url={}, param={}]", response.code(), url, json);
             }

+ 9 - 11
sxz-core/src/main/java/com/fdkk/sxz/other/listener/RunBuild.java

@@ -3,6 +3,8 @@ package com.fdkk.sxz.other.listener;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.io.file.FileReader;
+import cn.hutool.core.io.file.FileWriter;
+import cn.hutool.core.util.IdUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSON;
@@ -13,13 +15,12 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.fdkk.sxz.constant.ConstantFileName;
 import com.fdkk.sxz.constant.ConstantFilePath;
 import com.fdkk.sxz.entity.*;
-import com.fdkk.sxz.enums.ModelUploadType;
+import com.fdkk.sxz.entity.custuom.CustomComponentEntity;
 import com.fdkk.sxz.other.mq.TopicRabbitConfig;
 import com.fdkk.sxz.webApi.service.*;
 import com.fdkk.sxz.util.*;
 import com.fdkk.sxz.webApi.service.custom.ICustomComponentService;
 import lombok.extern.slf4j.Slf4j;
-import net.oschina.j2cache.CacheChannel;
 import org.springframework.amqp.rabbit.annotation.RabbitHandler;
 import org.springframework.amqp.rabbit.annotation.RabbitListener;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -29,6 +30,7 @@ import org.springframework.util.CollectionUtils;
 
 import java.io.File;
 import java.io.IOException;
+import java.net.URI;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
 
@@ -81,12 +83,6 @@ public class RunBuild {
     @Autowired
     private RedisUtil redisUtil;
 
-
-    @Autowired
-    private CacheChannel cacheChannel;
-
-
-
     @RabbitHandler
     @RabbitListener(queues = TopicRabbitConfig.CHANGE)
     public void change(String str) {
@@ -969,7 +965,7 @@ public class RunBuild {
                         postJson(fileId, filePath, postJsonObj);
 
                         Thread.sleep(1000L);
-
+                        postJsonObj.remove("params1");
                         checkResultJson(fileId, filePath, postJsonObj, modelUploadId);
 
                         String productName ="";
@@ -1071,7 +1067,6 @@ public class RunBuild {
 //                    componentModelUploadEntity.setImgPath(objPath.replace(buildPath, "").replace(".obj", "") + ".jpg");
                         componentModelUploadEntity.setObjPath(objPath.replace(buildPath, ""));
                         componentModelUploadService.updateById(componentModelUploadEntity);
-                        redisUtil.setEx("componentUploadStatus:id:"+componentModelUploadEntity.getId(),"done",30,TimeUnit.MINUTES);
                         break;
 
                     default:
@@ -1124,6 +1119,8 @@ public class RunBuild {
         boolean over = false;
         while (true) {
             String checkResult = OkHttpUtils.httpPostJson(modelBuildUrl + "check", jsonObject.toJSONString());
+            log.info("checkResult的长度为-{}", checkResult.length());
+
             JSONObject checkJson = JSONObject.parseObject(checkResult);
 
             JSONArray checkArray = checkJson.getJSONArray("msg");
@@ -1216,6 +1213,7 @@ public class RunBuild {
 
         String path = buildPath + "upload";
         String filePath = path + File.separator + fileId + File.separator;
+
         switch (uploadType){
             case "1":
                 endProductHandler(fileId, userId, modelId, dataJson, taskType, uploadType, filePath);
@@ -1409,7 +1407,7 @@ public class RunBuild {
                 }
 
                 if (objectJson.containsKey("progress")) {
-                    if (uploadType.equals(ModelUploadType.COMPONENT.getValue())){
+                    if (uploadType.equals("3")){
                         ComponentModelUploadEntity  componentModelUploadEntity = new ComponentModelUploadEntity();
                         componentModelUploadEntity.setId(Long.valueOf(modelId));
                         componentModelUploadEntity.setProgress(objectJson.getInteger("progress"));

+ 28 - 9
sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/ManagerController.java

@@ -1,5 +1,7 @@
 package com.fdkk.sxz.webApi.controller;
 
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
@@ -590,10 +592,24 @@ public class ManagerController extends BaseController {
         paramsMap.put("outFilePath",buildPath + buildPath + modelUploadEntity.getObjPath().replace(".obj", ""));
         OkHttpUtils.httpPostForm(maxObjUrl+"toToolbag",paramsMap);
         Thread.sleep(1000);
-        uploadToOssUtil.uploadTo4dTjw(buildPath + modelUploadEntity.getObjPath().replace(".obj", ".mview"), "domain/eHome/furniture/temp/" + modelUploadEntity.getFileId() + ".mview");
-        log.info("配件obj转换成mview格式结束{}",modelUploadEntity.getObjPath().replace(".obj", ".mview"));
-
 
+        log.info("上传开始");
+        int count=4;
+        boolean flag=true;
+        while (flag){
+            if(FileUtil.exist(buildPath + modelUploadEntity.getObjPath().replace(".obj", ".mview"))){
+                log.info("文件存在");
+                uploadToOssUtil.uploadTo4dTjw(buildPath + modelUploadEntity.getObjPath().replace(".obj", ".mview"), "domain/eHome/furniture/temp/" + modelUploadEntity.getFileId() + ".mview");
+                flag=false;
+            }else {
+                Thread.sleep(1000);
+            }
+            if (count<=0){
+                break;
+            }
+            count -= 1;
+        }
+        log.info("配件obj转换成mview格式结束{}",modelUploadEntity.getObjPath().replace(".obj", ".mview"));
 
         //obj转换成glb格式
         String glbPath = buildPath + "upload/" + modelUploadEntity.getFileId() + "/" + modelUploadEntity.getFileId() + ".glb";
@@ -627,10 +643,12 @@ public class ManagerController extends BaseController {
         RenovationPartsDetailEntity renovationPartsDetailEntity = new RenovationPartsDetailEntity();
         BeanUtils.copyProperties(param, renovationPartsDetailEntity);
         renovationPartsDetailEntity.setExamine(0);
-        renovationPartsDetailEntity.setMviewPath(prefix + "domain/eHome/furniture/temp/" + modelUploadEntity.getFileId() + ".mview");
         renovationPartsDetailEntity.setName(modelUploadEntity.getFileId());
         renovationPartsDetailEntity.setPath(prefix + "domain/eHome/furniture/temp/" + modelUploadEntity.getFileId() + ".glb");
-
+        if(FileUtil.exist(buildPath + modelUploadEntity.getObjPath().replace(".obj", ".mview"))){
+            log.info("文件存在");
+            renovationPartsDetailEntity.setMviewPath(prefix + "domain/eHome/furniture/temp/" + modelUploadEntity.getFileId() + ".mview");
+        }
         //入库前先提交模型到模型库,失败返回提示
         String version = SnowFlakeUUidUtils.generaUUid(null, null, null);
         JSONObject jsonObject = new JSONObject();
@@ -783,9 +801,11 @@ public class ManagerController extends BaseController {
                     renovationPartsDetailEntity.getImg().replace("/temp/", "/models/").replace(prefix, ""));
             uploadToOssUtil.copyTo4dTjw(renovationPartsDetailEntity.getPath().replace(prefix, ""),
                     renovationPartsDetailEntity.getPath().replace("/temp/", "/models/").replace(prefix, ""));
-
-            uploadToOssUtil.copyTo4dTjw(renovationPartsDetailEntity.getMviewPath().replace(prefix, ""),
-                    renovationPartsDetailEntity.getMviewPath().replace("/temp/", "/models/").replace(prefix, ""));
+            if (ObjectUtil.isNotNull(renovationPartsDetailEntity.getMviewPath())){
+                uploadToOssUtil.copyTo4dTjw(renovationPartsDetailEntity.getMviewPath().replace(prefix, ""),
+                        renovationPartsDetailEntity.getMviewPath().replace("/temp/", "/models/").replace(prefix, ""));
+                renovationPartsDetailEntity.setMviewPath(renovationPartsDetailEntity.getMviewPath().replace("/temp/", "/models/"));
+            }
 
             uploadToOssUtil.deleteTo4dTjw(renovationPartsDetailEntity.getImg().replace(prefix, ""));
             uploadToOssUtil.deleteTo4dTjw(renovationPartsDetailEntity.getPath().replace(prefix, ""));
@@ -794,7 +814,6 @@ public class ManagerController extends BaseController {
             renovationPartsDetailEntity.setImg(renovationPartsDetailEntity.getImg().replace("/temp/", "/models/"));
             renovationPartsDetailEntity.setHighImg(renovationPartsDetailEntity.getHighImg().replace("/temp/", "/models/"));
             renovationPartsDetailEntity.setPath(renovationPartsDetailEntity.getPath().replace("/temp/", "/models/"));
-            renovationPartsDetailEntity.setMviewPath(renovationPartsDetailEntity.getMviewPath().replace("/temp/", "/models/"));
 
         }
 

+ 2 - 1
sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/SceneController.java

@@ -6,6 +6,7 @@ import com.fdkk.sxz.annotation.auth.NoAuthentication;
 import com.fdkk.sxz.annotation.log.AroundLog;
 import com.fdkk.sxz.base.BaseController;
 import com.fdkk.sxz.other.mq.TopicRabbitConfig;
+import com.fdkk.sxz.util.EscapeUtil;
 import com.fdkk.sxz.util.OkHttpUtils;
 import com.fdkk.sxz.vo.request.RequestScene;
 import io.swagger.annotations.Api;
@@ -56,7 +57,7 @@ public class SceneController extends BaseController {
         JSONObject data = new JSONObject();
         data.put("pageNum", scene.getPageNum());
         data.put("pageSize", scene.getPageSize());
-        data.put("searchKey", scene.getSearchKey());
+        data.put("searchKey", EscapeUtil.escapeChar(scene.getSearchKey()));
         //指明请求来源
         data.put("type", "11");
 

+ 4 - 3
sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/SceneStyleController.java

@@ -146,9 +146,10 @@ public class SceneStyleController extends BaseController {
 
         Map<String, String> header = new HashMap<>();
         header.put("token", request.getHeader("token"));
+        header.put("Authorizations", "Y9z$w*WA%z!uz0O$dcCQ@i1KHKs5rhQW");
         log.info("删除风格场景开始ID:" + sceneStyleEntity.getId());
-        JSONObject res= OkHttpUtils.httpPostJson(mainUrl + "api/user/scene/delete", data.toJSONString(), header);
-        log.info("删除风格场景结束ID:" + sceneStyleEntity.getId()+",返回响应:"+res.toString());
+        OkHttpUtils.httpPostJson(mainUrl + "api/user/scene/delete", data.toJSONString(), header);
+        log.info("删除风格场景结束ID:" + sceneStyleEntity.getId());
         return Result.success();
     }
 
@@ -171,7 +172,7 @@ public class SceneStyleController extends BaseController {
         LambdaQueryWrapper<SceneStyleEntity> wrapper = Wrappers.lambdaQuery();
         wrapper.eq(SceneStyleEntity::getSceneNum, style.getSceneNum());
         if (!StringUtils.isEmpty(style.getStyleName())) {
-            wrapper.like(SceneStyleEntity::getStyleName, style.getSceneNum());
+            wrapper.like(SceneStyleEntity::getStyleName, style.getStyleName());
         }
         PageInfo<SceneStyleEntity> list = sceneStyleService.listByPage(style, wrapper);
         return Result.success(list);

+ 28 - 10
sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/custom/ComponetManagerController.java

@@ -13,7 +13,10 @@ import com.fdkk.sxz.entity.ModelUploadEntity;
 import com.fdkk.sxz.entity.custuom.CustomComponentClassifyEntity;
 import com.fdkk.sxz.entity.custuom.CustomComponentEntity;
 import com.fdkk.sxz.other.mq.TopicRabbitConfig;
-import com.fdkk.sxz.util.*;
+import com.fdkk.sxz.util.CreateObjUtil;
+import com.fdkk.sxz.util.FileUtils;
+import com.fdkk.sxz.util.RandomUtil;
+import com.fdkk.sxz.util.UploadToOssUtil;
 import com.fdkk.sxz.vo.request.*;
 import com.fdkk.sxz.vo.response.ResponseComponentManager;
 import com.fdkk.sxz.webApi.service.IComponentModelUploadService;
@@ -26,7 +29,6 @@ import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
-import net.oschina.j2cache.CacheChannel;
 import org.springframework.amqp.rabbit.core.RabbitTemplate;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -35,10 +37,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
 import java.io.File;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.LinkedList;
-import java.util.List;
+import java.util.*;
 
 /**
  * @description: 定制家具——库模块相关API接口
@@ -57,9 +56,6 @@ public class ComponetManagerController extends BaseController {
     @Autowired
     private RabbitTemplate rabbitTemplate;  //使用RabbitTemplate,这提供了接收/发送等等方
 
-    @Autowired
-    private CacheChannel cacheChannel;
-
 
 
     @Autowired
@@ -79,6 +75,29 @@ public class ComponetManagerController extends BaseController {
 
     @Autowired
     private IModelUploadService modelUploadService;
+
+
+    /**
+     * 根据上传id,删除上传模型
+     *
+     * @param param
+     * @return
+     */
+    @ApiOperation("根据上传id,删除上传模型")
+    @RequestMapping(value = "/deleteUploadModel", method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "ids", value = "id的集合用逗号分割", dataType = "String")})
+    @NoAuthentication
+    @AroundLog(name = "根据上传id,删除上传模型")
+    public Result deleteUploadModel(@RequestBody RequestRenovationParts param) {
+        if (StrUtil.isEmpty(param.getIds())) {
+            return Result.failure(CodeConstant.FAILURE_CODE_3001, CodeConstant.FAILURE_MSG_3001);
+        }
+
+        String[] idArray = param.getIds().split(",");
+        return Result.success(componentModelUploadService.removeByIds(Arrays.asList(idArray)));
+    }
+
     /**
      * 根据用户id,查询所有未发布的上传模型
      *
@@ -285,7 +304,6 @@ public class ComponetManagerController extends BaseController {
 
         rabbitTemplate.convertAndSend(TopicRabbitConfig.TOPICE, TopicRabbitConfig.MODEL, componentModelUploadEntity.getId() + ":;" + fileId + ":;" + userId + ":;" + modelType + ":;" + "false"+":;" +"3");
 
-        cacheChannel.set("componentUploadStatus","id"+componentModelUploadEntity.getId(),"running");
         return Result.success(componentModelUploadEntity);
     }
 

+ 4 - 2
sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/custom/CustomManagerController.java

@@ -400,8 +400,10 @@ public class CustomManagerController extends BaseController {
             ResponseCustomProductManager manager = new ResponseCustomProductManager();
             BeanUtil.copyProperties(customProductEntity, manager, false);
             CustomProductFirstclassifyEntity firstclassifyEntity = productFirstclassifyService.findById(customProductEntity.getParentId());
-            manager.setModelId(customProductEntity.getModelId());
-            manager.setTypeName(firstclassifyEntity.getName());
+            if (ObjectUtil.isNotNull(firstclassifyEntity)){
+                manager.setModelId(customProductEntity.getModelId());
+                manager.setTypeName(firstclassifyEntity.getName());
+            }
             managers.add(manager);
         }
 

+ 1 - 8
sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/testController.java

@@ -7,23 +7,18 @@ import com.fdkk.sxz.util.OkHttpUtils;
 import com.fdkk.sxz.util.RedisUtil;
 import com.fdkk.sxz.base.Result;
 import com.fdkk.sxz.webApi.service.custom.ICustomProductFirstclassifyService;
-import com.fdkk.sxz.webApi.socketController.testJacache;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import net.oschina.j2cache.CacheChannel;
-import net.oschina.j2cache.Command;
-import net.oschina.j2cache.cache.support.redis.SpringRedisPubSubPolicy;
-import net.oschina.j2cache.cluster.ClusterPolicy;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.Arrays;
-import java.util.concurrent.TimeUnit;
 
 @Slf4j
 @RestController
@@ -41,8 +36,6 @@ public class testController extends BaseController {
     private CacheChannel cacheChannel;
 
 
-
-
     /**
      * 测试redis
      *
@@ -56,7 +49,7 @@ public class testController extends BaseController {
             @ApiImplicitParam(name = "val", value = "val", dataType = "String")})
     @RequestMapping(value = "/redis", method = RequestMethod.POST)
     public Result redis(String key, String val) {
-        redisUtil.setEx("componentUploadStatus:id:"+key,val,30, TimeUnit.MINUTES);
+        redisUtil.set(key, val);
         return success(redisUtil.get(key));
     }
     /**

+ 1 - 1
sxz-core/src/main/java/com/fdkk/sxz/webApi/service/IModelUploadService.java

@@ -27,7 +27,7 @@ public interface IModelUploadService extends IBaseService<ModelUploadEntity> {
 
     ModelUploadEntity findById(Long id);
 
-    boolean updateById(ModelUploadEntity entity) ;
+    boolean updateById(ModelUploadEntity entity);
 
     boolean removeById(Long id) ;
 

+ 8 - 0
sxz-core/src/main/java/com/fdkk/sxz/webApi/service/custom/ICustomComponentClassifyService.java

@@ -1,6 +1,7 @@
 package com.fdkk.sxz.webApi.service.custom;
 
 import com.fdkk.sxz.base.IBaseService;
+import com.fdkk.sxz.entity.ModelUploadEntity;
 import com.fdkk.sxz.entity.custuom.CustomComponentClassifyEntity;
 import com.fdkk.sxz.vo.request.RequestCustomComponentClassify;
 import com.github.pagehelper.PageInfo;
@@ -16,4 +17,11 @@ public interface ICustomComponentClassifyService extends IBaseService<CustomComp
 
   PageInfo<CustomComponentClassifyEntity> listByPage(RequestCustomComponentClassify param);
 
+
+  CustomComponentClassifyEntity findById(Long id);
+
+  boolean updateById(CustomComponentClassifyEntity entity) ;
+
+  boolean removeById(Long id) ;
+
 }

+ 35 - 1
sxz-core/src/main/java/com/fdkk/sxz/webApi/service/custom/impl/CustomComponentClassifyServiceImpl.java

@@ -1,16 +1,19 @@
 package com.fdkk.sxz.webApi.service.custom.impl;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fdkk.sxz.base.impl.BaseServiceImpl;
+import com.fdkk.sxz.entity.ModelUploadEntity;
 import com.fdkk.sxz.entity.custuom.CustomComponentClassifyEntity;
 import com.fdkk.sxz.vo.request.RequestCustomComponentClassify;
 import com.fdkk.sxz.webApi.mapper.custom.ICustomComponentClassifyMapper;
 import com.fdkk.sxz.webApi.service.custom.ICustomComponentClassifyService;
 import com.github.pagehelper.PageInfo;
+import net.oschina.j2cache.CacheChannel;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -26,14 +29,45 @@ public class CustomComponentClassifyServiceImpl extends BaseServiceImpl<ICustomC
     @Autowired
     private ICustomComponentClassifyMapper customComponentClassifyMapper;
 
+    @Autowired
+    private CacheChannel cacheChannel;
 
 
     @Override
     public PageInfo<CustomComponentClassifyEntity> listByPage(RequestCustomComponentClassify param) {
             LambdaQueryWrapper<CustomComponentClassifyEntity> wrapper =  Wrappers.lambdaQuery();
           //  if (ObjectUtil.isNotNull(param.getId())){
-          //      wrapper.eq(CustomEntity::getId,param.getId());
+          //      wrapper.eq(CustomEntity:getId,param.getId());
           //  }
             return super.listByPage(param,wrapper);
     }
+
+    @Override
+    public boolean removeById(Long id) {
+        boolean removeById=super.removeById(id);
+        if (removeById){
+            cacheChannel.evict("CustomComponentClassifyEntity","id::"+id);
+        }
+        return removeById;
+    }
+
+    @Override
+    public CustomComponentClassifyEntity findById(Long id) {
+        CustomComponentClassifyEntity entity=super.findById(id);
+        if (ObjectUtil.isNotNull(entity)){
+            cacheChannel.set("CustomComponentClassifyEntity","id:"+entity.getId(),entity,60*30 );
+        }
+        return super.findById(id);
+    }
+
+    @Override
+    public boolean updateById(CustomComponentClassifyEntity entity) {
+        boolean updateById=super.updateById(entity);
+        if (updateById){
+            cacheChannel.set("CustomComponentClassifyEntity","id:"+entity.getId(),entity,60*30  );
+        }
+        return updateById;
+    }
+
+
 }

+ 12 - 0
sxz-core/src/main/java/com/fdkk/sxz/webApi/service/custom/impl/CustomComponentServiceImpl.java

@@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.fdkk.sxz.base.impl.BaseServiceImpl;
+import com.fdkk.sxz.entity.custuom.CustomComponentClassifyEntity;
 import com.fdkk.sxz.entity.custuom.CustomComponentEntity;
 import com.fdkk.sxz.entity.custuom.CustomProductEntity;
 import com.fdkk.sxz.vo.request.RequestCustom;
@@ -12,10 +13,12 @@ import com.fdkk.sxz.vo.request.RequestCustomComponent;
 import com.fdkk.sxz.vo.response.ResponseCustomComponent;
 import com.fdkk.sxz.vo.response.ResponseCustomProduct;
 import com.fdkk.sxz.webApi.mapper.custom.ICustomComponentMapper;
+import com.fdkk.sxz.webApi.service.custom.ICustomComponentClassifyService;
 import com.fdkk.sxz.webApi.service.custom.ICustomComponentService;
 import com.github.pagehelper.PageInfo;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
@@ -29,9 +32,13 @@ import java.util.stream.Collectors;
 @Service
 public class CustomComponentServiceImpl extends BaseServiceImpl<ICustomComponentMapper, CustomComponentEntity> implements ICustomComponentService {
 
+    @Qualifier("ICustomComponentMapper")
     @Autowired
     private ICustomComponentMapper customComponentMapper;
 
+    @Autowired
+    private ICustomComponentClassifyService componentClassifyService;
+
 
 
     @Override
@@ -77,10 +84,15 @@ public class CustomComponentServiceImpl extends BaseServiceImpl<ICustomComponent
         if (ObjectUtil.isNotNull(param.getParentId())){
             wrapper.eq(CustomComponentEntity::getComponentTypeId,param.getParentId());
         }
+        wrapper.eq(CustomComponentEntity::getExamine,1);
         wrapper.eq(CustomComponentEntity::getIsShow,1);
         return list(wrapper).stream().map(a ->{
             ResponseCustomComponent customComponent=new ResponseCustomComponent();
             BeanUtils.copyProperties(a, customComponent);
+            CustomComponentClassifyEntity componentClassifyEntity = componentClassifyService.findById(a.getComponentTypeId());
+            if (ObjectUtil.isNotNull(componentClassifyEntity)){
+                customComponent.setComponentTypeName(componentClassifyEntity.getName());
+            }
             customComponent.setType("component");
             return customComponent;
         }).collect(Collectors.toList());

+ 5 - 5
sxz-core/src/main/java/com/fdkk/sxz/webApi/service/custom/impl/CustomProductFirstclassifyServiceImpl.java

@@ -54,7 +54,7 @@ public class CustomProductFirstclassifyServiceImpl extends BaseServiceImpl<ICust
     public boolean removeById(Long id) {
         boolean removeById=super.removeById(id);
         if (removeById){
-            cacheChannel.evict("CustomProductFirstclassifyEntity","id:"+id);
+            cacheChannel.evict("CustomProductFirstclassifyEntity","id::"+id);
         }
         return removeById;
     }
@@ -62,13 +62,13 @@ public class CustomProductFirstclassifyServiceImpl extends BaseServiceImpl<ICust
     @Override
     public CustomProductFirstclassifyEntity findById(Long id) {
         CustomProductFirstclassifyEntity entity=null;
-        if (cacheChannel.check("CustomProductFirstclassifyEntity","id:"+id) >0){
-            CacheObject cache= cacheChannel.get("CustomProductFirstclassifyEntity","id:"+id);
+        if (cacheChannel.check("CustomProductFirstclassifyEntity","id::"+id) >0){
+            CacheObject cache= cacheChannel.get("CustomProductFirstclassifyEntity","id::"+id);
             entity= BeanUtil.toBean(cache.getValue(),CustomProductFirstclassifyEntity.class);
         }else {
             entity=super.findById(id);
             if (ObjectUtil.isNotNull(entity)){
-                cacheChannel.set("CustomProductFirstclassifyEntity","id:"+entity.getId(),entity,1800);
+                cacheChannel.set("CustomProductFirstclassifyEntity","id::"+entity.getId(),entity,1800);
             }
         }
         return entity;
@@ -78,7 +78,7 @@ public class CustomProductFirstclassifyServiceImpl extends BaseServiceImpl<ICust
     public boolean updateById(CustomProductFirstclassifyEntity entity) {
         boolean updateById=super.updateById(entity);
         if (updateById){
-            cacheChannel.set("CustomProductFirstclassifyEntity","id:"+entity.getId(),entity,60*30  );
+            cacheChannel.set("CustomProductFirstclassifyEntity","id::"+entity.getId(),entity,60*30  );
         }
         return updateById;
     }

+ 37 - 23
sxz-core/src/main/java/com/fdkk/sxz/webApi/service/custom/impl/CustomProductServiceImpl.java

@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fdkk.sxz.base.impl.BaseServiceImpl;
+import com.fdkk.sxz.entity.custuom.CustomComponentClassifyEntity;
 import com.fdkk.sxz.entity.custuom.CustomComponentEntity;
 import com.fdkk.sxz.entity.custuom.CustomProductEntity;
 import com.fdkk.sxz.vo.request.RequestCustom;
@@ -19,6 +20,7 @@ import com.fdkk.sxz.vo.response.ResponseCustomComponent;
 import com.fdkk.sxz.vo.response.ResponseCustomProduct;
 import com.fdkk.sxz.vo.response.ResponseRenovationPartsDetail;
 import com.fdkk.sxz.webApi.mapper.custom.ICustomProductMapper;
+import com.fdkk.sxz.webApi.service.custom.ICustomComponentClassifyService;
 import com.fdkk.sxz.webApi.service.custom.ICustomComponentService;
 import com.fdkk.sxz.webApi.service.custom.ICustomProductService;
 import com.github.pagehelper.PageInfo;
@@ -48,51 +50,63 @@ public class CustomProductServiceImpl extends BaseServiceImpl<ICustomProductMapp
     @Autowired
     private ICustomComponentService customComponentService;
 
+    @Autowired
+    private ICustomComponentClassifyService componentClassifyService;
+
 
     @Override
     public PageInfo<CustomProductEntity> listByPage(RequestCustomProduct param) {
-        LambdaQueryWrapper<CustomProductEntity> wrapper =  Wrappers.lambdaQuery();
-        if (ObjectUtil.isNotNull(param.getName())&&StrUtil.isNotEmpty(param.getName())){
-              wrapper.like(CustomProductEntity::getName,param.getName());
+        LambdaQueryWrapper<CustomProductEntity> wrapper = Wrappers.lambdaQuery();
+        if (ObjectUtil.isNotNull(param.getName()) && StrUtil.isNotEmpty(param.getName())) {
+            wrapper.like(CustomProductEntity::getName, param.getName());
         }
-        if (ObjectUtil.isNotNull(param.getUserId())){
-            wrapper.eq(CustomProductEntity::getUserId,param.getUserId());
+        if (ObjectUtil.isNotNull(param.getUserId())) {
+            wrapper.eq(CustomProductEntity::getUserId, param.getUserId());
         }
         param.setOrderBy("create_time");
         param.setSortBy("desc");
-        return listByPage(param,wrapper);
+        return listByPage(param, wrapper);
     }
 
 
     @Override
     public List<ResponseCustomProduct> findProductByParentId(RequestCustom param) {
-        LambdaQueryWrapper<CustomProductEntity> wrapper =  Wrappers.lambdaQuery();
-          if (ObjectUtil.isNotNull(param.getParentId())){
-              wrapper.eq(CustomProductEntity::getParentId,param.getParentId());
-          }
-        wrapper.eq(CustomProductEntity::getIsShow,1);
-        List<CustomProductEntity> list= this.list(wrapper);
-        List<ResponseCustomProduct> bList = list.stream().map(a ->{
+        LambdaQueryWrapper<CustomProductEntity> wrapper = Wrappers.lambdaQuery();
+        if (ObjectUtil.isNotNull(param.getParentId())) {
+            wrapper.eq(CustomProductEntity::getParentId, param.getParentId());
+        }
+        wrapper.eq(CustomProductEntity::getIsShow, 1);
+        wrapper.eq(CustomProductEntity::getExamine, 1);
+        List<CustomProductEntity> list = this.list(wrapper);
+        List<ResponseCustomProduct> bList = list.stream().map(a -> {
             //在此转把A转换为B
             ResponseCustomProduct responseCustomProduct = new ResponseCustomProduct();
             BeanUtils.copyProperties(a, responseCustomProduct);
             responseCustomProduct.setType("product");
             //组装配件
-            if (StrUtil.isNotEmpty(a.getComponentTypeIds())){
-                List<ResponseCustomComponent> responseCustomComponents= new ArrayList<>();
-                JSONArray components=JSONArray.parseArray(a.getComponentTypeIds());
+            if (StrUtil.isNotEmpty(a.getComponentTypeIds())) {
+                List<ResponseCustomComponent> responseCustomComponents = new ArrayList<>();
+                JSONArray components = JSONArray.parseArray(a.getComponentTypeIds());
                 //获取每个配件加入集合
-                components.forEach(c->{
-                    Long  id=Long.valueOf((String) c);
-                    CustomComponentEntity componentEntity= customComponentService.findById(id);
+                components.forEach(c -> {
+                    Long id = Long.valueOf((String) c);
+                    CustomComponentEntity componentEntity = customComponentService.findById(id);
                     if (ObjectUtil.isNotNull(componentEntity)) {
                         ResponseCustomComponent responseCustomComponent = new ResponseCustomComponent();
                         BeanUtils.copyProperties(componentEntity, responseCustomComponent);
-                        JSONObject origin=new JSONObject();
-                        origin.put("x",componentEntity.getX());
-                        origin.put("y",componentEntity.getY());
-                        origin.put("z",componentEntity.getZ());
+                        JSONObject origin = new JSONObject();
+                        origin.put("x", componentEntity.getX());
+                        origin.put("y", componentEntity.getY());
+                        origin.put("z", componentEntity.getZ());
                         responseCustomComponent.setOrigin(origin);
+
+
+                        if (ObjectUtil.isNotNull(componentEntity.getComponentTypeId())) {
+                            CustomComponentClassifyEntity componentClassifyEntity = componentClassifyService.findById(componentEntity.getComponentTypeId());
+                            if (ObjectUtil.isNotNull(componentClassifyEntity)) {
+                                responseCustomComponent.setComponentTypeName(componentClassifyEntity.getName());
+                            }
+                        }
                         responseCustomComponents.add(responseCustomComponent);
                     }
                 });

+ 9 - 6
sxz-core/src/main/java/com/fdkk/sxz/webApi/service/impl/ModelUploadServiceImpl.java

@@ -86,10 +86,13 @@ public class ModelUploadServiceImpl extends BaseServiceImpl<IModelUploadMapper,
 
     @Override
     public boolean removeById(Long id) {
+        ModelUploadEntity entity= findById(id);
         boolean removeById=super.removeById(id);
         if (removeById){
-            cacheChannel.evict("ModelUploadEntity","id:"+id);
-            cacheChannel.evict("ModelUploadEntity","fileId:"+id);
+            cacheChannel.evict("ModelUploadEntity","id::"+id);
+            if (ObjectUtil.isNotNull(entity)) {
+                cacheChannel.evict("ModelUploadEntity","fileId::"+entity.getFileId());
+            }
         }
         return removeById;
     }
@@ -98,7 +101,7 @@ public class ModelUploadServiceImpl extends BaseServiceImpl<IModelUploadMapper,
     public ModelUploadEntity findById(Long id) {
         ModelUploadEntity entity=super.findById(id);
         if (ObjectUtil.isNotNull(entity)){
-            cacheChannel.set("ModelUploadEntity","id:"+entity.getId(),entity,60*30 );
+            cacheChannel.set("ModelUploadEntity","id::"+entity.getId(),entity,60*30 );
         }
         return super.findById(id);
     }
@@ -107,8 +110,8 @@ public class ModelUploadServiceImpl extends BaseServiceImpl<IModelUploadMapper,
     public boolean updateById(ModelUploadEntity entity) {
         boolean updateById=super.updateById(entity);
         if (updateById){
-            cacheChannel.set("ModelUploadEntity","id:"+entity.getId(),entity,60*30  );
-            cacheChannel.set("ModelUploadEntity","fileId:"+entity.getFileId(),entity,60*30 );
+            cacheChannel.set("ModelUploadEntity","id::"+entity.getId(),entity,60*30  );
+            cacheChannel.set("ModelUploadEntity","fileId::"+entity.getFileId(),entity,60*30 );
         }
         return updateById;
     }
@@ -294,7 +297,7 @@ public class ModelUploadServiceImpl extends BaseServiceImpl<IModelUploadMapper,
     public ModelUploadEntity findByFileId(String fileId) {
         ModelUploadEntity entity=modelUploadMapper.findByFileId(fileId);
         if (ObjectUtil.isNotNull(entity)){
-            cacheChannel.set("ModelUploadEntity","fileId:"+fileId,entity,60*30 );
+            cacheChannel.set("ModelUploadEntity","fileId::"+fileId,entity,60*30 );
         }
         return entity;
     }

+ 4 - 0
sxz-core/src/main/java/com/fdkk/sxz/webApi/service/impl/RenovationPartsDetailServiceImpl.java

@@ -10,6 +10,7 @@ import com.fdkk.sxz.webApi.mapper.IRenovationPartsSizeMapper;
 import com.fdkk.sxz.webApi.service.IRenovationPartsDetailService;
 import com.fdkk.sxz.vo.response.ResponseRenovationPartsDetail;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -22,12 +23,15 @@ import java.util.List;
 @Transactional
 public class RenovationPartsDetailServiceImpl extends BaseServiceImpl<IRenovationPartsDetailMapper, RenovationPartsDetailEntity> implements IRenovationPartsDetailService {
 
+    @Qualifier("IRenovationPartsDetailMapper")
     @Autowired
     private IRenovationPartsDetailMapper mapper;
 
+    @Qualifier("IRenovationPartsAttachingMapper")
     @Autowired
     private IRenovationPartsAttachingMapper renovationPartsAttachingMapper;
 
+    @Qualifier("IRenovationPartsSizeMapper")
     @Autowired
     private IRenovationPartsSizeMapper renovationPartsSizeMapper;
 

+ 0 - 199
sxz-core/src/main/java/com/fdkk/sxz/webApi/socketController/ComponentSocket.java

@@ -1,199 +0,0 @@
-package com.fdkk.sxz.webApi.socketController;
-
-
-import cn.hutool.core.util.ObjectUtil;
-import cn.hutool.core.util.StrUtil;
-import cn.hutool.json.JSONObject;
-import cn.hutool.json.JSONUtil;
-import com.fdkk.sxz.entity.ComponentModelUploadEntity;
-import com.fdkk.sxz.util.RedisUtil;
-import com.fdkk.sxz.webApi.service.IComponentModelUploadService;
-import io.netty.handler.codec.http.HttpHeaders;
-import io.netty.handler.timeout.IdleStateEvent;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.yeauty.annotation.*;
-import org.yeauty.pojo.Session;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * @author XieWj
- */
-@ServerEndpoint(path = "/wss/componentWSS/", port = "${ws.port}")
-@Slf4j
-public class ComponentSocket {
-
-    @Value("${main.url}")
-    private String mainUrl;
-
-
-    private static Map<String, ComponentSocket> componentSocketMap = new ConcurrentHashMap<>();
-
-    @Autowired
-    private RedisUtil redisUtil;
-
-    @Autowired
-    private IComponentModelUploadService componentModelUploadService;
-
-    Thread thread = null;
-
-    static boolean isStop = true;
-
-
-    @BeforeHandshake
-    public void handshake(Session session, HttpHeaders headers, @PathVariable Map<String, String> pathMap) {
-        String num = pathMap.get("num");
-        String token = pathMap.get("token");
-        Map<String, String> paramsMap = new HashMap();
-        paramsMap.put("num", num);
-        Map<String, String> postHeaders = new HashMap();
-        postHeaders.put("token", token);
-        session.setSubprotocols("stomp");
-//        JSONObject req=OkHttpUtils.httpPostFormReturnJson(mainUrl + "api/scene/isLogin", paramsMap, postHeaders);
-        if (1 == 0) {
-            log.info("Authentication failed!");
-            session.close();
-        }
-    }
-
-    @OnOpen
-    public void onOpen(Session session, HttpHeaders headers, @PathVariable Map pathMap) {
-        log.info("new connection, sessionId-{},Host-{}", session.id(), headers.get("Host"));
-    }
-
-    @OnClose
-    public void onClose(Session session) throws IOException, InterruptedException {
-        log.info("one connection closed");
-        if (thread != null) {
-            Thread.sleep(1000);
-            thread.interrupt();
-        }
-    }
-
-    @OnError
-    public void onError(Session session, Throwable throwable) {
-        throwable.printStackTrace();
-        if (thread != null) {
-            thread.interrupt();
-        }
-    }
-
-    public void toDo(Session session, String message) throws InterruptedException {
-        while (true) {
-            JSONObject data = JSONUtil.parseObj(message);
-            Long id = data.getLong("id");
-            Thread.sleep(1000);
-            log.warn("查询" + session.id() + "|----------" + id);
-            if (session.isOpen()) {
-                String status = data.getStr("status");
-                if (StrUtil.equals(status, "query")) {
-                    if (redisUtil.hasKey("componentUploadStatus:id:" + id)) {
-                        String ObjStatus = redisUtil.get("componentUploadStatus:id:" + id);
-                        if (StrUtil.equals(ObjStatus, "done")) {
-                            extracted(session, data, id);
-                            return;
-                        }
-                    } else {
-                        ComponentModelUploadEntity entity = componentModelUploadService.findById(id);
-                        if (ObjectUtil.isNotNull(entity)) {
-                            if (entity.getStatus() == 1 && entity.getProgress() == 100) {
-                                extracted(session, data, id);
-                                return;
-                            }
-                        }else {
-                            return;
-                        }
-                    }
-
-                    if (Thread.currentThread().isInterrupted()) {
-                        log.info("i has isInterrupted");
-                        return;
-                    }
-                }
-            } else {
-                //连接关闭直接return
-                isStop = false;
-                componentSocketMap.remove("id" + data.getInt("id") + "session" + session.id());
-                return;
-            }
-        }
-    }
-
-    private void extracted(Session session, JSONObject data, Long id) {
-        JSONObject res = JSONUtil.createObj();
-        JSONObject resData = JSONUtil.createObj();
-        resData.set("id", id);
-        resData.set("status", "done");
-        res.set("msg", "done");
-        res.set("data", resData);
-        res.set("code", 0);
-        session.sendText(res.toString());
-        //连接关闭直接return
-        componentSocketMap.remove("id" + data.getInt("id") + "session" + session.id());
-        Thread.yield();
-    }
-
-    @OnMessage
-    public void onMessage(Session session, String message) throws InterruptedException {
-        log.info(message);
-        JSONObject res = JSONUtil.createObj();
-        res.set("code", 0);
-        //业务处理 调用异步线程,处理成功返回消息,连接断开,销毁线程
-        if (JSONUtil.isJson(message)) {
-            JSONObject data = JSONUtil.parseObj(message);
-            res.set("msg", "is Json");
-            isStop = true;
-            if (!componentSocketMap.containsKey("id" + data.getInt("id") + "session" + session.id())) {
-                componentSocketMap.put("id" + data.getInt("id") + "session" + session.id(), this);
-                thread = new Thread(() -> {
-                    try {
-                        toDo(session, message);
-                    } catch (InterruptedException e) {
-                        e.printStackTrace();
-                    }
-
-                });
-                thread.start();
-            }
-        } else {
-            res.set("code", 400);
-            res.set("msg", "Not for Json");
-        }
-        session.sendText(res.toString());
-        session.sendText(session.id().toString());
-    }
-
-
-    @OnBinary
-    public void onBinary(Session session, byte[] bytes) {
-        for (byte b : bytes) {
-            System.out.println(b);
-        }
-        session.sendBinary(bytes);
-    }
-
-    @OnEvent
-    public void onEvent(Session session, Object evt) {
-        if (evt instanceof IdleStateEvent) {
-            IdleStateEvent idleStateEvent = (IdleStateEvent) evt;
-            switch (idleStateEvent.state()) {
-                case READER_IDLE:
-                    log.info("read idle");
-                    break;
-                case WRITER_IDLE:
-                    log.info("write idle");
-                    break;
-                case ALL_IDLE:
-                    log.info("all idle");
-                    break;
-                default:
-                    break;
-            }
-        }
-    }
-}

+ 0 - 49
sxz-core/src/main/java/com/fdkk/sxz/webApi/socketController/testJacache.java

@@ -1,49 +0,0 @@
-package com.fdkk.sxz.webApi.socketController;
-
-import net.oschina.j2cache.CacheProviderHolder;
-import net.oschina.j2cache.Command;
-import net.oschina.j2cache.cluster.ClusterPolicy;
-import org.springframework.stereotype.Component;
-
-import java.util.Properties;
-
-@Component
-public class testJacache implements ClusterPolicy {
-
-    @Override
-    public void connect(Properties properties, CacheProviderHolder cacheProviderHolder) {
-        log.info(properties.toString());
-    }
-
-    @Override
-    public void publish(Command command) {
-        log.info(command.getRegion()+command.getKeys());
-    }
-
-
-    @Override
-    public void disconnect() {
-
-    }
-
-    @Override
-    public void evict(String s, String... strings) {
-        log.info(s);
-    }
-
-    @Override
-    public void clear(String s) {
-        log.info(s);
-
-    }
-
-    @Override
-    public boolean isLocalCommand(Command command) {
-        return false;
-    }
-
-    @Override
-    public void handleCommand(Command cmd) {
-        ClusterPolicy.super.handleCommand(cmd);
-    }
-}

+ 0 - 23
sxz-modules/src/main/java/com/fdkk/sxz/enums/ModelUploadType.java

@@ -1,23 +0,0 @@
-package com.fdkk.sxz.enums;
-
-import lombok.*;
-
-
-/**
- * @author Xiwj
- */
-
-@Getter
-@AllArgsConstructor
-public enum ModelUploadType {
-
-    END_PRODUCT("1", "成品"),
-    CUSTOM("2", "定制"),
-    COMPONENT("3", "组件");
-
-    private String value;
-    private String label;
-
-
-}
-

+ 1 - 0
sxz-modules/src/main/java/com/fdkk/sxz/vo/request/RequestCustom.java

@@ -23,4 +23,5 @@ public class RequestCustom extends RequestBase {
     @ApiModelProperty(value = "父节点id", name = "parentId")
     private Long parentId;
 
+    private Integer examine;
 }

+ 2 - 0
sxz-modules/src/main/java/com/fdkk/sxz/vo/response/ResponseCustomComponent.java

@@ -16,4 +16,6 @@ public class ResponseCustomComponent extends CustomComponentEntity {
     private JSONObject origin;
     private String type;
 
+    private String componentTypeName;
+
 }