lanlingxian_ziranziyuanhegu.../OpenAuth.WebApi/Controllers/ServiceControllers/DroneSsnyController.cs

152 lines
5.1 KiB
C#
Raw Normal View History

using Infrastructure;
using Infrastructure.Utilities.Excel;
using Microsoft.AspNetCore.Mvc;
using OpenAuth.App.ServiceApp.DroneSsnydManage;
using OpenAuth.App.ServiceApp.DroneSsnydManage.Request;
using OpenAuth.Repository.Domain;
namespace OpenAuth.WebApi.Controllers.ServiceControllers
{
/// <summary>
/// 批后监管--项目信息
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class DroneSsnyController : ControllerBase
{
DroneSsnyApp droneSsnyApp;
public DroneSsnyController(DroneSsnyApp droneSsnyApp)
{
this.droneSsnyApp = droneSsnyApp;
}
/// <summary>
2025-05-20 17:20:40 +08:00
/// 到期预警
/// </summary>
2025-05-21 16:03:36 +08:00
/// <param name="xiangmumc">项目名称</param>
/// <param name="countyid">县</param>
/// <param name="streetid">镇</param>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <returns></returns>
[HttpGet]
public Response<PageInfo<List<DroneSsnyd>>> TimeoutWarning(string xiangmumc, string countyid, string streetid,
int page, int limit)
{
var response = new Response<PageInfo<List<DroneSsnyd>>>();
try
{
response.Result = droneSsnyApp.TimeoutWarning(xiangmumc, countyid, streetid, page, limit);
}
catch (Exception ex)
{
response.Code = 500;
response.Message = ex.InnerException?.Message ?? ex.Message;
}
return response;
}
/// <summary>
/// 超期报警
/// </summary>
2025-05-21 16:03:36 +08:00
/// <param name="xiangmumc">项目名称</param>
/// <param name="countyid">县</param>
/// <param name="streetid">镇</param>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <returns></returns>
[HttpGet]
public Response<PageInfo<List<DroneSsnyd>>> TimeOutAlarmList(string xiangmumc, string countyid, string streetid,
int page, int limit)
{
var response = new Response<PageInfo<List<DroneSsnyd>>>();
try
{
2025-05-21 16:03:36 +08:00
response.Result = droneSsnyApp.TimeOutAlarmList(xiangmumc, countyid, streetid, page, limit);
}
catch (Exception ex)
{
response.Code = 500;
response.Message = ex.InnerException?.Message ?? ex.Message;
}
return response;
}
/// <summary>
/// 历史项目
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpGet]
public Response<PageInfo<List<DroneSsnyd>>> HistoryProject(DroneSnnyAppPageReq req)
{
var response = new Response<PageInfo<List<DroneSsnyd>>>();
try
{
response.Result = droneSsnyApp.HistoryProject(req);
}
catch (Exception ex)
{
response.Code = 500;
response.Message = ex.InnerException?.Message ?? ex.Message;
}
return response;
}
/// <summary>
/// 项目变更列表
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpGet]
public Response<PageInfo<List<DroneSsnyd>>> ProjectChange(DroneSnnyAppPageReq req)
{
var response = new Response<PageInfo<List<DroneSsnyd>>>();
try
{
response.Result = droneSsnyApp.ProjectChange(req);
}
catch (Exception ex)
{
response.Code = 500;
response.Message = ex.InnerException?.Message ?? ex.Message;
}
return response;
}
// todo 项目列表
/// <summary>
/// 历史项目导出
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpGet]
public IActionResult HistoryProjectExport([FromQuery] DroneSnnyAppReq req)
{
var data = droneSsnyApp.HistoryProjectList(req);
var x = ExcelExporter.ExportToExcel(data, "历史项目");
return File(x.Result.ToArray(),
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"历史项目导出" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xlsx");
}
/// <summary>
/// 项目变更导出
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpGet]
public IActionResult ProjectChangeExport([FromQuery] DroneSnnyAppReq req)
{
var data = droneSsnyApp.ProjectChangeExport(req);
var x = ExcelExporter.ExportToExcel(data, "项目变更");
return File(x.Result.ToArray(),
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"项目变更导出" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xlsx");
}
}
}