From 5bee62e95d6cd1d5306e99c0e4b6349b663ca0ce Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期四, 09 一月 2025 09:15:49 +0800
Subject: [PATCH] 工艺路线孙表新增;排产锁定工单(添康反写排产完成日期到金蝶);批改小时产能;批改上班工时;不良原因添加班组过滤

---
 WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs |  101 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 101 insertions(+), 0 deletions(-)

diff --git a/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs b/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
index 08d95d3..1d97270 100644
--- a/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
+++ b/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
@@ -569,6 +569,107 @@
             return objJsonResult;
         }
 
+        //宸ヨ壓璺嚎瀛欒〃 鏂板
+        [Route("Gy_RoutingBillSub/AddWorkQty")]
+        [HttpPost]
+        public object AddWorkQty([FromBody] JObject sMainSub)
+        {
+            try
+            {
+                var _value = sMainSub["sMainSub"].ToString();
+                string msg1 = _value.ToString();
+
+                string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+                string msg2 = sArray[0].ToString();
+                string user = sArray[1].ToString();
+
+                //鍒ゆ柇鏄惁鏈夌紪杈戞潈闄�
+                if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Edit", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "宸ヨ壓璺嚎鏃犳潈闄愮紪杈�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                List<Gy_RoutingBillSub_WorkQty> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_RoutingBillSub_WorkQty>>(msg2);
+                int i = 0;
+
+                oCN.BeginTran();//寮�濮嬩簨鐗�
+
+                foreach (Gy_RoutingBillSub_WorkQty oSub in DetailColl)
+                {
+                    i++;
+
+                    if (i == 1)
+                    {
+                        //鍏堝垹闄ゅ巻鍙茬粦瀹氭暟鎹悗鍦ㄩ噸鏂颁繚瀛�
+                        oCN.RunProc("delete from Gy_RoutingBillSub_WorkQty where HInterID = " + oSub.HInterID + " and HEntryID = " + oSub.HEntryID);
+                    };
+
+                    oCN.RunProc($"insert into Gy_RoutingBillSub_WorkQty" +
+                        $"(HInterID,HEntryID,HEntrySubID,HSourceID,HWorkQty_Source,HEntryStdEmpQty,HEntryStdEmpAvg,HSortNum,HRemark)" +
+                        $"values({oSub.HInterID},{oSub.HEntryID},{i},{oSub.HSourceID},{oSub.HWorkQty_Source},{oSub.HEntryStdEmpQty}" +
+                        $",{oSub.HEntryStdEmpAvg},{oSub.HSortNum},'{oSub.HRemark}')");
+                }
+
+                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;
+            }           
+        }
+        #endregion
+
+        #region 宸ヨ壓璺嚎瀛欒〃缂栬緫鑾峰彇鏁版嵁
+        [Route("Gy_RoutingBill/EditWorkQty")]
+        [HttpGet]
+        public object EditWorkQty(long HInterID,long HEntryID)
+        {
+            try
+            {
+
+                ds = oCN.RunProcReturn($"select * from h_v_Gy_RoutingBillSub_WorkQtyEdit where hmainid={HInterID} and hsubid={HEntryID} order by HEntrySubID asc", "h_v_Gy_RoutingBillSub_WorkQtyEdit");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "false锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    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 涓存椂瀹氶鎶ヨ〃

--
Gitblit v1.9.1