public List <DictValueEntity> GetDictValueList(DictValueQuery query) { List <DictValueEntity> list = new List <DictValueEntity>(); StringBuilder sqlCommandText = new StringBuilder(); sqlCommandText.Append("SELECT DictValueID,JournalID,DictKey,ValueID,ValueText,SortID,InUserID,EditUserID,EditDate,AddDate FROM dbo.DictValue a WITH(NOLOCK)"); string whereSQL = DictValueQueryToSQLWhere(query); string orderBy = DictValueQueryToSQLOrder(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 = MakeDictValueList(dr); } return(list); }
public ActionResult ExpertRenderToExcel(AuthorDetailQuery query, string strDict) { try { IAuthorPlatformFacadeService service = ServiceContainer.Instance.Container.Resolve <IAuthorPlatformFacadeService>(); query.JournalID = CurAuthor.JournalID; query.GroupID = 3; 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(); } } //开始导出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("导出专家信息异常!")); } }
public ExecResult DelDictValue(DictValueQuery query) { ExecResult execResult = new ExecResult(); IDictValueService service = ServiceContainer.Instance.Container.Resolve <IDictValueService>(); Int64[] dictValueIDs = query.DictValueIDs; if (dictValueIDs == null) { execResult.result = EnumJsonResult.failure.ToString(); execResult.msg = "没有删除任何数据!"; return(execResult); } string msg = string.Empty; bool result = service.BatchDeleteDictValue(dictValueIDs); if (result) { execResult.result = EnumJsonResult.success.ToString(); execResult.msg = "删除数据字典成功!"; } else { execResult.result = EnumJsonResult.failure.ToString(); execResult.msg = "删除数据字典失败!"; } return(execResult); }
public DictValueEntity GetDictValueModel(DictValueQuery query) { IDictValueService service = ServiceContainer.Instance.Container.Resolve <IDictValueService>(); DictValueEntity model = service.GetDictValue(query.DictValueID); return(model); }
public Pager <DictValueEntity> GetDictValuePageList(DictValueQuery query) { IDictValueService service = ServiceContainer.Instance.Container.Resolve <IDictValueService>(); Pager <DictValueEntity> pager = service.GetDictValuePageList(query); return(pager); }
/// <summary> /// 分页获取符合查询条件的数据 /// </summary> /// <param name="dictValueQuery">DictValueQuery查询实体对象</param> /// <returns>Pager<DictValueEntity></returns> public Pager <DictValueEntity> GetDictValuePageList(DictValueQuery dictValueQuery) { Pager <DictValueEntity> pager = DictValueBusProvider.GetDictValuePageList(dictValueQuery); if (pager != null) { pager.ItemList = GetDictValueList(pager.ItemList.ToList(), dictValueQuery); } return(pager); }
public ActionResult DeleteDictValue(Int64[] dictValueIDs) { ISiteConfigFacadeService service = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>(); DictValueQuery query = new DictValueQuery(); query.JournalID = CurAuthor.JournalID; query.DictValueIDs = dictValueIDs; ExecResult result = service.DelDictValue(query); return(Json(new { result = result.result, msg = result.msg })); }
public ActionResult GetDictValuePageList(DictValueQuery query) { ISiteConfigFacadeService service = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>(); query.JournalID = CurAuthor.JournalID; query.CurrentPage = Convert.ToInt32(Request.Params["page"]); query.PageSize = Convert.ToInt32(Request.Params["pagesize"]); Pager <DictValueEntity> pager = service.GetDictValuePageList(query); return(Json(new { Rows = pager.ItemList, Total = pager.TotalRecords })); }
public ActionResult GetEnExpertGroupList() { ISiteConfigFacadeService service = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>(); DictValueQuery query = new DictValueQuery(); query.JournalID = JournalID; query.DictKey = EnumDictKey.EnExpertGroupMap.ToString(); query.CurrentPage = 1; query.PageSize = 1000; Pager <DictValueEntity> pager = service.GetDictValuePageList(query); if (pager.ItemList != null && pager.ItemList.Count > 0) { pager.ItemList = pager.ItemList.OrderBy(p => p.ValueID).ToList(); } return(Json(new { Rows = pager.ItemList, Total = pager.TotalRecords })); }
/// <summary> /// 组装数据 /// </summary> /// <param name="list"></param> /// <returns></returns> private List <DictValueEntity> GetDictValueList(List <DictValueEntity> list, DictValueQuery dictValueQuery) { if (list == null || list.Count == 0) { return(list); } AuthorInfoService service = new AuthorInfoService(); AuthorInfoQuery query = new AuthorInfoQuery(); query.JournalID = dictValueQuery.JournalID; var dict = service.AuthorInfoBusProvider.GetAuthorDict(query); foreach (var mode in list) { mode.InUserName = dict.GetValue(mode.InUserID, mode.InUserID.ToString()); } return(list); }
public ActionResult CreateDictValue(Int64 dictValueId = 0) { DictValueEntity model = null; if (dictValueId > 0) { DictValueQuery query = new DictValueQuery(); query.JournalID = CurAuthor.JournalID; query.DictValueID = dictValueId; ISiteConfigFacadeService service = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>(); model = service.GetDictValueModel(query); } if (model == null) { model = new DictValueEntity(); } return(View(model)); }
/// <summary> /// 将查询实体转换为Where语句 /// <param name="query">查询实体</param> /// <returns>获取Where语句,不包含Where</returns> /// </summary> public string DictValueQueryToSQLWhere(DictValueQuery query) { StringBuilder strFilter = new StringBuilder(); strFilter.Append(" 1=1"); if (query.JournalID > 0) { strFilter.AppendFormat(" and a.JournalID={0}", query.JournalID); } if (query.DictID > 0) { strFilter.AppendFormat(" and exists(SELECT 1 FROM dbo.Dict b with(nolock) where a.DictKey=b.DictKey and b.DictID={0})", query.DictID); } if (!string.IsNullOrEmpty(query.DictKey)) { strFilter.AppendFormat(" and a.DictKey='{0}'", SecurityUtils.SafeSqlString(query.DictKey)); } return(strFilter.ToString()); }
public Pager <DictValueEntity> GetDictValuePageList(DictValueQuery query) { string strSql = "SELECT DictValueID,JournalID,DictKey,ValueID,ValueText,SortID,InUserID,EditUserID,EditDate,AddDate,ROW_NUMBER() OVER(ORDER BY DictValueID desc) AS ROW_ID FROM dbo.DictValue a with(nolock)", sumStr = "SELECT RecordCount=COUNT(1) FROM dbo.DictValue a with(nolock)"; string whereSQL = DictValueQueryToSQLWhere(query); if (!string.IsNullOrWhiteSpace(whereSQL)) { strSql += " WHERE " + whereSQL; sumStr += " WHERE " + whereSQL; } return(db.GetPageList <DictValueEntity>(string.Format(SQL_Page_Select, strSql, query.StartIndex, query.EndIndex) , sumStr , query.CurrentPage, query.PageSize , (dr, pager) => { pager.TotalRecords = TypeParse.ToLong(dr["RecordCount"]); } , MakeDictValueList)); }
/// <summary> /// 将查询实体转换为Order语句 /// <param name="query">查询实体</param> /// <returns>获取Order语句,不包含Order</returns> /// </summary> public string DictValueQueryToSQLOrder(DictValueQuery query) { return(" SortID ASC,DictValueID DESC"); }
public IDictionary <int, string> GetDictValueDcit(DictValueQuery query) { IDictValueService service = ServiceContainer.Instance.Container.Resolve <IDictValueService>(); return(service.GetDictValueDcit(query.JournalID, query.DictKey)); }
public ActionResult Index() { string url = Request.QueryString["url"]; ViewBag.RETURL = url; ViewBag.IsShowMoreRole = false; if (CurAuthor != null) { if (CurAuthor.RoleIDList != null) { if (CurAuthor.GroupID == (Byte)EnumMemberGroup.Editor && CurAuthor.RoleIDList.Count > 1) { ViewBag.RoleList = SelectRole("selRoleList", "65px;"); ViewBag.IsShowMoreRole = true; } if (CurAuthor.GroupID == (Byte)EnumMemberGroup.Expert && CurAuthor.RoleIDList.Count > 1) { ViewBag.RoleList = SelectExpertRole("selRoleList", "80px;"); ViewBag.IsShowMoreRole = true; } if (CurAuthor.GroupID == (Byte)EnumMemberGroup.Author && CurAuthor.RoleIDList.Count > 1) { ViewBag.RoleList = SelectAuthorRole("selRoleList", "80px;"); ViewBag.IsShowMoreRole = true; } } ViewBag.Group = CurAuthor.GroupID; ViewBag.Author = CurAuthor.AuthorID; ISiteConfigFacadeService service = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>(); DictValueQuery query = new DictValueQuery(); query.JournalID = SiteConfig.SiteID; query.DictKey = "NotAccessSearch"; IDictionary <int, string> dict = service.GetDictValueDcit(query); if (dict != null && dict.Count > 0) { foreach (var item in dict) { if (item.Value == CurAuthor.AuthorID.ToString()) { ViewBag.IsShowSearch = false; break; } else { ViewBag.IsShowSearch = true; } } } } //ISiteConfigFacadeService facadeService = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>(); //DictValueQuery dictQuery = new DictValueQuery(); //dictQuery.JournalID = JournalID; //dictQuery.DictKey = "NotAccessSearch"; //IList<DictValueEntity> dictList = facadeService.GetDictValueList(dictQuery); //文海峰 2014-1-8 IFlowFacadeService siteConfigService = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>(); IList <FlowStatusEntity> flowStatuslist = siteConfigService.GetFlowStatusList(new FlowStatusQuery() { JournalID = JournalID }); ViewBag.flowStatuslist = flowStatuslist; return(View()); }
public IList <DictValueEntity> GetDictValueList(DictValueQuery query) { IDictValueService service = ServiceContainer.Instance.Container.Resolve <IDictValueService>(); return(service.GetDictValueList(query)); }
/// <summary> /// 分页获取符合查询条件的数据 /// </summary> /// <param name="dictValueQuery">DictValueQuery查询实体对象</param> /// <returns>Pager<DictValueEntity></returns> public Pager <DictValueEntity> GetDictValuePageList(DictValueQuery dictValueQuery) { return(DictValueDataAccess.Instance.GetDictValuePageList(dictValueQuery)); }
/// <summary> /// 获取所有符合查询条件的数据 /// </summary> /// <param name="dictValueQuery">DictValueQuery查询实体对象</param> /// <returns>List<DictValueEntity></returns> public List <DictValueEntity> GetDictValueList(DictValueQuery dictValueQuery) { return(GetDictValueList(DictValueBusProvider.GetDictValueList(dictValueQuery), dictValueQuery)); }
/// <summary> /// 保存审稿单 /// </summary> /// <param name="list"></param> /// <returns></returns> public ExecResult SaveReviewBillContent(ReviewBillContentQuery query) { ExecResult execResult = new ExecResult(); List <ReviewBillContentEntity> list = new List <ReviewBillContentEntity>(); bool result = true; if (query.list != null && query.list.Count > 0) { list = query.list.ToList(); if (list == null || list.Count == 0) { execResult.result = EnumJsonResult.failure.ToString(); execResult.msg = "没有需要保存的数据!"; } foreach (var item in list) { item.JournalID = query.JournalID; item.AddUser = query.AddUser.Value; } ReviewBillService service = new ReviewBillService(); var billList = service.GetReviewBillList(new ReviewBillQuery() { JournalID = query.JournalID, PItemID = 0 }); ReviewBillContentEntity model = null; foreach (var item in billList) { if (list.Find(p => p.ItemID == item.ItemID) != null) { continue; } model = new ReviewBillContentEntity(); model.ItemContentID = 0; model.JournalID = query.JournalID; model.AddUser = query.AddUser.Value; model.CID = list[0].CID; model.ItemID = item.ItemID; model.ContentValue = string.Empty; model.IsChecked = false; list.Add(model); } result = ReviewBillContentBusProvider.SaveReviewBillContent(list); } if (result) { FlowCirculationBusiness business = new FlowCirculationBusiness(); CirculationEntity item = new CirculationEntity(); item.CID = query.CID == null ? 0 : query.CID.Value; item.AuthorID = query.AddUser.Value; item.JournalID = query.JournalID; if (query.IsEnExpert == true) { if (query.IsReReview == true) { item.EnumCStatus = EnumContributionStatus.ReAuditedEn; } else { item.EnumCStatus = EnumContributionStatus.AuditedEn; } } else { if (query.IsReReview == true) { item.EnumCStatus = EnumContributionStatus.ReAudited; } else { item.EnumCStatus = EnumContributionStatus.Audited; } } item.DealAdvice = WKT.Common.Security.SecurityUtils.SafeSqlString(query.DealAdvice); item.CPath = query.PathUrl; item.CFileName = query.CFileName; item.OtherPath = query.OtherPath; item.FigurePath = query.figurePath; item.FFileName = query.FFileName; item.IsHaveBill = 1; //专家审回到固定编辑设置 DictValueBusiness siteConfigBusiness = new DictValueBusiness(); DictValueQuery DictQuery = new DictValueQuery(); IDictionary <int, string> dict = siteConfigBusiness.GetDictValueDcit(query.JournalID, "ExpertToEditor"); if (dict != null && dict.Count > 0) { foreach (var dictItem in dict) { item.IsExpertToEditor = true; item.RecUserID = Convert.ToInt64(dictItem.Value); } } if (business.AuthorContribution(item)) { execResult.result = EnumJsonResult.success.ToString(); execResult.msg = "保存审稿单成功!"; } else { execResult.result = EnumJsonResult.success.ToString(); execResult.msg = "保存审核信息失败!"; } } else { execResult.result = EnumJsonResult.failure.ToString(); execResult.msg = "保存审稿单失败!"; } return(execResult); }