From b36726eb98dafc4ce57f530699df2bd1b8ccb2f0 Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Tue, 16 Jun 2020 22:13:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=87=E7=A6=8F=E6=89=93=E5=8D=B0=E7=AE=80?= =?UTF-8?q?=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ButcherFactory.BO/BaseInfo/ClientGoodsSet.cs | 6 +++++- ButcherFactory.BO/BaseInfo/Goods.cs | 4 +++- ButcherFactory.BO/Bill/SegmentProduction.cs | 4 ++++ ButcherFactory.BO/LocalBL/FormClientGoodsSetBL.cs | 6 ++++-- ButcherFactory.BO/LocalBL/SegmentProductionBL.cs | 6 ++++-- .../SegmentProductionAutoForm.cs | 3 ++- .../SegmentProduction_/SegmentProductionForm.cs | 3 ++- .../SegmentProduction_/SegmentProductionPrint.cs | 14 +++++++++++--- 8 files changed, 35 insertions(+), 11 deletions(-) diff --git a/ButcherFactory.BO/BaseInfo/ClientGoodsSet.cs b/ButcherFactory.BO/BaseInfo/ClientGoodsSet.cs index 338bce7..90bf249 100644 --- a/ButcherFactory.BO/BaseInfo/ClientGoodsSet.cs +++ b/ButcherFactory.BO/BaseInfo/ClientGoodsSet.cs @@ -43,7 +43,11 @@ namespace ButcherFactory.BO [ReferenceTo(typeof(Goods), "MainUnit")] [Join("Goods_ID", "ID")] - public string MainUnit { get; set; } + public string MainUnit { get; set; } + + [ReferenceTo(typeof(Goods), "ShotPrintName")] + [Join("Goods_ID", "ID")] + public string ShotPrintName { get; set; } public decimal? StandardWeight { get; set; } diff --git a/ButcherFactory.BO/BaseInfo/Goods.cs b/ButcherFactory.BO/BaseInfo/Goods.cs index b53e5d8..0675e49 100644 --- a/ButcherFactory.BO/BaseInfo/Goods.cs +++ b/ButcherFactory.BO/BaseInfo/Goods.cs @@ -22,6 +22,8 @@ namespace ButcherFactory.BO public decimal? DownWeight { get; set; } - public short? GoodsType { get; set; } + public short? GoodsType { get; set; } + + public string ShotPrintName { get; set; } } } diff --git a/ButcherFactory.BO/Bill/SegmentProduction.cs b/ButcherFactory.BO/Bill/SegmentProduction.cs index e23d0b2..19f573a 100644 --- a/ButcherFactory.BO/Bill/SegmentProduction.cs +++ b/ButcherFactory.BO/Bill/SegmentProduction.cs @@ -71,6 +71,10 @@ namespace ButcherFactory.BO [Join("Goods_ID", "ID")] public string MainUnit { get; set; } + [ReferenceTo(typeof(Goods), "ShotPrintName")] + [Join("Goods_ID", "ID")] + public string ShotPrintName { get; set; } + public decimal? StatisticNumber { get; set; } } diff --git a/ButcherFactory.BO/LocalBL/FormClientGoodsSetBL.cs b/ButcherFactory.BO/LocalBL/FormClientGoodsSetBL.cs index a97110c..b5876bc 100644 --- a/ButcherFactory.BO/LocalBL/FormClientGoodsSetBL.cs +++ b/ButcherFactory.BO/LocalBL/FormClientGoodsSetBL.cs @@ -69,7 +69,8 @@ namespace ButcherFactory.BO.LocalBL query.Columns.Add(DQSelectColumn.Field("Goods_Code", detail)); query.Columns.Add(DQSelectColumn.Field("GoodsType", detail)); query.Columns.Add(DQSelectColumn.Field("StandardPic", detail)); - query.Columns.Add(DQSelectColumn.Field("MainUnit", detail)); + query.Columns.Add(DQSelectColumn.Field("MainUnit", detail)); + query.Columns.Add(DQSelectColumn.Field("ShotPrintName", detail)); query.OrderBy.Expressions.Add(DQOrderByExpression.Create(main, "ID")); query.OrderBy.Expressions.Add(DQOrderByExpression.Create(detail, "ID")); @@ -92,7 +93,8 @@ namespace ButcherFactory.BO.LocalBL entity.Goods_Code = (string)reader[7]; entity.GoodsType = (short?)reader[8]; entity.StandardPic = (bool)reader[9]; - entity.MainUnit = (string)reader[10]; + entity.MainUnit = (string)reader[10]; + entity.ShotPrintName = (string)reader[11]; if (result.ContainsKey(key)) result[key].Add(entity); else diff --git a/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs b/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs index d399052..003eb96 100644 --- a/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs +++ b/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs @@ -32,7 +32,8 @@ namespace ButcherFactory.BO.LocalBL query.Columns.Add(DQSelectColumn.Field("Goods_Spec")); query.Columns.Add(DQSelectColumn.Field("StandardPic")); query.Columns.Add(DQSelectColumn.Field("Goods_ID")); - query.Columns.Add(DQSelectColumn.Field("Goods_Code")); + query.Columns.Add(DQSelectColumn.Field("Goods_Code")); + query.Columns.Add(DQSelectColumn.Field("ShotPrintName")); 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) @@ -58,7 +59,8 @@ namespace ButcherFactory.BO.LocalBL entity.Goods_Spec = (string)reader[7]; entity.StandardPic = (bool)reader[8]; entity.Goods_ID = (long)reader[9]; - entity.Goods_Code = (string)reader[10]; + entity.Goods_Code = (string)reader[10]; + entity.ShotPrintName = (string)reader[11]; entity.Submited = submited; list.Add(entity); } diff --git a/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs b/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs index 54fe261..3972f1d 100644 --- a/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs +++ b/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs @@ -210,7 +210,8 @@ namespace ButcherFactory.SegmentProductionAuto_ entity.Goods_Code = detail.Goods_Code; entity.Goods_Name = detail.Goods_Name; entity.Goods_Spec = detail.Goods_Spec; - entity.MainUnit = detail.MainUnit; + entity.MainUnit = detail.MainUnit; + entity.ShotPrintName = detail.ShotPrintName; GoodsLabel.Text = entity.Goods_Name; historyList.Insert(0, entity); diff --git a/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.cs b/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.cs index 776acb9..00908df 100644 --- a/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.cs +++ b/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.cs @@ -156,7 +156,8 @@ namespace ButcherFactory.SegmentProduction_ var entity = SegmentProductionBL.Insert(detail.Goods_ID, weight, workUnitID, batchID.Value, batchDate.Value); entity.Goods_Name = detail.Goods_Name; entity.Goods_Spec = detail.Goods_Spec; - entity.MainUnit = detail.MainUnit; + entity.MainUnit = detail.MainUnit; + entity.ShotPrintName = detail.ShotPrintName; GoodsLabel.Text = entity.Goods_Name; unSubmitList.Insert(0, entity); historyList.Insert(0, entity); diff --git a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs index b85e65d..6ebe800 100644 --- a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs +++ b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs @@ -21,8 +21,9 @@ namespace ButcherFactory.SegmentProduction_ if (AppContext.ConnectInfo.TraceBackUrl == "default") throw new Exception("请先配置追溯服务器地址"); if (dt == null) - dt = DateTime.Today; - var dic = new Dictionary(); + dt = DateTime.Today; + var dic = new Dictionary(); + dic.Add("$ShotPrintName", entity.ShotPrintName); dic.Add("$Goods_Name", entity.Goods_Name); var info = string.Empty; if (entity.StandardPic) @@ -43,7 +44,14 @@ namespace ButcherFactory.SegmentProduction_ var barImgUrl = string.Format(IMGFILE, id + "_bar"); BwpClientPrint.BwpClientWebPrint.CreateBarCode("69212203" + entity.Goods_Code, barImgUrl, new Size(120, 40)); dic.Add("$BarImg", barImgUrl); - dic.Add("$Weight", string.Format("{0:#0.##}{1}", entity.Weight, entity.MainUnit)); + string unit = entity.MainUnit; + int rate =1; + if (unit.ToUpper() == "KG") + { + rate = 1000; + unit = "g"; + } + dic.Add("$Weight", string.Format("{0:#0.##}{1}", entity.Weight * rate, unit)); BwpClientPrint.BwpClientWebPrint.Print(PRINTFILE + template, dic); AfterPrint();