static void Main(string[] args) { Console.WriteLine("开始查询"); SMSQuery query = new SMSQuery(); PMS.Model.SMSModel.SMSModel_Query model = new PMS.Model.SMSModel.SMSModel_Query() { account = "dh74381", password = "******", smsId = "54876ee66e74492bbfcf91656cbfa2bd" }; List<PMS.Model.SMSModel.SMSModel_QueryReceive> list_out = new List<PMS.Model.SMSModel.SMSModel_QueryReceive>(); query.QueryMsg(model, out list_out); var index = 0;//此处已修改 query.GetQueryState(list_out); var dic =PMS.Model.Dictionary.SMSQueryResultDictionary.GetResponseCode(); Console.WriteLine(dic[index]); Console.ReadLine(); }
/// <summary> /// 根据msgid执行查询接收短信状态 /// </summary> /// <param name="msgid"></param> public void ToQuery(PMS.Model.QueryModel.Redis_SMSContent model) { if (model.msgid == string.Empty) { //ToShow("读取msgid错误"); return; } if (model.PhoneNums == string.Empty) { //ToShow("发送联系人列表为空"); return; } string account = "dh74381"; //账号"dh74381"; string passWord = "******";//密码 = "uAvb3Qey"; //6 查询发送状态(是否加入等待时间?) PMS.Model.SMSModel.SMSModel_Query queryMsg = new PMS.Model.SMSModel.SMSModel_Query() { account = account, password = passWord, smsId = model.msgid, //phoneNums=model.PhoneNums }; List<PMS.Model.SMSModel.SMSModel_QueryReceive> list_QueryReceive; ISMS.ISMSQuery smsQuery = new SMSFactory.SMSQuery(); bool isGetReturnMsg = smsQuery.QueryMsg(queryMsg, out list_QueryReceive); if (!isGetReturnMsg) { return; // return Content("服务器错误"); } //7 获取改次发送的SMSContent的ID IS_SMSContentBLL smsContentBLL = new PMS.BLL.S_SMSContentBLL(); var list = smsContentBLL.GetListBy(p => p.msgId.Equals(model.msgid)); if (list.Count() < 1) { return; } else { int scid = list.FirstOrDefault().ID; if (list_QueryReceive.Count() == 0) { //ToShow("当前取出的对象中接收内容有误"); return; } IS_SMSRecord_CurrentBLL smsRecord_CurrentBLL = new PMS.BLL.S_SMSRecord_CurrentBLL(); bool isSaveCurrnetMsgOk = smsRecord_CurrentBLL.SaveReceieveMsg(list_QueryReceive, scid); } }