From 165f7c7df1e61f2bc9487c437f8cff4b71f92752 Mon Sep 17 00:00:00 2001
From: yexuzhong <120511780@qq.com>
Date: Wed, 27 Aug 2025 14:39:43 +0800
Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E5=90=88=E9=A3=8E=E6=8E=A7=20?=
=?UTF-8?q?=E9=AA=8C=E8=B5=84=E6=94=B9=E9=80=A0=20=20=E7=BC=93=E5=AD=98?=
=?UTF-8?q?=E8=AE=BE=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Framework/YLErp.Cache/IYLCache.cs | 10 ++++++++++
Framework/YLErp.Cache/YLRedisCache.cs | 5 +++++
.../ClientNoDMABalanceTask.cs | 1 +
3 files changed, 16 insertions(+)
diff --git a/Framework/YLErp.Cache/IYLCache.cs b/Framework/YLErp.Cache/IYLCache.cs
index dc37752c..e0939b22 100644
--- a/Framework/YLErp.Cache/IYLCache.cs
+++ b/Framework/YLErp.Cache/IYLCache.cs
@@ -18,6 +18,16 @@ namespace YLErp.Cache
///
bool DeleteKey(string key);
+ ///
+ /// Hash数据类型的保存
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ bool HashSet(string key, string hashKey, T value);
+
///
/// 字符串数据类型的保存
///
diff --git a/Framework/YLErp.Cache/YLRedisCache.cs b/Framework/YLErp.Cache/YLRedisCache.cs
index 93c9d3f0..aae50a6d 100644
--- a/Framework/YLErp.Cache/YLRedisCache.cs
+++ b/Framework/YLErp.Cache/YLRedisCache.cs
@@ -54,6 +54,11 @@ namespace YLErp.Cache
return db.StringSet(GenerateKey(key), value);
}
+ public bool HashSet(string key, string hashKey, T value)
+ {
+ return db.HashSet(key, hashKey, JsonConvert.SerializeObject(value));
+ }
+
public string StringGet(string key)
{
return db.StringGet(GenerateKey(key));
diff --git a/YLWinSer/RealTimeCalcPositionService/ClientNoDMABalanceTask.cs b/YLWinSer/RealTimeCalcPositionService/ClientNoDMABalanceTask.cs
index b0cd9f53..6dd124be 100644
--- a/YLWinSer/RealTimeCalcPositionService/ClientNoDMABalanceTask.cs
+++ b/YLWinSer/RealTimeCalcPositionService/ClientNoDMABalanceTask.cs
@@ -81,6 +81,7 @@ namespace RealTimeCalcPositionService
if (_yLCache != null)
{
_yLCache.StringSet("ClientBalance:" + cb.ClientId, obj);
+ _yLCache.HashSet("risk:cash:balance:amount", cb.ClientId.ToString(), (decimal)obj.AvailableAmount);
}
}
catch (Exception ex)