From 780c932338d7fbefb9bb3e05b253cc203f6f4d48 Mon Sep 17 00:00:00 2001
From: lu <123456>
Date: 星期五, 08 八月 2025 10:09:47 +0800
Subject: [PATCH] bug

---
 DevApp/Gs.DevApp/DevFrm/IPQC/Frm_XunJianDetect01.cs |   78 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 77 insertions(+), 1 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/IPQC/Frm_XunJianDetect01.cs b/DevApp/Gs.DevApp/DevFrm/IPQC/Frm_XunJianDetect01.cs
index 071b3c9..1c89392 100644
--- a/DevApp/Gs.DevApp/DevFrm/IPQC/Frm_XunJianDetect01.cs
+++ b/DevApp/Gs.DevApp/DevFrm/IPQC/Frm_XunJianDetect01.cs
@@ -1,11 +1,14 @@
-锘縰sing Gs.DevApp.Entity;
+锘縰sing DevExpress.XtraGrid.Views.Base.ViewInfo;
+using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
 using Gs.DevApp.UserControl;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using System;
 using System.Collections.Generic;
+using System.Configuration;
 using System.Data;
+using System.Net;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 
@@ -21,6 +24,7 @@
             this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
             this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
             toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
+            toolBarMenu1.btnOutClick += ToolBarMenu1_btnOutClick;
             this.toolBarMenu1.getXmlConfig();
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
@@ -108,6 +112,78 @@
             getPageList(1);
         }
         /// <summary>
+        /// 瀵煎嚭
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        /// <exception cref="NotImplementedException"></exception>
+        private void ToolBarMenu1_btnOutClick(object sender, EventArgs e)
+        {
+            //鏄惁妫�鏌ユ棤姣昩eg
+            var dr = gridView1.GetFocusedDataRow();
+            if (dr == null || string.IsNullOrEmpty(dr["guid"].ToString()))
+            {
+                MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                return;
+            }
+            string strLotNo = dr["lotNo"].ToString();
+            if (string.IsNullOrEmpty(strLotNo))
+            {
+                MsgHelper.ShowError("鏈紑濮嬫楠岋紝涓嶈兘瀵煎嚭锛�");
+                return;
+            }
+            //鏄惁妫�鏌ユ棤姣昬nd
+
+            string rowGuid = "", rowName = "";
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+                lbGuid, txt_releaseNo, gridView1, "releaseNo");
+            if (string.IsNullOrEmpty(rowGuid))
+            {
+                MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                return;
+            }
+            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾瀵煎嚭鍚楋紵"))
+                return;
+            using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
+            {
+                folderBrowserDialog.Description = "閫夋嫨瀵煎嚭鏂囦欢鐨勪繚瀛樿矾寰�";
+                DialogResult dialogResult = folderBrowserDialog.ShowDialog();
+                if (dialogResult == DialogResult.OK)
+                {
+                    string _folder = folderBrowserDialog.SelectedPath;
+                    var _obj = new
+                    {
+                        guid = rowGuid,
+                    };
+                    try
+                    {
+                        string strJson = UtilityHelper.HttpPost("", "XlsInOut/XlsOutXunJian", JsonConvert.SerializeObject(_obj));
+                        ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
+                        if (_rtn.rtnCode > 0)
+                        {
+                            string _file = _rtn.rtnData.fileUrl.ToString();
+                            string _folderName = _folder + "\\" + _file.Replace("down/", "");
+                            string _url = ConfigurationManager.AppSettings["WebApiUrl"].ToString() + _file;
+                            using (WebClient client = new WebClient())
+                            {
+                                client.DownloadFile(_url, _folderName);
+                            }
+                            var frm = new Gs.DevApp.DevFrm.QC.Xls(_folderName);
+                            frm.ShowDialog();
+                        }
+                        else
+                        {
+                            ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
+                    }
+                }
+            }
+        }
+        /// <summary>
         /// 鏃ュ織浜嬩欢
         /// </summary>
         /// <param name="sender"></param>

--
Gitblit v1.9.3