From 6773d107b6d63e8db137e415035a5c14d6b9ba89 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期二, 28 十一月 2023 12:09:50 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/MateOutController.cs                           |    1 
 WebAPI/Controllers/CJGL/Cj_SingleStationController.cs             |  160 ++++++++++++++++++++++----
 WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs     |   41 ++++++
 WebAPI/Controllers/BLL/Xt_UserController.cs                       |   12 +
 WebAPI/Controllers/SBGL/Sb_EquipDotCheckRuleBillController.cs     |    2 
 WebAPI/Web.config                                                 |    6 
 WebAPI/Controllers/SBGL/Sb_EquipMaintainPlanBillController.cs     |   41 ++++++
 Model/MES/ClsSc_SourceLineRepairBillMain.cs                       |    3 
 WebAPI/Controllers/品质管理/首件检验单/QC_FirstPieceCheckBillController.cs |   31 ++++
 WebAPI/Models/Gy_User.cs                                          |    3 
 WebAPI/Controllers/品质管理/工序检验单/QC_ProcessCheckBillController.cs    |   52 +++++++-
 11 files changed, 309 insertions(+), 43 deletions(-)

diff --git a/Model/MES/ClsSc_SourceLineRepairBillMain.cs b/Model/MES/ClsSc_SourceLineRepairBillMain.cs
index a517a07..cf3e42d 100644
--- a/Model/MES/ClsSc_SourceLineRepairBillMain.cs
+++ b/Model/MES/ClsSc_SourceLineRepairBillMain.cs
@@ -35,6 +35,9 @@
         public string HMainSourceBillType;
         public Int64 HMainSourceInterID;
         public Int64 HMainSourceEntryID;
+        public Int64 HProcExchInterID;
+        public Int64 HProcExchEntryID;
+        public string HProcExchBillNo;
         public string HMainSourceBillNo;
         public int HPrintQty;
         public int HItemMainID;
diff --git a/WebAPI/Controllers/BLL/Xt_UserController.cs b/WebAPI/Controllers/BLL/Xt_UserController.cs
index 853a083..1b10f0b 100644
--- a/WebAPI/Controllers/BLL/Xt_UserController.cs
+++ b/WebAPI/Controllers/BLL/Xt_UserController.cs
@@ -202,13 +202,15 @@
                     ",HSellManID,HSellMan,HDeptID,HDept " +
                     ",HWhID,HWHName,HSupID,HSupName " +
                     ",HSCWHID,HSCWHName " +
-                    ",HCloudUserName,HCloudUserPsd,HUSEORGID) " +
+                    ",HCloudUserName,HCloudUserPsd,HUSEORGID,HProcID" +
+                    ",HGroupID,HSourceID) " +
                     "values ('" + lsmain[0].Czybm.ToString() + "','" + lsmain[0].Czymc.ToString() + "','" + ClsPub.StrToPsd(lsmain[0].Czmm.ToString()) + "','" + lsmain[0].Explain.ToString() + "','" + lsmain[0].HEmpID.ToString() + "',"+ lsmain[0].HK3UserID.ToString() + "" +
                     ","+ lsmain[0].HKeeperID.ToString() + ",'"+ lsmain[0].HKeeper.ToString() + "',"+ lsmain[0].HSecManagerID.ToString() + ",'"+ lsmain[0].HSecManager.ToString() + "'" +
                     "," + lsmain[0].HSellManID.ToString() + ",'" + lsmain[0].HSellMan.ToString() + "'," + lsmain[0].HDeptID.ToString() + ",'" + lsmain[0].HDept.ToString() + "'" +
                     "," + lsmain[0].HWhID.ToString() + ",'" + lsmain[0].HWHName.ToString() + "'," + lsmain[0].HSupID.ToString() + ",'" + lsmain[0].HSupName.ToString() + "'" +
                     "," + lsmain[0].HSCWHID.ToString() + ",'" + lsmain[0].HSCWHName.ToString() + "'" + 
-                    ",'" + lsmain[0].HCloudUserName.ToString() + "','" + lsmain[0].HCloudUserPsd.ToString() + "',"+ lsmain[0].HOrgID.ToString() + ")");
+                    ",'" + lsmain[0].HCloudUserName.ToString() + "','" + lsmain[0].HCloudUserPsd.ToString() + "',"+ lsmain[0].HOrgID.ToString() + "," + lsmain[0].HProcID.ToString() + "" +
+                    ","+ lsmain[0].HGroupID.ToString() + ","+ lsmain[0].HSourceID.ToString() + ")");
 
                     //鏂板鍚庢煡璇�  纭繚鏁版嵁娣诲姞鎴愬姛
                     ds = oCN.RunProcReturn("Select * from  Gy_Czygl where Czybm='" + lsmain[0].Czybm.ToString() + "'", "Gy_Czygl");
@@ -255,6 +257,9 @@
                         ",HSCWHID=" + lsmain[0].HSCWHID.ToString() +
                         ",HSCWHName='" + lsmain[0].HSCWHName.ToString() + "'" +
                         ",HSupID=" + lsmain[0].HSupID.ToString() +
+                        ",HProcID=" + lsmain[0].HProcID.ToString() +
+                        ",HSourceID=" + lsmain[0].HSourceID.ToString() +
+                        ",HGroupID=" + lsmain[0].HGroupID.ToString() +
                         ",HSupName='" + lsmain[0].HSupName.ToString() + "'" +
                         ",HCloudUserName='" + lsmain[0].HCloudUserName.ToString() + "'" +
                         ",HCloudUserPsd='" + lsmain[0].HCloudUserPsd.ToString() + "'" +
@@ -280,6 +285,9 @@
                            ",HSCWHID=" + lsmain[0].HSCWHID.ToString() +
                            ",HSCWHName='" + lsmain[0].HSCWHName.ToString() + "'" +
                            ",HSupID=" + lsmain[0].HSupID.ToString() +
+                            ",HProcID=" + lsmain[0].HProcID.ToString() +
+                           ",HSourceID=" + lsmain[0].HSourceID.ToString() +
+                           ",HGroupID=" + lsmain[0].HGroupID.ToString() +
                            ",HSupName='" + lsmain[0].HSupName.ToString() + "'" +
                            ",HCloudUserName='" + lsmain[0].HCloudUserName.ToString() + "'" +
                            ",HCloudUserPsd='" + lsmain[0].HCloudUserPsd.ToString() + "'" +
diff --git a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
index 178aa71..79f48fe 100644
--- a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
@@ -320,15 +320,29 @@
                 }
 
                 ds = oCN.RunProcReturn("select * from gy_czygl where czymc='" + user + "'", "gy_czygl");
+                string HProcID = ds.Tables[0].Rows[0]["HProcID"].ToString();
 
-                ds = oCN.RunProcReturn(@"exec h_p_Gy_BarCodeBillBomList '" + HBarCode + "'," + ds.Tables[0].Rows[0]["HProcID"].ToString(), "h_p_Gy_BarCodeBillBomList");
+                ds = oCN.RunProcReturn(@"exec h_p_Gy_BarCodeBillBomList '" + HBarCode + "'," + HProcID, "h_p_Gy_BarCodeBillBomList");
                 if (ds.Tables[0].Rows.Count == 0)
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "閰嶄欢娓呭崟鏌ユ棤鏁版嵁锛�";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    DataSet dataSet = oCN.RunProcReturn(@"exec h_p_Sc_ProcessExchangeBillList '" + HBarCode + "'," + HProcID, "h_p_Sc_ProcessExchangeBillList");
+
+                    if (dataSet.Tables[0].Rows.Count > 0)
+                    {
+                        objJsonResult.code = "2";
+                        objJsonResult.count = 2;
+                        objJsonResult.Message = "";
+                        objJsonResult.data = dataSet.Tables[0];
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "閰嶄欢娓呭崟鏌ユ棤鏁版嵁锛�,鍙兘鏄綋鍓嶇敤鎴峰伐搴忎笉姝g‘鎴栬�呮祦杞崱杈撳叆閿欒!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                 }
                 else
                 {
@@ -387,7 +401,7 @@
                 if (tempList.Count == 0) {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犳暟鎹�!";
+                    objJsonResult.Message = "鏃犻厤浠舵暟鎹�!";
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
@@ -460,7 +474,7 @@
                 sub = JsonConvert.DeserializeObject<List<Model.ClsSc_AssemblyBillSub>>(sSubStr);
 
 
-                ds = oCN.RunProcReturn("select  * from h_v_Gy_QualifiedRecordsList where 浜у搧鏉$爜='" + omodel.HBarCode_P + "'", "h_v_Gy_QualifiedRecordsList");
+                ds = oCN.RunProcReturn("select  * from h_v_Gy_QualifiedRecordsList where 浜у搧鏉$爜='" + omodel.HBarCode_P + "' and HProcExchInterID="+ omodel .HProcExchInterID+ " and HProcExchEntryID="+ omodel.HProcExchEntryID + " and HProcID="+ omodel.HProcID, "h_v_Gy_QualifiedRecordsList");
                 if (ds.Tables[0].Rows.Count > 0)
                 {
                     objJsonResult.code = "0";
@@ -1042,6 +1056,8 @@
 
                 //鍙嶅啓宸ュ簭鍑虹珯鍗曠殑涓嶈壇鏁伴噺
                 oCN.RunProc("update Sc_StationOutBillMain set HBadCount-=1  where HProcExchInterID='" + HProcExchInterID + "' and HProcExchEntryID=" + HProcExchEntryID);
+                //鍙嶅啓娴佽浆鍗$姸鎬�
+                oCN.RunProc("update Gy_BarCodeBill set HStatus=''  where HBarCode='" + HBarCode + "'");
 
 
                 oCN.Commit();
@@ -1165,7 +1181,15 @@
                     return objJsonResult;
                 }
 
-                if (ds.Tables[0].Rows[0]["HProcID"].ToString() != HProcID)
+                int num = 0;
+                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
+                {
+                    if (ds.Tables[0].Rows[i]["HProcID"].ToString() == HProcID)
+                    {
+                        num = 1;
+                    }
+                }
+                if (num == 0)
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -1341,25 +1365,6 @@
 ({model.HInterID},{(ds.Tables[0].Rows.Count == 0 ? 1 : int.Parse(ds.Tables[0].Rows[0]["HEntryID"].ToString()) + 1)},'{model.HBillNo}','',{temp.HProcExchInterID}
 ,{temp.HProcExchEntryID},'{temp.HProcExchBillNo}','',{temp.HMaterID},0,'{temp.HBarCode}','{temp.HBatchNo}')");
 
-
-                    ds = oCN.RunProcReturn("select  * from Sc_SourceLineRepairBillSub where HInterID=" + model.HInterID, "Sc_SourceLineRepairBillSub");
-
-                    if (ds.Tables[0].Rows[0]["HRepairResult"].ToString() == "OK") {
-
-                        //鐢熶骇宸ュ簭鍑虹珯SN鏁版嵁
-                        ds = oCN.RunProcReturn("select top 1  HInterID,HBillNo from Sc_StationOutBillMain where HProcExchInterID=" + temp.HProcExchInterID + " and HProcExchEntryID=" + temp.HProcExchEntryID + " and HBadCount<>0  order by  HInterID desc", "Sc_StationOutBillMain");
-
-                        string HInterIDSN = ds.Tables[0].Rows[0]["HInterID"].ToString();
-                        string HBillNoSN = ds.Tables[0].Rows[0]["HBillNo"].ToString();
-
-                        ds = oCN.RunProcReturn("select *  from Sc_StationOutBillSub_SN where HInterID=" + HInterIDSN , "Sc_StationOutBillSub_SN");
-
-                        oCN.RunProc($@"insert into Sc_StationOutBillSub_SN(HInterID,HBillNo_bak,HEntryID,HBarCode,HBarCodeQty,HMakeTime,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney)
-values({HInterIDSN}, '{HBillNoSN}', {ds.Tables[0].Rows.Count + 1}, '{model.HBarCode}', 1, GETDATE(), '', "+ temp.HProcExchInterID + ","+ temp.HProcExchEntryID+ ", '"+ temp.HProcExchBillNo+ "', '', 0, 0)");
-                        //鍙嶅啓宸ュ簭鍑虹珯鍗� 涓昏〃 涓嶈壇鏁伴噺 鍜� 鍚堟牸鏁伴噺
-                        oCN.RunProc("update Sc_StationOutBillMain set HQty+=1,HBadCount-=1  where HInterID='" + HInterIDSN + "'");
-                    }
-
                     //淇敼浜х嚎杩芥函鍗曠粦瀹氱殑鏉$爜鎵瑰彿
                     oCN.RunProc("update Sc_AssemblyBillSub set HBarCode='" + temp.HBarCode + "' where HInterID=" + temp.HInterID + " and HEntryID=" + temp.HEntryID);
                     //oCN.RunProc("exec h_p_AssemblyBill_Temp '" + temp.HProcExchBillNo + "'," + model.HProcess + "," + temp.HMaterID + ",'" + temp.HBatchNo + "'");
@@ -1387,6 +1392,25 @@
 
                     if (HResult == "OK")
                     {
+                        ds = oCN.RunProcReturn("select  * from Sc_SourceLineRepairBillSub where HInterID=" + model.HInterID, "Sc_SourceLineRepairBillSub");
+
+                        if (ds.Tables[0].Rows[0]["HRepairResult"].ToString() == "OK")
+                        {
+
+                            //鐢熶骇宸ュ簭鍑虹珯SN鏁版嵁
+                            ds = oCN.RunProcReturn("select top 1  HInterID,HBillNo from Sc_StationOutBillMain where HProcExchInterID=" + model.HProcExchInterID + " and HProcExchEntryID=" + model.HProcExchEntryID + " and HBadCount<>0  order by  HInterID desc", "Sc_StationOutBillMain");
+
+                            string HInterIDSN = ds.Tables[0].Rows[0]["HInterID"].ToString();
+                            string HBillNoSN = ds.Tables[0].Rows[0]["HBillNo"].ToString();
+
+                            ds = oCN.RunProcReturn("select *  from Sc_StationOutBillSub_SN where HInterID=" + HInterIDSN, "Sc_StationOutBillSub_SN");
+
+                            oCN.RunProc($@"insert into Sc_StationOutBillSub_SN(HInterID,HBillNo_bak,HEntryID,HBarCode,HBarCodeQty,HMakeTime,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney)
+values({HInterIDSN}, '{HBillNoSN}', {ds.Tables[0].Rows.Count + 1}, '{model.HBarCode}', 1, GETDATE(), '', " + model.HProcExchInterID + "," + model.HProcExchEntryID + ", '" + model.HProcExchBillNo + "', '', 0, 0)");
+                            //鍙嶅啓宸ュ簭鍑虹珯鍗� 涓昏〃 涓嶈壇鏁伴噺 鍜� 鍚堟牸鏁伴噺
+                            oCN.RunProc("update Sc_StationOutBillMain set HQty+=1,HBadCount-=1  where HInterID='" + HInterIDSN + "'");
+                        }
+
                         oCN.RunProc("update Gy_BarCodeBill set HStatus='' where HBarCode='" + model.HBarCode + "'");
                     }
                 }
@@ -1577,5 +1601,85 @@
         }
         #endregion
 
+        #region 宸ュ簭鍗曞搧杩囩珯 鍚堟牸杩芥函鏌ヨ鎶ヨ〃
+        [Route("Cj_SingleStation/RetrospectiveQueryReport")]
+        [HttpGet]
+        public object RetrospectiveQueryReport(string HBardCode, string HProcExchBillNo, string HICMOBillNo, string sWhere, string user)
+        {
+            try
+            {
+
+                List<object> columnNameList = new List<object>();
+
+                string sql = @"exec  h_p_RetrospectiveQueryReport '" + sWhere + "', '" + HBardCode + "', '" + HProcExchBillNo + "','" + HICMOBillNo + "' ";
+                ds = oCN.RunProcReturn(sql, "h_p_RetrospectiveQueryReport");
+
+                //娣诲姞鍒楀悕
+                foreach (DataColumn col in ds.Tables[0].Columns)
+                {
+                    Type dataType = col.DataType;
+                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 宸ュ簭鍗曞搧杩囩珯 涓嶈壇杩芥函鏌ヨ鎶ヨ〃
+        [Route("Cj_SingleStation/BadQueryReport")]
+        [HttpGet]
+        public object BadQueryReport(string HBardCode, string HProcExchBillNo, string HICMOBillNo, string sWhere, string user)
+        {
+            try
+            {
+
+                List<object> columnNameList = new List<object>();
+
+                string sql = @"exec  h_p_BadQueryReport '" + sWhere + "', '" + HBardCode + "', '" + HProcExchBillNo + "','" + HICMOBillNo + "' ";
+                ds = oCN.RunProcReturn(sql, "h_p_BadQueryReport");
+
+                //娣诲姞鍒楀悕
+                foreach (DataColumn col in ds.Tables[0].Columns)
+                {
+                    Type dataType = col.DataType;
+                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
     }
 }
\ No newline at end of file
diff --git a/WebAPI/Controllers/MateOutController.cs b/WebAPI/Controllers/MateOutController.cs
index ccbc998..f5f8a03 100644
--- a/WebAPI/Controllers/MateOutController.cs
+++ b/WebAPI/Controllers/MateOutController.cs
@@ -2075,6 +2075,7 @@
             public string HCustomerName { get; set; }
             public string HProductName { get; set; }
             public string HOtherSearch { get; set; }
+            public string HEmpName { get; set; }
         }
         [Route("MaterOutEntryReport/SC_DayRkReport")]
         [HttpGet]
diff --git a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs
index 1d99e51..54dbcbe 100644
--- a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs
+++ b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs
@@ -355,6 +355,45 @@
         }
         #endregion
 
+        #region[璁惧鐐规璁″垝琛ㄧ紪杈戞椂鑾峰彇琛ㄤ綋鏁版嵁--鐐规璁″垝]
+        [Route("Sb_EquipDotCheckPlanBill/GetPlanList")]
+        [HttpGet]
+        public object GetPlanList(string sqlWhere)
+        {
+            DataSet ds;
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                if (sqlWhere == null || sqlWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_Sb_EquipDotCheckPlanList", "h_v_Sb_EquipDotCheckPlanList");
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                }
+                else
+                {
+                    string sql1 = "select * from h_v_Sb_EquipDotCheckPlanList where 1 = 1 ";
+                    string sql = sql1 + sqlWhere;
+                    ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckPlanList");
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁″垝锛�" + e.ToString();
+                objJsonResult.data = null;
+            }
+            return objJsonResult;
+        }
+        #endregion
+
         #region 璁惧鐐规璁″垝鍗曞鏍�/鍙嶅鏍稿姛鑳�
         [Route("Sb_EquipDotCheckPlanBill/CheckSb_EquipDotCheckPlanBill")]
         [HttpGet]
@@ -395,6 +434,8 @@
                         objJsonResult.data = null;
                         return objJsonResult;
                     }
+                    //鑷姩鐢熸垚鐐规璁″垝鍗�
+                    oCN.RunProc("exec h_p_Sb_EquipDotCheckPlan_Auto " + HInterID);
                 }
                 else
                 {
diff --git a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckRuleBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckRuleBillController.cs
index 37a814a..5b456da 100644
--- a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckRuleBillController.cs
+++ b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckRuleBillController.cs
@@ -175,7 +175,7 @@
             {
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
 
-                string sql1 = @"select 鐐规椤圭洰ID HDotCheckItemID,鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart,鍏蜂綋瑕佹眰 HClaim,璐熻矗浜篒D HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜� HManagerName,瀛愬娉� HRemark,b.HNumber 鐐规椤圭洰浠g爜  from h_v_Sb_EquipDotCheckRuleList a
+                string sql1 = @"select  *  from h_v_Sb_EquipDotCheckRuleList a
                         left join Gy_QCCheckItem b  on a.鐐规椤圭洰ID =b.HItemID where 1 = 1 ";
                 string sql = sql1 + sqlWhere;
                 ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckRuleList");
diff --git a/WebAPI/Controllers/SBGL/Sb_EquipMaintainPlanBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipMaintainPlanBillController.cs
index d2be264..f845d74 100644
--- a/WebAPI/Controllers/SBGL/Sb_EquipMaintainPlanBillController.cs
+++ b/WebAPI/Controllers/SBGL/Sb_EquipMaintainPlanBillController.cs
@@ -413,6 +413,45 @@
         }
         #endregion
 
+        #region[璁惧淇濆吇璁″垝琛ㄧ紪杈戞椂鑾峰彇琛ㄤ綋鏁版嵁--淇濆吇璁″垝]
+        [Route("Sb_EquipMaintainPlanBill/GetPlanList")]
+        [HttpGet]
+        public object GetPlanList(string sqlWhere)
+        {
+            DataSet ds;
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                if (sqlWhere == null || sqlWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_Sb_EquipMaintainPlanList", "h_v_Sb_EquipMaintainPlanList");
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                }
+                else
+                {
+                    string sql1 = "select * from h_v_Sb_EquipMaintainPlanList where 1 = 1 ";
+                    string sql = sql1 + sqlWhere;
+                    ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipMaintainPlanList");
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁″垝锛�" + e.ToString();
+                objJsonResult.data = null;
+            }
+            return objJsonResult;
+        }
+        #endregion
+
         #region 璁惧淇濆吇璁″垝鍗曞鏍�/鍙嶅鏍稿姛鑳�
         [Route("Sb_EquipMaintainPlanBill/CheckSb_EquipMaintainPlanBill")]
         [HttpGet]
@@ -453,6 +492,8 @@
                         objJsonResult.data = null;
                         return objJsonResult;
                     }
+                    //鑷姩鐢熸垚鐐规璁″垝鍗�
+                    oCN.RunProc("exec h_p_Sb_EquipMaintainPlan_Auto " + HInterID);
                 }
                 else
                 {
diff --git "a/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/QC_ProcessCheckBillController.cs" "b/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/QC_ProcessCheckBillController.cs"
index a92afbf..54ddf54 100644
--- "a/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/QC_ProcessCheckBillController.cs"
+++ "b/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/QC_ProcessCheckBillController.cs"
@@ -744,18 +744,55 @@
         {
             try
             {
-                if (HInterID == 0 || HBillType.Equals(""))
+                List<object> columnNameList = new List<object>();
+
+                string sReturn = "";
+                string sql = "";
+                if (oSystemParameter.ShowBill(ref sReturn))
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鍙傛暟涓嶅叏锛岃幏鍙栨簮鍗曚俊鎭け璐ワ紒HInterID锛�" + HInterID + "锛汬EntryID锛�" + HEntryID + "锛汬BillType锛�" + HBillType + "锛�";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    switch (oSystemParameter.omodel.QC_ProcessCheckBill_QCSchemeSource)
+                    {
+                        case "宸ュ簭":
+                            sql = "exec h_p_QC_GetInfoByICMOStatusBill " + "'宸ュ簭'," + HInterID + "," + HEntryID + "," + HBillType;
+                            break;
+                        case "鐗╂枡":
+                            sql = "exec h_p_QC_GetInfoByICMOStatusBill " + "'鐗╂枡'," + HInterID  + "," + HEntryID + "," + HBillType;
+                            break;
+                        case "宸ヨ壓璺嚎":
+                            sql = "exec h_p_QC_GetInfoByICMOStatusBill " + "'宸ヨ壓璺嚎'," + HInterID + "," + HEntryID + "," + HBillType;
+                            break;
+                    }
+
+                }
+                ds = oCN.RunProcReturn(sql, "h_p_QC_GetInfoByICMOStatusBill");
+
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                   
                 }
                 else
                 {
-                    ds = oCN.RunProcReturn("exec h_p_QC_GetInfoByICMOStatusBill " + HInterID + "," + HEntryID + "," + HBillType, "h_p_QC_GetInfoByICMOStatusBill");
+                    //娣诲姞鍒楀悕
+                    foreach (DataColumn col in ds.Tables[0].Columns)
+                    {
+                        Type dataType = col.DataType;
+                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                    }
                 }
+
+                //if (HInterID == 0 || HBillType.Equals(""))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "鍙傛暟涓嶅叏锛岃幏鍙栨簮鍗曚俊鎭け璐ワ紒HInterID锛�" + HInterID + "锛汬EntryID锛�" + HEntryID + "锛汬BillType锛�" + HBillType + "锛�";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                //else
+                //{
+                //    ds = oCN.RunProcReturn("exec h_p_QC_GetInfoByICMOStatusBill " + HInterID + "," + HEntryID + "," + HBillType, "h_p_QC_GetInfoByICMOStatusBill");
+                //}
                 if (ds == null || ds.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.code = "0";
@@ -770,6 +807,7 @@
                     objJsonResult.count = 1;
                     objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
                     objJsonResult.data = ds.Tables[0];
+                    objJsonResult.list = columnNameList;
                     return objJsonResult;
                 }
             }
diff --git "a/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\351\246\226\344\273\266\346\243\200\351\252\214\345\215\225/QC_FirstPieceCheckBillController.cs" "b/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\351\246\226\344\273\266\346\243\200\351\252\214\345\215\225/QC_FirstPieceCheckBillController.cs"
index 8112c58..02e0671 100644
--- "a/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\351\246\226\344\273\266\346\243\200\351\252\214\345\215\225/QC_FirstPieceCheckBillController.cs"
+++ "b/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\351\246\226\344\273\266\346\243\200\351\252\214\345\215\225/QC_FirstPieceCheckBillController.cs"
@@ -500,6 +500,8 @@
         {
             try
             {
+                List<object> columnNameList = new List<object>();
+
                 if (HInterID == 0 || HBillType.Equals(""))
                 {
                     objJsonResult.code = "0";
@@ -508,15 +510,37 @@
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
-                else
+
+                string sReturn = "";
+                string sql = "";
+                if (oSystemParameter.ShowBill(ref sReturn))
                 {
-                    ds = oCN.RunProcReturn("exec h_p_QC_GetInfoByICMOStatusBill " + HInterID + "," + HEntryID + "," + HBillType, "h_p_QC_GetInfoByICMOStatusBill");
+                    switch (oSystemParameter.omodel.QC_FirstPieceCheckBill_QCSchemeSource)
+                    {                       
+                        case "鐗╂枡":
+                            sql = "exec h_p_QC_GetInfoByICMOStatusBill " + "'鐗╂枡'" + "," + HInterID + "," + HEntryID + "," + HBillType;
+                            break;                        
+                    }
+
                 }
+
+                ds = oCN.RunProcReturn(sql, "h_p_QC_GetInfoByICMOStatusBill");
+
+                //娣诲姞鍒楀悕
+                foreach (DataColumn col in ds.Tables[0].Columns)
+                {
+                    Type dataType = col.DataType;
+                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                }
+
+               
+               
                 if (ds == null || ds.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "鏌ヨ鏁版嵁寮傚父锛岃涓庣鐞嗗憳鑱旂郴锛�";
+                    objJsonResult.Message = "娌℃煡璇㈠埌鏁版嵁锛�";
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
@@ -526,6 +550,7 @@
                     objJsonResult.count = 1;
                     objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
                     objJsonResult.data = ds.Tables[0];
+                    objJsonResult.list = columnNameList;
                     return objJsonResult;
                 }
             }
diff --git a/WebAPI/Models/Gy_User.cs b/WebAPI/Models/Gy_User.cs
index ec260cb..aea038d 100644
--- a/WebAPI/Models/Gy_User.cs
+++ b/WebAPI/Models/Gy_User.cs
@@ -31,5 +31,8 @@
         public string HSCWHName;
         public int HSupID;
         public string HSupName;
+        public int HProcID;
+        public int HGroupID;
+        public int HSourceID;
     }
 }
\ No newline at end of file
diff --git a/WebAPI/Web.config b/WebAPI/Web.config
index 92d9332..7247c9d 100644
--- a/WebAPI/Web.config
+++ b/WebAPI/Web.config
@@ -35,6 +35,8 @@
 		<!--<add key="sUrl" value="http://47.96.97.237/WEBS-WMS/WebService1.asmx"/> -->	<!--娴嬭瘯鏈嶅姟鍣�-->
 		<!--<add key="sUrl" value="http://localhost:8082/WEBS/WebService1.asmx"/>    鏈湴-->
 		<!--<add key="sUrl" value="http://192.168.56.1:81/web/WebService1.asmx"/>-->	<!--闄堥洴闈欐湰鍦伴厤缃�-->
+		<add key="sUrl" value="http://192.168.1.57:8082/WEBS-WMS/WebService1.asmx"/><!--涔濊彵-->
+
 		<add key="webpages:Version" value="3.0.0.0" />
 		<add key="webpages:Enabled" value="false" />
 		<add key="ClientValidationEnabled" value="true" />
@@ -101,7 +103,7 @@
 			</basicHttpBinding>
 		</bindings>
 		<client>
-			<endpoint address="http://192.168.63.20/WEBS-WMS/WebService1.asmx" binding="basicHttpBinding"
+			<endpoint address="http://192.168.1.57:8082/WEBS-WMS/WebService1.asmx" binding="basicHttpBinding"
      bindingConfiguration="WebService1Soap" contract="Webs1.WebService1Soap"
      name="WebService1Soap" />
 		</client>
@@ -110,7 +112,7 @@
  <applicationSettings>
   <WebAPI.Properties.Settings>
    <setting name="WebAPI_WebS_WebService1" serializeAs="String">
-    <value>http://192.168.63.20/WEBS-WMS/WebService1.asmx</value>
+    <value>http://192.168.1.57:8082/WEBS-WMS/WebService1.asmx</value>
    </setting>
   </WebAPI.Properties.Settings>
  </applicationSettings>

--
Gitblit v1.9.1