fix pull sms content

pull/26/head
3y 2 years ago
parent c0c1bdc699
commit 5de82a9d2a

@ -154,7 +154,7 @@ public class PushHandler extends BaseHandler implements Handler {
SendPushParam param = SendPushParam.builder() SendPushParam param = SendPushParam.builder()
.requestId(String.valueOf(IdUtil.getSnowflake().nextId())) .requestId(String.valueOf(IdUtil.getSnowflake().nextId()))
.pushMessage(SendPushParam.PushMessageVO.builder().notification(SendPushParam.PushMessageVO.NotificationVO.builder() .pushMessage(SendPushParam.PushMessageVO.builder().notification(SendPushParam.PushMessageVO.NotificationVO.builder()
.title(pushContentModel.getTitle()).body(pushContentModel.getContent()).clickType("startapp").build()) .title(pushContentModel.getTitle()).body(pushContentModel.getContent()).clickType("startapp").build())
.build()) .build())
.build(); .build();
if (CollUtil.isNotEmpty(cid)) { if (CollUtil.isNotEmpty(cid)) {

@ -47,7 +47,7 @@ public class SmsPullReceiptStarterImpl implements ReceiptMessageStater {
List<ChannelAccount> channelAccountList = channelAccountDao.findAllByIsDeletedEqualsAndSendChannelEquals(CommonConstant.FALSE, ChannelType.SMS.getCode()); List<ChannelAccount> channelAccountList = channelAccountDao.findAllByIsDeletedEqualsAndSendChannelEquals(CommonConstant.FALSE, ChannelType.SMS.getCode());
for (ChannelAccount channelAccount : channelAccountList) { for (ChannelAccount channelAccount : channelAccountList) {
SmsAccount smsAccount = JSON.parseObject(channelAccount.getAccountConfig(), SmsAccount.class); SmsAccount smsAccount = JSON.parseObject(channelAccount.getAccountConfig(), SmsAccount.class);
List<SmsRecord> smsRecordList = scriptMap.get(smsAccount.getScriptName()).pull(smsAccount.getScriptName()); List<SmsRecord> smsRecordList = scriptMap.get(smsAccount.getScriptName()).pull(channelAccount.getId().intValue());
if (CollUtil.isNotEmpty(smsRecordList)) { if (CollUtil.isNotEmpty(smsRecordList)) {
smsRecordDao.saveAll(smsRecordList); smsRecordDao.saveAll(smsRecordList);
} }

@ -26,9 +26,9 @@ public interface SmsScript {
/** /**
* *
* *
* @param scriptName * @param id ID
* @return * @return
*/ */
List<SmsRecord> pull(String scriptName); List<SmsRecord> pull(Integer id);
} }

@ -59,9 +59,9 @@ public class TencentSmsScript implements SmsScript {
} }
@Override @Override
public List<SmsRecord> pull(String scriptName) { public List<SmsRecord> pull(Integer accountId) {
try { try {
TencentSmsAccount account = accountUtils.getSmsAccountByScriptName(scriptName, TencentSmsAccount.class); TencentSmsAccount account = accountUtils.getAccountById(accountId, TencentSmsAccount.class);
SmsClient client = init(account); SmsClient client = init(account);
PullSmsSendStatusRequest req = assemblePullReq(account); PullSmsSendStatusRequest req = assemblePullReq(account);
PullSmsSendStatusResponse resp = client.PullSmsSendStatus(req); PullSmsSendStatusResponse resp = client.PullSmsSendStatus(req);

@ -58,8 +58,7 @@ public class YunPianSmsScript implements SmsScript {
} }
@Override @Override
public List<SmsRecord> pull(String scriptName) { public List<SmsRecord> pull(Integer accountId) {
YunPianSmsAccount account = accountUtils.getSmsAccountByScriptName(scriptName, YunPianSmsAccount.class);
// ..... // .....
return null; return null;
} }

@ -51,7 +51,7 @@ public class ShieldServiceImpl implements ShieldService {
} }
if (ShieldType.NIGHT_SHIELD_BUT_NEXT_DAY_SEND.getCode().equals(taskInfo.getShieldType())) { if (ShieldType.NIGHT_SHIELD_BUT_NEXT_DAY_SEND.getCode().equals(taskInfo.getShieldType())) {
redisUtils.lPush(NIGHT_SHIELD_BUT_NEXT_DAY_SEND_KEY, JSON.toJSONString(taskInfo, redisUtils.lPush(NIGHT_SHIELD_BUT_NEXT_DAY_SEND_KEY, JSON.toJSONString(taskInfo,
SerializerFeature.WriteClassName), SerializerFeature.WriteClassName),
(DateUtil.offsetDay(new Date(), 1).getTime() / 1000) - DateUtil.currentSeconds()); (DateUtil.offsetDay(new Date(), 1).getTime() / 1000) - DateUtil.currentSeconds());
logUtils.print(AnchorInfo.builder().state(AnchorState.NIGHT_SHIELD_NEXT_SEND.getCode()).businessId(taskInfo.getBusinessId()).ids(taskInfo.getReceiver()).build()); logUtils.print(AnchorInfo.builder().state(AnchorState.NIGHT_SHIELD_NEXT_SEND.getCode()).businessId(taskInfo.getBusinessId()).ids(taskInfo.getReceiver()).build());
} }

Loading…
Cancel
Save