From e5f9dc55226733c3e95f35d182f54b9f9f1b1409 Mon Sep 17 00:00:00 2001
From: 仲国强 <519541279@qq.com>
Date: 星期一, 06 九月 2021 15:17:10 +0800
Subject: [PATCH] 增加出站单删除功能,修改工序流转卡拆单是因为模具编号、程序号而报错的问题。

---
 WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs |  118 +++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 103 insertions(+), 15 deletions(-)

diff --git a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
index e7b2e6b..8eb45d9 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
@@ -23,11 +23,7 @@
         DataSet ds1;
         string fileip = System.Configuration.ConfigurationManager.AppSettings["FileIP"];
 
-        /// <summary>
-        /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳
-        ///鍙傛暟锛歴tring sql銆�
-        ///杩斿洖鍊硷細object銆�
-        /// </summary>
+        #region 鏂板鍗曟嵁-淇濆瓨鎸夐挳
         [Route("Cj_StationOutBill/AddBill")]
         [HttpPost]
         public object AddBill([FromBody] JObject oMain)
@@ -386,12 +382,9 @@
             }
             return false;
         }
+        #endregion
 
-        /// <summary>
-        /// 杩斿洖宸ュ簭鍑虹珯姹囨姤鍗曞垪琛�
-        ///鍙傛暟锛歴tring sql銆�
-        ///杩斿洖鍊硷細object銆�
-        /// </summary>
+        #region 杩斿洖宸ュ簭鍑虹珯姹囨姤鍗曞垪琛�
         [Route("Cj_StationOutBill/get_Display")]
         [HttpGet]
         public object get_Display(string sWhere)
@@ -434,12 +427,9 @@
                 return objJsonResult;
             }
         }
+        #endregion
 
-        /// <summary>
-        /// 缂栬緫椤甸潰鏍规嵁id鑾峰彇宸ュ簭鍑虹珯姹囨姤鍗曚俊鎭�
-        ///鍙傛暟锛歴tring sql銆�
-        ///杩斿洖鍊硷細object銆�
-        /// </summary>
+        #region 缂栬緫椤甸潰鏍规嵁id鑾峰彇宸ュ簭鍑虹珯姹囨姤鍗曚俊鎭�
         [Route("Cj_StationOutBill/GetStationOutBill")]
         [HttpGet]
         public object GetStationOutBill(int HInterID)
@@ -473,6 +463,7 @@
                 return objJsonResult;
             }
         }
+        #endregion
 
 
         #region  宸ュ簭鍑虹珯姹囨姤鍗曟枃浠朵笂浼犲鐞�
@@ -670,6 +661,103 @@
 
         #endregion
 
+        #region 鏍规嵁id鍒犻櫎鍑虹珯鍗�
+        [Route("Cj_StationOutBill/del_StationOutBill")]
+        [HttpGet]
+        public object del_StationOutBill(long HInterID, string HDeleteMan)
+        {
+            try
+            {
+
+                //缂栬緫鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("MES_StationOutBill_Delete", 1, true, HDeleteMan))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                DAL.ClsSc_StationOutBill oBill = new DAL.ClsSc_StationOutBill();
+                if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+                {
+                    if (oBill.omodel.HMaker != HDeleteMan && (HDeleteMan != "admin" && HDeleteMan != "Admin"))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍙兘鍒犻櫎鏈汉鐨勫崟鎹紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+
+                    SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+                    DataSet ds;
+                    //鍒ゆ柇鏄惁瀛樺湪 鐩稿悓鍗曟嵁鍙� 鐨勯鏂欏崟 鍒ゆ柇鐢熶骇璁㈠崟鏄惁宸茬粨妗堬紝瑕佹眰璁″垝鎵嬪伐鍙嶇粨妗�    
+                    ds = oCn.RunProcReturn("exec h_p_MES_StationOutBill_DelCtrl  '" + oBill.omodel.HBillNo + "'", "h_p_MES_StationOutBill_DelCtrl");
+                    if (ds == null)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍒ゆ柇鍏宠仈澶辫触锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (ds.Tables[0].Rows.Count > 0 && Pub_Class.ClsPub.isInt(ds.Tables[0].Rows[0][0]) == 2)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0][1]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (oBill.omodel.HChecker != "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+
+                    //鍐欏叆鍒犻櫎鏃ュ織 
+                    string WorkList = "鍒犻櫎鍑虹珯鍗曪細" + oBill.omodel.HBillNo;
+                    if (!oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HProcExchInterID, oBill.omodel.HProcExchEntryID, ref DBUtility.ClsPub.sExeReturnInfo))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        objJsonResult.code = "1";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁鏈壘鍒帮紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "寮傚父锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
 
         //鎵归噺鍑虹珯
         #region 鎵归噺鍑虹珯妯″潡杩斿洖鏄庣粏淇℃伅鍒楄〃

--
Gitblit v1.9.1