From 3ab8acb38e1e853d7002836f681a8b7a3ee96b5a Mon Sep 17 00:00:00 2001
From: wyb <1qaz@123>
Date: 星期二, 25 五月 2021 17:43:58 +0800
Subject: [PATCH] 不良原因设置增删改

---
 WebAPI/Controllers/QC_ManagementController.cs |   50 ++++++++++++++++++++++++++++----------------------
 1 files changed, 28 insertions(+), 22 deletions(-)

diff --git a/WebAPI/Controllers/QC_ManagementController.cs b/WebAPI/Controllers/QC_ManagementController.cs
index 2a8adee..fdde39f 100644
--- a/WebAPI/Controllers/QC_ManagementController.cs
+++ b/WebAPI/Controllers/QC_ManagementController.cs
@@ -151,7 +151,7 @@
                 }
                 else
                 {
-                    string sql1 = "select * from h_v_QC_POStockInCheckBillList where 1 = 1 ";
+                    string sql1 = "select * from h_v_QC_POStockInCheckBillList where 鍏抽棴浜�='' ";
                     string sql = sql1 + sqlWhere;
                     ds = oCN.RunProcReturn(sql, "h_v_QC_POStockInCheckBillList");
                 }
@@ -182,11 +182,11 @@
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 if (sqlWhere == null || sqlWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn("select top 500 * from h_v_QC_FirstPieceCheckBillList ", "h_v_QC_FirstPieceCheckBillList");
+                    ds = oCN.RunProcReturn("select top 500 * from h_v_QC_FirstPieceCheckBillList  where  鍏抽棴浜�='' ", "h_v_QC_FirstPieceCheckBillList");
                 }
                 else
                 {
-                    string sql1 = "select * from h_v_QC_FirstPieceCheckBillList where 1 = 1 ";
+                    string sql1 = "select * from h_v_QC_FirstPieceCheckBillList where 鍏抽棴浜�='' ";
                     string sql = sql1 + sqlWhere;
                     ds = oCN.RunProcReturn(sql, "h_v_QC_FirstPieceCheckBillList");
                 }
@@ -217,11 +217,11 @@
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 if (sqlWhere == null || sqlWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn("select top 500 * from h_v_QC_PatrolProcCheckBillList ", "h_v_QC_PatrolProcCheckBillList");
+                    ds = oCN.RunProcReturn("select top 500 * from h_v_QC_PatrolProcCheckBillList where  鍏抽棴浜�=''", "h_v_QC_PatrolProcCheckBillList");
                 }
                 else
                 {
-                    string sql1 = "select * from h_v_QC_PatrolProcCheckBillList where 1 = 1 ";
+                    string sql1 = "select * from h_v_QC_PatrolProcCheckBillList where 鍏抽棴浜�='' ";
                     string sql = sql1 + sqlWhere;
                     ds = oCN.RunProcReturn(sql, "h_v_QC_PatrolProcCheckBillList");
                 }
@@ -435,6 +435,7 @@
 
         #region 淇濆瓨/缂栬緫/鍒犻櫎鏂规硶
 
+        #region 妫�楠屾柟妗�
         /// <summary>
         /// 淇濆瓨妫�楠屾柟妗�
         /// </summary>
@@ -510,7 +511,7 @@
                     oItemSub.HSourceEntryID =0;
                     oItemSub.HSourceInterID =0;
                     oItemSub.HEntryID = i;
-                    oItemSub.HEntryCloseDate = Convert.ToDateTime("");
+                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                     oItemSub.HCloseType = false;
                     oItemSub.HSourceBillNo = "";
                     oItemSub.HSourceBillType = "";
@@ -634,8 +635,9 @@
                 return objJsonResult;
             }
         }
+        #endregion
 
-
+        #region 鏉ユ枡妫�楠�
         /// <summary>
         /// 淇濆瓨鏉ユ枡妫�楠屽崟
         /// </summary>
@@ -711,7 +713,7 @@
                     oItemSub.HSourceInterID = 0;
                     oItemSub.HEntryID = i;
                     // DBUtility.ClsPub.isDate(DateTime.Now);
-                    oItemSub.HEntryCloseDate = Convert.ToDateTime("");
+                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                     oItemSub.HCloseType = false;
                     oItemSub.HSourceBillNo = "";
                     oItemSub.HSourceBillType = "";
@@ -836,7 +838,9 @@
                 return objJsonResult;
             }
         }
+        #endregion
 
+        #region 棣栦欢妫�楠�
         /// <summary>
         /// 淇濆瓨棣栦欢妫�楠屽崟
         /// </summary>
@@ -913,7 +917,7 @@
                     oItemSub.HSourceInterID = 0;
                     oItemSub.HEntryID = i;
                     // DBUtility.ClsPub.isDate(DateTime.Now);
-                    oItemSub.HEntryCloseDate = Convert.ToDateTime("");
+                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                     oItemSub.HCloseType = false;
                     oItemSub.HSourceBillNo = "";
                     oItemSub.HSourceBillType = "";
@@ -996,8 +1000,8 @@
                     return objJsonResult;
                 }
                 oCN.BeginTran();//寮�濮嬩簨鍔�
-                ds = oCN.RunProcReturn("select * from QC_POStockInCheckBillMain where HInterID=" + HInterID, "QC_POStockInCheckBillMain");
-                DataSet ds2 = oCN.RunProcReturn("select * from QC_POStockInCheckBillSub where HInterID=" + HInterID, "QC_POStockInCheckBillSub");
+                ds = oCN.RunProcReturn("select * from QC_FirstPieceCheckBillMain where HInterID=" + HInterID, "QC_FirstPieceCheckBillMain");
+                DataSet ds2 = oCN.RunProcReturn("select * from QC_FirstPieceCheckBillSub where HInterID=" + HInterID, "QC_FirstPieceCheckBillSub");
                 if (ds == null || ds.Tables[0].Rows.Count == 0 || ds2 == null || ds2.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.code = "0";
@@ -1018,8 +1022,8 @@
                     return objJsonResult;
                 }
 
-                oCN.RunProc("update QC_POStockInCheckBillMain set HCloseMan='-1',HCloseDate=GETDATE()  where HInterID=" + HInterID);
-                oCN.RunProc("update QC_POStockInCheckBillSub set HCloseMan='-1',HEntryCloseDate=GETDATE()  where HInterID=" + HInterID);
+                oCN.RunProc("update QC_FirstPieceCheckBillMain set HCloseMan='-1',HCloseDate=GETDATE()  where HInterID=" + HInterID);
+                oCN.RunProc("update QC_FirstPieceCheckBillSub set HCloseMan='-1',HEntryCloseDate=GETDATE()  where HInterID=" + HInterID);
                 oCN.Commit();//鎻愪氦浜嬪姟
                 objJsonResult.code = "0";
                 objJsonResult.count = 1;
@@ -1037,7 +1041,9 @@
                 return objJsonResult;
             }
         }
+        #endregion
 
+        #region 宸℃
         /// <summary>
         /// 淇濆瓨宸℃鍗�
         /// </summary>
@@ -1058,7 +1064,7 @@
             ListModels oListModels = new ListModels();
             try
             {
-                DAL.ClsQC_PatrolProcCheckBill oBill = new DAL.ClsQC_PatrolProcCheckBill();
+                WebAPI.DLL.ClsQC_PatrolProcCheckBill oBill = new WebAPI.DLL.ClsQC_PatrolProcCheckBill();
                 List<Model.ClsQC_PatrolProcCheckBillMain> lsmain = new List<Model.ClsQC_PatrolProcCheckBillMain>();
                 msg2 = msg2.Replace("\\", "");
                 msg2 = msg2.Replace("\n", "");  //\n
@@ -1070,8 +1076,8 @@
                     oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
                     oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
                     oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
-                    oItem.HBillType = "7503";
-                    oItem.HBillSubType = "7503";
+                    oItem.HBillType = "7506";
+                    oItem.HBillSubType = "7506";
                     oItem.HBillStatus = 0;
                     oItem.HPeriod = 0;
                     oItem.HMaker = "";
@@ -1113,7 +1119,7 @@
                     oItemSub.HSourceInterID = 0;
                     oItemSub.HEntryID = i;
                     // DBUtility.ClsPub.isDate(DateTime.Now);
-                    oItemSub.HEntryCloseDate = Convert.ToDateTime("");
+                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                     oItemSub.HCloseType = false;
                     oItemSub.HSourceBillNo = "";
                     oItemSub.HSourceBillType = "";
@@ -1196,8 +1202,8 @@
                     return objJsonResult;
                 }
                 oCN.BeginTran();//寮�濮嬩簨鍔�
-                ds = oCN.RunProcReturn("select * from QC_POStockInCheckBillMain where HInterID=" + HInterID, "QC_POStockInCheckBillMain");
-                DataSet ds2 = oCN.RunProcReturn("select * from QC_POStockInCheckBillSub where HInterID=" + HInterID, "QC_POStockInCheckBillSub");
+                ds = oCN.RunProcReturn("select * from QC_PatrolProcCheckBillMain where HInterID=" + HInterID, "QC_PatrolProcCheckBillMain");
+                DataSet ds2 = oCN.RunProcReturn("select * from QC_PatrolProcCheckBillSub where HInterID=" + HInterID, "QC_PatrolProcCheckBillSub");
                 if (ds == null || ds.Tables[0].Rows.Count == 0 || ds2 == null || ds2.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.code = "0";
@@ -1218,8 +1224,8 @@
                     return objJsonResult;
                 }
 
-                oCN.RunProc("update QC_POStockInCheckBillMain set HCloseMan='-1',HCloseDate=GETDATE()  where HInterID=" + HInterID);
-                oCN.RunProc("update QC_POStockInCheckBillSub set HCloseMan='-1',HEntryCloseDate=GETDATE()  where HInterID=" + HInterID);
+                oCN.RunProc("update QC_PatrolProcCheckBillMain set HCloseMan='-1',HCloseDate=GETDATE()  where HInterID=" + HInterID);
+                oCN.RunProc("update QC_PatrolProcCheckBillSub set HCloseMan='-1',HEntryCloseDate=GETDATE()  where HInterID=" + HInterID);
                 oCN.Commit();//鎻愪氦浜嬪姟
                 objJsonResult.code = "0";
                 objJsonResult.count = 1;
@@ -1237,7 +1243,7 @@
                 return objJsonResult;
             }
         }
-
+        #endregion
 
         #endregion
 

--
Gitblit v1.9.1