From 1e5c4412216cdba315ab37ebc8e85644f39a7df1 Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期五, 11 七月 2025 16:50:02 +0800
Subject: [PATCH] PDA校验扫描物料条码方法修改,增加校验模块免扫物料条码系统参数

---
 WebAPI/Controllers/BaseSet/Gy_CustomerController.cs |  272 +++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 227 insertions(+), 45 deletions(-)

diff --git a/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs b/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs
index 03f153d..f6182eb 100644
--- a/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs
@@ -12,8 +12,8 @@
 using SyntacticSugar.constant;
 using System.Web;
 using WebAPI.Controllers.SCGL.鏃ヨ鍒掔鐞�;
-using WebAPI.WebBLL.JCJM.GYZL;
-using WebAPI.WebBLL.JCJM.IMPL;
+//using WebAPI.WebBLL.JCJM.GYZL;
+//using WebAPI.WebBLL.JCJM.IMPL;
 using System.IO;
 namespace WebAPI.Controllers
 {
@@ -25,7 +25,7 @@
 
         private json objJsonResult = new json();
         SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
-        private Gy_CustomerService customerService = new Gy_CustomerImpl();
+        //private Gy_CustomerService customerService = new Gy_CustomerImpl();
         DataSet ds;
 
         #region 杩斿洖瀹㈡埛鍒楄〃
@@ -102,6 +102,73 @@
         }
         #endregion
 
+        #region 瀹㈡埛鍒嗛〉鍒楄〃
+        [Route("Gy_Customer/page")]
+        [HttpGet]
+        public json Gy_CustomerPage(string sWhere, string user, int page, int size, string Organization)
+        {
+            DataSet ds;
+            json res = new json();
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //鍒ゆ柇鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log_second("Crm_CustomerFileList", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //瀹㈡埛鍒跺畾
+                string sErr = "";
+                if (oSystemParameter.ShowBill(ref sErr))
+                {
+                    if (oSystemParameter.omodel.WMS_CampanyName != "涔斾竴")
+                    { 
+                        sWhere += ("and 缁勭粐鍚嶇О = '" + Organization + "'");
+                    }
+                }
+
+
+                sWhere = sWhere.Replace("'", "''");
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("exec h_p_Gy_CustomerList " + page + "," + size + ",''", "h_p_Gy_CustomerList");
+                }
+                else
+                {
+                    ds = oCN.RunProcReturn("exec h_p_Gy_CustomerList " + page + "," + size + ",'" + sWhere + "'", "h_p_Gy_CustomerList");
+                }
+
+                //娣诲姞鍒楀悕
+                foreach (DataColumn col in ds.Tables[0].Columns)
+                {
+                    Type dataType = col.DataType;
+                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                }
+
+                res.code = CodeConstant.SUCCEED;
+                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
+                res.Message = "Sucess锛�";
+                res.list = columnNameList;
+                res.data = ds.Tables[0];
+                return res;
+            }
+            catch (Exception e)
+            {
+                res.code = CodeConstant.FAIL;
+                res.count = CountConstant.FAIL;
+                res.Message = "Exception锛�" + e.ToString();
+                res.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+
         #region 瀹㈡埛瀛愯〃[鍏宠仈鐢ㄦ埛] 鏌ヨ
         /// <summary>
         /// 杩斿洖瀹㈡埛瀛愯〃[鍏宠仈鐢ㄦ埛]鍒楄〃
@@ -162,6 +229,46 @@
                                             c.HTaxNum 绋庡姟鐧昏鍙�,c.HTaxRate 澧炲�肩◣鐜�,c.HEnglishName 鑻辨枃鍚嶇О,c.HEngLishAddress 鑻辨枃鍦板潃,c.HCountry 鍥藉,c.HCusStatus 瀹㈡埛鐘舵��
                                             ,c.HStopflag 绂佺敤鏍囧織,c.HRemark 澶囨敞,c.HAreaID 鍦板尯ID,a.HName 鍦板尯鍚嶇О,c.HCurID 榛樿璐у竵ID,r.HName 榛樿璐у竵,
                                             c.HSSID 缁撶畻鏂瑰紡ID,s.HName 缁撶畻鏂瑰紡,c.HCusTypeID 瀹㈡埛鍒嗙被ID,t.HName 瀹㈡埛鍒嗙被 from Gy_Customer c
+                                            left join Gy_AreaSet a on c.HAreaID=a.HItemID
+                                            left join Gy_Currency r on c.HCurID=r.HItemID 
+                                            left  join Gy_SettleStyle s on c.HSSID=s.HItemID
+                                            left  join Gy_CusType t on c.HCusTypeID=t.HItemID 
+                                            where c.HItemID='" + HInterID + "'");
+                ds = oCN.RunProcReturn(sql, "Gy_Customer");
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "";
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 瀹㈡埛鍒楄〃淇敼鎸夐挳鏂规硶娣诲姞瀹℃牳浜�
+        /// <summary>
+        /// 瀹㈡埛鍒楄〃淇敼鎸夐挳鏂规硶
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Gy_Customer/xg_extendCheckEmp")]
+        [HttpGet]
+        public object xg_extendCheckEmp(long HInterID)
+        {
+            try
+            {
+                string sql = string.Format(@"select  c.HItemID,c.HNumber 瀹㈡埛浠g爜,c.HName 瀹㈡埛鍚嶇О,c.HHelpCode  鍔╄鐮�,c.HShortName 绠�绉�,c.HAddress 鍦板潃,c.HLinkMan 鑱旂郴浜�,c.HLinkPhone 鑱旂郴鐢佃瘽
+                                            ,c.HMobilePhone 鎵嬫満,c.HFax 浼犵湡,c.HPostalCode 閭紪,c.HEmail 鐢靛瓙閭欢,c.HCorMan 娉曚汉浠h〃,c.HBank 寮�鎴烽摱琛�,c.HBankAccount 閾惰璐﹀彿,c.HMateOutEmp 棰嗙敤浜�,
+                                            c.HTaxNum 绋庡姟鐧昏鍙�,c.HTaxRate 澧炲�肩◣鐜�,c.HEnglishName 鑻辨枃鍚嶇О,c.HEngLishAddress 鑻辨枃鍦板潃,c.HCountry 鍥藉,c.HCusStatus 瀹㈡埛鐘舵��
+                                            ,c.HStopflag 绂佺敤鏍囧織,c.HRemark 澶囨敞,c.HAreaID 鍦板尯ID,a.HName 鍦板尯鍚嶇О,c.HCurID 榛樿璐у竵ID,r.HName 榛樿璐у竵,
+                                            c.HSSID 缁撶畻鏂瑰紡ID,s.HName 缁撶畻鏂瑰紡,c.HCusTypeID 瀹㈡埛鍒嗙被ID,t.HName 瀹㈡埛鍒嗙被, c.HCheckEmp 瀹℃牳浜� from Gy_Customer c
                                             left join Gy_AreaSet a on c.HAreaID=a.HItemID
                                             left join Gy_Currency r on c.HCurID=r.HItemID 
                                             left  join Gy_SettleStyle s on c.HSSID=s.HItemID
@@ -1318,6 +1425,56 @@
         }
         #endregion
 
+
+        // #region 瀹㈡埛鍒嗙被灞炴�х粨鏋� 鏍规嵁缁勭粐鍒嗙被
+        [Route("Gy_BadReason/Gy_CusTypeTreeListByOrganization")]
+        [HttpGet]
+        public object Gy_CusTypeTreeListByOrganization()
+        {   
+            try
+            {
+                string sql1 = string.Format("select hitemid,hnumber,hname,hparentid from Xt_ORGANIZATIONS where hstopflag != 1 order by hnumber");
+
+                ds = oCN.RunProcReturn(sql1, "Xt_ORGANIZATIONS");
+
+                List <TreeModel> treeModels = new List<TreeModel>();
+                TreeModel first = new TreeModel();
+                first.title = "浣跨敤缁勭粐";
+                first.id = "0";
+                treeModels.Add(first);
+
+                foreach (DataRow row in ds.Tables[0].Rows)
+                {
+                    int HParentID = (int)row["hparentid"];
+                    int HItemID = (int)row["hitemid"];
+                    //if(HParentID == 0 || HItemID == HParentID) // 鐖惰妭鐐逛负0鎴栬�呰嚜寮曠敤鐨勮缃负涓�绾у嚑鐐�
+                    //{
+                        TreeModel tree = new TreeModel();
+                        tree.id = row["hitemid"].ToString();
+                        tree.title = row["hname"].ToString();
+                        treeModels[0].children.Add(tree);
+                       
+                    //}
+                }
+                //getTreeByHItemID(ds.Tables[0], treeModels);
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = Newtonsoft.Json.JsonConvert.SerializeObject(treeModels);
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        // #endregion
+
         #region 鏍规嵁鐖秈d鍜岀瓑绾ц幏寰楁爲鐘跺浘閫掑綊
 
         [Route("Gy_BadReason/Gy_CusTypeTreeListByLevel")]
@@ -1367,41 +1524,41 @@
         #endregion
 
         #region 瀹㈡埛鍒楄〃 鏂囦欢涓婁紶
-        [Route("Gy_Customer/Gy_Process_Excel")]
-        [HttpPost]
-        public json Gy_Department_Excel()
-        {
-            json res = new json();
-            try
-            {
-                //鑾峰彇鏂囦欢鍚嶇О
-                var file = HttpContext.Current.Request.Files[0];
-                //鑾峰彇鏂囦欢鐗╃悊璺緞
-                string ExcelPath = HttpContext.Current.Server.MapPath("~/" + file.FileName);
-                //淇濆瓨鏂囦欢
-                file.SaveAs(ExcelPath);
+        //[Route("Gy_Customer/Gy_Process_Excel")]
+        //[HttpPost]
+        //public json Gy_Department_Excel()
+        //{
+        //    json res = new json();
+        //    try
+        //    {
+        //        //鑾峰彇鏂囦欢鍚嶇О
+        //        var file = HttpContext.Current.Request.Files[0];
+        //        //鑾峰彇鏂囦欢鐗╃悊璺緞
+        //        string ExcelPath = HttpContext.Current.Server.MapPath("~/" + file.FileName);
+        //        //淇濆瓨鏂囦欢
+        //        file.SaveAs(ExcelPath);
 
-                NpoiHelper np = new NpoiHelper();
-                DataSet ExcelDs = np.ReadExcel(ExcelPath, 1, 1, "0");
-                //鍒犻櫎鏂囦欢
-                File.Delete(ExcelPath);
-                DataTable provisional = customerService.UploadExcel(ExcelDs);             
+        //        NpoiHelper np = new NpoiHelper();
+        //        DataSet ExcelDs = np.ReadExcel(ExcelPath, 1, 1, "0");
+        //        //鍒犻櫎鏂囦欢
+        //        File.Delete(ExcelPath);
+        //        DataTable provisional = customerService.UploadExcel(ExcelDs);             
                 
-                res.code = CodeConstant.SUCCEED;
-                res.count = CountConstant.SUCCEED;
-                res.Message = "涓婁紶鎴愬姛";
-                res.data = provisional;
-                return res;
-            }
-            catch (Exception e)
-            {
-                res.code = "0";
-                res.count = 0;
-                res.Message = "Exception锛�" + e.ToString();
-                res.data = null;
-                return res;
-            }
-        }
+        //        res.code = CodeConstant.SUCCEED;
+        //        res.count = CountConstant.SUCCEED;
+        //        res.Message = "涓婁紶鎴愬姛";
+        //        res.data = provisional;
+        //        return res;
+        //    }
+        //    catch (Exception e)
+        //    {
+        //        res.code = "0";
+        //        res.count = 0;
+        //        res.Message = "Exception锛�" + e.ToString();
+        //        res.data = null;
+        //        return res;
+        //    }
+        //}
 
         /// <summary>
         /// 鍒ゆ柇褰撳墠鑱屽憳鏄惁瀛樺湪
@@ -1409,15 +1566,15 @@
         /// <param name="HEmpNumber"></param>
         /// <param name="HEmpName"></param>
         /// <returns></returns>
-        private bool JudgeEmp(string HEmpNumber, string HEmpName)
-        {
-            if (!String.IsNullOrEmpty(HEmpNumber) && !String.IsNullOrEmpty(HEmpName))
-            {
-                DataSet emp = oCN.RunProcReturn("select * from Gy_Employee where HNumber = '" + HEmpNumber + "' and HName = '" + HEmpName + "'", "Gy_Employee");
-                return emp.Tables[0].Rows.Count <= EmptyConstant.EMPTY ? true : false;
-            }
-            return false;
-        }
+        //private bool JudgeEmp(string HEmpNumber, string HEmpName)
+        //{
+        //    if (!String.IsNullOrEmpty(HEmpNumber) && !String.IsNullOrEmpty(HEmpName))
+        //    {
+        //        DataSet emp = oCN.RunProcReturn("select * from Gy_Employee where HNumber = '" + HEmpNumber + "' and HName = '" + HEmpName + "'", "Gy_Employee");
+        //        return emp.Tables[0].Rows.Count <= EmptyConstant.EMPTY ? true : false;
+        //    }
+        //    return false;
+        //}
 
         /// <summary>
         /// 鍒ゆ柇鍒�
@@ -1472,6 +1629,31 @@
 
         #endregion
 
+        public void getTreeByHItemID(DataTable dt, List<TreeModel> tree)
+        {
+            for (int m = 0; m < tree.Count; m++)
+            {
+                tree[m].children = new List<TreeModel>();
+                for (int i = 0; i < dt.Rows.Count; i++)//绗竴娆″惊鐜紝寰楀埌鎵�鏈夋牴鑺傜偣鐨勫瓙闆�
+                {
+                    var HParentID = dt.Rows[i]["hparentid"].ToString();
+                    var HItemID = dt.Rows[i]["hitemid"].ToString();
+                    if (HParentID == tree[m].id && HParentID != HItemID)
+                    {
+                        TreeModel tbjson = new TreeModel();
+                        tbjson.id = dt.Rows[i]["hitemid"].ToString();
+                        tbjson.title = dt.Rows[i]["hname"].ToString();
+                        tree[m].children.Add(tbjson);
+                    }
+                }
+
+                for (int i = 0; i < tree[m].children.Count; i++)
+                {
+                    getTreeByHItemID(dt, tree[m].children);//鍐嶆鐢ㄥ瓙闆嗗幓寰幆锛屾嬁鍑哄瓙闆嗙殑瀛愰泦
+                }
+            }
+        }
+
         #region 閫掑綊鍑芥暟
         /// <summary>
         /// 閫掑綊鍑芥暟

--
Gitblit v1.9.1