From 4dc2dbda4150c7c74a26435a75308789dc359b99 Mon Sep 17 00:00:00 2001
From: cdk <2441919651@qq.com>
Date: 星期六, 01 十一月 2025 17:06:41 +0800
Subject: [PATCH] 增加批量打印功能,增加组织分开维护
---
DevApp/Gs.DevApp/DevFrm/Rpt/CKTmkc.cs | 75 ++++++++++++++++++++++++++++++++++---
1 files changed, 68 insertions(+), 7 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/Rpt/CKTmkc.cs b/DevApp/Gs.DevApp/DevFrm/Rpt/CKTmkc.cs
index ad94ccc..9ac53b6 100644
--- a/DevApp/Gs.DevApp/DevFrm/Rpt/CKTmkc.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Rpt/CKTmkc.cs
@@ -5,7 +5,9 @@
using Newtonsoft.Json;
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.btnPrintClick += ToolBarMenu1_btnPrintClick;
+ toolBarMenu1.btnOutClick += ToolBarMenu1_btnOutClick;
this.toolBarMenu1.getXmlConfig();
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, this, "", "", (value) =>
{
@@ -43,7 +46,9 @@
{
_print101();
};
-
+ this.ucBtnPrint101.btnZhiJieClick += (s, e) => {
+ _print101();
+ };
//鍔犲叆checkbox begin
this.gridView1.CustomDrawColumnHeader += (s, e) => { Gs.DevApp.ToolBox.UtilityHelper.CustomDrawColumnHeader(s, e); };
@@ -229,7 +234,7 @@
if (Gs.DevApp.ToolBox.UtilityHelper.ToCheck(checkBox))
{
if (sb.Length > 0)
- sb.Append(",");
+ sb.Append("|");
sb.Append(_guid);
}
}
@@ -240,15 +245,71 @@
this.toolBarMenu1.rptParameter = "return false";
return;
}
- string rowGuid = sb.ToString();
- this.toolBarMenu1.rptParameter = "rpt_XSCK{"
- + ""
+ this.toolBarMenu1.rptParameter = "rpt_cktm{"
+ + "100"
+ "," + ""
+ "," + ""
+ + "," + ""
+ "," + ""
- + "," + ""
+ + "," + sb.ToString()
+ "}";
- this.toolBarMenu1.guidKey = rowGuid;
+ this.toolBarMenu1.guidKey = null;
+ }
+
+ /// <summary>
+ /// 瀵煎嚭
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ 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 wl.FSubsidiary 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_cktm", "", "", "", _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
--
Gitblit v1.9.3