Browse Source

添加集中短信推送相关判断

zhongwei
tyty 2 years ago
parent
commit
ca411580fc
  1. 21
      hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/SmsMessageServiceImpl.java

21
hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/SmsMessageServiceImpl.java

@ -2,12 +2,11 @@ package com.hnac.hzims.message.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.api.client.util.Value;
import com.hnac.hzims.message.MessageConstants; import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.entity.MessagePushRecordEntity;
import com.hnac.hzims.message.log.aspect.SaveLog;
import com.hnac.hzims.message.dto.PushDto; import com.hnac.hzims.message.dto.PushDto;
import com.hnac.hzims.message.dto.SmsPushDto; import com.hnac.hzims.message.dto.SmsPushDto;
import com.hnac.hzims.message.entity.MessagePushRecordEntity;
import com.hnac.hzims.message.log.aspect.SaveLog;
import com.hnac.hzims.message.service.IMessageService; import com.hnac.hzims.message.service.IMessageService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -19,6 +18,7 @@ import org.springblade.core.tool.utils.Func;
import org.springblade.resource.feign.ISmsClient; import org.springblade.resource.feign.ISmsClient;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
/** /**
* @author hx * @author hx
@ -54,9 +54,16 @@ public class SmsMessageServiceImpl implements IMessageService {
request.getSmsParam(), request.getSmsParam(),
this.getAccountByPusher(Long.parseLong(request.getPusher()),request.getType()) this.getAccountByPusher(Long.parseLong(request.getPusher()),request.getType())
); );
Assert.isTrue(response.isSuccess(),() -> { if(ObjectUtils.isEmpty(response.getData())) {
throw new ServiceException(response.getMsg()); Assert.isTrue(response.isSuccess(), () -> {
}); throw new ServiceException(response.getMsg());
return response.getData().isSuccess(); });
return response.isSuccess();
}else {
Assert.isTrue(response.getData().isSuccess(), () -> {
throw new ServiceException(response.getMsg());
});
return response.getData().isSuccess();
}
} }
} }

Loading…
Cancel
Save