| GasolineBlend/Controllers/RcyController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| RiskControl.NewService/Entity/RCY/RRGraphChain.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| RiskControl.NewService/RiskControl.NewService.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| RiskControl.NewService/Service/RcyService.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
GasolineBlend/Controllers/RcyController.cs
@@ -1,4 +1,5 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Web.Mvc; using RiskControl.NewService.Entity.RCY; @@ -115,5 +116,28 @@ var res = await _rcyService.GetChainIncomeCostChart(type); return SuccessNoShow(data: res); } /// <summary> /// 图谱 /// </summary> /// <param name="mainNode"></param> /// <returns></returns> [HttpPost] public async Task<ActionResult> GetRRGraphChain(string mainNode) { var list = await _rcyService.GetRRGraphChain(mainNode); var res = list.Select(a => new { label = a.AssociationNode, type = a.Relationship == "上级" ? "top" : "next", id = a.Id }).ToList(); var maxid = list.Max(a => a.Id); res.Add(new { label = mainNode, type = "main", id = 0 }); res.Add(new { label = "上级", type = "topText", id = maxid + 1 }); res.Add(new { label = "下级", type = "nextText", id = maxid + 2 }); res = res.OrderBy(a => a.id).ToList(); return SuccessNoShow(data: res); } } } RiskControl.NewService/Entity/RCY/RRGraphChain.cs
New file @@ -0,0 +1,25 @@ using SqlSugar; namespace RiskControl.NewService.Entity.RCY { public class RRGraphChain { /// <summary> /// ///</summary> [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)] public int Id { get; set; } /// <summary> /// 中心点 /// </summary> public string MainNode { get; set; } /// <summary> /// 关联节点 /// </summary> public string AssociationNode { get; set; } /// <summary> /// 关系 /// </summary> public string Relationship { get; set; } } } RiskControl.NewService/RiskControl.NewService.csproj
@@ -163,6 +163,7 @@ <Compile Include="Entity\RCY\RcyGsxq.cs" /> <Compile Include="Entity\RCY\RcyJqjz.cs" /> <Compile Include="Entity\RCY\RcySsdw.cs" /> <Compile Include="Entity\RCY\RRGraphChain.cs" /> <Compile Include="Entity\RiskControlRR\PayErrLog.cs" /> <Compile Include="Entity\RiskControlRR\UseOrder.cs" /> <Compile Include="Entity\RiskControlRR\PayOrder.cs" /> RiskControl.NewService/Service/RcyService.cs
@@ -154,5 +154,13 @@ return res; } public async Task<List<RRGraphChain>> GetRRGraphChain(string mainNode) { var list = await RiskControlRRDb.Queryable<RRGraphChain>() .Where(a => a.MainNode == mainNode) .ToListAsync(); return list; } } }