添加项目变更导出,历史项目导出
parent
dda93c6284
commit
06cf46503f
|
|
@ -0,0 +1,14 @@
|
||||||
|
namespace Infrastructure.Utilities.Excel;
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
[AttributeUsage(AttributeTargets.Property)]
|
||||||
|
public class ExcelColumnAttribute : Attribute
|
||||||
|
{
|
||||||
|
public string HeaderName { get; }
|
||||||
|
|
||||||
|
public ExcelColumnAttribute(string headerName)
|
||||||
|
{
|
||||||
|
HeaderName = headerName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,124 @@
|
||||||
|
using System.Reflection;
|
||||||
|
using NPOI.SS.UserModel;
|
||||||
|
using NPOI.SS.Util;
|
||||||
|
using NPOI.XSSF.UserModel;
|
||||||
|
|
||||||
|
namespace Infrastructure.Utilities.Excel;
|
||||||
|
|
||||||
|
public class ExcelExporter
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="data"></param>
|
||||||
|
/// <param name="filePath"></param>
|
||||||
|
/// <typeparam name="T"></typeparam>
|
||||||
|
/// <exception cref="ArgumentException"></exception>
|
||||||
|
public static Response<MemoryStream> ExportToExcel<T>(IEnumerable<T> data, string headerTitle) where T : class
|
||||||
|
{
|
||||||
|
var workbook = new XSSFWorkbook();
|
||||||
|
var sheet = workbook.CreateSheet("Sheet1");
|
||||||
|
|
||||||
|
// 获取实体类的属性信息,并筛选出标记了ExcelColumnAttribute的特性
|
||||||
|
PropertyInfo[] properties = typeof(T).GetProperties()
|
||||||
|
.Where(p => p.GetCustomAttribute<ExcelColumnAttribute>() != null)
|
||||||
|
.ToArray();
|
||||||
|
|
||||||
|
var rowIndex = 0;
|
||||||
|
if (!string.IsNullOrEmpty(headerTitle))
|
||||||
|
{
|
||||||
|
var headerTitleRow = sheet.CreateRow(rowIndex++);
|
||||||
|
sheet.AddMergedRegion(new CellRangeAddress(0, 0, 0, properties.Length - 1));
|
||||||
|
var cell = headerTitleRow.CreateCell(0);
|
||||||
|
cell.SetCellValue(headerTitle);
|
||||||
|
var style = workbook.CreateCellStyle();
|
||||||
|
var font = workbook.CreateFont();
|
||||||
|
font.FontName = "方正小标宋简体";
|
||||||
|
font.FontHeightInPoints = 36;
|
||||||
|
font.IsBold = true;
|
||||||
|
style.SetFont(font);
|
||||||
|
style.BorderBottom = BorderStyle.Thin;
|
||||||
|
style.BorderLeft = BorderStyle.Thin;
|
||||||
|
style.BorderRight = BorderStyle.Thin;
|
||||||
|
style.BorderTop = BorderStyle.Thin;
|
||||||
|
style.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center;
|
||||||
|
style.VerticalAlignment = VerticalAlignment.Center;
|
||||||
|
style.WrapText = true;
|
||||||
|
cell.CellStyle = style;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 写入表头
|
||||||
|
var headerRow = sheet.CreateRow(rowIndex++);
|
||||||
|
for (var i = 0; i < properties.Length; i++)
|
||||||
|
{
|
||||||
|
// 自动调节列宽
|
||||||
|
sheet.AutoSizeColumn(i);
|
||||||
|
var cell = headerRow.CreateCell(i);
|
||||||
|
cell.SetCellValue(properties[i].GetCustomAttribute<ExcelColumnAttribute>()?.HeaderName);
|
||||||
|
// 应用表头样式
|
||||||
|
var headerStyleAttr = properties[i].GetCustomAttribute<ExcelHeaderStyleAttribute>();
|
||||||
|
var style = workbook.CreateCellStyle();
|
||||||
|
if (headerStyleAttr != null)
|
||||||
|
{
|
||||||
|
var font = workbook.CreateFont();
|
||||||
|
font.FontName = headerStyleAttr.FontName;
|
||||||
|
font.FontHeightInPoints = (short)headerStyleAttr.FontSize;
|
||||||
|
font.IsBold = true;
|
||||||
|
style.SetFont(font);
|
||||||
|
// 填充模式
|
||||||
|
style.FillPattern = FillPattern.SolidForeground;
|
||||||
|
style.WrapText = true;
|
||||||
|
// 设置边框样式
|
||||||
|
style.BorderBottom = BorderStyle.Thin;
|
||||||
|
style.BorderLeft = BorderStyle.Thin;
|
||||||
|
style.BorderRight = BorderStyle.Thin;
|
||||||
|
style.BorderTop = BorderStyle.Thin;
|
||||||
|
style.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center;
|
||||||
|
style.VerticalAlignment = VerticalAlignment.Center;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var font = workbook.CreateFont();
|
||||||
|
font.FontName = "Microsoft YaHei";
|
||||||
|
font.FontHeightInPoints = 12f;
|
||||||
|
font.IsBold = true;
|
||||||
|
style.SetFont(font);
|
||||||
|
// 填充模式
|
||||||
|
style.FillPattern = FillPattern.SolidForeground;
|
||||||
|
style.WrapText = true;
|
||||||
|
// 设置边框样式
|
||||||
|
style.BorderBottom = BorderStyle.Thin;
|
||||||
|
style.BorderLeft = BorderStyle.Thin;
|
||||||
|
style.BorderRight = BorderStyle.Thin;
|
||||||
|
style.BorderTop = BorderStyle.Thin;
|
||||||
|
style.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center;
|
||||||
|
style.VerticalAlignment = VerticalAlignment.Center;
|
||||||
|
}
|
||||||
|
|
||||||
|
cell.CellStyle = style;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var item in data)
|
||||||
|
{
|
||||||
|
var row = sheet.CreateRow(rowIndex++);
|
||||||
|
for (var i = 0; i < properties.Length; i++)
|
||||||
|
{
|
||||||
|
var cell = row.CreateCell(i);
|
||||||
|
cell.SetCellValue(properties[i].GetValue(item)?.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var response = new Response<MemoryStream>
|
||||||
|
{
|
||||||
|
Result = new MemoryStream()
|
||||||
|
};
|
||||||
|
// MemoryStream中写入数据
|
||||||
|
workbook.Write(response.Result);
|
||||||
|
workbook.Close();
|
||||||
|
response.Result.Close();
|
||||||
|
response.Result.Dispose();
|
||||||
|
response.Code = 200;
|
||||||
|
response.Message = "获取成功";
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
using Color = System.Drawing.Color;
|
||||||
|
|
||||||
|
namespace Infrastructure.Utilities.Excel;
|
||||||
|
// 用于Color类型
|
||||||
|
|
||||||
|
// 自定义特性类,用于存储表头样式信息
|
||||||
|
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property, Inherited = false)]
|
||||||
|
public class ExcelHeaderStyleAttribute : Attribute
|
||||||
|
{
|
||||||
|
public string FontName { get; set; }
|
||||||
|
public float FontSize { get; set; }
|
||||||
|
public string FontColor { get; set; }
|
||||||
|
public bool Bold { get; set; }
|
||||||
|
public bool Italic { get; set; }
|
||||||
|
public HorizontalAlignment HorizontalAlignment { get; set; } // 注意:这里的HorizontalAlignment需要自定义或引用相关枚举
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 构造函数,用于初始化特性
|
||||||
|
public ExcelHeaderStyleAttribute(string fontName, float fontSize, string fontColor, bool bold, bool italic,
|
||||||
|
HorizontalAlignment horizontalAlignment)
|
||||||
|
{
|
||||||
|
FontName = fontName;
|
||||||
|
FontSize = fontSize;
|
||||||
|
FontColor = fontColor;
|
||||||
|
Bold = bold;
|
||||||
|
Italic = italic;
|
||||||
|
HorizontalAlignment = horizontalAlignment;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 为了方便,可以提供一个简化的构造函数
|
||||||
|
public ExcelHeaderStyleAttribute() : this("Microsoft YaHei", 12f, "black", false, false, HorizontalAlignment.General)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 自定义的HorizontalAlignment枚举(如果未从其他库引用)
|
||||||
|
public enum HorizontalAlignment
|
||||||
|
{
|
||||||
|
General,
|
||||||
|
Left,
|
||||||
|
Center,
|
||||||
|
Right,
|
||||||
|
Fill,
|
||||||
|
Justify,
|
||||||
|
CenterContinuous,
|
||||||
|
Distributed
|
||||||
|
}
|
||||||
|
|
@ -1,13 +1,11 @@
|
||||||
using Infrastructure;
|
using Infrastructure;
|
||||||
using OpenAuth.App.BaseApp.Base;
|
using OpenAuth.App.BaseApp.Base;
|
||||||
using OpenAuth.App.Interface;
|
using OpenAuth.App.Interface;
|
||||||
|
using OpenAuth.App.ServiceApp.DroneSsnydManage.Export;
|
||||||
using OpenAuth.App.ServiceApp.DroneSsnydManage.Request;
|
using OpenAuth.App.ServiceApp.DroneSsnydManage.Request;
|
||||||
using OpenAuth.Repository;
|
using OpenAuth.Repository;
|
||||||
using OpenAuth.Repository.Domain;
|
using OpenAuth.Repository.Domain;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Infrastructure;
|
|
||||||
using DocumentFormat.OpenXml.Spreadsheet;
|
|
||||||
using NPOI.SS.Formula.Functions;
|
|
||||||
|
|
||||||
namespace OpenAuth.App.ServiceApp.DroneSsnydManage
|
namespace OpenAuth.App.ServiceApp.DroneSsnydManage
|
||||||
{
|
{
|
||||||
|
|
@ -24,18 +22,19 @@ namespace OpenAuth.App.ServiceApp.DroneSsnydManage
|
||||||
/// <param name="pageIndex"></param>
|
/// <param name="pageIndex"></param>
|
||||||
/// <param name="pageSize"></param>
|
/// <param name="pageSize"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public PageInfo<List<DroneSsnyd>> TimeoutWarning(string xiangmumc, string countyid, string streetid, int pageIndex, int pageSize)
|
public PageInfo<List<DroneSsnyd>> TimeoutWarning(string xiangmumc, string countyid, string streetid,
|
||||||
|
int pageIndex, int pageSize)
|
||||||
{
|
{
|
||||||
int totalCount = 0;
|
int totalCount = 0;
|
||||||
var endTime = DateTime.Now.AddMonths(2);
|
var endTime = DateTime.Now.AddMonths(2);
|
||||||
|
|
||||||
var list = base.Repository.AsQueryable()
|
var list = base.Repository.AsQueryable()
|
||||||
.WhereIF(!string.IsNullOrEmpty(xiangmumc),a=>a.xiangmu_name.Contains(xiangmumc))
|
.WhereIF(!string.IsNullOrEmpty(xiangmumc), a => a.xiangmu_name.Contains(xiangmumc))
|
||||||
.WhereIF(!string.IsNullOrEmpty(countyid),a=>a.countyid==countyid)
|
.WhereIF(!string.IsNullOrEmpty(countyid), a => a.countyid == countyid)
|
||||||
.WhereIF(!string.IsNullOrEmpty(streetid),a=>a.streetid==streetid)
|
.WhereIF(!string.IsNullOrEmpty(streetid), a => a.streetid == streetid)
|
||||||
.Where(a => a.end_time <= endTime&&a.end_time>DateTime.Now)
|
.Where(a => a.end_time <= endTime && a.end_time > DateTime.Now)
|
||||||
.OrderBy(a => a.end_time, OrderByType.Desc)
|
.OrderBy(a => a.end_time, OrderByType.Desc)
|
||||||
.ToPageList(pageIndex, pageSize, ref totalCount);
|
.ToPageList(pageIndex, pageSize, ref totalCount);
|
||||||
|
|
||||||
return new PageInfo<List<DroneSsnyd>>
|
return new PageInfo<List<DroneSsnyd>>
|
||||||
{
|
{
|
||||||
|
|
@ -50,18 +49,19 @@ namespace OpenAuth.App.ServiceApp.DroneSsnydManage
|
||||||
/// <param name="pageIndex"></param>
|
/// <param name="pageIndex"></param>
|
||||||
/// <param name="pageSize"></param>
|
/// <param name="pageSize"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public PageInfo<List<DroneSsnyd>> TimeOutAlarmList(string xiangmumc, string countyid, string streetid, int pageIndex, int pageSize)
|
public PageInfo<List<DroneSsnyd>> TimeOutAlarmList(string xiangmumc, string countyid, string streetid,
|
||||||
|
int pageIndex, int pageSize)
|
||||||
{
|
{
|
||||||
int totalCount = 0;
|
int totalCount = 0;
|
||||||
var endTime = DateTime.Now;
|
var endTime = DateTime.Now;
|
||||||
|
|
||||||
var list = base.Repository.AsQueryable()
|
var list = base.Repository.AsQueryable()
|
||||||
.WhereIF(!string.IsNullOrEmpty(xiangmumc), a => a.xiangmu_name.Contains(xiangmumc))
|
.WhereIF(!string.IsNullOrEmpty(xiangmumc), a => a.xiangmu_name.Contains(xiangmumc))
|
||||||
.WhereIF(!string.IsNullOrEmpty(countyid), a => a.countyid == countyid)
|
.WhereIF(!string.IsNullOrEmpty(countyid), a => a.countyid == countyid)
|
||||||
.WhereIF(!string.IsNullOrEmpty(streetid), a => a.streetid == streetid)
|
.WhereIF(!string.IsNullOrEmpty(streetid), a => a.streetid == streetid)
|
||||||
.Where(a => a.end_time<endTime)
|
.Where(a => a.end_time < endTime)
|
||||||
.OrderBy(a => a.end_time, OrderByType.Desc)
|
.OrderBy(a => a.end_time, OrderByType.Desc)
|
||||||
.ToPageList(pageIndex, pageSize, ref totalCount);
|
.ToPageList(pageIndex, pageSize, ref totalCount);
|
||||||
|
|
||||||
return new PageInfo<List<DroneSsnyd>>
|
return new PageInfo<List<DroneSsnyd>>
|
||||||
{
|
{
|
||||||
|
|
@ -112,5 +112,63 @@ namespace OpenAuth.App.ServiceApp.DroneSsnydManage
|
||||||
Total = totalCount
|
Total = totalCount
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<DroneSsnydExport> HistoryProjectList(DroneSnnyAppReq req)
|
||||||
|
{
|
||||||
|
var list = Repository.AsQueryable()
|
||||||
|
.Where(a => a.handle_status_id == 99)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(req.xiangmu_no), a => a.xiangmu_no.Contains(req.xiangmu_no))
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(req.xiangmumc), a => a.xiangmumc.Contains(req.xiangmumc))
|
||||||
|
.Select(
|
||||||
|
a => new DroneSsnydExport()
|
||||||
|
{
|
||||||
|
xiangmu_no = a.xiangmu_no,
|
||||||
|
xiangmu_name = a.xiangmu_name,
|
||||||
|
streetname = a.streetname,
|
||||||
|
communityname = a.communityname,
|
||||||
|
quanliren = a.quanliren,
|
||||||
|
xingzhengquhua = a.xingzhengquhua,
|
||||||
|
beian_no = a.beian_no,
|
||||||
|
start_time = a.start_time,
|
||||||
|
end_time = a.end_time,
|
||||||
|
xiangmu_yt = a.xiangmu_yt,
|
||||||
|
shengchan_area = a.shengchan_area,
|
||||||
|
fuzhu_area = a.fuzhu_area,
|
||||||
|
shenqing_area = a.shenqing_area,
|
||||||
|
handle_status_name = a.handle_status_name,
|
||||||
|
xiafatime = a.xiafatime
|
||||||
|
})
|
||||||
|
.ToList();
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<DroneSsnydExport> ProjectChangeExport(DroneSnnyAppReq req)
|
||||||
|
{
|
||||||
|
var list = Repository.AsQueryable()
|
||||||
|
.Where(a => a.handle_status_id != 99)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(req.xiangmu_no), a => a.xiangmu_no.Contains(req.xiangmu_no))
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(req.xiangmumc), a => a.xiangmumc.Contains(req.xiangmumc))
|
||||||
|
.Select(
|
||||||
|
a => new DroneSsnydExport()
|
||||||
|
{
|
||||||
|
xiangmu_no = a.xiangmu_no,
|
||||||
|
xiangmu_name = a.xiangmu_name,
|
||||||
|
streetname = a.streetname,
|
||||||
|
communityname = a.communityname,
|
||||||
|
quanliren = a.quanliren,
|
||||||
|
xingzhengquhua = a.xingzhengquhua,
|
||||||
|
beian_no = a.beian_no,
|
||||||
|
start_time = a.start_time,
|
||||||
|
end_time = a.end_time,
|
||||||
|
xiangmu_yt = a.xiangmu_yt,
|
||||||
|
shengchan_area = a.shengchan_area,
|
||||||
|
fuzhu_area = a.fuzhu_area,
|
||||||
|
shenqing_area = a.shenqing_area,
|
||||||
|
handle_status_name = a.handle_status_name,
|
||||||
|
xiafatime = a.xiafatime
|
||||||
|
})
|
||||||
|
.ToList();
|
||||||
|
return list;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,105 @@
|
||||||
|
using Infrastructure.Utilities.Excel;
|
||||||
|
|
||||||
|
namespace OpenAuth.App.ServiceApp.DroneSsnydManage.Export;
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///设施农用地主表
|
||||||
|
/// </summary>
|
||||||
|
[ExcelHeaderStyle]
|
||||||
|
public class DroneSsnydExport
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 项目编号
|
||||||
|
/// </summary>
|
||||||
|
[ExcelColumn("项目编号")]
|
||||||
|
public string xiangmu_no { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 项目名称
|
||||||
|
/// </summary>
|
||||||
|
[ExcelColumn("项目名称")]
|
||||||
|
public string xiangmu_name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 镇街道
|
||||||
|
/// </summary>
|
||||||
|
[ExcelColumn("多镇")]
|
||||||
|
public string streetname { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 村庄
|
||||||
|
/// </summary>
|
||||||
|
|
||||||
|
[ExcelColumn("村庄")]
|
||||||
|
public string communityname { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 权利人
|
||||||
|
/// </summary>
|
||||||
|
[ExcelColumn("权利人")]
|
||||||
|
public string quanliren { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 行政区划
|
||||||
|
/// </summary>
|
||||||
|
[ExcelColumn("行政区划")]
|
||||||
|
public string xingzhengquhua { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 备案编号
|
||||||
|
/// </summary>
|
||||||
|
[ExcelColumn("备案编号")]
|
||||||
|
public string beian_no { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 开始时间
|
||||||
|
/// </summary>
|
||||||
|
[ExcelColumn("开始时间")]
|
||||||
|
public DateTime? start_time { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 结束时间
|
||||||
|
/// </summary>
|
||||||
|
[ExcelColumn("结束时间")]
|
||||||
|
public DateTime? end_time { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 项目当前用途
|
||||||
|
/// </summary>
|
||||||
|
[ExcelColumn("项目当前用途")]
|
||||||
|
public string xiangmu_yt { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设施农业申请用地面积(公顷)
|
||||||
|
/// </summary>
|
||||||
|
[ExcelColumn("设施农业申请用地面积(公顷)")]
|
||||||
|
public decimal? shenqing_area { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 生产设施用地(公顷)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="???"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[ExcelColumn("生产设施用地(公顷)")]
|
||||||
|
public decimal? shengchan_area { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 辅助设施用地(公顷)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="???"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[ExcelColumn("辅助设施用地(公顷)")]
|
||||||
|
public decimal? fuzhu_area { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 下发时间
|
||||||
|
/// </summary>
|
||||||
|
[ExcelColumn("下发时间")]
|
||||||
|
public DateTime? xiafatime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 项目状态
|
||||||
|
/// </summary>
|
||||||
|
[ExcelColumn("项目状态")]
|
||||||
|
public string handle_status_name { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
using OpenAuth.App.Request;
|
||||||
|
|
||||||
|
namespace OpenAuth.App.ServiceApp.DroneSsnydManage.Request;
|
||||||
|
|
||||||
|
public class DroneSnnyAppReq
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 项目名称
|
||||||
|
/// </summary>
|
||||||
|
public string xiangmumc { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 项目编号
|
||||||
|
/// </summary>
|
||||||
|
public string xiangmu_no { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using Infrastructure;
|
using Infrastructure;
|
||||||
|
using Infrastructure.Utilities.Excel;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using OpenAuth.App.ServiceApp.DroneSsnydManage;
|
using OpenAuth.App.ServiceApp.DroneSsnydManage;
|
||||||
using OpenAuth.App.ServiceApp.DroneSsnydManage.Request;
|
using OpenAuth.App.ServiceApp.DroneSsnydManage.Request;
|
||||||
|
|
@ -30,12 +31,13 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
||||||
/// <param name="pageSize"></param>
|
/// <param name="pageSize"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public Response<PageInfo<List<DroneSsnyd>>> TimeoutWarning(string xiangmumc, string countyid, string streetid, int page, int limit)
|
public Response<PageInfo<List<DroneSsnyd>>> TimeoutWarning(string xiangmumc, string countyid, string streetid,
|
||||||
|
int page, int limit)
|
||||||
{
|
{
|
||||||
var response = new Response<PageInfo<List<DroneSsnyd>>>();
|
var response = new Response<PageInfo<List<DroneSsnyd>>>();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
response.Result = droneSsnyApp.TimeoutWarning(xiangmumc, countyid, streetid,page, limit);
|
response.Result = droneSsnyApp.TimeoutWarning(xiangmumc, countyid, streetid, page, limit);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
@ -56,7 +58,8 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
||||||
/// <param name="pageSize"></param>
|
/// <param name="pageSize"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public Response<PageInfo<List<DroneSsnyd>>> TimeOutAlarmList(string xiangmumc, string countyid,string streetid,int page, int limit)
|
public Response<PageInfo<List<DroneSsnyd>>> TimeOutAlarmList(string xiangmumc, string countyid, string streetid,
|
||||||
|
int page, int limit)
|
||||||
{
|
{
|
||||||
var response = new Response<PageInfo<List<DroneSsnyd>>>();
|
var response = new Response<PageInfo<List<DroneSsnyd>>>();
|
||||||
try
|
try
|
||||||
|
|
@ -71,7 +74,7 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 历史项目
|
/// 历史项目
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -115,5 +118,35 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
||||||
|
|
||||||
return response;
|
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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue