Browse Source

[WHAT] 增加CategoryExhibition 搜尋條件

Dev
berlin-tzen 2 years ago
parent
commit
86832da446
  1. 10
      EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibMaintain_QryService.cs
  2. 4
      EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibitionService.cs
  3. 16
      EuroTran/WebApp/Controllers/ExhibitionController.cs

10
EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibMaintain_QryService.cs

@ -1472,7 +1472,7 @@ namespace EasyBL.WEBAPP.SYS
}
public List<CategoryExhibitionDTO> QueryCategoryExhibition(string sLanguageID) {
public List<CategoryExhibitionDTO> QueryCategoryExhibition(string sLanguageID, List<string> IncludeCountryIDs, List<string> ExcludeCountryIDs) {
Dictionary<string, CategoryExhibitionDTO> rsResult = new Dictionary<string, CategoryExhibitionDTO>();
@ -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<CategoryDTO> MainCategoryList = Exhibition.MainCategories;

4
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<string> IncludeCountryIDs, List<string> 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);

16
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<string> rsIncludeCountryIDs = new List<string>();
List<string> rsExcludeCountryIDs = new List<string>();
if (!string.IsNullOrEmpty(IncludeCountryIDs)) {
rsIncludeCountryIDs = JsonConvert.DeserializeObject<List<string>>(IncludeCountryIDs);
}
if (!string.IsNullOrEmpty(ExcludeCountryIDs))
{
rsExcludeCountryIDs = JsonConvert.DeserializeObject<List<string>>(ExcludeCountryIDs);
}
return new ExhibitionService().GetCategoryExhibition(Lang, rsIncludeCountryIDs, rsExcludeCountryIDs);
}

Loading…
Cancel
Save