导出修改

master
tq 2 months ago
parent 8ff5567328
commit 0777f188bf

@ -25,6 +25,10 @@ public class ChargeOrderDto
[ExporterHeader(DisplayName = "充电桩编号", IsBold = true)]
public string ChargerNo { get; set; }
[ExporterHeader(DisplayName = "仓位号", IsBold = true)]
public string BinNO { get; set; }
/// <summary>
/// Desc:电池编号
/// Default:
@ -56,7 +60,7 @@ public class ChargeOrderDto
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "充电时长", IsBold = true)]
[ExporterHeader(DisplayName = "充电时长/min", IsBold = true)]
public int ChargeTimeCount { get; set; }
/// <summary>

@ -14,6 +14,8 @@ public class ChargeOrderDto2
[ExporterHeader(DisplayName = "Order Number", IsBold = true)]
public string Sn { get; set; }
[ExporterHeader(DisplayName = "Battery Number", IsBold = true)]
public string BatteryNo { get; set; }
@ -21,6 +23,9 @@ public class ChargeOrderDto2
[ExporterHeader(DisplayName = "Charger Number", IsBold = true)]
public string ChargerNo { get; set; }
[ExporterHeader(DisplayName = "Location Number", IsBold = true)]
public string BinNO { get; set; }
[ExporterHeader(DisplayName = "Start Time", IsBold = true, Width = 30, Format = "yyyy-MM-dd HH:mm:ss",
AutoCenterColumn = true)]

@ -18,6 +18,10 @@ public class SwapLoseOrderDto
[ExporterHeader(DisplayName = "站号", IsBold = true)]
public string StationNumber { get; set; } = "2号站";
[ExporterHeader(DisplayName = "创建时间", IsBold = true, Width = 30, Format = "yyyy-MM-dd HH:mm:ss",
AutoCenterColumn = true)]
public DateTime? CreatedTime { get; set; }
[ExporterHeader(DisplayName = "开始时间", IsBold = true, Width = 30, Format = "yyyy-MM-dd HH:mm:ss",
AutoCenterColumn = true)]
@ -68,4 +72,7 @@ public class SwapLoseOrderDto
/// </summary>
[ExporterHeader(DisplayName = "失败原因", IsBold = true)]
public string FailReason { get; set; }
[ExporterHeader(DisplayName = "备注", IsBold = true)]
public decimal? Remark { get; set; }
}

@ -166,7 +166,7 @@ public class SwapOrderDto
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "soc", IsBold = true)]
[ExporterHeader(DisplayName = "soc%", IsBold = true)]
public decimal? UpBatterySoc { get; set; }
@ -199,7 +199,7 @@ public class SwapOrderDto
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "soc", IsBold = true)]
[ExporterHeader(DisplayName = "soc%", IsBold = true)]
public decimal? DownBatterySoc { get; set; }
@ -216,14 +216,14 @@ public class SwapOrderDto
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "订单编号", IsBold = true)]
[ExporterHeader(IsIgnore = true)]
public string Sn { get; set; }
/// <summary>
/// 换电服务费用
/// </summary>
[ExporterHeader(DisplayName = "换电服务费", IsBold = true)]
[ExporterHeader(DisplayName = "服务费", IsBold = true)]
public decimal? ServiceTotalFee { get; set; }
/// <summary>
@ -241,6 +241,9 @@ public class SwapOrderDto
/// <summary>
/// 总费用(所有的总费用)
/// </summary>
[ExporterHeader(DisplayName = "总费用(所有的总费用)", IsBold = true)]
[ExporterHeader(DisplayName = "总费用", IsBold = true)]
public decimal? TotalFee { get; set; }
[ExporterHeader(DisplayName = "备注", IsBold = true)]
public decimal? Remark { get; set; }
}

@ -70,6 +70,13 @@ public class ChargeOrderService : BaseServices<ChargeOrder>
if (language == "en")
{
List<ChargeOrderDto2> list2 = mapper.Map<List<ChargeOrderDto2>>(chargeOrders);
foreach (var chargeOrderDto in list2)
{
if (!string.IsNullOrEmpty(chargeOrderDto.ChargerNo))
{
chargeOrderDto.BinNO = chargeOrderDto.ChargerNo;
}
}
IExcelExporter excelExporter = new ExcelExporter();
var res = await excelExporter.ExportAsByteArray(list2);
return new FileStreamResult(new MemoryStream(res), "application/octet-stream")
@ -78,6 +85,13 @@ public class ChargeOrderService : BaseServices<ChargeOrder>
else
{
List<ChargeOrderDto> list = mapper.Map<List<ChargeOrderDto>>(chargeOrders);
foreach (var chargeOrderDto in list)
{
if (!string.IsNullOrEmpty(chargeOrderDto.ChargerNo))
{
chargeOrderDto.BinNO = chargeOrderDto.ChargerNo;
}
}
IExcelExporter excelExporter = new ExcelExporter();
var res = await excelExporter.ExportAsByteArray(list);
return new FileStreamResult(new MemoryStream(res), "application/octet-stream")

Loading…
Cancel
Save