From d4e779a6f473755fffaa95848f369157d2333349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=BC=9F?= <421281095@qq.com> Date: Fri, 23 May 2025 10:24:57 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DroneSsnydManage/DroneSsnyApp.cs | 45 ++++++++++++------- OpenAuth.Repository/Domain/DroneSsnyd.cs | 7 +-- .../ServiceControllers/DroneSsnyController.cs | 24 ++++++++++ 3 files changed, 58 insertions(+), 18 deletions(-) diff --git a/OpenAuth.App/ServiceApp/DroneSsnydManage/DroneSsnyApp.cs b/OpenAuth.App/ServiceApp/DroneSsnydManage/DroneSsnyApp.cs index a390dcc..8c0f7c7 100644 --- a/OpenAuth.App/ServiceApp/DroneSsnydManage/DroneSsnyApp.cs +++ b/OpenAuth.App/ServiceApp/DroneSsnydManage/DroneSsnyApp.cs @@ -460,20 +460,35 @@ namespace OpenAuth.App.ServiceApp.DroneSsnydManage } public async Task CloseProject(string id) - { - var project = await Repository.AsQueryable().SingleAsync(a => a.Id == id && a.handle_status_id != 99); - if (project == null) - { - throw new Exception("项目不存在或停止生产"); - } - - var newProject = new DroneSsnyd() - { - Id = project.Id, - handle_status_id = 99, - handle_status_name = "项目终止", - }; - await Repository.AsUpdateable(newProject).IgnoreNullColumns().ExecuteCommandAsync(); - } + { + var project = await Repository.AsQueryable().SingleAsync(a => a.Id == id && a.handle_status_id != 99); + if (project == null) + { + throw new Exception("项目不存在或停止生产"); + } + + var newProject = new DroneSsnyd() + { + Id = project.Id, + handle_status_id = 99, + handle_status_name = "项目终止", + }; + await Repository.AsUpdateable(newProject).IgnoreNullColumns().ExecuteCommandAsync(); + } + + public DroneSsnyd ProjectDetail(string id) + { + var project = Repository.GetById(id); + if (project == null) + { + throw new Exception("项目不存在"); + } + project.RcjgList = Repository + .ChangeRepository>().AsQueryable() + .Where(c => c.ssnyd_id == id) + .ToList(); + + return project; + } } } \ No newline at end of file diff --git a/OpenAuth.Repository/Domain/DroneSsnyd.cs b/OpenAuth.Repository/Domain/DroneSsnyd.cs index 1f11c36..0711cff 100644 --- a/OpenAuth.Repository/Domain/DroneSsnyd.cs +++ b/OpenAuth.Repository/Domain/DroneSsnyd.cs @@ -13,9 +13,8 @@ namespace OpenAuth.Repository.Domain { public DroneSsnyd() { - - } + /// /// Desc: /// Default: @@ -710,5 +709,7 @@ namespace OpenAuth.Repository.Domain /// public DateTime? yijiaoshijian { get; set; } + [SugarColumn(IsIgnore = true)] + public List RcjgList { get; set; } } -} +} \ No newline at end of file diff --git a/OpenAuth.WebApi/Controllers/ServiceControllers/DroneSsnyController.cs b/OpenAuth.WebApi/Controllers/ServiceControllers/DroneSsnyController.cs index eb14f03..1281161 100644 --- a/OpenAuth.WebApi/Controllers/ServiceControllers/DroneSsnyController.cs +++ b/OpenAuth.WebApi/Controllers/ServiceControllers/DroneSsnyController.cs @@ -218,6 +218,30 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers return response; } + + // 项目移交 项目详情 + + /// + /// 项目详情 + /// + /// + /// + [HttpGet] + public Response ProjectDetail(string id) + { + var response = new Response(); + try + { + response.Result = droneSsnyApp.ProjectDetail(id); + } + catch (Exception ex) + { + response.Code = 500; + response.Message = ex.InnerException?.Message ?? ex.Message; + } + + return response; + } /// /// 历史项目导出