From dd2c1f4c92aef880ea22da95ebde07f4d3dc0fbd Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期五, 11 八月 2023 16:12:17 +0800
Subject: [PATCH] 暂放区 及列表

---
 WebAPI/Controllers/品质管理/首件检验单/QC_FirstPieceCheckBillController.cs |  159 ++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 152 insertions(+), 7 deletions(-)

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 d99c43b..42184ae 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"
@@ -21,11 +21,6 @@
         DataSet ds;
 
         #region 棣栦欢妫�楠屽崟淇濆瓨
-        /// <summary>
-        /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳
-        ///鍙傛暟锛歴tring sql銆�
-        ///杩斿洖鍊硷細object銆�
-        /// </summary>
         [Route("QC_FirstPieceCheckBill/set_SaveBill")]
         [HttpPost]
         public object set_SaveBill([FromBody] JObject sMainSub)
@@ -42,9 +37,21 @@
             string msg2 = sArray[0].ToString();
             string msg3 = sArray[1].ToString();
             string OperationType = sArray[2].ToString().Trim();
+            string user = sArray[3].ToString();
+            string Value = sArray[4].ToString();
             bool bResult;
             try
             {
+                //鍒ゆ柇鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("QC_FirstPieceCheckBill_Edit", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犱繚瀛樻潈闄�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
                 msg2 = "[" + msg2.ToString() + "]";
                 List<Model.ClsQC_FirstPieceCheckBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_FirstPieceCheckBillMain>>(msg2);
                 DAL.ClsQC_FirstPieceCheckBill BillNew = new DAL.ClsQC_FirstPieceCheckBill();
@@ -72,7 +79,7 @@
                 BillNew.omodel.HSourceID = ClsPub.isLong(mainList[0].HSourceID);
                 BillNew.omodel.HICMOInterID = ClsPub.isLong(mainList[0].HICMOInterID);
                 BillNew.omodel.HICMOBillNo = ClsPub.isStrNull(mainList[0].HICMOBillNo);
-                BillNew.omodel.HICMOInterID = ClsPub.isLong(mainList[0].HICMOInterID);
+                BillNew.omodel.HICMOEntryID = ClsPub.isLong(mainList[0].HICMOEntryID);
                 BillNew.omodel.HICMOQty = ClsPub.isLong(mainList[0].HICMOQty);
                 BillNew.omodel.HProcExchInterID = ClsPub.isLong(mainList[0].HProcExchInterID);
                 BillNew.omodel.HProcExchEntryID = ClsPub.isLong(mainList[0].HProcExchEntryID);
@@ -113,6 +120,21 @@
                         oSub.HMin = DBUtility.ClsPub.isStrNull(subList[i].HMin);
                         oSub.HAvg = DBUtility.ClsPub.isStrNull(subList[i].HAvg);
                         oSub.HBillNo_bak = DBUtility.ClsPub.isStrNull(mainList[0].HBillNo);
+
+                        oSub.HSampleSchemeID= DBUtility.ClsPub.isLong(subList[i].HSampleSchemeID);
+                        oSub.HSampleQty= DBUtility.ClsPub.isLong(subList[i].HSampleQty);
+                        oSub.HSampleDamageQty= DBUtility.ClsPub.isDoule(subList[i].HSampleDamageQty);
+                        oSub.HAcceptQty= DBUtility.ClsPub.isLong(subList[i].HAcceptQty);
+                        oSub.HRejectQty= DBUtility.ClsPub.isLong(subList[i].HRejectQty);
+                        oSub.HSampleUnRightQty= DBUtility.ClsPub.isDoule(subList[i].HSampleUnRightQty);
+                        oSub.HStatus= DBUtility.ClsPub.isStrNull(subList[i].HStatus);
+                        oSub.HUnitID= DBUtility.ClsPub.isLong(subList[i].HUnitID);
+                        oSub.HInspectVal= DBUtility.ClsPub.isStrNull(subList[i].HInspectVal);
+                        oSub.HTargetVal= DBUtility.ClsPub.isStrNull(subList[i].HTargetVal);
+                        oSub.HUpLimit= DBUtility.ClsPub.isStrNull(subList[i].HUpLimit);
+                        oSub.HDownLimit= DBUtility.ClsPub.isStrNull(subList[i].HDownLimit);
+                        oSub.HUpOffSet= DBUtility.ClsPub.isStrNull(subList[i].HUpOffSet);
+                        oSub.HDownOffSet= DBUtility.ClsPub.isStrNull(subList[i].HDownOffSet);
                         BillNew.DetailColl.Add(oSub);
                     }
                     else
@@ -124,6 +146,7 @@
                         return objJsonResult;
                     }
                 }
+               
                 //淇濆瓨瀹屾瘯鍚庡鐞�
                 if (OperationType.Equals("1") || OperationType.Equals("2"))
                 {
@@ -213,6 +236,128 @@
             }
         }
         #endregion
-        //
+
+        #region 妫�楠屽�间繚瀛�
+        [Route("QC_FirstPieceCheckBill/set_SaveValue")]
+        [HttpPost]
+        public object set_SaveValue([FromBody] JObject msg)
+        {
+            ListModels oListModels = new ListModels();
+            try
+            {
+                var _value = msg["msg"].ToString();
+                string msg1 = _value.ToString();
+                string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+
+                string Value = sArray[0].ToString(); //妫�楠屽�艰〃鏍�
+                Int64 HInterID = Convert.ToInt64(sArray[1]); //涓籌D
+                Int64 HEntryID = Convert.ToInt64(sArray[2]); //瀛怚D
+                bool bResult;
+
+
+                List<Model.ClsQC_FirstPieceCheckBillSub_ValueGrid> valueList = new List<Model.ClsQC_FirstPieceCheckBillSub_ValueGrid>();
+                valueList = oListModels.getObjectByJson_ClsClsQC_FirstPieceCheckBillSub_ValueGrid(Value);
+
+                DAL.ClsQC_FirstPieceCheckBill BillNew = new DAL.ClsQC_FirstPieceCheckBill();
+
+                for (int i = 0; i < valueList.ToArray().Length; i++)
+                {
+                    if (i >= 0)//HQty
+                    {
+                        Model.ClsQC_FirstPieceCheckBillSub_ValueGrid oSub_Value = new Model.ClsQC_FirstPieceCheckBillSub_ValueGrid();
+                        oSub_Value.HInterID = HInterID;
+                        oSub_Value.HEntryID = HEntryID;
+                        oSub_Value.HSEQ = i + 1;
+                        oSub_Value.HInSpectResult = ClsPub.isStrNull(valueList[i].HInSpectResult);
+                        oSub_Value.HInSpectValue = ClsPub.isLong(valueList[i].HInSpectValue);
+                        oSub_Value.HInSpectValueB = ClsPub.isLong(valueList[i].HInSpectValueB);
+                        oSub_Value.HInSpectValueT = ClsPub.isStrNull(valueList[i].HInSpectValueT);
+
+                        BillNew.DetailColl_Value.Add(oSub_Value);
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鏃犳槑缁嗚淇℃伅!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+
+                bResult = BillNew.AddValue(ref ClsPub.sExeReturnInfo, ref HInterID, ref HEntryID);
+
+                if (bResult == true)
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "淇濆瓨妫�楠屽�兼垚鍔�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇濆瓨澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }                      
+        }
+        #endregion
+
+        /// <summary>
+        ///杩斿洖妫�楠屽�煎垪琛�
+        /// </summary>
+        /// <param name="sWhere"></param>
+        /// <returns></returns>
+        [Route("QC_ValueTable/getValueList")]
+        [HttpGet]
+        public object getValueList(Int64 HInterID, Int64 HEntryID, string user)
+        {
+            DataSet ds;
+            try
+            {              
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+                ds = oCN.RunProcReturn("select * from QC_FirstPieceCheckBillSub_ValueGrid  where  HInterID="+ HInterID + " and HEntryID="+ HEntryID, "h_v_QC_FirstPieceCheckBillList");
+
+                if (ds.Tables[0].Rows.Count > 0)
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "Sucess锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁鏌ヨ鍒版暟鎹紒";
+                    objJsonResult.data = ds.Tables[0];
+                    return objJsonResult;
+                }
+
+               
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1