添加项目维护接口
parent
adca60a489
commit
4077c05e7d
|
|
@ -500,5 +500,29 @@ namespace OpenAuth.App.ServiceApp.DroneSsnydManage
|
|||
var project = req.MapTo<DroneSsnyd>();
|
||||
await Repository.AsUpdateable(project).IgnoreNullColumns().ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
public async Task ProjectMaintain(DroneSsnydEditReq req)
|
||||
{
|
||||
// todo shp 解析
|
||||
var project = req.MapTo<DroneSsnyd>();
|
||||
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("更新失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
namespace OpenAuth.App.ServiceApp.DroneSsnydManage.Export;
|
||||
|
||||
///<summary>
|
||||
///设施农用地主表
|
||||
/// </summary>
|
||||
public class DroneSsnydEditReq
|
||||
{
|
||||
|
||||
public string Id { get; set; }
|
||||
/// <summary>
|
||||
/// 项目编号
|
||||
/// </summary>
|
||||
|
||||
public string xiangmu_no { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目名称
|
||||
/// </summary>
|
||||
|
||||
public string xiangmu_name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 乡镇
|
||||
/// </summary>
|
||||
|
||||
public string streetname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 村庄
|
||||
/// </summary>
|
||||
|
||||
|
||||
public string communityname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 权利人
|
||||
/// </summary>
|
||||
|
||||
public string quanliren { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 行政区划
|
||||
/// </summary>
|
||||
|
||||
public string xingzhengquhua { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备案编号
|
||||
/// </summary>
|
||||
|
||||
public string beian_no { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目开始时间
|
||||
/// </summary>
|
||||
|
||||
public DateTime? start_time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目结束时间
|
||||
/// </summary>
|
||||
|
||||
public DateTime? end_time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目当前用途
|
||||
/// </summary>
|
||||
|
||||
public string xiangmu_yt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设施农业申请用地面积(公顷)
|
||||
/// </summary>
|
||||
|
||||
public decimal? shenqing_area { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生产设施用地(公顷)
|
||||
/// </summary>
|
||||
/// <param name="???"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
public decimal? shengchan_area { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 辅助设施用地(公顷)
|
||||
/// </summary>
|
||||
/// <param name="???"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
public decimal? fuzhu_area { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// shp文件路径
|
||||
/// </summary>
|
||||
public string shpPath { get; set; }
|
||||
}
|
||||
|
|
@ -93,5 +93,6 @@ namespace OpenAuth.Repository
|
|||
public SugarRepositiry<DroneCloudLandTask> DroneCloudLandTask { get; set; }
|
||||
public SugarRepositiry<DroneLandType> DroneLandType { get; set; }
|
||||
public SugarRepositiry<DroneImageRef> DroneImageRef { get; set; }
|
||||
public SugarRepositiry<DroneSsnyd> DroneSsnyd { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
/// <summary>
|
||||
/// 项目维护
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<Response<bool>> ProjectMaintain(DroneSsnydEditReq req)
|
||||
{
|
||||
var response = new Response<bool>();
|
||||
try
|
||||
{
|
||||
await droneSsnyApp.ProjectMaintain(req);
|
||||
response.Result = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
response.Code = 500;
|
||||
response.Message = ex.InnerException?.Message ?? ex.Message;
|
||||
}
|
||||
|
||||
// todo 项目详情 停止生产 项目称交
|
||||
return response;
|
||||
}
|
||||
/// <summary>
|
||||
/// 编号维护
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Reference in New Issue