From d1923666df84480b0e7c59b76276de552300e54a Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Mon, 15 Jun 2020 08:45:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=87=E7=A6=8F=E5=A4=9A=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E6=89=93=E5=8D=B0=EF=BC=8C=E6=96=B0=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LocalBL/SegmentProductionBL.cs | 8 +++-- .../SegmentProductionPrint.cs | 33 +++++++++++-------- 2 files changed, 25 insertions(+), 16 deletions(-) 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(); } } }