From 790643bfa671cc2c6a4579c3676845eebe0fa9ac Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期二, 25 十月 2022 15:12:01 +0800
Subject: [PATCH] 条码生成完善

---
 WebAPI/Controllers/仓存管理/条码生成/Sc_BarCodeController.cs |   97 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 96 insertions(+), 1 deletions(-)

diff --git "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\346\235\241\347\240\201\347\224\237\346\210\220/Sc_BarCodeController.cs" "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\346\235\241\347\240\201\347\224\237\346\210\220/Sc_BarCodeController.cs"
index b415d2e..a0cea38 100644
--- "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\346\235\241\347\240\201\347\224\237\346\210\220/Sc_BarCodeController.cs"
+++ "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\346\235\241\347\240\201\347\224\237\346\210\220/Sc_BarCodeController.cs"
@@ -259,6 +259,34 @@
         }
         #endregion
 
+        #region [閫氳繃鏉$爜缂栧彿鑾峰彇HItemId]
+        [Route("Sc_BarCode/Get_HItemId")]
+        [HttpGet]
+        public object Get_HItemId(string sWhere)
+        {
+            List<object> columnNameList = new List<object>();
+            try
+            {
+                ds = oCN.RunProcReturn("select * from h_v_IF_BarCodeBillList where 鏉$爜缂栧彿 =  '" + sWhere + "'", "h_v_IF_BarCodeBillList");
+
+                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 = e.Message.ToString();
+                objJsonResult.data = null;
+                objJsonResult.list = columnNameList;
+            }
+            return objJsonResult;
+        }
+        #endregion
+
         #region [閫氳繃閫夋嫨鐨勬簮鍗曚俊鎭煡鎵炬簮鍗曟暟鎹甝
         [Route("Sc_BarCode/SelectReportFromBillList")]
         [HttpPost]
@@ -480,6 +508,73 @@
 
         #endregion
 
+        #region [鍚屾璧勬枡]
+        [Route("Sc_BarCode/Sync_data")]
+        [HttpGet]
+        public object Sync_data()
+        {
+            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+            try
+            {
+                oCn.RunProc("exec h_p_IF_ERPDataToLocal", ref DBUtility.ClsPub.sExeReturnInfo);
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鍚屾鍩虹璧勬枡鎴愬姛锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鍚屾鍩虹璧勬枡澶辫触锛�" + e;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region [鎵规]
+        [Route("Sc_BarCode/Batch")]
+        [HttpGet]
+        public object Batch(int HMaterID, string HBatchNo)
+        {
+            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+            bool b = false;
+            if (HMaterID != 0)
+            {
+                DataSet oDs = oCn.RunProcReturn("exec h_p_Gy_BarCodeBill_GetBatchNo " + HMaterID.ToString() + ",'" + HBatchNo + "','" + "" + "','" + "" + "'", "h_p_Gy_BarCodeBill_GetBatchNo");
+                //
+                if (oDs == null && oDs.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.Message="鐢熸垚鎵规澶辫触锛�";
+                    return objJsonResult;
+                }
+                else if (DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0][0]) == "1")
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.Message = "鐢熸垚鎵规鎴愬姛锛�";
+                    objJsonResult.data = DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["HBatchNo"]);
+                    HBatchNo = DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["HBatchNo"]);
+                    b = true;
+                    return objJsonResult;
+                }
+            }
+            //鏄庣粏琛ㄦ槸鍚︿负闆惰
+            if (b == false)
+            {
+                objJsonResult.code = "1";
+                objJsonResult.Message="娌℃湁闇�瑕佺敓鎴愭壒娆$殑鏄庣粏琛岋紒";
+                return objJsonResult;
+            }
+            else //瀹屽叏灏侀棴
+            {
+                return null;
+            }
+        }
+        #endregion
+
         #region [鏉$爜鐢熸垚鎺ュ彛]
         [Route("Sc_BarCode/Sub_SaveBill")]
         [HttpPost]
@@ -536,7 +631,7 @@
             }
             return objJsonResult;
         }
-        #endregion
+        #endregion        
 
         #region[鍗曟嵁瀹屾暣鎬у垽鏂璢
         private bool Sub_AllowSave(string msg2, string HSelectBarCodeType)

--
Gitblit v1.9.1