From 3f4013e9283d1fe29ef40cc8b4d7ee7a590a1590 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期二, 17 十月 2023 09:26:40 +0800 Subject: [PATCH] 最新代码 --- DocumentServiceAPI.Application/DocManage/DocClassificationManageAppService.cs | 21 ++++++++++++--------- 1 files changed, 12 insertions(+), 9 deletions(-) diff --git a/DocumentServiceAPI.Application/DocManage/DocClassificationManageAppService.cs b/DocumentServiceAPI.Application/DocManage/DocClassificationManageAppService.cs index de9221f..71e816c 100644 --- a/DocumentServiceAPI.Application/DocManage/DocClassificationManageAppService.cs +++ b/DocumentServiceAPI.Application/DocManage/DocClassificationManageAppService.cs @@ -1,5 +1,6 @@ 锘縰sing DocumentServiceAPI.Application.DocManage.Dtos; using DocumentServiceAPI.Application.DocManage.Services; +using DocumentServiceAPI.Application.ProjectInfo.Services.Interfaces; using DocumentServiceAPI.Model.cyDocumentModel; using DocumentServiceAPI.Utility; @@ -11,10 +12,11 @@ public class DocClassificationManageAppService : IDynamicApiController { private readonly DocClassificationService _classificationService; - - public DocClassificationManageAppService(DocClassificationService classificationService) + private readonly IProjectInfoService _projectInfoService; + public DocClassificationManageAppService(DocClassificationService classificationService, IProjectInfoService projectInfoService) { _classificationService = classificationService; + _projectInfoService = projectInfoService; } /// <summary> @@ -38,15 +40,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 && c.is_system == false , 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 && c.is_system == false , pg, c => c.sort_id, OrderByType.Asc); } result.TotalCount = pg.TotalCount; result.PageIndex = pg.PageIndex; @@ -62,7 +64,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 +80,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 +102,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); } @@ -112,9 +115,9 @@ /// </summary> /// <param name="id"></param> /// <returns></returns> - public async Task<IActionResult> PostDelInfo(int id) + public IActionResult PostDelInfo(int id) { - var msg = await _classificationService.DeleteByIdAsync(id); + var msg = _projectInfoService.GetDeleteDocClassification(id); return new JsonResult(msg); } } -- Gitblit v1.9.1