Browse Source

[WHAT] 修正展覽英文&簡稱API,提升展覽API效能

Dev
berlin-tzen 2 years ago
parent
commit
438654358b
  1. 52
      EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibMaintain_QryService.cs
  2. 2
      EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibitionService.cs

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

@ -767,6 +767,46 @@ namespace EasyBL.WEBAPP.SYS
#endregion 展覽管理(Dictionary 以ID查詢所有展覽)
#region 展覽管理(List 查詢所有展覽)
public List<View_CMS_Exhibition> FindAllByIDsAsList()
{
var db = SugarBase.GetIntance();
string sMsg = null;
List<View_CMS_Exhibition> saDataList = new List<View_CMS_Exhibition>();
try
{
do
{
saDataList = db.Queryable<SETB_CMS_Exhibition>()
.Where(t1 => t1.Effective == "Y")
.Where(t1 => t1.DelStatus == "N")
.Select(t1 => new View_CMS_Exhibition
{
ExhibitionID = SqlFunc.GetSelfAndAutoFill(t1.ExhibitionID),
})
.ToList();
return saDataList;
} while (false);
}
catch (Exception ex)
{
sMsg = Util.GetLastExceptionMsg(ex);
}
return saDataList;
}
#endregion 展覽管理(List 查詢所有展覽)
#region 展覽管理(List 查詢所有展覽列表卡片)
public List<ExhibitionCardDTO> QueryExhibitionCard(
string sLanguageID,
@ -845,9 +885,6 @@ namespace EasyBL.WEBAPP.SYS
if (sSortType == "ShowDate")
{
var CurrentDate = DateTime.Now;
System.Diagnostics.Debug.WriteLine(CurrentDate);
Cards = Cards.OrderByDescending(o => (o.StartDate - DateTime.Now)).ToList();
}
@ -1368,16 +1405,15 @@ namespace EasyBL.WEBAPP.SYS
Dictionary<string, ExhibitionDTO> rsResult = new Dictionary<string, ExhibitionDTO>();
var ExhibitionDic = FindAllByIDsAsDictionary("");
var AllExhibitionList = FindAllByIDsAsList();
var ExhibitionList = ExhibitionDic.Values.Where(w => w.LanguageID == sLanguageID).ToList();
var ExhibitionEngList = ExhibitionDic.Values.Where(w => w.LanguageID == WebAppGlobalConstWord.EN_US).ToList();
var ExhibitionList = AllExhibitionList.Where(w => w.LanguageID == sLanguageID).ToList();
var ExhibitionENList = AllExhibitionList.Where(w => w.LanguageID == WebAppGlobalConstWord.EN_US).ToList();
ExhibInfoMaintain_QryService eim_qry = new ExhibInfoMaintain_QryService();
var ExhibInfoDic = eim_qry.FindAllByIDsAsDictionary(sLanguageID, "");
var LocationDic = eim_qry.FindAllLocationByIDsAsDictionary(sLanguageID, "", "");
//System.Diagnostics.Debug.WriteLine("=====Start=====");
//System.Diagnostics.Stopwatch sw = new Stopwatch();
//sw.Start();
@ -1417,7 +1453,7 @@ namespace EasyBL.WEBAPP.SYS
string sENName = null;
var EngExhibition = ExhibitionDic.Values.Where(w => w.LanguageID == WebAppGlobalConstWord.EN_US).FirstOrDefault();
var EngExhibition = ExhibitionENList.Where(w => w.ExhibitionID == Exhibition.ExhibitionID).FirstOrDefault();
if (EngExhibition != null) {
sENName = EngExhibition.ExhibitionName;

2
EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibitionService.cs

@ -418,8 +418,6 @@ namespace EasyBL.WEBAPP.SYS
rsResult = rsResult.Skip(iPageSize * (iPageIndex - 1)).Take(iPageSize).ToList();
System.Diagnostics.Debug.WriteLine("Cards.Count" + ": " + rsResult.Count);
pml.DataList = rsResult.ToList();
//返回token信息

Loading…
Cancel
Save