diff --git a/Projects/WebClient/Web.Operation/Components/Pages/CPMeta.razor b/Projects/WebClient/Web.Operation/Components/Pages/CPMeta.razor
index 28dd133..98823c1 100644
--- a/Projects/WebClient/Web.Operation/Components/Pages/CPMeta.razor
+++ b/Projects/WebClient/Web.Operation/Components/Pages/CPMeta.razor
@@ -13,7 +13,10 @@
-
+
+
+
+
@@ -47,9 +50,10 @@
@code {
private string ServerAddress = "192.168.0.126:9000";
+ private string ShardID = "1";
private string SearchProductID = string.Empty;
private string SearchProductMacAddress = string.Empty;
-
+
Response_GetWbmsMeta response = new Response_GetWbmsMeta();
protected override async Task OnInitializedAsync()
@@ -60,8 +64,12 @@
private async Task SearchByProductID()
{
PopupService.OpenIndicator("");
- if (string.IsNullOrEmpty(SearchProductID) == false)
- response = await _cpMetaService.GetWbmsMetaByProductID(SearchProductID, ServerAddress);
+
+ if(Int32.TryParse(ShardID, out var outValue))
+ {
+ if (string.IsNullOrEmpty(SearchProductID) == false)
+ response = await _cpMetaService.GetWbmsMetaByProductID(SearchProductID, ServerAddress, outValue);
+ }
await Task.Delay(300);
PopupService.CloseIndicator();
@@ -70,8 +78,12 @@
private async Task SearchByMacAddress()
{
PopupService.OpenIndicator("");
- if (string.IsNullOrEmpty(SearchProductMacAddress) == false)
- response = await _cpMetaService.GetWbmsMetaByMacAddress(SearchProductMacAddress, ServerAddress);
+
+ if (Int32.TryParse(ShardID, out var outValue))
+ {
+ if (string.IsNullOrEmpty(SearchProductMacAddress) == false)
+ response = await _cpMetaService.GetWbmsMetaByMacAddress(SearchProductMacAddress, ServerAddress, outValue);
+ }
await Task.Delay(300);
PopupService.CloseIndicator();
diff --git a/Projects/WebClient/Web.Operation/Services/CPMetaService.cs b/Projects/WebClient/Web.Operation/Services/CPMetaService.cs
index b0bc95c..6018c03 100644
--- a/Projects/WebClient/Web.Operation/Services/CPMetaService.cs
+++ b/Projects/WebClient/Web.Operation/Services/CPMetaService.cs
@@ -22,12 +22,12 @@ namespace Web.Operation.Services
ApiHost = _configService.GetConfig()?.Api.Find(x => x.Id == 1)?.Host;
}
- public async Task GetWbmsMeta(DateOnly? startDate, DateOnly? endDate, string host)
+ public async Task GetWbmsMeta(DateOnly? startDate, DateOnly? endDate, string host, int shardID = 1)
{
string requestUrl = $"https://{host}/CPMeta/GetWbmsMeta?";
requestUrl += $"startDate={startDate}&";
requestUrl += $"endDate={endDate}&";
- requestUrl += $"ShardID=1";
+ requestUrl += $"ShardID={shardID}";
Http http = new Http();
var res = await http.GetJsonAsync($"{requestUrl}");
@@ -37,11 +37,11 @@ namespace Web.Operation.Services
return res;
}
- public async Task GetWbmsMetaByProductID(string productId, string host)
+ public async Task GetWbmsMetaByProductID(string productId, string host, int shardID = 1)
{
string requestUrl = $"https://{host}/CPMeta/GetWbmsMetaByProductID?";
requestUrl += $"ProductID={productId}&";
- requestUrl += $"ShardID=1";
+ requestUrl += $"ShardID={shardID}";
Http http = new Http();
var res = await http.GetJsonAsync($"{requestUrl}");
@@ -51,11 +51,11 @@ namespace Web.Operation.Services
return res;
}
- public async Task GetWbmsMetaByMacAddress(string macAddress, string host)
+ public async Task GetWbmsMetaByMacAddress(string macAddress, string host, int shardID = 1)
{
string requestUrl = $"https://{host}/CPMeta/GetWbmsMetaByMacAddress?";
requestUrl += $"MacAddress={macAddress}&";
- requestUrl += $"ShardID=1";
+ requestUrl += $"ShardID={shardID}";
Http http = new Http();
var res = await http.GetJsonAsync($"{requestUrl}");