Ejemplo n.º 1
0
        /// <summary>
        /// 厨师登录
        /// </summary>
        /// <param name="LoginValidate"></param>
        /// <returns></returns>
        public ResponseCookInfo CookLogin(RequestValidate LoginValidate)
        {
            IQueryable <CookVip> queryable = Kily.Set <CookVip>()
                                             .Where(t => t.Account.Equals(LoginValidate.Account) || t.Phone.Equals(LoginValidate.Account))
                                             .Where(t => t.PassWord.Equals(LoginValidate.PassWord))
                                             .Where(t => t.IsDelete == false);
            IQueryable <CookInfo> queryables = Kily.Set <CookInfo>();
            var data = queryable.GroupJoin(queryables, t => t.Id, x => x.CookId, (t, x) => new ResponseCookInfo()
            {
                Id         = t.Id,
                CookId     = t.Id,
                Sexlab     = x.FirstOrDefault().Sexlab,
                Account    = t.Account,
                PassWord   = t.PassWord,
                Address    = x.FirstOrDefault().Address,
                Birthday   = x.FirstOrDefault().Birthday,
                CardOffice = x.FirstOrDefault().CardOffice,
                ExpiredDay = x.FirstOrDefault().ExpiredDay,
                IdCardNo   = x.FirstOrDefault().IdCardNo,
                Phone      = t.Phone,
                TrueName   = x.FirstOrDefault().TrueName,
                Nation     = x.FirstOrDefault().Nation,
                TypePath   = x.FirstOrDefault().TypePath,
                StartTime  = t.StartTime,
                EndTime    = t.EndTime,
                RoleId     = t.RoleId,
                TableName  = typeof(ResponseCookInfo).Name
            }).AsNoTracking().FirstOrDefault();

            return(data);
        }
Ejemplo n.º 2
0
        public ActionResult Index(RequestParam <RequestMemberDetail> reqst)
        {
            LoggerHelper.Info(JsonHelper.Entity2Json(reqst));
            UserEntity     br = new UserEntity();
            B_member_table b  = new B_member_table();
            M_member_table p  = new M_member_table();

            p = b.GetModel(reqst.body.userId);

            if (p != null)
            {
                if (p.UsrCustId.Length <= 0)
                {
                    LoggerHelper.Warning("未实名,跳转至实名接口");
                    RequestParam <RequestValidate> vldParam = new RequestParam <RequestValidate>();
                    RequestValidate rv = new RequestValidate();
                    rv.userId     = reqst.body.userId.ToString();
                    vldParam.body = rv;
                    return(RedirectToAction("RequestRealName", "Index", new { area = "UserAuthentication", userId = reqst.body.userId.ToString() }));//未实名,跳转至实名接口
                }



                br.Version   = "10";
                br.CmdId     = "UserLogin";
                br.MerCustId = Settings.Instance.MerCustId;
                br.UsrCustId = p.UsrCustId;
                return(View(br));
            }
            else
            {
                return(Content("异常错误,请联系管理员"));
            }
        }
Ejemplo n.º 3
0
        //protected bool CheckToken(string token)
        //{
        //    RequestValidate requestValidate = new RequestValidate();
        //    return requestValidate.CheckToken(token);
        //}
        //protected Response<UpImageResponseBody> GetResult(string resultCode, string message, UpImageResponseBody body = null)
        //{
        //    Response<UpImageResponseBody> response = new Response<UpImageResponseBody>();
        //    response.Head = new GMSF.HeadDefine.ResponseHead()
        //    {
        //        ResultCode = resultCode,
        //        ResultMessage = message
        //    };
        //    response.Body = body;

        //    return response;
        //}

        /// <summary>
        /// 返回元祖《表示验证是否成功,验证成功后返回的userid》
        /// </summary>
        protected Tuple <bool, int> CheckToken(string token)
        {
            RequestValidate requestValidate = new RequestValidate();
            bool            succ            = requestValidate.CheckToken(token);
            int             userid          = requestValidate.GetCurrUserId();

            return(new Tuple <bool, int>(succ, userid));
        }
Ejemplo n.º 4
0
 public ObjectResultEx EnterpriseLogin(RequestValidate LoginValidate)
 {
     try
     {
         var    ComAdmin = EnterpriseService.EnterpriseLogin(LoginValidate);
         string Code     = string.Empty;
         if (!LoginValidate.IsApp)
         {
             Code = CacheFactory.Cache().GetCache <string>("ValidateCode").Trim();
             if (ComAdmin != null && Code.ToUpper().Equals(LoginValidate.ValidateCode.Trim().ToUpper()))
             {
                 CookieInfo cookie = new CookieInfo();
                 VerificationExtension.WriteToken(cookie, ComAdmin);
                 return(ObjectResultEx.Instance(new { ResponseCookieInfo.RSAToKen, ResponseCookieInfo.RSAApiKey, ResponseCookieInfo.RSASysKey, ComAdmin }, 1, RetrunMessge.SUCCESS, HttpCode.Success));
             }
             else if (!Code.ToUpper().Equals(LoginValidate.ValidateCode.Trim().ToUpper()))
             {
                 return(ObjectResultEx.Instance(null, -1, "验证码错误", HttpCode.NoAuth));
             }
             else
             {
                 return(ObjectResultEx.Instance(null, -1, "登录失败或账户冻结", HttpCode.NoAuth));
             }
         }
         else
         {
             if (ComAdmin != null)
             {
                 CookieInfo cookie = new CookieInfo();
                 VerificationExtension.WriteToken(cookie, ComAdmin);
                 return(ObjectResultEx.Instance(new { ResponseCookieInfo.RSAToKen, ResponseCookieInfo.RSAApiKey, ResponseCookieInfo.RSASysKey, ComAdmin }, 1, RetrunMessge.SUCCESS, HttpCode.Success));
             }
             else if (ComAdmin == null)
             {
                 return(ObjectResultEx.Instance(null, -1, "请检查用户名和密码是否正确", HttpCode.NoAuth));
             }
             else if (!Code.ToUpper().Equals(LoginValidate.ValidateCode.Trim().ToUpper()))
             {
                 return(ObjectResultEx.Instance(null, -1, "验证码错误", HttpCode.NoAuth));
             }
             else
             {
                 return(ObjectResultEx.Instance(null, -1, "登录失败或账户冻结", HttpCode.NoAuth));
             }
         }
     }
     catch (Exception)
     {
         return(ObjectResultEx.Instance(null, -1, "请输入验证码", HttpCode.FAIL));
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// 餐饮商家登录
        /// </summary>
        /// <param name="LoginValidate"></param>
        /// <returns></returns>
        public Object MerchantLogin(RequestValidate LoginValidate)
        {
            #region 餐饮企业登录

            IQueryable <RepastInfo> queryable = Kily.Set <RepastInfo>()
                                                .Where(t => t.Account.Equals(LoginValidate.Account) || t.Phone.Equals(LoginValidate.Account))
                                                .Where(t => t.PassWord.Equals(LoginValidate.PassWord))
                                                .Where(t => t.IsDelete == false);
            ResponseMerchant Info = queryable.Select(t => new ResponseMerchant()
            {
                Id              = t.Id,
                Account         = t.Account,
                CommunityCode   = t.CommunityCode,
                MerchantName    = t.MerchantName,
                Phone           = t.Phone,
                DiningType      = t.DiningType,
                VersionType     = t.VersionType,
                VersionTypeName = AttrExtension.GetSingleDescription <SystemVersionEnum, DescriptionAttribute>(t.VersionType),
                DiningTypeName  = AttrExtension.GetSingleDescription <MerchantEnum, DescriptionAttribute>(t.DiningType),
                MerchantImage   = t.MerchantImage,
                AuditType       = t.AuditType,
                AuditTypeName   = AttrExtension.GetSingleDescription <AuditEnum, DescriptionAttribute>(t.AuditType),
                DingRoleId      = t.DingRoleId,
                TypePath        = t.TypePath,
                Address         = t.Address,
                Certification   = t.Certification,
                Email           = t.Email,
                ImplUser        = t.ImplUser,
                TableName       = typeof(ResponseMerchant).Name
            }).FirstOrDefault();

            #endregion 餐饮企业登录

            #region 非企业登录

            IQueryable <RepastInfoUser> queryables = Kily.Set <RepastInfoUser>()
                                                     .Where(t => t.Account.Equals(LoginValidate.Account) || t.Phone.Equals(LoginValidate.Account))
                                                     .Where(t => t.PassWord.Equals(LoginValidate.PassWord))
                                                     .Where(t => t.IsDelete == false);
            ResponseMerchantUser User = queryables.Select(t => new ResponseMerchantUser()
            {
                Id              = t.InfoId,
                InfoId          = t.Id,
                Account         = t.Account,
                TrueName        = t.TrueName,
                DiningType      = t.DiningType,
                VersionType     = t.VersionType,
                DingRoleId      = t.DingRoleId,
                TypePath        = t.TypePath,
                MerchantName    = t.MerchantName,
                Phone           = t.Phone,
                IdCard          = t.Phone,
                VersionTypeName = AttrExtension.GetSingleDescription <SystemVersionEnum, DescriptionAttribute>(t.VersionType),
                DiningTypeName  = AttrExtension.GetSingleDescription <MerchantEnum, DescriptionAttribute>(t.DiningType),
                TableName       = typeof(ResponseMerchantUser).Name
            }).FirstOrDefault();

            #endregion 非企业登录

            if (Info != null)
            {
                return(Info);
            }
            else if (User != null)
            {
                return(User);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 6
0
        public ActionResult RechargeSubmit(RequestParam <RequestRecharge> reqst)
        {
            LoggerHelper.Info(JsonHelper.Entity2Json(reqst));
            MemberLogic   mLogic    = new MemberLogic();
            StringBuilder str       = new StringBuilder();
            string        blankName = reqst.body.bankType;
            int           userid    = reqst.body.userId;
            var           p         = mLogic.SelectMemberByUserId(reqst.body.userId);

            if (p.UsrCustId.Length <= 0)
            {
                RequestParam <RequestValidate> vldParam = new RequestParam <RequestValidate>();
                RequestValidate rv = new RequestValidate();
                rv.userId     = reqst.body.userId.ToString();
                vldParam.body = rv;
                return(RedirectToAction("RequestRealName", "Index", new { area = "UserAuthentication", userId = reqst.body.userId.ToString() }));//未实名,跳转至实名接口
            }

            #region 提现审核时,如果出现没有快捷卡时,禁止提现,防止用户绑定快捷卡
            string openAcctIds  = string.Empty;
            var    userCardList = mLogic.SelectUserBankList(userid);
            var    quickList    = new List <MemberBankEntity>();
            if (userCardList == null)
            {
                userCardList = new List <MemberBankEntity>();
            }
            if (userCardList != null)
            {
                quickList = userCardList.Where(d => d.BindCardType == 1).ToList();
            }

            if (quickList == null || quickList.Count == 0) //用户没有快捷卡时,有提现审核都拒绝
            {
                foreach (var item in userCardList)
                {
                    if (openAcctIds == string.Empty)
                    {
                        openAcctIds += "'" + item.OpenAcctId + "'";
                    }
                    else
                    {
                        openAcctIds += "," + "'" + item.OpenAcctId + "'";
                    }
                }
                //if (string.IsNullOrWhiteSpace(openAcctIds))
                //{
                //    LoggerHelper.Info("充值请求失败!未绑定银行卡,暂不能进行此操作!" + JsonHelper.Entity2Json(reqst));
                //    return Content("充值请求失败!未绑定银行卡,暂不能进行此操作!");
                //}
                try
                {
                    if (!string.IsNullOrWhiteSpace(openAcctIds))
                    {
                        bool isExist = mLogic.SelectVUserCashBank(openAcctIds, 0);
                        if (isExist)
                        {
                            LoggerHelper.Info("充值失败,提现审核中,暂不能进行其他操作" + JsonHelper.Entity2Json(reqst));
                            return(Content("充值审核中,暂不能进行其他操作!"));
                        }
                    }
                }
                catch
                {
                    LoggerHelper.Error("充值数据出现异常,提现审核中,暂不能进行其他操作。SelectVUserCashBank,openAcctIds=" + openAcctIds + "===>" + JsonHelper.Entity2Json(reqst));
                }
            }
            #endregion



            string             UsrCustId = p.UsrCustId; //这个是给用户充值  在充值前得保证商户余额足够
            decimal            amt       = reqst.body.amountOfCharge;
            M_QPNetSave        qp        = new M_QPNetSave();
            M_Recharge_history rh        = new M_Recharge_history();
            rh.membertable_registerid = reqst.body.userId;
            rh.recharge_amount        = Math.Round(amt, 2);
            rh.recharge_time          = DateTime.Now;
            rh.account_amount         = amt;
            rh.order_No           = Settings.Instance.OrderCode;
            rh.recharge_condition = 0;         //1表示充值成功
            rh.recharge_bank      = blankName; // 得接口返回;

            string CmdId     = "NetSave";
            string MerCustId = Settings.Instance.MerCustId;

            var ckd = Settings.Instance.SiteDomain;
            RechargeHistoryLogic hLogic = new RechargeHistoryLogic();


            int Recid = hLogic.Add(rh);
            if (Recid > 0)
            {
                string MerPriv = EncryptHelper.Encrypt(reqst.body.userId + "_" + Recid, Settings.Instance.WebPass);

                qp.Version    = "10";
                qp.CmdId      = CmdId;
                qp.MerCustId  = MerCustId;
                qp.UsrCustId  = UsrCustId;
                qp.OrdId      = rh.order_No;
                qp.OrdDate    = rh.recharge_time.ToString("yyyyMMdd");
                qp.GateBusiId = "QP";  //快捷支付
                qp.OpenBankId = blankName;
                qp.DcFlag     = "D";
                qp.TransAmt   = amt.ToString("0.00");
                qp.RetUrl     = Settings.Instance.GetCallbackUrl("/Recharge/Index/SuQPNetSave");
                qp.BgRetUrl   = Settings.Instance.GetCallbackUrl("/Recharge/Index/ReQPNetSave");
                qp.MerPriv    = MerPriv;


                StringBuilder chkVal = new StringBuilder();
                chkVal.Append(qp.Version);
                chkVal.Append(qp.CmdId);
                chkVal.Append(qp.MerCustId);
                chkVal.Append(qp.UsrCustId);
                chkVal.Append(qp.OrdId);
                chkVal.Append(qp.OrdDate);
                chkVal.Append(qp.GateBusiId);
                chkVal.Append(qp.OpenBankId);
                chkVal.Append(qp.DcFlag);
                chkVal.Append(qp.TransAmt);
                chkVal.Append(qp.RetUrl);
                chkVal.Append(qp.BgRetUrl);
                chkVal.Append(qp.OpenAcctId);
                // chkVal.Append(qp.CertId);
                chkVal.Append(qp.MerPriv);
                string chkv = chkVal.ToString();
                //私钥文件的位置(这里是放在了站点的根目录下)
                string merKeyFile = AppDomain.CurrentDomain.BaseDirectory + Settings.Instance.MerPr;
                //需要指定提交字符串的长度
                int           len        = Encoding.UTF8.GetBytes(chkv).Length;
                StringBuilder sbChkValue = new StringBuilder(256);
                //加签
                int str1 = DllInterop.SignMsg(Settings.Instance.MerId, merKeyFile, chkv, len, sbChkValue);
                qp.ChkValue = sbChkValue.ToString();
                str.Append(" <form id=\"formauto\" name=\"formauto\"  action=\"" + Settings.Instance.ChinapnrUrl + "\" method=\"post\">");

                str.Append("<input id=\"Version\"  name=\"Version\"  type=\"hidden\"  value=\"" + qp.Version + "\" />");

                str.Append("<input id=\"CmdId\"  name=\"CmdId\"    type=\"hidden\"  value=\"" + qp.CmdId + "\" />");

                str.Append("<input id=\"MerCustId\" name=\"MerCustId\"   type=\"hidden\"  value=\"" + qp.MerCustId + "\" />");

                str.Append("<input id=\"UsrCustId\" name=\"UsrCustId\" type=\"hidden\"  value=\"" + qp.UsrCustId + "\" />");

                str.Append("<input id=\"OrdId\" name=\"OrdId\" type=\"hidden\"  value=\"" + qp.OrdId + "\" />");

                str.Append("<input id=\"OrdDate\" name=\"OrdDate\" type=\"hidden\"  value=\"" + qp.OrdDate + "\" />");

                str.Append("<input id=\"GateBusiId\"  name=\"GateBusiId\" type=\"hidden\"  value=\"" + qp.GateBusiId + "\" />");

                str.Append("<input id=\"OpenBankId\"   name=\"OpenBankId\" type=\"hidden\"  value=\"" + qp.OpenBankId + "\" />");

                str.Append("<input id=\"DcFlag\" name=\"DcFlag\" type=\"hidden\"  value=\"" + qp.DcFlag + "\" />");

                str.Append("<input id=\"TransAmt\" name=\"TransAmt\" type=\"hidden\"  value=\"" + qp.TransAmt + "\" />");

                str.Append("<input id=\"RetUrl\" name=\"RetUrl\"  type=\"hidden\"  value=\"" + qp.RetUrl + "\" />");

                str.Append("<input id=\"BgRetUrl\" name=\"BgRetUrl\" type=\"hidden\"  value=\"" + qp.BgRetUrl + "\" />");

                //  str.Append("<input id=\"CertId\" name=\"CertId\" type=\"hidden\"  value=\"" + qp.CertId + "\" />");

                str.Append("<input id=\"MerPriv\" name=\"MerPriv\" type=\"hidden\"  value=\"" + qp.MerPriv + "\" />");

                str.Append("<input id=\"ChkValue\"  name=\"ChkValue\" type=\"hidden\"  value=\"" + qp.ChkValue + "\" />");

                str.Append(" </form>");

                str.Append("<script type=\"text/javascript\">document.getElementById('formauto').submit();</script>");

                LoggerHelper.Info("快捷充值提交表单:" + str.ToString());
            }
            ViewBag.str = str.ToString();

            return(View());
        }