From 838ed2eabcac0a0f5daa13bb4f0e46b745edca0a Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期四, 31 八月 2023 10:49:45 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WarM/条码打印/Kf_WeighToBarCode.cs |   45 +++++++++++++++++++++++++++++++++++++++------
 1 files changed, 39 insertions(+), 6 deletions(-)

diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Kf_WeighToBarCode.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Kf_WeighToBarCode.cs"
index 5c18417..cbb25c7 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Kf_WeighToBarCode.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Kf_WeighToBarCode.cs"
@@ -38,6 +38,7 @@
         public Int64 ProcessExchangeInterID = 0;
         public Int64 HSupID = 0;
         public double HSourceQty = 0;
+        public double HMaterWeight = 0;         //鐗╂枡鍏嬮噸
         public string HMaker = DBUtility.ClsPub.CurUserName;
         public Int64 HStockOrgID = DBUtility.ClsPub.HOrgID;
         public DateTime HDate = DateTime.Today;
@@ -313,8 +314,8 @@
             bool b = false;
             for (int i = 0; i < grdMain.RowCount; i++)
             {
-                    b = true;
-                    break;
+                b = true;
+                break;
             }
             if (b == false)
             {
@@ -337,7 +338,16 @@
                 oCn.BeginTran();
                 //鐢熸垚鍑哄叆搴撳崟鎹�
                 //鎻掑叆瀛愯〃
-                oCn.RunProc("EXEC h_p_Kf_ProductInBillSub_Insert_New " + HInterID.ToString() + ",'" + HBillNo + "','" + HSourceBillType + "'");
+                DataSet ds = oCn.RunProcReturn("EXEC h_p_Kf_ProductInBillSub_Insert_New " + HInterID.ToString() + ",'" + HBillNo + "','" + HSourceBillType + "'", "h_p_Kf_ProductInBillSub_Insert_New");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                }
+                else if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0][0]) != "OK")
+                {
+                    oCn.RollBack();
+                    MessageBox.Show("鐢熸垚鍏ュ簱鍗曞け璐ワ紝褰撳墠绉伴噸璁板綍鍒楄〃鏃犳暟鎹紝涓嶅厑璁告崲鐝敓鎴愬崟鎹紒", "鎻愮ず");
+                    return false;
+                }
                 //鎻掑叆涓昏〃
                 oCn.RunProc("Insert Into Kf_ICStockBillMain " +
                     "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMainSourceBillType" +
@@ -541,6 +551,22 @@
                 MessageBox.Show("鐗╂枡榛樿浠撳簱鍚敤浜嗕粨浣嶏紝浣嗘湭璁剧疆浠撲綅锛岃幏鍙栦粨浣嶄俊鎭け璐ワ紝璇峰厛璁剧疆鐗╂枡榛樿浠撲綅锛�", "鎻愮ず");
                 return false;
             }
+
+            //瀹為檯鍏嬮噸=閲嶉噺/绫虫暟*1000锛屽疄闄呭厠閲嶈秴鍑虹墿鏂欑淮鎶ゅ厠閲嶇殑鐧惧垎涔嬩簩鍗佹垨涓嶈冻鐗╂枡缁存姢鍏嬮噸鐨勭櫨鍒嗕箣鍏崄锛岄璀︽彁绀�
+            double sQty = 0;    //瀹為檯鍏嬮噸
+            sQty = DBUtility.ClsPub.isDoule(txtHWeightQyt.Text) / DBUtility.ClsPub.isDoule(txtHQty.Text) * 1000;
+
+            if (sQty > HMaterWeight * 1.2 || sQty < HMaterWeight * 0.8)
+            {
+                if (MessageBox.Show("鐗╂枡缁存姢鍏嬮噸涓猴細"+HMaterWeight.ToString()+ "锛屽疄闄呭厠閲嶄负锛�" + sQty.ToString() + "锛屾墍杈撳叆瀹為檯鍏嬮噸瓒呭嚭鐗╂枡缁存姢鍏嬮噸鐨勭櫨鍒嗕箣浜屽崄鎴栦笉瓒崇墿鏂欑淮鎶ゅ厠閲嶇殑鐧惧垎涔嬪叓鍗侊紝璇锋鏌ヨ緭鍏ョ殑鏁版嵁鏄惁姝g‘锛�", "鎻愮ず", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
+                {
+                    return true;
+                }
+                else
+                {
+                    return false;
+                }
+            }
             return true;
         }
 
@@ -610,6 +636,8 @@
             string ProcessExchangeBillNo = "";
             Int64 HBarcodeNo = 0;       //鍖呮暟
             Int64 HBadReasonID = 0;     //涓嶈壇鍘熷洜ID
+            string HCusMaterName = "";  //瀹㈡埛鐗╂枡鍚嶇О
+            string HCusModel = "";      //瀹㈡埛瑙勬牸鍨嬪彿
 
             HBarCode = TM;
             HBarCodeType = DBUtility.ClsPub.isStrNull(cmbHBarCodeType.Text);
@@ -623,11 +651,13 @@
             ProcessExchangeBillNo = DBUtility.ClsPub.isStrNull(txtHBillNo.Text);
             HBarcodeNo = DBUtility.ClsPub.isLong(txtHBarcodeNo.Text);
             HBadReasonID = DBUtility.ClsPub.isLong(txtHRemark.Tag);
+            HCusMaterName = DBUtility.ClsPub.isStrNull(txtHCusMaterName.Text);
+            HCusModel = DBUtility.ClsPub.isStrNull(txtHCusModel.Text);
 
             try
             {
                 oCn.BeginTran();
-                //鍐欏叆鏉$爜妗f
+                //鍐欏叆鏉$爜妗f    (瀹㈡埛鐗╂枡鍚嶇ОHCusMaterName瀛樺叆HMaterialModel瀛楁锛屽鎴疯鏍煎瀷鍙稨CusModel瀛樺叆HCusModel瀛楁
                 oCn.RunProc("Insert into Gy_BarCodeBill " +
                 "(HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
                 ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
@@ -635,7 +665,7 @@
                 ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " +
                 ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate,HMaterialJQty,HMaterialMQty " +
                 ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HGiveAwayFlag " +
-                ",HOrderInterID,HOrderEntryID,HOrderBillNo,HCustomQty1 " +
+                ",HOrderInterID,HOrderEntryID,HOrderBillNo,HCustomQty1,HMaterialModel,HCusModel " +
                 ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " +
                 ") Values ("
                 + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty.ToString()
@@ -644,7 +674,7 @@
                 + ", 1," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'"
                 + ", 0,'',getdate(),'','" + sDate + "'," + HMaterialJQty.ToString() + "," + HMaterialMQty.ToString()
                 + ", " + HStockOrgID.ToString() + "," + HStockOrgID.ToString() + ",''," + HInterID.ToString() + ",0"
-                + ", " + ProcessExchangeInterID.ToString() + ",0,'" + ProcessExchangeBillNo + "'," + HBadReasonID.ToString()
+                + ", " + ProcessExchangeInterID.ToString() + ",0,'" + ProcessExchangeBillNo + "'," + HBadReasonID.ToString() + ",'" + HCusMaterName + "','" + HCusModel + "'"
                 + ",'" + HMaterName + "','" + HMaterModel + "',''," + HAuxPropID.ToString() + ",'','')");
 
                 //鍥炲~鏈�澶ф祦姘村彿
@@ -695,6 +725,8 @@
             txtHMaterName.Text = DBUtility.ClsPub.isStrNull(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("鐗╂枡鍚嶇О")].Value);
             txtHMaterModel.Text = DBUtility.ClsPub.isStrNull(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("瑙勬牸鍨嬪彿")].Value);
             txtHBatchNo.Text = DBUtility.ClsPub.isStrNull(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("鎵瑰彿")].Value);
+            txtHCusMaterName.Text = DBUtility.ClsPub.isStrNull(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HCusMaterName")].Value);
+            txtHCusModel.Text = DBUtility.ClsPub.isStrNull(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HCusModel")].Value);
             HAuxPropID = DBUtility.ClsPub.isLong(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HAuxPropID")].Value);
             HUnitID = DBUtility.ClsPub.isLong(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HUnitID")].Value);
             HWhID = DBUtility.ClsPub.isLong(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HWhID")].Value);
@@ -707,6 +739,7 @@
             HSourceQty = DBUtility.ClsPub.isDoule(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("鏁伴噺")].Value);
             ProcessExchangeInterID = DBUtility.ClsPub.isLong(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("ProcessExchangeInterID")].Value);
             HSupID = DBUtility.ClsPub.isLong(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HSupID")].Value);
+            HMaterWeight = DBUtility.ClsPub.isDoule(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HMaterWeight")].Value);
         }
 
         //杩斿洖婧愬崟鍒楄〃淇℃伅

--
Gitblit v1.9.1