duhe
2025-03-14 573b883f435f32ec2be4dc1ab5d97ac8549c0c90
WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs
@@ -3290,6 +3290,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
    }
}