diff --git a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs index b0601f8..4a97a7b 100644 --- a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs +++ b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs @@ -16,10 +16,15 @@ namespace ButcherFactory.SegmentProduction_ const string PRINTFILE = @"PrintTemplate\"; const string ENDFILE = @"PrintTemplate\SegmentProductionPrintEnd.html"; const string IMGFILE = @"TempImg\_img{0}.png"; + static string CustomerDefine =null; public static void Print(SegmentProduction entity, DateTime? dt, string template, string customerDefine) { if (AppContext.ConnectInfo.TraceBackUrl == "default") throw new Exception("请先配置追溯服务器地址"); + if (string.IsNullOrEmpty(CustomerDefine) && File.Exists(@"PrintTemplate\CustomerDefine.txt")) + { + CustomerDefine = File.ReadAllText(@"PrintTemplate\CustomerDefine.txt"); + } if (dt == null) dt = DateTime.Today; var dic = new Dictionary(); @@ -33,7 +38,7 @@ namespace ButcherFactory.SegmentProduction_ dic.Add("$Info", info); dic.Add("$Date", dt.Value.ToString("yyyy/MM/dd")); if (string.IsNullOrEmpty(customerDefine)) - customerDefine = "GB/T9959.2-2008"; + customerDefine = CustomerDefine; dic.Add("$CustomerDefine", customerDefine); var code = entity.BarCode; if (code.Length > 17)