diff --git a/Service/MyTask/SwapOrderSettleAnAccountTask.cs b/Service/MyTask/SwapOrderSettleAnAccountTask.cs index ce0834b..e9fbb40 100644 --- a/Service/MyTask/SwapOrderSettleAnAccountTask.cs +++ b/Service/MyTask/SwapOrderSettleAnAccountTask.cs @@ -82,17 +82,20 @@ public class SwapOrderSettleAnAccountTask : ITask // 电量费用 decimal? electricCharge = (upNominalEnergy - downNominalEnergy) * electricityTotalFee; - - var matchingOrder = swapOrderList.FirstOrDefault(order => order.Sn == swapOrderBattery.SwapOrderSn); - if (matchingOrder != null) + + if (upNominalEnergy != null && downNominalEnergy != null && electricCharge != null) { - matchingOrder.ServiceTotalFee = serviceTotalFee; - matchingOrder.ElectricityTotalFee = electricCharge; - matchingOrder.AppendTotalFee = appendTotalFee; - matchingOrder.TotalFee = matchingOrder.ServiceTotalFee + matchingOrder.ElectricityTotalFee + - matchingOrder.AppendTotalFee; - // 标记换电订单已经算了订单价钱 - swapOrderBattery.SettleAnAccountFlag = 1; + var matchingOrder = swapOrderList.FirstOrDefault(order => order.Sn == swapOrderBattery.SwapOrderSn); + if (matchingOrder != null) + { + matchingOrder.ServiceTotalFee = serviceTotalFee; + matchingOrder.ElectricityTotalFee = electricCharge; + matchingOrder.AppendTotalFee = appendTotalFee; + matchingOrder.TotalFee = matchingOrder.ServiceTotalFee + matchingOrder.ElectricityTotalFee + + matchingOrder.AppendTotalFee; + // 标记换电订单已经算了订单价钱 + swapOrderBattery.SettleAnAccountFlag = 1; + } } } diff --git a/WebStarter/Program.cs b/WebStarter/Program.cs index 893f7aa..d7d4e5b 100644 --- a/WebStarter/Program.cs +++ b/WebStarter/Program.cs @@ -227,6 +227,7 @@ TaskInit.Init(); var supportedCultures = new List { new CultureInfo("en"), + new CultureInfo("id"), new CultureInfo("zh") }; diff --git a/WebStarter/Resources/Controllers.SwapMonitorController.en.resx b/WebStarter/Resources/Controllers.SwapMonitorController.en.resx index c8f0866..142dc62 100644 --- a/WebStarter/Resources/Controllers.SwapMonitorController.en.resx +++ b/WebStarter/Resources/Controllers.SwapMonitorController.en.resx @@ -43,48 +43,48 @@ - Masa luang + Idel - Kendaraan tiba Radar pintu masuk mendeteksikendaraan masuk + RadarInFlag - Deteksi status PLC + Plc - Pemindaian RFID selesai + RfidReadFlag - Deteksi radar kedua kali + Carradar - Kendaraan sampai di lokasi + SelectPackSuccess - Pemilihan selesai + CarInPositionFlag - Kendaraan membuka kunci + VelUnlockFlag - Mengeluarkan pemilihan PLC + DistributeSelectPackFlag - Mulai ganti baterai + StartSwappingFlag - Pelepasan baterai lama selesai + UnOldBatteryFlag - Pemasangan baterai baru selesai + InstallNewBatteryFlag - Instalasi selesai + FinishNewBatteryFlag - Kendaraan terkunci + VelLockFlag - Penggantian baterai selesai ( Kendaraan pergi ) + RadarOutFlag \ No newline at end of file diff --git a/WebStarter/Resources/Controllers.SwapMonitorController.id.Designer.cs b/WebStarter/Resources/Controllers.SwapMonitorController.id.Designer.cs new file mode 100644 index 0000000..4ec2e25 --- /dev/null +++ b/WebStarter/Resources/Controllers.SwapMonitorController.id.Designer.cs @@ -0,0 +1,197 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebStarter.Resources { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Controllers_SwapMonitorController_id { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Controllers_SwapMonitorController_id() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WebStarter.Resources.Controllers.SwapMonitorController.id", typeof(Controllers_SwapMonitorController_id).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Masa luang. + /// + internal static string _0 { + get { + return ResourceManager.GetString("0", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kendaraan tiba Radar pintu masuk mendeteksikendaraan masuk. + /// + internal static string _1 { + get { + return ResourceManager.GetString("1", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pelepasan baterai lama selesai. + /// + internal static string _10 { + get { + return ResourceManager.GetString("10", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pemasangan baterai baru selesai. + /// + internal static string _11 { + get { + return ResourceManager.GetString("11", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Instalasi selesai. + /// + internal static string _12 { + get { + return ResourceManager.GetString("12", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kendaraan terkunci. + /// + internal static string _13 { + get { + return ResourceManager.GetString("13", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Penggantian baterai selesai ( Kendaraan pergi ). + /// + internal static string _14 { + get { + return ResourceManager.GetString("14", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deteksi status PLC. + /// + internal static string _2 { + get { + return ResourceManager.GetString("2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pemindaian RFID selesai. + /// + internal static string _3 { + get { + return ResourceManager.GetString("3", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deteksi radar kedua kali. + /// + internal static string _4 { + get { + return ResourceManager.GetString("4", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kendaraan sampai di lokasi. + /// + internal static string _5 { + get { + return ResourceManager.GetString("5", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pemilihan selesai. + /// + internal static string _6 { + get { + return ResourceManager.GetString("6", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kendaraan membuka kunci. + /// + internal static string _7 { + get { + return ResourceManager.GetString("7", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mengeluarkan pemilihan PLC. + /// + internal static string _8 { + get { + return ResourceManager.GetString("8", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mulai ganti baterai. + /// + internal static string _9 { + get { + return ResourceManager.GetString("9", resourceCulture); + } + } + } +} diff --git a/WebStarter/Resources/Controllers.SwapMonitorController.id.resx b/WebStarter/Resources/Controllers.SwapMonitorController.id.resx new file mode 100644 index 0000000..50699b7 --- /dev/null +++ b/WebStarter/Resources/Controllers.SwapMonitorController.id.resx @@ -0,0 +1,66 @@ + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Masa luang + + + Kendaraan tiba Radar pintu masuk mendeteksikendaraan masuk + + + Deteksi status PLC + + + Pemindaian RFID selesai + + + Deteksi radar kedua kali + + + Kendaraan sampai di lokasi + + + Pemilihan selesai + + + Kendaraan membuka kunci + + + Mengeluarkan pemilihan PLC + + + Mulai ganti baterai + + + Pelepasan baterai lama selesai + + + Pemasangan baterai baru selesai + + + Instalasi selesai + + + Kendaraan terkunci + + + Penggantian baterai selesai ( Kendaraan pergi ) + + \ No newline at end of file