Przeglądaj źródła

release-重定位圆周率

dengsixing 1 miesiąc temu
rodzic
commit
adc8f59048

+ 3 - 0
src/main/java/com/fdkankan/contro/entity/RelocationBatch.java

@@ -47,5 +47,8 @@ public class RelocationBatch implements Serializable {
     @TableLogic(value = "A", delval = "I")
     private String recStatus;
 
+    @TableField("img_source")
+    private String imgSource;
+
 
 }

+ 8 - 0
src/main/java/com/fdkankan/contro/entity/RelocationInit.java

@@ -1,11 +1,13 @@
 package com.fdkankan.contro.entity;
 
 import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
 import lombok.Getter;
 import lombok.Setter;
 
 import java.io.Serializable;
 import java.util.Date;
+import java.util.List;
 
 /**
  * <p>
@@ -50,6 +52,12 @@ public class RelocationInit implements Serializable {
     @TableField("unicode")
     private String unicode;
 
+    @TableField("img_source")
+    private String imgSource;
+
+    @TableField(value = "relocation_images", typeHandler = FastjsonTypeHandler.class)
+    private List<String> relocationImages;
+
 
 
 }

+ 6 - 4
src/main/java/com/fdkankan/contro/mq/listener/BuildSxRelocationListener.java

@@ -66,16 +66,18 @@ public class BuildSxRelocationListener {
         String msg = new String(message.getBody(), StandardCharsets.UTF_8);
         JSONObject jsonObject = JSON.parseObject(msg);
         log.info("开始接受重定位请求,id:{},消息体:{}", messageId, jsonObject);
-        String sxNum = jsonObject.getString("sxNum");
+        String mainNum = jsonObject.getString("mainNum");
+        String imgSource = jsonObject.getString("imgSource");
         RelocationBatch relocationBatch = new RelocationBatch();
-        relocationBatch.setNum(sxNum);
+        relocationBatch.setNum(mainNum);
+        relocationBatch.setImgSource(imgSource);
         relocationBatchService.save(relocationBatch);
         JSONArray imgs = jsonObject.getJSONArray("imgs");
         List<RelocationBatchDetail> detailList = imgs.stream().map(v -> {
             JSONObject img = (JSONObject) v;
             RelocationBatchDetail detail = new RelocationBatchDetail();
             detail.setBatchId(relocationBatch.getId());
-            detail.setNum(sxNum);
+            detail.setNum(mainNum);
             detail.setPanNum(img.getString("num"));
             detail.setBucket(img.getString("bucket"));
             detail.setImgKey(img.getString("key"));
@@ -85,7 +87,7 @@ public class BuildSxRelocationListener {
         relocationBatchDetailService.saveBatch(detailList);
 
 
-        List<RelocationBatch> list = relocationBatchService.list(new LambdaQueryWrapper<RelocationBatch>().eq(RelocationBatch::getNum, sxNum).in(RelocationBatch::getStatus, 0, 1).lt(RelocationBatch::getId, relocationBatch.getId()));
+        List<RelocationBatch> list = relocationBatchService.list(new LambdaQueryWrapper<RelocationBatch>().eq(RelocationBatch::getNum, mainNum).in(RelocationBatch::getStatus, 0, 1).lt(RelocationBatch::getId, relocationBatch.getId()));
         boolean canBuild = true;
         if(CollUtil.isNotEmpty(list)){
             for (RelocationBatch batch : list) {

+ 5 - 0
src/main/java/com/fdkankan/contro/mq/service/impl/BuildSceneServiceImpl.java

@@ -134,6 +134,8 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
     private IAiService aiService;
     @Autowired
     private IBuildService buildService;
+    @Autowired
+    private IRelocationService relocationService;
 
 
     @Override
@@ -404,6 +406,9 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
             scenePlusService.updateById(scenePlus);
             scenePlusExtService.updateById(scenePlusExt);
 
+            //增加深巡重定位圆周率
+            relocationService.relocationYzlInit(sceneCode, fdageData, SceneUtil.getHomePath(path));
+
             //国际环境需要发邮件通知
             if("eur".equals(env) &&
                     !scenePlus.getSceneSource().equals(SceneSource.JG.code()) &&

+ 9 - 0
src/main/java/com/fdkankan/contro/service/IRelocationService.java

@@ -0,0 +1,9 @@
+package com.fdkankan.contro.service;
+
+import com.alibaba.fastjson.JSONObject;
+
+public interface IRelocationService {
+
+    void relocationYzlInit(String num, JSONObject dataFdage, String homePath);
+
+}

+ 13 - 9
src/main/java/com/fdkankan/contro/service/impl/RelocationInitServiceImpl.java

@@ -43,10 +43,13 @@ public class RelocationInitServiceImpl extends ServiceImpl<IRelocationInitMapper
     @Override
     public void pushInit(RelocationInit relocationInit) {
         try {
-            ScenePlus qjkk = scenePlusService.getScenePlusByNum(relocationInit.getPanNum());
-            if(qjkk.getSceneStatus() != SceneStatus.NO_DISPLAY.code() && qjkk.getSceneStatus() != SceneStatus.SUCCESS.code()){
-                return;
+            if(StrUtil.isEmpty(relocationInit.getImgSource()) || relocationInit.getImgSource().equals("qjkk")){
+                ScenePlus qjkk = scenePlusService.getScenePlusByNum(relocationInit.getPanNum());
+                if(qjkk.getSceneStatus() != SceneStatus.NO_DISPLAY.code() && qjkk.getSceneStatus() != SceneStatus.SUCCESS.code()){
+                    return;
+                }
             }
+
             ScenePlus sx = null;
             if(StrUtil.isNotEmpty(relocationInit.getNum())){
                 sx = scenePlusService.getScenePlusByNum(relocationInit.getNum());
@@ -61,13 +64,14 @@ public class RelocationInitServiceImpl extends ServiceImpl<IRelocationInitMapper
                 }
                 return;
             }
-            ScenePlus panNum = scenePlusService.getScenePlusByNum(relocationInit.getPanNum());
-            if(panNum.getSceneStatus() != SceneStatus.NO_DISPLAY.code() && panNum.getSceneStatus() != SceneStatus.SUCCESS.code()){
-                return;
+            Map<String, Object> map = new HashMap<>();
+            map.put("mainNum", relocationInit.getNum());
+            map.put("imgSource", relocationInit.getImgSource());
+            if("yzl".equals(relocationInit.getImgSource())){
+                map.put("relocationImages",relocationInit.getRelocationImages());
+            }else{
+                map.put("relocationNum",relocationInit.getPanNum());
             }
-            Map<String, String> map = new HashMap<>();
-            map.put("sxNum", relocationInit.getNum());
-            map.put("qjkkNum",relocationInit.getPanNum());
             mqProducer.sendByWorkQueue(queueRelocationSceneInit, map);
 
             relocationInit.setNum(sx.getNum());

+ 35 - 0
src/main/java/com/fdkankan/contro/service/impl/RelocationServiceImpl.java

@@ -0,0 +1,35 @@
+package com.fdkankan.contro.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.contro.entity.RelocationInit;
+import com.fdkankan.contro.service.IRelocationInitService;
+import com.fdkankan.contro.service.IRelocationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+public class RelocationServiceImpl implements IRelocationService {
+
+    @Autowired
+    private IRelocationInitService relocationInitService;
+
+
+    @Override
+    public void relocationYzlInit(String num, JSONObject dataFdage, String homePath) {
+        JSONArray relocationImages = dataFdage.getJSONArray("relocation_images");
+        if(CollUtil.isEmpty(relocationImages)){
+            return;
+        }
+        List<String> imageList = relocationImages.toJavaList(String.class).stream().map(v -> homePath + v).collect(Collectors.toList());
+        RelocationInit ri = new RelocationInit();
+        ri.setNum(num);
+        ri.setImgSource("yzl");
+        ri.setRelocationImages(imageList);
+        relocationInitService.save(ri);
+    }
+}