From 5466e02176f2acf2f08ef1c16315c3185bae903f Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期一, 19 五月 2025 15:53:34 +0800
Subject: [PATCH] 异常反馈单,快捷开工接口调整

---
 WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs |   81 ++++++++++++++++++++++++++++++++++------
 1 files changed, 68 insertions(+), 13 deletions(-)

diff --git a/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs b/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs
index 7654825..b5e58ab 100644
--- a/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs
+++ b/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs
@@ -44,12 +44,25 @@
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
-                //鍒ゆ柇鏄惁鏈夐噰璐粡鐞嗘潈闄愶紙瀹夌憺锛�
-                bool isCgjl = Security_Log("Cg_POOrderBill_PurchasManager", 1, true, user);
-                if (!isCgjl)
+
+                string sErr = "";
+                if (oSystemParameter.ShowBill(ref sErr))
                 {
-                    sWhere += $" and HEmpID in (select HEmpID from Gy_Czygl where Czymc='{user}' and HEmpID >0  )";
+                    if (oSystemParameter.omodel.WMS_CampanyName == "涔斾竴")
+                    {
+
+                    }
+                    else
+                    {
+                        //鍒ゆ柇鏄惁鏈夐噰璐粡鐞嗘潈闄愶紙瀹夌憺锛�
+                        bool isCgjl = Security_Log("Cg_POOrderBill_PurchasManager", 1, true, user);
+                        if (!isCgjl)
+                        {
+                            sWhere += $" and HEmpID in (select HEmpID from Gy_Czygl where Czymc='{user}' and HEmpID >0  )";
+                        }
+                    }
                 }
+                
 
 
                 sWhere = sWhere.Replace("'", "''");
@@ -1042,14 +1055,14 @@
                 long HBUYERWITHHOLDING = DetailColl2[i].HBUYERWITHHOLDING;//涔版柟浠f墸浠g即
                 string HMATERIALDESC = DetailColl2[i].HMATERIALDESC == null ? "''" : DetailColl2[i].HMATERIALDESC; //鐗╂枡璇存槑
                 i++;
-                if (oSub.HQty <= 0 || oSub.HQty == 0)
-                {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "绗�" + i + "琛岋紝鏁伴噺涓嶈兘涓�0鎴栬�呭皬浜�0";
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
+                //if (oSub.HQty <= 0 || oSub.HQty == 0)
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "绗�" + i + "琛岋紝鏁伴噺涓嶈兘涓�0鎴栬�呭皬浜�0";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
 
                 if (oSub.HMaterID == 0)
                 {
@@ -1374,9 +1387,11 @@
         {
             SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
 
-            string sql = "select a.HItemID HMaterID,a.HNumber HMaterNumber,a.HName HMaterName,a.HMaterRuleType,a.HModel HMaterModel,a.HUnitID, b.HNumber HUnitNumber, b.HName HUnitName" +
+            string sql = "select a.HItemID HMaterID,a.HNumber HMaterNumber,a.HName HMaterName,a.HMaterRuleType,a.HModel HMaterModel,a.HUnitID, b.HNumber HUnitNumber, b.HName HUnitName,a.HWHID,w.HName 榛樿浠撳簱,a.HPOUnitID,u.HName HPOUnitName " +
                 " from Gy_Material AS a " +
                 " LEFT OUTER JOIN Gy_Unit AS b on a.HUnitID = b.HItemID " +
+                " left outer join Gy_Warehouse as w on a.HWHID = w.HItemID " +
+                " left outer join Gy_Unit As u on a.HPOUnitID = u.HItemID" +
                 " where a.HItemID =" + HMaterID;
 
             var dataSet = oCN.RunProcReturn(sql, "Gy_Material");
@@ -3277,6 +3292,46 @@
         }
         #endregion
 
+
+        #region 閲囪喘璁㈠崟 鏍规嵁鐢ㄦ埛鑾峰彇鐢ㄦ埛鍏宠仈渚涘簲鍟嗚繃婊ゆ潯浠�
+        [Route("Cg_POOrderBill/getSupIDListByUser")]
+        [HttpGet]
+        public object getSupIDListByUser(string CurUserID, string CurUserName)
+        {
+            string sWhere = "";
+            string ModRightNameCheck = "Gy_UserLookAllSup";
+            DBUtility.ClsPub.CurUserName = CurUserName;
+            try
+            {
+                //鏉冮檺鍒ゆ柇锛氭槸鍚﹀彲浠ユ煡鐪嬫墍鏈変緵搴斿晢
+                if (DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName))
+                {
+                    sWhere = "";
+                }
+                else
+                {
+                    sWhere = " and HSupID in (select HSupID from Gy_UserSupplierRelation Where HUserID = '" + CurUserID + "')";
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = sWhere;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                sWhere = " and 1=0 ";
+
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = sWhere;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
     }
 
 }
\ No newline at end of file

--
Gitblit v1.9.1