修改电价类型,增加订单导出

master
tq 6 months ago
parent 6aee59ce6c
commit 4568ec8aaa

@ -122,10 +122,10 @@
/// Default:0
/// Nullable:True
/// </summary>
public int? SwapModel { get; set; }
public int? SwapWay { get; set; }
/// <summary>
/// 换电电池
/// </summary>
public List<SwapOrderBatteryReq> batteryList;
public List<SwapOrderBatteryReq> batteryList { get; set; }
}
}

@ -10,11 +10,25 @@ public partial class ElecPriceModelVersionDetailReq
/// 版本
/// </summary>
public int Version {get;set;}
private double _price;
/// <summary>
/// 价格
/// Desc:价格;以分为单位存储
/// Default:
/// Nullable:True
/// </summary>
// public int? Price {get;set;}
public double Price { get; set; }
// [SugarColumn(ColumnName="price")]
public double Price
{
get => _price;
set
{
if (value < 0)
{
throw new ArgumentException("电价不能为负数");
}
_price = Math.Round(value, 4);
}
}

@ -130,10 +130,10 @@ namespace Entity.Api.Req
/// Default:0
/// Nullable:True
/// </summary>
public int? SwapModel { get; set; }
public int? SwapWay { get; set; }
/// <summary>
/// 换电电池
/// </summary>
public List<UpdateSwapOrderBatteryReq> batteryList;
public List<UpdateSwapOrderBatteryReq> batteryList { get; set; }
}
}

@ -53,4 +53,11 @@ public class QuerySwapOrderPageReq : QueryPageModel
/// Nullable:True
/// </summary>
public int SwapResult { get; set; }
/// <summary>
/// Desc:换电类型
/// Default:0
/// Nullable:True
/// </summary>
public int? SwapWay { get; set; }
}

@ -5,7 +5,12 @@
///</summary>
public class SwapOrderBatteryReq
{
/// <summary>
/// Desc:id
/// Default:
/// Nullable:False
/// </summary>
public int Id { get; set; }
/// <summary>
/// Desc:亏电包编码
/// Default:

@ -2,13 +2,8 @@
namespace Entity.Api.Req;
public class UpdateSwapOrderBatteryReq:SwapOrderBatteryReq
public class UpdateSwapOrderBatteryReq :SwapOrderBatteryReq
{
/// <summary>
/// Desc:id
/// Default:
/// Nullable:False
/// </summary>
[Required]
public int Id { get; set; }
}

@ -124,6 +124,11 @@ namespace Entity.Api.Resp
/// 云平台订单号
/// </summary>
public string? CloudSn { get; set; }
/// <summary>
/// 换电类型
/// </summary>
public int? SwapWay { get; set; }
///// <summary>
///// 换电电池
///// </summary>

@ -61,14 +61,26 @@ namespace Entity.DbModel.Station
[SugarColumn(ColumnName = "end_second")]
public int EndSecond { get; set; }
private double _price;
/// <summary>
/// Desc:价格;以分为单位存储
/// Default:
/// Nullable:True
/// </summary>
// [SugarColumn(ColumnName="price")]
// public int? Price {get;set;}
public double Price { get; set; }
public double Price
{
get => _price;
set
{
if (value < 0)
{
throw new ArgumentException("电价不能为负数");
}
_price = Math.Round(value, 4);
}
}
/// <summary>
/// Desc:尖峰平谷类型;1-尖2-峰3-平4-谷

@ -0,0 +1,315 @@
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
namespace Entity.Dto;
[ExcelExporter(Name = "充电订单", TableStyle = OfficeOpenXml.Table.TableStyles.None, AutoFitAllColumn = true)]
public class ChargeOrderDto
{
/// <summary>
/// Desc:订单编号
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "订单编号", IsBold = true)]
public string Sn { get; set; }
/// <summary>
/// Desc:电池编号
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "电池编号", IsBold = true)]
public string BatteryNo { get; set; }
/// <summary>
/// Desc:启动报文状态;0-初始化1-启动成功
/// Default:0
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "启动报文状态", IsBold = true)]
public int? CmdStatus { get; set; }
/// <summary>
/// Desc:充电机编号
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "充电机编号", IsBold = true)]
public string ChargerNo { get; set; }
/// <summary>
/// Desc:充电枪编号
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "充电枪编号", IsBold = true)]
public string ChargerGunNo { get; set; }
/// <summary>
/// 0站内充电 1站外充电
/// </summary>
[ExporterHeader(DisplayName = "充电位置", IsBold = true)]
public int ChargeMode { get; set; }
/// <summary>
/// 1站控启动 2本地启动
/// </summary>
[ExporterHeader(DisplayName = "启动方式", IsBold = true)]
public int StartMode { get; set; }
/// <summary>
/// 充电开始时间
/// </summary>
[ExporterHeader(DisplayName = "充电开始时间", IsBold = true,Width = 25)]
public DateTime? StartTime { get; set; }
/// <summary>
/// Desc:充电结束时间
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "充电结束时间", IsBold = true,Width = 25)]
public DateTime? EndTime { get; set; }
/// <summary>
/// Desc:充电开始soc
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "充电开始soc", IsBold = true)]
public int? StartSoc { get; set; }
/// <summary>
/// Desc:充电结束soc
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "充电结束soc", IsBold = true)]
public int? StopSoc { get; set; }
/// <summary>
/// Desc:充电时长
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "充电时长", IsBold = true)]
public int ChargeTimeCount { get; set; }
/// <summary>
/// Desc:充电电量
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "充电电量", IsBold = true)]
public decimal? ElecCount { get; set; }
/// <summary>
/// Desc:充电开始交流表电量
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "充电开始交流表电量", IsBold = true)]
public decimal? StartAcElec { get; set; }
/// <summary>
/// Desc:充电结束交流表电量
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "充电结束交流表电量", IsBold = true)]
public decimal? StopAcElec { get; set; }
/// <summary>
/// Desc:充电开始直流表电量
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "充电开始直流表电量", IsBold = true)]
public decimal? StartDcElec { get; set; }
/// <summary>
/// Desc:充电结束直流表电量
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "充电结束直流表电量", IsBold = true)]
public decimal? StopDcElec { get; set; }
/// <summary>
/// Desc:停止原因;0满电自动停止1-人工停止
/// Default:0
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "停止原因", IsBold = true)]
public int? StopReason { get; set; }
/// <summary>
/// Desc:尖时段电量
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "尖时段电量", IsBold = true)]
public decimal? SharpElecCount { get; set; }
/// <summary>
/// Desc:峰时段电量
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "峰时段电量", IsBold = true)]
public decimal? PeakElecCount { get; set; }
/// <summary>
/// Desc:平时段电量
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "平时段电量", IsBold = true)]
public decimal? FlatElecCount { get; set; }
/// <summary>
/// Desc:谷时段电量
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "谷时段电量", IsBold = true)]
public decimal? ValleyElecCount { get; set; }
/// <summary>
/// Desc:尖时段交流电量
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "尖时段交流电量", IsBold = true)]
public decimal? ACSharpElecCount { get; set; }
/// <summary>
/// Desc:峰时段交流电量
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "峰时段交流电量", IsBold = true)]
public decimal? ACPeakElecCount { get; set; }
/// <summary>
/// Desc:平时段交流电量
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "平时段交流电量", IsBold = true)]
public decimal? ACFlatElecCount { get; set; }
/// <summary>
/// Desc:谷时段交流电量
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "谷时段交流电量", IsBold = true)]
public decimal? ACValleyElecCount { get; set; }
/// <summary>
/// Desc:电价版本号
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "电价版本号", IsBold = true)]
public string ElecPriceModelVersion { get; set; }
/// <summary>
/// Desc:换电订单编号
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "换电订单编号", IsBold = true)]
public string SwapOrderSn { get; set; }
/// <summary>
/// Desc:上传云平台状态;0-未上传1-已上传
/// Default:0
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "上传云平台状态", IsBold = true)]
public int? CloudReportStatus { get; set; }
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "创建人", IsBold = true)]
public string CreatedBy { get; set; }
/// <summary>
/// Desc:创建时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "创建时间", IsBold = true,Width = 25)]
public DateTime? CreatedTime { get; set; }
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "更新人", IsBold = true,Width = 25)]
public string UpdatedBy { get; set; }
/// <summary>
/// Desc:更新时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "更新时间", IsBold = true)]
public DateTime? UpdatedTime { get; set; }
/// <summary>
/// 云平台充电订单
/// </summary>
[ExporterHeader(DisplayName = "云平台充电订单", IsBold = true)]
public string? CloudChargeOrder { get; set; }
/// <summary>
/// Desc:是否可以上传云平台
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "是否可以上传云平台", IsBold = true)]
public int? CanUpload { get; set; }
}

@ -0,0 +1,114 @@
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
namespace Entity.Dto;
/// <summary>
/// 换电订单导出
/// </summary>
[ExcelExporter(Name = "换电订单", TableStyle = OfficeOpenXml.Table.TableStyles.None, AutoFitAllColumn = true)]
public class SwapOrderDto
{
/// <summary>
/// Desc:订单编号
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "订单编号", IsBold = true)]
public string Sn { get; set; }
/// <summary>
/// Desc:车牌号
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "车牌号", IsBold = true)]
public string VehicleNo { get; set; }
/// <summary>
/// Desc:车辆mac
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "车辆mac", IsBold = true)]
public string VehicleMac { get; set; }
/// <summary>
/// Desc:车辆vin码
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "车辆vin码", IsBold = true)]
public string VehicleVin { get; set; }
/// <summary>
/// Desc:车辆进场时间
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "车辆进场时间", IsBold = true,Width = 25)]
public DateTime? VehicleEnterTime { get; set; }
/// <summary>
/// Desc:车辆离场时间
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "车辆离场时间", IsBold = true,Width = 25)]
public DateTime? VehicleLeaveTime { get; set; }
/// <summary>
/// Desc:换电开始时间
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "换电开始时间", IsBold = true,Width = 25)]
public DateTime? SwapBeginTime { get; set; }
/// <summary>
/// Desc:换电结束时间
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "换电结束时间", IsBold = true,Width = 25)]
public DateTime? SwapEndTime { get; set; }
/// <summary>
/// Desc:换电结果;0-未知1-成功2-失败
/// Default:0
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "换电结果", IsBold = true)]
public int? SwapResult { get; set; }
/// <summary>
/// Desc:失败原因
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "失败原因", IsBold = true)]
public string FailReason { get; set; }
/// <summary>
/// Desc:上传云平台状态;0-未上传1-已上传
/// Default:0
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "上传云平台状态", IsBold = true)]
public int? CloudReportStatus { get; set; }
/// <summary>
/// 云平台订单号
/// </summary>
[ExporterHeader(DisplayName = "云平台订单号", IsBold = true)]
public string? CloudSn { get; set; }
/// <summary>
/// Desc:换电类型:;1自动换电;2手动换电
/// Default:0
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "换电类型", IsBold = true)]
public int? SwapWay { get; set; }
}

@ -1,5 +1,7 @@
using System.Linq.Expressions;
using Entity.DbModel.Station;
using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkCore.Entity;
using SqlSugar;
namespace Repository.Station;
@ -11,4 +13,57 @@ public class ChargeOrderRepository : BaseRepository<ChargeOrder>
public ChargeOrderRepository(ISqlSugarClient sqlSugar) : base(sqlSugar)
{
}
public IPage<ChargeOrder> QueryIPage(QueryPageModel page, Expression<Func<ChargeOrder, bool>> predicate)
{
if (null == predicate)
{
return QueryPage(page);
}
int totalCount = 0;
List<ChargeOrder> pageList = DbBaseClient
.Queryable<ChargeOrder>()
.Where(predicate)
.OrderByDescending(x => x.CreatedTime)
.WithNoLockOrNot(false)
.ToPageList(page.PageNum, page.PageSize, ref totalCount);
return new IPage<ChargeOrder>(totalCount, page, pageList);
}
/// <summary>
/// 查询需要导出充电订单
/// </summary>
/// <param name="predicate"></param>
/// <returns></returns>
public async Task<List<ChargeOrder>> QueryChargeOrderList(Expression<Func<ChargeOrder, bool>> predicate)
{
if (predicate == null)
{
return await QueryAsync();
}
List<ChargeOrder> resultList = await DbBaseClient
.Queryable<ChargeOrder>()
.Where(predicate)
.WithNoLockOrNot(false)
.ToListAsync();
return resultList;
}
public IPage<ChargeOrder> QueryPage(QueryPageModel page)
{
int totalCount = 0;
List<ChargeOrder> pageList = DbBaseClient
.Queryable<ChargeOrder>()
.OrderByDescending(x => x.CreatedTime)
.WithNoLockOrNot(false)
.ToPageList(page.PageNum, page.PageSize, ref totalCount);
return new IPage<ChargeOrder>(totalCount, page, pageList);
}
}

@ -1,14 +1,73 @@
using System.Linq.Expressions;
using Entity.DbModel.Station;
using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkCore.Entity;
using SqlSugar;
namespace Repository.Station;
[Scope("SingleInstance")]
public class SwapOrderRepository:BaseRepository<SwapOrder>
public class SwapOrderRepository : BaseRepository<SwapOrder>
{
public SwapOrderRepository(ISqlSugarClient sqlSugar) : base(sqlSugar)
{
}
/// <summary>
/// 查询需要导出换电订单
/// </summary>
/// <param name="predicate"></param>
/// <returns></returns>
public async Task<List<SwapOrder>> QuerySwapOrderList(Expression<Func<SwapOrder, bool>> predicate)
{
if (predicate == null)
{
return await QueryAsync();
}
List<SwapOrder> resultList = await DbBaseClient
.Queryable<SwapOrder>()
.Where(predicate)
.WithNoLockOrNot(false)
.ToListAsync();
return resultList;
}
public IPage<SwapOrder> QueryIPage(QueryPageModel page, Expression<Func<SwapOrder, bool>> predicate)
{
if (null == predicate)
{
return QueryPage(page);
}
int totalCount = 0;
List<SwapOrder> pageList = DbBaseClient
.Queryable<SwapOrder>()
.Where(predicate)
.OrderByDescending(x => x.CreatedTime)
.WithNoLockOrNot(false)
.ToPageList(page.PageNum, page.PageSize, ref totalCount);
return new IPage<SwapOrder>(totalCount, page, pageList);
}
public IPage<SwapOrder> QueryPage(QueryPageModel page)
{
int totalCount = 0;
List<SwapOrder> pageList = DbBaseClient
.Queryable<SwapOrder>()
.OrderByDescending(x => x.CreatedTime)
.WithNoLockOrNot(false)
.ToPageList(page.PageNum, page.PageSize, ref totalCount);
return new IPage<SwapOrder>(totalCount, page, pageList);
}
}

@ -1,10 +1,15 @@
using System.Linq.Expressions;
using AutoMapper;
using Entity.Api.Req;
using Entity.Api.Resp;
using Entity.DbModel.Station;
using Entity.Dto;
using Entity.Dto.Req;
using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkCore.Entity;
using HybirdFrameworkCore.Utils;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.Mvc;
using Repository.Station;
using Service.Cloud.Client;
@ -37,6 +42,56 @@ public class ChargeOrderService : BaseServices<ChargeOrder>
ParameterExpression parameter = Expression.Parameter(typeof(ChargeOrder), "u");
#region 构建动态查询树
where = queryTree(chargeOrder, where, parameter);
#endregion
//查询
return PageResult<ChargeOrderResp>.ConvertPage(chargeOrderRepository.QueryIPage(chargeOrder, where));
}
/// <summary>
/// 导出充电订单
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public async Task<IActionResult> ExportChargeOrder(QueryChargeOrderReq chargeOrder)
{
// 查询订单
List<ChargeOrder> chargeOrders = await QueryChargeOrderListAsync(chargeOrder);
var config = new MapperConfiguration(cfg =>
{ cfg.CreateMap<ChargeOrderDto, ChargeOrder>().ReverseMap(); });
IMapper mapper = config.CreateMapper();
List<ChargeOrderDto> list = mapper.Map<List<ChargeOrderDto>>(chargeOrders);
IExcelExporter excelExporter = new ExcelExporter();
var res = await excelExporter.ExportAsByteArray(list);
return new FileStreamResult(new MemoryStream(res), "application/octet-stream")
{ FileDownloadName = DateTime.Now.ToString("yyyyMMddHHmm") + "充电订单.xlsx" };
}
/// <summary>
/// 查询需要导出订单
/// </summary>
/// <param name="chargeOrder"></param>
/// <returns></returns>
public async Task<List<ChargeOrder>> QueryChargeOrderListAsync(QueryChargeOrderReq chargeOrder)
{
Expression<Func<ChargeOrder, bool>> where = null;
ParameterExpression parameter = Expression.Parameter(typeof(ChargeOrder), "u");
#region 构建动态查询树
where = queryTree(chargeOrder, where, parameter);
#endregion
// 查询需要导出充电订单 不分页
return await chargeOrderRepository.QueryChargeOrderList(where);
}
private static Expression<Func<ChargeOrder, bool>>? queryTree(QueryChargeOrderReq chargeOrder, Expression<Func<ChargeOrder, bool>>? where, ParameterExpression parameter)
{
if (chargeOrder.Id != 0)
{
Expression<Func<ChargeOrder, bool>> condition1Expr = u => u.Id == chargeOrder.Id;
@ -101,13 +156,11 @@ public class ChargeOrderService : BaseServices<ChargeOrder>
Expression<Func<ChargeOrder, bool>> condition2Expr = u => u.CloudChargeOrder == chargeOrder.CloudChargeOrder;
where = where == null ? condition2Expr : Expression.Lambda<Func<ChargeOrder, bool>>(Expression.AndAlso(where.Body, condition2Expr.Body), parameter);
}
#endregion
//查询
return PageResult<ChargeOrderResp>.ConvertPage(chargeOrderRepository.QueryIPageByCause(chargeOrder, where));
return where;
}
/// <summary>
///
/// </summary>

@ -6,6 +6,10 @@ using HybirdFrameworkCore.Entity;
using Repository.Station;
using SqlSugar;
using System.Linq.Expressions;
using AutoMapper;
using Entity.Dto;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.Mvc;
using Service.Mgr;
namespace Service.Station;
@ -40,8 +44,44 @@ public class SwapOrderService : BaseServices<SwapOrder>
return SwapOrderMgr.UploadCloud(list,2) ? Result<bool>.Success() : Result<bool>.Fail();
}
/// <summary>
/// 导出充电订单
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public async Task<IActionResult> ExportSwapOrder(QuerySwapOrderPageReq swapOrder)
{
// 查询订单
List<SwapOrder> swapOrders = await QuerySwapOrderListAsync(swapOrder);
var config = new MapperConfiguration(cfg => { cfg.CreateMap<SwapOrderDto, SwapOrder>().ReverseMap(); });
IMapper mapper = config.CreateMapper();
List<SwapOrderDto> list = mapper.Map<List<SwapOrderDto>>(swapOrders);
IExcelExporter excelExporter = new ExcelExporter();
var res = await excelExporter.ExportAsByteArray(list);
return new FileStreamResult(new MemoryStream(res), "application/octet-stream")
{ FileDownloadName = DateTime.Now.ToString("yyyyMMddHHmm") + "换电订单.xlsx" };
}
/// <summary>
/// 查询需要导出换电订单
/// </summary>
/// <param name="swapOrder"></param>
/// <returns></returns>
public async Task<List<SwapOrder>> QuerySwapOrderListAsync(QuerySwapOrderPageReq swapOrder)
{
Expression<Func<SwapOrder, bool>> where = null;
ParameterExpression parameter = Expression.Parameter(typeof(SwapOrder), "u");
#region 构建动态查询树
where = queryTree(swapOrder, where, parameter);
#endregion
// 查询需要导出充电订单 不分页
return await swapOrderRepository.QuerySwapOrderList(where);
}
/// <summary>
/// 根据条件查询分页数据
/// </summary>
@ -56,6 +96,25 @@ public class SwapOrderService : BaseServices<SwapOrder>
#region 构建动态查询树
where = queryTree(swapOrder, where, parameter);
#endregion
//查询
//var swapOrderResp = PageResult<SwapOrderResp>.ConvertPage(swapOrderRepository.QueryIPageByCause(swapOrder, where));
//for (int i = 0; i < swapOrderResp.Rows.Count; i++)
//{
// swapOrderResp.Rows[0].BatteryList.AddRange()
//}
//List<SwapOrderBatteryResp> BatteryList = new List<SwapOrderBatteryResp>();
//List<SwapOrderStepResp> StepList = new List<SwapOrderStepResp>();
return PageResult<SwapOrderResp>.ConvertPage(swapOrderRepository.QueryIPage(swapOrder, where));
}
private static Expression<Func<SwapOrder, bool>>? queryTree(QuerySwapOrderPageReq swapOrder, Expression<Func<SwapOrder, bool>>? where, ParameterExpression parameter)
{
if (!string.IsNullOrEmpty(swapOrder.Sn))
{
Expression<Func<SwapOrder, bool>> condition2Expr = u => u.Sn == swapOrder.Sn;
@ -119,18 +178,6 @@ public class SwapOrderService : BaseServices<SwapOrder>
parameter);
}
#endregion
//查询
//var swapOrderResp = PageResult<SwapOrderResp>.ConvertPage(swapOrderRepository.QueryIPageByCause(swapOrder, where));
//for (int i = 0; i < swapOrderResp.Rows.Count; i++)
//{
// swapOrderResp.Rows[0].BatteryList.AddRange()
//}
//List<SwapOrderBatteryResp> BatteryList = new List<SwapOrderBatteryResp>();
//List<SwapOrderStepResp> StepList = new List<SwapOrderStepResp>();
return PageResult<SwapOrderResp>.ConvertPage(swapOrderRepository.QueryIPageByCause(swapOrder, where));
return where;
}
}

@ -56,7 +56,17 @@ public class ChargeOrderController : ControllerBase
}
}
/// <summary>
/// 充电订单导出
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
[Route("export")]
public async Task<IActionResult> ExportChargeOrder([FromBody] QueryChargeOrderReq req)
{
return await chargeOrderService.ExportChargeOrder(req);
}
/// <summary>
/// 充电订单上报云端,入参传 CloudChargeOrder
/// </summary>

@ -199,7 +199,17 @@ public class SwapOrderController : ControllerBase
}
}
/// <summary>
/// 换电订单导出
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
[Route("export")]
public async Task<IActionResult> ExportSwapOrder([FromBody] QuerySwapOrderPageReq req)
{
return await swapOrderService.ExportSwapOrder(req);
}
/// <summary>
/// 换电订单上报云端
/// </summary>

@ -24,3 +24,5 @@ CREATE TABLE `manual_operation_record` (
`type` int DEFAULT NULL COMMENT '人工操作;1人工确认成功;2人工确认失败',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- 修改电价模型表,字段类型
ALTER TABLE elec_price_model_version_detail MODIFY COLUMN price DOUBLE;

Loading…
Cancel
Save