From 670bcc2f96f3c20b7da88a7d73765445350ba3cc Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Sat, 28 May 2022 15:58:44 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8D=95No.163866=201?= =?UTF-8?q?=E3=80=81=E9=B2=9C=E5=93=81=E3=80=90=E5=88=86=E5=89=B2=E5=93=81?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF=E3=80=91=E6=89=93=E5=8D=B0=E7=9A=84?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E4=B8=AD=E7=9A=84=E3=80=90=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E6=A0=87=E5=87=86=E3=80=91=E5=8F=96MES=E3=80=90=E5=AD=98?= =?UTF-8?q?=E8=B4=A7=E6=A1=A3=E6=A1=88=E3=80=91=E4=B8=AD=E3=80=90=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=89=A7=E8=A1=8C=E6=A0=87=E5=87=86=E3=80=91?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ButcherFactory.BO/Bill/SegmentProduction.cs | 4 ++++ ButcherFactory.BO/LocalBL/SegmentProductionBL.cs | 4 +++- .../SegmentProductionAutoForm.cs | 15 ++++----------- .../SegmentProduction_/SegmentProductionPrint.cs | 9 +++------ .../SegmentProductionPrint.html | 2 +- .../SegmentProductionPrint1.html | 2 +- 6 files changed, 16 insertions(+), 20 deletions(-) diff --git a/ButcherFactory.BO/Bill/SegmentProduction.cs b/ButcherFactory.BO/Bill/SegmentProduction.cs index 01eb94c..29869c6 100644 --- a/ButcherFactory.BO/Bill/SegmentProduction.cs +++ b/ButcherFactory.BO/Bill/SegmentProduction.cs @@ -62,6 +62,10 @@ namespace ButcherFactory.BO [ReferenceTo(typeof(Goods), "GoodsType")] [Join("Goods_ID", "ID")] public short? GoodsType { get; set; } + + [ReferenceTo(typeof(Goods), "CustomerDefine")] + [Join("Goods_ID", "ID")] + public string Goods_CustomerDefine { get; set; } [DbColumn(DefaultValue = 0)] public bool NoTotalCode { get; set; } diff --git a/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs b/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs index 12290b6..b6281ca 100644 --- a/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs +++ b/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs @@ -40,7 +40,8 @@ namespace ButcherFactory.BO.LocalBL query.Columns.Add(DQSelectColumn.Field("CreateTime")); query.Columns.Add(DQSelectColumn.Field("GoodsType")); query.Columns.Add(DQSelectColumn.Field("NoTotalCode")); - query.Columns.Add(DQSelectColumn.Field("Identify")); + query.Columns.Add(DQSelectColumn.Field("Identify")); + query.Columns.Add(DQSelectColumn.Field("Goods_CustomerDefine")); query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("InStored", false), DQCondition.EQ("Delete", false), DQCondition.EQ("Submited", submited))); query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID", true)); if (submited) @@ -76,6 +77,7 @@ namespace ButcherFactory.BO.LocalBL entity.GoodsType = (short?)reader[16]; entity.NoTotalCode = (bool)reader[17]; entity.Identify = (string)reader[18]; + entity.Goods_CustomerDefine = (string)reader[19]; list.Add(entity); } } diff --git a/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs b/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs index bbf4981..2d10d82 100644 --- a/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs +++ b/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs @@ -457,6 +457,7 @@ namespace ButcherFactory.SegmentProductionAuto_ entity.Goods_Spec = detail.Goods_Spec; entity.MainUnit = detail.MainUnit; entity.ShotPrintName = detail.ShotPrintName; + entity.Goods_CustomerDefine = detail.Goods_CustomerDefine; if (rebuild) { BindflowLayoutPanel(thisPanel, thisTotal); @@ -474,18 +475,14 @@ namespace ButcherFactory.SegmentProductionAuto_ if (barPrintCheck.Checked) { var template = config.Template; - string cd = null; if (detail.GoodsType.HasValue) { if (detail.GoodsType == 0) template = "SegmentProductionPrint.html"; else - { - cd = detail.Goods_CustomerDefine; template = "SegmentProductionPrint1.html"; - } } - NotAuto.SegmentProductionPrint.Print(entity, batchDate, template, cd); + NotAuto.SegmentProductionPrint.Print(entity, batchDate, template); var log = new SegmentLog(entity.BarCode, "打印"); log.Message = string.Format("存货名称:{0} 重量:{1:#0.###}", entity.Goods_Name, entity.Weight); SegmentProductionBL.InsertLog(log); @@ -779,18 +776,14 @@ namespace ButcherFactory.SegmentProductionAuto_ item = historyList.First(); var template = config.Template; var goodsInfo = SegmentProductionBL.GetGoodsInfo(item.Goods_ID); - string cd = null; if (goodsInfo != null && goodsInfo.Item1.HasValue) { if (goodsInfo.Item1 == 0) template = "SegmentProductionPrint.html"; else - { - cd = goodsInfo.Item2; - template = "SegmentProductionPrint1.html"; - } + template = "SegmentProductionPrint1.html"; } - NotAuto.SegmentProductionPrint.Print(item, batchDate, template, cd); + NotAuto.SegmentProductionPrint.Print(item, batchDate, template); var log = new SegmentLog(item.BarCode, "补打"); log.Message = string.Format("存货名称:{0} 重量:{1:#0.###}", item.Goods_Name, item.Weight); SegmentProductionBL.InsertLog(log); diff --git a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs index 4a97a7b..940d09f 100644 --- a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs +++ b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs @@ -16,15 +16,11 @@ 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) + static string CustomerDefine = "GB/T9959.2-2008"; + public static void Print(SegmentProduction entity, DateTime? dt, string template) { 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(); @@ -37,6 +33,7 @@ namespace ButcherFactory.SegmentProduction_ info = string.Format("重量:{0:#0.##}{1}", entity.Weight, entity.MainUnit); dic.Add("$Info", info); dic.Add("$Date", dt.Value.ToString("yyyy/MM/dd")); + var customerDefine = entity.Goods_CustomerDefine; if (string.IsNullOrEmpty(customerDefine)) customerDefine = CustomerDefine; dic.Add("$CustomerDefine", customerDefine); diff --git a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.html b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.html index 5a9bee0..4c4d9dd 100644 --- a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.html +++ b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.html @@ -18,7 +18,7 @@
品名:$Goods_Name
$Info  生产日期:$Date
- + diff --git a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint1.html b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint1.html index 0d7c962..67c2579 100644 --- a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint1.html +++ b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint1.html @@ -18,7 +18,7 @@
品名:$Goods_Name
$Info  生产日期:$Date
执行标准:GB/T9959.2-2008
执行标准:$CustomerDefine
储存条件:0~4℃保存
保 质 期:7天
生产厂家:青岛万福集团股份有限公司
- +
执行标准:GB/T9959.2-2008
执行标准:$CustomerDefine
储存条件:-18℃以下保存
保 质 期:18个月
生产厂家:青岛万福集团股份有限公司