王 垚
2021-04-19 e7b25b1c1d8d3310aa5deae5f72a3e0cc36c6fc2
src/BLL/Demo.BillView/PRD/PODemandPlanListFilter.cs
@@ -21,6 +21,7 @@
using Kingdee.BOS.Core.Metadata;
using Kingdee.K3.MFG.ServiceHelper;
using Kingdee.BOS;
using ZD.Cloud.Logger;
namespace Demo.BillView.PRD
{
@@ -37,19 +38,20 @@
            {
                int FSupplierId = GetSupplierId();
                if (FSupplierId > 0)
                    e.FilterString = " FSUPPLIERID IN (102629)";
                    e.FilterString = $" FSUPPLIERID IN ({FSupplierId})";
            }
            else
            {
                int FSupplierId = GetSupplierId();
                if (FSupplierId > 0)
                    e.FilterString += " AND FSUPPLIERID IN (102629)";
                    e.FilterString += $" AND FSUPPLIERID IN (FSupplierId)";
            }
        }
        public int GetSupplierId()
        {
            long userId = this.Context.UserId;
            string sql = $"/*dialect*/ select FSupplierId from T_SEC_user a join T_SCP_USERDATA b on a.FUSERID = b.FUSERID where FUSERTYPE = 2 and a.FUSERID ={userId}";
            LogHelper.Info(sql);
            int FSupplierId = DBServiceHelper.ExecuteScalar<int>(Context, sql, 0);
            return FSupplierId;
        }