Пример #1
0
        /// <summary>
        /// 获取同步批次作业中未完成的单元
        /// </summary>
        public ActionResult GetNotCompletedWorks(User user, long doWorkId, long recordId)
        {
            var workResources = workService.GetWorkResources(recordId);

            var unitWorks = workService.GetUserUnitWorks(doWorkId).ToDictionary(t => t.ContentId, t => t.Status);

            var jsonData = workResources.Select(t => new
            {
                content_id    = t.ContentId,
                resource_name = t.ResourceName,
                status        = unitWorks.ContainsKey(t.ContentId) ? unitWorks[t.ContentId] : 0,
                url           = string.Format("{0}/dowork?doworkId={1}&contentId={2}", RedirectHelper.GetRedirectUrl(t.ModuleId.ToString()), doWorkId, t.ContentId)
            });

            return(Json(jsonData, JsonRequestBehavior.AllowGet));
        }