From 479b6cfc60113f692f6f9146bcd7b9231a32b0e8 Mon Sep 17 00:00:00 2001 From: 移动系统liao <liaoxujun@qq.com> Date: 星期六, 08 二月 2025 09:07:57 +0800 Subject: [PATCH] Merge branch 'cyronghe' --- cylsg/cylsg.redis/EzCoreNetRedisService.cs | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/cylsg/cylsg.redis/EzCoreNetRedisService.cs b/cylsg/cylsg.redis/EzCoreNetRedisService.cs index 5ce6426..f81b0a7 100644 --- a/cylsg/cylsg.redis/EzCoreNetRedisService.cs +++ b/cylsg/cylsg.redis/EzCoreNetRedisService.cs @@ -121,6 +121,22 @@ return re; } + + public string GetYYYMMddAnd4sn() + { + string formattedDate = DateTime.Now.ToString("yyyyMMdd"); + + + var sn = Incrby($"CreatYYYMMddAnd4snKey:{formattedDate}"); + if (sn < 1) + { + //璁剧疆鏈夋晥鏈熼檺涓�24灏忔椂 + SetTtl($"CreatYYYMMddAnd4snKey:{formattedDate}", 24 * 60 * 60); + } + string re = formattedDate + sn.ToString("D4"); + + return re; + } /// <summary> /// /// </summary> -- Gitblit v1.9.1