From 415407ac784a81cedadde6cbf01a08677240d5ea Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期一, 27 十一月 2023 09:16:58 +0800
Subject: [PATCH] 设备点检/保养计划自动生成计划单;首件/过程检验单源单为生产任务单时修改查询数据方法

---
 WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs     |   41 +++++++++++++
 WebAPI/Controllers/SBGL/Sb_EquipDotCheckRuleBillController.cs     |    2 
 WebAPI/Web.config                                                 |    8 +-
 WebAPI/Controllers/SBGL/Sb_EquipMaintainPlanBillController.cs     |   41 +++++++++++++
 WebAPI/Controllers/品质管理/首件检验单/QC_FirstPieceCheckBillController.cs |   31 +++++++++-
 WebAPI/Controllers/品质管理/工序检验单/QC_ProcessCheckBillController.cs    |   52 +++++++++++++++--
 6 files changed, 161 insertions(+), 14 deletions(-)

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/Web.config b/WebAPI/Web.config
index 1a5fed7..6347cd6 100644
--- a/WebAPI/Web.config
+++ b/WebAPI/Web.config
@@ -34,7 +34,9 @@
 		<!--<add key="sUrl" value="http://192.168.80.90:9090/WEBS-WMS/WebService1.asmx"/>     瀹夌憺鏈嶅姟鍣�-->
 		<!--<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.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