From b0dc4d211319747633b1a9de9b925d7abf3feafb Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期四, 09 五月 2024 17:07:08 +0800
Subject: [PATCH] 1.增加 防错装置的 基础资料编辑 和 列表 页面; 2.网页版 增加 设备停机单 单据编辑 以及 单据列表 功能 3.网页版 增加 设备开机单 单据编辑 以及 单据列表 功能
---
WarM/条码打印/Gy_BarCodeBill_automaticallyByPLC_New.cs | 66 ++++++++++++++++++++++++++++++++
1 files changed, 65 insertions(+), 1 deletions(-)
diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New.cs"
index 2319049..6da5b7b 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New.cs"
@@ -850,6 +850,8 @@
HBatchNo2 = getBatchNo();
}
+ HBarCode = ClsPub.isStrNull(grdSub.Rows[i].Cells[HMaterModel2Col].Value) + getHBarCode_MaxNo();
+
long HSourceID = 0;
string sql = "select * from Gy_Source where HName = '" + comboBox_SourceNameParams.Text + "' ";
DataSet ds = oCn.RunProcReturn(sql, "Gy_Source");
@@ -944,6 +946,69 @@
return HBatchNo;
}
+
+ //鐢熸垚褰撳ぉ浜у搧鏉$爜鐨勬祦姘村彿
+ private string getHBarCode_MaxNo()
+ {
+ string HBarCode_MaxNo = "";
+
+ //鏃ユ湡鑾峰彇鏂瑰紡
+ string sDate = dtpHDate.Value.ToShortDateString(); //
+ string sYear = ClsPub.isDate(sDate).Year.ToString().Substring(2, 2);
+ string sPeriod = "0" + ClsPub.isDate(sDate).Month.ToString();
+ sPeriod = sPeriod.Substring(sPeriod.Length - 2, 2);
+ string sDay = "0" + ClsPub.isDate(sDate).Day.ToString();
+ sDay = sDay.Substring(sDay.Length - 2, 2);
+
+ string HDate = "20" + sYear + "-" + sPeriod + "-" + sDay;
+
+ //鑾峰彇娴佹按鍙凤細鍥涗綅锛岃鐗╂枡褰撳ぉ鐢熸垚鐨勬潯鐮佹暟
+ string LIU = "";
+ int LEN = 4;
+
+ //鑾峰彇浜у搧鏉$爜澶囦唤琛ㄤ腑褰撴棩鏈骇鍝佹潯鐮佺紪鍙锋渶澶х殑璁板綍
+ long HMaxNo_Bak = 0; //璁板綍浜у搧鏉$爜澶囦唤琛ㄤ腑褰撴棩鏈骇鍝佹潯鐮佺紪鍙锋渶澶х殑璁板綍鐨勬潯鐮佺紪鍙风殑娴佹按鍙�
+ DataSet ds1;
+ string sql1 = "select * from Gy_BarCodeBill_SWELL_SubBarCodeBill Where HMaterID = " + grdMain.Rows[0].Cells[HMaterIDCol].Value + " and HSTOCKORGID = " + HOrgID + " and CONVERT(varchar(100),HBarCodeDate, 23) = '" + HDate + "' and HInterID <>0 order by HBarCode desc";
+ ds1 = oCn.RunProcReturn(sql1, "Gy_BarCodeBill_SWELL_SubBarCodeBill");
+ if (ds1 != null && ds1.Tables[0].Rows.Count>0)
+ {
+ string HBarCodeMaxNo = ds1.Tables[0].Rows[0]["HBarCode"].ToString();
+ HBarCodeMaxNo = HBarCodeMaxNo.Substring(HBarCodeMaxNo.Length - LEN, LEN);
+ HMaxNo_Bak = ClsPub.isLong(HBarCodeMaxNo);
+ }
+
+ ////鑾峰彇鏉$爜妗f涓綋鏃ユ湰浜у搧鏉$爜缂栧彿鏈�澶х殑璁板綍
+ long HMaxNo = 0; //璁板綍鏉$爜妗f涓綋鏃ユ湰浜у搧鏉$爜缂栧彿鏈�澶х殑璁板綍鐨勬潯鐮佺紪鍙风殑娴佹按鍙�
+ DataSet ds;
+ string sql = "select * from h_v_IF_BarCodeBillList Where HMaterID = " + grdMain.Rows[0].Cells[HMaterIDCol].Value + " and HSTOCKORGID = " + HOrgID + " and CONVERT(varchar(100),鏉$爜鏃ユ湡, 23) = '" + HDate + "' and HInterID <> 0 order by 鏉$爜缂栧彿 desc";
+ ds = oCn.RunProcReturn(sql, "h_v_IF_BarCodeBillList");
+ if (ds != null && ds.Tables[0].Rows.Count > 0)
+ {
+ string HBarCodeMaxNo = ds.Tables[0].Rows[0]["鏉$爜缂栧彿"].ToString();
+ HBarCodeMaxNo = HBarCodeMaxNo.Substring(HBarCodeMaxNo.Length - LEN, LEN);
+ HMaxNo = ClsPub.isLong(HBarCodeMaxNo);
+ }
+
+
+ //鑾峰彇褰撴棩鏈骇鍝� 鍦ㄦ潯鐮佹。妗堝拰浜у搧鏉$爜澶囦唤琛ㄤ腑 鏈�澶х殑娴佹按鍙�
+ long count = 0;
+ count = HMaxNo >= HMaxNo_Bak ? HMaxNo : HMaxNo_Bak;
+
+ //涓烘祦姘村彿鍓嶉潰琛ラ浂
+ LIU += count + 1;
+ while (LIU.Length < LEN) //濡傛灉娴佹按鍙峰皬浜�6浣嶆暟鍓嶉潰琛�0
+ {
+ LIU = "0" + LIU;
+ }
+
+ //鎷兼帴鎵瑰彿
+ HBarCode_MaxNo = sYear + sPeriod + sDay + LIU;
+
+ return HBarCode_MaxNo;
+ }
+ #endregion
+
#endregion
#region 鐩戝惉閫氳
@@ -1712,7 +1777,6 @@
{
return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdList);
}
- #endregion
#endregion
--
Gitblit v1.9.1