From 291b43124d537daccc25e4e1613b5ff0cd749050 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期三, 13 十一月 2024 15:55:11 +0800
Subject: [PATCH] 线程

---
 DevApp/Gs.DevApp/UserControl/UcLookItems.cs    |   21 ++++++++++++---------
 DevApp/Gs.DevApp/App.config                    |    4 ++--
 DevApp/Gs.DevApp/UserControl/UcLookSupplier.cs |   16 +++++++++++-----
 DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs      |    7 +++++++
 4 files changed, 32 insertions(+), 16 deletions(-)

diff --git a/DevApp/Gs.DevApp/App.config b/DevApp/Gs.DevApp/App.config
index 13dfb53..bfed333 100644
--- a/DevApp/Gs.DevApp/App.config
+++ b/DevApp/Gs.DevApp/App.config
@@ -28,8 +28,8 @@
 		</assemblyBinding>
 	</runtime>
     <appSettings>
-        <add key="WebApiUrl" value="http://localhost:5263/" />
-        <!--<add key="WebApiUrl" value="http://192.168.1.145:81/" />-->
+        <!--<add key="WebApiUrl" value="http://localhost:5263/" />-->
+        <add key="WebApiUrl" value="http://192.168.1.145:81/" />
         <add key="LogPath" value="logs" />
         <add key="ProductName" value="骞挎繁绉戞妧 G-MES V2.0" />
         <add key="PageSize" value="50" />
diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
index 5b0c13b..a02baec 100644
--- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
+++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
@@ -5,6 +5,7 @@
 using System.Drawing;
 using System.IO;
 using System.Net;
+using System.Net.Cache;
 using System.Net.Http;
 using System.Reflection;
 using System.Resources;
@@ -75,6 +76,9 @@
             request.Accept = "*/*";
             request.Timeout = 15000;
             request.AllowAutoRedirect = false;
+            request.ServicePoint.Expect100Continue = false;
+            HttpRequestCachePolicy noCachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore);
+            request.CachePolicy = noCachePolicy;
             using (Stream requestStream = await request.GetRequestStreamAsync())
             {
                 byte[] dataBytes = Encoding.UTF8.GetBytes(param);
@@ -109,6 +113,9 @@
             request.Accept = "*/*";
             request.Timeout = 15000;
             request.AllowAutoRedirect = false;
+            request.ServicePoint.Expect100Continue = false;
+            HttpRequestCachePolicy noCachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore);
+            request.CachePolicy = noCachePolicy;
             StreamWriter requestStream = null;
             WebResponse response = null;
             string responseStr = null;
diff --git a/DevApp/Gs.DevApp/UserControl/UcLookItems.cs b/DevApp/Gs.DevApp/UserControl/UcLookItems.cs
index 016b744..8cac2ee 100644
--- a/DevApp/Gs.DevApp/UserControl/UcLookItems.cs
+++ b/DevApp/Gs.DevApp/UserControl/UcLookItems.cs
@@ -49,16 +49,20 @@
 
         private async void getSuppler()
         {
-            UcLoading _loading = new UcLoading();
-            var pgq = new PageQueryModel(1, 999999, "item_name", "asc", "",
-                " and fforbidstatus='A'");
-            var json = JsonConvert.SerializeObject(pgq);
+            var _obj = new
+            {
+                currentPage = 1,
+                everyPageSize = 999999,
+                sortName = "",
+                keyWhere = "",
+            };
+            var json = JsonConvert.SerializeObject(_obj);
             try
             {
-                var strReturn = await UtilityHelper.HttpPostAsync("",
-                    "MesItemsManager/GetListPageByLook", json);
-                var rtn = UtilityHelper.ReturnToList(strReturn);
-                var dt = rtn.rtnData;
+                var strReturn =  UtilityHelper.HttpPost("",
+                    "MesItemsManager/GetListSelect", json);
+                var rtn = UtilityHelper.ReturnToTablePage(strReturn);
+                var dt = rtn.rtnData.list;
                 lookSearchSupplier.Properties.DataSource = dt;
                 lookSearchSupplier.Properties.DisplayMember = "itemName";
                 // lookSearchSupplier.Properties.ValueMember = "depotId";
@@ -68,7 +72,6 @@
             {
                 MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
-            _loading.Close();
         }
 
         public string GetId()
diff --git a/DevApp/Gs.DevApp/UserControl/UcLookSupplier.cs b/DevApp/Gs.DevApp/UserControl/UcLookSupplier.cs
index 2e37a12..5e0a7de 100644
--- a/DevApp/Gs.DevApp/UserControl/UcLookSupplier.cs
+++ b/DevApp/Gs.DevApp/UserControl/UcLookSupplier.cs
@@ -5,6 +5,7 @@
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
 using Newtonsoft.Json;
+using static DevExpress.XtraPrinting.Native.PageSizeInfo;
 
 namespace Gs.DevApp.UserControl
 {
@@ -16,7 +17,6 @@
             lookSearchSupplier.Properties.NullText = "璇烽�夋嫨";
             lookSearchSupplier.EditValueChanged +=
                 LookSearchSupplier_EditValueChanged;
-            getSuppler();
         }
         public bool IsReadly { get; set; }
         private string _KeyFile = "";
@@ -26,6 +26,7 @@
             set
             {
                 _KeyFile = value;
+                if(!string.IsNullOrEmpty(value))
                 getSuppler();
             }
         }
@@ -42,13 +43,18 @@
 
         private void getSuppler()
         {
-            var pgq = new PageQueryModel(1, 999999, "supp_no", "asc", "",
-                " and fforbidstatus='A'");
-            var json = JsonConvert.SerializeObject(pgq);
+            var _obj = new
+            {
+                currentPage = 1,
+                everyPageSize = 999999,
+                sortName = "",
+                keyWhere = "",
+            };
+            var json = JsonConvert.SerializeObject(_obj);
             try
             {
                 var strReturn = UtilityHelper.HttpPost("",
-                    "MesSupplierManager/GetListPage", json);
+                    "MesSupplierManager/GetListSelect", json);
                 var rtn = UtilityHelper.ReturnToTablePage(strReturn);
                 var dt = rtn.rtnData.list;
                 lookSearchSupplier.Properties.DataSource = dt;

--
Gitblit v1.9.3