From a80c1ccadaa85132c7ac26474e7aab3da7706cbc Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期一, 02 六月 2025 13:24:13 +0800
Subject: [PATCH] iqc导出

---
 DevApp/Gs.DevApp/DevFrm/IPQC/Frm_ShouJianDetect01.cs |   61 ++++++++++++++++++++++++++++++
 1 files changed, 60 insertions(+), 1 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/IPQC/Frm_ShouJianDetect01.cs b/DevApp/Gs.DevApp/DevFrm/IPQC/Frm_ShouJianDetect01.cs
index c066b5e..46a0963 100644
--- a/DevApp/Gs.DevApp/DevFrm/IPQC/Frm_ShouJianDetect01.cs
+++ b/DevApp/Gs.DevApp/DevFrm/IPQC/Frm_ShouJianDetect01.cs
@@ -5,7 +5,9 @@
 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 +23,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);
@@ -42,6 +45,7 @@
             gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
             btnIpt.Click += BtnIpt_Click;
         }
+
 
         /// <summary>
         /// 鎵归噺褰曞叆
@@ -120,7 +124,62 @@
                 lbGuid, txt_releaseNo, gridView1);
             toolBarMenu1.guidKey = rowGuid;
         }
-
+        /// <summary>
+        /// 瀵煎嚭
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        /// <exception cref="NotImplementedException"></exception>
+        private void ToolBarMenu1_btnOutClick(object sender, EventArgs e)
+        {
+            string rowGuid = "", rowName = "";
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+                lbGuid, txt_releaseNo, gridView1, "releaseNo");
+            if (string.IsNullOrEmpty(rowGuid))
+            {
+                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                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/XlsOutShouJian", 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);
+                            }
+                            ToolBox.MsgHelper.ShowInformation("瀵煎嚭鎴愬姛锛�");
+                        }
+                        else
+                        {
+                            ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
+                    }
+                }
+            }
+        }
         /// <summary>
         /// 鍒锋柊浜嬩欢
         /// </summary>

--
Gitblit v1.9.3