/// <summary> /// 得到投稿自动分配配置 /// </summary> /// <param name="autoAllotQuery"></param> /// <returns></returns> public EditorAutoAllotEntity GetEditorAutoAllot(EditorAutoAllotQuery autoAllotQuery) { EditorAutoAllotEntity editorAutoAllotEntity = null; StringBuilder sqlCommandText = new StringBuilder(); sqlCommandText.Append("SELECT TOP 1 PKID,JournalID,AllotPattern,AuthorID,OddAuthorID,AddDate FROM dbo.EditorAutoAllot WITH(NOLOCK)"); sqlCommandText.Append(" WHERE JournalID=@JournalID"); DbCommand cmd = db.GetSqlStringCommand(sqlCommandText.ToString()); db.AddInParameter(cmd, "@JournalID", DbType.Int64, autoAllotQuery.JournalID); using (IDataReader dr = db.ExecuteReader(cmd)) { editorAutoAllotEntity = MakeEditorAutoAllot(dr); if (editorAutoAllotEntity != null) { // 如果是按照学科分类设置,则取学科分类的明细 if (editorAutoAllotEntity.AllotPattern == 1) { editorAutoAllotEntity.SubjectAuthorMap = new List <SubjectAuthorMapEntity>(); StringBuilder sqlGetSubjectCategoryText = new StringBuilder(); sqlGetSubjectCategoryText.Append("SELECT SubjectCategoryID,AuthorID FROM dbo.SubjectAuthorMap WITH(NOLOCK)"); sqlGetSubjectCategoryText.Append(" WHERE JournalID=@JournalID"); DbCommand cmdGetSubjectCategory = db.GetSqlStringCommand(sqlGetSubjectCategoryText.ToString()); db.AddInParameter(cmdGetSubjectCategory, "@JournalID", DbType.Int64, autoAllotQuery.JournalID); using (IDataReader drSubject = db.ExecuteReader(cmdGetSubjectCategory)) { SubjectAuthorMapEntity subjectMap = null; while (drSubject.Read()) { subjectMap = new SubjectAuthorMapEntity(); subjectMap.SubjectCategoryID = TypeParse.ToInt(drSubject["SubjectCategoryID"]); subjectMap.AuthorID = TypeParse.ToInt(drSubject["AuthorID"]); subjectMap.JournalID = autoAllotQuery.JournalID; editorAutoAllotEntity.SubjectAuthorMap.Add(subjectMap); } drSubject.Close(); } } } dr.Close(); } return(editorAutoAllotEntity); }
/// <summary> /// 得到投稿自动分配的编辑 /// </summary> /// <param name="autoAllotQuery"></param> /// <returns></returns> public AuthorInfoEntity GetAutoAllotEditor(EditorAutoAllotQuery autoAllotQuery) { return(EditorAutoAllotDataAccess.Instance.GetAutoAllotEditor(autoAllotQuery)); }
/// <summary> /// 得到投稿自动分配配置 /// </summary> /// <param name="autoAllotQuery"></param> /// <returns></returns> public EditorAutoAllotEntity GetEditorAutoAllot(EditorAutoAllotQuery autoAllotQuery) { return(EditorAutoAllotDataAccess.Instance.GetEditorAutoAllot(autoAllotQuery)); }
/// <summary> /// 得到投稿自动分配的编辑 /// </summary> /// <param name="autoAllotQuery">指定稿件编号,编辑部ID,学科ID</param> /// <returns></returns> public AuthorInfoEntity GetAutoAllotEditor(EditorAutoAllotQuery autoAllotQuery) { return(EditorAutoAllotBusProvider.GetAutoAllotEditor(autoAllotQuery)); }
/// <summary> /// 得到投稿自动分配配置 /// </summary> /// <param name="autoAllotQuery"></param> /// <returns></returns> public EditorAutoAllotEntity GetEditorAutoAllot(EditorAutoAllotQuery autoAllotQuery) { return(EditorAutoAllotBusProvider.GetEditorAutoAllot(autoAllotQuery)); }