计费字段改成decimal类型

master
tq 2 months ago
parent 78c79e4b58
commit 8faf0edb72

@ -131,16 +131,16 @@
/// <summary>
/// 电费
/// </summary>
public int? ElectricityTotalFee { get; set; }
public decimal? ElectricityTotalFee { get; set; }
/// <summary>
/// 附加费
/// </summary>
public int? AppendTotalFee { get; set; }
public decimal? AppendTotalFee { get; set; }
/// <summary>
/// 总费用(所有的总费用)
/// </summary>
public int? TotalFee { get; set; }
public decimal? TotalFee { get; set; }
}
}

@ -139,16 +139,16 @@ namespace Entity.Api.Req
/// <summary>
/// 电费
/// </summary>
public int? ElectricityTotalFee { get; set; }
public decimal? ElectricityTotalFee { get; set; }
/// <summary>
/// 附加费
/// </summary>
public int? AppendTotalFee { get; set; }
public decimal? AppendTotalFee { get; set; }
/// <summary>
/// 总费用(所有的总费用)
/// </summary>
public int? TotalFee { get; set; }
public decimal? TotalFee { get; set; }
}
}

@ -54,15 +54,15 @@ public class StationConfigResp
/// <summary>
/// 服务费
/// </summary>
public int? ServiceTotalFee { get; set; }
public decimal? ServiceTotalFee { get; set; }
/// <summary>
/// 电费
/// </summary>
public int? ElectricityTotalFee { get; set; }
public decimal? ElectricityTotalFee { get; set; }
/// <summary>
/// 附加费
/// </summary>
public int? AppendTotalFee { get; set; }
public decimal? AppendTotalFee { get; set; }
}

@ -162,22 +162,22 @@ namespace Entity.Api.Resp
/// <summary>
/// 换电服务费用
/// </summary>
public int? ServiceTotalFee { get; set; }
public decimal? ServiceTotalFee { get; set; }
/// <summary>
/// 电费
/// </summary>
public int? ElectricityTotalFee { get; set; }
public decimal? ElectricityTotalFee { get; set; }
/// <summary>
/// 附加费
/// </summary>
public int? AppendTotalFee { get; set; }
public decimal? AppendTotalFee { get; set; }
/// <summary>
/// 总费用(所有的总费用)
/// </summary>
public int? TotalFee { get; set; }
public decimal? TotalFee { get; set; }
/// <summary>
/// 手动操作

@ -129,25 +129,25 @@ namespace Entity.DbModel.Station
/// 换电服务费用(单位分)
/// </summary>
[SugarColumn(ColumnName = "service_total_fee")]
public int? ServiceTotalFee { get; set; }
public decimal? ServiceTotalFee { get; set; }
/// <summary>
/// 电费(单位分)
/// </summary>
[SugarColumn(ColumnName = "electricity_total_fee")]
public int? ElectricityTotalFee { get; set; }
public decimal? ElectricityTotalFee { get; set; }
/// <summary>
/// 附加费(单位分)
/// </summary>
[SugarColumn(ColumnName = "append_total_fee")]
public int? AppendTotalFee { get; set; }
public decimal? AppendTotalFee { get; set; }
/// <summary>
/// 总费用(所有的总费用-单位分)
/// </summary>
[SugarColumn(ColumnName = "total_fee")]
public int? TotalFee { get; set; }
public decimal? TotalFee { get; set; }
}
}

@ -224,23 +224,23 @@ public class SwapOrderDto
/// 换电服务费用
/// </summary>
[ExporterHeader(DisplayName = "换电服务费用", IsBold = true)]
public int? ServiceTotalFee { get; set; }
public decimal? ServiceTotalFee { get; set; }
/// <summary>
/// 电费
/// </summary>
[ExporterHeader(DisplayName = "电费", IsBold = true)]
public int? ElectricityTotalFee { get; set; }
public decimal? ElectricityTotalFee { get; set; }
/// <summary>
/// 附加费
/// </summary>
[ExporterHeader(DisplayName = "附加费", IsBold = true)]
public int? AppendTotalFee { get; set; }
public decimal? AppendTotalFee { get; set; }
/// <summary>
/// 总费用(所有的总费用)
/// </summary>
[ExporterHeader(DisplayName = "总费用(所有的总费用)", IsBold = true)]
public int? TotalFee { get; set; }
public decimal? TotalFee { get; set; }
}

@ -118,17 +118,17 @@ public class SwapOrderDto2
/// 电费
/// </summary>
[ExporterHeader(DisplayName = "ELECTRIC CHARGE", IsBold = true)]
public int? ElectricityTotalFee { get; set; }
public decimal? ElectricityTotalFee { get; set; }
/// <summary>
/// 附加费
/// </summary>
[ExporterHeader(DisplayName = "ADDITIONAL CHARGE", IsBold = true)]
public int? AppendTotalFee { get; set; }
public decimal? AppendTotalFee { get; set; }
/// <summary>
/// 总费用(所有的总费用)
/// </summary>
[ExporterHeader(DisplayName = "TOTAL COST", IsBold = true)]
public int? TotalFee { get; set; }
public decimal? TotalFee { get; set; }
}

@ -316,21 +316,21 @@ public class StaticStationInfo
}
public static int ServiceTotalFee
public static decimal ServiceTotalFee
{
get => int.Parse(Resolve(StationParamConst.ServiceTotalFee));
get => decimal.Parse(Resolve(StationParamConst.ServiceTotalFee));
set => Set(StationParamConst.ServiceTotalFee, value);
}
public static int ElectricityTotalFee
public static decimal ElectricityTotalFee
{
get => int.Parse(Resolve(StationParamConst.ElectricityTotalFee));
get => decimal.Parse(Resolve(StationParamConst.ElectricityTotalFee));
set => Set(StationParamConst.ElectricityTotalFee, value);
}
public static int AppendTotalFee
public static decimal AppendTotalFee
{
get => int.Parse(Resolve(StationParamConst.AppendTotalFee));
get => decimal.Parse(Resolve(StationParamConst.AppendTotalFee));
set => Set(StationParamConst.AppendTotalFee, value);
}

@ -57,11 +57,11 @@ public class SwapOrderSettleAnAccountTask : ITask
.In(swapOrder => swapOrder.Sn, list)
.ToList();
// 电费单价
int electricityTotalFee = StaticStationInfo.ElectricityTotalFee;
decimal electricityTotalFee = StaticStationInfo.ElectricityTotalFee;
// 换电服务费用
int serviceTotalFee = StaticStationInfo.ServiceTotalFee;
decimal serviceTotalFee = StaticStationInfo.ServiceTotalFee;
// 附加费用
int appendTotalFee = StaticStationInfo.AppendTotalFee;
decimal appendTotalFee = StaticStationInfo.AppendTotalFee;
foreach (var swapOrderBattery in listSwapOrderBattery)
{
// 换上的满电包soc*满电包的电池标量
@ -76,7 +76,7 @@ public class SwapOrderSettleAnAccountTask : ITask
if (matchingOrder != null)
{
matchingOrder.ServiceTotalFee = serviceTotalFee;
matchingOrder.ElectricityTotalFee = (int?)electricCharge;
matchingOrder.ElectricityTotalFee = electricCharge;
matchingOrder.AppendTotalFee = appendTotalFee;
matchingOrder.TotalFee = matchingOrder.ServiceTotalFee + matchingOrder.ElectricityTotalFee +
matchingOrder.AppendTotalFee;

@ -401,6 +401,26 @@ public class SwapOrderController : ControllerBase
List<SwapOrderBatteryResp> swapOrderBattery = mapper.Map<List<SwapOrderBatteryResp>>(batteryList);
// 换电订单
List<SwapOrderResp> swapOrderResp = mapper.Map<List<SwapOrderResp>>(orderList);
foreach (var orderResp in swapOrderResp)
{
if (orderResp.ServiceTotalFee.HasValue)
{
orderResp.ServiceTotalFee = Math.Round(orderResp.ServiceTotalFee.Value / 100m, 2);
}
if (orderResp.ElectricityTotalFee.HasValue)
{
orderResp.ElectricityTotalFee = Math.Round(orderResp.ElectricityTotalFee.Value / 100m, 2);
}
if (orderResp.AppendTotalFee.HasValue)
{
orderResp.AppendTotalFee = Math.Round(orderResp.AppendTotalFee.Value / 100m, 2);
}
if (orderResp.TotalFee.HasValue)
{
orderResp.TotalFee = Math.Round(orderResp.TotalFee.Value / 100m, 2);
}
}
List<string> vehicleNoList = swapOrderResp.Select(resp => resp.VehicleNo).ToList() ?? new List<string>();
// 查询车辆的部门

Loading…
Cancel
Save