From 7ece110dd8ba9ac474134de734e095695419c24d Mon Sep 17 00:00:00 2001
From: wyb <1qaz@123>
Date: 星期二, 18 五月 2021 18:30:08 +0800
Subject: [PATCH] 检验方案列表新增

---
 WebAPI/Controllers/QC_ManagementController.cs |  136 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 136 insertions(+), 0 deletions(-)

diff --git a/WebAPI/Controllers/QC_ManagementController.cs b/WebAPI/Controllers/QC_ManagementController.cs
index 9d9d419..ced9280 100644
--- a/WebAPI/Controllers/QC_ManagementController.cs
+++ b/WebAPI/Controllers/QC_ManagementController.cs
@@ -95,6 +95,8 @@
             return objJsonResult;
         }
         #endregion
+
+        #region 鏌ヨ鍒楄〃鏂规硶
         /// <summary>
         /// 杩斿洖妫�楠屾柟妗堝崟鍒楄〃
         /// </summary>
@@ -235,6 +237,140 @@
             return GetObjectJson(ds);
         }
 
+        #endregion
+
+        #region 淇濆瓨鏂规硶
+
+        /// <summary>
+        /// 淇濆瓨妫�楠屾柟妗�
+        /// </summary>
+        /// <param name="msg"></param>
+        /// <returns></returns>
+        [Route("SaveQCCheckProjectList")]
+        [HttpPost]
+        public object SaveQCCheckProjectList([FromBody] JObject msg)
+        {
+            var _value = msg["msg"].ToString();
+            string msg1 = _value.ToString();
+            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+            string msg2 = sArray[0].ToString();
+            string msg3 = sArray[1].ToString();
+
+
+            string UserName = "";
+            ListModels oListModels = new ListModels();
+            try
+            {
+                DAL.ClsGy_QCCheckProjectMain oBill = new DAL.ClsGy_QCCheckProjectMain();
+                List<Model.ClsGy_QCCheckProjectMain> lsmain = new List<Model.ClsGy_QCCheckProjectMain>();
+                msg2 = msg2.Replace("\\", "");
+                msg2 = msg2.Replace("\n", "");  //\n
+                lsmain = oListModels.getObjectByJson_Gy_QCCheckProjectMain(msg2);
+                foreach (Model.ClsGy_QCCheckProjectMain oItem in lsmain)
+                {
+                    //oItem.HMaker = "";
+                    UserName = oItem.HMaker;
+                    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 = "3302";
+                    oItem.HBillSubType = "3302";
+                    oItem.HBillStatus = 0;
+                    oItem.HPeriod = 0;
+                    oItem.HMaker = "";
+                    oItem.HStandard = false;
+                    oItem.HMainSourceInterID = oItem.HInterID;
+                    oItem.HInterID = 0;
+                    oItem.HMaterTypeID = 0;
+                    //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
+                    if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    oBill.omodel = oItem;
+                }
+                //琛ㄤ綋鏁版嵁
+                //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+                msg3 = msg3.Substring(1, msg3.Length - 2);
+                msg3 = msg3.Replace("\\", "");
+                msg3 = msg3.Replace("\n", "");  //\n
+                //msg2 = msg2.Replace("'", "鈥�");
+                List<Model.ClsGy_QCCheckProjectSub> ls = new List<Model.ClsGy_QCCheckProjectSub>();
+                ls = oListModels.getObjectByJson_ClsGy_QCCheckProjectSub(msg3);
+                int i = 0;
+                foreach (Model.ClsGy_QCCheckProjectSub oItemSub in ls)
+                {
+                    oItemSub.HBillNo_bak = oBill.omodel.HBillNo;//鍗曟嵁鍙凤紙澶囦唤锛屼互鍏嶅唴鐮佷涪澶憋紝鎵句笉鍒板搴斾富琛級
+                    i++;
+                    if (string.IsNullOrWhiteSpace(oItemSub.HBillNo_bak))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佹病澶囦唤鍗曟嵁鍙凤紝鏃犳硶淇濆瓨锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    oItemSub.HSourceEntryID =0;
+                    oItemSub.HSourceInterID =0;
+                    oItemSub.HEntryID = i;
+                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+                    oItemSub.HCloseType = false;
+                    oItemSub.HSourceBillNo = "";
+                    oItemSub.HSourceBillType = "";
+                    oItemSub.HRelationQty = 0;
+                    oItemSub.HRelationMoney = 0;
+                    oItemSub.HCloseMan = "";
+                    oItemSub.HRemark = "";
+                    oBill.DetailColl.Add(oItemSub);
+
+                }
+                //淇濆瓨
+                //淇濆瓨瀹屾瘯鍚庡鐞�
+                bool bResult;
+                if (oBill.omodel.HInterID == 0)
+                {
+                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+                else
+                {
+                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+                if (bResult)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+                    //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+                    objJsonResult.data = 1;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = 1;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
+                objJsonResult.data = 1;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+
+
 
 
     }

--
Gitblit v1.9.1