/// <summary>
        /// 查询任务书
        /// </summary>
        /// <param name="instId"></param>
        /// <param name="status"></param>
        /// <param name="year"></param>
        /// <returns></returns>
        public IQueryable <AnnualTask> GetAnnualTaskList(int instId, AnnualTaskStatus status, int year)
        {
            var getannualTask = _context.AnnualTasks
                                .Where(at => at.InstituteId == instId || instId == 0)
                                .Where(at => at.Status == status || status < 0)
                                .Where(at => at.Year == year || year == 0)
                                .OrderByDescending(at => at.EditTime);

            return(getannualTask);
        }
        public AnnualTask ChangeAnnualTaskStatus(AnnualTask task, AnnualTaskStatus from, AnnualTaskStatus to, string commnet = "")
        {
            if (task.Status == from)
            {
                task.Status  = to;
                task.Comment = commnet;
                _context.SaveChanges();
            }
            else
            {
                throw new OtherException("任务书状态不符合条件");
            }

            return(task);
        }
        public HttpResponseMessage GetInstReviewAnnualTask([FromUri] AnnualTaskStatus status, [FromUri] int page)
        {
            try
            {
                page = page <= 0 ? 1 : page;
                var userInfo       = UserHelper.GetCurrentUser();
                var reviewTaskDTOs = _repository
                                     .GetAnnualTaskList(userInfo.InstId, status, SystemConfig.ApplicationStartYear)
                                     .Select(Mapper.Map <GetAnnualTaskBasicInfoDTO>);

                var pagingList = PagingHelper.PagingWrapper(reviewTaskDTOs, page, SystemConfig.AnnualTaskPageCount);;

                return(ResponseWrapper.SuccessResponse(pagingList));
            }
            catch (Exception e)
            {
                return(ResponseWrapper.ExceptionResponse(e));
            }
        }