|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.shxy.xymanager_common.sms;
|
|
|
|
|
|
|
|
|
|
import com.shxy.xymanager_common.constant.Constants;
|
|
|
|
|
import com.shxy.xymanager_common.exception.ApiException;
|
|
|
|
|
import com.shxy.xymanager_common.model.SmsReturn;
|
|
|
|
|
import com.shxy.xymanager_common.sms.dahan.DahanWeb;
|
|
|
|
|
import com.shxy.xymanager_common.sms.lwwlkj.LwwlkjWeb;
|
|
|
|
@ -31,34 +32,52 @@ public class SmsAdapter {
|
|
|
|
|
LwwlkjWeb lwwlkjWeb;
|
|
|
|
|
|
|
|
|
|
public void sendSms(Integer type, List<String> iccidList, String content) {
|
|
|
|
|
String net = "";
|
|
|
|
|
try {
|
|
|
|
|
if (Constants.NetType_Dahan.equals(type)) {
|
|
|
|
|
net = "dahan";
|
|
|
|
|
dahanWeb.sendSms(iccidList, content);
|
|
|
|
|
} else if (Constants.NetType_Rabchaser.equals(type)) {
|
|
|
|
|
net = "rabchaser";
|
|
|
|
|
rabchaserApi.sendSms(iccidList, content);
|
|
|
|
|
} else if (Constants.NetType_M2M10086.equals(type)) {
|
|
|
|
|
net = "m2m10086";
|
|
|
|
|
m2m10086Web.sendSms(iccidList, content);
|
|
|
|
|
} else if (Constants.NetType_LWWLKJ.equals(type)) {
|
|
|
|
|
net = "lwwlkj";
|
|
|
|
|
lwwlkjWeb.sendSms(iccidList, content);
|
|
|
|
|
}
|
|
|
|
|
} catch (ApiException e) {
|
|
|
|
|
throw new ApiException(net + e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public SmsReturn listSms(Integer type, String iccid) {
|
|
|
|
|
SmsReturn result = new SmsReturn();
|
|
|
|
|
result.setType(type);
|
|
|
|
|
String today = DateUtil.format(new Date(), "yyyy-MM-dd");
|
|
|
|
|
String net = "";
|
|
|
|
|
try {
|
|
|
|
|
if (Constants.NetType_Dahan.equals(type)) {
|
|
|
|
|
net = "dahan";
|
|
|
|
|
Object obj = dahanWeb.listSms(iccid, today);
|
|
|
|
|
result.setData(obj);
|
|
|
|
|
} else if (Constants.NetType_Rabchaser.equals(type)) {
|
|
|
|
|
net = "rabchaser";
|
|
|
|
|
Object obj = rabchaserWeb.listSms(iccid, today);
|
|
|
|
|
result.setData(obj);
|
|
|
|
|
} else if (Constants.NetType_M2M10086.equals(type)) {
|
|
|
|
|
net = "m2m10086";
|
|
|
|
|
Object obj = m2m10086Web.listSms(iccid, today);
|
|
|
|
|
result.setData(obj);
|
|
|
|
|
} else if (Constants.NetType_LWWLKJ.equals(type)) {
|
|
|
|
|
net = "lwwlkj";
|
|
|
|
|
Object obj = lwwlkjWeb.listSms(iccid, today);
|
|
|
|
|
result.setData(obj);
|
|
|
|
|
}
|
|
|
|
|
} catch (ApiException e) {
|
|
|
|
|
throw new ApiException(net + e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|