소스 검색

修改触发生成封面图加入缓存标识业务处理中

xiewenjie 3 년 전
부모
커밋
266b4d2c4d

+ 0 - 3
sxz-core/src/main/java/com/fdkk/sxz/other/listener/RunBuild.java

@@ -1491,15 +1491,12 @@ public class RunBuild {
 
 
         switch (uploadType) {
         switch (uploadType) {
             case "1":
             case "1":
-                redisUtil.setEx("createImgStatus:id:" + modelId, "biz", 5, TimeUnit.MINUTES);
                 endProductHandler(fileId, userId, modelId, dataJson, taskType, uploadType, filePath);
                 endProductHandler(fileId, userId, modelId, dataJson, taskType, uploadType, filePath);
                 break;
                 break;
             case "2":
             case "2":
-                redisUtil.setEx("createImgStatus:id:" + modelId, "biz", 5, TimeUnit.MINUTES);
                 customHandler(fileId, userId, modelId, dataJson, taskType, uploadType, filePath);
                 customHandler(fileId, userId, modelId, dataJson, taskType, uploadType, filePath);
                 break;
                 break;
             case "3":
             case "3":
-                redisUtil.setEx("componentCreateImgStatus:id:" + modelId, "biz", 5, TimeUnit.MINUTES);
                 componentHandler(fileId, userId, modelId, dataJson, taskType, uploadType, filePath);
                 componentHandler(fileId, userId, modelId, dataJson, taskType, uploadType, filePath);
                 break;
                 break;
             default:
             default:

+ 4 - 1
sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/ManagerController.java

@@ -43,6 +43,7 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashMap;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
+import java.util.concurrent.TimeUnit;
 
 
 /**
 /**
  * Created by Hb_zzZ on 2020/12/1.
  * Created by Hb_zzZ on 2020/12/1.
@@ -55,7 +56,8 @@ public class ManagerController extends BaseController {
 
 
     @Value("${server.file.location}")
     @Value("${server.file.location}")
     private String buildPath;
     private String buildPath;
-
+    @Autowired
+    private RedisUtil redisUtil;
     @Autowired
     @Autowired
     private IModelUploadService modelUploadService;
     private IModelUploadService modelUploadService;
 
 
@@ -973,6 +975,7 @@ public class ManagerController extends BaseController {
                         modelUploadEntity.getId() + ":;" + jsonData + ":;modelPreview:;" + 1);
                         modelUploadEntity.getId() + ":;" + jsonData + ":;modelPreview:;" + 1);
 
 
         modelUploadService.updateById(modelUploadEntity);
         modelUploadService.updateById(modelUploadEntity);
+        redisUtil.setEx("createImgStatus:id:" + modelId, "biz", 5, TimeUnit.MINUTES);
         return Result.success();
         return Result.success();
     }
     }
 
 

+ 6 - 5
sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/custom/ComponetManagerController.java

@@ -14,10 +14,7 @@ import com.fdkk.sxz.entity.custuom.CustomComponentClassifyEntity;
 import com.fdkk.sxz.entity.custuom.CustomComponentEntity;
 import com.fdkk.sxz.entity.custuom.CustomComponentEntity;
 import com.fdkk.sxz.exception.BusinessException;
 import com.fdkk.sxz.exception.BusinessException;
 import com.fdkk.sxz.other.mq.TopicRabbitConfig;
 import com.fdkk.sxz.other.mq.TopicRabbitConfig;
-import com.fdkk.sxz.util.CreateObjUtil;
-import com.fdkk.sxz.util.FileUtils;
-import com.fdkk.sxz.util.SnowIdUtil;
-import com.fdkk.sxz.util.UploadToOssUtil;
+import com.fdkk.sxz.util.*;
 import com.fdkk.sxz.vo.request.*;
 import com.fdkk.sxz.vo.request.*;
 import com.fdkk.sxz.vo.response.ResponseComponentManager;
 import com.fdkk.sxz.vo.response.ResponseComponentManager;
 import com.fdkk.sxz.webApi.service.IComponentModelUploadService;
 import com.fdkk.sxz.webApi.service.IComponentModelUploadService;
@@ -45,6 +42,7 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Arrays;
 import java.util.LinkedList;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.List;
+import java.util.concurrent.TimeUnit;
 
 
 /**
 /**
  * @description: 定制家具——库模块相关API接口
  * @description: 定制家具——库模块相关API接口
@@ -59,7 +57,8 @@ public class ComponetManagerController extends BaseController {
 
 
     @Value("${server.file.location}")
     @Value("${server.file.location}")
     private String buildPath;
     private String buildPath;
-
+    @Autowired
+    private RedisUtil redisUtil;
     @Autowired
     @Autowired
     private RabbitTemplate rabbitTemplate;  //使用RabbitTemplate,这提供了接收/发送等等方
     private RabbitTemplate rabbitTemplate;  //使用RabbitTemplate,这提供了接收/发送等等方
 
 
@@ -199,6 +198,8 @@ public class ComponetManagerController extends BaseController {
                         modelUploadEntity.getId() + ":;" + jsonData + ":;modelPreview" + ":;" + 3);
                         modelUploadEntity.getId() + ":;" + jsonData + ":;modelPreview" + ":;" + 3);
 
 
         componentModelUploadService.updateById(modelUploadEntity);
         componentModelUploadService.updateById(modelUploadEntity);
+        redisUtil.setEx("componentCreateImgStatus:id:" + modelId, "biz", 5, TimeUnit.MINUTES);
+
         return Result.success();
         return Result.success();
     }
     }
 
 

+ 6 - 5
sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/custom/CustomManagerController.java

@@ -15,10 +15,7 @@ import com.fdkk.sxz.entity.custuom.CustomComponentEntity;
 import com.fdkk.sxz.entity.custuom.CustomProductEntity;
 import com.fdkk.sxz.entity.custuom.CustomProductEntity;
 import com.fdkk.sxz.entity.custuom.CustomProductFirstclassifyEntity;
 import com.fdkk.sxz.entity.custuom.CustomProductFirstclassifyEntity;
 import com.fdkk.sxz.other.mq.TopicRabbitConfig;
 import com.fdkk.sxz.other.mq.TopicRabbitConfig;
-import com.fdkk.sxz.util.CreateObjUtil;
-import com.fdkk.sxz.util.FileUtils;
-import com.fdkk.sxz.util.SnowIdUtil;
-import com.fdkk.sxz.util.UploadToOssUtil;
+import com.fdkk.sxz.util.*;
 import com.fdkk.sxz.vo.request.RequestCustomProduct;
 import com.fdkk.sxz.vo.request.RequestCustomProduct;
 import com.fdkk.sxz.vo.request.RequestModelCustomUpload;
 import com.fdkk.sxz.vo.request.RequestModelCustomUpload;
 import com.fdkk.sxz.vo.request.RequestRenovationPartsDetailManager;
 import com.fdkk.sxz.vo.request.RequestRenovationPartsDetailManager;
@@ -46,6 +43,7 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.LinkedList;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.List;
+import java.util.concurrent.TimeUnit;
 
 
 /**
 /**
  * @description: 定制家具——库模块相关API接口
  * @description: 定制家具——库模块相关API接口
@@ -60,7 +58,8 @@ public class CustomManagerController extends BaseController {
 
 
     @Value("${server.file.location}")
     @Value("${server.file.location}")
     private String buildPath;
     private String buildPath;
-
+    @Autowired
+    private RedisUtil redisUtil;
     @Autowired
     @Autowired
     private RabbitTemplate rabbitTemplate;  //使用RabbitTemplate,这提供了接收/发送等等方
     private RabbitTemplate rabbitTemplate;  //使用RabbitTemplate,这提供了接收/发送等等方
 
 
@@ -124,6 +123,8 @@ public class CustomManagerController extends BaseController {
                         modelUploadEntity.getId() + ":;" + jsonData + ":;customFurniturePreview:;" + 2);
                         modelUploadEntity.getId() + ":;" + jsonData + ":;customFurniturePreview:;" + 2);
 
 
         modelUploadService.updateById(modelUploadEntity);
         modelUploadService.updateById(modelUploadEntity);
+        redisUtil.setEx("createImgStatus:id:" + modelId, "biz", 5, TimeUnit.MINUTES);
+
         return Result.success();
         return Result.success();
     }
     }