2025-03-31 16:40:54 +08:00
|
|
|
|
using Infrastructure;
|
2025-03-21 16:42:48 +08:00
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
using OpenAuth.App.ServiceApp.FireManagement;
|
2025-03-28 16:41:12 +08:00
|
|
|
|
using OpenAuth.App.ServiceApp.FireManagement.Request;
|
2025-03-21 16:42:48 +08:00
|
|
|
|
using OpenAuth.App.ServiceApp.FireManagement.Response;
|
|
|
|
|
|
using OpenAuth.Repository.Domain.FireManagement;
|
|
|
|
|
|
|
|
|
|
|
|
namespace OpenAuth.WebApi.Controllers.ServiceControllers.FireManagement
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 防火管理模块
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Route("api/[controller]/[action]")]
|
|
|
|
|
|
[ApiController]
|
|
|
|
|
|
public class FireManagementController : ControllerBase
|
|
|
|
|
|
{
|
|
|
|
|
|
private readonly FireManagementApp _app;
|
|
|
|
|
|
|
|
|
|
|
|
public FireManagementController(FireManagementApp app)
|
|
|
|
|
|
{
|
|
|
|
|
|
_app = app;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 下发防火线索任务
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="info">防火任信息</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
public async Task<Response<bool>> IssuedFireClueTask(FmFireclueTask info)
|
|
|
|
|
|
{
|
|
|
|
|
|
Response<bool> response = new Response<bool>();
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
return await _app.IssuedFireClueTask(info);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
response.Code = 500;
|
|
|
|
|
|
response.Message = ex.InnerException?.Message ?? ex.Message;
|
|
|
|
|
|
}
|
|
|
|
|
|
return response;
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
2025-03-21 16:44:51 +08:00
|
|
|
|
/// 查询接收人员
|
2025-03-21 16:42:48 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="username"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet]
|
2025-03-22 08:42:21 +08:00
|
|
|
|
public async Task<Response<List<SysUserResp>>> LoadFireClueUser(string username, string unitname)
|
2025-03-21 16:42:48 +08:00
|
|
|
|
{
|
|
|
|
|
|
Response<List<SysUserResp>> response = new Response<List<SysUserResp>>();
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2025-03-22 08:42:21 +08:00
|
|
|
|
return await _app.LoadFireClueUser(username, unitname);
|
2025-03-21 16:42:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
response.Code = 500;
|
|
|
|
|
|
response.Message = ex.InnerException?.Message ?? ex.Message;
|
|
|
|
|
|
}
|
|
|
|
|
|
return response;
|
|
|
|
|
|
}
|
2025-03-21 17:02:41 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询任务列表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="username"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
|
public async Task<Response<List<FmFireclueTask>>> GetTaskList()
|
|
|
|
|
|
{
|
|
|
|
|
|
Response<List<FmFireclueTask>> response = new Response<List<FmFireclueTask>>();
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
return await _app.GetTaskList();
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
response.Code = 500;
|
|
|
|
|
|
response.Message = ex.InnerException?.Message ?? ex.Message;
|
|
|
|
|
|
}
|
|
|
|
|
|
return response;
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询人员单位信息
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
2025-03-22 08:42:21 +08:00
|
|
|
|
[HttpGet]
|
2025-03-21 17:02:41 +08:00
|
|
|
|
public async Task<Response<List<FmUserUnit>>> GetUserUnit()
|
|
|
|
|
|
{
|
|
|
|
|
|
Response<List<FmUserUnit>> response = new Response<List<FmUserUnit>>();
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
return await _app.GetUserUnit();
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
response.Code = 500;
|
|
|
|
|
|
response.Message = ex.InnerException?.Message ?? ex.Message;
|
|
|
|
|
|
}
|
|
|
|
|
|
return response;
|
|
|
|
|
|
}
|
2025-03-27 14:52:07 +08:00
|
|
|
|
#region 人员单位管理
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 添加人员单位
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="info"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
public async Task<Response<bool>> AddUserUnit(FmUserUnit info)
|
|
|
|
|
|
{
|
|
|
|
|
|
Response<bool> response = new Response<bool>();
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
return await _app.AddUserUnit(info);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
response.Code = 500;
|
|
|
|
|
|
response.Message = ex.InnerException?.Message ?? ex.Message;
|
|
|
|
|
|
}
|
|
|
|
|
|
return response;
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 编辑人员单位
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="info"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
public async Task<Response<bool>> EditUserUnit(FmUserUnit info)
|
|
|
|
|
|
{
|
|
|
|
|
|
Response<bool> response = new Response<bool>();
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
return await _app.EditUserUnit(info);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
response.Code = 500;
|
|
|
|
|
|
response.Message = ex.InnerException?.Message ?? ex.Message;
|
|
|
|
|
|
}
|
|
|
|
|
|
return response;
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 删除人员单位
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
public async Task<Response<bool>> DeleteUserUnit(long id)
|
|
|
|
|
|
{
|
|
|
|
|
|
Response<bool> response = new Response<bool>();
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
return await _app.DeleteUserUnit(id);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
response.Code = 500;
|
|
|
|
|
|
response.Message = ex.InnerException?.Message ?? ex.Message;
|
|
|
|
|
|
}
|
|
|
|
|
|
return response;
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取单条人员单位
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet]
|
2025-03-29 16:42:55 +08:00
|
|
|
|
|
2025-03-27 14:52:07 +08:00
|
|
|
|
public async Task<Response<FmUserUnit>> LoadUserUnitById(long id)
|
|
|
|
|
|
{
|
|
|
|
|
|
Response<FmUserUnit> response = new Response<FmUserUnit>();
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
return await _app.LoadUserUnitById(id);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
response.Code = 500;
|
|
|
|
|
|
response.Message = ex.InnerException?.Message ?? ex.Message;
|
|
|
|
|
|
}
|
|
|
|
|
|
return response;
|
|
|
|
|
|
}
|
2025-03-29 16:42:55 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 人员单位信息导入
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="formFiles"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
public Response<bool> FireUserUnitUpload(IFormFileCollection formFiles)
|
|
|
|
|
|
{
|
|
|
|
|
|
Response<bool> response = new Response<bool>();
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
return _app.FireUserUnitUpload(formFiles);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
response.Code = 500;
|
|
|
|
|
|
response.Message = ex.InnerException?.Message ?? ex.Message;
|
|
|
|
|
|
}
|
|
|
|
|
|
return response;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-27 14:52:07 +08:00
|
|
|
|
#endregion
|
2025-03-24 15:08:45 +08:00
|
|
|
|
#region 火情线索
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 添加火情线索
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="info"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
public async Task<Response<bool>> AddFireClueInfo(FmFireclueInfo info)
|
|
|
|
|
|
{
|
|
|
|
|
|
Response<bool> response = new Response<bool>();
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
return await _app.AddFireClueInfo(info);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
response.Code = 500;
|
|
|
|
|
|
response.Message = ex.InnerException?.Message ?? ex.Message;
|
|
|
|
|
|
}
|
|
|
|
|
|
return response;
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询火情线索
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
|
public async Task<Response<FmFireclueInfo>> LoadClueInfoById(long id)
|
|
|
|
|
|
{
|
|
|
|
|
|
Response<FmFireclueInfo> response = new Response<FmFireclueInfo>();
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
return await _app.LoadClueInfoById(id);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
response.Code = 500;
|
|
|
|
|
|
response.Message = ex.InnerException?.Message ?? ex.Message;
|
|
|
|
|
|
}
|
|
|
|
|
|
return response;
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询火情线索列表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
|
public async Task<Response<List<FmFireclueInfo>>> GetFireClueList()
|
|
|
|
|
|
{
|
|
|
|
|
|
Response<List<FmFireclueInfo>> response = new Response<List<FmFireclueInfo>>();
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
return await _app.GetFireClueList();
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
response.Code = 500;
|
|
|
|
|
|
response.Message = ex.InnerException?.Message ?? ex.Message;
|
|
|
|
|
|
}
|
|
|
|
|
|
return response;
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 按日期统计火情线索
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="type">1-月,2-年</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
|
public async Task<Response<List<FireInfoForChart>>> GetFireClueStatistics(int type)
|
|
|
|
|
|
{
|
|
|
|
|
|
Response<List<FireInfoForChart>> response = new Response<List<FireInfoForChart>>();
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
return await _app.GetFireClueStatistics(type);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
response.Code = 500;
|
|
|
|
|
|
response.Message = ex.InnerException?.Message ?? ex.Message;
|
|
|
|
|
|
}
|
|
|
|
|
|
return response;
|
|
|
|
|
|
}
|
2025-03-25 10:13:47 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 按状态统计火情线索
|
|
|
|
|
|
/// </summary>
|
2025-03-27 14:19:20 +08:00
|
|
|
|
/// <param name="type">1-日,2-月,3-年</param>
|
2025-03-25 10:13:47 +08:00
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
|
public async Task<Response<List<FireInfoStateForChart>>> GetFireClueStatisticsByState(int type)
|
|
|
|
|
|
{
|
|
|
|
|
|
Response<List<FireInfoStateForChart>> response = new Response<List<FireInfoStateForChart>>();
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
return await _app.GetFireClueStatisticsByState(type);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
response.Code = 500;
|
|
|
|
|
|
response.Message = ex.InnerException?.Message ?? ex.Message;
|
|
|
|
|
|
}
|
|
|
|
|
|
return response;
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 按等级统计火情线索
|
|
|
|
|
|
/// </summary>
|
2025-03-27 14:19:20 +08:00
|
|
|
|
/// <param name="type">1-日,2-月,3-年</param>
|
2025-03-25 10:13:47 +08:00
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
|
public async Task<Response<List<FireInfoDegreeForChart>>> GetFireClueStatisticsByDegreeType(int type)
|
|
|
|
|
|
{
|
|
|
|
|
|
Response<List<FireInfoDegreeForChart>> response = new Response<List<FireInfoDegreeForChart>>();
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
return await _app.GetFireClueStatisticsByDegreeType(type);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
response.Code = 500;
|
|
|
|
|
|
response.Message = ex.InnerException?.Message ?? ex.Message;
|
|
|
|
|
|
}
|
|
|
|
|
|
return response;
|
|
|
|
|
|
}
|
2025-03-24 15:08:45 +08:00
|
|
|
|
#endregion
|
2025-03-28 16:41:12 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 在线情况
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="pageReq"></param>
|
|
|
|
|
|
/// <returns></returns>
|
2025-03-29 09:25:52 +08:00
|
|
|
|
[HttpPost]
|
2025-03-28 16:41:12 +08:00
|
|
|
|
public async Task<Response<PageInfo<dynamic>>> GetPointUserOnLine(UserOnLineReq pageReq)
|
|
|
|
|
|
{
|
|
|
|
|
|
Response<PageInfo<dynamic>> response = new Response<PageInfo<dynamic>>();
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
return await _app.GetPointUserOnLine(pageReq);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
response.Code = 500;
|
|
|
|
|
|
response.Message = ex.InnerException?.Message ?? ex.Message;
|
|
|
|
|
|
}
|
|
|
|
|
|
return response;
|
|
|
|
|
|
}
|
2025-03-31 16:40:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 添加人员坐标点
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="info">坐标点</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
|
public async Task<Response<bool>> AddPoint(FmUserPoint info)
|
|
|
|
|
|
{
|
|
|
|
|
|
return await _app.AddPointAsync(info);
|
|
|
|
|
|
}
|
2025-03-21 16:42:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|