DocumentServiceAPI.Application/DocManage/DocClassificationManageAppService.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DocumentServiceAPI.Application/DocManage/DocumentManageAppService.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DocumentServiceAPI.Application/DocManage/Dtos/Classification_Submit_Dto.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DocumentServiceAPI.Application/DocManage/Dtos/Document_List_Dto.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DocumentServiceAPI.Application/DocManage/Dtos/Document_Lock_Dto.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DocumentServiceAPI.Application/DocManage/Dtos/Project_List_Dto.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DocumentServiceAPI.Application/DocManage/Services/ProjectManageService.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DocumentServiceAPI.Application/DocumentServiceAPI.Application.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DocumentServiceAPI.Model/cyDocumentModel/Doc_Info.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
DocumentServiceAPI.Application/DocManage/DocClassificationManageAppService.cs
@@ -38,15 +38,15 @@ PageModel pg = new PageModel(); pg.PageSize = page.PageSize; pg.PageIndex = page.PageIndex; PageResult<Doc_Classification> result = new PageResult<Doc_Classification>(); if (page.Status.HasValue) { result.Items = await _classificationService.GetPageListAsync(c => c.status ==page.Status && c.parent_code == page.Code, pg); result.Items = await _classificationService.GetPageListAsync(c => c.status ==page.Status && c.parent_code == page.Code,pg,c=>c.sort_id,OrderByType.Asc); } else { result.Items = await _classificationService.GetPageListAsync(c => c.parent_code == page.Code, pg); result.Items = await _classificationService.GetPageListAsync(c => c.parent_code == page.Code, pg, c => c.sort_id, OrderByType.Asc); } result.TotalCount = pg.TotalCount; result.PageIndex = pg.PageIndex; @@ -62,7 +62,7 @@ public async Task<IActionResult> PostItemList(DocClassificationSearch page) { var data = await _classificationService.GetListAsync(c => c.status == 1 && c.parent_code == page.Code); return new JsonResult(data); return new JsonResult(data.OrderBy(c=>c.sort_id).ToList()); } /// <summary> @@ -78,7 +78,7 @@ doc.doc_classification_code = ""; doc.is_system = false; doc.parent_code = info.code; doc.sort_id = 99; doc.sort_id = info.sort; doc.status = info.status; doc.tenant_code = info.tenant_id; @@ -100,6 +100,7 @@ model.add_time = DateTime.Now; model.doc_classification = info.name; model.status = info.status; model.sort_id = info.sort; msg = await _classificationService.UpdateAsync(model); } DocumentServiceAPI.Application/DocManage/DocumentManageAppService.cs
@@ -1,9 +1,12 @@ using DocumentServiceAPI.Application.DocManage.Dtos; using DocumentServiceAPI.Application.DocManage.Services; using DocumentServiceAPI.Application.ProjectInfo.Services; using DocumentServiceAPI.Application.System.Services; using DocumentServiceAPI.Model.cyDocumentModel; using DocumentServiceAPI.Services.IService; using DocumentServiceAPI.Utility; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.Caching.Memory; using System.Linq.Expressions; namespace DocumentServiceAPI.Application.DocManage @@ -17,13 +20,71 @@ private readonly DocumentManageService _docManageService; private readonly OrganizationService _organizationService; private readonly FileManageService _fileManageService; private readonly ProjectManageService _projectService; private readonly IRedisCacheService _redisCache; public DocumentManageAppService(DocClassificationService classService, DocumentManageService docService, OrganizationService orgService,FileManageService fileManageService) public DocumentManageAppService(DocClassificationService classService, DocumentManageService docService, OrganizationService orgService, FileManageService fileManageService, ProjectManageService projectService, IRedisCacheService redisCase) { _classificationService = classService; _docManageService = docService; _organizationService = orgService; _fileManageService = fileManageService; _projectService = projectService; _redisCache = redisCase; } /// <summary> /// 编辑文档时设置文档锁定状态 /// </summary> /// <param name="model"></param> /// <returns> /// true:设置锁定成功 /// false:锁定失败,文档已被锁定 /// </returns> public bool SetDocLockStatus(DocLock_Submit_Dto model) { bool msg = true; string key = model.tenant_id.ToString().PadLeft(4,'0') + "_" + model.id.ToString().PadLeft(8,'0'); if (_redisCache.Get<Document_Lock_Dto>(key) != null) { msg = false; } else { Document_Lock_Dto lk = new Document_Lock_Dto(); lk.doc_id = model.id; lk.lock_time = DateTime.Now; lk.lock_user = model.username; lk.lock_user_id = model.userid; lk.status = 0; lk.tenant_id = model.tenant_id; var db= _redisCache.Add<Document_Lock_Dto>(key,lk ,-1); } return msg; } /// <summary> /// 查询项目信息 /// </summary> /// <param name="search"></param> /// <returns></returns> public async Task<IActionResult> PostProjectItemList(ProjectItemSearch search) { var data = await _projectService.GetListAsync();//.GetListAsync(c => c.TenantID == search.tenant_id); if (data != null) { var list = data.Select(c => new ProjectItem_List_Dto() { pro_id=c.ProjectId, pro_name=c.ProjectName }).OrderBy(c => c.pro_name).ToList(); return new JsonResult(list); } return null; } /// <summary> @@ -40,6 +101,11 @@ { expression = expression.And(t => t.classification_id == model.class_id); } if (model.project_id.HasValue && model.project_id != 0) { expression = expression.And(t => t.project_id == model.project_id); } if (model.id > 0) { expression = expression.And(t => t.id != model.id); @@ -86,7 +152,9 @@ var data = await _docManageService.Context.Queryable<Doc_Info>() .Includes(c => c.DocClassification) .Includes(c=>c.DocOrganization) .Includes(c=>c.DocProject) .Where(expression) .OrderByDescending(c=>c.id) .ToPageListAsync(page.PageIndex, page.PageSize, total); if (data != null && total > 0) @@ -101,7 +169,7 @@ org_id = c.org_id, org_name = c.DocOrganization?.UnitName, project_id = c.project_id, project_name = "", project_name = c.DocProject?.ProjectName, status = c.status }).ToList(); DocumentServiceAPI.Application/DocManage/Dtos/Classification_Submit_Dto.cs
@@ -13,6 +13,7 @@ /// </summary> public string code { get; set; } public int sort { get; set; } public int status { get; set; } } } DocumentServiceAPI.Application/DocManage/Dtos/Document_List_Dto.cs
@@ -76,6 +76,11 @@ /// </summary> public int? org_id { get; set; } /// <summary> /// 项目名称 /// </summary> public int? project_id { get; set; } public int status { get; set; } public List<DocumentFile_Submit_Dto> newfiles { get; set; } DocumentServiceAPI.Application/DocManage/Dtos/Document_Lock_Dto.cs
New file @@ -0,0 +1,48 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DocumentServiceAPI.Application.DocManage.Dtos { public class Document_Lock_Dto { /// <summary> /// 文档id /// </summary> public int doc_id { get; set; } public int lock_user_id { get; set; } public string lock_user { get; set; } public DateTime lock_time { get; set; } public DateTime? release_time { get; set; } public int tenant_id { get; set; } public int status { get; set; } } /// <summary> /// 提交信息 /// </summary> public class DocLock_Submit_Dto { public int id { get; set; } /// <summary> /// 人员 /// </summary> public int userid { get; set; } /// <summary> /// 人员 /// </summary> public string username { get; set; } public int tenant_id { get; set; } } } DocumentServiceAPI.Application/DocManage/Dtos/Project_List_Dto.cs
New file @@ -0,0 +1,34 @@ namespace DocumentServiceAPI.Application.DocManage.Dtos { /// <summary> /// 项目列表信息 /// </summary> public class ProjectItem_List_Dto { /// <summary> /// 项目id /// </summary> public int pro_id { get; set; } /// <summary> /// 项目名称 /// </summary> public string pro_name { get; set; } } /// <summary> /// 项目查询条件 /// </summary> public class ProjectItemSearch { /// <summary> /// 租户 /// </summary> public int tenant_id { get; set; } /// <summary> /// 单位 /// </summary> public int org_id { get; set; } } } DocumentServiceAPI.Application/DocManage/Services/ProjectManageService.cs
New file @@ -0,0 +1,12 @@ using DocumentServiceAPI.Core; using DocumentServiceAPI.Model.cyDocumentModel; namespace DocumentServiceAPI.Application.DocManage.Services { /// <summary> /// 项目查询类 /// </summary> public class ProjectManageService : BaseRepository<Document_ProjectInfo>, ITransient { } } DocumentServiceAPI.Application/DocumentServiceAPI.Application.xml
@@ -56,6 +56,23 @@ 资料管理 </summary> </member> <member name="M:DocumentServiceAPI.Application.DocManage.DocumentManageAppService.SetDocLockStatus(DocumentServiceAPI.Application.DocManage.Dtos.DocLock_Submit_Dto)"> <summary> 编辑文档时设置文档锁定状态 </summary> <param name="model"></param> <returns> true:设置锁定成功 false:锁定失败,文档已被锁定 </returns> </member> <member name="M:DocumentServiceAPI.Application.DocManage.DocumentManageAppService.PostProjectItemList(DocumentServiceAPI.Application.DocManage.Dtos.ProjectItemSearch)"> <summary> 查询项目信息 </summary> <param name="search"></param> <returns></returns> </member> <member name="M:DocumentServiceAPI.Application.DocManage.DocumentManageAppService.CheckNameDuplicate(DocumentServiceAPI.Application.DocManage.Dtos.Document_Submit_Dto)"> <summary> 检查名称重复 @@ -165,6 +182,11 @@ 投标单位 </summary> </member> <member name="P:DocumentServiceAPI.Application.DocManage.Dtos.Document_Submit_Dto.project_id"> <summary> 项目名称 </summary> </member> <member name="T:DocumentServiceAPI.Application.DocManage.Dtos.Document_Info_Dto"> <summary> 查询文档信息 @@ -230,9 +252,59 @@ 上传人员 </summary> </member> <member name="P:DocumentServiceAPI.Application.DocManage.Dtos.Document_Lock_Dto.doc_id"> <summary> 文档id </summary> </member> <member name="T:DocumentServiceAPI.Application.DocManage.Dtos.DocLock_Submit_Dto"> <summary> 提交信息 </summary> </member> <member name="P:DocumentServiceAPI.Application.DocManage.Dtos.DocLock_Submit_Dto.userid"> <summary> 人员 </summary> </member> <member name="P:DocumentServiceAPI.Application.DocManage.Dtos.DocLock_Submit_Dto.username"> <summary> 人员 </summary> </member> <member name="P:DocumentServiceAPI.Application.DocManage.Dtos.FileInfo_List_Dto.suffix"> <summary> 扩展名 </summary> </member> <member name="T:DocumentServiceAPI.Application.DocManage.Dtos.ProjectItem_List_Dto"> <summary> 项目列表信息 </summary> </member> <member name="P:DocumentServiceAPI.Application.DocManage.Dtos.ProjectItem_List_Dto.pro_id"> <summary> 项目id </summary> </member> <member name="P:DocumentServiceAPI.Application.DocManage.Dtos.ProjectItem_List_Dto.pro_name"> <summary> 项目名称 </summary> </member> <member name="T:DocumentServiceAPI.Application.DocManage.Dtos.ProjectItemSearch"> <summary> 项目查询条件 </summary> </member> <member name="P:DocumentServiceAPI.Application.DocManage.Dtos.ProjectItemSearch.tenant_id"> <summary> 租户 </summary> </member> <member name="P:DocumentServiceAPI.Application.DocManage.Dtos.ProjectItemSearch.org_id"> <summary> 单位 </summary> </member> <member name="P:DocumentServiceAPI.Application.DocManage.Services.DocClassificationPageSearch.Code"> @@ -300,6 +372,11 @@ 文件管理 </summary> </member> <member name="T:DocumentServiceAPI.Application.DocManage.Services.ProjectManageService"> <summary> 项目查询类 </summary> </member> <member name="T:DocumentServiceAPI.Application.ProjectInfo.ProjectInfoController"> <summary> 登录控制器 DocumentServiceAPI.Model/cyDocumentModel/Doc_Info.cs
@@ -61,6 +61,13 @@ [SugarColumn(IsIgnore = true)] [Navigate(NavigateType.OneToOne, nameof(org_id))] public Document_TenderUnit? DocOrganization { get; set; } /// <summary> /// 关联项目 /// </summary> [SugarColumn(IsIgnore = true)] [Navigate(NavigateType.OneToOne, nameof(project_id))] public Document_ProjectInfo? DocProject { get; set; } } }