using Infrastructure; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using OpenAuth.App.BaseApp.Shape; using OpenAuth.App.ServiceApp.DroneCaseInfoTaskManage; using OpenAuth.App.ServiceApp.DroneCaseInfoTaskManage.Request; using OpenAuth.App.ServiceApp.DroneCaseInfoTaskManage.Response; using OpenAuth.App.ServiceApp.DroneCloudQuery; using OpenAuth.App.ServiceApp.DroneCloudQueryManage.Request; using OpenAuth.App.ServiceApp.Response; using OpenAuth.Repository.Domain; namespace OpenAuth.WebApi.Controllers.ServiceControllers { /// /// shp导入 /// [Route("api/[controller]/[action]")] [ApiController] public class DroneCaseInfoTaskController : ControllerBase { private DroneCaseInfoTaskApp _app; public DroneCaseInfoTaskController(DroneCaseInfoTaskApp app) { _app = app; } /// ///添加案件截图任务 /// /// [HttpPost] public Response AddCaseInfoTask(AddCaseinfoTaskReq req) { var response = new Response(); if (string.IsNullOrEmpty(req.picihao)) throw new Exception("批次号不能为空"); try { response = _app.AddCaseInfoTask(req.caseinfoids, req.shplayerids,req.qianshixiang,req.houshixiang,req.picihao); } catch (Exception ex) { response.Code = 500; response.Message = ex.InnerException?.Message ?? ex.Message; } return response; } /// /// 获取需要查询的任务列表 /// /// [HttpGet] [AllowAnonymous] public async Task>> LoadDroneCaseInfoTask() { return await _app.LoadDroneCaseInfoTask(); } /// /// 添加数据查询结果 /// /// /// [HttpPost] [AllowAnonymous] public async Task> UpdateDroneCaseInfo(DroneCaseInfoTaskRes req) { var response = new Response(); try { response = await _app.UpdateDroneCaseInfo(req); } catch (Exception ex) { response.Code = 500; response.Message = ex.InnerException?.Message ?? ex.Message; } return response; } /// /// 添加数据查询结果--矿产 /// /// /// [HttpPost] [AllowAnonymous] public async Task> UpdateDroneCaseInfoMinerals(DroneCaseInfoTaskRes req) { var response = new Response(); try { response = await _app.UpdateDroneCaseInfoMinerals(req); } catch (Exception ex) { response.Code = 500; response.Message = ex.InnerException?.Message ?? ex.Message; } return response; } /// /// 根据批次号分页获取列表数据 /// /// 批次号 /// 图斑来源 /// 开始时间 /// 结束时间 /// 当前页 /// 每页条数 /// [HttpGet] [AllowAnonymous] public async Task>>> LoadDataBaseInfo(string picihao,string laiyuan, DateTime? begintime, DateTime? endtime, int page = 1, int limit = 15) { return await _app.LoadCaseImportInfoBypicihao(picihao,laiyuan,begintime,endtime, page, limit); } /// /// 查询图层信息 /// /// [HttpGet] public async Task>> LoadLayerInfo() { return await _app.LoadLayerInfo(); } /// /// shp导入 /// /// /// /// [HttpPost] public async Task> ImportCaseInfoShpData(string zipFilePath, string srid,string subjectname) { var result = new Response(); try { result = await _app.ImportCaseInfoShpData(zipFilePath, srid,subjectname); } catch (Exception ex) { result.Code = 500; result.Message = ex.InnerException?.Message ?? ex.Message; } return result; } /// /// 矿产shp导入 /// /// /// /// [HttpPost] public async Task> ImportMineralShpData(string zipFilePath, string srid, string subjectname) { var result = new Response(); try { result = await _app.ImportMineralShpData(zipFilePath, srid, subjectname); } catch (Exception ex) { result.Code = 500; result.Message = ex.InnerException?.Message ?? ex.Message; } return result; } /// ///添加前时像后时像信息 /// /// [HttpPost] [AllowAnonymous] public Response AddTubanshixiang(List req) { var response = new Response(); try { response = _app.AddTubanshixiang(req); } catch (Exception ex) { response.Code = 500; response.Message = ex.InnerException?.Message ?? ex.Message; } return response; } /// /// 获取需要查询的前时像后时像信息 /// /// [HttpGet] public async Task>> LoadTuBanshixiang() { return await _app.LoadTuBanshixiang(); } /// /// 更新进度值 /// /// /// /// [HttpGet] [AllowAnonymous] public Response UpdateDroneCaseInfoTask(string id,int rate) { var response = new Response(); try { response = _app.UpdateDroneCaseInfoTask(id,rate); } catch (Exception ex) { response.Code = 500; response.Message = ex.InnerException?.Message ?? ex.Message; } return response; } /// /// 查询任务信息 /// /// [HttpGet] public async Task> LoadDroneCaseInfobyid(string id) { return await _app.LoadDroneCaseInfobyid(id); } /// /// 根据用户获取需要查询的任务列表 /// /// [HttpGet] public async Task>> LoadDroneCaseInfoTaskByUser() { return await _app.LoadDroneCaseInfoTaskByUser(); } /// /// 查询最后一次导入数据 /// /// 专题名称 /// 当前页 /// 每页条数 /// [HttpGet] public async Task> LoadCaseImportInfoLast(string subjectname, int page = 1, int limit = 15) { return await _app.LoadCaseImportInfoLast(subjectname,page, limit); } /// /// 导入数据--不截图 /// /// 批次号 /// [HttpPost] [AllowAnonymous] public async Task> UpdateDroneCaseInfoT(string picihao) { var response = new Response(); try { response = await _app.UpdateDroneCaseInfoT(picihao); } catch (Exception ex) { response.Code = 500; response.Message = ex.InnerException?.Message ?? ex.Message; } return response; } /// /// 导入数据--矿产--不截图 /// /// /// [HttpPost] [AllowAnonymous] public async Task> UpdateDroneCaseInfoMineralsT(string picihao) { var response = new Response(); try { response = await _app.UpdateDroneCaseInfoMineralsT(picihao); } catch (Exception ex) { response.Code = 500; response.Message = ex.InnerException?.Message ?? ex.Message; } return response; } [HttpPost] public async Task> ImportCaseInfoShpDataSsny(string zipFilePath, string srid) { var response = new Response(); try { response = await _app.ImportCaseInfoShpDataSsny(zipFilePath, srid); } catch (Exception ex) { response.Code = 500; response.Message = ex.InnerException?.Message ?? ex.Message; } return response; } } }