public DoiRegLogEntity GetDoiRegLog(DoiRegLogQuery query) { IIssueService service = ServiceContainer.Instance.Container.Resolve <IIssueService>(); DoiRegLogEntity model = service.GetDoiRegLog(query); return(model); }
public ExecResult SaveDoiRegLog(DoiRegLogEntity model) { ExecResult execResult = new ExecResult(); bool result = false; if (model.isUpdate == true) { result = UpdateDoiRegLog(model); } else { result = AddDoiRegLog(model); } if (result) { execResult.result = EnumJsonResult.success.ToString(); execResult.msg = "保存DOI注册记录成功!"; } else { execResult.result = EnumJsonResult.failure.ToString(); execResult.msg = "注册记录成功失败!"; } return(execResult); }
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 })); }
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 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 ExecResult SaveDoiRegLog(DoiRegLogEntity model) { IIssueService service = ServiceContainer.Instance.Container.Resolve <IIssueService>(); return(service.SaveDoiRegLog(model)); }
public bool UpdateDoiRegLog(DoiRegLogEntity model) { return(IssueBusProvider.UpdateDoiRegLog(model)); }
public bool AddDoiRegLog(DoiRegLogEntity model) { return(IssueBusProvider.AddDoiRegLog(model)); }
/// <summary> /// 编辑DOI注册日志 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool UpdateDoiRegLog(DoiRegLogEntity model) { return(IssueDataAccess.Instance.UpdateDoiRegLog(model)); }