/// <summary>
        /// 调用接口返回数据
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="accId"></param>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <returns></returns>
        public string GetWeixinFeedBack(int pageIndex, string accId, string start, string end)
        {
            ProxyRequestModel.ProxyRequest request = new ProxyRequestModel.ProxyRequest();
            ProxyRequestModel.UserMessage  usrMsg  = new ProxyRequestModel.UserMessage();

            Dictionary <string, string> dic = new Dictionary <string, string>()
            {
                { "listData", "" },
                { "rowCount", "" },
                { "maxPage", "" }
            };

            usrMsg.pageIndex = pageIndex;
            usrMsg.pageSize  = 15;

            if (!string.IsNullOrEmpty(start))
            {
                usrMsg.startTime = Convert.ToDateTime(start);
            }
            if (!string.IsNullOrEmpty(end))
            {
                usrMsg.endTime = Convert.ToDateTime(end);
            }
            if (int.Parse(accId) != 0)
            {
                usrMsg.accId        = Convert.ToInt32(accId);
                request.RequestName = "getMessageByAccId";
            }
            else
            {
                usrMsg.accId        = 0;
                request.RequestName = "getMessage";
            }

            request.RequestJson = CommonLib.Helper.JsonSerializeObject(usrMsg);
            ProxyRequestModel.WeixinResponseModel response = new ProxyRequestModel.WeixinResponseModel();
            response = AuthMethod.SendRequest(request);

            if (response.Status)
            {
                OpenResponseModel.ResponseMessage responseModel =
                    CommonLib.Helper.JsonDeserializeObject <OpenResponseModel.ResponseMessage>(response.ObjectStr);

                foreach (OpenResponseModel.T_UserMessageModel item in responseModel.userMessage)
                {
                    item.CompanyName = T_AccountBLL.GetSingleCompanyName(item.accId);
                }

                dic["listData"] = CommonLib.Helper.JsonSerializeObject(responseModel.userMessage, "yyyy-MM-dd HH:mm:ss");
                dic["rowCount"] = responseModel.pageInfo.totalCount.ToString();
                dic["maxPage"]  = responseModel.pageInfo.pageCount.ToString();

                return(CommonLib.Helper.JsonSerializeObject(dic, "yyyy-MM-dd HH:mm:ss"));
            }
            else
            {
                return("API接口调用出错!");
            }
        }
Пример #2
0
        /// <summary>
        /// 获取充值状态列表
        /// </summary>
        /// <param name="page"></param>
        /// <param name="phoneNum"></param>
        /// <param name="orderNo"></param>
        /// <returns></returns>
        public static string GetRechargeOrderList(int page, string phoneNum, string orderNo)
        {
            var model = MobileRecharge.GetHistoryOrder(page, 15, phoneNum, orderNo);

            if (model.error_code == 0)
            {
                if (model.result.data != null)
                {
                    foreach (var item in model.result.data)
                    {
                        //获取当前最后记录对应的订单ID
                        //int lastOid = Sys_RechargeRecordBLL.GetLastOid();

                        var tempModel = T_OrderInfoBLL.GetRechargeOrderListExtend(item.uorderid);

                        if (tempModel != null)
                        {
                            //更新的订单如果在记录表没有记录则插入信息
                            if (Sys_RechargeRecordBLL.CheckExist(tempModel.oid) == 0)
                            {
                                RechargeRecord recordModel = new RechargeRecord();
                                recordModel.AccId    = tempModel.accId;
                                recordModel.AddTime  = item.addtime;
                                recordModel.CardName = item.cardname;
                                recordModel.Oid      = tempModel.oid;
                                recordModel.OrderNo  = item.uorderid;
                                recordModel.State    = item.game_state;
                                recordModel.CardNum  = Convert.ToInt32(item.cardnum);
                                recordModel.RealNum  = Convert.ToDecimal(item.uordercash);
                                recordModel.PaidNum  = tempModel.RealPayMoney;
                                recordModel.GapNum   = recordModel.RealNum - recordModel.PaidNum;

                                Sys_RechargeRecordBLL.AddNewRecord(recordModel);
                            }

                            item.accModel = T_AccountBLL.GetAccountBasic(tempModel.accId);
                        }
                    }

                    model.result.Summary = Sys_RechargeRecordBLL.GetRecordSum();

                    return(CommonLib.Helper.JsonSerializeObject(model, "yyyy-MM-dd HH:mm:ss"));
                }
                else
                {
                    return("");
                }
            }
            return(CommonLib.Helper.JsonSerializeObject(model));
        }
Пример #3
0
        /// <summary>
        /// 开通支付宝处理
        /// </summary>
        /// <param name="accId"></param>
        /// <param name="alipayAccount"></param>
        /// <param name="alipayPid"></param>
        /// <param name="alipayKey"></param>
        /// <returns></returns>
        public static int AddAccountAlipay(int accId, string alipayAccount, string alipayPid, string alipayKey)
        {
            AlipayUserInfo infoModel = new AlipayUserInfo();
            var            model     = T_AccountBLL.GetAccountBasic(accId);

            infoModel.AccId      = accId;
            infoModel.AccName    = model.UserRealName;
            infoModel.AliAccount = alipayAccount;
            infoModel.AliKey     = alipayKey;
            infoModel.AliPid     = alipayPid;
            infoModel.PhoneNum   = model.PhoneNumber;

            return(T_PaymentInfoBLL.Add(infoModel));
        }
Пример #4
0
        public string GetShopSummary(string originList)
        {
            string detailList = "";
            string sumStr     = "";

            List <string> list = new List <string>(originList.Split(','));

            int strCount = 0;
            int count    = list.Count;

            foreach (string str in list)
            {
                try
                {
                    detailList += T_AccountBLL.GetCompanyName(Convert.ToInt32(str)) + "[" + Convert.ToInt32(str) + "]<br/>";


                    if (strCount < 5)
                    {
                        sumStr += T_AccountBLL.GetCompanyName(Convert.ToInt32(str)) + ",";
                    }
                    strCount++;
                }
                catch (Exception ex)
                {
                    return("没有找到有关【" + str + "】这个Id相关的信息!");
                }
            }

            Dictionary <string, string> dic = new Dictionary <string, string>()
            {
                { "list", "" },
                { "count", "" },
                { "strsum", "" },
                { "detail", "" }
            };

            dic["list"]   = CommonLib.Helper.JsonSerializeObject(list);
            dic["count"]  = count.ToString();
            dic["detail"] = detailList;
            dic["strsum"] = sumStr.Substring(0, sumStr.LastIndexOf(','));


            return(CommonLib.Helper.JsonSerializeObject(dic));
        }
Пример #5
0
        /// <summary>
        /// 得到此店铺相关的分店 及 总店信息  如果需要 可以 转成对像
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static Dictionary <string, object> GetSubbranchList(int id)
        {
            Dictionary <string, object> list = new Dictionary <string, object>();

            List <dynamic> branch = T_AccountBLL.GetSubbranchInfo(id);
            dynamic        head   = T_AccountBLL.GetHeadquartersInfo(id);

            list["subbranch"]    = null;
            list["headquerters"] = null;

            if (branch != null && branch.Count > 0)
            {
                list["subbranch"]    = branch;
                list["headquerters"] = T_AccountBLL.GetHeadquartersInfo(Convert.ToInt32(branch[0].ID));
            }

            if (head != null)
            {
                list["headquerters"] = head;
                list["subbranch"]    = T_AccountBLL.GetSubbranchInfo(Convert.ToInt32(head.ID));
            }

            return(list);
        }
Пример #6
0
        public static Dictionary <string, string> GetForumContent(string url)
        {
            Dictionary <string, string> dic = new Dictionary <string, string>()
            {
                { "title", "" },
                { "user", "" }
            };

            if (url.IndexOf("www.i200.cn/bbs") < 0)
            {
                return(null);//不是合法地址
            }
            //制定编码格式
            var encoding = Encoding.GetEncoding("utf-8");
            //url的设置
            var request = (HttpWebRequest)WebRequest.Create(url);

            //设置请求的方式
            request.Method = "Get";
            //设置Content-Type 的值
            //request.ContentType = "application/x-www-form-urlencoded";

            //request.ContentLength = data.Length;
            //var outStream = request.GetRequestStream();
            //outStream.Write(data, 0, data.Length);
            //outStream.Close();
            var response  = (HttpWebResponse)request.GetResponse();
            var srContent = new System.IO.StreamReader(response.GetResponseStream(), encoding);
            //获取抓取下来的页面内容
            var strPage = srContent.ReadToEnd();

            response.Close();
            srContent.Close();

            //获取帖子标题
            Regex           regTitle = new Regex(@"(?i)(?<=<a.*?id=""thread_subject"".*?>)[^<]+(?=</a>)");
            MatchCollection mcTitle  = regTitle.Matches(strPage);

            //获取帖子发表时间
            Regex           regTime = new Regex(@"(?i)(?<=<em.*?id=""authorposton.*?>发表于)[^<]+(?=</em>)");
            MatchCollection mcTime  = regTime.Matches(strPage);

            if (mcTime.Count == 0)
            {
                regTime = new Regex(@"(?i)(?<=<em.*?id=""authorposton.*?>发表于.*<span.*title="")[^<]+(?="">)");
                mcTime  = regTime.Matches(strPage);
            }

            string postUser = strPage.Substring(strPage.IndexOf("class=\"pi\""), 300);

            //获取发帖人
            Regex           regUser = new Regex(@"(?i)(?<=<a.*?uid=)[^<]+(?="".*?target)");
            MatchCollection mcUser  = regUser.Matches(postUser);

            if (mcUser.Count == 0)
            {
                regUser = new Regex(@"(?i)(?<=匿名.*?<em>)[^<]+(?=</em>)");
                mcUser  = regUser.Matches(postUser);
            }

            Sys_TaskDailyInfo model = new Sys_TaskDailyInfo();

            dic["title"] = mcTitle[0].Groups[0].ToString();
            if (mcUser[0].Groups[0].ToString().IndexOf('.') >= 0)
            {
                dic["user"] = "******";
            }
            else
            {
                try
                {
                    int accountid = T_AccountBLL.GetAccIdBybbsId(Convert.ToInt32(mcUser[0].Groups[0].ToString()));
                    dic["user"] = T_AccountBLL.GetCompanyName(accountid);
                }
                catch (Exception ex)
                {
                    Logger.Error("转换论坛ID出错!", ex);
                    dic["user"] = "******";
                }
            }

            return(dic);
        }
Пример #7
0
        /// <summary>
        /// 插入论坛建议反馈
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        public static string GetForumFeedBack(string url, string uName, string remark)
        {
            if (url.IndexOf("www.i200.cn/bbs") < 0)
            {
                return("");//不是合法地址
            }
            //制定编码格式
            var encoding = Encoding.GetEncoding("utf-8");
            //url的设置
            var request = (HttpWebRequest)WebRequest.Create(url);

            //设置请求的方式
            request.Method = "Get";
            //设置Content-Type 的值
            //request.ContentType = "application/x-www-form-urlencoded";

            //request.ContentLength = data.Length;
            //var outStream = request.GetRequestStream();
            //outStream.Write(data, 0, data.Length);
            //outStream.Close();
            var response  = (HttpWebResponse)request.GetResponse();
            var srContent = new System.IO.StreamReader(response.GetResponseStream(), encoding);
            //获取抓取下来的页面内容
            var strPage = srContent.ReadToEnd();

            response.Close();
            srContent.Close();

            //获取帖子标题
            Regex           regTitle = new Regex(@"(?i)(?<=<a.*?id=""thread_subject"".*?>)[^<]+(?=</a>)");
            MatchCollection mcTitle  = regTitle.Matches(strPage);

            //获取帖子发表时间
            Regex           regTime = new Regex(@"(?i)(?<=<em.*?id=""authorposton.*?>发表于)[^<]+(?=</em>)");
            MatchCollection mcTime  = regTime.Matches(strPage);

            if (mcTime.Count == 0)
            {
                regTime = new Regex(@"(?i)(?<=<em.*?id=""authorposton.*?>发表于.*<span.*title="")[^<]+(?="">)");
                mcTime  = regTime.Matches(strPage);
            }

            string postUser = strPage.Substring(strPage.IndexOf("class=\"pi\""), 300);

            //获取发帖人
            Regex           regUser = new Regex(@"(?i)(?<=<a.*?uid=)[^<]+(?="".*?target)");
            MatchCollection mcUser  = regUser.Matches(postUser);

            if (mcUser.Count == 0)
            {
                regUser = new Regex(@"(?i)(?<=匿名.*?<em>)[^<]+(?=</em>)");
                mcUser  = regUser.Matches(postUser);
            }

            Sys_TaskDailyInfo model = new Sys_TaskDailyInfo();

            try
            {
                model.t_mk    = mcTitle[0].Groups[0].ToString();
                model.dt_Time = Convert.ToDateTime(mcTime[0].Groups[0].ToString());
                if (mcUser[0].Groups[0].ToString().IndexOf('.') >= 0)
                {
                    model.accountid = 0;
                }
                else
                {
                    try
                    {
                        model.accountid = T_AccountBLL.GetAccIdBybbsId(Convert.ToInt32(mcUser[0].Groups[0].ToString()));
                    }
                    catch (Exception ex)
                    {
                        Logger.Error("转换论坛ID出错!", ex);
                        model.accountid = 0;
                    }
                }

                model.inertTime = DateTime.Now;
                model.dt_Level  = 9;
                model.dt_Status = 99;

                model.insetName = uName;
                model.dt_remark = "@(" + url + ")" + remark;
                model.dt_logUid = 0;
                model.dt_Source = "论坛反馈";

                if (Sys_TaskDailyBLL.CheckForumUrl(url))
                {
                    return("已经存在该条反馈!");
                }
                else
                {
                    if (Sys_TaskDailyBLL.AddModel(model) > 0)
                    {
                        return("添加成功!");
                    }
                    else
                    {
                        return("添加出错!");
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Error("添加论坛反馈出错!", ex);
                return("添加反馈出错!");
            }

            //return mcTitle[0].Groups[0].ToString() + "  " + mcTime[0].Groups[0].ToString() + "  " + mcUser[0].Groups[0].ToString();
            //foreach (Match m in mc)
            //{
            //    Console.WriteLine(m.Groups[0].ToString());
            //}

            //return strPage;
        }
Пример #8
0
 /// <summary>
 ///  在审核店铺时删除店铺
 /// </summary>
 /// <param name="accid"></param>
 /// <returns></returns>
 public static int DeleteShopDuringChecking(int accid)
 {
     return(T_AccountBLL.DeleteShopDuringChecking(accid));
 }
Пример #9
0
 /// <summary>
 /// 审核店铺信息
 /// </summary>
 /// <param name="accid"></param>
 /// <param name="type">0-邮件|1-手机</param>
 /// <returns></returns>
 public static int CheckShop(int accid, int type)
 {
     return(T_AccountBLL.CheckShop(accid, type));
 }
Пример #10
0
 /// <summary>
 /// 返回未审核的店铺列表
 /// </summary>
 /// <returns></returns>
 public static List <UncheckedShopModel> GetUncheckedShopList(DateTime regTime)
 {
     return(T_AccountBLL.GetUncheckedShopList(regTime));
 }
Пример #11
0
        /// <summary>
        /// 开通店铺权限
        /// </summary>
        /// <param name="accid">店铺ID</param>
        /// <param name="appKey">权限KEY</param>
        /// <param name="operId">操作人ID</param>
        /// <returns></returns>
        public static int AddAccountApp(int accid, int appKey, int operId)
        {
            t_App_Au model = new t_App_Au();

            model.accid     = accid;
            model.appkey    = appKey;
            model.appName   = Enum.GetName(typeof(Model.Enum.AppAuEnum.AppName), appKey);
            model.stattime  = DateTime.Now;
            model.endtime   = DateTime.Now.AddMonths(6);
            model.aa_time   = DateTime.Now;
            model.aa_remark = "(后台" + operId + "授权)";
            model.aa_Status = 0;
            if (appKey == 1 || appKey == 2)
            {
                string rm = CommonLib.Helper.CreateUUID();
                T_AccountBLL.UpdateRandomNumber(accid, rm);
                tb_user_inforBLL.InitializeUserInfor(accid);
            }

            if (appKey == 7)
            {
                #region 颜色尺码
                List <DapperWhere> whereList = new List <DapperWhere>();
                whereList.Add(new DapperWhere("accId", accid));
                whereList.Add(new DapperWhere("gaType", 1));
                List <T_Goods_Attribute> attributeList = new List <T_Goods_Attribute>();
                attributeList = BLL.Base.T_Goods_AttributeBaseBLL.GetList(whereList);
                if (attributeList.Count < 2)
                {
                    Dictionary <string, int> attr = new Dictionary <string, int>();
                    attr["颜色"] = 0;
                    attr["尺码"] = 0;

                    foreach (T_Goods_Attribute item in attributeList)
                    {
                        attr[item.gaName] = 1;
                    }

                    foreach (KeyValuePair <string, int> ik in attr)
                    {
                        if (ik.Value == 0)
                        {
                            T_Goods_Attribute addModel = new T_Goods_Attribute();
                            addModel.gaName   = ik.Key;
                            addModel.gaType   = 1;
                            addModel.gaRemark = "";
                            addModel.gaTime   = DateTime.Now;
                            addModel.gaAlive  = 1;
                            addModel.accId    = accid;
                            T_Goods_AttributeBLL.Add(addModel);
                        }
                    }
                }
                #endregion
            }
            if (appKey == 21)
            {
                #region 手机串号
                List <DapperWhere> whereList = new List <DapperWhere>();
                whereList.Add(new DapperWhere("accId", accid));
                whereList.Add(new DapperWhere("gaType", 2));
                List <T_Goods_Attribute> attributeList = new List <T_Goods_Attribute>();
                attributeList = BLL.Base.T_Goods_AttributeBaseBLL.GetList(whereList);
                if (attributeList.Count < 2)
                {
                    Dictionary <string, int> attr = new Dictionary <string, int>();
                    attr["串号"] = 0;

                    foreach (T_Goods_Attribute item in attributeList)
                    {
                        attr[item.gaName] = 1;
                    }

                    foreach (KeyValuePair <string, int> ik in attr)
                    {
                        if (ik.Value == 0)
                        {
                            T_Goods_Attribute addModel = new T_Goods_Attribute();
                            addModel.gaName   = ik.Key;
                            addModel.gaType   = 2;
                            addModel.gaRemark = "";
                            addModel.gaTime   = DateTime.Now;
                            addModel.gaAlive  = 0;
                            addModel.accId    = accid;
                            T_Goods_AttributeBLL.Add(addModel);
                        }
                    }
                }
                #endregion
            }

            return(t_App_AuBLL.Add(model));
        }
Пример #12
0
 /// <summary>
 /// 得到店铺今天信息汇总
 /// </summary>
 /// <param name="accid"></param>
 /// <returns></returns>
 public static T_AccountSummarize.TodaySummarize GetAccountTodaySummarize(int accid)
 {
     return(T_AccountBLL.GetAccountTodaySummarize(accid));
 }
Пример #13
0
 /// <summary>
 /// 得到店铺基本信息
 /// </summary>
 /// <param name="accid"></param>
 /// <returns></returns>
 public static T_AccountBasic GetAccountBasic(int accid)
 {
     return(T_AccountBLL.GetAccountBasic(accid));
 }
Пример #14
0
        /// <summary>
        /// 返回店铺搜索分页列表
        /// </summary>
        /// <returns></returns>
        public static Dictionary <string, object> GetSearchList(int pageIndex, int pageSize, string companyName = "", string userRealName = "", string phoneNumber = "", string userEmail = "", int bbsUid = 0, int agentId = 0, string agentName = "", string serviceManager = "", string regSource = "all", DateTime?startRegTime = null, DateTime?endRegTime = null, string searchStr = "")
        {
            Dictionary <string, object> list        = new Dictionary <string, object>();
            List <DapperWhere>          dapperWhere = new List <DapperWhere>();


            if (string.IsNullOrEmpty(searchStr))
            {
                dapperWhere.Add(new DapperWhere("State", 1));

                if (companyName != "")
                {
                    dapperWhere.Add(new DapperWhere("CompanyName", companyName, " CompanyName like '%'+ @CompanyName +'%'"));
                }
                if (userRealName != "")
                {
                    dapperWhere.Add(new DapperWhere("UserRealName", userRealName, " UserRealName like '%'+ @UserRealName +'%'"));
                }
                if (phoneNumber != "")
                {
                    dapperWhere.Add(new DapperWhere("phoneNumber", phoneNumber, "ID in(select accountid from i200.dbo.T_Account_User where grade='管理员' and PhoneNumber like '%' + @phoneNumber + '%')"));
                }
                if (userEmail != "")
                {
                    dapperWhere.Add(new DapperWhere("UserEmail", userEmail, "ID in(select accountid from i200.dbo.T_Account_User where grade='管理员' and UserEmail like '%' + @UserEmail + '%')"));
                }
                if (bbsUid != 0)
                {
                    dapperWhere.Add(new DapperWhere("BBS_Uid", bbsUid));
                }

                if (startRegTime != null)
                {
                    dapperWhere.Add(new DapperWhere("startRegtime", startRegTime, " RegTime>=@startRegtime"));
                }
                if (endRegTime != null)
                {
                    DateTime end = Convert.ToDateTime(endRegTime).Date.Add(new TimeSpan(23, 59, 59));
                    dapperWhere.Add(new DapperWhere("endRegtime", end, "RegTime<=@endRegtime"));
                }

                if (agentId != 0)
                {
                    dapperWhere.Add(new DapperWhere("AgentId", agentId));
                }
                if (agentName != "")
                {
                    dapperWhere.Add(new DapperWhere("agentName", agentName, "AgentId in(select ID from Sys_agent_mess where AgentName=@agentName)"));
                }

                if (serviceManager != "")
                {
                    dapperWhere.Add(new DapperWhere("ServiceManager", serviceManager, " ServiceManager like '%+ @ServiceManager +%'"));
                }

                if (regSource != "all")
                {
                    switch (regSource)
                    {
                    case "0":
                        dapperWhere.Add(new DapperWhere("Remark", "0"));
                        break;

                    case "9":
                        dapperWhere.Add(new DapperWhere("Remark", "9"));
                        break;

                    case "8":
                        dapperWhere.Add(new DapperWhere("Remark", "8"));
                        break;

                    case "10":
                        dapperWhere.Add(new DapperWhere("Remark", "10"));
                        break;

                    case "11":
                        dapperWhere.Add(new DapperWhere("Remark", "11"));
                        break;
                    }
                }
            }

            if (pageSize < 1)
            {
                pageSize = 20;
            }

            int rowCount = 0;

            if (pageIndex == 1)
            {
                rowCount = BLL.Base.T_AccountBaseBLL.GetCount(dapperWhere, searchStr);
            }
            int maxPage = 0;

            if (rowCount > 0)
            {
                maxPage = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(rowCount) / pageSize));
            }

            //List<dynamic> dataList = T_AccountBLL.GetSearchList(pageIndex, 15, dapperWhere, " id desc");

            list["rowCount"]  = rowCount;
            list["maxPage"]   = maxPage;
            list["pageIndex"] = pageIndex;
            list["listData"]  = T_AccountBLL.GetSearchList(pageIndex, 15, dapperWhere, " id desc", searchStr);

            //List<int> accidList = new List<int>();
            //foreach (dynamic item in dataList)
            //{
            //    accidList.Add(item.ID);
            //}

            //list["accidList"] = CommonLib.Helper.JsonSerializeObject(accidList);

            return(list);
        }