|
|
|
@ -38,7 +38,28 @@ public class SmsServiceImpl implements SmsService {
|
|
|
|
|
List<String> rabchaserList = new ArrayList<>();
|
|
|
|
|
List<String> m2mList = new ArrayList<>();
|
|
|
|
|
List<String> lkjList = new ArrayList<>();
|
|
|
|
|
for (Integer termId : model.getTermIdList()) {
|
|
|
|
|
|
|
|
|
|
this.buildiccidList(dahanList, rabchaserList, m2mList, lkjList,
|
|
|
|
|
model.getTermIdList());
|
|
|
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(dahanList)) {
|
|
|
|
|
smsAdapter.sendSms(Constants.NetType_Dahan, dahanList, model.getContent());
|
|
|
|
|
}
|
|
|
|
|
if (!CollectionUtils.isEmpty(rabchaserList)) {
|
|
|
|
|
smsAdapter.sendSms(Constants.NetType_Rabchaser, rabchaserList, model.getContent());
|
|
|
|
|
}
|
|
|
|
|
if (!CollectionUtils.isEmpty(m2mList)) {
|
|
|
|
|
smsAdapter.sendSms(Constants.NetType_M2M10086, m2mList, model.getContent());
|
|
|
|
|
}
|
|
|
|
|
if (!CollectionUtils.isEmpty(lkjList)) {
|
|
|
|
|
smsAdapter.sendSms(Constants.NetType_LWWLKJ, lkjList, model.getContent());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void buildiccidList(List<String> dahanList, List<String> rabchaserList,
|
|
|
|
|
List<String> m2mList, List<String> lkjList,
|
|
|
|
|
List<Integer> termIdList) {
|
|
|
|
|
for (Integer termId : termIdList) {
|
|
|
|
|
Terminals term = newCacheService.getTerminal(termId);
|
|
|
|
|
if (term == null) {
|
|
|
|
|
throw new ApiException(termId + "该装置不存在");
|
|
|
|
@ -92,19 +113,6 @@ public class SmsServiceImpl implements SmsService {
|
|
|
|
|
throw new ApiException(termId + "该装置的运营商类型未配置");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(dahanList)) {
|
|
|
|
|
smsAdapter.sendSms(Constants.NetType_Dahan, dahanList, model.getContent());
|
|
|
|
|
}
|
|
|
|
|
if (!CollectionUtils.isEmpty(rabchaserList)) {
|
|
|
|
|
smsAdapter.sendSms(Constants.NetType_Rabchaser, rabchaserList, model.getContent());
|
|
|
|
|
}
|
|
|
|
|
if (!CollectionUtils.isEmpty(m2mList)) {
|
|
|
|
|
smsAdapter.sendSms(Constants.NetType_M2M10086, m2mList, model.getContent());
|
|
|
|
|
}
|
|
|
|
|
if (!CollectionUtils.isEmpty(lkjList)) {
|
|
|
|
|
smsAdapter.sendSms(Constants.NetType_LWWLKJ, lkjList, model.getContent());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -162,4 +170,52 @@ public class SmsServiceImpl implements SmsService {
|
|
|
|
|
throw new ApiException(termId + "该装置的运营商类型未配置");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void netDown(SmsModel model) {
|
|
|
|
|
List<String> dahanList = new ArrayList<>();
|
|
|
|
|
List<String> rabchaserList = new ArrayList<>();
|
|
|
|
|
List<String> m2mList = new ArrayList<>();
|
|
|
|
|
List<String> lkjList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
this.buildiccidList(dahanList, rabchaserList, m2mList, lkjList,
|
|
|
|
|
model.getTermIdList());
|
|
|
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(dahanList)) {
|
|
|
|
|
smsAdapter.netDown(Constants.NetType_Dahan, dahanList);
|
|
|
|
|
}
|
|
|
|
|
if (!CollectionUtils.isEmpty(rabchaserList)) {
|
|
|
|
|
smsAdapter.netDown(Constants.NetType_Rabchaser, rabchaserList);
|
|
|
|
|
}
|
|
|
|
|
if (!CollectionUtils.isEmpty(m2mList)) {
|
|
|
|
|
smsAdapter.netDown(Constants.NetType_M2M10086, m2mList);
|
|
|
|
|
}
|
|
|
|
|
if (!CollectionUtils.isEmpty(lkjList)) {
|
|
|
|
|
smsAdapter.netDown(Constants.NetType_LWWLKJ, lkjList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void netUp(SmsModel model) {
|
|
|
|
|
List<String> dahanList = new ArrayList<>();
|
|
|
|
|
List<String> rabchaserList = new ArrayList<>();
|
|
|
|
|
List<String> m2mList = new ArrayList<>();
|
|
|
|
|
List<String> lkjList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
this.buildiccidList(dahanList, rabchaserList, m2mList, lkjList,
|
|
|
|
|
model.getTermIdList());
|
|
|
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(dahanList)) {
|
|
|
|
|
smsAdapter.netUp(Constants.NetType_Dahan, dahanList);
|
|
|
|
|
}
|
|
|
|
|
if (!CollectionUtils.isEmpty(rabchaserList)) {
|
|
|
|
|
smsAdapter.netUp(Constants.NetType_Rabchaser, rabchaserList);
|
|
|
|
|
}
|
|
|
|
|
if (!CollectionUtils.isEmpty(m2mList)) {
|
|
|
|
|
smsAdapter.netUp(Constants.NetType_M2M10086, m2mList);
|
|
|
|
|
}
|
|
|
|
|
if (!CollectionUtils.isEmpty(lkjList)) {
|
|
|
|
|
smsAdapter.netUp(Constants.NetType_LWWLKJ, lkjList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|