Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
 public static SmsBind ToSmsBindObject(string msg, string state, int type)
 {
     SmsBind bind = new SmsBind();
     bind.setContent(msg);
     bind.setType(type);
     bind.setSendphone("10086");
     bind.setReceivephone("15852744042");
     bind.setState(state);
     bind.setCreatetime(DateTime.Now);
     return bind;
 }
Exemplo n.º 3
0
 public static SmsBind ToSmsBindObject(IMessage message, String state)
 {
     String name = message.Properties.GetString("name");
             String phone = message.Properties.GetString("phone");
             String address = message.Properties.GetString("address");
             String idNumber = message.Properties.GetString("idNumber");
             String msg = "ZLDJ#" + phone + "#" + idNumber + "#" + name + "#" + address;
             SmsBind vo = new SmsBind();
             vo.setContent(msg);
             vo.setType(2);
             vo.setSendphone("10086");
             vo.setReceivephone("15852744042");
             vo.setState(state);
             vo.setCreatetime(DateTime.Now);
             return vo;
 }
Exemplo n.º 4
0
 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;
     }
 }