From 291fdb29daf239a13fcfb3f5e08a2f5bf9167534 Mon Sep 17 00:00:00 2001
From: chenhaozhe <gaozhechen26@gmail.com>
Date: 星期六, 07 三月 2026 17:37:07 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WarM/条码打印/Gy_BarCodeBill_automaticallyByPLC_New_Change.cs |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New_Change.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New_Change.cs"
index 2bcc8d5..98255b8 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New_Change.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New_Change.cs"
@@ -17,6 +17,8 @@
 using System.Printing;
 using uPLibrary.Networking.M2Mqtt;
 using uPLibrary.Networking.M2Mqtt.Messages;
+using WebAPI;
+using Newtonsoft.Json;
 
 namespace WarM
 {
@@ -429,7 +431,11 @@
             }
 
             this.Sub_SaveBill();
+            LogService.Write("==============================================================================================");
+            LogService.Write("鑾峰彇鎵撳嵃鍒楄〃銆�" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "銆�");
             Display();
+            LogService.Write("鑾峰彇鎵撳嵃鍒楄〃缁撴潫銆�" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "銆�");
+            LogService.Write("==============================================================================================");
 
             if (radioButton_IsPrint_Yes.Checked == true)
             {
@@ -851,6 +857,7 @@
                         HWhID = ClsPub.isLong(grdSub.Rows[i].Cells[HWhID2Col].Value);
                         HSPID = ClsPub.isLong(grdSub.Rows[i].Cells[HSPID2Col].Value);
                         HRemark = ClsPub.isStrNull(grdSub.Rows[i].Cells[HRemark2Col].Value);
+                        HRemark = "PLC鑷姩鐢熸垚";
                         HMaterName = ClsPub.isStrNull(grdSub.Rows[i].Cells[HMaterName2Col].Value);
                         HMaterModel = ClsPub.isStrNull(grdSub.Rows[i].Cells[HMaterModel2Col].Value);
                         HPinfan = ClsPub.isStrNull(grdSub.Rows[i].Cells[HPinfan2Col].Value);
@@ -957,14 +964,14 @@
                 string LIU = "";
                 int LEN = 4;
                 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 + "' order by 鎵瑰彿 desc";
+                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 澶囨敞 = 'PLC鑷姩鐢熸垚' order by 鎵瑰彿 desc";
                 ds = oCn.RunProcReturn(sql, "h_v_IF_BarCodeBillList");
                 if (ds != null)
                 {
                     long count = 0;
                     if (ds.Tables[0].Rows.Count > 0)
                     {
-                        count = ClsPub.isLong(ds.Tables[0].Rows[0]["鎵瑰彿"].ToString().Replace(sYear + sPeriod + sDay, ""));
+                        count = ClsPub.isLong(ds.Tables[0].Rows[0]["鎵瑰彿"].ToString().Replace(sYear + sPeriod + sDay + " ", ""));
                     }
                     LIU += count + 1;
                     while (LIU.Length < LEN)  //濡傛灉娴佹按鍙峰皬浜�6浣嶆暟鍓嶉潰琛�0
@@ -978,7 +985,7 @@
                 }
 
                 //鎷兼帴鎵瑰彿
-                HBatchNo = sYear + sPeriod + sDay + LIU;
+                HBatchNo = sYear + sPeriod + sDay + " " + LIU;
             }
 
 
@@ -1165,7 +1172,11 @@
                 this.Sub_SaveBill();
 
                 //鑾峰彇闇�瑕佹墦鍗扮殑鏁版嵁
+                LogService.Write("==============================================================================================");
+                LogService.Write("鑾峰彇鎵撳嵃鍒楄〃銆�" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "銆�");
                 Display();
+                LogService.Write("鑾峰彇鎵撳嵃鍒楄〃缁撴潫銆�" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "銆�");
+                LogService.Write("==============================================================================================");
 
                 if (radioButton_IsPrint_Yes.Checked == true)
                 {
@@ -1196,8 +1207,10 @@
         //鑾峰彇闇�瑕佹墦鍗扮殑鏁版嵁骞跺瓨鏀惧湪瀛愯〃grdList
         private void Display()
         {
+            LogService.Write("鎵撳嵃鍒楄〃鎼滅储璇彞锛氥�恠elect * from h_v_IF_BarCodeBillList Where HinterID=" + HInterID.ToString() + " and HMaterID = " + grdMain.Rows[0].Cells[HMaterIDCol].Value + " order by HItemID銆�");
+
             //璁剧疆妗f鍒楄〃閫夐」鍗¤〃鏍兼暟鎹�
-            DataSet DSet = oCn.RunProcReturn("select * from h_v_IF_BarCodeBillList Where HinterID=" + HInterID.ToString() + " order by HItemID", "h_v_IF_BarCodeBillList", ref DBUtility.ClsPub.sExeReturnInfo);
+            DataSet DSet = oCn.RunProcReturn("select * from h_v_IF_BarCodeBillList Where HinterID=" + HInterID.ToString() + " and HMaterID = " + grdMain.Rows[0].Cells[HMaterIDCol].Value + " order by HItemID", "h_v_IF_BarCodeBillList", ref DBUtility.ClsPub.sExeReturnInfo);
             //鐢熸垚棣栬鏍囬
             if (DSet == null)
             {
@@ -1212,6 +1225,8 @@
             DBUtility.Xt_BaseBillFun.DisplayGrid(grdList, this.Name + "grdList", s, FrCol);
             //鐢荤嚎
             //GraphLine();
+
+            LogService.Write("鎵撳嵃鍒楄〃鏁版嵁锛氥��" + JsonConvert.SerializeObject(DSet.Tables[0]) + "銆�");
         }
 
         //鑾峰彇宸ュ崟褰撳ぉ鐗╂枡鐢熸垚鐨勬潯鐮佽褰�
@@ -2356,6 +2371,7 @@
                 {
                     sMoney = ClsPub.isDoule(grdMain.Rows[sRow].Cells[HQtyCol].Value) / ClsPub.isDoule(grdMain.Rows[sRow].Cells[HMinQtyCol].Value);
                 }
+                sMoney = Math.Round(sMoney, 10);    // 淇濈暀10浣嶅皬鏁拌繘琛屽洓鑸嶄簲鍏�
                 sMoney = Math.Ceiling(sMoney);
                 grdMain.Rows[sRow].Cells[HBQtyCol].Value = sMoney;
             }

--
Gitblit v1.9.1