lyhzzz 1 週間 前
コミット
56bc573eb7

+ 43 - 0
src/main/java/com/fdkankan/manage/common/typehandle/ArrayStringTypeHandler.java

@@ -0,0 +1,43 @@
+package com.fdkankan.manage.common.typehandle;
+
+import cn.hutool.json.JSONUtil;
+import org.apache.ibatis.type.BaseTypeHandler;
+import org.apache.ibatis.type.JdbcType;
+import org.apache.ibatis.type.MappedJdbcTypes;
+import org.apache.ibatis.type.MappedTypes;
+
+import java.sql.CallableStatement;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+/**
+ *  存储到数据库, 将String数组转换成字符串;
+ *  从数据库获取数据, 将字符串转为LONG数组.
+ */
+@MappedTypes({String[].class})
+@MappedJdbcTypes({JdbcType.VARCHAR})
+public class ArrayStringTypeHandler extends BaseTypeHandler<String[]> {
+    private static String[] l = new String[]{};
+    @Override
+    public void setNonNullParameter(PreparedStatement ps, int i,
+                                    String[] parameter, JdbcType jdbcType) throws SQLException {
+        ps.setString(i, JSONUtil.toJsonStr(parameter));
+    }
+    @Override
+    public String[] getNullableResult(ResultSet rs, String columnName)
+            throws SQLException {
+        return JSONUtil.parseArray(rs.getString(columnName)).toArray(l);
+    }
+    @Override
+    public String[] getNullableResult(ResultSet rs, int columnIndex)
+            throws SQLException {
+        return JSONUtil.parseArray(rs.getString(columnIndex)).toArray(l);
+    }
+    @Override
+    public String[] getNullableResult(CallableStatement cs, int columnIndex)
+            throws SQLException {
+        return JSONUtil.parseArray(cs.getString(columnIndex)).toArray(l);
+    }
+}
+

+ 54 - 0
src/main/java/com/fdkankan/manage/common/typehandle/JsonArrayTypeHandler.java

@@ -0,0 +1,54 @@
+package com.fdkankan.manage.common.typehandle;
+
+import com.alibaba.fastjson.JSONArray;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.type.BaseTypeHandler;
+import org.apache.ibatis.type.JdbcType;
+import org.apache.ibatis.type.MappedJdbcTypes;
+import org.apache.ibatis.type.MappedTypes;
+
+import java.sql.CallableStatement;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+/**
+ *  存储到数据库, 将JSON数组对象转换成字符串;
+ *  从数据库获取数据, 将字符串转为JSON数组对象.
+ */
+@MappedTypes({JSONArray.class})
+@MappedJdbcTypes({JdbcType.VARCHAR})
+public class JsonArrayTypeHandler extends BaseTypeHandler<JSONArray> {
+    @Override
+    public void setNonNullParameter(PreparedStatement ps, int i, JSONArray parameter,
+                                    JdbcType jdbcType) throws SQLException {
+        ps.setString(i, JSONArray.toJSONString(parameter));
+    }
+    @Override
+    public JSONArray getNullableResult(ResultSet rs, String columnName)
+            throws SQLException {
+        return parseArray(rs.getString(columnName));
+    }
+    @Override
+    public JSONArray getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
+        return parseArray(rs.getString(columnIndex));
+    }
+    @Override
+    public JSONArray getNullableResult(CallableStatement cs, int columnIndex)
+            throws SQLException {
+        return parseArray(cs.getString(columnIndex));
+    }
+
+    public static JSONArray parseArray(String content) {
+        if(StringUtils.isBlank(content)){
+            return new JSONArray();
+        }
+        try {
+            return JSONArray.parseArray(content);
+        } catch (Exception e) {
+            return new JSONArray();
+        }
+    }
+
+}
+

+ 46 - 0
src/main/java/com/fdkankan/manage/controller/h5/FeedbackH5Controller.java

@@ -0,0 +1,46 @@
+package com.fdkankan.manage.controller.h5;
+
+
+import com.fdkankan.manage.common.ResultData;
+import com.fdkankan.manage.controller.BaseController;
+import com.fdkankan.manage.entity.Feedback;
+import com.fdkankan.manage.service.IFeedbackOptionService;
+import com.fdkankan.manage.service.IFeedbackService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2024-01-24
+ */
+@RestController
+@RequestMapping("/service/manage/feedback/h5")
+public class FeedbackH5Controller extends BaseController {
+
+    @Autowired
+    IFeedbackService feedbackService;
+    @Autowired
+    IFeedbackOptionService feedbackOptionService;
+
+
+    @PostMapping("/add")
+    public ResultData add(@RequestBody Feedback param){
+        feedbackService.save(param);
+        return ResultData.ok();
+    }
+
+    @GetMapping("/getDefaultAddress")
+    public ResultData getDefaultAddress(){
+        return ResultData.ok(feedbackService.getDefaultAddress(request));
+    }
+
+    @GetMapping("/getAllByTypeId/{typeId}")
+    public ResultData getAllByTypeId(@PathVariable Integer typeId){
+        return ResultData.ok(feedbackOptionService.getAllByTypeId(typeId));
+    }
+}
+

+ 244 - 0
src/main/java/com/fdkankan/manage/inner/controller/InnerController.java

@@ -0,0 +1,244 @@
+package com.fdkankan.manage.inner.controller;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.extra.servlet.ServletUtil;
+import cn.hutool.log.Log;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.fdkankan.common.util.SecurityUtil;
+import com.fdkankan.manage.common.CacheUtil;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.common.ResultData;
+import com.fdkankan.manage.config.ManageConfig;
+import com.fdkankan.manage.controller.BaseController;
+import com.fdkankan.manage.entity.*;
+import com.fdkankan.manage.exception.BusinessException;
+import com.fdkankan.manage.service.*;
+import com.fdkankan.manage.util.RsaUtils;
+import com.fdkankan.manage.vo.request.RtkDeviceInParam;
+import com.fdkankan.manage.vo.request.RtkInfoParam;
+import com.fdkankan.manage.vo.request.SceneParam;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * <p>
+ * TODO
+ * </p>
+ *
+ * @author dengsixing
+ * @since 2022/6/7
+ **/
+@RestController
+@RequestMapping("/service/manage/inner")
+public class InnerController extends BaseController {
+
+    @Autowired
+    private ISceneProService sceneProService;
+    @Autowired
+    IServiceUpTipService serviceUpTipService;
+    @Autowired
+    ManageConfig manageConfig;
+    @Autowired
+    IRtkInfoService rtkInfoService;
+    @Autowired
+    IRtkAccountService rtkAccountService;
+    @Autowired
+    IRtkDeviceService rtkDeviceService;
+    @Autowired
+    IRtkUseLogService rtkUseLogService;
+    @Autowired
+    IRtkUpdateLogService rtkUpdateLogService;
+    @Autowired
+    IAuthorizeRtkService authorizeRtkService;
+
+    @PostMapping("/move")
+    public ResultData move(@RequestBody SceneParam param){
+        if(!checkSign()){
+            return ResultData.error(-1,"签名错误");
+        }
+
+        if(StringUtils.isEmpty(param.getNum()) || StringUtils.isEmpty(param.getSnCode())){
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
+        }
+        sceneProService.move(param);
+        return ResultData.ok();
+    }
+    @GetMapping("/copyScene")
+    public ResultData copyScene(@RequestParam(required = false) String num){
+        if(!checkSign()){
+            return ResultData.error(-1,"签名错误");
+        }
+        if(StringUtils.isEmpty(num)){
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
+        }
+        sceneProService.copy(num);
+        return ResultData.ok();
+    }
+
+    @GetMapping("/getServiceUpTip")
+    public ResultData getServiceUpTip(@RequestParam(required = false) Integer type){
+
+        return ResultData.ok( serviceUpTipService.getServiceUpTipByType(type));
+    }
+
+    @GetMapping("/rebuildScene")
+    public ResultData rebuild(@RequestParam(required = false) String num,@RequestParam(required = false) String from){
+        sceneProService.rebuildScene(num,from);
+        return ResultData.ok( );
+    }
+
+
+
+
+    /**
+     * 相机开启rtk获取账号
+     */
+    @GetMapping("/info/{rtkSnCode}")
+    public synchronized ResultData info(@PathVariable String rtkSnCode,
+                                        @RequestParam(value = "cameraSn",required = false) String cameraSn){
+        if(StringUtils.isBlank(rtkSnCode)){
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
+        }
+        RtkDevice rtkDevice = rtkDeviceService.getByRtkSnCode(rtkSnCode);
+        if(rtkDevice == null || rtkDevice.getUseStatus() !=0){
+            throw new BusinessException(ResultCode.RTK_SN_CODE_NOT_EXIT);
+        }
+        //2.9.0授权期限相机
+        if(rtkDevice.getAccountType() ==2){
+            List<AuthorizeRtk> authorizeRtks = authorizeRtkService.getByRtkId(rtkDevice.getId());
+            if(authorizeRtks == null || authorizeRtks.isEmpty()){
+                if(new Date().getTime() > DateUtil.parse(manageConfig.getAuthRtkExTime(),"yyyy-MM-dd HH:mm:ss").getTime()){
+                    throw new BusinessException(ResultCode.RTK_SN_CODE_NOT_AUTH);
+                }
+            }
+            if (authorizeRtks !=null && !authorizeRtks.isEmpty()){
+                Boolean flag = false;
+                Date now = new Date();
+                for (AuthorizeRtk authorizeRtk : authorizeRtks) {
+                    if(DateUtil.isIn(now,authorizeRtk.getValidStartTime(),authorizeRtk.getValidEndTime())){
+                        flag = true;
+                        break;
+                    }
+                }
+                if(!flag){
+                    throw new BusinessException(ResultCode.RTK_SN_CODE_NOT_AUTH);
+                }
+            }
+
+        }
+        //rtkDevice.getType() = 0板卡自带账号信息,无需关联
+        Integer rtkAccountId = null;
+        if(rtkDevice.getRtkType() == 0 && rtkDevice.getFailureTime() != null && rtkDevice.getFailureTime().getTime() <= new Date().getTime()){
+            rtkDevice.setRtkType(1);
+            rtkDeviceService.updateTypeById(rtkDevice.getId(),1);
+        }
+        if(rtkDevice.getRtkType() != 0 && (rtkDevice.getAccountType() == 0 || rtkDevice.getAccountType() == 2)){
+            RtkAccount rtkAccount = rtkAccountService.getOneNotUseAccount(rtkSnCode,rtkDevice.getCameraSn());
+            rtkAccountId = rtkAccount.getId();
+            BeanUtils.copyProperties(rtkAccount,rtkDevice);
+        }
+
+        String clientIP = ServletUtil.getClientIP(request);
+        rtkUseLogService.saveLog(clientIP,rtkAccountId,cameraSn,rtkDevice);
+        return ResultData.ok(rtkDevice);
+    }
+
+    /**
+     * 相机关闭rtk,回收账号
+     */
+    @GetMapping("/stop/{rtkSnCode}")
+    public ResultData stop(@PathVariable String rtkSnCode,
+                           @RequestParam(value = "cameraSn",required = false) String cameraSn){
+        if(StringUtils.isBlank(rtkSnCode)){
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
+        }
+        RtkDevice rtkDevice = rtkDeviceService.getByRtkSnCode(rtkSnCode);
+        if(rtkDevice == null){
+            throw new BusinessException(ResultCode.RTK_SN_CODE_NOT_EXIT);
+        }
+        String clientIP = ServletUtil.getClientIP(request);
+        rtkAccountService.stop(rtkDevice,clientIP,cameraSn);
+        return ResultData.ok();
+    }
+
+
+    /**
+     * 相机开启rtk获取账号
+     */
+    @GetMapping("/infoByTk/{rtkSnCode}")
+    public synchronized ResultData infoByTk(@PathVariable String rtkSnCode){
+        JSONObject jsonObject = checkRtkSign();
+        if(jsonObject == null){
+            throw new BusinessException(ResultCode.RTK_TOKEN_ERROR);
+        }
+        String string = jsonObject.getString("rtkSnCode");
+        if(!string.equals(rtkSnCode)){
+            throw new BusinessException(ResultCode.RTK_TOKEN_ERROR);
+        }
+        if(StringUtils.isBlank(rtkSnCode)){
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
+        }
+        RtkDevice rtkDevice = rtkDeviceService.getByRtkSnCode(rtkSnCode);
+        if(rtkDevice == null || rtkDevice.getUseStatus() !=0){
+            throw new BusinessException(ResultCode.RTK_SN_CODE_NOT_EXIT);
+        }
+
+        return ResultData.ok(rtkDevice);
+    }
+
+
+    @PostMapping("/updateRtkInfo")
+    public ResultData updateRtkInfo(@RequestBody RtkInfo param){
+        if(StringUtils.isBlank(param.getRtkSnCode())){
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
+        }
+
+        JSONObject jsonObject = checkRtkSign();
+        if(jsonObject == null){
+            throw new BusinessException(ResultCode.RTK_TOKEN_ERROR);
+        }
+        String string = jsonObject.getString("rtkSnCode");
+        if(!string.equals(param.getRtkSnCode())){
+            throw new BusinessException(ResultCode.RTK_TOKEN_ERROR);
+        }
+        String account = jsonObject.getString("account");
+
+        RtkDevice rtkDevice = rtkDeviceService.getByRtkSnCode(param.getRtkSnCode());
+        if(rtkDevice == null){
+            throw new BusinessException(ResultCode.RTK_SN_CODE_NOT_EXIT);
+        }
+        if(rtkDevice.getAccountType() == 0){    //账号池
+            throw new BusinessException(ResultCode.RTK_UPDATE_ERROR);
+        }
+        if(rtkDevice.getCameraType() !=3){ //只有深光能改
+            throw new BusinessException(ResultCode.RTK_UPDATE_ERROR);
+        }
+        if(rtkDevice.getRtkType() !=2){ //只有北云板卡能改
+            throw new BusinessException(ResultCode.RTK_UPDATE_ERROR);
+        }
+        LambdaUpdateWrapper<RtkDevice> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(RtkDevice::getId,rtkDevice.getId());
+        wrapper.set(RtkDevice::getUserName,param.getUserName());
+        wrapper.set(RtkDevice::getPassword,param.getPassword());
+        wrapper.set(RtkDevice::getIpAddr,param.getIpAddr());
+        wrapper.set(RtkDevice::getPort,param.getPort());
+        wrapper.set(RtkDevice::getMountPoint,param.getMountPoint());
+        wrapper.set(RtkDevice::getFailureTime,null);
+        rtkDeviceService.update(wrapper);
+
+        RtkUpdateLog rtkUpdateLog = new RtkUpdateLog();
+        rtkUpdateLog.setRtkSnCode(param.getRtkSnCode());
+        rtkUpdateLog.setFdAccount(account);
+        rtkUpdateLog.setOldJsonData(JSONObject.toJSONString(rtkDevice));
+        rtkUpdateLog.setNewJsonData(JSONObject.toJSONString(rtkDeviceService.getById(rtkDevice.getId())));
+        rtkUpdateLogService.save(rtkUpdateLog);
+        return ResultData.ok();
+    }
+}

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

@@ -0,0 +1,14 @@
+package com.fdkankan.manage.mq.common;
+
+public class MqQueueUtil {
+
+    public static String manageToSaleQueue = "manageToSale";
+    public static String updateUserCommand = "updateUser";
+
+    public static String ucenterScenePayStatusQueue = "scene-pay-status";
+    public static String sceneRestoreQueue = "scene-rest-store";
+    public static String laserUnfreezeScene = "laser-unfreeze-scene";
+    public static String laserMoveQueue = "laser-migrate-scene";
+    public static String laserMoveWenBaoQueue = "relics-migrate-scene-queue";
+    public static String laserMoveWenBaoQueue2 = "pano-migrate-scene-queue";
+}

+ 66 - 0
src/main/java/com/fdkankan/manage/mq/consumer/LaserSceneGpsConsumer.java

@@ -0,0 +1,66 @@
+package com.fdkankan.manage.mq.consumer;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.fdkankan.manage.entity.ScenePlus;
+import com.fdkankan.manage.entity.ScenePlusExt;
+import com.fdkankan.manage.mq.param.LaserSceneGpsVo;
+import com.fdkankan.manage.service.IScenePlusExtService;
+import com.fdkankan.manage.service.IScenePlusService;
+import com.rabbitmq.client.Channel;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.amqp.core.Message;
+import org.springframework.amqp.rabbit.annotation.Queue;
+import org.springframework.amqp.rabbit.annotation.RabbitListener;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.nio.charset.StandardCharsets;
+
+/**
+ */
+@Slf4j
+@Component
+public class LaserSceneGpsConsumer {
+
+    @Autowired
+    IScenePlusService scenePlusService;
+    @Autowired
+    IScenePlusExtService scenePlusExtService;
+
+    @RabbitListener(
+            queuesToDeclare = @Queue("${queue.laser.update-scene.location:save-scene-location}")
+    )
+    public void consumerQueue(Channel channel, Message message)  {
+        try {
+            String messageId = message.getMessageProperties().getMessageId();
+            String msg = new String(message.getBody(), StandardCharsets.UTF_8);
+            log.info("laser-update-save-scene-location-mq--messageId:{},msg:{}",messageId,msg);
+
+            channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
+            LaserSceneGpsVo vo = JSONObject.parseObject(msg, LaserSceneGpsVo.class);
+            if(vo != null && vo.getStatus() ==1 && StringUtils.isNotBlank(vo.getNum()) && vo.getLocation() != null && vo.getLocation().length >0){
+                String lat = String.valueOf(vo.getLocation()[0]);
+                String lon = String.valueOf(vo.getLocation()[1]);
+                String hig = String.valueOf(vo.getLocation()[2]);
+                ScenePlus scenePlus = scenePlusService.getByNum(vo.getNum());
+                if(scenePlus != null){
+                    LambdaUpdateWrapper<ScenePlusExt> wrapper = new LambdaUpdateWrapper<>();
+                    wrapper.eq(ScenePlusExt::getPlusId,scenePlus.getId());
+                    wrapper.set(ScenePlusExt::getRtkLocation,lat +","+lon +","+hig);
+                    scenePlusExtService.update(wrapper);
+                }
+            }
+            if(vo != null && vo.getStatus() == 0){
+            }
+
+        }catch (Exception e){
+            log.info("laser-save-scene-location------消费失败",e);
+        }finally {
+
+        }
+
+    }
+
+}

+ 57 - 0
src/main/java/com/fdkankan/manage/mq/consumer/LaserSceneTitleConsumer.java

@@ -0,0 +1,57 @@
+package com.fdkankan.manage.mq.consumer;
+
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.manage.mq.param.LaserSceneTitleVo;
+import com.fdkankan.manage.service.IScenePlusService;
+import com.fdkankan.manage.service.ISceneProService;
+import com.rabbitmq.client.Channel;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.amqp.core.Message;
+import org.springframework.amqp.rabbit.annotation.Queue;
+import org.springframework.amqp.rabbit.annotation.RabbitListener;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.nio.charset.StandardCharsets;
+
+/**
+ * 场景封存解封 mq
+ */
+@Slf4j
+@Component
+public class LaserSceneTitleConsumer {
+
+
+    @Autowired
+    ISceneProService sceneProService;
+
+    @Autowired
+    IScenePlusService scenePlusService;
+    @RabbitListener(
+            queuesToDeclare = @Queue("${queue.laser.update-scene.title:laser-update-scene-title}")
+    )
+    public void consumerQueue(Channel channel, Message message)  {
+        try {
+            String messageId = message.getMessageProperties().getMessageId();
+            String msg = new String(message.getBody(), StandardCharsets.UTF_8);
+            log.info("laser-update-scene-title-mq--messageId:{},msg:{}",messageId,msg);
+
+            channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
+
+            LaserSceneTitleVo vo = JSONObject.parseObject(msg, LaserSceneTitleVo.class);
+            if(vo == null || StringUtils.isBlank(vo.getSceneNum()) || StringUtils.isBlank(vo.getSceneNewTitle())){
+                return;
+            }
+            sceneProService.updateTitleByNum(vo.getSceneNum(),vo.getSceneNewTitle());
+            scenePlusService.updateTitleByNum(vo.getSceneNum(),vo.getSceneNewTitle());
+
+        }catch (Exception e){
+            log.info("laser-scene-title-----消费失败",e);
+        }finally {
+
+        }
+
+    }
+
+}

+ 63 - 0
src/main/java/com/fdkankan/manage/mq/consumer/OverallConsumer.java

@@ -0,0 +1,63 @@
+package com.fdkankan.manage.mq.consumer;
+
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.manage.common.RedisKeyUtil;
+import com.fdkankan.manage.httpClient.param.WorkOfflineDTO;
+import com.fdkankan.manage.mq.param.LaserSceneTitleVo;
+import com.fdkankan.manage.service.IScenePlusService;
+import com.fdkankan.manage.service.ISceneProService;
+import com.fdkankan.redis.util.RedisUtil;
+import com.rabbitmq.client.Channel;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.amqp.core.Message;
+import org.springframework.amqp.rabbit.annotation.Queue;
+import org.springframework.amqp.rabbit.annotation.RabbitListener;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.nio.charset.StandardCharsets;
+
+/**
+ * 场景封存解封 mq
+ */
+@Slf4j
+@Component
+public class OverallConsumer {
+
+
+    @Autowired
+    RedisUtil redisUtil;
+
+
+    @RabbitListener(
+            queuesToDeclare = @Queue("${queue.qjkk.offline-done:qjkk-work-offline-done}")
+    )
+    public void consumerQueue(Channel channel, Message message)  {
+        try {
+            String messageId = message.getMessageProperties().getMessageId();
+            String msg = new String(message.getBody(), StandardCharsets.UTF_8);
+            log.info("qjkk-work-offline-done-mq--messageId:{},msg:{}",messageId,msg);
+
+            channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
+
+            WorkOfflineDTO vo = JSONObject.parseObject(msg, WorkOfflineDTO.class);
+
+            String redisKey = String.format(RedisKeyUtil.overallDownOfflineProgressKey,vo.getWorkId());
+            if(vo.getOfflineStatus() != null && vo.getOfflineStatus() == -1){
+                vo.setProgress(0);
+            }else {
+                vo.setOfflineStatus(3);
+                vo.setProgress(100);
+            }
+            redisUtil.set(redisKey,JSONObject.toJSONString(vo), RedisKeyUtil.overallDownOfflineProgressKeyTime);
+
+        }catch (Exception e){
+            log.info("qjkk-work-offline-done-----消费失败",e);
+        }finally {
+
+        }
+
+    }
+
+}

+ 98 - 0
src/main/java/com/fdkankan/manage/mq/consumer/SceneRestStoreConsumer.java

@@ -0,0 +1,98 @@
+package com.fdkankan.manage.mq.consumer;
+
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
+import com.fdkankan.manage.common.RedisKeyUtil;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
+import com.fdkankan.manage.mq.param.SceneRestStoreVo;
+import com.fdkankan.manage.service.ISceneColdStorageLogService;
+import com.fdkankan.manage.service.ISceneColdStorageService;
+import com.fdkankan.manage.service.ISceneProService;
+import com.fdkankan.manage.thread.ThreadService;
+import com.fdkankan.rabbitmq.util.RabbitMqProducer;
+import com.fdkankan.redis.util.RedisUtil;
+import com.rabbitmq.client.Channel;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.amqp.core.Message;
+import org.springframework.amqp.rabbit.annotation.Queue;
+import org.springframework.amqp.rabbit.annotation.RabbitListener;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicReference;
+
+/**
+ * 场景解冻 mq
+ */
+@Slf4j
+@Component
+public class SceneRestStoreConsumer {
+
+    @Autowired
+    FYunFileServiceInterface fYunFileServiceInterface;
+    @Autowired
+    RedisUtil redisUtil;
+    @Autowired
+    ISceneColdStorageService sceneColdStorageService;
+    @Autowired
+    ISceneColdStorageLogService sceneColdStorageLogService;
+    @Autowired
+    ISceneProService sceneProService;
+
+    @RabbitListener(
+            queuesToDeclare = @Queue("${queue.scene.rest-store:scene-rest-store}"),
+            concurrency = "1",
+            ackMode = "MANUAL"
+    )
+    public void consumerQueue(Channel channel, Message message) throws IOException {
+        try {
+            String messageId = message.getMessageProperties().getMessageId();
+            String msg = new String(message.getBody(), StandardCharsets.UTF_8);
+            log.info("scene-restStore-mq--messageId:{},msg:{}",messageId,msg);
+
+            SceneRestStoreVo sceneRestStoreVo = JSONObject.parseObject(msg, SceneRestStoreVo.class);
+            String num = sceneRestStoreVo.getNum();
+            String cloudBucket= sceneRestStoreVo.getCloudBucket();
+            String bucket= sceneRestStoreVo.getBucket();
+            String folderName= sceneRestStoreVo.getFolderName();
+            String redisKey = String.format(RedisKeyUtil.restStoreKey, num);
+
+            try {
+                fYunFileServiceInterface.restoreFolder(cloudBucket,folderName,1);
+            }catch (Exception e){
+                log.info("scene-restStore-mq-error:",e);
+            }
+            Long startTime = new Date().getTime();
+            Integer process = fYunFileServiceInterface.getRestoreFolderProcess(cloudBucket, folderName);
+            log.info("scene-restStore-mq-cloudBucket:{},bucket:{},folderName:{},process:{}",cloudBucket,bucket,folderName,process);
+            while (process != 100 ){
+                Long time = new Date().getTime();
+                if(time - startTime >1000 * 60 * 10){
+                    startTime = time;
+                    process = fYunFileServiceInterface.getRestoreFolderProcess(cloudBucket, folderName);
+                    log.info("scene-restStore-mq-cloudBucket:{},bucket:{},folderName:{},process:{}",cloudBucket,bucket,folderName,process);
+                }
+            }
+            fYunFileServiceInterface.copyFileBetweenBucket(cloudBucket,folderName,bucket,folderName);
+            log.info("Tscene-restStore-mq-copy-bucket");
+            sceneColdStorageService.updateStatus(num,2);
+            sceneColdStorageLogService.saveLog(num,folderName);
+            sceneProService.restStoreSuccess(num);
+            redisUtil.del(redisKey);
+            channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
+        }catch (Exception e){
+            log.info("scene-restStore----消费失败",e);
+        }finally {
+
+        }
+
+    }
+
+}

+ 10 - 0
src/main/java/com/fdkankan/manage/mq/param/LaserSceneGpsVo.java

@@ -0,0 +1,10 @@
+package com.fdkankan.manage.mq.param;
+
+import lombok.Data;
+
+@Data
+public class LaserSceneGpsVo {
+    private String num;
+    private Double[] location;
+    private Integer status;
+ }

+ 12 - 0
src/main/java/com/fdkankan/manage/mq/param/LaserSceneTitleVo.java

@@ -0,0 +1,12 @@
+package com.fdkankan.manage.mq.param;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class LaserSceneTitleVo implements Serializable {
+    private String sceneNum;
+    private String sceneNewTitle;
+
+}

+ 15 - 0
src/main/java/com/fdkankan/manage/mq/param/ManageToSaleParam.java

@@ -0,0 +1,15 @@
+package com.fdkankan.manage.mq.param;
+
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.manage.entity.SysUser;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+@AllArgsConstructor
+public class ManageToSaleParam implements Serializable {
+    private String command;
+    private SysUser data;
+}

+ 23 - 0
src/main/java/com/fdkankan/manage/mq/param/ScenePayStatusVo.java

@@ -0,0 +1,23 @@
+package com.fdkankan.manage.mq.param;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+@Data
+public class ScenePayStatusVo implements Serializable {
+    private Long cameraId;
+    private Long sceneId;
+    private Integer payStatus;
+
+    public ScenePayStatusVo(Long cameraId) {
+        this.cameraId = cameraId;
+    }
+
+    public ScenePayStatusVo(Long sceneId, Integer payStatus) {
+        this.sceneId = sceneId;
+        this.payStatus = payStatus;
+    }
+}

+ 13 - 0
src/main/java/com/fdkankan/manage/mq/param/SceneRestStoreVo.java

@@ -0,0 +1,13 @@
+package com.fdkankan.manage.mq.param;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+@Data
+@AllArgsConstructor
+public class SceneRestStoreVo {
+    private String num ;
+    private String cloudBucket;
+    private String bucket;
+    private String folderName;
+}

+ 67 - 0
src/main/java/com/fdkankan/manage/thread/ThreadService.java

@@ -0,0 +1,67 @@
+package com.fdkankan.manage.thread;
+
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
+import com.fdkankan.manage.common.RedisKeyUtil;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
+import com.fdkankan.manage.service.ISceneColdStorageLogService;
+import com.fdkankan.manage.service.ISceneColdStorageService;
+import com.fdkankan.redis.util.RedisUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicReference;
+
+@Service
+@Slf4j
+public class ThreadService {
+    @Autowired
+    FYunFileServiceInterface fYunFileServiceInterface;
+    @Autowired
+    RedisUtil redisUtil;
+    @Autowired
+    ISceneColdStorageService sceneColdStorageService;
+    @Autowired
+    ISceneColdStorageLogService sceneColdStorageLogService;
+
+
+    public void checkRestore(String num,String cloudBucket,String bucket,String folderName){
+        String redisKey = String.format(RedisKeyUtil.restStoreKey, num);
+        if(redisUtil.hasKey(redisKey)){
+            return;
+        }
+        redisUtil.set(redisKey,folderName);
+        AtomicReference<Integer> state = new AtomicReference<>(1);
+        AtomicReference<String> reason = new AtomicReference<>("");
+        ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(1);
+        //等待任务执行结束,在间隔2秒执行。
+        scheduledThreadPoolExecutor.scheduleWithFixedDelay(()->{
+            try {
+                Integer process = fYunFileServiceInterface.getRestoreFolderProcess(cloudBucket, folderName);
+                log.info("ThreadService-cloudBucket:{},bucket:{},folderName:{},process:{}",cloudBucket,bucket,folderName,process);
+                if(process == 100){
+                    fYunFileServiceInterface.copyFileBetweenBucket(cloudBucket,folderName,bucket,folderName);
+                    log.info("ThreadService-copy-bucket");
+                    sceneColdStorageService.updateStatus(num,2);
+                    scheduledThreadPoolExecutor.shutdown();
+                }
+            }catch (Exception e){
+                log.info("ThreadService-error:",e);
+                state.set(-1);
+                reason.set(e.getMessage());
+                scheduledThreadPoolExecutor.shutdown();
+                throw new BusinessException(ResultCode.SCENE_NOT_STORE);
+            }finally {
+                redisUtil.del(redisKey);
+                sceneColdStorageLogService.saveLog(num,folderName);
+            }
+
+            //任务启动多久之后   ,周期 每10s执行一次,时间单位
+        },1000,60*1000, TimeUnit.MILLISECONDS);
+    }
+
+
+}