From 1869da0ed72dfa054f611bdd3c46aba8cc062b88 Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期五, 05 一月 2024 17:09:08 +0800
Subject: [PATCH] 新增PDA用户登入验证调用方法,新增扫码返回供应商信息方法,扫码返回客户信息方法修改

---
 WebAPI/Controllers/条码管理/WEBSController.cs |  126 ++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 120 insertions(+), 6 deletions(-)

diff --git "a/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs" "b/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs"
index 4e08991..d1fe44e 100644
--- "a/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs"
+++ "b/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs"
@@ -37,6 +37,78 @@
 
         #region 鍏敤鏂规硶
 
+        #region 璐﹀彿鐧诲叆
+
+        /// <summary>
+        /// 璐﹀彿鐧诲叆鏃堕獙璇佽处鍙枫�佸瘑鐮佷俊鎭�
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/GetUser_Json")]
+        [HttpGet]
+        public object GetUser_Json(string HUserNumber, string HPassWord, Int64 HStockOrgID, string HStockOrgName)
+        {
+            try
+            {
+                HPassWord = DBUtility.ClsPub.StrToPsd(HPassWord.Trim());
+                ds = oCn.RunProcReturn("exec h_p_Gy_User '" + HUserNumber + "','" + HPassWord + "'," + HStockOrgID.ToString(), "h_p_Gy_User");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "杈撳叆鐨勭敤鎴峰悕鎴栧瘑鐮侀敊璇紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    //鍒ゆ柇鐢ㄦ埛瀵瑰簲缁勭粐鏉冮檺锛屽緱鍒扮櫥鍏ョ粍缁囦俊鎭紙ID銆佷唬鐮併�佸悕绉帮級
+                    DataSet ds2 = oWebs.get_ORGANIZATIONS_UserByOrgRelation(HUserNumber, HStockOrgName);
+                    if (ds2 == null || ds2.Tables[0].Rows.Count == 0)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍒ゆ柇鐢ㄦ埛瀵瑰簲缁勭粐鏉冮檺閿欒锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else if (DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HBack"])==1)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+
+                    //鍒ゆ柇鐢ㄦ埛璐﹀彿瀵嗙爜锛圵ISE銆丆LOUD锛夋槸鍚︽纭�
+                    if (!oWebs.CheckUser(DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["Czymc"]), ref DBUtility.ClsPub.sErrInfo))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //澶辫触锛�
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鐧诲綍鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鐧诲綍寮傚父锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+
         #region 鑾峰彇鏈�澶у崟鎹甀D銆佸崟鎹彿
 
         /// <summary>
@@ -465,16 +537,56 @@
         /// <returns></returns>
         [Route("WEBSController/GetSupplier_Json")]
         [HttpGet]
-        public object GetSupplier_Json(Int64 HSupID)
+        public object GetSupplier_Json(string HBarCode, Int64 HStockOrgID)
         {
             try
             {
-                ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Supplier with(nolock) where HStopflag=0 and HItemID=" + HSupID.ToString(), "Gy_Supplier");
+                Int64 HSupID = 0;
+                HSupID = DBUtility.ClsPub.isLong(HBarCode);
+                ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Supplier with(nolock) where HStopflag=0 and HItemID=" + HSupID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "Gy_Supplier");
                 if (ds == null || ds.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛岃纭鎵�鎵緵搴斿晢鏉$爜鏄惁姝g‘锛屼笖涓洪潪绂佺敤鐘舵�侊紒";
+                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛岃纭鎵�鎵緵搴斿晢鏉$爜鏄惁灞炰簬璇ョ粍缁囷紝涓斾负闈炵鐢ㄧ姸鎬侊紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "杩斿洖渚涘簲鍟嗕俊鎭け璐ワ紒" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        /// <summary>
+        /// 鑾峰彇渚涘簲鍟嗗垪琛ㄤ俊鎭�
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/GetSupplierList_Json")]
+        [HttpGet]
+        public object GetSupplierList_Json(string Supplier, Int64 HStockOrgID)
+        {
+            try
+            {
+                ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Supplier with(nolock) where HStopflag=0 and HUSEORGID=" + HStockOrgID.ToString() + " and (HNumber like '%" + Supplier + "%' or HName like '%" + Supplier + "%')", "Gy_Supplier");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍渚涘簲鍟嗚褰曪紒";
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
@@ -507,16 +619,18 @@
         /// <returns></returns>
         [Route("WEBSController/GetCustomer_Json")]
         [HttpGet]
-        public object GetCustomer_Json(Int64 HCusID)
+        public object GetCustomer_Json(string HBarCode, Int64 HStockOrgID)
         {
             try
             {
-                ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Customer with(nolock) where HStopflag=0 and HItemID=" + HCusID.ToString(), "Gy_Customer");
+                Int64 HCusID = 0;
+                HCusID = DBUtility.ClsPub.isLong(HBarCode);
+                ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Customer with(nolock) where HStopflag=0 and HItemID=" + HCusID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "Gy_Customer");
                 if (ds == null || ds.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛岃纭鎵�鎵鎴锋潯鐮佹槸鍚︽纭紝涓斾负闈炵鐢ㄧ姸鎬侊紒";
+                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛岃纭鎵�鎵鎴锋潯鐮佹槸鍚﹀睘浜庤缁勭粐锛屼笖涓洪潪绂佺敤鐘舵�侊紒";
                     objJsonResult.data = null;
                     return objJsonResult;
                 }

--
Gitblit v1.9.1