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; } }
public static Boolean InsertSmsBind(SmsBind sms) { String sql = "insert into sms_bind(uuid, bindphone, sn, content, type, sendphone,receivephone,createtime) values("; sql += "'" + sms.getUuid() + "',"; sql += "'" + sms.getBindphone() + "',"; sql += "'" + sms.getSn() + "',"; sql += "'" + sms.getContent() + "',"; sql += "" + sms.getType() + ","; sql += "'" + sms.getSendphone() + "',"; sql += "'" + sms.getReceivephone() + "',"; sql += "'" + sms.getCreatetime().ToString() + "')"; if (MySqlDB.ExcCommand(sql)) { return true; } else { Program.logWriter.WriteLine("InsertSmsBind sql执行失败"); return false; } }