|
@@ -11,7 +11,6 @@ import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.Arrays;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
@@ -30,8 +29,6 @@ public class TenantInfoSendMsgServiceImpl implements TenantInfoSendMsgService {
|
|
|
|
|
|
//平台向机构发送信息,目前有 机构开通、机构续费、机构即将到期提醒、云教室余额不足
|
|
//平台向机构发送信息,目前有 机构开通、机构续费、机构即将到期提醒、云教室余额不足
|
|
public static final String PLATFORM_SEND = "PLATFORM_SEND";
|
|
public static final String PLATFORM_SEND = "PLATFORM_SEND";
|
|
- //邮件 和 短信
|
|
|
|
- public static final MessageSenderPluginContext.MessageSender[] SENDER_ALL_ENUM = {MessageSenderPluginContext.MessageSender.EMAIL, MessageSenderPluginContext.MessageSender.AWSMS};
|
|
|
|
//平台向机构发送信息 开通、续费、即将到期提醒、云教室余额不足
|
|
//平台向机构发送信息 开通、续费、即将到期提醒、云教室余额不足
|
|
private static final Map<MessageSenderPluginContext.MessageSender, MessageTypeEnum> PLATFORM_ALL_MSG_ENUM = new HashMap<>();
|
|
private static final Map<MessageSenderPluginContext.MessageSender, MessageTypeEnum> PLATFORM_ALL_MSG_ENUM = new HashMap<>();
|
|
|
|
|
|
@@ -49,18 +46,27 @@ public class TenantInfoSendMsgServiceImpl implements TenantInfoSendMsgService {
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public void platformSendToAll(String email, String phone, Object[] objs) {
|
|
public void platformSendToAll(String email, String phone, Object[] objs) {
|
|
- log.info("platformSendToAll>>> ing...");
|
|
|
|
Map<Integer, String> sendPar = new HashMap<>();
|
|
Map<Integer, String> sendPar = new HashMap<>();
|
|
Integer userId = tenantInfoDao.queryUserByTenantId(-1);
|
|
Integer userId = tenantInfoDao.queryUserByTenantId(-1);
|
|
if (Objects.isNull(userId)) {
|
|
if (Objects.isNull(userId)) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- sendPar.put(userId, email);
|
|
|
|
- if (StringUtils.isNotBlank(email) && StringUtils.isNotBlank(phone)) {
|
|
|
|
- log.info("platformSendToAll>>> email {} phone {} objs {} sendPar {}", email, phone, objs, sendPar);
|
|
|
|
- Arrays.stream(SENDER_ALL_ENUM).forEach(en -> sysMessageService.batchSendMessage(en,
|
|
|
|
- PLATFORM_ALL_MSG_ENUM.get(en), sendPar, null, 0, null,
|
|
|
|
- "SYSTEM", objs));
|
|
|
|
|
|
+ log.info("platformSendToAll>>> email {} phone {} objs {} sendPar {}", email, phone, objs, sendPar);
|
|
|
|
+
|
|
|
|
+ if (StringUtils.isNotBlank(email)) {
|
|
|
|
+ sendPar.put(userId, email);
|
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.EMAIL,
|
|
|
|
+ PLATFORM_ALL_MSG_ENUM.get(MessageSenderPluginContext.MessageSender.EMAIL),
|
|
|
|
+ sendPar, null, 0, null,
|
|
|
|
+ "SYSTEM", objs);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (StringUtils.isNotBlank(phone)) {
|
|
|
|
+ sendPar.put(userId, phone);
|
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS,
|
|
|
|
+ PLATFORM_ALL_MSG_ENUM.get(MessageSenderPluginContext.MessageSender.AWSMS),
|
|
|
|
+ sendPar, null, 0, null,
|
|
|
|
+ "SYSTEM", objs);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|