diff --git a/BBWYB.Server.API/Controllers/VenderController.cs b/BBWYB.Server.API/Controllers/VenderController.cs
index d2d296c..df3a8e3 100644
--- a/BBWYB.Server.API/Controllers/VenderController.cs
+++ b/BBWYB.Server.API/Controllers/VenderController.cs
@@ -29,14 +29,14 @@ namespace BBWYB.Server.API.Controllers
}
///
- /// 获取店铺下的采购账号
+ /// 查询采购账号列表
///
- ///
+ ///
///
- [HttpGet]
- public IList GetPurchaserListByShopId([FromBody]long shopId)
+ [HttpPost]
+ public IList GetPurchaserListByShopId([FromBody] QueryPurchaseAccountRequest request)
{
- return venderBusiness.GetPurchaserListByShopId(shopId);
+ return venderBusiness.GetPurchaserListByShopId(request);
}
diff --git a/BBWYB.Server.Business/Vender/VenderBusiness.cs b/BBWYB.Server.Business/Vender/VenderBusiness.cs
index f8b5822..13c71d3 100644
--- a/BBWYB.Server.Business/Vender/VenderBusiness.cs
+++ b/BBWYB.Server.Business/Vender/VenderBusiness.cs
@@ -81,11 +81,16 @@ namespace BBWYB.Server.Business
return shopSettingRequest.PurchaseAccountId;
}
- public IList GetPurchaserListByShopId(long shopId)
+ public IList GetPurchaserListByShopId(QueryPurchaseAccountRequest request)
{
- var shopIdStr = shopId.ToString();
+ var purchasePlatofrmId = request.PurchasePlatofrmId != null ? ((int)request.PurchasePlatofrmId).ToString() : string.Empty;
+ var shopIdStr = request.ShopId.ToString();
var mdsShop = fsqlManager.MDSfsql.Select().Where(s => s.ShopId == shopIdStr).ToOne();
- var plist = fsqlManager.MDSfsql.Select().Where(pa => pa.ShopId == mdsShop.Id).ToList();
+ var plist = fsqlManager.MDSfsql.Select()
+ .Where(pa => pa.ShopId == mdsShop.Id)
+ .WhereIf(!string.IsNullOrEmpty(purchasePlatofrmId), pa => pa.PurchasePlatformId == purchasePlatofrmId)
+ .WhereIf(!string.IsNullOrEmpty(request.AccountName), pa => pa.AccountName == request.AccountName)
+ .ToList();
foreach (var pa in plist)
pa.ShopId = shopIdStr;
return plist;
diff --git a/BBWYB.Server.Model/Dto/Request/Vender/QueryPurchaseAccountRequest.cs b/BBWYB.Server.Model/Dto/Request/Vender/QueryPurchaseAccountRequest.cs
new file mode 100644
index 0000000..72fb4c6
--- /dev/null
+++ b/BBWYB.Server.Model/Dto/Request/Vender/QueryPurchaseAccountRequest.cs
@@ -0,0 +1,14 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace BBWYB.Server.Model.Dto
+{
+ public class QueryPurchaseAccountRequest
+ {
+ [Required]
+ public long ShopId { get; set; }
+
+ public Enums.Platform? PurchasePlatofrmId { get; set; }
+
+ public string AccountName { get; set;}
+ }
+}
diff --git a/BBWYB.Server.Model/Dto/Request/Vender/ShopSettingRequest.cs b/BBWYB.Server.Model/Dto/Request/Vender/ShopSettingRequest.cs
index 96bf413..71a6f1e 100644
--- a/BBWYB.Server.Model/Dto/Request/Vender/ShopSettingRequest.cs
+++ b/BBWYB.Server.Model/Dto/Request/Vender/ShopSettingRequest.cs
@@ -10,17 +10,29 @@
public long PurchaseAccountId { get; set; }
+ ///
+ /// 采购账号AccountName
+ ///
public string AccountName { get; set; }
-
+ ///
+ /// 采购账号AppKey
+ ///
public string AppKey { get; set; }
-
+ ///
+ /// 采购账号AppSecret
+ ///
public string AppSecret { get; set; }
-
+ ///
+ /// 采购账号Token
+ ///
public string AppToken { get; set; }
+ ///
+ /// 采购平台
+ ///
public Enums.Platform PurchasePlatformId { get; set; }
}
}