Пример #1
0
        private void GetReceiptConfirm()
        {
            GOrderBLL orderServer = new GOrderBLL(Default.GetLoggingSession());
            string    msgUrl      = ConfigurationManager.AppSettings["push_weixin_msg_url"].Trim();
            string    strError    = string.Empty;
            bool      b           = orderServer.GetReceiptConfirm("4C2BFAD08409499FB08DED7BC5F874F3", "70413b931e6840d8898cfd69c62d3eb6", msgUrl, out strError);

            this.lbCode.Text = b.ToString();
            this.lbDesc.Text = strError;
        }
Пример #2
0
        /// <summary>
        /// 所有订单的推送
        /// </summary>
        private void SetGOrderPushAll()
        {
            GOrderBLL orderServer = new GOrderBLL(Default.GetLoggingSession());
            string    msgUrl      = ConfigurationManager.AppSettings["push_weixin_msg_url"].Trim();
            string    strError    = string.Empty;
            bool      b           = orderServer.SetGOrderPushAll(msgUrl, out strError);

            this.lbCode.Text = b.ToString();
            this.lbDesc.Text = strError;
        }
Пример #3
0
        static int SendDelayTime = 10; // ms

        static void Main(string[] args)
        {
            try
            {
                int    cycleTime = int.Parse(ConfigurationManager.AppSettings["cycleTime"]);
                string batId     = string.Empty;

                while (true)
                {
                    if (ConfigurationManager.AppSettings["EnableTaskSend"] == "1")
                    {
                        Console.WriteLine(string.Format("[{0}]任务开始...", Utils.GetNow()));
                        GOrderBLL gOrderBLL = new GOrderBLL(GetLoginUser("bs"));
                        var       msgUrl    = ConfigurationManager.AppSettings["push_weixin_msg_url"];
                        var       error     = "";
                        var       flag      = gOrderBLL.SetGOrderPushAll(msgUrl, out error);
                        if (flag)
                        {
                            Console.WriteLine(string.Format("[{0}] 执行成功", Utils.GetNow()));
                        }
                        else
                        {
                            Console.WriteLine(string.Format("[{0}] 执行失败:{1}", Utils.GetNow(), error));
                        }
                        Thread.Sleep(SendDelayTime);
                        Console.WriteLine(string.Format("[{0}]任务结束", Utils.GetNow()));
                    }
                    if (ConfigurationManager.AppSettings["EnableMsgSend_lj"] == "1")
                    {
                        Console.WriteLine(string.Format("[{0}]lj消息发送任务开始...", Utils.GetNow()));
                        LVipOldBLL lVipOldBLL = new LVipOldBLL(GetLoginUser("lj"));

                        // 获取lj消息列表
                        var msgList = lVipOldBLL.GetVipListForMsgSend(new LVipOldEntity()
                        {
                        });

                        // 发送lj消息
                        Console.WriteLine(string.Format("[{0}]消息数量:{1}", Utils.GetNow(),
                                                        (msgList == null ? 0 : msgList.Count)));
                        if (msgList != null)
                        {
                            foreach (var msgItem in msgList)
                            {
                                if (msgItem == null ||
                                    msgItem.Mobile == null || msgItem.Mobile.Length < 10)
                                {
                                    continue;
                                }

                                string weixin = "泸州老窖VIP尊享";
                                string msg    = string.Format(
                                    //"亲爱的{0},泸州老窖最新推出的官方微信公众号“{1}”上线了,我们等待您的关注,请关注后在平台的菜单中选择积分券兑换,并输入积分券号“{2}”,赢取积分,兑换精美礼品。",
                                    "亲爱的{0},泸州老窖最新推出的官方微信“{1}”上线了,我们等待您的关注,请关注后在平台的菜单中选择“贵宾卡领取”,并输入贵宾卡号“{2}”验证,您将成为我们泸州老窖的VIP贵宾,独享更多的尊崇服务。",
                                    msgItem.VipName, weixin, msgItem.CardCode);
                                MsgSend(lVipOldBLL, msgItem, msg);

                                Thread.Sleep(SendDelayTime);
                            }
                        }
                        Console.WriteLine(string.Format("[{0}]lj消息发送任务结束", Utils.GetNow()));
                    }
                    Console.WriteLine(string.Format("".PadLeft(50, '=')));
                    Thread.Sleep(cycleTime);
                }
            }
            catch (Exception ex)
            {
                Loggers.Debug(new DebugLogInfo()
                {
                    Message = string.Format("Exception:", ex.ToString())
                });
                Console.Write(ex.ToString());
                Console.Read();
            }
        }