From 09844d2ce0c99bfcf7698581f9393a2ac1fc3e15 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期二, 11 四月 2023 00:01:04 +0800
Subject: [PATCH] 生成条码--最小包装数;选工序带出车间,工作中心

---
 WebAPI/Controllers/SCGL/Sc_MaterToSourceBillController.cs |   92 +++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 87 insertions(+), 5 deletions(-)

diff --git a/WebAPI/Controllers/SCGL/Sc_MaterToSourceBillController.cs b/WebAPI/Controllers/SCGL/Sc_MaterToSourceBillController.cs
index af0c38b..d354a67 100644
--- a/WebAPI/Controllers/SCGL/Sc_MaterToSourceBillController.cs
+++ b/WebAPI/Controllers/SCGL/Sc_MaterToSourceBillController.cs
@@ -40,13 +40,13 @@
             {
                 if (sWhere == null || sWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn("select * from h_v_Sc_MaterToSourceBillList " + sWhere, "h_v_Sc_MaterToSourceBillList");
+                    ds = oCN.RunProcReturn("select * from h_v_Sc_MaterToSourceBillMain " + sWhere, "h_v_Sc_MaterToSourceBillMain");
                 }
                 else
                 {
-                    string sql1 = "select * from h_v_Sc_MaterToSourceBillList where 1 = 1 ";
+                    string sql1 = "select * from h_v_Sc_MaterToSourceBillMain where 1 = 1 ";
                     string sql = sql1 + sWhere;
-                    ds = oCN.RunProcReturn(sql, "h_v_Sc_MaterToSourceBillList");
+                    ds = oCN.RunProcReturn(sql, "h_v_Sc_MaterToSourceBillMain");
                 }
                 if (ds == null || ds.Tables[0].Rows.Count == 0)
                 {
@@ -132,6 +132,87 @@
                 objJsonResult.data = null;
             }
             return objJsonResult;
+        }
+        #endregion
+
+        #region [涓婃枡闃查敊鍗曞垹闄ゅ姛鑳絔
+        /// <summary>
+        /// 寮�宸ュ崟鍒犻櫎鍔熻兘
+        /// </summary>
+        /// <returns></returns>
+        [Route("Sc_MaterToSourceBill/DeltetMaterToSourceBill")]
+        [HttpGet]
+        public object DeltetMaterToSourceBill(string HInterID, string UserName)
+        {
+            DBUtility.ClsPub.CurUserName = UserName;
+            //缂栬緫鏉冮檺
+            //if (!DBUtility.ClsPub.Security_Log("MES_MaterToSourceBill_Delete", 1, false, DBUtility.ClsPub.CurUserName))
+            //{
+            //    objJsonResult.code = "0";
+            //    objJsonResult.count = 0;
+            //    objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+            //    objJsonResult.data = null;
+            //    return objJsonResult;
+            //}
+
+
+            Int64 lngBillKey = 0;
+            lngBillKey = DBUtility.ClsPub.isLong(HInterID);
+            if (lngBillKey == 0)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鍗曟嵁ID涓虹┖锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            DAL.ClsSc_MESMaterToSourceBill oBill = new DAL.ClsSc_MESMaterToSourceBill();
+            if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
+            {
+                if (oBill.omodel.HBillStatus > 1)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵��,涓嶈兘鍒犻櫎锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (oBill.omodel.HChecker != "")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+                if (IsDete)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+            }
+            else
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鍗曟嵁鏈壘鍒�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
         }
         #endregion
 
@@ -338,7 +419,7 @@
             string refSav = sArray[2].ToString();
 
             //淇濆瓨鏉冮檺
-            //if (!DBUtility.ClsPub.Security_Log("MES_MaterToSourceBill_Edit", 1, true, DBUtility.ClsPub.CurUserName))
+            //if (!DBUtility.ClsPub.Security_Log("MES_MaterToSourceBill_Edit", 1, false, DBUtility.ClsPub.CurUserName))
             //{
             //    objJsonResult.code = "0";
             //    objJsonResult.count = 0;
@@ -515,6 +596,7 @@
                 else
                 {
                     bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+                    objJsonResult.HInterID = DBUtility.ClsPub.sExeReturnInfo; //杩斿洖涓籌D
                     objJsonResult.Verify = "N";
                 }
                 if (bResult)
@@ -563,7 +645,7 @@
             try
             {
                 //瀹℃牳鏉冮檺
-                //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName))
+                //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName))
                 //{
                 //    objJsonResult.code = "0";
                 //    objJsonResult.count = 0;

--
Gitblit v1.9.1