From c2c81f518deb22140121bbb1c76c672d69d533c8 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期二, 11 三月 2025 15:41:36 +0800
Subject: [PATCH] 生产资源,工序冲突合并

---
 WebAPI/Controllers/品质管理/基础资料/Gy_BaseInformationController.cs |  132 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 131 insertions(+), 1 deletions(-)

diff --git "a/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_BaseInformationController.cs" "b/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_BaseInformationController.cs"
index 7b1c65c..44f86ad 100644
--- "a/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_BaseInformationController.cs"
+++ "b/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_BaseInformationController.cs"
@@ -757,7 +757,137 @@
                 return objJsonResult;
             }
         }
-        #endregion     
+        #endregion
+
+        #region SPC涓績绾垮垪琛� 鏌ヨ       
+        [Route("QC_SpcCenterlineList/List")]
+        [HttpGet]
+        public object List(string sWhere, string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+
+               
+
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_QC_SpcCenterlineList order by HInterID desc", "锘縣_v_QC_SpcCenterlineList");
+                }
+                else
+                {
+                    string sql1 = "select * from  h_v_QC_SpcCenterlineList  where 1 = 1 ";
+                    string sql = sql1 + sWhere + " order by HInterID desc";
+                    ds = oCN.RunProcReturn(sql, "锘縣_v_QC_SpcCenterlineList");
+                }
+
+                //娣诲姞鍒楀悕
+                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)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region SPC涓績绾垮垪琛� 寮傚父鏁版嵁 鏇存柊       
+        [Route("QC_SpcCenterlineList/UpdateData")]
+        [HttpGet]
+        public object UpdateData(string HInterID, string HBeginDate, string HEndDate, string user)
+        {
+            try
+            {
+                LogService.Write("杈撳叆鍊�:" + "exec h_p_QC_SPC_EightJudge_Abnormal " + HInterID + ",'" + HBeginDate + "','" + HEndDate + "'");
+                ds = oCN.RunProcReturn("exec h_p_QC_SPC_EightJudge_Abnormal "+ HInterID + ",'"+ HBeginDate + "','"+ HEndDate + "'", "锘縣_p_QC_SPC_EightJudge_Abnormal");
+                LogService.Write("杈撳叆鍊�:" + ds.Tables[0].Rows.Count);
+                if (int.Parse(ds.Tables[0].Rows[0]["绫诲瀷"].ToString()) <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = ds.Tables[0].Rows[0][1].ToString();
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region SPC涓績绾垮垪琛� 寮傚父鏁版嵁 鏂板
+        [Route("QC_SpcCenterlineList/QC_SpcCenterlineAdd")]
+        [HttpGet]
+        public object UpdateData(string HInterID, string AvgData, string HControlUpperLimit_X, string HControlLowerLimit_X, string user)
+        {
+            try
+            {
+
+                ds = oCN.RunProcReturn("select * from QC_SpcCenterline where HInterID="+ HInterID, "锘縌C_SpcCenterline");
+
+                if (ds.Tables[0].Rows.Count==0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message ="鏌ユ棤鏁版嵁!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                var HMaterID = int.Parse( ds.Tables[0].Rows[0]["HMaterID"].ToString());
+                var HQCCheckItemID = int.Parse(ds.Tables[0].Rows[0]["HQCCheckItemID"].ToString());
+                var HMouldNum = ds.Tables[0].Rows[0]["HMouldNum"].ToString();
+
+                oCN.RunProc("update QC_SpcCenterline set HStart=0 where HMaterID=" + HMaterID + " and HQCCheckItemID=" + HQCCheckItemID + " and HMouldNum='" + HMouldNum + "'");
+                oCN.RunProc("insert into QC_SpcCenterline(HMaterID,HQCCheckItemID,HMouldNum,HCenterline_X,HControlUpperLimit_X,HControlLowerLimit_X,HMaker, HMakeDate, HStart)" +
+                    "values(" + HMaterID + "," + HQCCheckItemID + "," + HMouldNum + "," + AvgData + "," + HControlUpperLimit_X + "," + HControlLowerLimit_X + "," + user + ",getdate(),1) ");
+
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鏂板鎴愬姛锛�";
+                objJsonResult.data = null;
+                objJsonResult.list = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
 
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1