From 272483c2ad7aaf288316ff08ace8f2e97440b880 Mon Sep 17 00:00:00 2001
From: ch <37327@LLOOCCY>
Date: 星期四, 11 十一月 2021 21:41:00 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WorkM/流转卡管理/MES_StationOutBillList_Bad.cs |   57 ++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 50 insertions(+), 7 deletions(-)

diff --git "a/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/MES_StationOutBillList_Bad.cs" "b/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/MES_StationOutBillList_Bad.cs"
index 1ed6549..1756635 100644
--- "a/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/MES_StationOutBillList_Bad.cs"
+++ "b/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/MES_StationOutBillList_Bad.cs"
@@ -496,7 +496,7 @@
             //LOT鍙�
             if (txtHBillNo.Text.Trim() != "")
             {
-                sFastSQL = sFastSQL + " and 娴佽浆鍗″彿 like '%" + txtHBillNo.Text + "%'";
+                sFastSQL = sFastSQL + " and 宸ュ簭娴佽浆鍗″彿 like '%" + txtHBillNo.Text + "%'";
             }
             //宸ヤ綔涓績
             if (txtHCenterID.Text.Trim() != "")
@@ -618,7 +618,12 @@
             int MainIDCol =  Fun_GetCol("hmainid");
             int SubIDCol = Fun_GetCol("hsubid");
             int BillNoCol = Fun_GetCol("鍗曟嵁鍙�");
-            DAL.ClsKf_ProductInBill oClsKf_ProductInBill ;
+            int HUserK3Col = Fun_GetCol("K3鐢ㄦ埛");
+            int HKeepCol = Fun_GetCol("K3淇濈");
+            int HSecManagerCol = Fun_GetCol("K3楠屾敹");
+            int HDeptCol = Fun_GetCol("K3閮ㄩ棬");
+            DAL.ClsKf_ProductInBill oClsKf_ProductInBill;
+            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
             //鑾峰彇绯荤粺鍙傛暟
             Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
             if (oSystemParameter.ShowBill(ref DBUtility.ClsPub.sExeReturnInfo) == false)
@@ -635,6 +640,34 @@
                 MessageBox.Show("浼氳鏈熼棿鏈夐敊璇紒 " + DBUtility.ClsPub.sExeReturnInfo);
                 return;
             }
+            string sHInterID = "";
+            for (int i = 0; i < grdMain.SelectedRows.Count; i++)
+            {
+                sHInterID = sHInterID + "," + DBUtility.ClsPub.isStrNull(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[MainIDCol].Value);
+            }
+            if (sHInterID=="")
+            {
+                MessageBox.Show("娌℃湁閫変腑鐨勫崟鎹槑缁嗚锛岃鍏堥�夋嫨瑕佸叆搴撶殑鍗曟嵁锛�", "鎻愮ず");
+                return;
+            }
+            else
+            {
+                DataSet DS = oCn.RunProcReturn("exec h_p_MES_StationOutBillList_Bad_PreProductIn '" + sHInterID + "'", "h_p_MES_StationOutBillList_Bad_PreProductIn", ref DBUtility.ClsPub.sExeReturnInfo);
+                if (DS == null || DS.Tables[0].Rows.Count == 0)
+                {
+                    MessageBox.Show("鍏ュ簱鍓嶅垽鏂け璐ワ紒", "鎻愮ず");
+                    return;
+                }
+                else
+                {
+                    if (DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]) == "1")
+                    {
+                        MessageBox.Show(DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]));
+                        return;
+                    }
+                }
+            }
+
             Int64 n = 0;
             //寰幆 閫変腑琛�
             for (int i = 0; i < grdMain.SelectedRows.Count; i++)
@@ -645,15 +678,23 @@
                 oClsKf_ProductInBill.omodel.HInterID = ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[MainIDCol].Value);
                 oClsKf_ProductInBill.omodel.HDate = DateTime.Today;
                 oClsKf_ProductInBill.omodel.HBillNo = ClsPub.isStrNull(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[BillNoCol].Value);
-                oClsKf_ProductInBill.omodel.HDeptID = 0;
-                oClsKf_ProductInBill.omodel.HEmpID = 0;
-                oClsKf_ProductInBill.omodel.HSecManagerID = 0;
-                oClsKf_ProductInBill.omodel.HKeeperID = 0;
+                oClsKf_ProductInBill.omodel.HDeptID = ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[HDeptCol].Value);
+                oClsKf_ProductInBill.omodel.HEmpID = ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[HKeepCol].Value);
+                oClsKf_ProductInBill.omodel.HSecManagerID = ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[HSecManagerCol].Value);
+                oClsKf_ProductInBill.omodel.HKeeperID = ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[HKeepCol].Value);
+                oClsKf_ProductInBill.omodel.HBillerID = ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[HUserK3Col].Value);
                 oClsKf_ProductInBill.omodel.HRemark = "涓嶈壇鍝佸悓姝�";
                 oClsKf_ProductInBill.omodel.HMaker =  DBUtility.ClsPub.CurUserName;
                 oClsKf_ProductInBill.omodel.HWHID = 0;
                 oClsKf_ProductInBill.omodel.HSupID = 0;
                 oClsKf_ProductInBill.omodel.HExplanation = ""; 
+                if(oClsKf_ProductInBill.omodel.HBillerID==0 || oClsKf_ProductInBill.omodel.HKeeperID==0 
+                    || oClsKf_ProductInBill.omodel.HEmpID==0 || oClsKf_ProductInBill.omodel.HDeptID==0
+                    || oClsKf_ProductInBill.omodel.HSecManagerID ==0 )
+                {
+                    MessageBox.Show("娌℃湁璁剧疆閲戣澏鐢ㄦ埛銆侀儴闂ㄣ�佷繚绠°�侀獙鏀跺憳锛� " + DBUtility.ClsPub.sExeReturnInfo);
+                    continue;
+                }
                 if(oClsKf_ProductInBill.AddBill_StationOut_Bad("3710", oSystemParameter.omodel, ref DBUtility.ClsPub.sExeReturnInfo))
                 {
                     n++;
@@ -663,13 +704,15 @@
                     MessageBox.Show("鍚屾鍗曟嵁澶辫触锛�"+ DBUtility.ClsPub.sExeReturnInfo);
                 }
                 //浼戠湢5绉�
-                System.Threading.Thread.Sleep(5000);
+                System.Threading.Thread.Sleep(2000);
                 //
             }
             //
             if (n > 0)
             {
                 MessageBox.Show("鍚屾鍗曟嵁瀹屾瘯锛佷竴鍏辨湁" + n.ToString() + "寮犲叆搴撳崟锛�");
+                initGrid();
+                Display();
             }
         }
 

--
Gitblit v1.9.1