From 6efc7d05a24fb3db3f74cd5bbd5b5e2839c280ec Mon Sep 17 00:00:00 2001
From: zzr99 <1940172413@qq.com>
Date: 星期二, 12 四月 2022 15:14:49 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 DAL/WMS/ClsGy_BarCodeBill_Ctl.cs |  200 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 200 insertions(+), 0 deletions(-)

diff --git a/DAL/WMS/ClsGy_BarCodeBill_Ctl.cs b/DAL/WMS/ClsGy_BarCodeBill_Ctl.cs
index 84cb48b..260ac0b 100644
--- a/DAL/WMS/ClsGy_BarCodeBill_Ctl.cs
+++ b/DAL/WMS/ClsGy_BarCodeBill_Ctl.cs
@@ -11,6 +11,10 @@
         //鍘熶唬鐮� 鐢ㄤ簬 鏇挎崲瀛愰」鐩�
         public string HOldNumber;
         public Model.ClsGy_BarCodeBill_WMS_Model oModel = new Model.ClsGy_BarCodeBill_WMS_Model();
+        public const string ModRightName = "Gy_BarCodeBillList";
+        public const string ModRightNameEdit = ModRightName + "_Edit";      //鍒犻櫎
+        public const string ModRightNameDelete = ModRightName + "_Delete";  //浣滃簾
+        public const string ModRightNamePrint = ModRightName + "_Print";    //鎵撳嵃
         //鏂板
         public override bool AddNew()
         {
@@ -220,6 +224,202 @@
             }
         }
 
+
+        //鍒犻櫎鏉$爜
+        public bool DeleteBill(long sHItemID, string sHBarCode, string CurUserName, ref string sReturn)
+        {
+            //缂栬緫鏉冮檺
+            if (!DBUtility.ClsPub.Security_Log(ModRightNameEdit, 1, false, CurUserName))
+            {
+                sReturn = "鎮ㄦ病鏈夊垹闄ゆ潈闄愶紒";
+                return true;
+            }
+            try
+            {
+                DataSet DS = oCn.RunProcReturn("exec h_p_Gy_BarCodeBill_Delete " + sHItemID + ",'" + sHBarCode + "','" + CurUserName + "','" + DBUtility.ClsPub.ComputerName + "','" + DBUtility.ClsPub.IPAddress + "'", "h_p_Gy_BarCodeBill_Delete", ref DBUtility.ClsPub.sExeReturnInfo);
+                if (DS == null || DS.Tables[0].Rows.Count <= 0)
+                {
+                    oCn.CnClose();
+                    oCn.CnDispose();
+                    sReturn = "鍒犻櫎鏉$爜鏃跺彂鐢熼敊璇紒";
+                    return true;
+                }
+                else
+                {
+                    //鍒犻櫎澶辫触
+                    if (DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]) == "1")
+                    {
+                        oCn.CnClose();
+                        oCn.CnDispose();
+                        sReturn = DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]);
+                        return true;
+                    }
+                    else
+                    //鍒犻櫎鎴愬姛
+                    {
+                        oCn.CnClose();
+                        oCn.CnDispose();
+                        sReturn = DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]);
+                        return false;
+                    }
+                }
+            }
+            catch (Exception e)
+            {
+                oCn.RollBack();
+                throw (e);
+            }
+        }
+
+        //鎵归噺鍒犻櫎鏉$爜
+        public bool MulDeleteBill(string sHItemID, string sHBarCode, string CurUserName, ref string sReturn)
+        {
+            //缂栬緫鏉冮檺
+            if (!DBUtility.ClsPub.Security_Log(ModRightNameEdit, 1, false, CurUserName))
+            {
+                sReturn = "鎮ㄦ病鏈夊垹闄ゆ潈闄愶紒";
+                return true;
+            }
+            try
+            {
+                DataSet DS = oCn.RunProcReturn("exec h_p_Gy_BarCodeBill_MulDelete '" + sHItemID + "','" + sHBarCode + "','" + CurUserName + "','" + DBUtility.ClsPub.ComputerName + "','" + DBUtility.ClsPub.IPAddress + "'", "h_p_Gy_BarCodeBill_MulDelete", ref DBUtility.ClsPub.sExeReturnInfo);
+                if (DS == null || DS.Tables[0].Rows.Count <= 0)
+                {
+                    oCn.CnClose();
+                    oCn.CnDispose();
+                    sReturn = "鎵归噺鍒犻櫎鏉$爜鏃跺彂鐢熼敊璇紒";
+                    return true;
+                }
+                else
+                {
+                    //鎵归噺鍒犻櫎澶辫触
+                    if (DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]) == "1")
+                    {
+                        oCn.CnClose();
+                        oCn.CnDispose();
+                        sReturn = DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]);
+                        return true;
+                    }
+                    else
+                    //鎵归噺鍒犻櫎鎴愬姛
+                    {
+                        oCn.CnClose();
+                        oCn.CnDispose();
+                        sReturn = DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]);
+                        return false;
+                    }
+                }
+            }
+            catch (Exception e)
+            {
+                oCn.RollBack();
+                throw (e);
+            }
+        }
+
+
+
+
+
+        //鏉$爜鐢熸垚妯″潡璋冪敤    鏉$爜鎵撳嵃鍓嶏紝鏉$爜鎵撳嵃娆℃暟鎺у埗锛堟槸鍚﹁秴杩囧厑璁稿彲鎵撳嵃娆℃暟锛�
+        public bool Set_CheckPrintQty_SD(Int64 HInterID, long PrintQty, ref string sReturn)
+        {
+            DataSet DS;
+            string sBarCode = "";
+            DS = oCn.RunProcReturn("select stuff((select ','+HBarCode from Gy_BarCodeBill with(nolock) where HPrintQty >=" + PrintQty + " and HBarCodeType = '鍞竴鏉$爜' and HInterID = " + HInterID + " for xml path('')),1,1,'')", "Gy_BarCodeBill");
+            if (DS == null || DS.Tables[0].Rows.Count == 0)
+            {
+                sReturn = "姝e父锛�";
+                return false;
+            }
+            else
+            {
+                sBarCode = DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]);
+                if (sBarCode == "")
+                {
+                    sReturn = "姝e父锛�";
+                    return false;
+                }
+                else
+                {
+                    sReturn = "鏉$爜缂栧彿锛�" + DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]) + "锛屽凡鎵撳嵃" + PrintQty + " 娆★紝涓嶅厑璁稿啀娆¢瑙堟墦鍗帮紒";
+                    return true;
+                }
+            }
+        }
+
+        //鏉$爜妗f鍒楄〃妯″潡璋冪敤    鏉$爜鎵撳嵃鍓嶏紝鏉$爜鎵撳嵃娆℃暟鎺у埗锛堟槸鍚﹁秴杩囧厑璁稿彲鎵撳嵃娆℃暟锛�
+        public bool Set_CheckPrintQty(string sBarCodeItemID,long PrintQty, ref string sReturn)
+        {
+            DataSet DS;
+            string sBarCode = "";
+            DS = oCn.RunProcReturn("select stuff((select ','+HBarCode from Gy_BarCodeBill with(nolock) where HPrintQty >=" + PrintQty + " and HBarCodeType = '鍞竴鏉$爜' and HItemID in (" + sBarCodeItemID + ") for xml path('')),1,1,'')", "Gy_BarCodeBill");
+            if (DS == null || DS.Tables[0].Rows.Count == 0)
+            {
+                sReturn = "姝e父锛�";
+                return false;
+            }
+            else
+            {
+                sBarCode = DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]);
+                if (sBarCode == "")
+                {
+                    sReturn = "姝e父锛�";
+                    return false;
+                }
+                else
+                {
+                    sReturn = "鏉$爜缂栧彿锛�" + DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]) + "锛屽凡鎵撳嵃" + PrintQty + " 娆★紝涓嶅厑璁稿啀娆¢瑙堟墦鍗帮紒";
+                    return true;
+                }
+            }
+        }
+
+        //鏉$爜鐢熸垚妯″潡璋冪敤    鏉$爜鎵撳嵃鍚庯紝鏇存柊鏉$爜鎵撳嵃娆℃暟
+        public bool Set_UpdatePrintQty_SD(Int64 HInterID)
+        {
+            try
+            {
+                oCn.BeginTran();
+                //鏇存柊 鏉$爜鎵撳嵃娆℃暟
+                oCn.RunProc("update Gy_BarCodeBill set HPrintQty=isnull(HPrintQty,0)+1 where HInterID = " + HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+                oCn.Commit();
+                return true;
+            }
+            catch (Exception e)
+            {
+                oCn.RollBack();
+                throw (e);
+            }
+        }
+
+        //鏉$爜妗f鍒楄〃妯″潡璋冪敤    鏉$爜鎵撳嵃鍚庯紝鏇存柊鏉$爜鎵撳嵃娆℃暟
+        public bool Set_UpdatePrintQty(string sBarCodeItemID)
+        {
+            try
+            {
+                oCn.BeginTran();
+                //鏇存柊 鏉$爜鎵撳嵃娆℃暟
+                oCn.RunProc("update Gy_BarCodeBill set HPrintQty=isnull(HPrintQty,0)+1 where HItemID in (" + sBarCodeItemID + ")", ref DBUtility.ClsPub.sExeReturnInfo);
+                oCn.Commit();
+                return true;
+            }
+            catch (Exception e)
+            {
+                oCn.RollBack();
+                throw (e);
+            }
+        }
+
+
+
+
+
+
+
+
+
+
         //鏋勯�犲嚱鏁�
         public ClsGy_BarCodeBill_Ctl()
         {

--
Gitblit v1.9.1