From e740617f4c4009642a3097afda28d557984f40e1 Mon Sep 17 00:00:00 2001
From: lu <123456>
Date: 星期五, 05 九月 2025 08:28:34 +0800
Subject: [PATCH] bug
---
DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs | 209 +++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 191 insertions(+), 18 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
index ac8da9c..9b68dc3 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
@@ -1,3 +1,6 @@
+using DevExpress.Pdf.Native.BouncyCastle.Utilities.Collections;
+using DevExpress.XtraLayout.Customization;
+using DevExpress.XtraRichEdit.API.Native;
using Gs.DevApp.DevFrm.QC;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
@@ -10,6 +13,7 @@
using System.Data;
using System.Net;
using System.Threading.Tasks;
+using System.Timers;
using System.Windows.Forms;
namespace Gs.DevApp.DevFrm
@@ -19,9 +23,23 @@
string _strTag = "N:涓嶅悎鏍�";
string _webServiceName = "MesQaItemsDetect01Manager/";
List<FilterEntity> _filterList = new List<FilterEntity>();
+ /// <summary>
+ /// 瀹氭椂鍒锋柊
+ /// </summary>
+ System.Timers.Timer timer;
+
public Frm_MesQaItemsDetect01()
{
InitializeComponent();
+
+ #region 璁剧疆鏃堕棿
+ int int32 = 3000;
+ string _vanishingSeconds = ConfigurationManager.AppSettings["IqcGetWeight"];
+ if (!string.IsNullOrEmpty(_vanishingSeconds))
+ int32 = int.Parse(_vanishingSeconds);
+ timer = new System.Timers.Timer(int32);
+ #endregion
+
this.toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick;
this.toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick;
this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
@@ -54,8 +72,157 @@
gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
btnIpt.Click += BtnIpt_Click;
btnYcReport.Click += BtnYcReport_Click;
- }
+ #region 浜旀閲嶉噺
+ //鍏抽棴鏃堕噴鏀総imer
+ this.Disposed += (s, e) =>
+ {
+ // MessageBox.Show("ddddddd");
+ if (timer != null)
+ {
+ timer.Stop();
+ timer.Dispose();
+ }
+ };
+ timer.Elapsed += (s, e) =>
+ {
+ var _obj = new
+ {
+ };
+ try
+ {
+ var strReturn = UtilityHelper.HttpPost("", "WorkWeight/GetIqcWeight", JsonConvert.SerializeObject(_obj), false);
+ var dd = UtilityHelper.ReturnToDynamic(strReturn);
+ if (dd.rtnCode > 0)
+ {
+ BeginInvoke(new Action(() =>
+ {
+ txtWCurrent.Text = dd.rtnData;
+ }));
+ }
+ }
+ catch (Exception ex)
+ {
+ Gs.DevApp.ToolBox.LogHelper.Debug(this.ToString(), "WorkWeight/GetIqcWeight:" + ex.Message);
+ }
+ };
+ timer.AutoReset = true; // 璁剧疆涓簍rue琛ㄧず閲嶅鎵ц锛宖alse琛ㄧず鎵ц涓�娆″悗鍋滄
+ timer.Enabled = true; // 寮�濮嬭鏃�
+ //璇诲彇閲嶉噺
+ this.btnW.Click += (s, e) =>
+ {
+ string _strCurrent = this.txtWCurrent.Text.Trim();
+ bool _isNumeric = decimal.TryParse(_strCurrent, out _);
+ if (!_isNumeric)
+ {
+ ToolBox.MsgHelper.ShowError("璇锋鏌ョО閲嶈缃紒");
+ return;
+ }
+ decimal _decCurrent = decimal.Parse(_strCurrent);
+ if (_decCurrent * 1 <= 0)
+ {
+ ToolBox.MsgHelper.ShowError("璇锋鏌ョО閲嶈缃紒");
+ return;
+ }
+ if (txt_weight1.Text.Trim().Length <= 0)
+ {
+ _setWeigth(1, _strCurrent);
+ return;
+ }
+ if (txt_weight2.Text.Trim().Length <= 0)
+ {
+ _setWeigth(2, _strCurrent);
+ return;
+ }
+ if (txt_weight3.Text.Trim().Length <= 0)
+ {
+ _setWeigth(3, _strCurrent);
+ return;
+ }
+ if (txt_weight4.Text.Trim().Length <= 0)
+ {
+ _setWeigth(4, _strCurrent);
+ return;
+ }
+ if (txt_weight5.Text.Trim().Length <= 0)
+ {
+ _setWeigth(5, _strCurrent);
+ return;
+ }
+ ToolBox.MsgHelper.ShowError("閲嶉噺宸茶幏鍙栧畬姣曪紒");
+ return;
+ };
+ //娓呯┖
+ this.btnClean.Click += (s, e) =>
+ {
+ if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + txt_releaseNo.Text.Trim() + "銆戯紝纭畾娓呴櫎鎵�鏈夌О閲嶆暟鎹悧锛�"))
+ return;
+ _setWeigth(99, "");
+
+ };
+ #endregion
+
+ }
+ /// <summary>
+ /// 鎻愪氦绉伴噸
+ /// </summary>
+ /// <param name="_weightType"></param>
+ /// <param name="_weight"></param>
+ private void _setWeigth(int _weightType, string _weight)
+ {
+ var _obj = new
+ {
+ iqcGuid = this.txt_guid.Text.Trim(),
+ weightType = _weightType,
+ weight = _weight
+ };
+ try
+ {
+ var strReturn = UtilityHelper.HttpPost("", "WorkWeight/EditIqcWeight", JsonConvert.SerializeObject(_obj), false);
+ var dd = UtilityHelper.ReturnToDynamic(strReturn);
+ if (dd.rtnCode <= 0)
+ {
+ ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + dd.rtnMsg);
+ }
+ else
+ {
+ if (_weightType == 1)
+ {
+ txt_weight1.Text = _weight;
+ return;
+ }
+ if (_weightType == 2)
+ {
+ txt_weight2.Text = _weight;
+ return;
+ }
+ if (_weightType == 3)
+ {
+ txt_weight3.Text = _weight;
+ return;
+ }
+ if (_weightType == 4)
+ {
+ txt_weight4.Text = _weight;
+ return;
+ }
+ if (_weightType == 5)
+ {
+ txt_weight5.Text = _weight;
+ return;
+ }
+ if (_weightType == 99)
+ {
+ this.txt_weight1.Text = this.txt_weight2.Text = this.txt_weight3.Text = this.txt_weight4.Text = this.txt_weight5.Text = "";
+ return;
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
+ }
+ }
/// <summary>
/// 鎵归噺褰曞叆
@@ -104,7 +271,7 @@
string strGuid = lbGuid.Text.Trim();
if (string.IsNullOrEmpty(strGuid))
{
- ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
var _obj = new
@@ -126,7 +293,7 @@
}
catch (Exception ex)
{
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
/// <summary>
@@ -139,7 +306,7 @@
int intHandle = this.gvMx1.FocusedRowHandle;
if (intHandle < 0)
{
- ToolBox.MsgHelper.Warning("鎻愮ず锛氳閫夋嫨妫�楠岄」鐩紒");
+ ToolBox.MsgHelper.ShowError("鎻愮ず锛氳閫夋嫨妫�楠岄」鐩紒");
return;
}
if (e.KeyCode == Keys.Enter)
@@ -188,7 +355,7 @@
}
catch (Exception ex)
{
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
}
@@ -239,7 +406,7 @@
lbGuid, txt_releaseNo, gridView1);
toolBarMenu1.guidKey = rowGuid;
}
-
+
private void ToolBarMenu1_btnChkClick(object sender, EventArgs e)
{
@@ -272,7 +439,7 @@
lbGuid, txt_releaseNo, gridView1, "releaseNo");
if (string.IsNullOrEmpty(rowGuid))
{
- MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾瀵煎嚭鍚楋紵"))
@@ -301,7 +468,8 @@
{
client.DownloadFile(_url, _folderName);
}
- ToolBox.MsgHelper.ShowInformation("瀵煎嚭鎴愬姛锛�");
+ var frm = new Gs.DevApp.DevFrm.QC.Xls(_folderName);
+ frm.ShowDialog();
}
else
{
@@ -350,7 +518,7 @@
(rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1, "releaseNo");
if (string.IsNullOrEmpty(rowGuid))
{
- ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
@@ -378,7 +546,7 @@
toolBarMenu1.isSetBtn = false;
if (txt_fcheckResu.Text.Trim() == _strTag && string.IsNullOrEmpty(txt_fngDesc.TextTxt.Trim()))
{
- Gs.DevApp.ToolBox.MsgHelper.Warning("褰撴楠岀粨鏋滀笉鍚堟牸鏃讹紝璇峰~鍐欏娉ㄨ鏄庯紒");
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("褰撴楠岀粨鏋滀笉鍚堟牸鏃讹紝璇峰~鍐欏娉ㄨ鏄庯紒");
txt_fngDesc.Focus();
return;
}
@@ -391,7 +559,7 @@
{
string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj));
ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
-
+
if (_rtn.rtnCode > 0)
{
ToolBox.MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg);
@@ -418,7 +586,11 @@
/// <param name="pageSize">姣忛〉鍑犳潯</param>
private void getPageList(int curPage)
{
- gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
+ gcMain1.DataSource = null;
+ System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder();
+ _sbSqlWhere.Append(" and a.ReceiveOrgId in");
+ _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere());
+ _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList));
PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "release_no", "asc", "", _sbSqlWhere.ToString());
string json = JsonConvert.SerializeObject(pgq);
try
@@ -450,7 +622,7 @@
}
catch (Exception ex)
{
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
@@ -466,7 +638,7 @@
if (toolBarMenu1.currentAction == "edit") isEdit = true;
if (string.IsNullOrEmpty(strGuid))
{
- ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
var _obj = new
@@ -518,11 +690,11 @@
}
}
else
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
}
catch (Exception ex)
{
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
@@ -578,7 +750,7 @@
}
catch (Exception ex)
{
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
/// <summary>
@@ -590,6 +762,7 @@
txtJianYan.ReadOnly = !bl;
btnLoad.Enabled = bl;
btnIpt.Text = (bl == true ? "褰曞叆鏍锋湰" : "鏌ョ湅鏍锋湰");
+ btnW.Enabled = btnClean.Enabled = bl;
}
#region 鎵撳紑鐖朵翰绐楀彛濮旀墭锛屾煡鐪嬪紓甯告姤鍛�
@@ -640,7 +813,7 @@
_webServiceName + _meth,
JsonConvert.SerializeObject(_obj));
var _rtn = UtilityHelper.ReturnToDynamic(strJson);
-
+
if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
{
MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnData.outMsg);
--
Gitblit v1.9.3