Browse Source

[WHAT] 會員展覽收藏列表API,會員展覽收藏國家API

Dev
berlin-tzen 2 years ago
parent
commit
261401596a
  1. 73
      EuroTran/EasyBL.WEBAPP/ShowEasy/FavoriteMaintain_QryService.cs
  2. 34
      EuroTran/EasyBL.WEBAPP/ShowEasy/FavoriteService.cs
  3. 13
      EuroTran/WebApp/Controllers/FavoriteController.cs

73
EuroTran/EasyBL.WEBAPP/ShowEasy/FavoriteMaintain_QryService.cs

@ -124,40 +124,56 @@ namespace EasyBL.WEBAPP.SYS
}
#region 收藏管理(List 查詢收藏展覽列表)
public Dictionary<string, ExhibitionDTO> FindFavoriateExhibitionByIDsAsDictionary(string sLanguageID, string sAccount) {
/// <summary>
/// 收藏管理(List 查詢收藏展覽列表)
/// </summary>
/// <param name="i_crm"></param>
/// <returns></returns>
///
public Dictionary<string, ExhibitionCardDTO> QueryFavoriteExhibition(string sLanguageID, string sAccount, List<string> SubCategoryIDList, List<string> CountryIDList, List<string> StatusList)
{
var rsExhibitionDic = new Dictionary<string, ExhibitionDTO>();
if (string.IsNullOrEmpty(sLanguageID)) {
sLanguageID = WebAppGlobalConstWord.DEFAULT_LANGUAGE;
}
var rsExhibitionList = new List<ExhibitionDTO>();
var rsExhibitionCardDic = new Dictionary<string, ExhibitionCardDTO>();
var FavoriateDic = FindAllByIDsAsDictionary(sAccount, "Exhibition");
ExhibMaintain_QryService em_qry = new ExhibMaintain_QryService();
var ExhibitionDic = em_qry.QueryAllDetailExhibitionAsDictionary(sLanguageID);
foreach (var Favoriate in FavoriateDic.Values) {
if (ExhibitionDic.ContainsKey(Favoriate.ParentID)) {
foreach (var Favoriate in FavoriateDic.Values)
{
if (ExhibitionDic.ContainsKey(Favoriate.ParentID))
{
var Exhibition = ExhibitionDic[Favoriate.ParentID];
rsExhibitionList.Add(Exhibition);
rsExhibitionDic[Exhibition.ExhibitionID] = Exhibition;
}
}
return rsExhibitionDic;
}
#region 收藏管理(Dictionary 查詢收藏展覽列表)
/// <summary>
/// 收藏管理(Dictionary 查詢收藏展覽列表)
/// </summary>
/// <param name="i_crm"></param>
/// <returns></returns>
///
public Dictionary<string, ExhibitionCardDTO> QueryFavoriteExhibition(string sLanguageID, string sAccount, List<string> SubCategoryIDList, List<string> CountryIDList, List<string> StatusList)
{
if (string.IsNullOrEmpty(sLanguageID)) {
sLanguageID = WebAppGlobalConstWord.DEFAULT_LANGUAGE;
}
var rsExhibitionList = FindFavoriateExhibitionByIDsAsDictionary(sLanguageID, sAccount).Values.ToList();
var rsExhibitionCardDic = new Dictionary<string, ExhibitionCardDTO>();
ExhibMaintain_QryService em_qry = new ExhibMaintain_QryService();
if (SubCategoryIDList.Count > 0) {
rsExhibitionList = em_qry.FilterBySubCategoryIDs(rsExhibitionList, SubCategoryIDList);
}
@ -182,7 +198,30 @@ namespace EasyBL.WEBAPP.SYS
}
#endregion 收藏管理(List 查詢收藏展覽列表)
#endregion 收藏管理(Dictionary 查詢收藏展覽列表)
public Dictionary<string, CountryDTO> QueryExhibitionCountryList(string sLanguageID, string sAccount) {
var rsCountryDic = new Dictionary<string, CountryDTO>();
if (string.IsNullOrEmpty(sLanguageID))
{
sLanguageID = WebAppGlobalConstWord.DEFAULT_LANGUAGE;
}
var rsExhibitionList = FindFavoriateExhibitionByIDsAsDictionary(sLanguageID, sAccount).Values.ToList();
foreach (var Exhibition in rsExhibitionList) {
if (!string.IsNullOrEmpty(Exhibition.Country.CountryID)) {
rsCountryDic[Exhibition.Country.CountryID] = Exhibition.Country;
}
}
return rsCountryDic;
}

34
EuroTran/EasyBL.WEBAPP/ShowEasy/FavoriteService.cs

@ -1,4 +1,5 @@

using DocumentFormat.OpenXml.Wordprocessing;
using EasyBL.WebApi;
using EasyBL.WebApi.Common;
using EasyBL.WebApi.Message;
@ -185,8 +186,41 @@ namespace EasyBL.WEBAPP.SYS
#endregion 收藏管理(HttpResponseMessage API 分頁查詢收藏展覽列表)
public HttpResponseMessage GetExhibitionCountryList(string sLanguageID, string sAccount) {
SuccessResponseMessage srm = null;
string sError = null;
try
{
do
{
FavoriteMaintain_QryService fm_qry = new FavoriteMaintain_QryService();
var rsResult = fm_qry.QueryExhibitionCountryList(sLanguageID, sAccount).Values.ToList();
//返回token信息
srm = new SuccessResponseMessage(null, null);
srm.DATA.Add(BLWording.REL, rsResult);
} while (false);
}
catch (Exception ex)
{
sError = Util.GetLastExceptionMsg(ex);
srm = new SuccessResponseMessage(null, null)
{
STATUSCODE = (int)StatusCodeEnum.Error,
MSG = StatusCodeEnum.Error.GetEnumText()
};
srm.DATA.Add(BLWording.REL, "");
}
return HttpResponseExtension.ToJson(JsonConvert.SerializeObject(srm));
}
private List<FavoriteDTO> FavoriteEntityToDTO(Object Data)
{

13
EuroTran/WebApp/Controllers/FavoriteController.cs

@ -93,5 +93,18 @@ namespace WebApp.Controllers
return new FavoriteService().GetFavoriteExhibition(Lang, sAccount, PageIndex, PageSize, rsSubCategoryIDList, rsCountryIDList, rsStatusList);
}
[HttpGet]
[SEApiSecurityFilter]
public HttpResponseMessage ExhibitionCountryList(string Lang)
{
// get authtoken
var SEToken = SETokenUtil.GetToken(this.Request);
var sAccount = SEToken.Email;
return new FavoriteService().GetExhibitionCountryList(Lang, sAccount);
}
}
}
Loading…
Cancel
Save