Explorar el Código

短信跳转链接可配置

hanzhiwei hace 2 años
padre
commit
263f142894

+ 6 - 2
zd-modules/zd-algorithm/src/main/java/com/zd/alg/alarm/controller/AlarmController.java

@@ -19,6 +19,7 @@ import com.zd.model.domain.per.PerPrefix;
 import com.zd.model.page.TableDataInfo;
 import com.zd.model.page.TableDataInfo;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
@@ -38,6 +39,9 @@ public class AlarmController extends BaseController {
     @Autowired
     @Autowired
     private RemoteMessageService remoteMessageService;
     private RemoteMessageService remoteMessageService;
 
 
+    @Value("${alarm.smsRedirect}")
+    private String smsRedirect;
+
     /**
     /**
      * 查询算法结果列表
      * 查询算法结果列表
      * @return
      * @return
@@ -165,14 +169,14 @@ public class AlarmController extends BaseController {
     private void sendSMS(AlarmEntrty alarmEntrty) {
     private void sendSMS(AlarmEntrty alarmEntrty) {
         List<UserPhoneInfo> userPhoneInfoList = alarmEntrty.getUserPhoneInfo();
         List<UserPhoneInfo> userPhoneInfoList = alarmEntrty.getUserPhoneInfo();
         LinkedHashMap<String, List<UserPhoneInfo>> userPhoneInfoMap = Optional.ofNullable(userPhoneInfoList).orElseGet(Collections::emptyList).stream().collect(Collectors.groupingBy(UserPhoneInfo::getPhone, LinkedHashMap::new, Collectors.toList()));
         LinkedHashMap<String, List<UserPhoneInfo>> userPhoneInfoMap = Optional.ofNullable(userPhoneInfoList).orElseGet(Collections::emptyList).stream().collect(Collectors.groupingBy(UserPhoneInfo::getPhone, LinkedHashMap::new, Collectors.toList()));
-        String text = alarmEntrty.getText() + "https://lab.zjznai.com/labAppTest/earlyWarning/index.html?id=";
+        String text = alarmEntrty.getText() + smsRedirect;
         for (String phone : alarmEntrty.getTo()) {
         for (String phone : alarmEntrty.getTo()) {
             ResultData urlScheme = remoteMessageService.getUrlScheme(alarmEntrty.getLogId());
             ResultData urlScheme = remoteMessageService.getUrlScheme(alarmEntrty.getLogId());
             if (urlScheme.getCode() != HttpStatus.SUCCESS) {
             if (urlScheme.getCode() != HttpStatus.SUCCESS) {
                 logger.error("获取urlScheme失败!");
                 logger.error("获取urlScheme失败!");
             }
             }
             String newTest = "";
             String newTest = "";
-            newTest = text + alarmEntrty.getLogId() + "&urlScheme=" + urlScheme.getData();
+            newTest = text + "?id=" + alarmEntrty.getLogId() + "&urlScheme=" + urlScheme.getData();
             alarmEntrty.setText(newTest);
             alarmEntrty.setText(newTest);
             alarmEntrty.setTo(new String[]{phone});
             alarmEntrty.setTo(new String[]{phone});
             logger.info("发送给用户===>>>{},短信内容===>>>{}",phone,newTest);
             logger.info("发送给用户===>>>{},短信内容===>>>{}",phone,newTest);