From 86832da446de8d26ed5bdc04532d85a8b51730b4 Mon Sep 17 00:00:00 2001 From: berlin-tzen Date: Thu, 9 Feb 2023 15:33:18 +0800 Subject: [PATCH] =?UTF-8?q?[WHAT]=20=E5=A2=9E=E5=8A=A0CategoryExhibition?= =?UTF-8?q?=20=E6=90=9C=E5=B0=8B=E6=A2=9D=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ShowEasy/ExhibMaintain_QryService.cs | 10 +++++++++- .../EasyBL.WEBAPP/ShowEasy/ExhibitionService.cs | 4 ++-- .../WebApp/Controllers/ExhibitionController.cs | 16 ++++++++++++++-- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibMaintain_QryService.cs b/EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibMaintain_QryService.cs index a8a7155..f5ec2a1 100644 --- a/EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibMaintain_QryService.cs +++ b/EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibMaintain_QryService.cs @@ -1472,7 +1472,7 @@ namespace EasyBL.WEBAPP.SYS } - public List QueryCategoryExhibition(string sLanguageID) { + public List QueryCategoryExhibition(string sLanguageID, List IncludeCountryIDs, List ExcludeCountryIDs) { Dictionary rsResult = new Dictionary(); @@ -1482,6 +1482,14 @@ namespace EasyBL.WEBAPP.SYS var rsExhibitionList = QueryAllDetailExhibitionAsDictionary(sLanguageID).Values.Where(w => w.MainCategories.Count > 0); + if (IncludeCountryIDs.Count > 0) { + rsExhibitionList = rsExhibitionList.Where(w => IncludeCountryIDs.Contains(w.Country.CountryID)); + } + + if (ExcludeCountryIDs.Count > 0) { + rsExhibitionList = rsExhibitionList.Where(w => !ExcludeCountryIDs.Contains(w.Country.CountryID)); + } + foreach (var Exhibition in rsExhibitionList) { List MainCategoryList = Exhibition.MainCategories; diff --git a/EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibitionService.cs b/EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibitionService.cs index 1125589..b4fb110 100644 --- a/EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibitionService.cs +++ b/EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibitionService.cs @@ -511,7 +511,7 @@ namespace EasyBL.WEBAPP.SYS return HttpResponseExtension.ToJson(JsonConvert.SerializeObject(srm)); } - public HttpResponseMessage GetCategoryExhibition(string sLanguageID) { + public HttpResponseMessage GetCategoryExhibition(string sLanguageID, List IncludeCountryIDs, List ExcludeCountryIDs) { SuccessResponseMessage srm = null; string sError = null; @@ -526,7 +526,7 @@ namespace EasyBL.WEBAPP.SYS } ExhibMaintain_QryService em_qry = new ExhibMaintain_QryService(); - var rsResult = em_qry.QueryCategoryExhibition(sLanguageID); + var rsResult = em_qry.QueryCategoryExhibition(sLanguageID, IncludeCountryIDs, ExcludeCountryIDs); //返回token信息 srm = new SuccessResponseMessage(null, null); diff --git a/EuroTran/WebApp/Controllers/ExhibitionController.cs b/EuroTran/WebApp/Controllers/ExhibitionController.cs index 0d0a8a8..68d0692 100644 --- a/EuroTran/WebApp/Controllers/ExhibitionController.cs +++ b/EuroTran/WebApp/Controllers/ExhibitionController.cs @@ -216,10 +216,22 @@ namespace WebApp.Controllers } [HttpGet] - public HttpResponseMessage CategoryExhibition(string Lang) + public HttpResponseMessage CategoryExhibition(string Lang, string IncludeCountryIDs, string ExcludeCountryIDs) { - return new ExhibitionService().GetCategoryExhibition(Lang); + List rsIncludeCountryIDs = new List(); + List rsExcludeCountryIDs = new List(); + + if (!string.IsNullOrEmpty(IncludeCountryIDs)) { + rsIncludeCountryIDs = JsonConvert.DeserializeObject>(IncludeCountryIDs); + } + + if (!string.IsNullOrEmpty(ExcludeCountryIDs)) + { + rsExcludeCountryIDs = JsonConvert.DeserializeObject>(ExcludeCountryIDs); + } + + return new ExhibitionService().GetCategoryExhibition(Lang, rsIncludeCountryIDs, rsExcludeCountryIDs); }