计费字段改成decimal类型

master
tq 2 months ago
parent 78c79e4b58
commit 8faf0edb72

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

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

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

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

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

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

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

@ -57,11 +57,11 @@ public class SwapOrderSettleAnAccountTask : ITask
.In(swapOrder => swapOrder.Sn, list) .In(swapOrder => swapOrder.Sn, list)
.ToList(); .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) foreach (var swapOrderBattery in listSwapOrderBattery)
{ {
// 换上的满电包soc*满电包的电池标量 // 换上的满电包soc*满电包的电池标量
@ -76,7 +76,7 @@ public class SwapOrderSettleAnAccountTask : ITask
if (matchingOrder != null) if (matchingOrder != null)
{ {
matchingOrder.ServiceTotalFee = serviceTotalFee; matchingOrder.ServiceTotalFee = serviceTotalFee;
matchingOrder.ElectricityTotalFee = (int?)electricCharge; matchingOrder.ElectricityTotalFee = electricCharge;
matchingOrder.AppendTotalFee = appendTotalFee; matchingOrder.AppendTotalFee = appendTotalFee;
matchingOrder.TotalFee = matchingOrder.ServiceTotalFee + matchingOrder.ElectricityTotalFee + matchingOrder.TotalFee = matchingOrder.ServiceTotalFee + matchingOrder.ElectricityTotalFee +
matchingOrder.AppendTotalFee; matchingOrder.AppendTotalFee;

@ -401,6 +401,26 @@ public class SwapOrderController : ControllerBase
List<SwapOrderBatteryResp> swapOrderBattery = mapper.Map<List<SwapOrderBatteryResp>>(batteryList); List<SwapOrderBatteryResp> swapOrderBattery = mapper.Map<List<SwapOrderBatteryResp>>(batteryList);
// 换电订单 // 换电订单
List<SwapOrderResp> swapOrderResp = mapper.Map<List<SwapOrderResp>>(orderList); 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>(); List<string> vehicleNoList = swapOrderResp.Select(resp => resp.VehicleNo).ToList() ?? new List<string>();
// 查询车辆的部门 // 查询车辆的部门

Loading…
Cancel
Save