123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Net;
- using System.Net.Http;
- using System.Web.Http;
- using Lottomat.Application.Busines.InformationManage;
- using Lottomat.Application.Busines.SystemManage;
- using Lottomat.Application.Cache;
- using Lottomat.Application.Code;
- using Lottomat.Application.Entity.PublicInfoManage;
- using Lottomat.Application.Entity.SystemManage;
- using Lottomat.Application.Entity.ViewModel.ConsultationMangerModel;
- using Lottomat.Application.Entity.ViewModel.TrendChartModel;
- using Lottomat.SOA.API.Controllers.Base;
- using Lottomat.Util.Extension;
- using Lottomat.Util.WebControl;
- using Lottomat.Application.Entity.CommonEntity;
- using Lottomat.Application.Entity.InformationManage;
- using Lottomat.Application.Entity.SystemManage.ViewModel;
- using Lottomat.Application.Entity.LotteryNumberManage.Parameter;
- using TrendChartMain;
- using Lottomat.Application.Entity.LotteryNumberManage.ViewModel;
- using Lottery.Entity.TrendChart;
- using Lottery.Entity;
- using System.Data;
- using Lottomat.Utils.Date;
- using Lottomat.Utils;
- using System.Text;
- using Lottomat.Util;
- using Lottomat.Application.Busines.CommonManage;
- namespace Lottomat.SOA.API.Controllers.V1
- {
- public class TrendChartController : BaseApiController
- {
- private static readonly TrendChartBLL TrendChartBll = new TrendChartBLL();
- /// <summary>
- /// 公共BLL
- /// </summary>
- private static readonly CommonBLL commonBll = new CommonBLL();
- //private static readonly string[] types = { "QGC", "DFC", "GPC11X5", "GPCK3", "GPCKL12", "GPCKLSF" , "GPCQTC" };
- private static readonly DataItemCache dataItemCache = new DataItemCache();
- #region 查询走势图链接
- /// <summary>
- /// 查询走势图链接
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public HttpResponseMessage GetTrendChartNewsList(TrendChart arg)
- {
- BaseJson<List<TrendChart_Preview>> resultMsg = new BaseJson<List<TrendChart_Preview>> { Status = (int)JsonObjectStatus.Error, Message = "服务器未知错误。", Data = null };
- Logger(typeof(TrendChartController), arg.TryToJson(), "查询走势图链接-GetTrendChartNewsList", () =>
- {
- if (!string.IsNullOrEmpty(arg.Category))
- {
- List<TrendChart_Preview> res = Cache.Factory.CacheFactory.Cache().GetCache<List<TrendChart_Preview>>("__" + arg.Category + "__");
- if (res == null)
- {
- res = new List<TrendChart_Preview>();
- //如果传入为 GPC 的话,就默认返回高频彩11选5相关数据
- List<DataItemModel> data = dataItemCache.GetDataItemList(arg.Category.Equals("GPC") ? "GPC11X5" : arg.Category).OrderBy(n => n.SortCode).ToList();
- string[] ids = data.Select(d => d.ItemDetailId).ToArray();
- //获取该分类下符合要求的数据
- List<TrendChartEntity> trendChartEntities = GetCacheTrendChartList().Where(n=>ids.Contains(n.CategoryId)).OrderBy(n => n.SortCode).ToList();
- if (trendChartEntities.Count > 0)
- {
- //组装父级相关属性
- TrendChart_Preview previewItem = new TrendChart_Preview
- {
- TrendChartType = arg.Category,
- ItemName = dataItemCache.GetDataItemEntityByCode(arg.Category).ItemName
- };
- //根据分类ID进行分组
- IEnumerable<IGrouping<string, TrendChartEntity>> group = trendChartEntities.GroupBy(t => t.CategoryId);
- List<TempTrendChartPreviewItem> temp = new List<TempTrendChartPreviewItem>();
- foreach (IGrouping<string, TrendChartEntity> chartEntities in group)
- {
- //分类ID
- string key = chartEntities.Key;
- //获取分类信息
- DataItemDetailEntity dataItemEntity = dataItemCache.GetDataItemEntityById(key);
- List<TrendChartPreviewItem> trendChartPreviewItems = new List<TrendChartPreviewItem>();
- //组装项目相关属性
- TempTrendChartPreviewItem item = new TempTrendChartPreviewItem
- {
- TrendChartChildType = dataItemEntity.ItemValue,
- TrendChartChildName = dataItemEntity.ItemName
- };
- //组装具体信息
- foreach (TrendChartEntity entity in chartEntities)
- {
- TrendChartPreviewItem p = new TrendChartPreviewItem
- {
- Title = entity.Title,
- TrendChartUrl = entity.TrendChartUrl
- };
- trendChartPreviewItems.Add(p);
- }
- item.TrendChartPreviewItem = trendChartPreviewItems;
- temp.Add(item);
- }
- previewItem.TrendChartPreviewItems = temp;
- res.Add(previewItem);
- }
- Cache.Factory.CacheFactory.Cache().WriteCache<List<TrendChart_Preview>>(res, "__" + arg.Category + "__");
- }
- resultMsg = new BaseJson<List<TrendChart_Preview>>
- {
- Status = (int)JsonObjectStatus.Success,
- Data = res,
- Message = JsonObjectStatus.Success.GetEnumText(),
- BackUrl = null
- };
- }
- else
- {
- resultMsg = new BaseJson<List<TrendChart_Preview>>
- {
- Status = (int)JsonObjectStatus.Fail,
- Data = null,
- Message = JsonObjectStatus.Fail.GetEnumText() + ",请求参数Category为空。",
- BackUrl = null
- };
- }
- }, e =>
- {
- resultMsg = new BaseJson<List<TrendChart_Preview>>
- {
- Status = (int)JsonObjectStatus.Exception,
- Data = null,
- Message = JsonObjectStatus.Exception.GetEnumText() + ",异常信息:" + e.Message,
- BackUrl = null
- };
- });
- return resultMsg.TryToJson().ToHttpResponseMessage();
- }
- /// <summary>
- /// 缓存ToolsList
- /// </summary>
- /// <returns></returns>
- public List<TrendChartEntity> GetCacheTrendChartList()
- {
- string key = $"Cache-TrendChartList";
- List<TrendChartEntity> list = webCache.GetObject<List<TrendChartEntity>>(key);
- if (list == null)
- {
- list = TrendChartBll.GetPageList(n => n.IsDelete == false && n.IsStick == true).ToList();
- if(list!=null)
- webCache.AddObject(key, list, (int)CacheTime.Data);
- }
- return list;
- }
- #endregion
- // 引用的走势图相关的sdk
- private static readonly TrendChartSDK _main = new TrendChartSDK();
- /// <summary>
- /// 获取所有的彩种
- /// </summary>
- /// <param name="arg"></param>
- /// <returns></returns>
- [HttpPost]
- public HttpResponseMessage GetAllTrendList(BaseParameterEntity arg)
- {
- BaseJson<List<LotteryInfo>> resultMsg = new BaseJson<List<LotteryInfo>> { Status = (int)JsonObjectStatus.Error, Message = "服务器未知错误。", Data = null };
- Logger(typeof(TrendChartController), arg.TryToJson(), "获取所有的彩种-GetAllTrendList", () =>
- {
- if (arg.t.CheckTimeStamp())
- {
- //var Lottery = Cache.Factory.CacheFactory.Cache().GetCache<List<LotteryInfo>>("__LotteryList");
- //if (Lottery == null)
- //{
- //查询所有拥有走势图的彩种list
- var Lottery = _main.GetLotteryList(out string msg).Select(o => new LotteryInfo { Name = o.Name, Cid = o.Cid, Id = o.Id }).ToList();
- // Cache.Factory.CacheFactory.Cache().WriteCache<List<LotteryInfo>>(Lottery, "__LotteryList", DateTime.Now.AddHours(1));
- //}
- resultMsg = new BaseJson<List<LotteryInfo>>
- {
- Status = (int)JsonObjectStatus.Success,
- Data = Lottery,
- Message = JsonObjectStatus.Success.GetEnumText(),
- BackUrl = null
- };
- }
- else
- {
- resultMsg = new BaseJson<List<LotteryInfo>>
- {
- Status = (int)JsonObjectStatus.Fail,
- Data = null,
- Message = JsonObjectStatus.Fail.GetEnumText(),
- BackUrl = null
- };
- }
- }, e =>
- {
- resultMsg = new BaseJson<List<LotteryInfo>>
- {
- Status = (int)JsonObjectStatus.Exception,
- Data = null,
- Message = JsonObjectStatus.Exception.GetEnumText() + ",异常信息:" + e.Message,
- BackUrl = null
- };
- });
- return resultMsg.TryToJson().ToHttpResponseMessage();
- }
- /// <summary>
- /// 获取类型码-枚举码字典
- /// </summary>
- /// <param name="model">系统字典集合</param>
- /// <param name="TypeCode"></param>
- /// <returns></returns>
- private Dictionary<string, SCCLottery> GetTypeCodeAndEnumCodeDict(List<DataItemModel> model, bool IsRecommend = false, bool IsShowHomePage = false, bool IsHot = false, string TypeCode = "")
- {
- string key = IsRecommend ? "__IsRecommend___" : IsShowHomePage ? "__IsShowHomePage__" : IsHot ? "__IsHot__" : "__Public__";
- if (!string.IsNullOrEmpty(TypeCode))
- key += TypeCode + "__";
- //类型码-枚举
- Dictionary<string, SCCLottery> dictionary = Cache.Factory.CacheFactory.Cache().GetCache<Dictionary<string, SCCLottery>>(CacheKeyEnum.TypeCodeAndEnumCodeDict.ToString() + key);
- if (dictionary == null || dictionary.Count == 0)
- {
- dictionary = new Dictionary<string, SCCLottery>();
- //枚举码
- List<string> enumCode = new List<string>();
- //类型码
- List<string> typeCode = new List<string>();
- //筛选推荐
- if (IsRecommend)
- {
- enumCode = model.Where(d => d.IsRecommend).Select(d => d.SimpleSpelling).ToList();
- typeCode = model.Where(d => d.IsRecommend).Select(d => d.ItemValue).ToList();
- }
- //筛选二级首页显示彩种
- if (IsShowHomePage)
- {
- enumCode = model.Where(d => d.IsShowHomePage).Select(d => d.SimpleSpelling).ToList();
- typeCode = model.Where(d => d.IsShowHomePage).Select(d => d.ItemValue).ToList();
- }
- //筛选热门
- if (IsHot)
- {
- enumCode = model.Where(d => d.IsHot).Select(d => d.SimpleSpelling).ToList();
- typeCode = model.Where(d => d.IsHot).Select(d => d.ItemValue).ToList();
- }
- //枚举列表
- List<SCCLottery> lotteryType = enumCode.Select(s => (SCCLottery)Enum.Parse(typeof(SCCLottery), s, true)).ToList();
- for (int i = 0; i < typeCode.Count; i++)
- {
- if (!dictionary.ContainsKey(typeCode[i]))
- {
- dictionary.Add(typeCode[i], lotteryType[i]);
- }
- }
- Cache.Factory.CacheFactory.Cache().WriteCache(dictionary, CacheKeyEnum.TypeCodeAndEnumCodeDict.ToString() + key, DateTimeHelper.Now.AddDays(30));
- }
- return dictionary;
- }
- private string GetTerm(SCCLottery type)
- {
- string tableName = type.GetSCCLotteryTableName();
- string sql = $"SELECT TOP 1 [ID],[Term],[OpenTime],[Spare] FROM [dbo].[{tableName}] ORDER BY Term DESC ";
- //查询结果
- DataTable rec = commonBll.ExcuteSqlDataTable(sql, DatabaseLinksEnum.LotteryNumber, null);
- return rec.Rows.Count > 0 ? rec.Rows[0].ItemArray[1].ToString() : "";
- }
- /// <summary>
- /// 获取所有的彩种及拥有的走势图/图表/遗漏/工具
- /// </summary>
- /// <param name="arg"></param>
- /// <returns></returns>
- [HttpPost]
- public HttpResponseMessage GetAllTrendChartList(BaseParameterEntity arg)
- {
- BaseJson<List<TrendChartViewEntity>> resultMsg = new BaseJson<List<TrendChartViewEntity>> { Status = (int)JsonObjectStatus.Error, Message = "服务器未知错误。", Data = null };
- Logger(typeof(TrendChartController), arg.TryToJson(), "获取所有的彩种及拥有的走势图/图表/遗漏/工具-GetAllTrendChartList", () =>
- {
- if (arg.t.CheckTimeStamp())
- {
- //var Lottery = Cache.Factory.CacheFactory.Cache().GetCache<List<TrendChartViewEntity>>("__LotteryTrendList");
- //if (Lottery == null)
- //{
- var Lottery = new List<TrendChartViewEntity>();
- //获取所有彩种
- List<SCCConfig> configList = LotteryConfig.ToList().OrderByDescending(o => o.Name).ToList();
- foreach (var item in configList)
- {
- TrendChartViewEntity lottery = new TrendChartViewEntity();
- Enum.TryParse<SCCLottery>(item.EnumCode, true, out SCCLottery type);
- lottery.EmCode = item.Name.Substring(0, 3);
- lottery.EnumCode = item.Name;
- lottery.Cid =type.GetCid();
- lottery.Term = GetTerm(type);
- lottery.Name = type.GetEnumDescription().ToString();
- //查出对应的彩种的走势图
- lottery.TrendChartInfos = _main.GetTrendChartList(out string msg2, lottery.Cid).Select(o => new TrendChartInfo { Id = o.Id, Name = o.Name, Cid = o.Cid, Tid = o.Tid }).ToList();
- //图表
- lottery.TrendPictuerInfos = _main.GetTrendChartList(out string msg3, lottery.Cid, 2004).Select(o => new TrendChartInfo { Id = o.Id, Name = o.Name, Cid = o.Cid, Tid = o.Tid }).ToList();
- //工具
- lottery.TrendToolsInfos = _main.GetTrendChartList(out string msg4, lottery.Cid, 2002).Select(o => new TrendChartInfo { Id = o.Id, Name = o.Name, Cid = o.Cid, Tid = o.Tid }).ToList();
- //遗漏
- lottery.TrendMissInfos = _main.GetTrendChartList(out string msg5, lottery.Cid, 2003).Select(o => new TrendChartInfo { Id = o.Id, Name = o.Name, Cid = o.Cid, Tid = o.Tid }).ToList();
- //if (lottery.TrendChartInfos.Count!=0)
- //{
- Lottery.Add(lottery);
- //}
- }
- // Cache.Factory.CacheFactory.Cache().WriteCache<List<TrendChartViewEntity>>(Lottery, "__LotteryTrendList", DateTime.Now.AddHours(1));
- //}
- resultMsg = new BaseJson<List<TrendChartViewEntity>>
- {
- Status = (int)JsonObjectStatus.Success,
- Data = Lottery,
- Message = JsonObjectStatus.Success.GetEnumText(),
- BackUrl = null
- };
- }
- else
- {
- resultMsg = new BaseJson<List<TrendChartViewEntity>>
- {
- Status = (int)JsonObjectStatus.Fail,
- Data = null,
- Message = JsonObjectStatus.Fail.GetEnumText(),
- BackUrl = null
- };
- }
- }, e =>
- {
- resultMsg = new BaseJson<List<TrendChartViewEntity>>
- {
- Status = (int)JsonObjectStatus.Exception,
- Data = null,
- Message = JsonObjectStatus.Exception.GetEnumText() + ",异常信息:" + e.Message,
- BackUrl = null
- };
- //Cache.Factory.CacheFactory.Cache().RemoveCache("__LotteryTrendList");
- });
- return resultMsg.TryToJson().ToHttpResponseMessage();
- }
- /// <summary>
- /// 获取指定彩种拥有的走势图/图表/遗漏/工具
- /// </summary>
- /// <param name="arg"></param>
- /// <param name="tid">类别编码:2001-走势;2002-工具;2003-遗漏;2004-图表,默认2001</param>
- /// <param name="direction">方向(横屏/竖屏): 0-横屏(普通电脑);1-竖屏(电视)</param>
- /// <remarks>备注:拥有 遗漏 的彩种【福彩3D、体彩排三、双色球】;拥有 图表 的彩种【福彩3D、体彩排三】;拥有 工具 的彩种【福彩3D、体彩排三、体彩排五、双色球、七乐彩、22选5、大乐透、七星彩】</remarks>
- /// <returns></returns>
- [HttpPost]
- public HttpResponseMessage GetTrendChartList(LotteryTrendChartArgEntity arg)
- {
- BaseJson<TrendChartViewEntity> resultMsg = new BaseJson<TrendChartViewEntity> { Status = (int)JsonObjectStatus.Error, Message = "服务器未知错误。", Data = null };
- Logger(typeof(TrendChartController), arg.TryToJson(), "获取指定彩种拥有的走势图/图表/遗漏/工具-GetTrendChartList", () =>
- {
- if (arg.t.CheckTimeStamp())
- {
- if (arg.Tid != 2001 && arg.Tid != 2002 && arg.Tid != 2003 && arg.Tid != 2004 && arg.Direction != 0 && arg.Direction != 1)
- {
- resultMsg = new BaseJson<TrendChartViewEntity>
- {
- Status = (int)JsonObjectStatus.Fail,
- Data = null,
- Message = JsonObjectStatus.Fail.GetEnumText() + "(类别编码/方向编码)有误",
- BackUrl = null
- };
- }
- else
- {
- TrendChartViewEntity lottery = new TrendChartViewEntity();
- lottery.Cid = arg.Cid;
- //查出对应的彩种的走势图
- lottery.TrendChartInfos = _main.GetTrendChartList(out string msg2, lottery.Cid).Select(o => new TrendChartInfo { Id = o.Id, Name = o.Name, Cid = o.Cid, Tid = o.Tid }).ToList();
- //图表
- lottery.TrendPictuerInfos = _main.GetTrendChartList(out string msg3, lottery.Cid, 2004).Select(o => new TrendChartInfo { Id = o.Id, Name = o.Name, Cid = o.Cid, Tid = o.Tid }).ToList();
- //工具
- lottery.TrendToolsInfos = _main.GetTrendChartList(out string msg4, lottery.Cid, 2002).Select(o => new TrendChartInfo { Id = o.Id, Name = o.Name, Cid = o.Cid, Tid = o.Tid }).ToList();
- //遗漏
- lottery.TrendMissInfos = _main.GetTrendChartList(out string msg5, lottery.Cid, 2003).Select(o => new TrendChartInfo { Id = o.Id, Name = o.Name, Cid = o.Cid, Tid = o.Tid }).ToList();
- resultMsg = new BaseJson<TrendChartViewEntity>
- {
- Status = (int)JsonObjectStatus.Success,
- Data = lottery,
- Message = JsonObjectStatus.Success.GetEnumText(),
- BackUrl = null
- };
- }
- }
- else
- {
- resultMsg = new BaseJson<TrendChartViewEntity>
- {
- Status = (int)JsonObjectStatus.Fail,
- Data = null,
- Message = JsonObjectStatus.Fail.GetEnumText(),
- BackUrl = null
- };
- }
- }, e =>
- {
- resultMsg = new BaseJson<TrendChartViewEntity>
- {
- Status = (int)JsonObjectStatus.Exception,
- Data = null,
- Message = JsonObjectStatus.Exception.GetEnumText() + ",异常信息:" + e.Message,
- BackUrl = null
- };
- });
- return resultMsg.TryToJson().ToHttpResponseMessage();
- }
- /// <summary>
- /// 获取走势图详情
- /// </summary>
- /// <param name="arg"></param>
- /// <returns></returns>
- [HttpPost]
- public HttpResponseMessage GetTrendChart(LotteryTrendChartArgEntity arg)
- {
- BaseJson<TrendChartMain.TrendChartViewModel> resultMsg = new BaseJson<TrendChartMain.TrendChartViewModel> { Status = (int)JsonObjectStatus.Error, Message = "服务器未知错误。", Data = null };
- Logger(typeof(TrendChartController), arg.TryToJson(), "获取走势图详情-GetTrendChart", () =>
- {
- if (arg.t.CheckTimeStamp())
- {
- QueryTrendChartArg para = new QueryTrendChartArg
- {
- ChatrId = arg.ChartId,
- TotalRecord = arg.TotalRecord,
- Year = arg.Year,
- StartTerm = arg.StartTerm,
- EndTerm = arg.EndTerm,
- SearchTime = arg.SearchTime,
- ChartType = arg.ChartType
- };
- var Lottery = _main.GetTrendChartHtml(out string msg, para);
- resultMsg = new BaseJson<TrendChartMain.TrendChartViewModel>
- {
- Status = (int)JsonObjectStatus.Success,
- Data = Lottery,
- Message = JsonObjectStatus.Success.GetEnumText(),
- BackUrl = null
- };
- }
- else
- {
- resultMsg = new BaseJson<TrendChartMain.TrendChartViewModel>
- {
- Status = (int)JsonObjectStatus.Fail,
- Data = null,
- Message = JsonObjectStatus.Fail.GetEnumText(),
- BackUrl = null
- };
- }
- }, e =>
- {
- resultMsg = new BaseJson<TrendChartMain.TrendChartViewModel>
- {
- Status = (int)JsonObjectStatus.Exception,
- Data = null,
- Message = JsonObjectStatus.Exception.GetEnumText() + ",异常信息:" + e.Message,
- BackUrl = null
- };
- });
- return resultMsg.TryToJson().ToHttpResponseMessage();
- }
- /// <summary>
- /// 获取遗漏详情
- /// </summary>
- /// <param name="arg"></param>
- /// <returns></returns>
- [HttpPost]
- public HttpResponseMessage GetMissDataChart(LotteryMissDataArgEntity arg)
- {
- BaseJson<TrendChartMain.TrendChartViewModel> resultMsg = new BaseJson<TrendChartMain.TrendChartViewModel> { Status = (int)JsonObjectStatus.Error, Message = "服务器未知错误。", Data = null };
- Logger(typeof(TrendChartController), arg.TryToJson(), "获取遗漏详情-GetMissDataChart", () =>
- {
- if (arg.t.CheckTimeStamp())
- {
- var MisssData = _main.GetMissDataHtml(out string msg, arg.MissId, arg.EndTerm);
- resultMsg = new BaseJson<TrendChartMain.TrendChartViewModel>
- {
- Status = (int)JsonObjectStatus.Success,
- Data = MisssData,
- Message = JsonObjectStatus.Success.GetEnumText(),
- BackUrl = null
- };
- }
- else
- {
- resultMsg = new BaseJson<TrendChartMain.TrendChartViewModel>
- {
- Status = (int)JsonObjectStatus.Fail,
- Data = null,
- Message = JsonObjectStatus.Fail.GetEnumText(),
- BackUrl = null
- };
- }
- }, e =>
- {
- resultMsg = new BaseJson<TrendChartMain.TrendChartViewModel>
- {
- Status = (int)JsonObjectStatus.Exception,
- Data = null,
- Message = JsonObjectStatus.Exception.GetEnumText() + ",异常信息:" + e.Message,
- BackUrl = null
- };
- });
- return resultMsg.TryToJson().ToHttpResponseMessage();
- }
- /// <summary>
- /// 获取图表详情
- /// </summary>
- /// <param name="arg"></param>
- /// <returns></returns>
- [HttpPost]
- public HttpResponseMessage GetPicChart(LotteryPicArgEntity arg)
- {
- BaseJson<TrendChartMain.TrendChartViewModel> resultMsg = new BaseJson<TrendChartMain.TrendChartViewModel> { Status = (int)JsonObjectStatus.Error, Message = "服务器未知错误。", Data = null };
- Logger(typeof(TrendChartController), arg.TryToJson(), "获取图表详情-GetPicChart", () =>
- {
- if (arg.t.CheckTimeStamp())
- {
- var MisssData = _main.GetChartHtml(out string msg, arg.ChartId);
- resultMsg = new BaseJson<TrendChartMain.TrendChartViewModel>
- {
- Status = (int)JsonObjectStatus.Success,
- Data = MisssData,
- Message = JsonObjectStatus.Success.GetEnumText(),
- BackUrl = null
- };
- }
- else
- {
- resultMsg = new BaseJson<TrendChartMain.TrendChartViewModel>
- {
- Status = (int)JsonObjectStatus.Fail,
- Data = null,
- Message = JsonObjectStatus.Fail.GetEnumText(),
- BackUrl = null
- };
- }
- }, e =>
- {
- resultMsg = new BaseJson<TrendChartMain.TrendChartViewModel>
- {
- Status = (int)JsonObjectStatus.Exception,
- Data = null,
- Message = JsonObjectStatus.Exception.GetEnumText() + ",异常信息:" + e.Message,
- BackUrl = null
- };
- });
- return resultMsg.TryToJson().ToHttpResponseMessage();
- }
- }
- }
|