예제 #1
0
        public ActionResult GetExpertWorkloadList(WorkloadQuery query)
        {
            decimal totalMoney           = 0;
            IAuthorFacadeService service = ServiceContainer.Instance.Container.Resolve <IAuthorFacadeService>();

            query.JournalID = JournalID;
            int pageIndex = TypeParse.ToInt(Request.Params["page"], 1);
            int pageSize  = TypeParse.ToInt(Request.Params["pageSize"], 15);
            IList <WorkloadEntity> listAuthor = service.GetWorkloadList(query);

            for (int i = 0; i < listAuthor.Count; i++)
            {
                listAuthor[i].ExpertReviewFee = (SiteConfig.ExpertReviewFee * listAuthor[i].AlreadyCount).ToString("C2");
                totalMoney += SiteConfig.ExpertReviewFee * listAuthor[i].AlreadyCount;
            }
            if (query.isIgnoreNoWork == true)
            {
                listAuthor = listAuthor.Where(p => p.AlreadyCount > 0).OrderByDescending(x => x.AlreadyCount).ToList();
                return(Json(new { Rows = listAuthor.Where(p => p.AlreadyCount > 0).Skip((pageIndex - 1) * pageSize).Take(pageSize), Total = listAuthor.Count, TotalMoney = totalMoney.ToString("C2") }));
            }
            else
            {
                return(Json(new { Rows = listAuthor.Skip((pageIndex - 1) * pageSize).Take(pageSize), Total = listAuthor.Count, TotalMoney = totalMoney.ToString("C2") }));
            }
        }
예제 #2
0
        public ActionResult ExpertWorkloadListToExcel(WorkloadQuery query)
        {
            decimal totalMoney           = 0;
            decimal money                = Convert.ToDecimal(Request.Params["Money"]);
            IAuthorFacadeService service = ServiceContainer.Instance.Container.Resolve <IAuthorFacadeService>();

            query.JournalID = JournalID;
            int pageIndex = TypeParse.ToInt(Request.Params["page"], 1);
            IList <WorkloadEntity> listAuthor = service.GetWorkloadList(query);

            for (int i = 0; i < listAuthor.Count; i++)
            {
                listAuthor[i].ExpertReviewFee = (SiteConfig.ExpertReviewFee * listAuthor[i].AlreadyCount).ToString("C2");
                totalMoney += SiteConfig.ExpertReviewFee * listAuthor[i].AlreadyCount;
            }

            string[] titleFiles  = new string[] { "专家姓名", "登录名", "待审稿件", "已审稿件", "审稿费", "发票抬头", "户名", "帐号", "开户行", "专家单位", "专家地址", "邮编", "联系电话", "手机" };
            int[]    titleWidth  = new int[] { 50, 100, 50, 50, 80, 100, 50, 150, 100, 120, 150, 50, 100, 80 };
            string[] dataFiles   = new string[] { "RealName", "LoginName", "WaitCount", "AlreadyCount", "ExpertReviewFee", "InvoiceUnit", "ReserveField1", "ReserveField2", "ReserveField3", "WorkUnit", "Address", "ZipCode", "Tel", "Mobile" };
            string[] fomateFiles = new string[] { "", "", "", "", "", "", "", "", "", "", "", "", "", "" };
            string   strTempPath = "/UploadFile/TempFile/" + "ExpertWorkloadList.xls";

            if (query.isIgnoreNoWork == true)
            {
                listAuthor = listAuthor.Where(p => p.AlreadyCount > 0).OrderByDescending(x => x.AlreadyCount).ToList();
                ExcelHelperEx.CreateExcel <WorkloadEntity>("专家信息列表_审稿费每篇" + money + "元,总计_" + totalMoney + "元", titleFiles, titleWidth, dataFiles, fomateFiles, listAuthor, strTempPath);
            }
            else
            {
                ExcelHelperEx.CreateExcel <WorkloadEntity>("专家信息列表_审稿费每篇" + money + "元,总计_" + totalMoney + "元", titleFiles, titleWidth, dataFiles, fomateFiles, listAuthor, strTempPath);
            }
            return(Json(new { flag = 1, ExcelPath = strTempPath }));
        }
예제 #3
0
        /// <summary>
        /// 获取编辑Model
        /// </summary>
        /// <param name="AuthorID"></param>
        /// <returns></returns>
        private AuthorDetailEntity GetEditorModel(Int64 AuthorID)
        {
            AuthorDetailEntity model = null;

            if (AuthorID > 0)
            {
                AuthorDetailQuery query = new AuthorDetailQuery();
                query.JournalID = CurAuthor.JournalID;
                query.AuthorID  = AuthorID;
                IAuthorPlatformFacadeService service = ServiceContainer.Instance.Container.Resolve <IAuthorPlatformFacadeService>();
                model = service.GetAuthorDetailModel(query);
            }
            if (model == null)
            {
                model = new AuthorDetailEntity();
            }
            IAuthorFacadeService authorService = ServiceContainer.Instance.Container.Resolve <IAuthorFacadeService>();
            var list = authorService.GetEditorFieldsSet();

            if (list == null)
            {
                list = new List <FieldsSet>();
            }
            list.Insert(0, new FieldsSet {
                DisplayName = "中文姓名", FieldName = "中文姓名", DBField = "AuthorName", IsShow = true, IsRequire = true
            });
            model.FieldList = list.Where(p => p.IsShow).ToList();
            if (model.AuthorModel == null)
            {
                model.AuthorModel = new AuthorInfoEntity();
            }
            return(model);
        }
예제 #4
0
        public ActionResult GetStatDetail(StatQuery query)
        {
            IAuthorFacadeService service = ServiceContainer.Instance.Container.Resolve <IAuthorFacadeService>();

            query.JournalID = JournalID;
            int pageIndex = TypeParse.ToInt(Request.Params["page"], 1);
            IList <StatDealContributionDetailEntity> listStatDetail = service.GetDealContributionDetail(query);

            return(Json(new { Rows = listStatDetail.Skip((pageIndex - 1) * 10).Take(10), Total = listStatDetail.Count }));
        }
예제 #5
0
        public ActionResult GetContributionList(long SiteID, string EMail)
        {
            string contributions = string.Empty;

            //根据邮箱获取作者实体-得到作者ID
            IAuthorFacadeService authorService = ServiceContainer.Instance.Container.Resolve <IAuthorFacadeService>();
            AuthorInfoQuery      query         = new AuthorInfoQuery();

            query.LoginName = EMail;
            query.JournalID = SiteID;
            query.GroupID   = (int)EnumMemberGroup.Author;
            AuthorInfoEntity authorInfoEntity = authorService.GetAuthorInfo(query);

            //获取作者最新状态的稿件列表
            IFlowFacadeService flowService = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>();
            CirculationEntity  cirEntity   = new CirculationEntity();

            cirEntity.JournalID   = SiteID;
            cirEntity.CurAuthorID = authorInfoEntity.AuthorID;
            //int pageIndex = TypeParse.ToInt(Request.Params["page"], 1);
            cirEntity.CurrentPage = 1;
            cirEntity.PageSize    = TypeParse.ToInt(Request.Params["pagesize"], 100);
            Pager <FlowContribution> pager = flowService.GetAuthorContributionList(cirEntity);

            if (pager.ItemList.Count == 0)
            {
                return(base.Json(new { code = "1000002", msg = "没有查询到符合条件的数据。" }, JsonRequestBehavior.AllowGet));//没有稿件数据
            }
            else if (pager.ItemList.Count == 1)
            {
                return(base.Json(new { code = "1000003", msg = "查询到1条符合条件的数据。" }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                contributions += "[";
                for (int i = 0; i < pager.ItemList.Count; i++)
                {
                    contributions += "{\"Title\":\"" + pager.ItemList[i].Title + "\",\"AuthorName\":\"" + pager.ItemList[i].AuthorName + "\",\"AuditStatus\":\"" + pager.ItemList[i].AuditStatus + "\",\"AddDate\":\"" + pager.ItemList[i].AddDate + "\"},";
                }
                contributions.Remove(contributions.LastIndexOf(','), 1);
                contributions += "]";
                return(base.Json(new { code = "1000004", msg = "查询到" + pager.ItemList.Count + "条符合条件的数据。", Contributions = contributions }, JsonRequestBehavior.AllowGet));
            }
        }
예제 #6
0
        public JsonResult ExpertPayMoneyRenderToExcel(WorkloadQuery query, string strDict)
        {
            try
            {
                IAuthorFacadeService         service = ServiceContainer.Instance.Container.Resolve <IAuthorFacadeService>();
                IAuthorPlatformFacadeService serviceAuthorPlatform = ServiceContainer.Instance.Container.Resolve <IAuthorPlatformFacadeService>();

                query.JournalID = CurAuthor.JournalID;
                query.GroupID   = query.GroupID;
                IList <WorkloadEntity>     list       = service.GetWorkloadList(query);
                IList <AuthorDetailEntity> listDetail = serviceAuthorPlatform.GetAuthorDetailList(new AuthorDetailQuery()
                {
                    GroupID = 3, JournalID = JournalID
                });
                list = (from author in list join authorDetail in listDetail on author.AuthorID equals authorDetail.AuthorID into JionauthorDetail from authorDetail in JionauthorDetail.DefaultIfEmpty() select new WorkloadEntity()
                {
                    RealName = author.RealName, LoginName = author.LoginName, AlreadyCount = author.AlreadyCount, WaitCount = author.WaitCount, ZipCode = authorDetail.ZipCode, Address = authorDetail.Address
                }).ToList <WorkloadEntity>();

                if (list == null || list.Count <= 0)
                {
                    return(Json(new { flag = "error", msg = "没有数据不能导出,请先进行查询!" }));
                }
                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());
                RenderToExcel.ExportListToExcel <WorkloadEntity>(list, dict
                                                                 , null
                                                                 , "专家审稿费信息_导出" + DateTime.Now.ToString("yyyy-MM-dd"), false, "xls");
                return(Json(new { flag = "success" }));
            }
            catch (Exception ex)
            {
                LogProvider.Instance.Error("导出作者信息出现异常:" + ex.Message);
                return(Json(new { flag = "error", msg = "导出作者信息异常!" }));
            }
        }
예제 #7
0
        public JsonResult GetNewEditorWorkloadList()
        {
            IAuthorFacadeService service = ServiceContainer.Instance.Container.Resolve <IAuthorFacadeService>();
            AuthorInfoQuery      query   = new AuthorInfoQuery();

            query.JournalID = CurAuthor.JournalID;
            query.GroupID   = (int)EnumMemberGroup.Editor;
            query.RoleID    = 0;
            IList <AuthorInfoEntity> pager = service.GetAuthorListByRole(query);
            Dictionary <string, IList <FlowStatusEntity> > dic = new Dictionary <string, IList <FlowStatusEntity> >();

            if (pager != null && pager.Count > 0)
            {
                foreach (var item in pager)
                {
                    AuthorInfoQuery currentEntity = new AuthorInfoQuery();
                    currentEntity.AuthorID = item.AuthorID;
                    IList <FlowStatusEntity> list = GetFlowStatusList(currentEntity);
                    dic.Add(item.RealName + "-" + item.AuthorID + "-" + item.RoleID + "-" + item.RoleName, list);
                }
            }
            return(Json(dic));
        }
예제 #8
0
        /// <summary>
        /// 获取作者字段信息
        /// </summary>
        /// <returns></returns>
        private IDictionary <string, string> GetAuthorDetail()
        {
            IDictionary <string, string> dict = new Dictionary <string, string>();

            dict.Add("AuthorName", "中文名称");
            dict.Add("AuthorModel.LoginName", "登录名");
            //dict.Add("AuthorModel.Pwd", "登录密码");
            //dict.Add("AuthorModel.GroupID", "用户类型");
            //dict.Add("AuthorModel.Status", "用户状态");
            dict.Add("ReserveField2", "用户类型");
            dict.Add("ReserveField3", "用户状态");
            IAuthorFacadeService authorService = ServiceContainer.Instance.Container.Resolve <IAuthorFacadeService>();
            var list = authorService.GetFieldsSet();

            foreach (var item in list)
            {
                if (!dict.ContainsKey(item.DBField))
                {
                    dict.Add(item.DBField, item.DisplayName);
                }
            }
            dict.Add("AuthorModel.AddDate", "注册时间");
            return(dict);
        }
예제 #9
0
        /// <summary>
        /// 单篇送排
        /// </summary>
        /// <param name="CID"></param>
        /// <returns></returns>
        public ActionResult SingleSendTypesetting(long CID)
        {
            ExecResult eResult = new ExecResult();

            FangZService.JournalXService jService = new FangZService.JournalXService();
            try
            {
                # region get token

                // 验证令牌正确性
                TokenQuery tokenQuery = new TokenQuery();
                tokenQuery.JournalID  = SiteConfig.SiteID;
                tokenQuery.AuthorID   = 0;
                tokenQuery.Type       = 3;
                tokenQuery.ExpireDate = DateTime.Now.AddDays(-7);
                IAuthorFacadeService authorService = ServiceContainer.Instance.Container.Resolve <IAuthorFacadeService>();
                TokenEntity          tokenEntity   = authorService.GetToken(tokenQuery);
                string SafetyCode = "";
                if (tokenEntity != null)
                {
                    SafetyCode = tokenEntity.Token;
                }

                # endregion