public List <SiteConfigEntity> GetSiteConfigList(SiteConfigQuery query) { List <SiteConfigEntity> list = new List <SiteConfigEntity>(); StringBuilder sqlCommandText = new StringBuilder(); sqlCommandText.Append("SELECT * FROM dbo.SiteConfig WITH(NOLOCK)"); string whereSQL = SiteConfigQueryToSQLWhere(query); string orderBy = SiteConfigQueryToSQLOrder(query); if (!string.IsNullOrEmpty(whereSQL)) { sqlCommandText.Append(" WHERE " + whereSQL); } if (!string.IsNullOrEmpty(orderBy)) { sqlCommandText.Append(" ORDER BY " + orderBy); } DbCommand cmd = db.GetSqlStringCommand(sqlCommandText.ToString()); using (IDataReader dr = db.ExecuteReader(cmd)) { list = MakeSiteConfigList(dr); } return(list); }
public ActionResult Index() { //获取配置信息 DataTable GlobalSetDT = GetSiteSetCfg.GetSiteGlobalSet(CurAuthor.JournalID.ToString()); DataTable PersonalSetDT = GetSiteSetCfg.GetSitePersonalSet(CurAuthor.JournalID.ToString(), CurAuthor.AuthorID.ToString()); //获取基本信息 SiteConfigQuery query = new SiteConfigQuery(); query.JournalID = CurAuthor.JournalID; ISiteConfigFacadeService service = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>(); SiteConfigEntity model = service.GetSiteConfigModel(query); if (model == null) { model = new SiteConfigEntity(); } ViewBag.AuthorID = CurAuthor.AuthorID; ViewBag.IsShowPwdInput = CurAuthor.LoginName == GlobalSetDT.Rows[0]["SysSuperAdmin"].ToString() ? 1 : 0;//是否显示password类型的输入框中的内容 ViewBag.IsEnableRegActivate = GlobalSetDT.Rows[0]["IsEnableRegActivate"].ToString(); ViewBag.IsHideEditorInfoForAuthor = GlobalSetDT.Rows[0]["IsHideEditorInfoForAuthor"].ToString(); ViewBag.IsHideEditorInfoForExpert = GlobalSetDT.Rows[0]["IsHideEditorInfoForExpert"].ToString(); ViewBag.ShowNameForHide = GlobalSetDT.Rows[0]["ShowNameForHide"].ToString(); ViewBag.IsStopNotLoginDownPDF = GlobalSetDT.Rows[0]["IsStopNotLoginDownPDF"].ToString(); ViewBag.ShowMoreFlowInfoForAuthor = GlobalSetDT.Rows[0]["ShowMoreFlowInfoForAuthor"].ToString(); ViewBag.ShowHistoryFlowInfoForExpert = GlobalSetDT.Rows[0]["ShowHistoryFlowInfoForExpert"].ToString(); ViewBag.isAutoHandle = GlobalSetDT.Rows[0]["isAutoHandle"].ToString(); ViewBag.isStatByGroup = GlobalSetDT.Rows[0]["isStatByGroup"].ToString(); ViewBag.Personal_Order = PersonalSetDT.Rows[0]["Personal_Order"].ToString(); ViewBag.Personal_OnlyMySearch = PersonalSetDT.Rows[0]["Personal_OnlyMySearch"].ToString(); return(View(model)); }
public SiteConfigEntity GetSiteConfigModel(SiteConfigQuery query) { SiteConfigEntity model = null; ISiteConfigService service = ServiceContainer.Instance.Container.Resolve <ISiteConfigService>(); model = service.GetSiteConfig(query); return(model); }
private SiteConfigEntity GetSiteConfig() { ISiteConfigFacadeService service = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>(); SiteConfigQuery query = new SiteConfigQuery(); query.JournalID = CurAuthor.JournalID; return(service.GetSiteConfigModel(query)); }
public ActionResult UpdateLocalDataAjax(Int64 PKID) { //获取站点配置信息 SiteConfigQuery sitequery = new SiteConfigQuery(); sitequery.JournalID = CurAuthor.JournalID; ISiteConfigFacadeService siteservice = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>(); SiteConfigEntity model = siteservice.GetSiteConfigModel(sitequery); //获取DOI注册日志实体 IIssueFacadeService service = ServiceContainer.Instance.Container.Resolve <IIssueFacadeService>(); DoiRegLogQuery query = new DoiRegLogQuery(); query.PKID = PKID; query.JournalID = CurAuthor.JournalID; string DoiFileName = service.GetDoiRegLog(query).DoiFileName.Trim(); //保存DOI注册结果 DoiRegResultFilePath = System.DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss-fff") + ".xml"; WKT.Common.Utils.DoiUtils.GetDoiRegResult(DoiFileName, model.DoiUserName, model.DoiUserPwd, Utils.GetMapPath(SiteConfig.RootPath + "/data/" + DoiRegResultFilePath)); XElement root = XElement.Load(Utils.GetMapPath(SiteConfig.RootPath + "/data/" + DoiRegResultFilePath), LoadOptions.SetLineInfo); XElement journal = root.Element("body").Element("journal"); var Articles = from Article in journal.Elements("journal_article") select Article; foreach (var Article in Articles) { string doi = Article.Element("doi_data").Element("doi").Value; string resource = Article.Element("doi_data").Element("resource").Value; Int64 ContentID = Convert.ToInt64(resource.Substring(resource.LastIndexOf('=') + 1, resource.Length - resource.LastIndexOf('=') - 4)); IIssueFacadeService IssueService = ServiceContainer.Instance.Container.Resolve <IIssueFacadeService>(); IssueContentEntity issueContentEntity = new IssueContentEntity(); //获取期刊实体 IssueContentQuery IssueQuery = new IssueContentQuery(); IssueQuery.JournalID = CurAuthor.JournalID; IssueQuery.contentID = ContentID; IssueQuery.IsAuxiliary = true; issueContentEntity = IssueService.GetIssueContentModel(IssueQuery); //更新期刊DOI数据 issueContentEntity.DOI = doi; issueContentEntity.isRegDoi = true; ExecResult result = IssueService.SaveIssueContent(issueContentEntity); } //更新DOI注册日志 DoiRegLogEntity doiRegLogEntity = new DoiRegLogEntity(); doiRegLogEntity.State = "已更新"; doiRegLogEntity.PKID = PKID; doiRegLogEntity.isUpdate = true; service.SaveDoiRegLog(doiRegLogEntity); //删除临时文件 System.IO.File.Delete(Utils.GetMapPath(SiteConfig.RootPath + "/data/" + DoiRegResultFilePath)); return(Json(new { flag = 1 })); }
/// <summary> /// 获取站点配置实体 /// </summary> /// <param name="query"></param> /// <returns></returns> public SiteConfigEntity GetSiteConfig(SiteConfigQuery query) { string strSql = "SELECT TOP 1 * FROM dbo.SiteConfig WITH(NOLOCK)"; strSql += string.Format(" WHERE JournalID={0}", query.JournalID); DbCommand cmd = db.GetSqlStringCommand(strSql); using (IDataReader dr = db.ExecuteReader(cmd)) { return(MakeSiteConfig(dr)); } }
public ActionResult IssueDoiRegQueryAjax(Int64[] ContentIDs) { //获取期刊详细数据 IIssueFacadeService service = ServiceContainer.Instance.Container.Resolve <IIssueFacadeService>(); IssueContentQuery query = new IssueContentQuery(); query.JournalID = CurAuthor.JournalID; query.contentIDs = ContentIDs; query.CurrentPage = 1; query.PageSize = 50; query.SortName = " EditDate "; query.SortOrder = " DESC "; IList <IssueContentEntity> list = service.GetIssueContentList(query); //获取站点配置信息 SiteConfigQuery sitequery = new SiteConfigQuery(); sitequery.JournalID = CurAuthor.JournalID; ISiteConfigFacadeService siteservice = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>(); SiteConfigEntity model = siteservice.GetSiteConfigModel(sitequery); //生成注册用XML文件 CreateDoiRegFilePath = System.DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss-fff") + ".xml"; WKT.Common.Utils.DoiUtils.CreateDoiRegisterFile(Utils.GetMapPath(SiteConfig.RootPath + "/data/DoiRegister.xml"), Utils.GetMapPath(SiteConfig.RootPath + "/data/" + CreateDoiRegFilePath), model.DoiJournalID, model.DoiPrefix, model.Title, model.EnTitle, model.ISSN, model.CN, list[0].Year, list[0].Volume, list[0].Issue, list, model.Home); //上传注册用XML文件到中文DOI网站 string ReturnXMLFile = WKT.Common.Utils.DoiUtils.Upload(Utils.GetMapPath(SiteConfig.RootPath + "/data/" + CreateDoiRegFilePath), model.DoiUserName, model.DoiUserPwd, 3); //获取DOI注册结果 string DoiRegResult = WKT.Common.Utils.DoiUtils.GetDoiRegResult(ReturnXMLFile, model.DoiUserName, model.DoiUserPwd); //保存DOI注册日志 DoiRegLogEntity doiRegLogEntity = new DoiRegLogEntity(); doiRegLogEntity.JournalID = CurAuthor.JournalID; doiRegLogEntity.DoiFileName = ReturnXMLFile; doiRegLogEntity.State = DoiRegResult; doiRegLogEntity.Year = list[0].Year;; doiRegLogEntity.Issue = list[0].Issue;; doiRegLogEntity.AdminID = CurAuthor.AuthorID; if (service.SaveDoiRegLog(doiRegLogEntity).result == "success") { //删除生成的XML注册文件 System.IO.File.Delete(Utils.GetMapPath(SiteConfig.RootPath + "/data/" + CreateDoiRegFilePath)); return(Json(new { flag = 1 })); } else { return(Json(new { flag = 0 })); } }
public ActionResult Index() { SiteConfigQuery query = new SiteConfigQuery(); query.JournalID = CurAuthor.JournalID; ISiteConfigFacadeService service = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>(); SiteConfigEntity model = service.GetSiteConfigModel(query); if (model == null) { model = new SiteConfigEntity(); } ViewBag.AuthorID = CurAuthor.AuthorID; return(View(model)); }
//信封导出打印 public ActionResult LetterPrint() { //获取站点配置信息 SiteConfigQuery query = new SiteConfigQuery(); query.JournalID = CurAuthor.JournalID; ISiteConfigFacadeService service = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>(); SiteConfigEntity model = service.GetSiteConfigModel(query); if (model == null) { model = new SiteConfigEntity(); } return(View(model)); }
public ActionResult ReCheckDoiStateAjax(Int64 PKID) { //获取站点配置信息 SiteConfigQuery sitequery = new SiteConfigQuery(); sitequery.JournalID = CurAuthor.JournalID; ISiteConfigFacadeService siteservice = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>(); SiteConfigEntity model = siteservice.GetSiteConfigModel(sitequery); //获取DOI注册日志实体 IIssueFacadeService service = ServiceContainer.Instance.Container.Resolve <IIssueFacadeService>(); DoiRegLogQuery query = new DoiRegLogQuery(); query.PKID = PKID; query.JournalID = CurAuthor.JournalID; string DoiFileName = service.GetDoiRegLog(query).DoiFileName.Trim(); //CreateDoiRegFilePath = Utils.GetMapPath(SiteConfig.RootPath + "/data/" + DoiFileName); string DoiRegResult = WKT.Common.Utils.DoiUtils.GetDoiRegResult(DoiFileName, model.DoiUserName, model.DoiUserPwd); if (DoiRegResult == "已完成") { DoiRegLogEntity doiRegLogEntity = new DoiRegLogEntity(); doiRegLogEntity.State = "已完成"; doiRegLogEntity.PKID = PKID; doiRegLogEntity.isUpdate = true; service.SaveDoiRegLog(doiRegLogEntity); return(Json(new { flag = 1 })); } if (DoiRegResult == "不合格") { DoiRegLogEntity doiRegLogEntity = new DoiRegLogEntity(); doiRegLogEntity.State = "不合格"; doiRegLogEntity.PKID = PKID; doiRegLogEntity.isUpdate = true; service.SaveDoiRegLog(doiRegLogEntity); return(Json(new { flag = 1 })); } if (DoiRegResult == "未审核") { return(Json(new { flag = -1 })); } else { return(Json(new { flag = 0 })); } }
public Pager <SiteConfigEntity> GetSiteConfigPageList(SiteConfigQuery query) { int recordCount = 0; string whereSQL = SiteConfigQueryToSQLWhere(query); string orderBy = SiteConfigQueryToSQLOrder(query); DataSet ds = db.GetPagingData("SiteConfig", "SiteConfigID,JournalID,Title,EnTitle,CN,ISSN,Home,Keywords,Description,ICPCode,ZipCode,Address,SendMail,MailServer,MailPort,MailAccount,MailPwd,MailIsSSL,SMSUserName,SMSPwd,DoiUserName,DoiUserPwd,DoiJournalID,DoiPrefix,InUserID,EditUserID,EditDate,AddDate,EBankType,EBankAccount,EBankCode,EBankEncryKey", orderBy, whereSQL, query.CurrentPage, query.PageSize, out recordCount); Pager <SiteConfigEntity> pager = new Pager <SiteConfigEntity>(); if (ds != null && ds.Tables.Count > 0) { pager.ItemList = MakeSiteConfigList(ds.Tables[0]); } pager.CurrentPage = query.CurrentPage; pager.PageSize = query.PageSize; pager.TotalRecords = recordCount; return(pager); }
/// <summary> /// 获取总访问量数 /// </summary> /// <param name="helper"></param> /// <returns></returns> public static int GetAllHits(this HtmlHelper helper) { int totalCount = 0; try { ISiteConfigFacadeService service = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>(); SiteConfigQuery query = new SiteConfigQuery(); query.JournalID = GetJournalID(); totalCount = service.GetSiteAccessCount(query); } catch (Exception ex) { WKT.Log.LogProvider.Instance.Error("获取访问量总数出现异常:" + ex.Message); } return(totalCount); }
/// <summary> /// 更新总访问数 /// </summary> /// <param name="query"></param> /// <returns></returns> public bool UpdateSiteAccessCount(SiteConfigQuery query) { bool flag = false; try { string strSql = "UPDATE dbo.SiteConfig SET Hits=Hits+1"; strSql += string.Format(" WHERE JournalID={0}", query.JournalID); DbCommand cmd = db.GetSqlStringCommand(strSql); db.ExecuteNonQuery(cmd); } catch (SqlException ex) { throw ex; } return(flag); }
/// <summary> /// 获取总访问数 /// </summary> /// <param name="query"></param> /// <returns></returns> public int GetSiteAccessCount(SiteConfigQuery query) { int totalAccessCount = 0; string strSql = "SELECT TOP 1 Hits FROM dbo.SiteConfig WITH(NOLOCK)"; strSql += string.Format(" WHERE JournalID={0}", query.JournalID); DbCommand cmd = db.GetSqlStringCommand(strSql); using (IDataReader dr = db.ExecuteReader(cmd)) { if (dr.Read()) { totalAccessCount = WKT.Common.Utils.TypeParse.ToInt(dr["Hits"]); } dr.Close(); } return(totalAccessCount); }
/// <summary> /// 获取站点配置实体 /// </summary> /// <param name="query"></param> /// <returns></returns> public SiteConfigEntity GetSiteConfig(SiteConfigQuery query) { return(SiteConfigDataAccess.Instance.GetSiteConfig(query)); }
public int GetSiteAccessCount(SiteConfigQuery query) { ISiteConfigService service = ServiceContainer.Instance.Container.Resolve <ISiteConfigService>(); return(service.GetSiteAccessCount(query)); }
/// <summary> /// 将查询实体转换为Where语句 /// <param name="query">查询实体</param> /// <returns>获取Where语句,不包含Where</returns> /// </summary> public string SiteConfigQueryToSQLWhere(SiteConfigQuery query) { return(string.Empty); }
/// <summary> /// 将查询实体转换为Order语句 /// <param name="query">查询实体</param> /// <returns>获取Order语句,不包含Order</returns> /// </summary> public string SiteConfigQueryToSQLOrder(SiteConfigQuery query) { return(" SiteConfigID DESC"); }
/// <summary> /// 获取总访问数 /// </summary> /// <param name="query"></param> /// <returns></returns> public int GetSiteAccessCount(SiteConfigQuery query) { return(SiteConfigBusProvider.GetSiteAccessCount(query)); }
/// <summary> /// 获取站点配置实体 /// </summary> /// <param name="query"></param> /// <returns></returns> public SiteConfigEntity GetSiteConfig(SiteConfigQuery query) { return(SiteConfigBusProvider.GetSiteConfig(query)); }
/// <summary> /// 分页获取符合查询条件的数据 /// </summary> /// <param name="siteConfigQuery">SiteConfigQuery查询实体对象</param> /// <returns>Pager<SiteConfigEntity></returns> public Pager <SiteConfigEntity> GetSiteConfigPageList(SiteConfigQuery siteConfigQuery) { return(SiteConfigBusProvider.GetSiteConfigPageList(siteConfigQuery)); }
/// <summary> /// 更新总访问数 /// </summary> /// <param name="query"></param> /// <returns></returns> public bool UpdateSiteAccessCount(SiteConfigQuery query) { return(SiteConfigDataAccess.Instance.UpdateSiteAccessCount(query)); }
/// <summary> /// 更新总访问数 /// </summary> /// <param name="query"></param> /// <returns></returns> public bool UpdateSiteAccessCount(SiteConfigQuery query) { return(SiteConfigBusProvider.UpdateSiteAccessCount(query)); }
/// <summary> /// 获取总访问数 /// </summary> /// <param name="query"></param> /// <returns></returns> public int GetSiteAccessCount(SiteConfigQuery query) { return(SiteConfigDataAccess.Instance.GetSiteAccessCount(query)); }
/// <summary> /// 获取所有符合查询条件的数据 /// </summary> /// <param name="siteConfigQuery">SiteConfigQuery查询实体对象</param> /// <returns>List<SiteConfigEntity></returns> public List <SiteConfigEntity> GetSiteConfigList(SiteConfigQuery siteConfigQuery) { return(SiteConfigBusProvider.GetSiteConfigList(siteConfigQuery)); }
/// <summary> /// 分页获取符合查询条件的数据 /// </summary> /// <param name="siteConfigQuery">SiteConfigQuery查询实体对象</param> /// <returns>Pager<SiteConfigEntity></returns> public Pager <SiteConfigEntity> GetSiteConfigPageList(SiteConfigQuery siteConfigQuery) { return(SiteConfigDataAccess.Instance.GetSiteConfigPageList(siteConfigQuery)); }