示例#1
0
        public ActionResult AppUserRiskSh()
        {
            int userid = string.IsNullOrEmpty(Request["userid"]) ? 0 : int.Parse(Request["userid"]);

            JMP.BLL.jmp_user bll   = new JMP.BLL.jmp_user();
            JMP.MDL.jmp_user model = bll.GetModel(userid);
            ViewBag.usermodel = model;
            return(View());
        }
示例#2
0
        public JsonResult UserLogin(string logName, string logPwd, string valCode)
        {
            //获取开发者平台地址

            object result = new { msg = "验证码错误!", success = "0" };

            if (valCode == Session["ValidateCode"].ToString())
            {
                string Pwd = DESEncrypt.Encrypt(logPwd);

                string            Userurl   = System.Configuration.ConfigurationManager.AppSettings["Userurl"] + "?qs=" + DESEncrypt.Encrypt(logName + ";" + Pwd + ";0;" + System.DateTime.Now.ToString());
                JMP.BLL.jmp_limit bll_limit = new JMP.BLL.jmp_limit();
                JMP.BLL.jmp_user  bll       = new JMP.BLL.jmp_user();
                JMP.MDL.jmp_user  model     = bll.GetModel(logName);

                if (model != null && model.u_state == 1)
                {
                    if ((model.u_email == logName || model.u_phone == logName) && model.u_password == Pwd)
                    {
                        UserInfo.UserId     = model.u_id;
                        UserInfo.UserName   = model.u_realname;
                        UserInfo.UserNo     = model.u_email;
                        UserInfo.UserRoleId = model.u_role_id;
                        DataTable dtLimit = bll_limit.GetAppUserLimitSession(model.u_id, model.u_role_id);
                        if (dtLimit.Rows.Count > 0)
                        {
                            result = new { msg = "登录成功!", success = "1", url = Userurl };
                        }
                        else
                        {
                            result = new { msg = "权限不足!", success = "2" };
                        }
                    }
                    else
                    {
                        result = new { msg = "用户名或密码错误!", success = "2" };
                    }
                }
                else
                {
                    if (model == null)
                    {
                        result = new { msg = "用户名或密码错误!", success = "2" };
                    }
                    else if (model.u_state != 1)
                    {
                        result = new { msg = "该账号已冻结!", success = "2" };
                    }
                }


                //result = new { msg = "验证码成功!", status = 1, url = Userurl };
            }

            return(Json(result));
        }
示例#3
0
        public ActionResult AppUserAuditing()
        {
            int userid = string.IsNullOrEmpty(Request["userid"]) ? 0 : int.Parse(Request["userid"]);

            JMP.BLL.jmp_user bll   = new JMP.BLL.jmp_user();
            JMP.MDL.jmp_user model = bll.GetModel(userid);
            ViewBag.usermodel = model;
            //审核状态
            ViewBag.start  = model.u_auditstate;
            ViewBag.userid = userid;
            return(View());
        }
示例#4
0
        public JsonResult DoAll(string uids, int tag)
        {
            JMP.BLL.jmp_user userBll = new JMP.BLL.jmp_user();
            bool             flag    = userBll.UpdateState(uids, tag);

            //写日志
            if (flag)
            {
                string info = "批量更新开发者(" + uids + ")的状态为" + (tag == 1 ? "正常。" : "冻结。");
                Logger.OperateLog("批量更新开发者状态", info);
            }
            return(Json(new { success = flag ? 1 : 0, msg = flag ? "更新成功!" : "更新失败!" }));
        }
示例#5
0
        public JsonResult AddUser(JMP.MDL.jmp_user jmpuser)
        {
            JMP.BLL.CoServiceFeeRatioGrade grade_bll = new JMP.BLL.CoServiceFeeRatioGrade();
            //查询默认费率
            JMP.MDL.CoServiceFeeRatioGrade grade_model = grade_bll.GetModelById();

            object obj = new { success = 0, msg = "添加失败!" };

            JMP.BLL.jmp_user userBll = new JMP.BLL.jmp_user();
            jmpuser.u_password = DESEncrypt.Encrypt(jmpuser.u_password);
            jmpuser.u_role_id  = int.Parse(ConfigurationManager.AppSettings["JSRoleID"]);
            try
            {
                if (jmpuser.u_category == 0)
                {
                    jmpuser.u_photo = string.IsNullOrEmpty(jmpuser.u_photo) ? "" : jmpuser.u_photo;
                }
                else
                {
                    jmpuser.u_blicense = string.IsNullOrEmpty(jmpuser.u_blicense) ? "" : jmpuser.u_blicense;
                    jmpuser.u_photo    = string.IsNullOrEmpty(jmpuser.u_photo) ? " " : jmpuser.u_photo;
                }
                jmpuser.u_qq      = string.IsNullOrEmpty(jmpuser.u_qq) ? "" : jmpuser.u_qq;
                jmpuser.u_address = string.IsNullOrEmpty(jmpuser.u_address) ? " " : jmpuser.u_address;
                jmpuser.ServiceFeeRatioGradeId = string.IsNullOrEmpty(grade_model.Id.ToString()) ? 0 : grade_model.Id;
                jmpuser.u_time = DateTime.Now;

                bool flag = false;
                if (!userBll.ExistsEmail(jmpuser.u_email))
                {
                    flag = userBll.Add(jmpuser) > 0;
                }
                obj = new { success = flag ? 1 : 0, msg = flag ? "添加成功!" : "添加失败!" };
                //写日志
                if (flag)
                {
                    Logger.CreateLog("添加开发者", jmpuser);
                }
            }
            catch (Exception ex)
            {
                obj = new { success = 0, msg = "添加异常!" };

                Logger.OperateLog("添加开发者报错", ex.ToString());
            }
            return(Json(obj));
        }
示例#6
0
        public JsonResult CheckAuditing()
        {
            int    id           = string.IsNullOrEmpty(Request["userid"]) ? 0 : int.Parse(Request["userid"]);
            int    u_auditstate = string.IsNullOrEmpty(Request["u_auditstate"]) ? 0 : int.Parse(Request["u_auditstate"]);
            string name         = UserInfo.UserName;

            JMP.BLL.jmp_user bll  = new JMP.BLL.jmp_user();
            bool             flag = bll.UpdateAuditState(id, u_auditstate, name);

            if (flag)
            {
                string info = "审核开发者状态(" + id + ")的状态为" + u_auditstate + "";
                Logger.OperateLog("审核开发者状态", info);
            }

            return(Json(new { success = flag ? 1 : 0, msg = flag ? "审核成功!" : "审核失败!" }));
        }
示例#7
0
        public JsonResult CheckRiskSH()
        {
            int id             = string.IsNullOrEmpty(Request["userid"]) ? 0 : int.Parse(Request["userid"]);
            int IsSignContract = string.IsNullOrEmpty(Request["IsSignContract"]) ? 0 : int.Parse(Request["IsSignContract"]);
            int IsRecord       = string.IsNullOrEmpty(Request["IsRecord"]) ? 0 : int.Parse(Request["IsRecord"]);

            JMP.BLL.jmp_user bll  = new JMP.BLL.jmp_user();
            bool             flag = bll.UpdateRiskSH(id, IsSignContract, IsRecord);

            if (flag)
            {
                string info = "审核风控资料信息(" + id + ")的签订合同状态为" + IsSignContract + ",产品备案状态为" + IsRecord + "";
                Logger.OperateLog("审核风控资料信息", info);
            }

            return(Json(new { success = flag ? 1 : 0, msg = flag ? "风控资料审核成功!" : "风控资料审核失败!" }));
        }
示例#8
0
        public ActionResult AppUserEdit()
        {
            int userId = !string.IsNullOrEmpty(Request["uid"]) ? int.Parse(Request["uid"]) : 0;

            JMP.BLL.jmp_user bll   = new JMP.BLL.jmp_user();
            JMP.MDL.jmp_user model = bll.GetModel(userId);
            ViewBag.UserData  = model;
            ViewBag.UploadUrl = ConfigurationManager.AppSettings["imgurl"];
            string DisplayName = "";

            //
            switch (model.relation_type)
            {
            case 1:

                co_model = bll_co.GetModel(model.relation_person_id);
                if (co_model != null)
                {
                    DisplayName = co_model.DisplayName;
                }

                break;

            case 2:

                modelAgent = bllAgent.GetModel(model.relation_person_id);

                if (modelAgent != null)
                {
                    DisplayName = modelAgent.DisplayName;
                }
                break;
            }

            ViewBag.DisplayName = DisplayName;

            return(View());
        }
示例#9
0
        public ActionResult AppUserList()
        {
            #region 初始化
            //获取开发者平台地址
            string Userurl = System.Configuration.ConfigurationManager.AppSettings["Userurl"];
            ViewBag.Userurl = Userurl;
            //获取请求参数
            int    pageCount  = 0;
            int    pageIndexs = string.IsNullOrEmpty(Request["curr"]) ? 1 : Int32.Parse(Request["curr"]);     //当前页
            int    PageSize   = string.IsNullOrEmpty(Request["psize"]) ? 20 : Int32.Parse(Request["psize"]);  //每页显示数量
            string type       = string.IsNullOrEmpty(Request["stype"]) ? "0" : Request["stype"];              //查询条件类型
            string sea_name   = string.IsNullOrEmpty(Request["skeys"]) ? "" : Request["skeys"].Trim();        //查询条件值
            string stat       = string.IsNullOrEmpty(Request["state"]) ? "1" : Request["state"];              //用户状态
            string tag        = string.IsNullOrEmpty(Request["scheck"]) ? "" : Request["scheck"];             //审核状态
            string category   = string.IsNullOrEmpty(Request["scategory"]) ? "" : Request["scategory"];       //认证类型
            int    px         = string.IsNullOrEmpty(Request["s_sort"]) ? 1 : Int32.Parse(Request["s_sort"]); //排序
            string RiskM      = string.IsNullOrEmpty(Request["RiskM"]) ? "" : Request["RiskM"];               //风控资料

            int relation_type = string.IsNullOrEmpty(Request["relation_type"]) ? -1 : int.Parse(Request["relation_type"]);
            //string RoleID = System.Configuration.ConfigurationManager.AppSettings["RoleID"];
            //获取用户列表
            string where = "where 1=1";
            if (!string.IsNullOrEmpty(type.ToString()))
            {
                if (!string.IsNullOrEmpty(sea_name))
                {
                    switch (type)
                    {
                    case "0":
                        where += string.Format(" and  u.u_email like '%{0}%'", sea_name);
                        break;

                    case "1":
                        where += string.Format(" and  u.u_realname like '%{0}%'", sea_name);
                        break;

                    case "4":
                        where += string.Format(" and u.u_name like '%{0}%'", sea_name);
                        break;

                    case "7":
                        where += string.Format(" and (i.DisplayName like '%{0}%' or o.DisplayName like '%{0}%')", sea_name);
                        break;

                    case "8":
                        where += string.Format(" and u_id ='" + sea_name + "'");
                        break;
                    }
                }
            }
            if (!string.IsNullOrEmpty(stat))
            {
                where += string.Format(" and u.u_state={0}", stat);
            }
            if (!string.IsNullOrEmpty(tag))
            {
                where += string.Format(" and u.u_auditstate={0}", tag);
            }
            if (!string.IsNullOrEmpty(category))
            {
                where += string.Format(" and u.u_category={0}", category);
            }
            if (relation_type > -1)
            {
                where += string.Format(" and  u.relation_type={0}", relation_type);
            }
            if (!string.IsNullOrEmpty(RiskM))
            {
                switch (RiskM)
                {
                case "0":
                    where += " and IsSignContract=1 and IsRecord=1";
                    break;

                case "1":
                    where += " and IsSignContract=0 and IsRecord=0";
                    break;
                }
            }

            string           Order = " order by u_id " + (px == 0 ? "" : " desc ") + " ";
            JMP.BLL.jmp_user bll   = new JMP.BLL.jmp_user();
            string           query = "select  u.IsSignContract,u.IsRecord, u.u_id,relation_type,u.u_category,u.u_idnumber,u.u_photo,u.u_blicense,u.u_blicensenumber,u.u_count,u.u_state,u.u_auditstate,u.u_topid,u.u_address,u.u_email,u.u_role_id,u.u_password,u.u_realname,u.u_phone,u.u_qq,u.u_bankname,u.u_name,u.u_account,u.u_time,u.u_auditor,u.IsSpecialApproval,u.SpecialApproval,i.DisplayName as sw,o.DisplayName as dls,g.ServiceFeeRatio  from jmp_user as u left join CoBusinessPersonnel as i on u.relation_person_id = i.Id and u.relation_type = 1 left join CoAgent as o on u.relation_person_id = o.Id and u.relation_type = 2 left join CoServiceFeeRatioGrade as g on g.Id=u.ServiceFeeRatioGradeId " + where;
            var list = bll.GetAppUserMerchantLists(query, Order, pageIndexs, PageSize, out pageCount);
            //返回
            ViewBag.CurrPage      = pageIndexs;
            ViewBag.PageSize      = PageSize;
            ViewBag.PageCount     = pageCount;
            ViewBag.stype         = type;
            ViewBag.skeys         = sea_name;
            ViewBag.state         = stat;
            ViewBag.scategory     = category;
            ViewBag.scheck        = tag;
            ViewBag.s_sort        = px;
            ViewBag.list          = list;
            ViewBag.btnstr        = GetVoidHtml();
            ViewBag.relation_type = relation_type;
            ViewBag.RiskM         = RiskM;

            #endregion
            return(View());
        }
示例#10
0
        public JsonResult UpdateUser(JMP.MDL.jmp_user jmpuser)
        {
            object obj = new { success = 0, msg = "更新失败!" };

            JMP.BLL.jmp_user userBll = new JMP.BLL.jmp_user();
            JMP.MDL.jmp_user oldUser = userBll.GetModel(jmpuser.u_id);
            var oldUserColne         = oldUser.Clone();

            oldUser.u_category         = jmpuser.u_category;//类别
            oldUser.u_email            = jmpuser.u_email;
            oldUser.u_realname         = jmpuser.u_realname;
            oldUser.u_password         = DESEncrypt.Encrypt(jmpuser.u_password);
            oldUser.u_phone            = jmpuser.u_phone;
            oldUser.u_qq               = jmpuser.u_qq;
            oldUser.u_address          = jmpuser.u_address;
            oldUser.u_account          = jmpuser.u_account;
            oldUser.u_name             = jmpuser.u_name;
            oldUser.u_bankname         = jmpuser.u_bankname;
            oldUser.u_idnumber         = jmpuser.u_idnumber;
            oldUser.FrozenMoney        = jmpuser.FrozenMoney;
            oldUser.BusinessEntity     = jmpuser.BusinessEntity;
            oldUser.RegisteredAddress  = jmpuser.RegisteredAddress;
            oldUser.relation_type      = jmpuser.relation_type;
            oldUser.relation_person_id = jmpuser.relation_person_id;
            oldUser.u_photof           = string.IsNullOrEmpty(jmpuser.u_photof) ? "" : jmpuser.u_photof;
            oldUser.u_licence          = string.IsNullOrEmpty(jmpuser.u_licence) ? "" : jmpuser.u_licence;
            try
            {
                if (oldUser.u_category == 0)
                {
                    oldUser.u_photo = string.IsNullOrEmpty(jmpuser.u_photo) ? "" : jmpuser.u_photo;
                }
                else
                {
                    oldUser.u_blicense       = string.IsNullOrEmpty(jmpuser.u_blicense) ? "" : jmpuser.u_blicense;
                    oldUser.u_photo          = string.IsNullOrEmpty(jmpuser.u_photo) ? " " : jmpuser.u_photo;
                    oldUser.u_blicensenumber = jmpuser.u_blicensenumber;
                }
                if (string.IsNullOrEmpty(oldUser.u_qq))
                {
                    oldUser.u_qq = " ";
                }
                if (string.IsNullOrEmpty(oldUser.u_address))
                {
                    oldUser.u_address = " ";
                }
                bool flag = userBll.Update(oldUser);
                obj = new { success = flag ? 1 : 0, msg = flag ? "更新成功!" : "更新失败!" };
                //写日志
                if (flag)
                {
                    Logger.ModifyLog("修改开发者", oldUserColne, jmpuser);
                    //审核状态改变是发送私信和邮件给用户
                    if (jmpuser.u_auditstate != oldUserColne.u_auditstate)
                    {
                        JMP.BLL.jmp_message messbll = new JMP.BLL.jmp_message();
                        JMP.MDL.jmp_message j_mess  = new JMP.MDL.jmp_message();
                        string tipmsg = string.Empty;
                        #region 组装私信实体
                        j_mess.m_sender   = UserInfo.UserId;
                        j_mess.m_receiver = oldUser.u_id.ToString();
                        j_mess.m_type     = 1;
                        j_mess.m_time     = DateTime.Now;
                        j_mess.m_state    = 0;
                        switch (jmpuser.u_auditstate)
                        {
                        case -1:
                            tipmsg = "你的账号审核未通过!";
                            break;

                        case 0:
                            tipmsg = "你的账号正在审核中,如有疑问请联系我们!";
                            break;

                        case 1:
                            tipmsg = "你的账号审核通过!";
                            break;
                        }
                        j_mess.m_content = tipmsg;
                        j_mess.m_topid   = oldUser.u_topid;
                        #endregion
                        //发送私信
                        if (jmpuser.u_auditstate == 1)
                        {
                            //更改审核状态为通过时,才发送私信
                            int record = messbll.Add(j_mess);
                            if (record > 0)
                            {
                                Logger.CreateLog("发送私信给用户", j_mess);
                            }
                        }
                        #region 发送邮件
                        //StringBuilder MailContent = new StringBuilder();
                        //MailContent.Append("亲爱的开发者:<br/>");
                        //MailContent.Append("&nbsp;&nbsp;&nbsp;&nbsp;您好!" + tipmsg);
                        //MailContent.Append("&nbsp;&nbsp;&nbsp;&nbsp;如果你没有用该邮件账号注册过聚米支付平台的账号,请忽视本邮件!");
                        //MailContent.Append("亲爱的开发者:<br/>");
                        //bool isSend = MailHelper.SendText("*****@*****.**", "聚米网络科技", jmpuser.u_email, "重置密码", MailContent.ToString(), "smtp.adjumi.com", "*****@*****.**", "");
                        //if (isSend)
                        //{
                        //    string tmsg = string.Format("用户{0}({1})发送邮件至用户邮箱{2},邮件内容为:{3}", UserInfo.UserName, UserInfo.UserId, jmpuser.u_email, tipmsg);
                        //    AddLocLog.AddLog(int.Parse(UserInfo.UserId), 3, RequestHelper.GetClientIp(), "发送邮件给用户" + jmpuser.u_id, tmsg);
                        //}
                        #endregion
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.OperateLog("修改开发者报错" + jmpuser.u_id, ex.ToString());
                obj = new { success = 0, msg = "更新出错了!" };
            }
            return(Json(obj));
        }
示例#11
0
        public ActionResult UserList()
        {
            List <JMP.MDL.jmp_user> list = new List <JMP.MDL.jmp_user>();

            JMP.BLL.jmp_user bll = new JMP.BLL.jmp_user();
            #region 初始化
            //获取请求参数
            int    pageCount  = 0;
            int    pageIndexs = string.IsNullOrEmpty(Request["curr"]) ? 1 : Int32.Parse(Request["curr"]);     //当前页
            int    PageSize   = string.IsNullOrEmpty(Request["psize"]) ? 20 : Int32.Parse(Request["psize"]);  //每页显示数量
            string type       = string.IsNullOrEmpty(Request["stype"]) ? "5" : Request["stype"];              //查询条件类型
            string sea_name   = string.IsNullOrEmpty(Request["skeys"]) ? "" : Request["skeys"];               //查询条件值
            string category   = string.IsNullOrEmpty(Request["scategory"]) ? "" : Request["scategory"];       //认证类型
            int    px         = string.IsNullOrEmpty(Request["s_sort"]) ? 0 : Int32.Parse(Request["s_sort"]); //排序
            //获取用户列表
            string where = " where 1=1 and u_auditstate='1' and u_state='1' ";
            if (!string.IsNullOrEmpty(type.ToString()))
            {
                if (!string.IsNullOrEmpty(sea_name))
                {
                    switch (type)
                    {
                    case "0":
                        where += string.Format(" and u_email like '%{0}%'", sea_name);
                        break;

                    case "1":
                        where += string.Format(" and u_phone like '%{0}%'", sea_name);
                        break;

                    case "3":
                        where += string.Format(" and u_idnumber like '%{0}%'", sea_name);
                        break;

                    case "6":
                        where += string.Format(" and u_blicensenumber like '%{0}%'", sea_name);
                        break;

                    case "5":
                        where += string.Format(" and u_realname like '%{0}%'", sea_name);
                        break;
                    }
                }
            }
            if (!string.IsNullOrEmpty(category))
            {
                where += string.Format(" and u_category={0}", category);
            }
            string Order = " order by u_id " + (px == 0 ? "" : " desc ") + " ";
            string query = "select * from jmp_user" + where;
            list = bll.GetLists(query, Order, pageIndexs, PageSize, out pageCount);
            //返回
            ViewBag.CurrPage  = pageIndexs;
            ViewBag.PageSize  = PageSize;
            ViewBag.PageCount = pageCount;
            ViewBag.stype     = type;
            ViewBag.skeys     = sea_name;
            ViewBag.scategory = category;
            ViewBag.s_sort    = px;
            ViewBag.list      = list;
            #endregion
            return(View());
        }