lyhzzz 3 maanden geleden
bovenliggende
commit
6cb22af549
31 gewijzigde bestanden met toevoegingen van 327 en 77 verwijderingen
  1. 25 1
      README.md
  2. 29 4
      src/main/java/com/fdkankan/manage/controller/SceneController.java
  3. 4 0
      src/main/java/com/fdkankan/manage/entity/CameraDetail.java
  4. 7 1
      src/main/java/com/fdkankan/manage/entity/Case.java
  5. 15 0
      src/main/java/com/fdkankan/manage/entity/FeedbackOption.java
  6. 2 1
      src/main/java/com/fdkankan/manage/entity/ScenePlus.java
  7. 3 0
      src/main/java/com/fdkankan/manage/entity/ScenePro.java
  8. 1 1
      src/main/java/com/fdkankan/manage/generate/AutoGenerate.java
  9. 0 5
      src/main/java/com/fdkankan/manage/httpClient/client/LaserClient.java
  10. 3 36
      src/main/java/com/fdkankan/manage/httpClient/service/LaserService.java
  11. 5 1
      src/main/java/com/fdkankan/manage/mapper/IScenePlusMapper.java
  12. 4 0
      src/main/java/com/fdkankan/manage/mapper/ISceneProMapper.java
  13. 2 0
      src/main/java/com/fdkankan/manage/mq/common/MqQueueUtil.java
  14. 1 1
      src/main/java/com/fdkankan/manage/service/IScenePlusService.java
  15. 5 0
      src/main/java/com/fdkankan/manage/service/ISceneProService.java
  16. 2 0
      src/main/java/com/fdkankan/manage/service/impl/CameraServiceImpl.java
  17. 4 3
      src/main/java/com/fdkankan/manage/service/impl/DownService.java
  18. 17 0
      src/main/java/com/fdkankan/manage/service/impl/FeedbackOptionServiceImpl.java
  19. 1 2
      src/main/java/com/fdkankan/manage/service/impl/ScenePlusServiceImpl.java
  20. 76 15
      src/main/java/com/fdkankan/manage/service/impl/SceneProServiceImpl.java
  21. 3 0
      src/main/java/com/fdkankan/manage/test/TestController.java
  22. 26 0
      src/main/java/com/fdkankan/manage/util/CameraUtils.java
  23. 1 0
      src/main/java/com/fdkankan/manage/vo/request/CameraInOutParam.java
  24. 2 1
      src/main/java/com/fdkankan/manage/vo/request/SceneParam.java
  25. 17 0
      src/main/java/com/fdkankan/manage/vo/request/SetFeedOptionParam.java
  26. 4 0
      src/main/java/com/fdkankan/manage/vo/response/CameraDetailVo.java
  27. 6 0
      src/main/java/com/fdkankan/manage/vo/response/SceneVo.java
  28. 4 1
      src/main/resources/bootstrap-dev.yml
  29. 2 1
      src/main/resources/mapper/manage/CameraMapper.xml
  30. 27 0
      src/main/resources/mapper/manage/ScenePlusMapper.xml
  31. 29 3
      src/main/resources/mapper/manage/SceneProMapper.xml

+ 25 - 1
README.md

@@ -205,4 +205,28 @@
     新增字段 oddNumber 开票审批单号
     
     http://120.25.146.52:3090/project/102/interface/api/10708
-~~~~
+~~~~
+
+
+###**v3.2.0**
+~~~~
+一,配置管理
+    1.用户反馈管理,配置项,标签使用 feedbackOption/getTypeList 接口
+    2.feedbackOption/list 
+        返回新增 sysNickName创建人昵称,sysUserName创建人用户名 ,modelApi ai模型的api地址,aiOption场景分类的ai识别配置 数组,[0,1] 0表示通用识别,1表示文物病害
+二,相机所属行业配置
+    1. camera/updateCameraType 添加参数 feedbackOptionId,取值为 feedbackOption/list 中的Id
+    2. camera/list  返回添加 feedbackOptionName行业名称
+三,场景分类设置
+    1.新增接口 scene/setFeedbackOption  POST json入参示例:{"feedbackOptionId":1,"num":"场景码"}
+    2.scene/list 返回添加 feedbackOptionName行业名称
+四,案例管理新增类型
+    1.类型下拉框,新增other标识为其他
+    2.case/addOrUpdate 接口新增参数 feedbackOptionIds 场景分类类型数组
+    3.case/list 接口返回新增 feedbackOptionIds 场景分类类型数组
+五,显示算法授权 authorizeCamera/list 接口返回中的modelAuthCode
+六,增加事业部选型
+七,删除场景恢复
+    1.scene/getDelScene 列表接口  POST json入参示例:{"pageNum":1,"pageSize":10,"snCode":"相机sn","num":"场景码","userName":"用户名"}
+    2.scene/reDelScene  恢复接口  POST json入参示例 {"numList":["SG-t-ICWd217UZfu"]}
+~~~~

+ 29 - 4
src/main/java/com/fdkankan/manage/controller/SceneController.java

@@ -1,22 +1,20 @@
 package com.fdkankan.manage.controller;
 
 
-import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.fyun.face.FYunFileServiceInterface;
+import com.fdkankan.manage.common.PageInfo;
 import com.fdkankan.manage.common.ResultCode;
-import com.fdkankan.manage.entity.*;
 import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.manage.common.ResultData;
 import com.fdkankan.manage.httpClient.client.FdKKClient;
 import com.fdkankan.manage.service.*;
 import com.fdkankan.manage.vo.request.SceneParam;
+import com.fdkankan.manage.vo.request.SetFeedOptionParam;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import javax.annotation.Resource;
-import java.util.Arrays;
 import java.util.HashMap;
 
 
@@ -185,5 +183,32 @@ public class SceneController {
     public ResultData getRestStoreProcess(@RequestParam(required = false) String num){
         return ResultData.ok(sceneProService.getRestStoreProcess(num));
     }
+
+    @PostMapping("/setFeedbackOption")
+    public ResultData setFeedOption(@RequestBody SetFeedOptionParam param){
+        if(param.getFeedbackOptionId() == null || StringUtils.isBlank(param.getNum())){
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
+        }
+        sceneProService.setFeedbackOption(param);
+        return ResultData.ok();
+    }
+
+    @PostMapping("/getDelScene")
+    public ResultData getDelScene(@RequestBody SceneParam param){
+        if(StringUtils.isBlank(param.getNum()) && StringUtils.isBlank(param.getSnCode()) && StringUtils.isBlank(param.getUserName())){
+            return ResultData.ok(PageInfo.PageInfoEmpty(param.getPageNum(),param.getPageSize()));
+        }
+        param.setRecStatus("I");
+        return ResultData.ok(sceneProService.pageList(param));
+    }
+
+    @PostMapping("/reDelScene")
+    public ResultData reDelScene(@RequestBody SceneParam param){
+        if(param.getNumList() == null || param.getNumList().isEmpty()){
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
+        }
+        sceneProService.reDelScene(param.getNumList());
+        return ResultData.ok();
+    }
 }
 

+ 4 - 0
src/main/java/com/fdkankan/manage/entity/CameraDetail.java

@@ -165,4 +165,8 @@ public class CameraDetail implements Serializable {
 
     @TableField("version")
     private String version;
+
+    @TableField("feedback_option_id")
+    private Integer feedbackOptionId;
+
 }

+ 7 - 1
src/main/java/com/fdkankan/manage/entity/Case.java

@@ -1,5 +1,6 @@
 package com.fdkankan.manage.entity;
 
+import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -7,6 +8,8 @@ import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import java.io.Serializable;
 import java.util.Date;
+
+import com.fdkankan.manage.common.typehandle.JsonArrayTypeHandler;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -20,7 +23,7 @@ import lombok.Setter;
  */
 @Getter
 @Setter
-@TableName("t_case")
+@TableName(value = "t_case",autoResultMap = true)
 public class Case implements Serializable {
 
     private static final long serialVersionUID = 1L;
@@ -43,6 +46,9 @@ public class Case implements Serializable {
     @TableField("type_id")
     private String typeId;
 
+    @TableField(typeHandler= JsonArrayTypeHandler.class)
+    private JSONArray feedbackOptionIds;
+
     @TableField("icon_ids")
     private String iconIds;
 

+ 15 - 0
src/main/java/com/fdkankan/manage/entity/FeedbackOption.java

@@ -50,6 +50,15 @@ public class FeedbackOption implements Serializable {
     @TableField("is_system")
     private Integer isSystem;
 
+    @TableField("sys_user_id")
+    private Long sysUserId;
+
+    @TableField("ai_option")
+    private String aiOption;
+
+    @TableField("model_api")
+    private String modelApi;
+
     @TableField("rec_status")
     @TableLogic(value = "A",delval = "I")
     private String recStatus;
@@ -62,4 +71,10 @@ public class FeedbackOption implements Serializable {
 
     @TableField(exist = false)
     private BigDecimal score;
+
+    @TableField(exist = false)
+    private String sysNickName;
+
+    @TableField(exist = false)
+    private String sysUserName;
 }

+ 2 - 1
src/main/java/com/fdkankan/manage/entity/ScenePlus.java

@@ -113,5 +113,6 @@ public class ScenePlus implements Serializable {
     @TableLogic(value = "A",delval = "I")
     private String recStatus;
 
-
+    @TableField("feedback_option_id")
+    private Integer feedbackOptionId;
 }

+ 3 - 0
src/main/java/com/fdkankan/manage/entity/ScenePro.java

@@ -228,4 +228,7 @@ public class ScenePro implements Serializable {
 
     @TableField("is_obj")
     private Integer isObj;
+
+    @TableField("feedback_option_id")
+    private Integer feedbackOptionId;
 }

+ 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[]{
-                "t_app_secret"
+                "t_feedback_num"
         }));
 
 //        generate(path,"goods", getTables(new String[]{

+ 0 - 5
src/main/java/com/fdkankan/manage/httpClient/client/LaserClient.java

@@ -53,11 +53,6 @@ public interface LaserClient {
      */
     @Post(value = "/laser/4dage/scene/cooperation/cameraSave",interceptor = SignInterceptor.class)
     Result cooperationCameraSave(@JSONBody List<Map<String, String> >param);
-    /**
-     * 添加相机协作
-     */
-    @Post(value = "/laser/init/{sceneNum}/saveOrEdit",interceptor = SignInterceptor.class)
-    Result saveOrEdit(@Var("sceneNum") String sceneNum, @JSONBody  Map<String,Object> params);
 
     /**
      * 下载深时场景

+ 3 - 36
src/main/java/com/fdkankan/manage/httpClient/service/LaserService.java

@@ -302,44 +302,11 @@ public class LaserService {
     }
 
 
-    public void copy(String snCode, String createTime, String newNum, Integer status, String sceneKey, String sceneName, Long userId){
-        String phone = null;
-        if(userId != null){
-            User user = userService.getById(userId);
-            if(user != null){
-                phone = user.getUserName();
-            }
-        }
-        Map<String,Object> params = new HashMap<>();
-        params.put("childName",snCode);
-        params.put("createTime", createTime);
-        params.put("phone", phone);
-        params.put("sceneCode", newNum);
-        params.put("snCode",snCode);
-        params.put("status", status);
-        params.put("password", sceneKey);
-        params.put("title", sceneName);
-        params.put("userId", userId);
-        params.put("copy", true);
-        Result result = laserClient.saveOrEdit(newNum, params);
-        if( result.getCode() != HttpStatus.OK.value()){
-            log.error("激光场景状态同步失败!");
-        }
-    }
 
     public void delete(String num) {
-        try {
-            Map<String,Object> params = new HashMap<>();
-            params.put("sceneCode", num);
-            params.put("status", -1);
-            Result result = laserClient.saveOrEdit(num, params);
-            if(result.getCode() != HttpStatus.OK.value()){
-                log.error("激光场景状态同步失败!");
-            }
-        }catch (Exception e){
-            log.error("激光场景状态同步失败!",e);
-        }
-
+        HashMap<String,String> map = new HashMap<>();
+        map.put("numList",JSONObject.toJSONString(Arrays.asList(num)));
+        rabbitMqProducer.sendByWorkQueue(MqQueueUtil.laserDeleteScene,map);
     }
 
 

+ 5 - 1
src/main/java/com/fdkankan/manage/mapper/IScenePlusMapper.java

@@ -6,7 +6,6 @@ import com.fdkankan.manage.vo.response.GroupByCount;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
-import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -27,4 +26,9 @@ public interface IScenePlusMapper extends BaseMapper<ScenePlus> {
     Long getSpaceSumByCameraId(@Param("cameraId") Long cameraId);
 
     List<ScenePlus> getByUserIdsAndLocation(@Param("userIds")List<Long> userIds, @Param("location")Integer location);
+
+
+    List<ScenePlus> selectDelPro(@Param("numList")List<String> numList);
+    void reDelScenePro(@Param("numList")List<String> numList);
+    void reDelSceneProEdit(@Param("proIds")List<Long> proIds);
 }

+ 4 - 0
src/main/java/com/fdkankan/manage/mapper/ISceneProMapper.java

@@ -33,4 +33,8 @@ public interface ISceneProMapper extends BaseMapper<ScenePro> {
     List<GroupByCount> getProSpaceGroupByCameraId();
 
     Long getSpaceSumByCameraId(@Param("cameraId") Long cameraId);
+
+    List<ScenePro> selectDelPro(@Param("numList")List<String> numList);
+    void reDelScenePro(@Param("numList")List<String> numList);
+    void reDelSceneProEdit(@Param("proIds")List<Long> proIds);
 }

+ 2 - 0
src/main/java/com/fdkankan/manage/mq/common/MqQueueUtil.java

@@ -11,4 +11,6 @@ public class MqQueueUtil {
     public static String laserMoveQueue = "laser-migrate-scene";
     public static String laserMoveWenBaoQueue = "relics-migrate-scene-queue";
     public static String laserMoveWenBaoQueue2 = "pano-migrate-scene-queue";
+    public static String RECOVER_SCENE = "recover-scene";
+    public static String laserDeleteScene = "laser-delete-scene";
 }

+ 1 - 1
src/main/java/com/fdkankan/manage/service/IScenePlusService.java

@@ -1,6 +1,6 @@
 package com.fdkankan.manage.service;
 
-import com.fdkankan.manage.entity.CameraDetail;
+import com.fdkankan.manage.common.PageInfo;
 import com.fdkankan.manage.entity.ScenePlus;
 import com.baomidou.mybatisplus.extension.service.IService;
 

+ 5 - 0
src/main/java/com/fdkankan/manage/service/ISceneProService.java

@@ -6,6 +6,7 @@ import com.fdkankan.manage.entity.ScenePlus;
 import com.fdkankan.manage.entity.ScenePro;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fdkankan.manage.vo.request.SceneParam;
+import com.fdkankan.manage.vo.request.SetFeedOptionParam;
 import com.fdkankan.manage.vo.response.GroupByCount;
 
 import java.util.HashMap;
@@ -67,4 +68,8 @@ public interface ISceneProService extends IService<ScenePro> {
     void updateTitleByNum(String sceneNum, String sceneNewTitle);
 
     Object labelList();
+
+    void setFeedbackOption(SetFeedOptionParam param);
+
+    void reDelScene(List<String> numList);
 }

+ 2 - 0
src/main/java/com/fdkankan/manage/service/impl/CameraServiceImpl.java

@@ -108,6 +108,7 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
         }
         for (CameraDetailVo record : voPage.getRecords()) {
             record.setTypeStr(typeHashMap.get(record.getType()).getName());
+            record.setFeedbackOptionName("");
         }
         return PageInfo.PageInfo(voPage);
     }
@@ -589,6 +590,7 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
         wrapper.set(CameraDetail::getGoodsId,param.getCameraType() == 1? 4: param.getCameraType());
         wrapper.set(CameraDetail::getColour,param.getColour());
         wrapper.set(CameraDetail::getVersion,param.getVersion());
+        wrapper.set(CameraDetail::getFeedbackOptionId,param.getFeedbackOptionId());
         cameraDetailService.update(wrapper);
 
 

+ 4 - 3
src/main/java/com/fdkankan/manage/service/impl/DownService.java

@@ -10,6 +10,7 @@ import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.manage.entity.*;
 import com.fdkankan.manage.httpClient.service.LaserService;
 import com.fdkankan.manage.service.*;
+import com.fdkankan.manage.util.CameraUtils;
 import com.fdkankan.manage.vo.response.DownVo;
 import com.fdkankan.manage.vo.response.DownloadProcessVo;
 import com.fdkankan.manage.vo.response.SSDownSceneVo;
@@ -57,7 +58,7 @@ public class DownService implements IDownService {
         }
         Integer sceneType = scenePro !=null ? scenePro.getSceneSource() : plus.getSceneSource();
         log.info("checkDownLoad--sceneType:{},isObj:{}",sceneType,isObj);
-        if((sceneType == 4 || sceneType == 5 ||  sceneType == 57) && isObj !=1){ //深时场景
+        if(CameraUtils.isLaser(sceneType,isObj)){ //深时场景
             return SSCheckDownload(sceneNum);
         }
         int isUp = 0;
@@ -135,7 +136,7 @@ public class DownService implements IDownService {
 
         Integer sceneType = scenePro !=null ? scenePro.getSceneSource() : scenePlus.getSceneSource();
         log.info("down--sceneType:{},isObj:{}",sceneType,isObj);
-        if((sceneType == 4 || sceneType == 5 || sceneType == 57) && isObj !=1){ //深时场景
+        if(CameraUtils.isLaser(sceneType,isObj)){ //深时场景
             return SSDownload(sceneNum,userId);
         }
 
@@ -183,7 +184,7 @@ public class DownService implements IDownService {
         }
         Integer sceneType = scenePro !=null ? scenePro.getSceneSource() : scenePlus.getSceneSource();
         log.info("downloadProcess--sceneType:{},isObj:{}",sceneType,isObj);
-        if((sceneType == 4 || sceneType == 5|| sceneType == 57) && isObj !=1){ //深时场景
+        if(CameraUtils.isLaser(sceneType,isObj)){ //深时场景
             return SSDownloadProcess(sceneNum);
         }
         String redisKey = RedisKey.PREFIX_DOWNLOAD_PROGRESS;

+ 17 - 0
src/main/java/com/fdkankan/manage/service/impl/FeedbackOptionServiceImpl.java

@@ -6,19 +6,24 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fdkankan.manage.common.PageInfo;
 import com.fdkankan.manage.common.ResultCode;
 import com.fdkankan.manage.entity.FeedbackOption;
+import com.fdkankan.manage.entity.SysUser;
 import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.manage.mapper.IFeedbackOptionMapper;
 import com.fdkankan.manage.service.IFeedbackOptionService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.manage.service.ISysUserService;
 import com.fdkankan.manage.vo.request.FeedbackOptionParam;
 import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.sql.BatchUpdateException;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -31,12 +36,24 @@ import java.util.List;
 @Service
 public class FeedbackOptionServiceImpl extends ServiceImpl<IFeedbackOptionMapper, FeedbackOption> implements IFeedbackOptionService {
 
+    @Autowired
+    ISysUserService sysUserService;
+
     @Override
     public Object pageList(FeedbackOptionParam param) {
         LambdaQueryWrapper<FeedbackOption> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(FeedbackOption::getTypeId,param.getTypeId());
         wrapper.orderByAsc(FeedbackOption::getId);
         Page<FeedbackOption> page = this.page(new Page<>(param.getPageNum(), param.getPageSize()), wrapper);
+        Set<Long> sysIds = page.getRecords().stream().map(FeedbackOption::getSysUserId).collect(Collectors.toSet());
+        HashMap<Long, SysUser> byIds = sysUserService.getByIds(sysIds);
+        for (FeedbackOption record : page.getRecords()) {
+            SysUser sysUser = byIds.get(record.getSysUserId());
+            if(sysUser != null){
+                record.setSysNickName(sysUser.getNickName());
+                record.setSysUserName(sysUser.getUserName());
+            }
+        }
         return PageInfo.PageInfo(page);
     }
 

+ 1 - 2
src/main/java/com/fdkankan/manage/service/impl/ScenePlusServiceImpl.java

@@ -2,7 +2,7 @@ package com.fdkankan.manage.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.fdkankan.common.util.DateUtil;
+import com.fdkankan.manage.common.PageInfo;
 import com.fdkankan.manage.httpClient.service.LaserService;
 import com.fdkankan.manage.entity.*;
 import com.fdkankan.manage.mapper.IScenePlusMapper;
@@ -13,7 +13,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 

+ 76 - 15
src/main/java/com/fdkankan/manage/service/impl/SceneProServiceImpl.java

@@ -20,6 +20,7 @@ import com.fdkankan.manage.httpClient.client.FdKKClient;
 import com.fdkankan.manage.httpClient.service.LaserService;
 import com.fdkankan.manage.entity.*;
 import com.fdkankan.manage.httpClient.service.OverallService;
+import com.fdkankan.manage.mapper.IScenePlusMapper;
 import com.fdkankan.manage.mapper.ISceneProMapper;
 import com.fdkankan.manage.mq.common.MqQueueUtil;
 import com.fdkankan.manage.mq.param.ScenePayStatusVo;
@@ -29,6 +30,7 @@ import com.fdkankan.manage.util.CameraUtils;
 import com.fdkankan.manage.util.DateUtils;
 import com.fdkankan.manage.util.SceneStatusUtil;
 import com.fdkankan.manage.vo.request.SceneParam;
+import com.fdkankan.manage.vo.request.SetFeedOptionParam;
 import com.fdkankan.manage.vo.response.*;
 import com.fdkankan.rabbitmq.util.RabbitMqProducer;
 import com.fdkankan.redis.util.RedisUtil;
@@ -106,6 +108,8 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
     OverallService overallService;
     @Autowired
     ICameraTypeService cameraTypeService;
+    @Autowired
+    IFeedbackOptionService feedbackOptionService;
 
 
     @Override
@@ -205,13 +209,15 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
 
     @Override
     public PageInfo pageList(SceneParam param) {
-
-        SceneTypeLabelEnum sceneTypeLabelEnum = SceneTypeLabelEnum.getByLabelType(param.getType());
-        if(sceneTypeLabelEnum == null){
-            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
+        SceneTypeLabelEnum sceneTypeLabelEnum = null;
+        if(param.getType() != null){
+            sceneTypeLabelEnum = SceneTypeLabelEnum.getByLabelType(param.getType());
+            if(sceneTypeLabelEnum == null){
+                throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
+            }
         }
 
-        if(param.getType() == 3){ //双目lite
+        if(param.getType() != null && param.getType() == 3){ //双目lite
            return sceneService.pageList(param);
         }
         //优化查询,去掉left join
@@ -241,7 +247,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
             return PageInfo.PageInfoEmpty(param.getPageNum(),param.getPageSize());
         }
         HashMap<String, JSONObject> laserMap = new HashMap<>();
-        param.setIsLaser(sceneTypeLabelEnum.getLaser());
+        param.setIsLaser(sceneTypeLabelEnum != null && sceneTypeLabelEnum.getLaser());
 
         Page<SceneVo> page = this.getBaseMapper().pageList(new Page<>(param.getPageNum(),param.getPageSize()),param);
         List<SceneVo> records = page.getRecords();
@@ -252,6 +258,9 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         HashMap<String,MqSendLog> mqSendLogMap = null;
 
         List<String> sceneNumList = page.getRecords().stream().map(SceneVo::getNum).collect(Collectors.toList());
+        List<Integer> feedbackOptionIds = page.getRecords().stream().map(SceneVo::getFeedbackOptionId).collect(Collectors.toList());
+        HashMap<Integer, FeedbackOption> mapByIds = feedbackOptionService.getMapByIds(new HashSet<>(feedbackOptionIds));
+
         if(!records.isEmpty()){
             map = copyLogService.getByNewNumList(sceneNumList);
             coldStorageMap = sceneColdStorageService.getByNumList(sceneNumList);
@@ -288,6 +297,9 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
                 if(record.getSceneSource() != null && (SceneTypeLabelEnum.isLaserBySceneSource(record.getSceneSource()))){
                     record.setComputeTime(record.getMeshComputeTime());
                 }
+                if(CameraUtils.isLaser(record.getSceneSource(),record.getIsObj())){
+                    record.setSceneName(record.getLaserTitle());
+                }
             }
             if(record.getStatus() != -2){
                 record.setComputeTime(null);
@@ -327,7 +339,6 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
                 }
                 record.setBuildErrorReason(SceneBuildProcessLogEnum.getReason(process));
             }
-            //{"latitude":22.3672085,"longitude":113.595673,"altitude":9.275519,"horizontalAccuracy":65.0,"verticalAccuracy":10.0,"timestamp":1564381147.2775609}
             record.setAddressComponent(commonService.getAddressComponent(record.getGps()));
 
             if(mqSendLogMap!=null){
@@ -337,13 +348,11 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
                     record.setStatus(-4);
                 }
             }
+            FeedbackOption feedbackOption = mapByIds.get(record.getFeedbackOptionId());
+            if(feedbackOption != null){
+                record.setFeedbackOptionName(feedbackOption.getNameCn());
+            }
 
-//            if(record.getLocation() != null && (record.getLocation() == 5 || record.getLocation() == 6)){
-//                if(record.getMixture() != 1){
-//                    record.setSlamCount(record.getShootCount());
-//                    record.setShootCount(null);
-//                }
-//            }
         }
         return PageInfo.PageInfo(page);
     }
@@ -683,7 +692,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
             }
             scenePlusService.removeById(scenePlus.getId());
         }
-        if(sceneSource != null && (sceneSource == 4 || sceneSource == 5 || sceneSource ==57)){
+        if(CameraUtils.isLaser(sceneSource)){
             laserService.delete(num);
         }
         //overallService.delete(num);
@@ -910,7 +919,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
             }
         }
         //深时场景通知修改计算完成时间
-        if(sceneResource != null && (sceneResource == 4 || sceneResource == 5)){
+        if(CameraUtils.isLaser(sceneResource)){
             HashMap<String,String> map = new HashMap<>();
             map.put("sceneCode",num);
             map.put("algorithmTime",date);
@@ -962,4 +971,56 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
     public Object labelList() {
         return SceneTypeLabelEnum.getAllProperties();
     }
+
+    @Override
+    public void setFeedbackOption(SetFeedOptionParam param) {
+        LambdaUpdateWrapper<ScenePro> updateWrapper = new LambdaUpdateWrapper<>();
+        updateWrapper.eq(ScenePro::getNum,param.getNum());
+        updateWrapper.set(ScenePro::getFeedbackOptionId,param.getFeedbackOptionId());
+        this.update(updateWrapper);
+
+        LambdaUpdateWrapper<ScenePlus> updateWrapper2 = new LambdaUpdateWrapper<>();
+        updateWrapper2.eq(ScenePlus::getNum,param.getNum());
+        updateWrapper2.set(ScenePlus::getFeedbackOptionId,param.getFeedbackOptionId());
+        scenePlusService.update(updateWrapper2);
+    }
+
+    @Autowired
+    IScenePlusMapper scenePlusMapper;
+    @Override
+    public void reDelScene(List<String> numList) {
+
+        List<String> laserNumList = new ArrayList<>();
+        List<ScenePro> sceneProList = this.getBaseMapper().selectDelPro(numList);
+        if(!sceneProList.isEmpty()){
+            List<Long> proIds = sceneProList.stream().map(ScenePro::getId).collect(Collectors.toList());
+            this.getBaseMapper().reDelScenePro(numList);
+            this.getBaseMapper().reDelSceneProEdit(proIds);
+
+            List<String> lNumList = sceneProList.stream().filter(e -> CameraUtils.isLaser(e.getSceneSource())).map(ScenePro::getNum).collect(Collectors.toList());
+            if(!lNumList.isEmpty()){
+                laserNumList.addAll(lNumList);
+            }
+        }
+
+        List<ScenePlus> scenePlusList = scenePlusMapper.selectDelPro(numList);
+        if(!scenePlusList.isEmpty()){
+            List<Long> plusIds = scenePlusList.stream().map(ScenePlus::getId).collect(Collectors.toList());
+            scenePlusMapper.reDelScenePro(numList);
+            scenePlusMapper.reDelSceneProEdit(plusIds);
+
+            List<String> lNumList = scenePlusList.stream().filter(e -> CameraUtils.isLaser(e.getSceneSource())).map(ScenePlus::getNum).collect(Collectors.toList());
+            if(!lNumList.isEmpty()){
+                laserNumList.addAll(lNumList);
+            }
+        }
+
+        if(!laserNumList.isEmpty()){
+            HashMap<String,String> map = new HashMap<>();
+            map.put("numList",JSONObject.toJSONString(laserNumList));
+            rabbitMqProducer.sendByWorkQueue(MqQueueUtil.RECOVER_SCENE,map);
+        }
+
+    }
+
 }

+ 3 - 0
src/main/java/com/fdkankan/manage/test/TestController.java

@@ -99,5 +99,8 @@ public class TestController {
         return ResultData.ok();
     }
 
+    public static void main(String[] args) {
+        System.out.println(SecurityUtil.MD5("0\u0001FDFDDLDL"));
+    }
 
 }

+ 26 - 0
src/main/java/com/fdkankan/manage/util/CameraUtils.java

@@ -1,7 +1,12 @@
 package com.fdkankan.manage.util;
 
+import java.util.Arrays;
+import java.util.List;
+
 public class CameraUtils {
 
+    public static List<Integer> laserSceneSourceList = Arrays.asList(4,5,7,57);
+    public static List<Integer> laserCameraTypeList = Arrays.asList(10,11,12);
     public static  Integer getCameraType2(Integer type){
         switch (type){
             case 0 : return 1;
@@ -38,4 +43,25 @@ public class CameraUtils {
         }
         return "";
     }
+
+    public static boolean isLaser(Integer sceneSource, Integer isObj) {
+        if(sceneSource == null || isObj == null){
+            return false;
+        }
+        return isLaser(sceneSource) && isObj == 1;
+    }
+
+    public static boolean isLaser(Integer sceneSource) {
+        if(sceneSource == null){
+            return false;
+        }
+        return laserSceneSourceList.contains(sceneSource);
+    }
+
+    public static boolean isLaserCamera(Integer cameraType) {
+        if(cameraType == null){
+            return false;
+        }
+        return laserCameraTypeList.contains(cameraType);
+    }
 }

+ 1 - 0
src/main/java/com/fdkankan/manage/vo/request/CameraInOutParam.java

@@ -22,4 +22,5 @@ public class CameraInOutParam {
 
     private String colour;
     private String version;
+    private Integer feedbackOptionId;
 }

+ 2 - 1
src/main/java/com/fdkankan/manage/vo/request/SceneParam.java

@@ -17,7 +17,7 @@ public class SceneParam extends RequestBase {
     private String sceneName;   //场景标题
     private String snCode;      //sn码
     private String userName;    //绑定账号
-    private Integer type = 0;   //0 看看,1看见,2深时
+    private Integer type ;   //0 看看,1看见,2深时
     private Integer companyId;
 
     private List<String> snCodes;
@@ -40,6 +40,7 @@ public class SceneParam extends RequestBase {
     private List<Integer> locations;
     private Integer locationType;
     private Boolean isLaser;
+    private String recStatus = "A";
 
     private List<String> numList = new ArrayList<>();
     public String getStartTime() {

+ 17 - 0
src/main/java/com/fdkankan/manage/vo/request/SetFeedOptionParam.java

@@ -0,0 +1,17 @@
+package com.fdkankan.manage.vo.request;
+
+import com.alibaba.fastjson.JSONObject;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class SetFeedOptionParam {
+    private Integer feedbackOptionId;
+    private String num;
+
+
+}
+

+ 4 - 0
src/main/java/com/fdkankan/manage/vo/response/CameraDetailVo.java

@@ -34,6 +34,10 @@ public class CameraDetailVo {
 
     private String version;
 
+    private Integer feedbackOptionId;
+
+    private String feedbackOptionName;
+
     public String getWarrantyDate() {
         if(buyDate ==null){
             return null;

+ 6 - 0
src/main/java/com/fdkankan/manage/vo/response/SceneVo.java

@@ -1,5 +1,6 @@
 package com.fdkankan.manage.vo.response;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fdkankan.manage.entity.SceneBuildProcessLog;
 import lombok.Data;
 
@@ -58,4 +59,9 @@ public class SceneVo {
     private Long meshComputeTime; //mesh计算时间 单位秒
 
     private Integer sceneSource;
+
+    private Integer feedbackOptionId;
+
+    private String feedbackOptionName;
+
 }

+ 4 - 1
src/main/resources/bootstrap-dev.yml

@@ -32,10 +32,13 @@ spring:
             group: DEFAULT_GROUP
             refresh: true
 
-          - data-id: sa-token-config.yaml
+          - data-id: common-rabbitmq-config.yaml
             group: DEFAULT_GROUP
             refresh: true
 
+          - data-id: sa-token-config.yaml
+            group: DEFAULT_GROUP
+            refresh: true
       discovery:
         server-addr: ${spring.cloud.nacos.config.server-addr}
         namespace: ${spring.cloud.nacos.config.namespace}

+ 2 - 1
src/main/resources/mapper/manage/CameraMapper.xml

@@ -4,12 +4,13 @@
 
     <select id="pageList" resultType="com.fdkankan.manage.vo.response.CameraDetailVo">
         select c.id ,c.sn_code,c.activated_time ,d.create_time as outTime ,d.type,d.own as outType ,co.company_name ,u.user_name, c.wifi_name,
-        d.order_sn,an.id as agentId,an.name as agentName,d.buy_date,d.colour,d.version
+        d.order_sn,an.id as agentId,an.name as agentName,d.buy_date,d.colour,d.version,d.feedback_option_id ,fo.name_cn as feedbackOptionName
         from t_camera c
         left join t_camera_detail d on c.id = d.camera_id
         left join t_company co on d.company_id = co.id
         left join t_user u on d.user_id = u.id
         left join t_agent_new an on d.agent_id = an.id
+        left join t_feedback_option fo on d.feedback_option_id = fo.id
         where c.rec_status = 'A'
         <if test="param.userId !=null ">
             and d.user_id = #{param.userId}

+ 27 - 0
src/main/resources/mapper/manage/ScenePlusMapper.xml

@@ -32,4 +32,31 @@
             </foreach>
 
     </select>
+
+
+
+    <select id="selectDelPro" resultType="com.fdkankan.manage.entity.ScenePlus" >
+        select * from t_scene_plus  WHERE rec_status = 'I'
+        and num in
+        <foreach item="num" collection="numList" open="(" separator="," close=")">
+            #{num}
+        </foreach>
+    </select>
+
+
+    <update id="reDelScenePro">
+        update t_scene_plus set rec_status = 'A' WHERE rec_status = 'I'
+        and num in
+        <foreach item="num" collection="numList" open="(" separator="," close=")">
+            #{num}
+        </foreach>
+    </update>
+
+    <update id="reDelSceneProEdit">
+        update t_scene_plus_ext set rec_status = 'A' WHERE rec_status = 'I'
+        and plus_id in
+        <foreach item="plusId" collection="proIds" open="(" separator="," close=")">
+            #{plusId}
+        </foreach>
+    </update>
 </mapper>

+ 29 - 3
src/main/resources/mapper/manage/SceneProMapper.xml

@@ -24,7 +24,8 @@
         SELECT * FROM(
         select s.scene_name ,s.num,s.create_time,s.space as sceneSize
         ,s.view_count,s.status,s.pay_status,'v3' as scene_version ,s.web_site , s.thumb
-        ,null as algorithmTime,data_source,s.shoot_count,s.gps,s.user_id,s.camera_id,s.compute_time,null as location,null as mixture,s.laser_title,null as slamCount,null as meshComputeTime,s.scene_source
+        ,null as algorithmTime,data_source,s.shoot_count,s.gps,s.user_id,s.camera_id,s.compute_time,null as location,null as mixture,s.laser_title,null as slamCount,
+         null as meshComputeTime,s.scene_source,s.feedback_option_id
         from t_scene_pro s
         <include refid="commonWhere"></include>
         <if test="param.isLaser ==0 and param.sceneName != null and param.sceneName!='' ">
@@ -46,7 +47,8 @@
         UNION ALL
         select s.title as sceneName ,s.num,s.create_time,e.space as sceneSize
         ,e.view_count,s.scene_status as status,s.pay_status,'v4' as scene_version,e.web_site,e.thumb
-        ,algorithm_time,data_source,e.shoot_count,e.gps,s.user_id,s.camera_id,e.compute_time,e.location,e.mixture,s.laser_title,e.slam_count,e.mesh_compute_time,s.scene_source
+        ,algorithm_time,data_source,e.shoot_count,e.gps,s.user_id,s.camera_id,e.compute_time,e.location,e.mixture,s.laser_title,e.slam_count,
+        e.mesh_compute_time,s.scene_source,s.feedback_option_id
         from t_scene_plus s
         left join t_scene_plus_ext e on s.id = e.plus_id
         <include refid="commonWhere"></include>
@@ -73,7 +75,7 @@
     </select>
 
     <sql id="commonWhere">
-        where s.rec_status = 'A'
+        where s.rec_status = #{param.recStatus}
         <if test="param.cameraIds !=null and param.cameraIds.size >0">
             and s.camera_id in
             <foreach item="cameraId" collection="param.cameraIds" open="(" separator="," close=")">
@@ -150,5 +152,29 @@
         select sum(space) from t_scene_pro where rec_status= 'A' and status = -2 and is_upgrade = 0 and camera_id = #{cameraId}
     </select>
 
+    <select id="selectDelPro" resultType="com.fdkankan.manage.entity.ScenePro">
+        select * from t_scene_pro  WHERE rec_status = 'I'
+        and num in
+        <foreach item="num" collection="numList" open="(" separator="," close=")">
+            #{num}
+        </foreach>
+    </select>
+
+
+    <update id="reDelScenePro">
+        update t_scene_pro set rec_status = 'A' WHERE rec_status = 'I'
+        and num in
+        <foreach item="num" collection="numList" open="(" separator="," close=")">
+            #{num}
+        </foreach>
+    </update>
+
+    <update id="reDelSceneProEdit">
+        update t_scene_pro_edit set rec_status = 'A' WHERE rec_status = 'I'
+        and pro_id in
+        <foreach item="proId" collection="proIds" open="(" separator="," close=")">
+            #{proId}
+        </foreach>
+    </update>
 
 </mapper>