From 92d68fe5ecb24f070a9b46e0409f52d5dd0d9081 Mon Sep 17 00:00:00 2001
From: 沈泽 <211959439@qq.com>
Date: 星期一, 06 九月 2021 09:31:28 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/CJGL/Cj_StationInBillController.cs |  105 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 103 insertions(+), 2 deletions(-)

diff --git a/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs
index 13ad85b..4ffb696 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs
@@ -15,6 +15,9 @@
     {
         public DBUtility.ClsPub.Enum_BillStatus BillStatus;
 
+        //鑾峰彇绯荤粺鍙傛暟
+        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
+
         private json objJsonResult = new json();
         SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
         DataSet ds;
@@ -139,13 +142,14 @@
                 ds = oCN.RunProcReturn("select HInterID from Sc_ProcessExchangeBillSub Where hinterid=" + HProcExchInterID + " and hprocno<" + HProcNo + " order by hprocno", "Sc_ProcessExchangeBillSub");
                 if (ds == null)
                 {
-                    oCN.RollBack();
+
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
                     objJsonResult.Message = "鍒ゆ柇棣栭亾宸ュ簭澶辫触锛屼笉鍏佽淇濆瓨锛�";
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
+             
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
                 oCN.BeginTran();
 
@@ -720,6 +724,7 @@
         }
         #endregion
 
+        //鎵归噺杩涚珯
         #region 鎵归噺杩涚珯妯″潡杩斿洖鏄庣粏淇℃伅鍒楄〃
         [Route("Cj_StationInBill/get_BarCodeDetail")]
         [HttpGet]
@@ -765,6 +770,102 @@
         }
         #endregion
 
-        //
+        #region 鏍规嵁id鍒犻櫎杩涚珯鍗�
+        [Route("Cj_StationInBill/del_StationInBill")]
+        [HttpGet]
+        public object del_StationInBill(long HInterID,string HDeleteMan)
+        {
+            try
+            {
+
+                //缂栬緫鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("MES_StationInBill_Delete", 1, true, HDeleteMan))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                DAL.ClsSc_StationInBill oBill = new DAL.ClsSc_StationInBill();
+                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_StationInBill_DelCtrl  '" + oBill.omodel.HBillNo + "'", "h_p_MES_StationInBill_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
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1