From c34e85eda515636993b37a752b52c0f43ae6e17b Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期四, 09 一月 2025 09:17:18 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs |  123 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 122 insertions(+), 1 deletions(-)

diff --git a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
index 25f15f5..ceb4d6b 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
@@ -1871,7 +1871,10 @@
                     case "Emp":
                         sql = "select * from h_v_Sc_StationOutBillSubQuery_Emp where 1 = 1 and HInterID=" + sWhere;
                         break;
-                  
+                    case "Sup":
+                        sql = "select * from h_v_Sc_StationOutBillSubQuery_Sup where 1 = 1 and HInterID=" + sWhere;
+                        break;
+
                 }
 
                 ds = oCN.RunProcReturn(sql, TableName);
@@ -4066,5 +4069,123 @@
             }
         }
         #endregion
+
+        #region 鍑虹珯鍗曞垪琛�-涓嬫帹PPM鏁版嵁褰曞叆淇濆瓨,鍒犻櫎
+
+        [Route("Cj_StationOutBill/PPMSupAddBill")]
+        [HttpPost]
+        public object PPMSupAddBill([FromBody] JObject sSubStr)
+        {
+            var _value = sSubStr["sSubStr"].ToString();
+            string msg1 = _value.ToString();
+            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+            try
+            {
+                //鍙嶅簭鍒楀寲
+                string msg2 = sArray[0].ToString(); //琛ㄤ綋
+                string refSav = sArray[1].ToString();//鎿嶄綔绫诲瀷
+                string user = sArray[2].ToString(); //鐢ㄦ埛
+                msg2 = msg2.Substring(1, msg2.Length - 2);
+                msg2 = msg2.Replace("\\", "");
+                msg2 = msg2.Replace("\n", "");
+                msg2 = "[" + msg2 + "]";
+                //鍒ゆ柇鏄惁鏈夌紪杈戞潈闄�
+                if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Edit", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犵紪杈戞潈闄�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+
+                List<Sc_StationOutBillSub_Sup> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Sc_StationOutBillSub_Sup>>(msg2);
+
+                oCN.BeginTran();
+                for (int i = 0; i < list.Count; i++)
+                {              
+                    int HInterID = list[i].HInterID;
+                    int HEntryID = i+1;
+                    int HSupID = list[i].HSupID;
+                    double HWasterQty_Mater = list[i].HWasterQty_Mater;
+                    double HBackWorkQty = list[i].HBackWorkQty;
+
+                    oCN.RunProc("Insert Into Sc_StationOutBillSub_Sup " +
+                     "(HInterID, HEntryID, HSupID, HWasterQty_Mater, HBackWorkQty) " +
+                     "values ('" + HInterID + "', '" + HEntryID + "', '" + HSupID + "', '" + HWasterQty_Mater + "', '" + HBackWorkQty + "')");
+
+                }
+
+                oCN.Commit();            
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鏂板鍗曟嵁鎴愬姛锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        [Route("Cj_StationOutBill/PPMSupDelete")]
+        [HttpGet]
+        public object PPMSupDelete(int HInterID,string user)
+        {
+            try
+            {
+                //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+                if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Drop", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犲垹闄ゆ潈闄�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                ds = oCN.RunProcReturn("select * from Sc_StationOutBillSub_Sup WITH(NOLOCK) where HInterID = " + HInterID, "Sc_StationOutBillSub_Sup");
+
+                if (ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏌ユ棤鏁版嵁锛�";
+                    objJsonResult.data = null;
+                }
+
+                oCN.BeginTran();
+
+                string sql = "";
+               
+                sql = "delete from Sc_StationOutBillSub_Sup where HInterID = " + HInterID;
+                oCN.RunProc(sql);
+
+                oCN.Commit();
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = null;
+                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

--
Gitblit v1.9.1