Przeglądaj źródła

去除无关代码

tianboguang 2 lat temu
rodzic
commit
baa8ffe13c

+ 0 - 12
pom.xml

@@ -73,24 +73,12 @@
 
     <dependency>
       <groupId>com.fdkankan</groupId>
-      <artifactId>4dkankan-utils-dingtalk</artifactId>
-      <version>3.0.0-SNAPSHOT</version>
-    </dependency>
-
-    <dependency>
-      <groupId>com.fdkankan</groupId>
       <artifactId>4dkankan-common-web</artifactId>
       <version>3.0.0-SNAPSHOT</version>
     </dependency>
 
     <dependency>
       <groupId>com.fdkankan</groupId>
-      <artifactId>4dkankan-utils-app-push</artifactId>
-      <version>3.0.0-SNAPSHOT</version>
-    </dependency>
-
-    <dependency>
-      <groupId>com.fdkankan</groupId>
       <artifactId>4dkankan-utils-redis</artifactId>
       <version>3.0.0-SNAPSHOT</version>
     </dependency>

+ 2 - 60
src/main/java/com/fdkankan/contro/mq/service/impl/BuildSceneServiceImpl.java

@@ -31,8 +31,6 @@ import com.fdkankan.model.enums.ModelTypeEnums;
 import com.fdkankan.model.utils.CreateHouseJsonUtil;
 import com.fdkankan.model.utils.CreateObjUtil;
 import com.fdkankan.model.utils.SceneUtil;
-import com.fdkankan.push.config.PushMessageConfig;
-import com.fdkankan.push.utils.PushMsgUtil;
 import com.fdkankan.rabbitmq.bean.BuildSceneCallMessage;
 import com.fdkankan.rabbitmq.bean.BuildSceneResultMqMessage;
 import com.fdkankan.rabbitmq.util.RabbitMqProducer;
@@ -572,47 +570,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
 
     private void pushMsgToApp(Integer pushChannel, String pushToken, int cameraType, String sceneName, String webSite){
         log.info("推送消息,渠道是 {}, 手机token是 {}", pushChannel, pushToken);
-        if(Objects.isNull(pushChannel) && StrUtil.isBlank(pushToken)){
-            return;
-        }
-
-        String title = sceneName + "计算完成";
-        String body = "您上传的" + sceneName + "计算完成,点击查看";
-
-        try{
-            if(FYunTypeEnum.AWS.code().equals(fYunFileService.getFyunType())){
-                PushMsgUtil.googlePushMsg(ConstantFilePath.BASE_PATH + "/refreshToken.json", pushToken,
-                        title, body , webSite);
-                return;
-            }
-
-            PushMessageConfig pushConfig = null;
-            if(pushChannel == 0){
-                if(cameraType == 10 || cameraType == 13){
-                    //ios
-                    pushConfig = new PushMessageConfig(PushMessageConfig.IOS_KEY_Z, PushMessageConfig.IOS_SECRET_Z);
-                    pushConfig.sendIOSUnicast(pushToken,  "四维看看Minion",title, body, webSite);
-                }else {
-                    //ios
-                    pushConfig = new PushMessageConfig(PushMessageConfig.IOS_KEY, PushMessageConfig.IOS_SECRET);
-                    pushConfig.sendIOSUnicast(pushToken, "四维看看Pro",title, body, webSite);
-                }
-            }else {
-                if(cameraType == 10 || cameraType == 13){
-                    //ios
-                    //安卓
-                    pushConfig = new PushMessageConfig(PushMessageConfig.ANDROID_KEY_Z, PushMessageConfig.ANDROID_SECRET_Z);
-                    pushConfig.sendAndroidUnicast2(pushToken, "四维看看Minion",title, body, webSite);
-                }else {
-                    //安卓
-                    pushConfig = new PushMessageConfig(PushMessageConfig.ANDROID_KEY, PushMessageConfig.ANDROID_SECRET);
-                    pushConfig.sendAndroidUnicast(pushToken, "四维看看Pro",title, body, webSite);
-                }
-            }
-            log.info("消息推送结束!");
-        }catch (Exception e){
-            log.error("推送消息失败:", e);
-        }
     }
 
     private void copyToEditDir(String num) throws IOException {
@@ -795,23 +752,8 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
 
     private int getPayStatus(Long cameraId, Long space){
         //更新相机使用用量
-        CameraDetail cameraDetail = cameraDetailService.updateCameraDetailByCameraIdAndSpace(cameraId, space);
-        Long totalSpace = cameraDetail.getTotalSpace();
-
-        UserIncrement userIncrement = userIncrementService.getByCameraId(cameraId);
-        if(!ObjectUtils.isEmpty(userIncrement) && userIncrement.getIsExpired().equals(ExpiredStatus.NOT_EXPIRED.code())){
-            IncrementType type = incrementTypeService.getById(userIncrement.getIncrementTypeId());
-            if(type != null){
-                Integer cameraCapacity = type.getCameraCapacity();
-                if(cameraCapacity == -1){           //无限容量权益
-                    return PayStatus.PAY.code();
-                }else {
-                    totalSpace = cameraCapacity *1024 * 1024 * 1024L;     //权益设置容量
-                }
-            }
-        }
-
-        return totalSpace.compareTo(cameraDetail.getUsedSpace()) == -1 ? PayStatus.NO_CAPACITY.code() : PayStatus.PAY.code();
+        cameraDetailService.updateCameraDetailByCameraIdAndSpace(cameraId, space);
+        return PayStatus.PAY.code();
     }
 
     private Object[] updateEditInfo(ScenePlus scenePlus){

+ 0 - 43
src/main/java/com/fdkankan/contro/mq/service/impl/BuildV3SceneServiceImpl.java

@@ -26,8 +26,6 @@ import com.fdkankan.model.constants.ConstantFilePath;
 import com.fdkankan.model.constants.UploadFilePath;
 import com.fdkankan.model.utils.CreateHouseJsonUtil;
 import com.fdkankan.model.utils.CreateObjUtil;
-import com.fdkankan.push.config.PushMessageConfig;
-import com.fdkankan.push.utils.PushMsgUtil;
 import com.fdkankan.rabbitmq.bean.BuildSceneCallMessage;
 import com.fdkankan.rabbitmq.bean.BuildSceneResultMqMessage;
 import com.fdkankan.rabbitmq.util.RabbitMqProducer;
@@ -411,47 +409,6 @@ public class BuildV3SceneServiceImpl implements IBuildSceneService {
 
     private void pushMsgToApp(Integer pushChannel, String pushToken, int cameraType, String sceneName, String webSite){
         log.info("推送消息,渠道是 {}, 手机token是 {}", pushChannel, pushToken);
-        if(Objects.isNull(pushChannel) && StrUtil.isBlank(pushToken)){
-            return;
-        }
-
-        String title = sceneName + "计算完成";
-        String body = "您上传的" + sceneName + "计算完成,点击查看";
-
-        try{
-            if(FYunTypeEnum.AWS.code().equals(fYunFileService.getFyunType())){
-                PushMsgUtil.googlePushMsg(ConstantFilePath.BASE_PATH + "/refreshToken.json", pushToken,
-                        title, body , webSite);
-                return;
-            }
-
-            PushMessageConfig pushConfig = null;
-            if(pushChannel == 0){
-                if(cameraType == 10 || cameraType == 13){
-                    //ios
-                    pushConfig = new PushMessageConfig(PushMessageConfig.IOS_KEY_Z, PushMessageConfig.IOS_SECRET_Z);
-                    pushConfig.sendIOSUnicast(pushToken,  "四维看看Minion",title, body, webSite);
-                }else {
-                    //ios
-                    pushConfig = new PushMessageConfig(PushMessageConfig.IOS_KEY, PushMessageConfig.IOS_SECRET);
-                    pushConfig.sendIOSUnicast(pushToken, "四维看看Pro",title, body, webSite);
-                }
-            }else {
-                if(cameraType == 10 || cameraType == 13){
-                    //ios
-                    //安卓
-                    pushConfig = new PushMessageConfig(PushMessageConfig.ANDROID_KEY_Z, PushMessageConfig.ANDROID_SECRET_Z);
-                    pushConfig.sendAndroidUnicast2(pushToken, "四维看看Minion",title, body, webSite);
-                }else {
-                    //安卓
-                    pushConfig = new PushMessageConfig(PushMessageConfig.ANDROID_KEY, PushMessageConfig.ANDROID_SECRET);
-                    pushConfig.sendAndroidUnicast(pushToken, "四维看看Pro",title, body, webSite);
-                }
-            }
-            log.info("消息推送结束!");
-        }catch (Exception e){
-            log.error("推送消息失败:", e);
-        }
     }
 
     private JSONObject getVideosJson(String path, Integer videoVersion, String projectNum, int cameraType) throws Exception {

+ 5 - 18
src/main/java/com/fdkankan/contro/service/impl/BuildSceneDTServiceImpl.java

@@ -1,18 +1,12 @@
 package com.fdkankan.contro.service.impl;
 
-import cn.hutool.core.util.StrUtil;
 import com.fdkankan.contro.service.IBuildSceneDTService;
-import com.fdkankan.dingtalk.DingTalkSendUtils;
 import com.fdkankan.fyun.config.FYunFileConfig;
-import com.taobao.api.ApiException;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
-import java.io.UnsupportedEncodingException;
-import java.security.InvalidKeyException;
-import java.security.NoSuchAlgorithmException;
 import java.util.concurrent.CompletableFuture;
 
 /**
@@ -36,9 +30,6 @@ public class BuildSceneDTServiceImpl implements IBuildSceneDTService {
     public static final String contentExt = "**algorithm-log**: [%sbuild_log/%s/console.log](%sbuild_log/%s/console.log)";
 
     @Autowired
-    private DingTalkSendUtils dingTalkSendUtils;
-
-    @Autowired
     private FYunFileConfig fYunFileConfig;
 
     @Value("${main.url}")
@@ -48,13 +39,10 @@ public class BuildSceneDTServiceImpl implements IBuildSceneDTService {
     public void handModelFail(String reason, String serverPath, String num, String hostName) {
         CompletableFuture.runAsync(() -> {
             try {
-                log.info("开始发送钉钉消息");
                 String logPath = String.format(contentExt,fYunFileConfig.getHost(),num,fYunFileConfig.getHost(),num);
-                log.info("发送钉钉消息,content:{}", logPath);
                 String content = String.format(this.DINGTALK_MSG_PATTERN, this.mainUrl, hostName, reason, num, serverPath) + logPath;
-                log.info("发送钉钉消息,content:{}", content);
-                dingTalkSendUtils.sendActioncardMsgToDingRobot(content,"场景计算失败");
-            } catch (ApiException | UnsupportedEncodingException | NoSuchAlgorithmException | InvalidKeyException apiException) {
+                log.info("计算失败,content:{}", content);
+            } catch (Exception apiException) {
                 log.error("发送钉钉消息失败", apiException);
             }
         });
@@ -65,10 +53,9 @@ public class BuildSceneDTServiceImpl implements IBuildSceneDTService {
         CompletableFuture.runAsync(() -> {
             try {
                 String content = String.format(this.DINGTALK_MSG_PATTERN, this.mainUrl, hostName, reason, num, serverPath);
-                log.info("发送钉钉消息,content:{}", content);
-                dingTalkSendUtils.sendActioncardMsgToDingRobot(content,"场景计算失败");
-            } catch (ApiException | UnsupportedEncodingException | NoSuchAlgorithmException | InvalidKeyException apiException) {
-                log.error("发送钉钉消息失败", apiException);
+                log.info("处理失败,content:{}", content);
+            } catch (Exception apiException) {
+                log.error("处理失败", apiException);
             }
         });
     }