示例#1
0
        public void hell(HttpContext context)
        {
            //string str = "[{\"payType\":\"1\",\"productID\":\"352\",\"orderTime\":\"2019 - 05 - 20 12:43:03\",\"num\":1,\"totalMoney\":\"5.9\",\"proLD\":\"44\",\"type\":\"2\",\"orderNO\":1558327383210,\"bz\":\"交易成功\",\"code\":\"\",\"billno\":\"111977820000757543\",\"mechineID\":\"55\",\"memberID\":\"\"}]";
            //ht.Add("recordList",str);
            //XmlDocument xx = WebSvcCaller.QuerySoapWebService("http://nq.bingoseller.com/api/mechineService.asmx", "upSellRecord", ht);
            //context.Response.Write(xx.OuterXml);


            string ldNO      = "100";
            string bill      = "123456";
            string payType   = "1";
            string productID = "352";
            string money     = "4.0";
            string type      = "2";
            //Thread.Sleep(1000 * 60);
            string    sql = "select trxid,m.id from  asm_pay_info a left join asm_member m on a.unionID=m.unionID where  a.statu=1 and trxid='" + bill + "'";
            DataTable dt  = DbHelperSQL.Query(sql).Tables[0];

            if (dt.Rows.Count >= 0)
            {
                System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1, 0, 0, 0, 0));
                long            t         = (DateTime.Now.Ticks - startTime.Ticks) / 10000; //除10000调整为13位
                Hashtable       ht        = new Hashtable();
                ht.Add("payType", payType);
                ht.Add("productID", productID);
                ht.Add("orderTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                ht.Add("num", 1);
                ht.Add("totalMoney", money);
                ht.Add("proLD", ldNO);
                ht.Add("type", type);
                ht.Add("orderNO", t);
                ht.Add("bz", "交易失败了");
                ht.Add("code", "");
                ht.Add("billno", bill);
                ht.Add("mechineID", "25");
                ht.Add("memberID", "21212");

                Hashtable ht1 = new Hashtable();
                ht1.Add("recordList", "[" + Util.HashtableToWxJson(ht) + "]");
                XmlDocument xx     = WebSvcCaller.QuerySoapWebService("http://nq.bingoseller.com/api/mechineService.asmx", "upSellRecord", ht1);
                string      result = xx.OuterXml;
            }
        }
示例#2
0
        /// <summary>
        /// 零售出货
        /// </summary>
        /// <param name="jiqiid"></param>
        /// <param name="text"></param>
        /// <returns></returns>
        public static async System.Threading.Tasks.Task LSCH(string chBillno, string mechineID)
        {
            log("chBillno=" + chBillno + ";mechineID" + mechineID, "LSCH.txt");

            string billno = RedisHelper.GetRedisModel <string>(chBillno);
            int    i      = 0;

            while (!string.IsNullOrEmpty(billno))
            {
                log(i + "=chBillno=" + chBillno, "LSCH.txt");
                if (i == 5)
                {
                    log("执行重发出货指令", "LSCH.txt");
                    sendorderAsync(mechineID, billno);
                }
                if (i == 50)
                {
                    try
                    {
                        JObject jo        = JObject.Parse(billno);
                        string  ldNO      = jo["ldNO"].ToString();
                        string  bill      = jo["billno"].ToString();
                        string  payType   = jo["payType"].ToString();
                        string  productID = jo["productID"].ToString();
                        string  money     = jo["money"].ToString();
                        string  type      = jo["type"].ToString();
                        Thread.Sleep(1000 * 60);
                        string    sql = "select trxid,m.id from  asm_pay_info a left join asm_member m on a.unionID=m.unionID where  a.statu=1 and trxid='" + bill + "'";
                        DataTable dt  = DbHelperSQL.Query(sql).Tables[0];
                        if (dt.Rows.Count > 0)
                        {
                            System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1, 0, 0, 0, 0));
                            long            t         = (DateTime.Now.Ticks - startTime.Ticks) / 10000; //除10000调整为13位
                            Hashtable       ht        = new Hashtable();
                            ht.Add("payType", payType);
                            ht.Add("productID", productID);
                            ht.Add("orderTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                            ht.Add("num", 1);
                            ht.Add("totalMoney", money);
                            ht.Add("proLD", ldNO);
                            ht.Add("type", type);
                            ht.Add("orderNO", t);
                            ht.Add("bz", "出货失败");
                            ht.Add("code", "");
                            ht.Add("billno", bill);
                            ht.Add("mechineID", mechineID);
                            ht.Add("memberID", dt.Rows[0]["id"].ToString());
                            Hashtable ht1 = new Hashtable();
                            ht1.Add("recordList", "[" + Util.HashtableToWxJson(ht) + "]");
                            XmlDocument xx     = WebSvcCaller.QuerySoapWebService("http://nq.bingoseller.com/api/mechineService.asmx", "upSellRecord", ht1);
                            string      result = xx.OuterXml;
                            log("bill:" + bill + ";result=" + result + ";HT:" + ht.ToString(), "LSCH.txt");
                            return;
                        }
                    }
                    catch (Exception e) {
                        log("执行退款e=" + e.Message, "LSCH.txt");
                    }
                    log("执行退款" + billno, "LSCH.txt");
                    return;
                }
                Thread.Sleep(500);
                billno = RedisHelper.GetRedisModel <string>(chBillno);

                i++;
            }
        }