From dafb45cd50d417f876f63aa74f96205361ac2ee4 Mon Sep 17 00:00:00 2001 From: "Robin_PC\\robin" <3504557@qq.com> Date: Wed, 18 Nov 2026 19:18:47 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8D=95No.6009=20=E8=80=81?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LocalBL/SegmentProductionBL.cs | 6 +++ ButcherFactory.BO/Utils/AppContext.cs | 1 + .../SegmentProductionAutoForm.cs | 12 ++++-- ButcherFactory.Login/Login.xaml.cs | 39 ++++++++++--------- 4 files changed, 36 insertions(+), 22 deletions(-) diff --git a/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs b/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs index 48bf0ea..e3d1d38 100644 --- a/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs +++ b/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs @@ -18,6 +18,7 @@ namespace ButcherFactory.BO.LocalBL const string RpcPath = @"/MainSystem/B3ClientService/Rpcs/SegmentProductionRpc/"; const string ProductTaskRpc = @"/MainSystem/B3Sale/Rpcs/SaleOutStoreRpc/GetSaleOutStoreNumber"; const string BatchProductTaskRpc = @"/MainSystem/B3Sale/Rpcs/SaleOutStoreRpc/BatchGetSaleOutStoreNumber"; + const string GetMinWeightMethod = @"/MainSystem/B3Sale/Rpcs/SaleOutStoreRpc/GetMinWeight"; public static BindingList GetListByState(bool submited) { @@ -691,6 +692,11 @@ namespace ButcherFactory.BO.LocalBL session.Commit(); } } + + public static decimal GetMinWeight ( ) + { + return ButcherFactoryUtil.SecondUrlCall(GetMinWeightMethod); + } } class SegmentProductionMin diff --git a/ButcherFactory.BO/Utils/AppContext.cs b/ButcherFactory.BO/Utils/AppContext.cs index f5784bc..b7089d2 100644 --- a/ButcherFactory.BO/Utils/AppContext.cs +++ b/ButcherFactory.BO/Utils/AppContext.cs @@ -9,6 +9,7 @@ namespace ButcherFactory.BO.Utils { public static class AppContext { + public static string Version = "202611181900"; public static bool RpcFacadeInited { get; set; } static ServerUrlConfig _connectInfo = ServerUrlConfig.Init(); public static ServerUrlConfig ConnectInfo { get { return _connectInfo; } } diff --git a/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs b/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs index 3beefe7..f3e64cc 100644 --- a/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs +++ b/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs @@ -44,6 +44,7 @@ namespace ButcherFactory.SegmentProductionAuto_ long? batchID; DateTime? batchDate; DateTime butcherDate = DateTime.Today; + decimal minWeight = 0; NotAuto.SegmentProductionFormConfig config; List identityList; List specialGoodsCodes; @@ -128,7 +129,7 @@ namespace ButcherFactory.SegmentProductionAuto_ _freshTotalCode = SegmentProductionBL.InitFreshTotalCode(); _stayTotalCode = SegmentProductionBL.InitStayTotalCode(); identityList = SegmentProductionBL.GetGoodsIdentify(); - + minWeight = SegmentProductionBL.GetMinWeight(); } void LoadBind() @@ -260,8 +261,13 @@ namespace ButcherFactory.SegmentProductionAuto_ //weight = 10; MessageBox.Show("重量必须大于0"); return; - } - if (g.StandardWeight.HasValue) + } + if (minWeight > 0 && weight < minWeight) + { + MessageBox.Show(string.Format("重量:{0}小于最小重量:{1}", weight, minWeight)); + return; + } + if (g.StandardWeight.HasValue) { if (weight < (g.StandardWeightLow ?? 0) || weight > (g.StandardWeightUp ?? 0)) { diff --git a/ButcherFactory.Login/Login.xaml.cs b/ButcherFactory.Login/Login.xaml.cs index 5764e32..10bf177 100644 --- a/ButcherFactory.Login/Login.xaml.cs +++ b/ButcherFactory.Login/Login.xaml.cs @@ -111,27 +111,28 @@ namespace ButcherFactory.Login void Login_Loaded(object sender, RoutedEventArgs e) { - if (!File.Exists("ButcherFactory.AutoUpdate.exe")) - return; - var versionInfo = new ClientVersion(); - if (File.Exists("ClientVersion.xml")) - { - versionInfo = XmlUtil.DeserializeFromFile("ClientVersion.xml"); - versionLbl.Text = versionInfo.Version; - } - if (string.IsNullOrEmpty(versionInfo.ServerUrl)) - versionInfo.ServerUrl = serUri; + versionLbl.Text = BO.Utils.AppContext.Version; + //if (!File.Exists("ButcherFactory.AutoUpdate.exe")) + // return; + //var versionInfo = new ClientVersion(); + //if (File.Exists("ClientVersion.xml")) + //{ + // versionInfo = XmlUtil.DeserializeFromFile("ClientVersion.xml"); + // + //} + //if (string.IsNullOrEmpty(versionInfo.ServerUrl)) + // versionInfo.ServerUrl = serUri; - HttpWebRequest req = (HttpWebRequest)WebRequest.Create(versionInfo.ServerUrl); - req.Timeout = 5000; - HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); - if (resp.StatusCode != HttpStatusCode.OK) - return; + //HttpWebRequest req = (HttpWebRequest)WebRequest.Create(versionInfo.ServerUrl); + //req.Timeout = 5000; + //HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); + //if (resp.StatusCode != HttpStatusCode.OK) + // return; - var down = new System.Net.WebClient(); - var serverVersion = XmlUtil.XmlDeserializeObject(down.DownloadString(versionInfo.ServerUrl)); - if (versionInfo.Version != serverVersion.Version) - updateImg.Visibility = Visibility.Visible; + //var down = new System.Net.WebClient(); + //var serverVersion = XmlUtil.XmlDeserializeObject(down.DownloadString(versionInfo.ServerUrl)); + //if (versionInfo.Version != serverVersion.Version) + // updateImg.Visibility = Visibility.Visible; } private void UpdateBtn_Click(object sender, MouseButtonEventArgs e)