public void BindProductor(String QueueName,SmsBindTemp temp,SmsBind vo) { try { m_mq.CreateProducer(false, QueueName + temp.getHostName()); List<Property> m_lstProperty = new List<Property>(); //TODO//等待完成 Property sn; sn.name = "sn"; sn.value = temp.getSn(); m_lstProperty.Add(sn); Property uuid; uuid.name = "uuid"; uuid.value =temp.getUuid(); m_lstProperty.Add(uuid); Property name; name.name = "name"; name.value = temp.getName(); m_lstProperty.Add(name); Property userId; userId.name = "userId"; userId.value = temp.getUserId(); m_lstProperty.Add(userId); Property phone; phone.name = "phone"; phone.value = temp.getPhone(); m_lstProperty.Add(phone); Property address; address.name = "address"; address.value = temp.getAddress(); m_lstProperty.Add(address); Property idNumber; idNumber.name = "idNumber"; idNumber.value = temp.getIdNumber(); Property content; content.name = "content"; content.value = vo.getContent(); m_lstProperty.Add(content); Property state; state.name = "state"; state.value = vo.getState(); m_lstProperty.Add(state); Property userMessageId; userMessageId.name = "userMessageId"; userMessageId.value = temp.getUserMessageId(); m_lstProperty.Add(userMessageId); m_mq.SendMQMessage("", m_lstProperty); Program.logWriter.WriteLine("=============MQ队列写入完成 电话号码:"+temp.getPhone()+"============="); } catch (Exception ex) { Program.logWriter.WriteLine("BindProductor Exception:" + ex.Message); Program.mqconnection = false; } }
private void successHandler(string content, SmsBindTemp temp, int type) { SmsBind sms = MTO.ToSmsBindObject(content, "success", type); sms.setBindphone(temp.getPhone()); sms.setSn(temp.getSn()); sms.setUuid(temp.getUuid()); DbAction.InsertSmsBind(sms); this.cust.BindProductor("BIND_IDNO_RESPONSE_", temp, sms); DbAction.UpdateSmsBindTempReceiveFlag("1", temp); }
private void failedHandler(string content, SmsBindTemp temp, int type) { SmsBind sms = MTO.ToSmsBindObject(content, "unsuccess", type); sms.setBindphone(temp.getPhone()); sms.setSn(temp.getSn()); sms.setUuid(temp.getUuid()); DbAction.InsertSmsBind(sms); this.cust.BindProductor("BIND_IDNO_RESPONSE_", temp, sms); DbAction.UpdateSmsBindTempReceiveFlag("2", temp); if (type == 5||type==3) { SendMail("*****@*****.**", "浦廷钧", "[email protected];[email protected];[email protected]", "Error", content, "tingjun.pu", "listandmount", "smtp.ym.163.com", ""); } }