Esempio n. 1
0
        /// <summary>
        /// 得到用户信息
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public static ResultData <UserApplyUserResultDTO> GetOneUserApply(UserApplySearchDTO dto)
        {
            ResultData <UserApplyUserResultDTO> result = new ResultData <UserApplyUserResultDTO>();

            var pp = GetAPI <ResultData <List <UserApplyBatchchResultModel> > >(WebConfiger.UserServicesUrl + "ApplyUser?UserApplySearchDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto));

            if (pp.Object != null && pp.Object.Count > 0)
            {
                var qq = pp.Object.FirstOrDefault();
                if (qq != null)
                {
                    result.Object       = qq.UserApplyUserList.FirstOrDefault();
                    result.SubmitResult = true;
                }
                else
                {
                    result.Message = "此条信息不存在!";
                }
            }
            else
            {
                result.Message = "此条信息不存在!";
            }

            return(result);
        }
Esempio n. 2
0
        public List <UserApplyUserResultDTO> GetUserApply(UserApplySearchDTO dto)
        {
            List <UserApplyUserResultDTO> result = null;
            var tcdmse = SingleQueryObject.GetObj();

            var pp = tcdmse.UserApply_UserApplyInfo.AsNoTracking().Where(p => p.AuditStatus == 0);

            if (dto != null)
            {
                if (!string.IsNullOrEmpty(dto.SearchText))
                {
                    pp = pp.Where(p => p.UserApplyName.Contains(dto.SearchText));
                }
                if (dto.RoleIDlist != null)
                {
                    pp = pp.Where(p => dto.RoleIDlist.Where(g => p.AuditRoleIDList.Contains(("," + (g ?? -1).ToString() + ","))).Count() > 0);
                }
                if (dto.UserApplyID != null)
                {
                    pp = pp.Where(p => p.UserApplyID == dto.UserApplyID);
                }
            }
            result = Mapper.Map <List <UserApply_UserApplyInfo>, List <UserApplyUserResultDTO> >(pp.ToList());

            return(result);
        }
Esempio n. 3
0
        /// <summary>
        /// 得到申请用户权限
        /// </summary>
        /// <returns></returns>
        public static ResultData <List <UserApplyAuthority> > GetApplyUserAut(UserApplySearchDTO dto)
        {
            ResultData <List <UserApplyAuthority> > result = new ResultData <List <UserApplyAuthority> >();

            var pp = GetAPI <ResultData <List <UserApplyAuthority> > >(WebConfiger.MasterDataServicesUrl + "ApplyUserAuthority?UserApplySearchDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto));

            return(result);
        }
Esempio n. 4
0
        /// <summary>
        /// 得到所有用户申请信息(含模糊查询)
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public static ResultData <List <UserApplyResultDTOModel> > GetUserApply(UserApplySearchDTO dto)
        {
            ResultData <List <UserApplyResultDTOModel> > result = null;

            result = GetAPI <ResultData <List <UserApplyResultDTOModel> > >(WebConfiger.UserServicesUrl + "ApplyUserAudit?UserApplySearchDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto));

            return(result);
        }
Esempio n. 5
0
        /// <summary>
        /// 得到所有用户申请信息(含模糊查询)
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public ActionResult GetUserApply(UserApplySearchDTO dto)
        {
            ResultData <List <UserApplyResultDTOModel> > result = null;
            UserLoginDTO user = (UserLoginDTO)Session["UserLoginInfo"];

            dto.RoleIDlist = user.CurrentRoleIDList;
            result         = UserAuthorityProvider.GetUserApply(dto);

            return(Json(result.Object, JsonRequestBehavior.AllowGet));
        }
Esempio n. 6
0
        /// <summary>
        /// 查询申请的用户
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public List <UserApplyUserResultDTO> GetApplyUser(UserApplySearchDTO dto)
        {
            List <UserApplyUserResultDTO> result = null;
            var tcdmse = SingleQueryObject.GetObj();
            var pp     = tcdmse.UserApply_UserApplyInfo.AsNoTracking().Where(p => p.UserApplyID != null);

            if (dto.BatchID != null)
            {
                pp = pp.Where(p => p.BatchID == dto.BatchID);
            }

            result = Mapper.Map <List <UserApply_UserApplyInfo>, List <UserApplyUserResultDTO> >(pp.ToList());

            return(result);
        }
Esempio n. 7
0
        /// <summary>
        /// 用户申请审核(通过)
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public ActionResult AuditUserApplyAdopt(UserApplyOperateDTO dto)
        {
            ResultData <UserApplyOperateDTO> result = new ResultData <UserApplyOperateDTO>();
            UserLoginDTO user = (UserLoginDTO)Session["UserLoginInfo"];

            try
            {
                dto.CreateUser  = user.FullName;
                dto.RoleIDlist  = user.CurrentRoleIDList;
                dto.AuditStatus = 1;
                result          = UserAuthorityProvider.AuditUserApplyAdopt(dto);
                if (result.SubmitResult)
                {
                    result.Object.StopTime = DateTime.Now.AddYears(1);
                    UserAuthorityProvider.AuditUserApplyAdoptAut(result.Object);

                    //通过的模块名称
                    var    aut       = result.Object.ApplyUserAuthority.Select(s => s.StructureID).ToList();
                    var    modelname = ModelRoleModel.ModelRolelist.Where(m => aut.Contains(m.ModelID)).Select(s => s.ModelName).ToList();
                    string modelstr  = string.Join(",", modelname);

                    //取得申请人邮箱
                    UserApplySearchDTO batchdto = new UserApplySearchDTO();
                    batchdto.BatchID = result.Object.BatchID;
                    batchdto.Query   = 1;
                    batchdto.page    = 1;
                    batchdto.rows    = 1;
                    var pp = UserAuthorityProvider.GetBatchUser(batchdto);

                    //发送邮件通知申请人
                    EmailHelper.SendMessage("用户审核通过", string.Format(WebConfiger.UserAuditPassEmailMessage, result.Object.UserApplyName, dto.Distributor, modelstr), new List <string> {
                        pp.Object.ApplyUserEamil
                    }, null, null);
                    // 发送短信通知申请人
                    MobileMessage.SendMessage(new List <string> {
                        pp.Object.ApplyUserPhone
                    }, String.Format(WebConfiger.UserAuditPassShortMessage, modelstr));
                }
            }
            catch (Exception ex)
            {
                result.SubmitResult = false;
                result.Message      = ex.Message;
            }

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Esempio n. 8
0
        /// <summary>
        /// 得到一条用户申请信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static ResultData <UserApplyResultDTOModel> GetOneUserApply(UserApplySearchDTO dto)
        {
            ResultData <UserApplyResultDTOModel> result = new ResultData <UserApplyResultDTOModel>();

            var pp = GetAPI <ResultData <List <UserApplyResultDTOModel> > >(WebConfiger.UserServicesUrl + "ApplyUserAudit?UserApplySearchDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto));

            if (pp.Object.Count > 0)
            {
                result.Object       = pp.Object.First();
                result.SubmitResult = true;
            }
            else
            {
                result.Message = "此条信息不存在!";
            }

            return(result);
        }
Esempio n. 9
0
        public HttpResponseMessage GetUserApply(string UserApplySearchDTO)
        {
            UserApplySearchDTO dto = TransformHelper.ConvertBase64JsonStringToDTO <UserApplySearchDTO>(UserApplySearchDTO);
            ResultDTO <List <UserApplyUserResultDTO> > resultdto = new ResultDTO <List <UserApplyUserResultDTO> >();
            List <UserApplyUserResultDTO> user = null;

            user = _IUserServices.GetUserApply(dto);

            resultdto.Object       = user;
            resultdto.SubmitResult = true;

            HttpResponseMessage result = new HttpResponseMessage
            {
                Content = new StringContent(JsonConvert.SerializeObject(resultdto),
                                            System.Text.Encoding.GetEncoding("UTF-8"),
                                            "application/json")
            };

            return(result);
        }
Esempio n. 10
0
        public HttpResponseMessage GetApplyBatchUser(string UserApplySearchDTO)
        {
            UserApplySearchDTO dto = TransformHelper.ConvertBase64JsonStringToDTO <UserApplySearchDTO>(UserApplySearchDTO);
            ResultDTO <List <UserApplyBatchResultDTO> > resultdto = new ResultDTO <List <UserApplyBatchResultDTO> >();

            try
            {
                if (dto.Query == 1)
                {
                    resultdto.Object       = _IUserServices.GetApplyBatchUser(dto);
                    resultdto.SubmitResult = true;
                    resultdto.Count        = dto.Count;
                }
                else if (dto.Query == 2)
                {
                    resultdto.Object = new List <UserApplyBatchResultDTO>()
                    {
                        new UserApplyBatchResultDTO()
                        {
                            UserApplyUserList = _IUserServices.GetApplyUser(dto)
                        }
                    };
                    resultdto.SubmitResult = true;
                }
            }
            catch (Exception ex)
            {
                resultdto.SubmitResult = false;
                resultdto.Message      = ex.Message;
            }

            HttpResponseMessage result = new HttpResponseMessage
            {
                Content = new StringContent(JsonConvert.SerializeObject(resultdto),
                                            System.Text.Encoding.GetEncoding("UTF-8"),
                                            "application/json")
            };

            return(result);
        }
Esempio n. 11
0
        /// <summary>
        /// 查询申请的批次
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public List <UserApplyBatchResultDTO> GetApplyBatchUser(UserApplySearchDTO dto)
        {
            List <UserApplyBatchResultDTO> result = null;
            var tcdmse = SingleQueryObject.GetObj();
            var pp     = tcdmse.UserApply_ApplyBatch.AsNoTracking().Where(p => p.AuditStatus == 0 || p.AuditStatus == 1 || p.AuditStatus == 3);

            if (dto.DistributorID != null)
            {
                pp = pp.Where(p => p.DistributorID.Contains(dto.DistributorID.Value.ToString()));
            }
            if (dto.BatchID != null)
            {
                pp = tcdmse.UserApply_ApplyBatch.AsNoTracking().Where(p => p.BatchID == dto.BatchID);
            }

            dto.Count = pp.Count();
            var aa = pp.OrderByDescending(o => o.CreateTime).ThenByDescending(t => t.BatchID).Skip((dto.page - 1) * dto.rows).Take(dto.rows).ToList();

            result = Mapper.Map <List <UserApply_ApplyBatch>, List <UserApplyBatchResultDTO> >(aa.ToList());

            return(result);
        }
Esempio n. 12
0
        /// <summary>
        /// 获取申请用户权限
        /// </summary>
        /// <returns></returns>
        public ActionResult GetUserApplyAuthorityInfo(UserApplySearchDTO dto)
        {
            List <AuthorityListModel> result = new List <AuthorityListModel>();

            UserLoginDTO user    = (UserLoginDTO)Session["UserLoginInfo"];
            var          rolelis = user.CurrentRoleIDList;
            var          modelid = ModelRoleModel.ModelRolelist.Where(m => rolelis.Contains(m.RoleID) && (m.RoleID >= 2 && m.RoleID <= 13)).Select(s => s.ModelID).ToList();

            dto.Query = 2;
            var pp = UserAuthorityProvider.GetOneUserApply(dto).Object;

            List <StructureDTO> strcdtolevelone   = null;
            List <StructureDTO> strcdtoleveltwo   = null;
            List <StructureDTO> strcdtolevelthree = null;

            strcdtolevelone   = GlobalStaticData.StructureInfo.Where(p => modelid.Contains(p.StructureID) && p.ParentStructureID == null).ToList();
            strcdtoleveltwo   = GlobalStaticData.StructureInfo.Where(p => modelid.Contains(p.StructureID.Substring(0, 3)) && p.StructureID.Length == 6).ToList();
            strcdtolevelthree = GlobalStaticData.StructureInfo.Where(p => modelid.Contains(p.StructureID.Substring(0, 3)) && p.StructureID.Length == 9).ToList();

            foreach (var p in strcdtolevelone)
            {
                var tow = strcdtoleveltwo.Where(g => g.ParentStructureID == p.StructureID);
                if (tow.Count() == 0)
                {
                    AuthorityListModel alm = new AuthorityListModel();
                    result.Add(alm);
                    alm.LevelOne = p;
                    if (pp.ApplyUserAuthority.Where(x => x.StructureID == p.StructureID).FirstOrDefault() != null)
                    {
                        alm.IsChecked = true;
                    }
                    else
                    {
                        alm.IsChecked = false;
                    }
                }
                foreach (var t in tow)
                {
                    var three = strcdtolevelthree.Where(g => g.ParentStructureID == t.StructureID);
                    if (three.Count() == 0)
                    {
                        AuthorityListModel alm = new AuthorityListModel();
                        result.Add(alm);
                        alm.LevelOne  = p;
                        alm.LevelTWO  = t;
                        alm.IsChecked = false;

                        if (pp.ApplyUserAuthority.Where(x => x.StructureID == t.StructureID).FirstOrDefault() != null)
                        {
                            alm.IsChecked = true;
                        }
                        else
                        {
                            alm.IsChecked = false;
                        }
                    }
                    foreach (var w in three)
                    {
                        AuthorityListModel alm = new AuthorityListModel();
                        result.Add(alm);
                        alm.LevelOne   = p;
                        alm.LevelTWO   = t;
                        alm.LevelThree = w;
                        if (pp.ApplyUserAuthority.Where(x => x.StructureID == w.StructureID).FirstOrDefault() != null)
                        {
                            alm.IsChecked = true;
                        }
                        else
                        {
                            alm.IsChecked = false;
                        }
                    }
                }
            }

            return(Json(new { rows = result }, JsonRequestBehavior.AllowGet));
        }
Esempio n. 13
0
        /// <summary>
        /// 得到一条用户申请信息
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public ActionResult GetOneUserApply(UserApplySearchDTO dto)
        {
            ResultData <UserApplyResultDTOModel> result = new ResultData <UserApplyResultDTOModel>();
            DistributorSearchDTO disdto = new DistributorSearchDTO();

            try
            {
                string strSaveDir = this.Server.MapPath("~/Attachments");
                result = UserAuthorityProvider.GetOneUserApply(dto);
                result.SubmitResult = true;
                string ViewdisNameStr = "";

                if (!string.IsNullOrEmpty(result.Object.DistributorIDList))
                {
                    //查询经销商ID字符串转List
                    string        disString = string.Empty;
                    string        Disstr    = result.Object.DistributorIDList;
                    List <string> DisList   = new List <string>();
                    Disstr.Split(',').ToList().ForEach(g =>
                    {
                        disString = g.Trim();
                        if (!string.IsNullOrEmpty(disString))
                        {
                            DisList.Add(disString);
                        }
                    });
                    //根据经销商ID的List查询到经销商的姓名,并且拼接成字符串
                    foreach (var q in DisList)
                    {
                        Guid guid = new Guid(q);
                        disdto.DistributorID = guid;
                        disdto.rows          = 10000;
                        disdto.page          = 1;
                        var OneDisName = DistributorProvider.GetOneDistributor(disdto);
                        var DisName    = OneDisName.Object.DistributorName;
                        ViewdisNameStr += DisName + ",";
                    }
                }

                result.Object.DistributorIDList = ViewdisNameStr;

                if (result.Object.BatchID != null)
                {
                    AttachFileSearchDTO attdto = new AttachFileSearchDTO();
                    attdto.BelongModule           = 2;
                    attdto.BelongModulePrimaryKey = result.Object.BatchID.Value.ToString();
                    var att = UserAuthorityProvider.GetAttachFileList(attdto);
                    if (att != null)
                    {
                        result.Object.AttName          = att.AttachFileName;
                        result.Object.AttSrcName       = att.AttachFileSrcName;
                        result.Object.AttExtentionName = att.AttachFileExtentionName;
                        result.Object.IsAtt            = true;
                    }
                }
            }
            catch (Exception ex)
            {
                result.SubmitResult = false;
                result.Message      = ex.Message;
            }

            return(Json(result, JsonRequestBehavior.AllowGet));
        }