Commit d2eefa86 by levphon

通知服务-新增发短信接口,分隔符处理

1 parent bf62185f
...@@ -18,7 +18,6 @@ import org.springframework.util.MultiValueMap; ...@@ -18,7 +18,6 @@ import org.springframework.util.MultiValueMap;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.Arrays;
import java.util.Date; import java.util.Date;
...@@ -54,10 +53,10 @@ public class SmsService { ...@@ -54,10 +53,10 @@ public class SmsService {
} }
String content = MessageFormat.format(mt.getContent(), arg); String content = MessageFormat.format(mt.getContent(), arg);
//把非英文逗号分隔符替换为英文逗号分隔符,todo 待优化,用正则统一替换非英文逗号分隔符
phone = phone.replaceAll(",", ",").replaceAll(";", ",").replaceAll(";", ",");
String[] phones = phone.split(";"); sendMessage(phone, mt.getSource(), String.valueOf(mt.getType()), content);
Arrays.asList(phones).forEach(pno -> sendMessage(pno, mt.getSource(), String.valueOf(mt.getType()), content));
MessageLog log = new MessageLog(); MessageLog log = new MessageLog();
log.setToUser(phone); log.setToUser(phone);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!