| | |
| | | using Kingdee.BOS.Core.Metadata; |
| | | using Kingdee.K3.MFG.ServiceHelper; |
| | | using Kingdee.BOS; |
| | | using ZD.Cloud.Logger; |
| | | |
| | | namespace Demo.BillView.PRD |
| | | { |
| | |
| | | { |
| | | 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; |
| | | } |