lyhzzz 6 часов назад
Родитель
Сommit
1a11077dc3

+ 1 - 5
src/main/java/com/fdkankan/ucenter/constant/CameraTypelEnum.java

@@ -1,9 +1,6 @@
 package com.fdkankan.ucenter.constant;
 package com.fdkankan.ucenter.constant;
 
 
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
 public enum CameraTypelEnum {
 public enum CameraTypelEnum {
@@ -68,5 +65,4 @@ public enum CameraTypelEnum {
     }
     }
 
 
 
 
-
 }
 }

+ 1 - 2
src/main/java/com/fdkankan/ucenter/controller/ContactUsController.java

@@ -40,8 +40,7 @@ public class ContactUsController extends BaseController {
         String ip = IPUtils.getIpAddr(request);
         String ip = IPUtils.getIpAddr(request);
         contactUs.setIpAddress(ip);
         contactUs.setIpAddress(ip);
         contactUs.setSessionId(request.getSession().getId());
         contactUs.setSessionId(request.getSession().getId());
-        contactUsService.submit(contactUs);
-        return Result.success();
+        return Result.success(contactUsService.submit(contactUs));
     }
     }
 
 
     @GetMapping("/callBack/{uuid}")
     @GetMapping("/callBack/{uuid}")

+ 5 - 1
src/main/java/com/fdkankan/ucenter/controller/LoginController.java

@@ -6,6 +6,7 @@ import com.fdkankan.redis.util.RedisUtil;
 import com.fdkankan.ucenter.common.BaseController;
 import com.fdkankan.ucenter.common.BaseController;
 import com.fdkankan.ucenter.common.RedisKeyUtil;
 import com.fdkankan.ucenter.common.RedisKeyUtil;
 import com.fdkankan.ucenter.common.Result;
 import com.fdkankan.ucenter.common.Result;
+import com.fdkankan.ucenter.common.constants.NacosProperty;
 import com.fdkankan.ucenter.service.impl.LoginService;
 import com.fdkankan.ucenter.service.impl.LoginService;
 import com.fdkankan.ucenter.vo.request.LoginParam;
 import com.fdkankan.ucenter.vo.request.LoginParam;
 import com.fdkankan.ucenter.vo.request.RegisterParam;
 import com.fdkankan.ucenter.vo.request.RegisterParam;
@@ -61,7 +62,10 @@ public class LoginController extends BaseController {
      */
      */
     @PostMapping("/sendUserInfo")
     @PostMapping("/sendUserInfo")
     public Result sendUserInfo(@RequestBody JSONObject jsonObject){
     public Result sendUserInfo(@RequestBody JSONObject jsonObject){
-        return Result.success(loginService.sendUserInfo(jsonObject.getString("uuid")));
+        if("aws".equals(NacosProperty.uploadType) ){
+            return Result.success( loginService.sendUserInfo(jsonObject.getString("uuid")));
+        }
+        return Result.success( loginService.sendUserInfo2(jsonObject.getString("uuid")));
     }
     }
     /**
     /**
      * 登出
      * 登出

+ 2 - 1
src/main/java/com/fdkankan/ucenter/service/IContactUsService.java

@@ -3,6 +3,7 @@ package com.fdkankan.ucenter.service;
 import com.fdkankan.ucenter.entity.ContactUs;
 import com.fdkankan.ucenter.entity.ContactUs;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fdkankan.ucenter.entity.ContactUsPoint;
 import com.fdkankan.ucenter.entity.ContactUsPoint;
+import com.fdkankan.ucenter.vo.response.ContactUsSubmitVo;
 import com.fdkankan.ucenter.vo.response.LoginVo;
 import com.fdkankan.ucenter.vo.response.LoginVo;
 import com.fdkankan.ucenter.vo.response.SceneVo;
 import com.fdkankan.ucenter.vo.response.SceneVo;
 import org.springframework.http.ResponseEntity;
 import org.springframework.http.ResponseEntity;
@@ -21,7 +22,7 @@ import java.util.Map;
  */
  */
 public interface IContactUsService extends IService<ContactUs> {
 public interface IContactUsService extends IService<ContactUs> {
 
 
-    void submit(ContactUs contactUs);
+    ContactUsSubmitVo submit(ContactUs contactUs);
 
 
     LoginVo callBack(String email);
     LoginVo callBack(String email);
 
 

+ 4 - 6
src/main/java/com/fdkankan/ucenter/service/impl/ContactUsServiceImpl.java

@@ -16,10 +16,7 @@ import com.fdkankan.ucenter.service.*;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fdkankan.ucenter.util.DateUserUtil;
 import com.fdkankan.ucenter.util.DateUserUtil;
 import com.fdkankan.ucenter.vo.request.RegisterParam;
 import com.fdkankan.ucenter.vo.request.RegisterParam;
-import com.fdkankan.ucenter.vo.response.LoginVo;
-import com.fdkankan.ucenter.vo.response.SceneInfoVo;
-import com.fdkankan.ucenter.vo.response.ScenePlusVo;
-import com.fdkankan.ucenter.vo.response.SceneVo;
+import com.fdkankan.ucenter.vo.response.*;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -57,7 +54,7 @@ public class ContactUsServiceImpl extends ServiceImpl<IContactUsMapper, ContactU
     UcenterConfig ucenterConfig;
     UcenterConfig ucenterConfig;
 
 
     @Override
     @Override
-    public void submit(ContactUs contactUs) {
+    public ContactUsSubmitVo submit(ContactUs contactUs) {
         if(StringUtils.isBlank(contactUs.getName()) || StringUtils.isBlank(contactUs.getTel())
         if(StringUtils.isBlank(contactUs.getName()) || StringUtils.isBlank(contactUs.getTel())
                 || StringUtils.isBlank(contactUs.getEmail()) || StringUtils.isBlank(contactUs.getCompany())){
                 || StringUtils.isBlank(contactUs.getEmail()) || StringUtils.isBlank(contactUs.getCompany())){
             throw new BusinessException(ResultCode.PARAM_MISS);
             throw new BusinessException(ResultCode.PARAM_MISS);
@@ -75,7 +72,7 @@ public class ContactUsServiceImpl extends ServiceImpl<IContactUsMapper, ContactU
         if(user !=null){
         if(user !=null){
             mailTemplateService.sendContactUs2(contactUs.getEmail(),13);
             mailTemplateService.sendContactUs2(contactUs.getEmail(),13);
             this.save(contactUs);
             this.save(contactUs);
-            return;
+            return new ContactUsSubmitVo(1);
         }
         }
 
 
         String callBackUrl = ucenterConfig.getContactUsCallBackUrl() + uuid;
         String callBackUrl = ucenterConfig.getContactUsCallBackUrl() + uuid;
@@ -84,6 +81,7 @@ public class ContactUsServiceImpl extends ServiceImpl<IContactUsMapper, ContactU
             redisUtil.set(redisKey2, JSONObject.toJSONString(contactUs),ucenterConfig.getEmailExTime());
             redisUtil.set(redisKey2, JSONObject.toJSONString(contactUs),ucenterConfig.getEmailExTime());
         }
         }
         this.save(contactUs);
         this.save(contactUs);
+        return new ContactUsSubmitVo(0);
     }
     }
 
 
     @Override
     @Override

+ 3 - 0
src/main/java/com/fdkankan/ucenter/service/impl/InnerServiceImpl.java

@@ -216,6 +216,9 @@ public class InnerServiceImpl implements IInnerService {
             }
             }
             if(plus.getFeedbackOptionId() != null){
             if(plus.getFeedbackOptionId() != null){
                 FeedbackOption feedbackOption = feedbackOptionService.getById(plus.getFeedbackOptionId());
                 FeedbackOption feedbackOption = feedbackOptionService.getById(plus.getFeedbackOptionId());
+                if(feedbackOption == null){
+                    return vo;
+                }
                 JSONArray aiOption = feedbackOption.getAiOption();
                 JSONArray aiOption = feedbackOption.getAiOption();
                 if(aiOption == null || aiOption.isEmpty()){
                 if(aiOption == null || aiOption.isEmpty()){
                     return vo;
                     return vo;

+ 38 - 1
src/main/java/com/fdkankan/ucenter/service/impl/LoginService.java

@@ -217,7 +217,43 @@ public class LoginService {
         return json;
         return json;
     }
     }
 
 
-    public Object sendUserInfo(String uuid) {
+    public JSONObject sendUserInfo(String uuid) {
+        if (StringUtils.isEmpty(uuid)){
+            throw new BusinessException(LoginConstant.FAILURE_CODE_3001, LoginConstant.FAILURE_MSG_3001);
+        }
+        //二维码失效,清除本地文件二维码
+        if(!redisUtil.hasKey(RedisKeyUtil.QRCODE +uuid)){
+            FileUtils.delFile(QrCodeFilePath.LOGIN_QR_CODE_PATH + uuid + ".png");
+            throw new BusinessException(LoginConstant.FAILURE_CODE_3035, LoginConstant.FAILURE_MSG_3035);
+        }
+        if(!redisUtil.hasKey(uuid)){
+            throw new BusinessException(LoginConstant.FAILURE_CODE_3004, LoginConstant.FAILURE_MSG_3004);
+        }
+        String childName = redisUtil.get(uuid);
+        Camera camera = cameraService.getBySnCode(childName);
+        if(camera == null){
+            throw new BusinessException(LoginConstant.FAILURE_CODE_3004, LoginConstant.FAILURE_MSG_3004);
+        }
+        CameraDetail cameraDetail = cameraDetailService.getByCameraId(camera.getId());
+        if(cameraDetail == null){
+            throw new BusinessException(LoginConstant.FAILURE_CODE_3004, LoginConstant.FAILURE_MSG_3004);
+        }
+        UserVo userVo = new UserVo();
+        userVo.setUserName(childName);
+        userVo.setId(cameraDetail.getUserId());
+        userVo.setCameraId(camera.getId());
+        userVo.setCameraLogin(1);
+        String token = this.redisLogin(childName,JSONObject.toJSONString(userVo),"camera");
+        JSONObject obj = new JSONObject();
+        obj.put("token",token);
+        obj.put("childName",childName);
+        obj.put("to",1);
+        redisUtil.del(uuid);
+        FileUtils.deleteFile(QrCodeFilePath.LOGIN_QR_CODE_PATH +uuid +".png");
+        return obj;
+    }
+
+    public Object sendUserInfo2(String uuid) {
         if (StringUtils.isEmpty(uuid)){
         if (StringUtils.isEmpty(uuid)){
             throw new BusinessException(LoginConstant.FAILURE_CODE_3001, LoginConstant.FAILURE_MSG_3001);
             throw new BusinessException(LoginConstant.FAILURE_CODE_3001, LoginConstant.FAILURE_MSG_3001);
         }
         }
@@ -242,6 +278,7 @@ public class LoginService {
 
 
 
 
 
 
+
     public void getEmailAuthCode(String email, String country) throws Exception {
     public void getEmailAuthCode(String email, String country) throws Exception {
         if(StringUtils.isEmpty(email) || StringUtils.isEmpty(country)){
         if(StringUtils.isEmpty(email) || StringUtils.isEmpty(country)){
             throw new BusinessException(LoginConstant.FAILURE_CODE_3001, LoginConstant.FAILURE_MSG_3001);
             throw new BusinessException(LoginConstant.FAILURE_CODE_3001, LoginConstant.FAILURE_MSG_3001);

+ 19 - 5
src/main/java/com/fdkankan/ucenter/service/impl/SceneProServiceImpl.java

@@ -29,6 +29,7 @@ import com.fdkankan.ucenter.common.constants.ResultCodeMsg;
 import com.fdkankan.ucenter.config.UcenterConfig;
 import com.fdkankan.ucenter.config.UcenterConfig;
 import com.fdkankan.ucenter.config.ThreadPoolConfig;
 import com.fdkankan.ucenter.config.ThreadPoolConfig;
 import com.fdkankan.ucenter.constant.CameraConstant;
 import com.fdkankan.ucenter.constant.CameraConstant;
+import com.fdkankan.ucenter.constant.CameraTypelEnum;
 import com.fdkankan.ucenter.constant.LoginConstant;
 import com.fdkankan.ucenter.constant.LoginConstant;
 import com.fdkankan.ucenter.entity.*;
 import com.fdkankan.ucenter.entity.*;
 import com.fdkankan.ucenter.httpClient.service.LaserService;
 import com.fdkankan.ucenter.httpClient.service.LaserService;
@@ -1402,14 +1403,27 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         }
         }
         Page<SceneVo> page = scenePlusService.domeSceneList(new Page<>(param.getPageNum(),param.getPageSize()),param);
         Page<SceneVo> page = scenePlusService.domeSceneList(new Page<>(param.getPageNum(),param.getPageSize()),param);
         if(param.getIsObj() == 0){  //点云列表
         if(param.getIsObj() == 0){  //点云列表
+
+            Set<Integer> laserSceneSource = page.getRecords().stream().map(SceneVo::getSceneSource).filter(SceneSourceUtil::isLaser).collect(Collectors.toSet());
+            HashMap<String,JSONObject> laserMap = new HashMap<>();
+            for (Integer sceneSource : laserSceneSource) {
+                List<String> numList = page.getRecords().stream().filter(e -> Objects.equals(e.getSceneSource(), sceneSource)).map(SceneVo::getNum).collect(Collectors.toList());
+                HashMap<String,JSONObject> map = laserService.list(numList, sceneSource);
+                laserMap.putAll(map);
+            }
             for (SceneVo record : page.getRecords()) {
             for (SceneVo record : page.getRecords()) {
-                if(ucenterConfig.getActive().contains("prod")){
-                    record.setWebSite(ucenterConfig.getBasePath() +"/index.html?m="+record.getNum());
-                }else {
-                    record.setWebSite(ucenterConfig.getBasePath() +"/uat/index.html?m="+record.getNum());
+                JSONObject ssObj = laserMap.get(record.getNum());
+                if(ssObj!=null){
+                    record.setSceneName(ssObj.getString("title"));
+                    record.setThumb(ssObj.getString("thumb"));
+                    record.setWebSite(ssObj.getString("webSite"));
+                    record.setViewCount(ssObj.getInteger("viewCount"));
+                }else{
+                    record.setStatus(-1);
+                    record.setWebSite(null);
                 }
                 }
-                record.setSceneName(record.getLaserTitle());
                 record.setIsLaser(true);
                 record.setIsLaser(true);
+                record.setIsUpgrade(0);
             }
             }
         }
         }
         return PageInfo.PageInfo(page);
         return PageInfo.PageInfo(page);

+ 10 - 0
src/main/java/com/fdkankan/ucenter/vo/response/ContactUsSubmitVo.java

@@ -0,0 +1,10 @@
+package com.fdkankan.ucenter.vo.response;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+@Data
+@AllArgsConstructor
+public class ContactUsSubmitVo {
+    private Integer isRegistry ;
+}