diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/MainViewModel.Check.cs b/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/MainViewModel.Check.cs index b86c04c..f2f9cdb 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/MainViewModel.Check.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/MainViewModel.Check.cs @@ -250,10 +250,12 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel } else { - var newModel = $"RV-{item.WireColor}-1x{item.CrossSection}-{item.WireLength + 5}-16×N2-{item.WireNumber}"; + //var newModel = $"RV-{item.WireColor}-1x{item.CrossSection}-{item.WireLength + 5}-16×N2-{item.WireNumber}"; + var newModel = GenWireModel(item.WireColor, item.CrossSection, $"{double.Parse(item.WireLength) + 5}_add_5", item.WireNumber); if (StuffedData.Any(it => it.Model == newModel)) { - var newModel2 = $"RV-{item.WireColor}-1x{item.CrossSection}-{item.WireLength + 10}-16×N2-{item.WireNumber}"; + //var newModel2 = $"RV-{item.WireColor}-1x{item.CrossSection}-{item.WireLength + 10}-16×N2-{item.WireNumber}"; + var newModel2 = GenWireModel(item.WireColor, item.CrossSection, $"{double.Parse(item.WireLength) + 10}_add_10", item.WireNumber); if (StuffedData.Any(it => it.Model == newModel2)) SetItemError(item, $"{item.Model} 该型号存在重复!\r\n"); else diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/MainViewModel.cs b/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/MainViewModel.cs index 71e5b16..6ea87ab 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/MainViewModel.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/MainViewModel.cs @@ -288,7 +288,9 @@ public partial class MainViewModel : INotifyPropertyChanged //data.WireNumber = item.Imprint; data.Quantity = 1; //"RV-"&A2&"-"&"1×"&J2&"-"&L2&"-"&"16×N2"&"-"&M2 - data.Model = $"RV-{data.WireColor}-1×{data.CrossSection}-{data.WireLength}-16×N2-{data.WireNumber}"; + //data.Model = $@"RV-{data.WireColor}-1×【Replace】{data.CrossSection}-{data.WireLength}-16×N2-{data.WireNumber}"; + //data.Model = string.Format("RV-{0}-1{4}{1}-{2}-16×N2-{3}", data.WireColor, data.CrossSection, data.WireLength, data.WireNumber, "×"); + data.Model = GenWireModel(data.WireColor, data.CrossSection, data.WireLength, data.WireNumber); //data.IsChecked = true; if (!string.IsNullOrEmpty(data.DiscolorationDesc)) { @@ -543,4 +545,9 @@ public partial class MainViewModel : INotifyPropertyChanged } } + private string GenWireModel(string wireColor, string crossSection, string wireLength, string wireNumber) + { + return $@"RV-{wireColor}-1×{crossSection}-{wireLength}-16×N2-{wireNumber}"; + } + } \ No newline at end of file