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 ActionResult AuthorRenderToExcel(AuthorDetailQuery query, string strDict) { try { IAuthorPlatformFacadeService service = ServiceContainer.Instance.Container.Resolve<IAuthorPlatformFacadeService>(); query.JournalID = CurAuthor.JournalID; query.GroupID = 2; query.OrderStr = "AddDate DESC"; 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(); } } //移除字段 dict.Remove("Education"); dict.Remove("JobTitle"); //开始导出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 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 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); }
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(); }
/// <summary> /// 获取所有符合查询条件的数据 /// </summary> /// <param name="dictValueQuery">DictValueQuery查询实体对象</param> /// <returns>List<DictValueEntity></returns> public List<DictValueEntity> GetDictValueList(DictValueQuery dictValueQuery) { return DictValueDataAccess.Instance.GetDictValueList(dictValueQuery); }
/// <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 IList<DictValueEntity> GetDictValueList(DictValueQuery query) { HttpClientHelper clientHelper = new HttpClientHelper(); IList<DictValueEntity> result = clientHelper.Post<IList<DictValueEntity>, DictValueQuery>(GetAPIUrl(APIConstant.DICTVALUE_DICTLIST), query); return result; }
public DictValueEntity GetDictValueModel(DictValueQuery query) { IDictValueService service = ServiceContainer.Instance.Container.Resolve<IDictValueService>(); DictValueEntity model = service.GetDictValue(query.DictValueID); return model; }
public ActionResult GetExpertGroupList() { ISiteConfigFacadeService service = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>(); DictValueQuery query=new DictValueQuery(); query.JournalID=JournalID; query.DictKey=EnumDictKey.ExpertGroupMap.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 }); }
public EditorAutoAllotEntity GetContributeAutoAllotInfo(EditorAutoAllotQuery query) { try { IEditorAutoAllotService cSetService = ServiceContainer.Instance.Container.Resolve<IEditorAutoAllotService>(); EditorAutoAllotEntity cSetEntity = cSetService.GetEditorAutoAllot(query); if (cSetEntity == null) { cSetEntity = new EditorAutoAllotEntity(); cSetEntity.SubjectAuthorMap = new List<SubjectAuthorMapEntity>(); } else { if (cSetEntity.SubjectAuthorMap == null) { cSetEntity.SubjectAuthorMap = new List<SubjectAuthorMapEntity>(); } } if (cSetEntity.SubjectAuthorMap.Count == 0) { # region 获取学科分类 IDictValueService service = ServiceContainer.Instance.Container.Resolve<IDictValueService>(); DictValueQuery dictQuery = new DictValueQuery(); dictQuery.JournalID = query.JournalID; dictQuery.DictKey = EnumDictKey.SubjectCat.ToString(); List<DictValueEntity> listDictValue = service.GetDictValueList(dictQuery); SubjectAuthorMapEntity subjectItem = null; foreach (DictValueEntity item in listDictValue) { subjectItem = new SubjectAuthorMapEntity(); subjectItem.SubjectCategoryID = item.ValueID; subjectItem.CategoryName = item.ValueText; subjectItem.AuthorID = 0; cSetEntity.SubjectAuthorMap.Add(subjectItem); } # endregion } else { IDictValueService service = ServiceContainer.Instance.Container.Resolve<IDictValueService>(); IDictionary<int, string> dictValues = service.GetDictValueDcit(query.JournalID, EnumDictKey.SubjectCat.ToString()); string subjectCategoryName = ""; foreach (SubjectAuthorMapEntity item in cSetEntity.SubjectAuthorMap) { dictValues.TryGetValue(item.SubjectCategoryID,out subjectCategoryName); item.CategoryName = subjectCategoryName; subjectCategoryName = ""; } } return cSetEntity; }
/// <summary> /// 删除数据字典值 /// </summary> /// <param name="query"></param> /// <returns></returns> public ExecResult DelDictValue(DictValueQuery query) { HttpClientHelper clientHelper = new HttpClientHelper(); ExecResult result = clientHelper.Post<ExecResult, DictValueQuery>(GetAPIUrl(APIConstant.DICTVALUE_DELETE), query); return result; }
/// <summary> /// 获取数据字典值分页数据 /// </summary> /// <param name="query"></param> /// <returns></returns> public Pager<DictValueEntity> GetDictValuePageList(DictValueQuery query) { HttpClientHelper clientHelper = new HttpClientHelper(); Pager<DictValueEntity> pager = clientHelper.Post<Pager<DictValueEntity>, DictValueQuery>(GetAPIUrl(APIConstant.DICTVALUE_GETPAGELIST), query); return pager; }
/// <summary> /// 获取数据字典值实体 /// </summary> /// <param name="query"></param> /// <returns></returns> public DictValueEntity GetDictValueModel(DictValueQuery query) { HttpClientHelper clientHelper = new HttpClientHelper(); DictValueEntity model = clientHelper.Post<DictValueEntity, DictValueQuery>(GetAPIUrl(APIConstant.DICTVALUE_GETMODEL), query); return model; }
public IDictionary<int, string> GetDictValueDcit(DictValueQuery query) { IDictValueService service = ServiceContainer.Instance.Container.Resolve<IDictValueService>(); return service.GetDictValueDcit(query.JournalID, query.DictKey); }
public IList<DictValueEntity> GetDictValueList(DictValueQuery query) { IDictValueService service = ServiceContainer.Instance.Container.Resolve<IDictValueService>(); return service.GetDictValueList(query); }
/// <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; }
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="CID"></param> /// <param name="ExpertID"></param> /// <returns></returns> private string GetReviewBillContent(Int64 CID, Int64 EditorID, Int64 ExpertID, Int64 FlowLogID) { StringBuilder strHtml = new StringBuilder(); strHtml.AppendFormat(" <div style=\"text-align: center; font-family: 黑体; font-size: 16px; padding-bottom: 15px;\">《{0}》 审稿单</div>", SiteConfig.SiteName); #region 获取稿件信息 ContributionInfoQuery query = new ContributionInfoQuery(); query.JournalID = CurAuthor.JournalID; query.IsAuxiliary = false; query.CID = CID; IAuthorPlatformFacadeService service = ServiceContainer.Instance.Container.Resolve<IAuthorPlatformFacadeService>(); var CModel = service.GetContributionInfoModel(query); if (CModel == null) CModel = new ContributionInfoEntity(); #endregion #region 获取作者信息 AuthorDetailQuery query1 = new AuthorDetailQuery(); query1.JournalID = CurAuthor.JournalID; query1.AuthorIDs = new Int64[] { CModel.AuthorID, ExpertID }; var listAuthor = service.GetAuthorDetailList(query1).ToList(); var AModel = listAuthor.Find(p => p.AuthorID == CModel.AuthorID); var EModel = listAuthor.Find(p => p.AuthorID == ExpertID); if (AModel == null) AModel = new AuthorDetailEntity(); if (EModel == null) EModel = new AuthorDetailEntity(); ISiteConfigFacadeService service1 = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>(); DictValueQuery query2 = new DictValueQuery(); query2.JournalID = SiteConfig.SiteID; query2.DictKey = EnumDictKey.JobTitle.ToString(); IDictionary<int, string> dict = service1.GetDictValueDcit(query2); string jobTitle = dict.ContainsKey(EModel.JobTitle) ? dict[EModel.JobTitle] : string.Empty; #endregion #region 获取审稿日志 IFlowFacadeService flowService = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>(); CirculationEntity cirEntity = new CirculationEntity(); cirEntity.CID = CID; cirEntity.JournalID = JournalID; cirEntity.GroupID = 1; IList<FlowLogInfoEntity> flowLogList = flowService.GetFlowLog(cirEntity); FlowLogInfoEntity LogSendModel = flowLogList.ToList().Find(p => p.FlowLogID == FlowLogID); //var LogModel = flowLogList.ToList().Where(p => p.SendUserID == ExpertID).FirstOrDefault(q => q.TargetStatusID == LogSendModel.TargetStatusID); var LogModel = flowLogList.ToList().Find(p => p.SendUserID == EditorID); if (LogModel == null) LogModel = new FlowLogInfoEntity(); if (LogSendModel == null) LogSendModel = new FlowLogInfoEntity(); #endregion strHtml.Append(flowService.GetReviewBillContentHead(CurAuthor.JournalID, ExpertID, CID)); strHtml.AppendFormat("<div style=\"padding: 0px 0px 5px 0px; font-size: 11pt; font-family: Times New Roman;\">稿件编号:{0}</div>" , CModel.CNumber); strHtml.Append("<table border=\"0\" class=\"mainTable\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=\"100%\">"); strHtml.AppendFormat("<tr><td class=\"left\">稿件标题:</td><td class=\"right\" style=\"font-weight: bolder;\" colspan=\"3\">{0}</td></tr>" , CModel.Title); strHtml.AppendFormat("<tr><td class=\"left\">送审日期:</td><td class=\"right\">{0}</td><td class=\"left_m\">审毕日期:</td><td class=\"right\">{1}</td></tr>" , LogModel.AddDate, LogModel.DealDate); strHtml.AppendFormat("<tr><td class=\"left\">作者姓名:</td><td class=\"right\">{0}</td><td class=\"left_m\">单位:</td><td class=\"right\">{1}</td></tr>" , AModel.AuthorName, AModel.WorkUnit); strHtml.AppendFormat("<tr><td class=\"left\" style=\"width: 80px;\">对本稿的总评价:</td><td class=\"right\" style=\"padding: 5px 0px 10px 5px;\" colspan=\"3\">"); IFlowFacadeService service2 = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>(); strHtml.Append(service2.GetReviewBillContentStr(CurAuthor.JournalID, ExpertID, CID)); strHtml.Append("</td></tr>"); strHtml.Append("<tr><td class=\"left\" style=\"width: 80px;\">审稿意见:</td><td class=\"right\" style=\"padding: 5px 0px 10px 5px;\" colspan=\"3\">"); strHtml.Append(LogSendModel.DealAdvice); strHtml.Append("</td></tr>"); strHtml.AppendFormat("<tr><td class=\"left\">审稿人姓名:</td><td class=\"right\">{0}</td><td class=\"left_m\">身份证号:</td><td class=\"right\">{1}</td></tr>" , EModel.AuthorName, EModel.IDCard); strHtml.AppendFormat("<tr><td class=\"left\">联系电话:</td><td class=\"right\">{0}</td><td class=\"left_m\">Email:</td><td class=\"right\">{1}</td></tr>" , EModel.Mobile, EModel.AuthorModel.LoginName); strHtml.AppendFormat("<tr><td class=\"left\">通讯地址:</td><td class=\"right\">{0}</td><td class=\"left_m\">邮政编码:</td><td class=\"right\">{1}</td></tr>" , EModel.Address, EModel.ZipCode); strHtml.AppendFormat("<tr><td class=\"left\">研究方向:</td><td class=\"right\">{0}</td><td class=\"left_m\">职称:</td><td class=\"right\">{1}</td></tr>" , EModel.ResearchTopics, jobTitle); strHtml.Append("</table>"); return strHtml.ToString(); }
/// <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="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 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 }); }
/// <summary> /// 获取数据字典值键值对 /// </summary> /// <param name="query"></param> /// <returns></returns> public IDictionary<int, string> GetDictValueDcit(DictValueQuery query) { HttpClientHelper clientHelper = new HttpClientHelper(); IDictionary<int, string> result = clientHelper.Post<IDictionary<int, string>, DictValueQuery>(GetAPIUrl(APIConstant.DICTVALUE_DICT), query); return result; }