|
@@ -12,11 +12,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.fdkankan.common.constant.*;
|
|
|
-import com.fdkankan.common.util.*;
|
|
|
-import com.fdkankan.contro.bean.PointBean;
|
|
|
-import com.fdkankan.contro.bean.SegmentBean;
|
|
|
-import com.fdkankan.contro.bean.VertexBean;
|
|
|
-import com.fdkankan.contro.bean.WallBean;
|
|
|
+import com.fdkankan.common.util.FileUtils;
|
|
|
import com.fdkankan.contro.bean.*;
|
|
|
import com.fdkankan.contro.entity.*;
|
|
|
import com.fdkankan.contro.service.*;
|
|
@@ -27,8 +23,8 @@ import com.fdkankan.image.MatrixToImageWriterUtil;
|
|
|
import com.fdkankan.model.constants.ConstantFilePath;
|
|
|
import com.fdkankan.model.constants.UploadFilePath;
|
|
|
import com.fdkankan.model.utils.CreateHouseJsonUtil;
|
|
|
-import com.fdkankan.push.PushMessageConfig;
|
|
|
-import com.fdkankan.push.PushMsgUtil;
|
|
|
+import com.fdkankan.push.config.PushMessageConfig;
|
|
|
+import com.fdkankan.push.utils.PushMsgUtil;
|
|
|
import com.fdkankan.rabbitmq.bean.BuildSceneResultMqMessage;
|
|
|
import com.fdkankan.redis.constant.RedisKey;
|
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
@@ -44,7 +40,6 @@ import java.util.*;
|
|
|
import java.util.Map.Entry;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
-import static com.fdkankan.push.PushMessageConfig.*;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -199,7 +194,7 @@ public class BuildScenePostServiceImpl implements IBuildScenePostService {
|
|
|
scenePlusExt, arrearCap);
|
|
|
|
|
|
//计算成功,发短信
|
|
|
- this.sendSms(pushChannel,pushToken, cameraType, scenePlus.getTitle(), scenePlusExt.getWebSite());
|
|
|
+ this.pushMsgToApp(pushChannel,pushToken, cameraType, scenePlus.getTitle(), scenePlusExt.getWebSite());
|
|
|
|
|
|
log.info("场景计算结果处理结束,场景码:{}", message.getSceneCode());
|
|
|
|
|
@@ -272,47 +267,43 @@ public class BuildScenePostServiceImpl implements IBuildScenePostService {
|
|
|
|
|
|
}
|
|
|
|
|
|
- private void sendSms(Integer pushChannel, String pushToken, int cameraType, String sceneName, String webSite){
|
|
|
+ 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))
|
|
|
+ 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,
|
|
|
- sceneName + "计算完成", "您上传的" + sceneName + "计算完成,点击查看", webSite);
|
|
|
+ title, body , webSite);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- PushMessageConfig demo = null;
|
|
|
+ PushMessageConfig pushConfig = null;
|
|
|
if(pushChannel == 0){
|
|
|
if(cameraType == 10 || cameraType == 13){
|
|
|
//ios
|
|
|
- log.info("IOS_KEY:{}, IOS_SECRET:{}", IOS_KEY_Z, IOS_SECRET_Z);
|
|
|
- demo = new PushMessageConfig(IOS_KEY_Z, IOS_SECRET_Z);
|
|
|
- demo.sendIOSUnicast(pushToken, "四维看看Minion",
|
|
|
- sceneName + "计算完成", "您上传的" + sceneName + "计算完成,点击查看", webSite);
|
|
|
+ pushConfig = new PushMessageConfig(PushMessageConfig.IOS_KEY_Z, PushMessageConfig.IOS_SECRET_Z);
|
|
|
+ pushConfig.sendIOSUnicast(pushToken, "四维看看Minion",title, body, webSite);
|
|
|
}else {
|
|
|
//ios
|
|
|
- log.info("IOS_KEY:{}, IOS_SECRET:{}", IOS_KEY, IOS_SECRET);
|
|
|
- demo = new PushMessageConfig(IOS_KEY, IOS_SECRET);
|
|
|
- demo.sendIOSUnicast(pushToken, "四维看看Pro",
|
|
|
- sceneName + "计算完成", "您上传的" + sceneName + "计算完成,点击查看", webSite);
|
|
|
+ pushConfig = new PushMessageConfig(PushMessageConfig.IOS_KEY, PushMessageConfig.IOS_SECRET);
|
|
|
+ pushConfig.sendIOSUnicast(pushToken, "四维看看Pro",title, body, webSite);
|
|
|
}
|
|
|
}else {
|
|
|
if(cameraType == 10 || cameraType == 13){
|
|
|
//ios
|
|
|
//安卓
|
|
|
- log.info("ANDROID_KEY:{}, ANDROID_SECRET:{}", ANDROID_KEY_Z, ANDROID_SECRET_Z);
|
|
|
- demo = new PushMessageConfig(ANDROID_KEY_Z, ANDROID_SECRET_Z);
|
|
|
- demo.sendAndroidUnicast2(pushToken, "四维看看Minion",
|
|
|
- sceneName + "计算完成", "您上传的" + sceneName + "计算完成,点击查看", webSite);
|
|
|
+ pushConfig = new PushMessageConfig(PushMessageConfig.ANDROID_KEY_Z, PushMessageConfig.ANDROID_SECRET_Z);
|
|
|
+ pushConfig.sendAndroidUnicast2(pushToken, "四维看看Minion",title, body, webSite);
|
|
|
}else {
|
|
|
//安卓
|
|
|
- log.info("ANDROID_KEY:{}, ANDROID_SECRET:{}", ANDROID_KEY, ANDROID_SECRET);
|
|
|
- demo = new PushMessageConfig(ANDROID_KEY, ANDROID_SECRET);
|
|
|
- demo.sendAndroidUnicast(pushToken, "四维看看Pro",
|
|
|
- sceneName + "计算完成", "您上传的" + sceneName + "计算完成,点击查看", webSite);
|
|
|
+ pushConfig = new PushMessageConfig(PushMessageConfig.ANDROID_KEY, PushMessageConfig.ANDROID_SECRET);
|
|
|
+ pushConfig.sendAndroidUnicast(pushToken, "四维看看Pro",title, body, webSite);
|
|
|
}
|
|
|
}
|
|
|
log.info("消息推送结束!");
|