username@email.com
2023-10-17 3f4013e9283d1fe29ef40cc8b4d7ee7a590a1590
DocumentServiceAPI.Application/DocManage/DocClassificationManageAppService.cs
@@ -1,5 +1,6 @@
using 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);
        }
    }