| | |
| | | |
| | | |
| | | |
| | | public PageResult<Document_TBXYFile> postDocumentTBXYFileList(DocumentProjectInfoPageSearch page) |
| | | public PageResult<DocumentTBXYFileDTO> postDocumentTBXYFileList(DocumentProjectInfoPageSearch page) |
| | | { |
| | | var aaa = GetJwtInfo(); |
| | | |
| | |
| | | pg.PageIndex = page.PageIndex; |
| | | //page.ToEmployeeId = a.EID; |
| | | int total = 0; |
| | | PageResult<Document_TBXYFile> result = new PageResult<Document_TBXYFile>(); |
| | | PageResult<DocumentTBXYFileDTO> result = new PageResult<DocumentTBXYFileDTO>(); |
| | | |
| | | |
| | | |
| | |
| | | .Where(a => a.UnitId == page.UnitId && a.ProjectId == page.ProjectId) |
| | | //文件名称 |
| | | .WhereIF(!string.IsNullOrEmpty(page.FileName), a => a.FileName.Contains(page.FileName)) |
| | | .WhereIF(page.Classification>0, a => a.Classification == page.Classification) |
| | | .WhereIF(!string.IsNullOrEmpty(page.FilePath), a => ( a.FilePath !=null && a.FilePath != "")) |
| | | |
| | | .Select(a => new Document_TBXYFile |
| | | .Select(a => new DocumentTBXYFileDTO |
| | | { |
| | | Id = a.Id, |
| | | FileName = a.FileName, |
| | |
| | | AdviseFlag = a.AdviseFlag, |
| | | UserId = a.UserId, |
| | | Sort = a.Sort, |
| | | |
| | | Classification = a.Classification, |
| | | } |
| | | ) |
| | | .OrderBy(a => a.Sort).ToPageList(page.PageIndex, page.PageSize, ref total); |
| | | |
| | | |
| | | if(result.Items !=null&& result.Items.Count > 0) |
| | | { |
| | | var doc_Classifications = _db.Queryable<Doc_Classification>().Where(x => x.parent_code == "003").ToList();//执行查询 |
| | | foreach (var item in result.Items) |
| | | { |
| | | var doc_Classification = doc_Classifications.Where(x => x.id == item.Classification).FirstOrDefault(); |
| | | if (doc_Classification != null) |
| | | { |
| | | item.ClassificationName = doc_Classification.doc_classification; |
| | | } |
| | | } |
| | | } |
| | | |
| | | result.TotalCount = total; |
| | | result.TotalPage = total % page.PageSize == 0 ? total / page.PageSize : total / page.PageSize + 1; |
| | |
| | | UserId = a.UserId, |
| | | Sort = a.Sort, |
| | | SaveFlag = a.SaveFlag, |
| | | |
| | | Classification = a.Classification, |
| | | }).OrderBy(a => a.Sort).ToList(); |
| | | return ret; |
| | | } |
| | |
| | | return true; |
| | | } |
| | | |
| | | |
| | | public List<Doc_Classification> GetDocClassificationList() |
| | | { |
| | | var ret = _db.Queryable<Doc_Classification>().Where(x => x.parent_code =="003" && x.status == 1).ToList(); |
| | | return ret; |
| | | } |
| | | |
| | | } |
| | | } |