瀏覽代碼

计算优先级配置接口,设置接口

lyhzzz 1 年之前
父節點
當前提交
456ad24ecc

+ 66 - 0
src/main/java/com/fdkankan/manage/entity/MqSendLog.java

@@ -0,0 +1,66 @@
+package com.fdkankan.manage.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 
+ * @since 2024-05-08
+ */
+@Getter
+@Setter
+@TableName("mq_send_log")
+public class MqSendLog implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @TableField("num")
+    private String num;
+
+    /**
+     * 发送的队列
+     */
+    @TableField("queue")
+    private String queue;
+
+    /**
+     * 发送的mq消息
+     */
+    @TableField("content")
+    private String content;
+
+    /**
+     * 0未发送,1已发送
+     */
+    @TableField("status")
+    private Integer status;
+
+    @TableField("create_time")
+    private Date createTime;
+
+    @TableField("update_time")
+    private Date updateTime;
+
+    @TableField("sort")
+    private Integer sort;
+
+    @TableField("rec_status")
+    @TableLogic(value = "A",delval = "I")
+    private String recStatus;
+
+
+}

+ 1 - 1
src/main/java/com/fdkankan/manage/generate/AutoGenerate.java

@@ -18,7 +18,7 @@ public class AutoGenerate {
         String path =System.getProperty("user.dir");
 
         generate(path,"manage", getTables(new String[]{
-                "mq_queue_config",
+                "mq_send_log",
         }));
 
 //        generate(path,"goods", getTables(new String[]{

+ 24 - 0
src/main/java/com/fdkankan/manage/httpClient/service/LaserService.java

@@ -406,4 +406,28 @@ public class LaserService {
         }
     }
 
+    public HashMap<String, JSONObject> list(List<String> sceneNumList,Integer sceneSource) {
+        LaserSceneParam newParam = new LaserSceneParam();
+        newParam.setPageNum(1);
+        newParam.setPageSize(sceneNumList.size());
+        newParam.setSceneCodes(sceneNumList);
+        newParam.setSceneSource(sceneSource);
+        return this.list(newParam);
+    }
+
+    public HashMap<String, JSONObject> list(LaserSceneParam newParam) {
+        HashMap<String, JSONObject> map = new HashMap<>();
+        FdkkResponse fdkkResponse = laserClient.sceneList(newParam);
+        JSONObject jsonObject = fdkkResponse.getData();
+        if(jsonObject == null){
+            return map;
+        }
+        JSONArray list = jsonObject.getJSONArray("list");
+
+        for (Object o : list) {
+            JSONObject obj = (JSONObject) o;
+            map.put(obj.getString("num"),obj);
+        }
+        return map;
+    }
 }

+ 18 - 0
src/main/java/com/fdkankan/manage/mapper/IMqSendLogMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.manage.mapper;
+
+import com.fdkankan.manage.entity.MqSendLog;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2024-05-08
+ */
+@Mapper
+public interface IMqSendLogMapper extends BaseMapper<MqSendLog> {
+
+}

+ 16 - 0
src/main/java/com/fdkankan/manage/service/IMqSendLogService.java

@@ -0,0 +1,16 @@
+package com.fdkankan.manage.service;
+
+import com.fdkankan.manage.entity.MqSendLog;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2024-05-08
+ */
+public interface IMqSendLogService extends IService<MqSendLog> {
+
+}

+ 20 - 0
src/main/java/com/fdkankan/manage/service/impl/MqSendLogServiceImpl.java

@@ -0,0 +1,20 @@
+package com.fdkankan.manage.service.impl;
+
+import com.fdkankan.manage.entity.MqSendLog;
+import com.fdkankan.manage.mapper.IMqSendLogMapper;
+import com.fdkankan.manage.service.IMqSendLogService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2024-05-08
+ */
+@Service
+public class MqSendLogServiceImpl extends ServiceImpl<IMqSendLogMapper, MqSendLog> implements IMqSendLogService {
+
+}

+ 38 - 3
src/main/java/com/fdkankan/manage/service/impl/SceneProServiceImpl.java

@@ -197,9 +197,6 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
 
     @Override
     public PageInfo pageList(SceneParam param) {
-        if(param.getType() == 2 || param.getType() == 6){  //深时
-            return laserService.pageList(param);
-        }
         if(param.getType() == 3){ //双目lite
            return sceneService.pageList(param);
         }
@@ -237,6 +234,15 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         HashMap<Long, User> userMap = null;
         HashMap<Long, Camera> cameraMap = null;
 
+        List<String> sceneNumList = page.getRecords().stream().map(SceneVo::getNum).collect(Collectors.toList());
+        HashMap<String,JSONObject> ssSceneMap = new HashMap<>();
+        if(param.getType() == 2 ){
+            ssSceneMap = laserService.list(sceneNumList,4);
+        }
+        if(param.getType() == 6){
+            ssSceneMap = laserService.list(sceneNumList,5);
+        }
+
         if(!records.isEmpty()){
             List<String> numList = records.parallelStream().map(SceneVo::getNum).collect(Collectors.toList());
             map = copyLogService.getByNewNumList(numList);
@@ -250,6 +256,21 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
 
         }
         for (SceneVo record : page.getRecords()) {
+            if(param.getType() == 2 || param.getType() == 6){
+                JSONObject ssObj = ssSceneMap.get(record.getNum());
+                if(ssObj!=null){
+                    record.setSceneName(ssObj.getString("title"));
+                    record.setThumb(ssObj.getString("thumb"));
+                    record.setWebSite(ssObj.getString("webSite"));
+                    record.setIsObj(ssObj.getInteger("buildObjStatus"));
+                    record.setViewCount(ssObj.getInteger("viewCount"));
+                    record.setStatus(toFdStatus(ssObj.getInteger("status")));
+                }else{
+                    record.setStatus(-1);
+                    record.setWebSite(null);
+                }
+            }
+
             record.setStatusString(SceneStatusUtil.getStatusString(record));
             if(userMap != null){
                 User user = userMap.get(record.getUserId());
@@ -289,6 +310,20 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         return PageInfo.PageInfo(page);
     }
 
+    private Integer toFdStatus(Integer status) {
+        //深时状态,-1:场景被删 0:计算中 1计算失败 2计算成功 3封存 4生成OBJ中
+        switch (status) {
+            case 0:
+            case 4:
+                return 0;
+            case 2:
+                return -2;
+            case 3:
+                return -3;
+            default:
+                return -1;
+        }
+    }
     @Override
     public synchronized void move(SceneParam param) {
         Camera camera = cameraService.getBySnCode(param.getSnCode());

+ 2 - 1
src/main/java/com/fdkankan/manage/util/ProvinceUtils.java

@@ -125,7 +125,8 @@ public class ProvinceUtils {
     }
 
     public static void main(String[] args) {
-        System.out.println( getAddressByIp("127"));
+
+        System.out.println( pointsToLocationsAll("120.42355098505286,23.543548401862722"));
     }
 
 }

+ 5 - 0
src/main/resources/mapper/manage/MqSendLogMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fdkankan.manage.mapper.IMqSendLogMapper">
+
+</mapper>