username@email.com
2023-09-06 f7ff76aeadd7d92da92ee65ed658b636fa4e8036
DocumentServiceAPI.Application/ProjectInfo/Services/ProjectInfoService.cs
@@ -1642,7 +1642,7 @@
        public PageResult<Document_TBXYFile> postDocumentTBXYFileList(DocumentProjectInfoPageSearch page)
        public PageResult<DocumentTBXYFileDTO> postDocumentTBXYFileList(DocumentProjectInfoPageSearch page)
        {
            var aaa = GetJwtInfo();
@@ -1651,7 +1651,7 @@
            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>();
@@ -1659,8 +1659,10 @@
                .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,
@@ -1673,11 +1675,24 @@
                 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;
@@ -1745,7 +1760,7 @@
                UserId = a.UserId,
                Sort = a.Sort,
                    SaveFlag = a.SaveFlag,
                    Classification  = a.Classification,
                }).OrderBy(a => a.Sort).ToList();
            return ret;
        }
@@ -1785,5 +1800,27 @@
            return true;
        }
        public List<Doc_Classification> GetDocClassificationList()
        {
            var ret = _db.Queryable<Doc_Classification>().Where(x => x.parent_code =="003" && x.status == 1 && x.is_system == true).ToList();
            return ret;
        }
        public bool SaveDocumentTBXYFileInfoNotRep(Document_TBXYFile dp)
        {
            if (dp.Id > 0)
            {
                _db.Updateable<Document_TBXYFile>(dp).ExecuteCommand();
            }
            else
            {
                _db.Insertable<Document_TBXYFile>(dp).ExecuteCommand();
            }
            return true;
        }
    }
}