Пример #1
0
        /// <summary>
        /// 新增DOI注册日志
        /// </summary>
        /// <param name="doiRegLogEntity"></param>
        /// <returns></returns>
        public bool AddDoiRegLog(DoiRegLogEntity doiRegLogEntity)
        {
            bool flag = false;
            StringBuilder sqlCommandText = new StringBuilder();
            sqlCommandText.Append(" @JournalID");
            sqlCommandText.Append(", @DoiFileName");
            sqlCommandText.Append(", @State");
            sqlCommandText.Append(", @Year");
            sqlCommandText.Append(", @Issue");
            sqlCommandText.Append(", @AdminID");

            DbCommand cmd = db.GetSqlStringCommand(String.Format("INSERT INTO dbo.DoiRegLog ({0},AddDate) VALUES ({1},getdate())", sqlCommandText.ToString().Replace("@", ""), sqlCommandText.ToString()));

            db.AddInParameter(cmd, "@JournalID", DbType.Int64, doiRegLogEntity.JournalID);
            db.AddInParameter(cmd, "@DoiFileName", DbType.String, doiRegLogEntity.DoiFileName);
            db.AddInParameter(cmd, "@State", DbType.String, doiRegLogEntity.State);
            db.AddInParameter(cmd, "@Year", DbType.Int32, doiRegLogEntity.Year);
            db.AddInParameter(cmd, "@Issue", DbType.Int32, doiRegLogEntity.Issue);
            db.AddInParameter(cmd, "@AdminID", DbType.Int64, doiRegLogEntity.AdminID);

            try
            {
                db.ExecuteNonQuery(cmd);
                flag = true;
            }
            catch (SqlException sqlEx)
            {
                throw sqlEx;
            }
            return flag;
        }
Пример #2
0
 public ExecResult SaveDoiRegLog(DoiRegLogEntity model)
 {
     IIssueService service = ServiceContainer.Instance.Container.Resolve<IIssueService>();
     return service.SaveDoiRegLog(model);
 }
Пример #3
0
        public bool UpdateDoiRegLog(DoiRegLogEntity doiRegLogEntity)
        {
            bool flag = false;
            StringBuilder whereCommandText = new StringBuilder();
            whereCommandText.Append(" PKID=@PKID");
            StringBuilder sqlCommandText = new StringBuilder();
            sqlCommandText.Append(" State=@State");
            DbCommand cmd = db.GetSqlStringCommand(String.Format("UPDATE dbo.DoiRegLog SET {0} WHERE  {1}", sqlCommandText.ToString(), whereCommandText.ToString()));
            db.AddInParameter(cmd, "@PKID", DbType.Int64, doiRegLogEntity.PKID);
            db.AddInParameter(cmd, "@State", DbType.String, doiRegLogEntity.State);

            try
            {
                db.ExecuteNonQuery(cmd);
                flag = true;
            }
            catch (SqlException sqlEx)
            {
                throw sqlEx;
            }
            return flag;
        }
Пример #4
0
 private DoiRegLogEntity MakeDoiRegLog(IDataReader dr)
 {
     DoiRegLogEntity model = new DoiRegLogEntity();
     model.PKID = (Int64)dr["PKID"];
     model.JournalID = (Int64)dr["JournalID"];
     model.DoiFileName = dr["DoiFileName"] == System.DBNull.Value ? "" : (String)dr["DoiFileName"];
     model.State = dr["State"] == System.DBNull.Value ? "" : (String)dr["State"];
     model.Year = (Int32)dr["Year"];
     model.Issue = (Int32)dr["Issue"];
     model.AdminID = (Int64)dr["AdminID"];
     model.AddDate = (DateTime)dr["AddDate"];
     return model;
 }
Пример #5
0
 //新增DOI注册日志
 public bool AddDoiRegLog(DoiRegLogEntity model)
 {
     return IssueDataAccess.Instance.AddDoiRegLog(model);
 }
Пример #6
0
 /// <summary>
 /// 编辑DOI注册日志
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool UpdateDoiRegLog(DoiRegLogEntity model)
 {
     return IssueDataAccess.Instance.UpdateDoiRegLog(model);
 }
Пример #7
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 });
        }
Пример #8
0
        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 });
        }
Пример #9
0
        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 });
        }
Пример #10
0
 public ExecResult SaveDoiRegLog(DoiRegLogEntity model)
 {
     HttpClientHelper clientHelper = new HttpClientHelper();
     ExecResult result = clientHelper.Post<ExecResult, DoiRegLogEntity>(GetAPIUrl(APIConstant.DOIREGLOG_SAVEDOIREGLOG), model);
     return result;
 }
Пример #11
0
 public bool UpdateDoiRegLog(DoiRegLogEntity model)
 {
     return IssueBusProvider.UpdateDoiRegLog(model);
 }
Пример #12
0
 public bool AddDoiRegLog(DoiRegLogEntity model)
 {
     return IssueBusProvider.AddDoiRegLog(model);
 }
Пример #13
0
 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;
 }