.vs/PolicyControl/FileContentIndex/38bcb322-498b-4d31-ae00-a86beb0906ad.vsidxBinary files differ
.vs/PolicyControl/FileContentIndex/6c8460c3-9804-4bbc-a78b-0578aabdf329.vsidxBinary files differ
.vs/PolicyControl/FileContentIndex/8a4e2975-9fed-4b2f-ac5a-c87c346e1299.vsidxBinary files differ
.vs/PolicyControl/FileContentIndex/913507dd-72bf-4c9c-a867-18de68b289dd.vsidxBinary files differ
GasolineBlend.BLL/StockDataBLL.cs
New file @@ -0,0 +1,24 @@ using GasolineBlend.DAL; using GasolineBlend.Entity; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace GasolineBlend.BLL { public class StockDataBLL { private StockDataDAL _acc = new StockDataDAL(); /// <summary> /// 获取用益信托网记录数据 /// </summary> /// <returns></returns> public List<StockDataPage> GetStockDataList(string CompanyName) { return _acc.GetStockDataList(CompanyName); } } } GasolineBlend.BLL/TreeDiagramRecordBLL.cs
@@ -17,9 +17,9 @@ /// 获取用益信托网记录数据 /// </summary> /// <returns></returns> public List<TreeDiagramRecord> GetTreeDiagramRecordIsName(string CompanyName) public List<TreeDiagramRecord> GetTreeDiagramRecordIsName(string CompanyName, int UserId) { return _acc.GetTreeDiagramRecordIsName(CompanyName); return _acc.GetTreeDiagramRecordIsName(CompanyName, UserId); } public bool AddTreeDiagramRecord(TreeDiagramRecord treeDiagramRecord) GasolineBlend.DAL/StockDataDAL.cs
New file @@ -0,0 +1,24 @@ using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using Dapper; using GasolineBlend.Entity; using MySql.Data.MySqlClient; namespace GasolineBlend.DAL { public class StockDataDAL : BaseMySQLDAL { public List<StockDataPage> GetStockDataList(string CompanyName) { using (IDbConnection connection = new MySqlConnection(connectionString)) { var sql = $"SELECT id,tickersymbol,stocktype,stockname,chinesename,city,secondaryindustry from stockdata WHERE chinesename like '%{CompanyName}%' LIMIT 1;"; return connection.Query<StockDataPage>(sql).ToList(); } } } } GasolineBlend.DAL/TreeDiagramRecordDAL.cs
@@ -16,11 +16,11 @@ { public class TreeDiagramRecordDAL : BaseMySQLDAL { public List<TreeDiagramRecord> GetTreeDiagramRecordIsName(string CompanyName) public List<TreeDiagramRecord> GetTreeDiagramRecordIsName(string CompanyName, int UserId) { using (IDbConnection connection = new MySqlConnection(connectionString)) { var sql = $"select * from treediagramrecord WHERE companyname='{CompanyName}';"; var sql = $"select * from treediagramrecord WHERE companyname='{CompanyName}' and UserId ='{UserId}';"; return connection.Query<TreeDiagramRecord>(sql).ToList(); } } @@ -29,13 +29,14 @@ using (IDbConnection connection = new MySqlConnection(connectionString)) { var sql = @" INSERT INTO treediagramrecord (companyname, content, modificationtime) VALUES ( @CompanyName, @Content,NOW())"; INSERT INTO treediagramrecord (companyname, content,userid, modificationtime) VALUES ( @CompanyName, @Content,@UserId,NOW())"; var parameters = new { CompanyName = treeDiagramRecord.CompanyName, Content = treeDiagramRecord.Content Content = treeDiagramRecord.Content, UserId = treeDiagramRecord.UserId }; connection.Open(); // 打开数据库连接 @@ -51,12 +52,13 @@ update treediagramrecord set content=@Content, modificationtime=NOW() where companyname=@CompanyName"; where companyname=@CompanyName and userid =@UserId"; var parameters = new { CompanyName = treeDiagramRecord.CompanyName, Content = treeDiagramRecord.Content Content = treeDiagramRecord.Content, UserId = treeDiagramRecord.UserId }; connection.Open(); // 打开数据库连接 GasolineBlend.Entity/StockDataPage.cs
New file @@ -0,0 +1,41 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace GasolineBlend.Entity { public class StockDataPage { /// <summary> /// 序号 /// </summary> public int Id { get; set; } /// <summary> /// 股票代码 /// </summary> public string TickerSymbol { get; set; } /// <summary> /// 股票类型 /// </summary> public string StockType { get; set; } /// <summary> /// 股票名称 /// </summary> public string StockName { get; set; } /// <summary> /// 城市 /// </summary> public string City { get; set; } /// <summary> /// 中文名称 /// </summary> public string ChineseName { get; set; } /// <summary> /// 区 /// </summary> public string SecondaryIndustry { get; set; } } } GasolineBlend.Entity/TreeDiagramRecord.cs
@@ -21,6 +21,10 @@ /// </summary> public string Content { get; set; } /// <summary> /// 提示词 /// </summary> public int UserId { get; set; } /// <summary> ///修改时间 /// </summary> public DateTime ModificationTime { get; set; } GasolineBlend/Controllers/StockDataController.cs
New file @@ -0,0 +1,35 @@ using CommonHelper; using GasolineBlend.BLL; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace GasolineBlend.Controllers { public class StockDataController : BaseController { private StockDataBLL _acc = new StockDataBLL(); /// <summary> ///获取上市公司列表数据 /// </summary> /// <param name="CompanyName"></param> /// <returns></returns> [HttpPost] public ActionResult GetStockDataList(string CompanyName) { try { var list = _acc.GetStockDataList(CompanyName); return SuccessNoShow(data: list); } catch (Exception e) { LogHelper.Write(Level.Error, "获取地区列表数据 GetStockDataList", e, OperatorProvider.Instance.Current == null ? "GuestEx" : OperatorProvider.Instance.Current.LoginName); return Error(); } } } } GasolineBlend/Controllers/TreeDiagramRecord.cs
@@ -24,16 +24,20 @@ { try { var list = _acc.GetTreeDiagramRecordIsName(CompanyName); if (list != null && list.Count > 0) if (OperatorProvider.Instance?.Current?.UserId != null) { return SuccessNoShow(data: list); var list = _acc.GetTreeDiagramRecordIsName(CompanyName, OperatorProvider.Instance.Current.UserId); if (list != null && list.Count > 0) { return SuccessNoShow(data: list); } return SuccessNoShow(data: null); } return SuccessNoShow(data: null); } catch (Exception e) { LogHelper.Write(Level.Error, "获取地区智能体数据 GetTreeDiagramRecordIsId", e, OperatorProvider.Instance.Current == null ? "GuestEx" : OperatorProvider.Instance.Current.LoginName); LogHelper.Write(Level.Error, "获取树状图数据 GetTreeDiagramRecordIsId", e, OperatorProvider.Instance.Current == null ? "GuestEx" : OperatorProvider.Instance.Current.LoginName); return Error(); } } @@ -48,17 +52,22 @@ { try { var list = _acc.GetTreeDiagramRecordIsName(treeDiagramRecord.CompanyName); if (list.Count == 0) if (OperatorProvider.Instance?.Current?.UserId != null) { bool isAdd = _acc.AddTreeDiagramRecord(treeDiagramRecord); return isAdd ? SuccessNoShow() : Error(); treeDiagramRecord.UserId = OperatorProvider.Instance.Current.UserId; var list = _acc.GetTreeDiagramRecordIsName(treeDiagramRecord.CompanyName, treeDiagramRecord.UserId); if (list.Count == 0) { bool isAdd = _acc.AddTreeDiagramRecord(treeDiagramRecord); return isAdd ? SuccessNoShow() : Error(); } return SuccessNoShow(data: null); } return SuccessNoShow(data: null); } catch (Exception e) { LogHelper.Write(Level.Error, "添加智能体 AddTreeDiagramRecord" + LogHelper.Write(Level.Error, "添加树状图数据 AddTreeDiagramRecord" + "" + "", e, OperatorProvider.Instance.Current == null ? "GuestEx" : OperatorProvider.Instance.Current.LoginName); return Error(); @@ -75,20 +84,26 @@ { try { var list = _acc.GetTreeDiagramRecordIsName(treeDiagramRecord.CompanyName); if (list != null && list.Count != 0) if (OperatorProvider.Instance?.Current?.UserId != null) { bool isUpdata = _acc.UpdateTreeDiagramRecord(treeDiagramRecord); return isUpdata ? SuccessNoShow() : Error(); } else { bool isUpdata = _acc.AddTreeDiagramRecord(treeDiagramRecord); } treeDiagramRecord.UserId = OperatorProvider.Instance.Current.UserId; var list = _acc.GetTreeDiagramRecordIsName(treeDiagramRecord.CompanyName, treeDiagramRecord.UserId); if (list != null && list.Count != 0) { bool isUpdata = _acc.UpdateTreeDiagramRecord(treeDiagramRecord); return isUpdata ? SuccessNoShow() : Error(); } else { bool isUpdata = _acc.AddTreeDiagramRecord(treeDiagramRecord); } return SuccessNoShow(data: null); } return SuccessNoShow(data: null); } catch (Exception e) { LogHelper.Write(Level.Error, "修改智能体 UpdateTreeDiagramRecord" + LogHelper.Write(Level.Error, "修改树状图数据 UpdateTreeDiagramRecord" + "" + "", e, OperatorProvider.Instance.Current == null ? "GuestEx" : OperatorProvider.Instance.Current.LoginName); return Error();