diff --git a/OpenAuth.App/ServiceApp/DroneSsnydManage/DroneSsnyApp.cs b/OpenAuth.App/ServiceApp/DroneSsnydManage/DroneSsnyApp.cs index 3905076..531ebe0 100644 --- a/OpenAuth.App/ServiceApp/DroneSsnydManage/DroneSsnyApp.cs +++ b/OpenAuth.App/ServiceApp/DroneSsnydManage/DroneSsnyApp.cs @@ -500,5 +500,29 @@ namespace OpenAuth.App.ServiceApp.DroneSsnydManage var project = req.MapTo(); await Repository.AsUpdateable(project).IgnoreNullColumns().ExecuteCommandAsync(); } + + public async Task ProjectMaintain(DroneSsnydEditReq req) + { + // todo shp 解析 + var project = req.MapTo(); + var oldProject = await Repository.GetByIdAsync(project.Id); + var geomid = oldProject.geomid; + var geometry = new DroneShpData() + { + gid = int.Parse(geomid), + geom = "" + }; + using var uow = base.UnitWork.CreateContext(); + var a = await uow.DroneShpData.AsUpdateable(geometry).IgnoreNullColumns().ExecuteCommandAsync(); + var b = await uow.DroneSsnyd.AsUpdateable(project).IgnoreNullColumns().ExecuteCommandAsync(); + if (a > 0 && b > 0) + { + uow.Commit(); + } + else + { + throw new Exception("更新失败"); + } + } } } \ No newline at end of file diff --git a/OpenAuth.App/ServiceApp/DroneSsnydManage/Request/DroneSsnydEditReq.cs b/OpenAuth.App/ServiceApp/DroneSsnydManage/Request/DroneSsnydEditReq.cs new file mode 100644 index 0000000..9440afe --- /dev/null +++ b/OpenAuth.App/ServiceApp/DroneSsnydManage/Request/DroneSsnydEditReq.cs @@ -0,0 +1,97 @@ +namespace OpenAuth.App.ServiceApp.DroneSsnydManage.Export; + +/// +///设施农用地主表 +/// +public class DroneSsnydEditReq +{ + + public string Id { get; set; } + /// + /// 项目编号 + /// + + public string xiangmu_no { get; set; } + + /// + /// 项目名称 + /// + + public string xiangmu_name { get; set; } + + /// + /// 乡镇 + /// + + public string streetname { get; set; } + + /// + /// 村庄 + /// + + + public string communityname { get; set; } + + /// + /// 权利人 + /// + + public string quanliren { get; set; } + + /// + /// 行政区划 + /// + + public string xingzhengquhua { get; set; } + + /// + /// 备案编号 + /// + + public string beian_no { get; set; } + + /// + /// 项目开始时间 + /// + + public DateTime? start_time { get; set; } + + /// + /// 项目结束时间 + /// + + public DateTime? end_time { get; set; } + + /// + /// 项目当前用途 + /// + + public string xiangmu_yt { get; set; } + + /// + /// 设施农业申请用地面积(公顷) + /// + + public decimal? shenqing_area { get; set; } + + /// + /// 生产设施用地(公顷) + /// + /// + /// + + public decimal? shengchan_area { get; set; } + + /// + /// 辅助设施用地(公顷) + /// + /// + /// + + public decimal? fuzhu_area { get; set; } + + /// + /// shp文件路径 + /// + public string shpPath { get; set; } +} \ No newline at end of file diff --git a/OpenAuth.Repository/SugarDbContext.cs b/OpenAuth.Repository/SugarDbContext.cs index 7a819a6..7832fd8 100644 --- a/OpenAuth.Repository/SugarDbContext.cs +++ b/OpenAuth.Repository/SugarDbContext.cs @@ -93,5 +93,6 @@ namespace OpenAuth.Repository public SugarRepositiry DroneCloudLandTask { get; set; } public SugarRepositiry DroneLandType { get; set; } public SugarRepositiry DroneImageRef { get; set; } + public SugarRepositiry DroneSsnyd { get; set; } } } diff --git a/OpenAuth.WebApi/Controllers/ServiceControllers/DroneSsnyController.cs b/OpenAuth.WebApi/Controllers/ServiceControllers/DroneSsnyController.cs index 3d9e517..0a10d90 100644 --- a/OpenAuth.WebApi/Controllers/ServiceControllers/DroneSsnyController.cs +++ b/OpenAuth.WebApi/Controllers/ServiceControllers/DroneSsnyController.cs @@ -3,6 +3,7 @@ using Infrastructure.Utilities.Excel; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using OpenAuth.App.ServiceApp.DroneSsnydManage; +using OpenAuth.App.ServiceApp.DroneSsnydManage.Export; using OpenAuth.App.ServiceApp.DroneSsnydManage.Request; using OpenAuth.Repository.Domain; @@ -121,8 +122,28 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers return response; } + /// + /// 项目维护 + /// + /// + /// + [HttpPost] + public async Task> ProjectMaintain(DroneSsnydEditReq req) + { + var response = new Response(); + try + { + await droneSsnyApp.ProjectMaintain(req); + response.Result = true; + } + catch (Exception ex) + { + response.Code = 500; + response.Message = ex.InnerException?.Message ?? ex.Message; + } - // todo 项目详情 停止生产 项目称交 + return response; + } /// /// 编号维护 ///