fix: 自动获取卡1卡2信息来发送和查询短信

dev
huangfeng 10 months ago
parent f8b96e5d47
commit 26edc96641

@ -68,8 +68,28 @@ public class SmsServiceImpl implements SmsService {
throw new ApiException(termId + "该装置缺少msisdn2"); throw new ApiException(termId + "该装置缺少msisdn2");
} }
lkjList.add(simcard.getMsisdn2()); lkjList.add(simcard.getMsisdn2());
} else if (Constants.NetType_Dahan.equals(simcard.getType1())) {
if (StringUtils.isBlank(simcard.getIccid1())) {
throw new ApiException(termId + "该装置缺少iccid1");
}
dahanList.add(simcard.getIccid1());
} else if (Constants.NetType_Rabchaser.equals(simcard.getType1())) {
if (StringUtils.isBlank(simcard.getIccid1())) {
throw new ApiException(termId + "该装置缺少iccid1");
}
rabchaserList.add(simcard.getIccid1());
} else if (Constants.NetType_M2M10086.equals(simcard.getType1())) {
if (StringUtils.isBlank(simcard.getIccid1())) {
throw new ApiException(termId + "该装置缺少iccid1");
}
m2mList.add(simcard.getIccid1());
} else if (Constants.NetType_LWWLKJ.equals(simcard.getType1())) {
if (StringUtils.isBlank(simcard.getMsisdn1())) {
throw new ApiException(termId + "该装置缺少msisdn1");
}
lkjList.add(simcard.getMsisdn1());
} else { } else {
throw new ApiException(termId + "该装置的运营商类型type2=" + simcard.getType2() + "暂不支持发短信"); throw new ApiException(termId + "该装置的运营商类型暂不支持发短信");
} }
} }
@ -118,8 +138,28 @@ public class SmsServiceImpl implements SmsService {
throw new ApiException(termId + "该装置缺少msisdn2"); throw new ApiException(termId + "该装置缺少msisdn2");
} }
return smsAdapter.listSms(simcard.getType2(), simcard.getMsisdn2()); return smsAdapter.listSms(simcard.getType2(), simcard.getMsisdn2());
} else if (Constants.NetType_Dahan.equals(simcard.getType1())) {
if (StringUtils.isBlank(simcard.getMsisdn1())) {
throw new ApiException(termId + "该装置缺少msisdn1");
}
return smsAdapter.listSms(simcard.getType1(), simcard.getMsisdn1());
} else if (Constants.NetType_Rabchaser.equals(simcard.getType1())) {
if (StringUtils.isBlank(simcard.getIccid1())) {
throw new ApiException(termId + "该装置缺少iccid1");
}
return smsAdapter.listSms(simcard.getType1(), simcard.getIccid1());
} else if (Constants.NetType_M2M10086.equals(simcard.getType1())) {
if (StringUtils.isBlank(simcard.getIccid1())) {
throw new ApiException(termId + "该装置缺少iccid1");
}
return smsAdapter.listSms(simcard.getType1(), simcard.getIccid1());
} else if (Constants.NetType_LWWLKJ.equals(simcard.getType1())) {
if (StringUtils.isBlank(simcard.getMsisdn1())) {
throw new ApiException(termId + "该装置缺少msisdn1");
}
return smsAdapter.listSms(simcard.getType1(), simcard.getMsisdn1());
} else { } else {
throw new ApiException(termId + "该装置的运营商类型type2=" + simcard.getType2() + "暂不支持查询短信"); throw new ApiException(termId + "该装置的运营商类型暂不支持查询短信");
} }
} }
} }

Loading…
Cancel
Save