From e7ce5805983cac708c2feb2d60dbf90eedfa123d Mon Sep 17 00:00:00 2001
From: cdk <2441919651@qq.com>
Date: 星期一, 22 九月 2025 17:20:57 +0800
Subject: [PATCH] 齐套报表字体变红,库存差异表增加导出

---
 DevApp/Gs.DevApp/DevFrm/Rpt/CkKuCun.cs |   56 +++++++++++++++++++++++++++
 DevApp/Gs.DevApp/DevFrm/Rpt/RptQT.cs   |   48 ++++++++++++++++++++++-
 2 files changed, 100 insertions(+), 4 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Rpt/CkKuCun.cs b/DevApp/Gs.DevApp/DevFrm/Rpt/CkKuCun.cs
index e809354..064101e 100644
--- a/DevApp/Gs.DevApp/DevFrm/Rpt/CkKuCun.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Rpt/CkKuCun.cs
@@ -6,9 +6,11 @@
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
+using System.Configuration;
 using System.Data;
 using System.Drawing;
 using System.Linq;
+using System.Net;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
@@ -24,6 +26,7 @@
             InitializeComponent();
             this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
             this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
+            this.toolBarMenu1.btnOutClick += ToolBarMenu1_btnOutClick;
             this.toolBarMenu1.getXmlConfig();
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, this, "", "", (value) =>
             {
@@ -136,6 +139,57 @@
                 ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
             }
         }
-     
+
+        private void ToolBarMenu1_btnOutClick(object sender, EventArgs e)
+        {
+            using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
+            {
+                folderBrowserDialog.Description = "閫夋嫨瀵煎嚭鏂囦欢鐨勪繚瀛樿矾寰�";
+                DialogResult dialogResult = folderBrowserDialog.ShowDialog();
+                if (dialogResult == DialogResult.OK)
+                {
+                    string _folder = folderBrowserDialog.SelectedPath;
+                    System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder();
+                    _sbSqlWhere.Append(" and org.fid in");
+                    _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere());
+                    _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList));
+                    var _params = new
+                    {
+                        inQueryWhere = _sbSqlWhere.ToString(),//涓诲缓
+                        inFid = "",
+                        inP1 = "",
+                        inP2 = "",
+                        inP3 = "",
+                        inP4 = ""
+                    };
+                    var _obj = new Gs.DevApp.Entity.XlsOutModel("xlsOut_jskc", "", "", "", _params);
+                    try
+                    {
+                        string strJson = UtilityHelper.HttpPost("", "XlsInOut/XlsOutView_NEW", 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.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                    }
+                }
+            }
+        }
+
     }
 }
\ No newline at end of file
diff --git a/DevApp/Gs.DevApp/DevFrm/Rpt/RptQT.cs b/DevApp/Gs.DevApp/DevFrm/Rpt/RptQT.cs
index 27d46c2..459d962 100644
--- a/DevApp/Gs.DevApp/DevFrm/Rpt/RptQT.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Rpt/RptQT.cs
@@ -1,6 +1,5 @@
-using DevExpress.Pdf.Native.BouncyCastle.Utilities.Collections;
 using DevExpress.Utils;
-using DevExpress.Utils.DirectXPaint;
+using DevExpress.XtraGrid.Views.Grid;
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
 using Gs.DevApp.UserControl;
@@ -9,7 +8,7 @@
 using System;
 using System.Collections.Generic;
 using System.Data;
-using System.Data.SqlTypes;
+using System.Drawing;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 
@@ -23,6 +22,7 @@
         public RptQT()
         {
             InitializeComponent();
+            gridView2.RowCellStyle += gridView2_RowCellStyle;
             this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
             this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
             this.toolBarMenu1.getXmlConfig();
@@ -31,6 +31,7 @@
             // 娣诲姞gridView1鐨勮閫夋嫨鍙樺寲浜嬩欢
             gridView1.FocusedRowChanged += GridView1_FocusedRowChanged;
             // 璁剧疆gridView2鍙傛暟
+            gridView1.RowCellStyle += gridView1_RowCellStyle;
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gridView2);
             Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
             {
@@ -236,5 +237,46 @@
                 ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
             }
         }
+
+        private void gridView1_RowCellStyle(object sender, RowCellStyleEventArgs e)
+        {
+            // 纭繚鍙鐞唌inQT鍒�
+            if (e.Column.FieldName == "minQT")
+            {
+                // 鑾峰彇褰撳墠琛岀殑鏁版嵁
+                DataRowView row = gridView1.GetRow(e.RowHandle) as DataRowView;
+                if (row != null && row["minQT"] != DBNull.Value)
+                {
+
+                    double minQT = Convert.ToDouble(row["minQT"]);
+                    if (minQT < 1.0)
+                    {
+                        e.Appearance.ForeColor = Color.Red;
+                    }
+                }
+            }
+        }
+
+        private void gridView2_RowCellStyle(object sender, RowCellStyleEventArgs e)
+        {
+            // 纭繚鍙鐞唓tNum鍒�
+            if (e.Column.FieldName == "qtNum")
+            {
+                // 鑾峰彇褰撳墠琛岀殑鏁版嵁
+                DataRowView row = gridView2.GetRow(e.RowHandle) as DataRowView;
+                if (row != null)
+                {
+                    // 妫�鏌tNum鍊兼槸鍚﹀皬浜�1锛�100%锛�
+                    if (row["qtNum"] != DBNull.Value)
+                    {
+                        double qtNum = Convert.ToDouble(row["qtNum"]);
+                        if (qtNum < 1.0)
+                        {
+                            e.Appearance.ForeColor = Color.Red;
+                        }
+                    }
+                }
+            }
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3