Authored by Amos_sdy

fix

... ... @@ -8,6 +8,8 @@ import java.util.List;
import java.util.Map;
import java.util.UUID;
import javax.annotation.PostConstruct;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
... ... @@ -37,8 +39,21 @@ public class XWSendSMSServiceImpl implements ISendSMSService {
private Account defaultAccount = new Account("nocrm", "1qa@WS");
private Account marketAccount = new Account("market", "Market2017");
private PostMsg postMsg = null;
@PostConstruct
void init() {
postMsg = this.createPostMsg();
}
private int pageSize = 100000;
private PostMsg createPostMsg() {
PostMsg pm = new PostMsg();
pm.getCmHost().setHost("211.147.239.62", 20506);// 设置网关的IP和port,用于发送信息
pm.getWsHost().setHost("211.147.239.62", 20507);// 设置网关的
return pm;
}
@Override
public Response<SendNoticeResultBean> sendSMS(List<String> mobileList, String content, Map<String, String> params) throws Exception {
if (CollectionUtils.isEmpty(mobileList)) {
... ... @@ -85,10 +100,6 @@ public class XWSendSMSServiceImpl implements ISendSMSService {
ac = marketAccount;
}
log.info("sms acct name is[{}]", ac.getName());
PostMsg pm = new PostMsg();
pm.getCmHost().setHost("211.147.239.62", 20506);// 设置网关的IP和port,用于发送信息
pm.getWsHost().setHost("211.147.239.62", 20507);// 设置网关的
// IP和port,用于获取账号信息、上行、状态报告等等
MTPack pack = new MTPack();
pack.setBatchID(UUID.randomUUID());
... ... @@ -111,7 +122,7 @@ public class XWSendSMSServiceImpl implements ISendSMSService {
pack.setMsgs(msgs);
GsmsResponse resp = null;
try {
resp = pm.post(ac, pack);
resp = postMsg.post(ac, pack);
log.info("immediateSendSMS resp :" + resp);
if (resp != null && resp.getResult() == 0) {
return mobileList;
... ...