예제 #1
0
 public ActionResult AuthorRenderToExcel(AuthorDetailQuery query, string strDict)
 {
     try
     {
         IAuthorPlatformFacadeService service = ServiceContainer.Instance.Container.Resolve<IAuthorPlatformFacadeService>();
         query.JournalID = CurAuthor.JournalID;
         query.GroupID = 2;
         query.OrderStr = "AddDate DESC";
         IList<AuthorDetailEntity> list = service.GetAuthorDetailList(query);
         if (list == null || list.Count <= 0)
         {
             return Content("没有数据不能导出,请先进行查询!");
         }
         strDict = Server.UrlDecode(strDict);
         JavaScriptSerializer s = new JavaScriptSerializer();
         Dictionary<string, object> JsonData = (Dictionary<string, object>)s.DeserializeObject(strDict);
         IDictionary<string, string> dict = ((object[])JsonData.First().Value).Select(p => (Dictionary<string, object>)p).ToDictionary(p => p["key"].ToString(), q => q["value"].ToString());
         //获取学历[Education]数据字典显示名-dict2[list[i].Education].ToString()
         ISiteConfigFacadeService service2 = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>();
         DictValueQuery query2 = new DictValueQuery();
         query2.JournalID = CurAuthor.JournalID;
         query2.DictKey = "Education";
         IDictionary<int, string> dict2 = service2.GetDictValueDcit(query2);
         //获取职称[JobTitle]数据字典显示名-dict3[list[i].JobTitle].ToString()
         DictValueQuery query3 = new DictValueQuery();
         query3.JournalID = CurAuthor.JournalID;
         query3.DictKey = "JobTitle";
         IDictionary<int, string> dict3 = service2.GetDictValueDcit(query3);
         //替换字段内容
         if (dict != null && dict.Count > 0)
         {
             for (int i = 0; i < list.Count; i++)
             {
                 if (list[i].AuthorModel.GroupID == 2)
                     list[i].ReserveField2 = "作者";
                 if (list[i].AuthorModel.Status == 1)
                     list[i].ReserveField3 = "正常";
                 else
                     list[i].ReserveField3 = "已停用";
                 list[i].ReserveField4 = dict2[list[i].Education].ToString();
                 list[i].ReserveField5 = dict3[list[i].JobTitle].ToString();
             }
         }
         //移除字段
         dict.Remove("Education");
         dict.Remove("JobTitle");
         //开始导出Excel
         RenderToExcel.ExportListToExcel<AuthorDetailEntity>(list, dict
             , null
             , "作者信息_导出" + DateTime.Now.ToString("yyyy-MM-dd"), false, "xls");
         return Content("导出成功!");
     }
     catch (Exception ex)
     {
         LogProvider.Instance.Error("导出作者信息出现异常:" + ex.Message);
         return Content("导出作者信息异常!");
     }
 }
예제 #2
0
        /// <summary>
        /// 激活用户账号
        /// </summary>
        public ActionResult Activate(long AuthorID, string Token)
        {
            if (!string.IsNullOrEmpty(Token))
            {
                // 验证令牌正确性
                TokenQuery tokenQuery = new TokenQuery();
                tokenQuery.JournalID = SiteConfig.SiteID;
                tokenQuery.AuthorID = AuthorID;
                tokenQuery.Token = Token;
                tokenQuery.ExpireDate = DateTime.Now.AddMonths(-3);
                IAuthorFacadeService authorService = ServiceContainer.Instance.Container.Resolve<IAuthorFacadeService>();
                TokenEntity tokenEntity = authorService.GetToken(tokenQuery);
                if (tokenEntity == null)
                {
                    return Content("自动登录令牌不存在或已过期,请重新获取登录链接或<a href=\"" + SiteConfig.RootPath + "/\">输入用户名密码进行登录.</a>");
                }
                AuthorInfoEntity currentAuthorEntity = new AuthorInfoEntity() { Status=1,AuthorID=AuthorID,GroupID=2};
                //跟新作者账号为有效
                authorService.EditMember(currentAuthorEntity);
                // 保存登录ticket

                // 验证是否是作者
                IAuthorPlatformFacadeService service = ServiceContainer.Instance.Container.Resolve<IAuthorPlatformFacadeService>();
                AuthorDetailQuery authorQuery = new AuthorDetailQuery();
                authorQuery.JournalID = SiteConfig.SiteID;
                authorQuery.GroupID = 2;
                authorQuery.CurrentPage = 1;
                authorQuery.PageSize = 1;
                authorQuery.AuthorIDs = new long[] { AuthorID };
                Pager<AuthorDetailEntity> authorPager = service.GetAuthorDetailPageList(authorQuery);
                if (authorPager != null && authorPager.ItemList.Count == 1)
                {
                    AuthorInfoEntity authorEntity = new AuthorInfoEntity();
                    authorEntity.AuthorID = AuthorID;
                    authorEntity.GroupID = 2;
                    authorEntity.JournalID = SiteConfig.SiteID;
                    authorEntity.Status = 1;
                    authorEntity.RealName = authorPager.ItemList[0].AuthorModel.RealName;
                    authorEntity.LoginName = authorPager.ItemList[0].AuthorModel.LoginName;

                    TicketTool.SetCookie(authorEntity.AuthorID.ToString(), JsonConvert.SerializeObject(authorEntity), false);
                }
                else
                {
                    return Content("请确认您的ID正确,或<a href=\"" + SiteConfig.RootPath + "/\">输入用户名密码进行登录.</a>");
                }
            }
            Response.Redirect(SiteConfig.RootPath + "/", true);
            return Content("");
        }
예제 #3
0
 /// <summary>
 /// 将查询实体转换为Order语句
 /// <param name="query">查询实体</param>
 /// <returns>获取Order语句,不包含Order</returns>
 /// </summary>
 public string AuthorDetailQueryToSQLOrder(AuthorDetailQuery query)
 {
     if (query.OrderStr != null && query.OrderStr.Trim() == "AddDate DESC")
         return "bAddDate DESC";
     else
         return " a.PKID DESC";
 }
 public AuthorDetailEntity GetModel(AuthorDetailQuery query)
 {
     IAuthorDetailService service = ServiceContainer.Instance.Container.Resolve<IAuthorDetailService>();
     AuthorDetailEntity model = service.GetAuthorDetailModel(query.AuthorID);
     return model;
 }
 public ExecResult Del(AuthorDetailQuery query)
 {
     IAuthorDetailService service = ServiceContainer.Instance.Container.Resolve<IAuthorDetailService>();
     return service.DelAuthorDetail(query.AuthorIDs);
 }
예제 #6
0
 /// <summary>
 /// 获取所有符合查询条件的数据
 /// </summary>
 /// <param name="authorDetailQuery">AuthorDetailQuery查询实体对象</param>
 /// <returns>List<AuthorDetailEntity></returns>
 public List<AuthorDetailEntity> GetAuthorDetailList(AuthorDetailQuery authorDetailQuery)
 {
     return AuthorDetailDataAccess.Instance.GetAuthorDetailList(authorDetailQuery);
 }
예제 #7
0
        /// <summary>
        /// 获取审稿单内容
        /// </summary>
        /// <param name="CID"></param>
        /// <param name="ExpertID"></param>
        /// <returns></returns>
        private string GetReviewBillContent(Int64 CID, Int64 EditorID, Int64 ExpertID, Int64 FlowLogID)
        {
            StringBuilder strHtml = new StringBuilder();
            strHtml.AppendFormat(" <div style=\"text-align: center; font-family: 黑体; font-size: 16px; padding-bottom: 15px;\">《{0}》 审稿单</div>",
                SiteConfig.SiteName);

            #region 获取稿件信息
            ContributionInfoQuery query = new ContributionInfoQuery();
            query.JournalID = CurAuthor.JournalID;
            query.IsAuxiliary = false;
            query.CID = CID;
            IAuthorPlatformFacadeService service = ServiceContainer.Instance.Container.Resolve<IAuthorPlatformFacadeService>();
            var CModel = service.GetContributionInfoModel(query);
            if (CModel == null)
                CModel = new ContributionInfoEntity();
            #endregion

            #region 获取作者信息
            AuthorDetailQuery query1 = new AuthorDetailQuery();
            query1.JournalID = CurAuthor.JournalID;
            query1.AuthorIDs = new Int64[] { CModel.AuthorID, ExpertID };
            var listAuthor = service.GetAuthorDetailList(query1).ToList();
            var AModel = listAuthor.Find(p => p.AuthorID == CModel.AuthorID);
            var EModel = listAuthor.Find(p => p.AuthorID == ExpertID);
            if (AModel == null)
                AModel = new AuthorDetailEntity();
            if (EModel == null)
                EModel = new AuthorDetailEntity();

            ISiteConfigFacadeService service1 = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>();
            DictValueQuery query2 = new DictValueQuery();
            query2.JournalID = SiteConfig.SiteID;
            query2.DictKey = EnumDictKey.JobTitle.ToString();
            IDictionary<int, string> dict = service1.GetDictValueDcit(query2);
            string jobTitle = dict.ContainsKey(EModel.JobTitle) ? dict[EModel.JobTitle] : string.Empty;
            #endregion

            #region 获取审稿日志
            IFlowFacadeService flowService = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
            CirculationEntity cirEntity = new CirculationEntity();
            cirEntity.CID = CID;
            cirEntity.JournalID = JournalID;
            cirEntity.GroupID = 1;
            IList<FlowLogInfoEntity> flowLogList = flowService.GetFlowLog(cirEntity);

            FlowLogInfoEntity LogSendModel = flowLogList.ToList().Find(p => p.FlowLogID == FlowLogID);

            //var LogModel = flowLogList.ToList().Where(p => p.SendUserID == ExpertID).FirstOrDefault(q => q.TargetStatusID == LogSendModel.TargetStatusID);
            var LogModel = flowLogList.ToList().Find(p => p.SendUserID == EditorID);
            if (LogModel == null)
                LogModel = new FlowLogInfoEntity();
            if (LogSendModel == null)
                LogSendModel = new FlowLogInfoEntity();
            #endregion

            strHtml.Append(flowService.GetReviewBillContentHead(CurAuthor.JournalID, ExpertID, CID));
            strHtml.AppendFormat("<div style=\"padding: 0px 0px 5px 0px; font-size: 11pt; font-family: Times New Roman;\">稿件编号:{0}</div>"
                , CModel.CNumber);
            strHtml.Append("<table border=\"0\" class=\"mainTable\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=\"100%\">");
            strHtml.AppendFormat("<tr><td class=\"left\">稿件标题:</td><td class=\"right\" style=\"font-weight: bolder;\" colspan=\"3\">{0}</td></tr>"
                , CModel.Title);

            strHtml.AppendFormat("<tr><td class=\"left\">送审日期:</td><td class=\"right\">{0}</td><td class=\"left_m\">审毕日期:</td><td class=\"right\">{1}</td></tr>"
                , LogModel.AddDate, LogModel.DealDate);
            strHtml.AppendFormat("<tr><td class=\"left\">作者姓名:</td><td class=\"right\">{0}</td><td class=\"left_m\">单位:</td><td class=\"right\">{1}</td></tr>"
                , AModel.AuthorName, AModel.WorkUnit);
            strHtml.AppendFormat("<tr><td class=\"left\" style=\"width: 80px;\">对本稿的总评价:</td><td class=\"right\" style=\"padding: 5px 0px 10px 5px;\" colspan=\"3\">");
            IFlowFacadeService service2 = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
            strHtml.Append(service2.GetReviewBillContentStr(CurAuthor.JournalID, ExpertID, CID));
            strHtml.Append("</td></tr>");
            strHtml.Append("<tr><td class=\"left\" style=\"width: 80px;\">审稿意见:</td><td class=\"right\" style=\"padding: 5px 0px 10px 5px;\" colspan=\"3\">");
            strHtml.Append(LogSendModel.DealAdvice);
            strHtml.Append("</td></tr>");

            strHtml.AppendFormat("<tr><td class=\"left\">审稿人姓名:</td><td class=\"right\">{0}</td><td class=\"left_m\">身份证号:</td><td class=\"right\">{1}</td></tr>"
              , EModel.AuthorName, EModel.IDCard);
            strHtml.AppendFormat("<tr><td class=\"left\">联系电话:</td><td class=\"right\">{0}</td><td class=\"left_m\">Email:</td><td class=\"right\">{1}</td></tr>"
                , EModel.Mobile, EModel.AuthorModel.LoginName);
            strHtml.AppendFormat("<tr><td class=\"left\">通讯地址:</td><td class=\"right\">{0}</td><td class=\"left_m\">邮政编码:</td><td class=\"right\">{1}</td></tr>"
               , EModel.Address, EModel.ZipCode);
            strHtml.AppendFormat("<tr><td class=\"left\">研究方向:</td><td class=\"right\">{0}</td><td class=\"left_m\">职称:</td><td class=\"right\">{1}</td></tr>"
            , EModel.ResearchTopics, jobTitle);
            strHtml.Append("</table>");
            return strHtml.ToString();
        }
예제 #8
0
 /// <summary>
 /// 获取作者Model
 /// </summary>
 /// <param name="AuthorID"></param>
 /// <returns></returns>
 private AuthorDetailEntity GetModel(Int64 AuthorID)
 {
     AuthorDetailEntity model = null;
     if (AuthorID > 0)
     {
         AuthorDetailQuery query = new AuthorDetailQuery();
         query.JournalID = CurAuthor.JournalID;
         query.AuthorID = AuthorID;
         IAuthorPlatformFacadeService service = ServiceContainer.Instance.Container.Resolve<IAuthorPlatformFacadeService>();
         model = service.GetAuthorDetailModel(query);
     }
     if (model == null)
         model = new AuthorDetailEntity();
     IAuthorFacadeService authorService = ServiceContainer.Instance.Container.Resolve<IAuthorFacadeService>();
     var list = authorService.GetFieldsSet();
     if (list == null)
         list = new List<FieldsSet>();
     list.Insert(0, new FieldsSet { DisplayName = "中文姓名", FieldName = "中文姓名", DBField = "AuthorName", IsShow = true, IsRequire = true });
     model.FieldList = list.Where(p => p.IsShow).ToList();
     if (model.AuthorModel == null)
         model.AuthorModel = new AuthorInfoEntity();
     if (model.ExpertGroupList == null)
         model.ExpertGroupList = new List<ExpertGroupMapEntity>();
     return model;
 }
예제 #9
0
 /// <summary>
 /// 分页获取符合查询条件的数据
 /// </summary>
 /// <param name="authorDetailQuery">AuthorDetailQuery查询实体对象</param>
 /// <returns>Pager<AuthorDetailEntity></returns>
 public Pager<AuthorDetailEntity> GetAuthorDetailPageList(AuthorDetailQuery authorDetailQuery)
 {
     return AuthorDetailBusProvider.GetAuthorDetailPageList(authorDetailQuery);
 }
 /// <summary>
 /// 投稿主页
 /// </summary>
 /// <param name="CID"></param>
 /// <returns></returns>
 public ActionResult Index(Int64 CID = 0)
 {
     var model = GetModelForModify(CID);
     var IsModifyFormat = Request["IsModifyFormat"];
     if( (model.Status > 0) && (model.Status != 100) )
     {
         return base.Content("当前稿件状态下不允许编辑!");
     }
     if (model.Status <= 0 || model.Status == 100)
     {
         if (model.AuthorList == null || model.AuthorList.Count < 1)
         {
             if (CID == 0)
             {
                 var authorModel = GetAuthorDetailModel();
                 if (authorModel.PKID == 0)/// TODO:因为提取用户详情信息时是左联,所以这里用详细信息中的必填项来判断是否设置了详情信息
                 {
                     return Content("为了方便编辑与您联系,请先完善您的个人信息!<a href=\"" + SiteConfig.RootPath + "/AuthorDetail/UpdateSelf/\">设置个人信息</a>");
                 }
                 model.AuthorList = new List<ContributionAuthorEntity>() {
                     new ContributionAuthorEntity() {
                         AuthorName = authorModel.AuthorName,
                         Gender=authorModel.Gender,
                         Birthday=authorModel.Birthday,
                         Nation=authorModel.Nation,
                         NativePlace=authorModel.NativePlace,
                         WorkUnit=authorModel.WorkUnit,
                         Tel=authorModel.Tel,
                         Email=authorModel.Emial,
                         SectionOffice=authorModel.SectionOffice,
                         ZipCode=authorModel.ZipCode,
                         Address=authorModel.Address
                     }
                 };
             }
             else
             {
                 model.AuthorList = new List<ContributionAuthorEntity>() { new ContributionAuthorEntity() { AuthorName = CurAuthor.RealName } };
             }
         }
         if (model.ReferenceList == null || model.ReferenceList.Count < 1)
             model.ReferenceList = new List<ContributionReferenceEntity>() { new ContributionReferenceEntity() };
         if (model.FundList == null || model.FundList.Count < 1)
             model.FundList = new List<ContributionFundEntity>() { new ContributionFundEntity() };
         if (model.AttModel == null)
             model.AttModel = new ContributionInfoAttEntity();
         ViewBag.QQ = SiteConfig.QQ;
         ViewBag.IsModifyFormat = IsModifyFormat;
         if(CurAuthor.JournalID==20130107001)
         {
             AuthorDetailQuery authorDetailQuery = new AuthorDetailQuery();
             authorDetailQuery.JournalID = CurAuthor.JournalID;
             authorDetailQuery.AuthorID = CurAuthor.AuthorID;
             IAuthorPlatformFacadeService AuthorService = ServiceContainer.Instance.Container.Resolve<IAuthorPlatformFacadeService>();
             ViewBag.Province = AuthorService.GetAuthorDetailModel(authorDetailQuery).Province;//获取作者地址以用于学科分类
         }
         return View(model);
     }
     else
     {
         return Content("当前稿件状态下不允许编辑!");
     }
 }
예제 #11
0
 /// <summary>
 /// 设置作者为专家
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public bool SetAuthorExpert(AuthorDetailQuery query)
 {
     bool flag = false;
     try
     {
         DbCommand cmd = db.GetStoredProcCommand("UP_SetAuthorExpert");
         db.AddInParameter(cmd, "@JournalID", DbType.Int64, query.JournalID);
         db.AddInParameter(cmd, "@AuthorIDs", DbType.String, string.Join(",", query.AuthorIDs));
         db.ExecuteNonQuery(cmd);
         flag = true;
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return flag;
 }
예제 #12
0
 public Pager<AuthorDetailEntity> GetAuthorDetailPageList(AuthorDetailQuery query)
 {
     string tableSql = @"SELECT {0} FROM dbo.AuthorDetail a with(nolock)
                       RIGHT JOIN dbo.AuthorInfo b with(nolock) ON a.JournalID=b.JournalID and a.AuthorID=b.AuthorID";
     string where = AuthorDetailQueryToSQLWhere(query);
     if (!string.IsNullOrWhiteSpace(where))
         tableSql += " WHERE " + where;
     string strSql = string.Format(tableSql, "b.AuthorID as bAuthorID,b.JournalID as bJournalID,b.LoginName,b.Pwd,b.RealName,b.LoginIP,b.LoginCount,b.LoginDate,b.Status,b.GroupID,b.AddDate as bAddDate,a.PKID,a.AuthorID,a.AuthorName,a.EnglishName,(case when a.Gender=1 then '男' when a.Gender=0 then '女' end) as Gender,a.Nation,a.Birthday,a.NativePlace,a.Province,a.City,a.Area,a.IDCard,a.Address,a.ZipCode,a.Mobile,a.Tel,a.Fax,a.Education,a.Professional,a.JobTitle,a.Job,a.ResearchTopics,a.WorkUnit,a.WorkUnitLevel,a.SectionOffice,a.InvoiceUnit,a.Mentor,a.Remark,a.AuthorOpus,a.QQ,a.MSN,a.ReserveField,a.ReserveField1,a.ReserveField2,a.ReserveField3,a.ReserveField4,a.ReserveField5,ROW_NUMBER() OVER(ORDER BY " + AuthorDetailQueryToSQLOrder(query) + ") AS ROW_ID")
         , sumStr = string.Format(tableSql, "RecordCount=COUNT(1)");
     return db.GetPageList<AuthorDetailEntity>(string.Format(SQL_Page_Select, strSql, query.StartIndex, query.EndIndex)
         , sumStr
         , query.CurrentPage, query.PageSize
         , (dr, pager) =>
         {
             pager.TotalRecords = TypeParse.ToLong(dr["RecordCount"]);
         }
         , MakeAuthorDetailList);
 }
예제 #13
0
 public List<AuthorDetailEntity> GetAuthorDetailList(AuthorDetailQuery query)
 {
     string strSql = @"SELECT b.AuthorID as bAuthorID,b.JournalID as bJournalID,b.LoginName,b.Pwd,b.RealName,b.LoginIP,b.LoginCount,b.LoginDate,b.Status,b.GroupID,b.AddDate as bAddDate,a.PKID,a.AuthorID,a.AuthorName,a.EnglishName,(case when a.Gender=1 then '男' when a.Gender=0 then '女' end) as Gender,a.Nation,a.Birthday,a.NativePlace,a.Province,a.City,a.Area,a.IDCard,a.Address,a.ZipCode,a.Mobile,a.Tel,a.Fax,a.Education,a.Professional,a.JobTitle,a.Job,a.ResearchTopics,a.WorkUnit,a.WorkUnitLevel,a.SectionOffice,a.InvoiceUnit,a.Mentor,a.Remark,a.AuthorOpus,a.QQ,a.MSN,a.ReserveField,a.ReserveField1,a.ReserveField2,a.ReserveField3,a.ReserveField4,a.ReserveField5 FROM dbo.AuthorDetail a with(nolock)
                       RIGHT JOIN dbo.AuthorInfo b with(nolock) ON a.JournalID=b.JournalID and a.AuthorID=b.AuthorID";
     string where = AuthorDetailQueryToSQLWhere(query);
     if (!string.IsNullOrWhiteSpace(where))
         strSql += " WHERE " + where;
     strSql += " ORDER BY " + AuthorDetailQueryToSQLOrder(query);
     return db.GetList<AuthorDetailEntity>(strSql, MakeAuthorDetailList);
 }
예제 #14
0
        /// <summary>
        /// 将查询实体转换为Where语句
        /// <param name="query">查询实体</param>
        /// <returns>获取Where语句,不包含Where</returns>
        /// </summary>
        public string AuthorDetailQueryToSQLWhere(AuthorDetailQuery query)
        {
            StringBuilder strFilter = new StringBuilder(" b.JournalID=" + query.JournalID);
            if (query.GroupID != null)
            {
                if (query.GroupID.Value == 3)
                {
                    strFilter.Append(@" and (b.GroupID=3 or exists(select 1 from dbo.RoleAuthor m with(nolock)
                                        WHERE b.JournalID=m.JournalID and b.AuthorID=m.AuthorID and m.RoleID=3))");
                }
                else
                {
                    strFilter.Append(" and b.GroupID=").Append(query.GroupID.Value);
                }
            }
            if (query.Status != null)
                strFilter.Append(" and b.Status=").Append(query.Status.Value);
            query.LoginName = query.LoginName.TextFilter();
            if (!string.IsNullOrWhiteSpace(query.LoginName))
                strFilter.AppendFormat(" and b.LoginName like '%{0}%'", query.LoginName);

            query.RealName = query.RealName.TextFilter();
            if (!string.IsNullOrWhiteSpace(query.RealName))
                strFilter.AppendFormat(" and b.RealName like '%{0}%'", query.RealName);

            query.WorkUnit = query.WorkUnit.TextFilter();
            if (!string.IsNullOrWhiteSpace(query.WorkUnit))
                strFilter.AppendFormat(" and a.WorkUnit like '%{0}%'", query.WorkUnit);

            query.Mobile = query.Mobile.TextFilter();
            if (!string.IsNullOrWhiteSpace(query.Mobile))
                strFilter.AppendFormat(" and b.Mobile like '%{0}%'", query.Mobile);

            query.Address = query.Address.TextFilter();
            if (!string.IsNullOrWhiteSpace(query.Address))
                strFilter.AppendFormat(" and a.Address like '%{0}%'", query.Address);

            query.ZipCode = query.ZipCode.TextFilter();
            if (!string.IsNullOrWhiteSpace(query.ZipCode))
                strFilter.AppendFormat(" and a.ZipCode like '%{0}%'", query.ZipCode);

            if (query.AuthorIDs != null && query.AuthorIDs.Length > 0)
            {
                if (query.AuthorIDs.Length == 1)
                {
                    strFilter.Append(" and b.AuthorID=").Append(query.AuthorIDs[0]);
                }
                else
                {
                    strFilter.Append(" and b.AuthorID in (").Append(string.Join(",", query.AuthorIDs)).Append(")");
                }
            }
            return strFilter.ToString();
        }
예제 #15
0
 public ActionResult SetExpert(Int64[] AuthorIDs)
 {
     IAuthorPlatformFacadeService service = ServiceContainer.Instance.Container.Resolve<IAuthorPlatformFacadeService>();
     AuthorDetailQuery query = new AuthorDetailQuery();
     query.JournalID = CurAuthor.JournalID;
     query.AuthorIDs = AuthorIDs;
     ExecResult result = service.SetAuthorExpert(query);
     return Json(new { result = result.result, msg = result.msg });
 }
예제 #16
0
 /// <summary>
 /// 取消作者为专家信息
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public ExecResult CancelAuthorExpert(AuthorDetailQuery query)
 {
     ExecResult result = new ExecResult();
     if (query.AuthorIDs == null)
     {
         result.result = EnumJsonResult.failure.ToString();
         result.msg = "没有选择设置的作者数据!";
         return result;
     }
     bool flag = AuthorDetailBusProvider.CancelAuthorExpert(query);
     if (flag)
     {
         result.result = EnumJsonResult.success.ToString();
         result.msg = "取消设置成功!";
     }
     else
     {
         result.result = EnumJsonResult.success.ToString();
         result.msg = "取消设置失败!";
     }
     return result;
 }
 /// <summary>
 /// 获取作者详细信息实体
 /// </summary>
 /// <param name="loginAuthor"></param>
 /// <returns></returns>
 public AuthorDetailEntity GetAuthorDetailModel(AuthorDetailQuery query)
 {
     HttpClientHelper clientHelper = new HttpClientHelper();
     AuthorDetailEntity model = clientHelper.PostAuth<AuthorDetailEntity, AuthorDetailQuery>(GetAPIUrl(APIConstant.AUTHORDETAIL_GETMODEL), query);
     return model;
 }
예제 #18
0
        /// <summary>
        /// 打印信封
        /// </summary>
        /// <param name="CID"></param>
        /// <returns></returns>
        public ActionResult PrintEnvelope(string AuthorIDStr)
        {
            if (string.IsNullOrWhiteSpace(AuthorIDStr))
            {
                ViewBag.EnvelopeContent = "请选择需要打印的稿件信息";
                return View();
            }

            Int64[] AuthorIDs = AuthorIDStr.Split(',').Where(p => !string.IsNullOrWhiteSpace(p))
                .Select(p => TypeParse.ToLong(p)).ToArray();

            if (AuthorIDs == null || AuthorIDs.Length == 0)
            {
                ViewBag.EnvelopeContent = "请选择需要打印的稿件信息";
                return View();
            }

            //获取模版
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(Utils.GetMapPath(SiteConfig.RootPath + "/data/envelopetemplate.config"));
            XmlNode envelopeNode = xmlDoc.SelectSingleNode("envelope");

            //获取站点信息
            ISiteConfigFacadeService service = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>();
            SiteConfigEntity siteModel = service.GetSiteConfigModel(new SiteConfigQuery() { JournalID = CurAuthor.JournalID });
            if (siteModel == null)
            {
                ViewBag.EnvelopeContent = "请配置站点信息";
                return View();
            }

            //获取数据
            IAuthorPlatformFacadeService authorService = ServiceContainer.Instance.Container.Resolve<IAuthorPlatformFacadeService>();
            AuthorDetailQuery query = new AuthorDetailQuery();
            query.JournalID = CurAuthor.JournalID;
            query.AuthorIDs = AuthorIDs;
            IList<AuthorDetailEntity> list = authorService.GetAuthorDetailList(query);

            if (list == null || list.Count == 0)
            {
                ViewBag.EnvelopeContent = "获取接收人信息失败";
                return View();
            }

            //替换内容
            StringBuilder strHtml = new StringBuilder();
            foreach (var model in list)
            {
                strHtml.Append(envelopeNode.InnerText
                    .Replace("${接收邮编}$", model.ZipCode)
                    .Replace("${接收地址}$", model.Address)
                    .Replace("${接收人}$", model.AuthorModel.RealName)
                    .Replace("${编辑部地址}$", siteModel.Address)
                    .Replace("${站点名称}$", siteModel.Title)
                    .Replace("${编辑部邮编}$", siteModel.ZipCode));
            }

            ViewBag.EnvelopeContent = strHtml.ToString();
            return View();
        }
 /// <summary>
 /// 获取作者详细信息分页数据
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public Pager<AuthorDetailEntity> GetAuthorDetailPageList(AuthorDetailQuery query)
 {
     HttpClientHelper clientHelper = new HttpClientHelper();
     Pager<AuthorDetailEntity> pager = clientHelper.Post<Pager<AuthorDetailEntity>, AuthorDetailQuery>(GetAPIUrl(APIConstant.AUTHORDETAIL_GETPAGELIST), query);
     return pager;
 }
예제 #20
0
 /// <summary>
 /// 取消作者为专家
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public bool CancelAuthorExpert(AuthorDetailQuery query)
 {
     return AuthorDetailDataAccess.Instance.CancelAuthorExpert(query);
 }
 /// <summary>
 /// 设置作者为专家
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public ExecResult SetAuthorExpert(AuthorDetailQuery query)
 {
     HttpClientHelper clientHelper = new HttpClientHelper();
     ExecResult result = clientHelper.Post<ExecResult, AuthorDetailQuery>(GetAPIUrl(APIConstant.AUTHOR_SETEXPERT), query);
     return result;
 }
예제 #22
0
        public ActionResult SendIssueListSelectAuthor(string RecEmail, string Content)
        {
            ISiteConfigFacadeService service = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>();
            MessageRecodeEntity model = new MessageRecodeEntity();
            model.ReciveAddress = RecEmail;
            model.JournalID = CurAuthor.JournalID;
            model.MsgType = 1;
            model.MsgTitle = "《" + SiteConfig.SiteName + "》期刊目录推送";
            model.MsgContent = Content;

            ExecResult result = new ExecResult();
            var strList = RecEmail.Split(',').Where(p => !string.IsNullOrWhiteSpace(p)).ToList();

            IAuthorPlatformFacadeService AuthorService = ServiceContainer.Instance.Container.Resolve<IAuthorPlatformFacadeService>();
            AuthorDetailQuery query = new AuthorDetailQuery();
            query.JournalID = CurAuthor.JournalID;
            query.CurrentPage = 1;
            query.PageSize = 1;

            for (int i = 0; i < strList.Count; i++)
            {
                query.LoginName = strList[i];
                Pager<AuthorDetailEntity> pager = AuthorService.GetAuthorDetailPageList(query);
                if (i == 0)
                    Content = Content.Replace("%Name%", pager.ItemList[0].AuthorName);
                else
                {
                    query.LoginName = strList[i - 1];
                    Pager<AuthorDetailEntity> pagerTemp = AuthorService.GetAuthorDetailPageList(query);
                    Content = Content.Replace(pagerTemp.ItemList[0].AuthorName, pager.ItemList[0].AuthorName);
                }
                service.SendEmail("《" + SiteConfig.SiteName + "》期刊目录推送", Content, strList[i], SiteConfig.SiteName, CurAuthor.JournalID);
            }

            return Json(new { flag = 1 });
        }
 /// <summary>
 /// 删除作者详细信息
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public ExecResult DelAuthorDetail(AuthorDetailQuery query)
 {
     HttpClientHelper clientHelper = new HttpClientHelper();
     ExecResult result = clientHelper.Post<ExecResult, AuthorDetailQuery>(GetAPIUrl(APIConstant.AUTHORDETAIL_DEL), query);
     return result;
 }
 public ExecResult CancelExpert(AuthorDetailQuery query)
 {
     IAuthorDetailService service = ServiceContainer.Instance.Container.Resolve<IAuthorDetailService>();
     return service.CancelAuthorExpert(query);
 }
 /// <summary>
 /// 获取作者详细信息数据
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public IList<AuthorDetailEntity> GetAuthorDetailList(AuthorDetailQuery query)
 {
     HttpClientHelper clientHelper = new HttpClientHelper();
     IList<AuthorDetailEntity> list = clientHelper.Post<IList<AuthorDetailEntity>, AuthorDetailQuery>(GetAPIUrl(APIConstant.AUTHORDETAIL_GETLIST), query);
     return list;
 }
 public IList<AuthorDetailEntity> GetList(AuthorDetailQuery query)
 {
     IAuthorDetailService service = ServiceContainer.Instance.Container.Resolve<IAuthorDetailService>();
     IList<AuthorDetailEntity> list = service.GetAuthorDetailList(query);
     return list;
 }
예제 #27
0
 public ActionResult GetExpertPageList(AuthorDetailQuery query)
 {
     IAuthorPlatformFacadeService service = ServiceContainer.Instance.Container.Resolve<IAuthorPlatformFacadeService>();
     query.JournalID = CurAuthor.JournalID;
     query.CurrentPage = Convert.ToInt32(Request.Params["page"]);
     query.PageSize = Convert.ToInt32(Request.Params["pagesize"]);
     Pager<AuthorDetailEntity> pager = service.GetAuthorDetailPageList(query);
     return Json(new { Rows = pager.ItemList, Total = pager.TotalRecords });
 }
 public Pager<AuthorDetailEntity> GetPageList(AuthorDetailQuery query)
 {
     IAuthorDetailService service = ServiceContainer.Instance.Container.Resolve<IAuthorDetailService>();
     Pager<AuthorDetailEntity> pager = service.GetAuthorDetailPageList(query);
     return pager;
 }
 /// <summary>
 /// 获取作者信息
 /// </summary>
 /// <param name="userList"></param>
 /// <param name="isEmail"></param>
 /// <returns></returns>
 private IDictionary<Int64, string> GetAuthorDcit(IList<Int64> userList, Int64 JournalID, bool isEmail)
 {
     if (isEmail)
     {
         AuthorInfoQuery query = new AuthorInfoQuery();
         query.AuthorIDs = userList.Distinct().ToArray();
         query.JournalID = JournalID;
         query.PageSize = userList.Count;
         query.CurrentPage = 1;
         AuthorFacadeAPIService service = new AuthorFacadeAPIService();
         var list = service.GetAuthorList(query).ItemList;
         if (list == null || list.Count == 0)
             return null;
         return list.Where(p => !string.IsNullOrWhiteSpace(p.LoginName))
             .ToDictionary(p => p.AuthorID, q => q.LoginName);
     }
     else
     {
         AuthorDetailQuery query = new AuthorDetailQuery();
         query.AuthorIDs = userList.Distinct().ToArray();
         query.JournalID = JournalID;
         query.PageSize = userList.Count;
         query.CurrentPage = 1;
         AuthorPlatformFacadeAPIService service = new AuthorPlatformFacadeAPIService();
         var list = service.GetAuthorDetailList(query);
         return list.Where(p => !string.IsNullOrWhiteSpace(p.Mobile))
             .Where(p => p.Mobile.IsMobilePhone())
             .ToDictionary(p => p.AuthorID, q => q.Mobile);
     }
 }