diff --git a/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs b/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs index e023046..d399052 100644 --- a/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs +++ b/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs @@ -30,8 +30,9 @@ namespace ButcherFactory.BO.LocalBL query.Columns.Add(DQSelectColumn.Field("GroupID")); query.Columns.Add(DQSelectColumn.Field("TrunOutID")); 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("StandardPic")); + query.Columns.Add(DQSelectColumn.Field("Goods_ID")); + query.Columns.Add(DQSelectColumn.Field("Goods_Code")); 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) @@ -56,7 +57,8 @@ namespace ButcherFactory.BO.LocalBL entity.TrunOutID = (long?)reader[6]; entity.Goods_Spec = (string)reader[7]; entity.StandardPic = (bool)reader[8]; - entity.Goods_ID = (long)reader[9]; + entity.Goods_ID = (long)reader[9]; + entity.Goods_Code = (string)reader[10]; entity.Submited = submited; list.Add(entity); } diff --git a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs index fa34c02..b85e65d 100644 --- a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs +++ b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs @@ -1,10 +1,11 @@ -using ButcherFactory.BO; -using ButcherFactory.BO.Utils; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; +using ButcherFactory.BO; +using ButcherFactory.BO.Utils; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Text; using System.Threading.Tasks; namespace ButcherFactory.SegmentProduction_ @@ -37,8 +38,13 @@ namespace ButcherFactory.SegmentProduction_ var imgUrl = string.Format(IMGFILE, id); var url = string.Format(AppContext.ConnectInfo.TraceBackUrl + "?code={0}", entity.BarCode); BwpClientPrint.BwpClientWebPrint.Create2DPic(url, imgUrl, 120); + dic.Add("$ImageUrl", imgUrl); + + 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)); - dic.Add("$ImageUrl", imgUrl); BwpClientPrint.BwpClientWebPrint.Print(PRINTFILE + template, dic); AfterPrint(); } @@ -81,11 +87,12 @@ namespace ButcherFactory.SegmentProduction_ id++; if (TempImage == null) TempImage = new DirectoryInfo("TempImg"); - var files = TempImage.GetFiles(); - if (files.Length > 10) - { - var last = files.OrderBy(x => x.CreationTime).First().FullName; - File.Delete(last); + var files = TempImage.GetFiles(); + while (files.Length > 20) + { + var last = files.OrderBy(x => x.CreationTime).First().FullName; + File.Delete(last); + files = TempImage.GetFiles(); } } }