查询必选修规则结果接口新增返回数据序号

master
xiaochanghai 2 weeks ago
parent 4523fb52d6
commit aef550b341
  1. BIN
      Lib/Tiobon.Core.Base.dll
  2. 2
      Lib/Tiobon.Core.Base.xml
  3. BIN
      Lib/Tiobon.Core.dll
  4. 135
      Lib/Tiobon.Core.xml
  5. 23
      Tiobon.Core.Api/Controllers/Ghre/Ghre_StudyRuleResultController.cs
  6. 2
      Tiobon.Core.Api/Controllers/Systems/CacheManageController.cs
  7. 342
      Tiobon.Core.Common/Caches/Caching.cs
  8. 53
      Tiobon.Core.Common/Caches/ICaching.cs
  9. 60
      Tiobon.Core.Common/Caches/SqlSugarCacheService.cs
  10. 20
      Tiobon.Core.Common/Enums/ModifyType.cs
  11. 2
      Tiobon.Core.Common/Extensions/ExpressionExtensions.cs
  12. 2
      Tiobon.Core.Extensions/AOP/BlogCacheAOP.cs
  13. 2
      Tiobon.Core.Extensions/ServiceExtensions/CacheSetup.cs
  14. 6
      Tiobon.Core.Extensions/ServiceExtensions/SqlsugarSetup.cs
  15. 2
      Tiobon.Core.Gateway/Helper/CustomJwtTokenAuthMiddleware.cs
  16. 16
      Tiobon.Core.Gateway/Startup.cs
  17. 1
      Tiobon.Core.Model/View/Ghre/Ghre_StudyRuleResult.Dto.View.cs
  18. 40
      Tiobon.Core.Services/Ghra/Ghra_StaffGroupServices.cs
  19. 2
      Tiobon.Core.Services/GlobalUsings.cs

Binary file not shown.

@ -41,7 +41,7 @@
缓存
</summary>
</member>
<member name="M:Tiobon.Core.Services.BASE.BaseServices`4.#ctor(Tiobon.Core.IRepository.Base.IBaseRepository{`0},Tiobon.Core.Common.Caches.ICaching)">
<member name="M:Tiobon.Core.Services.BASE.BaseServices`4.#ctor(Tiobon.Core.IRepository.Base.IBaseRepository{`0},Tiobon.Core.Caches.ICaching)">
<summary>
</summary>

Binary file not shown.

@ -157,6 +157,121 @@
事务传播方式
</summary>
</member>
<member name="M:Tiobon.Core.Caches.Caching.AddCacheKeyAsync(System.String)">
<summary>
增加缓存Key
</summary>
<param name="cacheKey"></param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Caches.Caching.DelByPatternAsync(System.String)">
<summary>
删除某特征关键字缓存
</summary>
<param name="key"></param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Caches.Caching.DelCacheKeyAsync(System.String)">
<summary>
删除缓存
</summary>
<param name="cacheKey"></param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Caches.Caching.ExistsAsync(System.String)">
<summary>
检查给定 key 是否存在
</summary>
<param name="cacheKey"></param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Caches.Caching.GetAllCacheKeysAsync">
<summary>
获取所有缓存列表
</summary>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Caches.Caching.GetAsync``1(System.String)">
<summary>
获取缓存
</summary>
<typeparam name="T"></typeparam>
<param name="cacheKey"></param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Caches.Caching.GetStringAsync(System.String)">
<summary>
获取缓存
</summary>
<param name="cacheKey"></param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Caches.Caching.RemoveAsync(System.String)">
<summary>
删除缓存
</summary>
<param name="key"></param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Caches.Caching.SetAsync``1(System.String,``0)">
<summary>
增加对象缓存
</summary>
<param name="cacheKey"></param>
<param name="value"></param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Caches.Caching.SetAsync``1(System.String,``0,System.TimeSpan)">
<summary>
增加对象缓存,并设置过期时间
</summary>
<param name="cacheKey"></param>
<param name="value"></param>
<param name="expire"></param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Caches.Caching.SetStringAsync(System.String,System.String)">
<summary>
增加字符串缓存
</summary>
<param name="cacheKey"></param>
<param name="value"></param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Caches.Caching.SetStringAsync(System.String,System.String,System.TimeSpan)">
<summary>
增加字符串缓存,并设置过期时间
</summary>
<param name="cacheKey"></param>
<param name="value"></param>
<param name="expire"></param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Caches.Caching.SetMaxDataScopeType(System.Int64,System.Int32)">
<summary>
缓存最大角色数据范围
</summary>
<param name="userId"></param>
<param name="dataScopeType"></param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Caches.Caching.DelByParentKeyAsync(System.String)">
<summary>
根据父键清空
</summary>
<param name="key"></param>
<returns></returns>
</member>
<member name="T:Tiobon.Core.Caches.ICaching">
<summary>
缓存抽象接口,基于IDistributedCache封装
</summary>
</member>
<member name="T:Tiobon.Core.Caches.SqlSugarCacheService">
<summary>
实现SqlSugar的ICacheService接口
</summary>
</member>
<member name="T:Tiobon.Core.Const.CacheConst">
<summary>
缓存相关常量
@ -289,6 +404,26 @@
以嵌套事务方式执行
</summary>
</member>
<member name="T:Tiobon.Core.Common.Enums.ModifyType">
<summary>
资料修改模式
</summary>
</member>
<member name="F:Tiobon.Core.Common.Enums.ModifyType.Add">
<summary>
新增模式。
</summary>
</member>
<member name="F:Tiobon.Core.Common.Enums.ModifyType.Edit">
<summary>
修改模式。
</summary>
</member>
<member name="F:Tiobon.Core.Common.Enums.ModifyType.Delete">
<summary>
删除模式
</summary>
</member>
<member name="M:Tiobon.Core.Extensions.RuntimeExtension.GetAllAssemblies">
<summary>
获取项目程序集,排除所有的系统程序集(Microsoft.***、System.***等)、Nuget下载包

@ -23,7 +23,28 @@ public class Ghre_StudyRuleResultController : BaseController<IGhre_StudyRuleResu
[HttpPost, Route("QueryByRuleId/{RuleId}")]
public async Task<ServicePageResult<Ghre_StudyRuleResultDto>> Query(long RuleId, [FromBody] QueryBody body)
{
return await _service.QueryFilterPage(body, $"StudyRuleId='{RuleId}'");
var result = await _service.QueryFilterPage(body, $"StudyRuleId='{RuleId}'");
var DT_TableDataT1 = result.result.DT_TableDataT1;
int index1 = 0;
int index2 = 0;
for (int i = 0; i < DT_TableDataT1.Count; i++)
{
if (DT_TableDataT1[i].Status == "SUCCESS")
{
index1++;
DT_TableDataT1[i].Index = index1;
}
else
{
index2++;
DT_TableDataT1[i].Index = index2;
}
}
result.result.DT_TableDataT1 = DT_TableDataT1;
return result;
}
#endregion

@ -1,4 +1,4 @@
using Tiobon.Core.Common.Caches;
using Tiobon.Core.Caches;
namespace Tiobon.Core.Api.Controllers.Systems;
/// <summary>

@ -1,342 +0,0 @@
using Microsoft.Extensions.Caching.Distributed;
using Newtonsoft.Json;
using System.Text;
using Tiobon.Core.Const;
namespace Tiobon.Core.Common.Caches;
public class Caching : ICaching
{
private readonly IDistributedCache _cache;
public Caching(IDistributedCache cache)
{
_cache = cache;
}
private byte[] GetBytes<T>(T source)
{
return Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(source));
}
public IDistributedCache Cache => _cache;
public void AddCacheKey(string cacheKey)
{
var res = _cache.GetString(CacheConst.KeyAll);
var allkeys = string.IsNullOrWhiteSpace(res) ? new List<string>() : JsonConvert.DeserializeObject<List<string>>(res);
if (!allkeys.Any(m => m == cacheKey))
{
allkeys.Add(cacheKey);
_cache.SetString(CacheConst.KeyAll, JsonConvert.SerializeObject(allkeys));
}
}
/// <summary>
/// 增加缓存Key
/// </summary>
/// <param name="cacheKey"></param>
/// <returns></returns>
public async Task AddCacheKeyAsync(string cacheKey)
{
var res = await _cache.GetStringAsync(CacheConst.KeyAll);
var allkeys = string.IsNullOrWhiteSpace(res) ? new List<string>() : JsonConvert.DeserializeObject<List<string>>(res);
if (!allkeys.Any(m => m == cacheKey))
{
allkeys.Add(cacheKey);
await _cache.SetStringAsync(CacheConst.KeyAll, JsonConvert.SerializeObject(allkeys));
}
}
public void DelByPattern(string key)
{
var allkeys = GetAllCacheKeys();
if (allkeys == null) return;
var delAllkeys = allkeys.Where(u => u.Contains(key)).ToList();
delAllkeys.ForEach(u => { _cache.Remove(u); });
// 更新所有缓存键
allkeys = allkeys.Where(u => !u.Contains(key)).ToList();
_cache.SetString(CacheConst.KeyAll, JsonConvert.SerializeObject(allkeys));
}
/// <summary>
/// 删除某特征关键字缓存
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public async Task DelByPatternAsync(string key)
{
var allkeys = await GetAllCacheKeysAsync();
if (allkeys == null) return;
var delAllkeys = allkeys.Where(u => u.Contains(key)).ToList();
delAllkeys.ForEach(u => { _cache.Remove(u); });
// 更新所有缓存键
allkeys = allkeys.Where(u => !u.Contains(key)).ToList();
await _cache.SetStringAsync(CacheConst.KeyAll, JsonConvert.SerializeObject(allkeys));
}
public void DelCacheKey(string cacheKey)
{
var res = _cache.GetString(CacheConst.KeyAll);
var allkeys = string.IsNullOrWhiteSpace(res) ? new List<string>() : JsonConvert.DeserializeObject<List<string>>(res);
if (allkeys.Any(m => m == cacheKey))
{
allkeys.Remove(cacheKey);
_cache.SetString(CacheConst.KeyAll, JsonConvert.SerializeObject(allkeys));
}
}
/// <summary>
/// 删除缓存
/// </summary>
/// <param name="cacheKey"></param>
/// <returns></returns>
public async Task DelCacheKeyAsync(string cacheKey)
{
var res = await _cache.GetStringAsync(CacheConst.KeyAll);
var allkeys = string.IsNullOrWhiteSpace(res) ? new List<string>() : JsonConvert.DeserializeObject<List<string>>(res);
if (allkeys.Any(m => m == cacheKey))
{
allkeys.Remove(cacheKey);
await _cache.SetStringAsync(CacheConst.KeyAll, JsonConvert.SerializeObject(allkeys));
}
}
public bool Exists(string cacheKey)
{
var res = _cache.Get(cacheKey);
return res != null;
}
/// <summary>
/// 检查给定 key 是否存在
/// </summary>
/// <param name="cacheKey">键</param>
/// <returns></returns>
public async Task<bool> ExistsAsync(string cacheKey)
{
var res = await _cache.GetAsync(cacheKey);
return res != null;
}
public List<string> GetAllCacheKeys()
{
var res = _cache.GetString(CacheConst.KeyAll);
return string.IsNullOrWhiteSpace(res) ? null : JsonConvert.DeserializeObject<List<string>>(res);
}
/// <summary>
/// 获取所有缓存列表
/// </summary>
/// <returns></returns>
public async Task<List<string>> GetAllCacheKeysAsync()
{
var res = await _cache.GetStringAsync(CacheConst.KeyAll);
return string.IsNullOrWhiteSpace(res) ? null : JsonConvert.DeserializeObject<List<string>>(res);
}
public T Get<T>(string cacheKey)
{
var res = _cache.Get(cacheKey);
return res == null ? default : JsonConvert.DeserializeObject<T>(Encoding.UTF8.GetString(res));
}
/// <summary>
/// 获取缓存
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="cacheKey"></param>
/// <returns></returns>
public async Task<T> GetAsync<T>(string cacheKey)
{
var res = await _cache.GetAsync(cacheKey);
return res == null ? default : JsonConvert.DeserializeObject<T>(Encoding.UTF8.GetString(res));
}
public object Get(Type type, string cacheKey)
{
var res = _cache.Get(cacheKey);
return res == null ? default : JsonConvert.DeserializeObject(Encoding.UTF8.GetString(res), type);
}
public async Task<object> GetAsync(Type type, string cacheKey)
{
var res = await _cache.GetAsync(cacheKey);
return res == null ? default : JsonConvert.DeserializeObject(Encoding.UTF8.GetString(res), type);
}
public string GetString(string cacheKey)
{
return _cache.GetString(cacheKey);
}
/// <summary>
/// 获取缓存
/// </summary>
/// <param name="cacheKey"></param>
/// <returns></returns>
public async Task<string> GetStringAsync(string cacheKey)
{
return await _cache.GetStringAsync(cacheKey);
}
public void Remove(string key)
{
_cache.Remove(key);
DelCacheKey(key);
}
/// <summary>
/// 删除缓存
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public async Task RemoveAsync(string key)
{
await _cache.RemoveAsync(key);
await DelCacheKeyAsync(key);
}
public void RemoveAll()
{
var catches = GetAllCacheKeys();
foreach (var @catch in catches) Remove(@catch);
catches.Clear();
_cache.SetString(CacheConst.KeyAll, JsonConvert.SerializeObject(catches));
}
public async Task RemoveAllAsync()
{
var catches = await GetAllCacheKeysAsync();
foreach (var @catch in catches) await RemoveAsync(@catch);
catches.Clear();
await _cache.SetStringAsync(CacheConst.KeyAll, JsonConvert.SerializeObject(catches));
}
public void Set<T>(string cacheKey, T value, TimeSpan? expire = null)
{
_cache.Set(cacheKey, GetBytes(value),
expire == null
? new DistributedCacheEntryOptions() {AbsoluteExpirationRelativeToNow = TimeSpan.FromHours(6)}
: new DistributedCacheEntryOptions() {AbsoluteExpirationRelativeToNow = expire});
AddCacheKey(cacheKey);
}
/// <summary>
/// 增加对象缓存
/// </summary>
/// <param name="cacheKey"></param>
/// <param name="value"></param>
/// <returns></returns>
public async Task SetAsync<T>(string cacheKey, T value)
{
await _cache.SetAsync(cacheKey, Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(value)),
new DistributedCacheEntryOptions() {AbsoluteExpirationRelativeToNow = TimeSpan.FromHours(6)});
await AddCacheKeyAsync(cacheKey);
}
/// <summary>
/// 增加对象缓存,并设置过期时间
/// </summary>
/// <param name="cacheKey"></param>
/// <param name="value"></param>
/// <param name="expire"></param>
/// <returns></returns>
public async Task SetAsync<T>(string cacheKey, T value, TimeSpan expire)
{
await _cache.SetAsync(cacheKey, Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(value)),
new DistributedCacheEntryOptions() {AbsoluteExpirationRelativeToNow = expire});
await AddCacheKeyAsync(cacheKey);
}
public void SetPermanent<T>(string cacheKey, T value)
{
_cache.Set(cacheKey, Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(value)));
AddCacheKey(cacheKey);
}
public async Task SetPermanentAsync<T>(string cacheKey, T value)
{
await _cache.SetAsync(cacheKey, Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(value)));
await AddCacheKeyAsync(cacheKey);
}
public void SetString(string cacheKey, string value, TimeSpan? expire = null)
{
if (expire == null)
_cache.SetString(cacheKey, value, new DistributedCacheEntryOptions() {AbsoluteExpirationRelativeToNow = TimeSpan.FromHours(6)});
else
_cache.SetString(cacheKey, value, new DistributedCacheEntryOptions() {AbsoluteExpirationRelativeToNow = expire});
AddCacheKey(cacheKey);
}
/// <summary>
/// 增加字符串缓存
/// </summary>
/// <param name="cacheKey"></param>
/// <param name="value"></param>
/// <returns></returns>
public async Task SetStringAsync(string cacheKey, string value)
{
await _cache.SetStringAsync(cacheKey, value, new DistributedCacheEntryOptions() {AbsoluteExpirationRelativeToNow = TimeSpan.FromHours(6)});
await AddCacheKeyAsync(cacheKey);
}
/// <summary>
/// 增加字符串缓存,并设置过期时间
/// </summary>
/// <param name="cacheKey"></param>
/// <param name="value"></param>
/// <param name="expire"></param>
/// <returns></returns>
public async Task SetStringAsync(string cacheKey, string value, TimeSpan expire)
{
await _cache.SetStringAsync(cacheKey, value, new DistributedCacheEntryOptions() {AbsoluteExpirationRelativeToNow = expire});
await AddCacheKeyAsync(cacheKey);
}
/// <summary>
/// 缓存最大角色数据范围
/// </summary>
/// <param name="userId"></param>
/// <param name="dataScopeType"></param>
/// <returns></returns>
public async Task SetMaxDataScopeType(long userId, int dataScopeType)
{
var cacheKey = CacheConst.KeyMaxDataScopeType + userId;
await SetStringAsync(cacheKey, dataScopeType.ToString());
await AddCacheKeyAsync(cacheKey);
}
/// <summary>
/// 根据父键清空
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public async Task DelByParentKeyAsync(string key)
{
var allkeys = await GetAllCacheKeysAsync();
if (allkeys == null) return;
var delAllkeys = allkeys.Where(u => u.StartsWith(key)).ToList();
delAllkeys.ForEach(Remove);
// 更新所有缓存键
allkeys = allkeys.Where(u => !u.StartsWith(key)).ToList();
await SetStringAsync(CacheConst.KeyAll, JsonConvert.SerializeObject(allkeys));
}
}

@ -1,53 +0,0 @@
using Microsoft.Extensions.Caching.Distributed;
namespace Tiobon.Core.Common.Caches;
/// <summary>
/// 缓存抽象接口,基于IDistributedCache封装
/// </summary>
public interface ICaching
{
public IDistributedCache Cache { get; }
void AddCacheKey(string cacheKey);
Task AddCacheKeyAsync(string cacheKey);
void DelByPattern(string key);
Task DelByPatternAsync(string key);
void DelCacheKey(string cacheKey);
Task DelCacheKeyAsync(string cacheKey);
bool Exists(string cacheKey);
Task<bool> ExistsAsync(string cacheKey);
List<string> GetAllCacheKeys();
Task<List<string>> GetAllCacheKeysAsync();
T Get<T>(string cacheKey);
Task<T> GetAsync<T>(string cacheKey);
object Get(Type type, string cacheKey);
Task<object> GetAsync(Type type, string cacheKey);
string GetString(string cacheKey);
Task<string> GetStringAsync(string cacheKey);
void Remove(string key);
Task RemoveAsync(string key);
void RemoveAll();
Task RemoveAllAsync();
void Set<T>(string cacheKey, T value, TimeSpan? expire = null);
Task SetAsync<T>(string cacheKey, T value);
Task SetAsync<T>(string cacheKey, T value, TimeSpan expire);
void SetPermanent<T>(string cacheKey, T value);
Task SetPermanentAsync<T>(string cacheKey, T value);
void SetString(string cacheKey, string value, TimeSpan? expire = null);
Task SetStringAsync(string cacheKey, string value);
Task SetStringAsync(string cacheKey, string value, TimeSpan expire);
Task DelByParentKeyAsync(string key);
}

@ -1,60 +0,0 @@
using SqlSugar;
namespace Tiobon.Core.Common.Caches;
/// <summary>
/// 实现SqlSugar的ICacheService接口
/// </summary>
public class SqlSugarCacheService : ICacheService
{
private readonly Lazy<ICaching> _caching = new(() => App.GetService<ICaching>(false));
private ICaching Caching => _caching.Value;
public void Add<V>(string key, V value)
{
Caching.Set(key, value);
}
public void Add<V>(string key, V value, int cacheDurationInSeconds)
{
Caching.Set(key, value, TimeSpan.FromSeconds(cacheDurationInSeconds));
}
public bool ContainsKey<V>(string key)
{
return Caching.Exists(key);
}
public V Get<V>(string key)
{
return Caching.Get<V>(key);
}
public IEnumerable<string> GetAllKey<V>()
{
return Caching.GetAllCacheKeys();
}
public V GetOrCreate<V>(string cacheKey, Func<V> create, int cacheDurationInSeconds = int.MaxValue)
{
if (!ContainsKey<V>(cacheKey))
{
var value = create();
Caching.Set(cacheKey, value, TimeSpan.FromSeconds(cacheDurationInSeconds));
return value;
}
return Caching.Get<V>(cacheKey);
}
public void Remove<V>(string key)
{
Caching.Remove(key);
}
public bool RemoveAll()
{
Caching.RemoveAll();
return true;
}
}

@ -1,20 +0,0 @@
namespace Tiobon.Core.Common.Enums;
/// <summary>
/// 资料修改模式
/// </summary>
public enum ModifyType
{
/// <summary>
/// 新增模式。
/// </summary>
Add,
/// <summary>
/// 修改模式。
/// </summary>
Edit,
/// <summary>
/// 删除模式
/// </summary>
Delete
}

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Http;
using System.Linq.Expressions;
using Tiobon.Core.Common.Caches;
using Tiobon.Core.Caches;
namespace Tiobon.Core.Common.Helper;

@ -1,6 +1,6 @@
using Castle.DynamicProxy;
using Tiobon.Core.Common;
using Tiobon.Core.Common.Caches;
using Tiobon.Core.Caches;
namespace Tiobon.Core.AOP;

@ -1,6 +1,6 @@
using Microsoft.Extensions.DependencyInjection;
using StackExchange.Redis;
using Tiobon.Core.Common.Caches;
using Tiobon.Core.Caches;
using Tiobon.Core.Option;
namespace Tiobon.Core.Extensions.ServiceExtensions;

@ -2,7 +2,7 @@
using Microsoft.Extensions.DependencyInjection;
using SqlSugar;
using System.Text.RegularExpressions;
using Tiobon.Core.Common.Caches;
using Tiobon.Core.Caches;
using Tiobon.Core.Common.DB;
using Tiobon.Core.Common.DB.Aop;
using Tiobon.Core.Const;
@ -32,7 +32,7 @@ public static class SqlsugarSetup
{
ConfigId = m.ConnId.ObjToString().ToLower(),
ConnectionString = m.Connection,
DbType = (DbType) m.DbType,
DbType = (DbType)m.DbType,
IsAutoCloseConnection = true,
// Check out more information: https://github.com/anjoy8/Tiobon.Core/issues/122
//IsShardSameThread = false,
@ -99,7 +99,7 @@ public static class SqlsugarSetup
{
BaseDBConfig.ValidConfig.ForEach(config =>
{
var dbProvider = db.GetConnectionScope((string) config.ConfigId);
var dbProvider = db.GetConnectionScope((string)config.ConfigId);
// 打印SQL语句
dbProvider.Aop.OnLogExecuting = (s, parameters) =>

@ -2,7 +2,7 @@
using System.Text.RegularExpressions;
using Microsoft.AspNetCore.Authentication;
using Tiobon.Core.Common;
using Tiobon.Core.Common.Caches;
using Tiobon.Core.Caches;
using Tiobon.Core.Common.Helper;
namespace Tiobon.Core.AuthHelper

@ -1,15 +1,14 @@
using Tiobon.Core.AuthHelper;
using Tiobon.Core.Common;
using Tiobon.Core.Common.Caches;
using Microsoft.AspNetCore.Authentication;
using System.Reflection;
using Tiobon.Core.AuthHelper;
using Tiobon.Core.Caches;
using Tiobon.Core.Extensions;
using Tiobon.Core.Gateway.Extensions;
using Microsoft.AspNetCore.Authentication;
using System.Reflection;
namespace Tiobon.Core.AdminMvc
namespace Tiobon.Core.AdminMvc;
public class Startup
{
public class Startup
{
/**
*
* 
@ -75,5 +74,4 @@ namespace Tiobon.Core.AdminMvc
app.UseCustomOcelotMildd().Wait();
}
}
}

@ -31,4 +31,5 @@ public class Ghre_StudyRuleResultDto : Ghre_StudyRuleResult
/// 修改信息
/// </summary>
public string UpdateDataInfo { get; set; }
public int Index { get; set; }
}

@ -1,27 +1,10 @@

using Tiobon.Core.IServices;
using Tiobon.Core.Model.Models;
using Tiobon.Core.Services.BASE;
using Tiobon.Core.IRepository.Base;
using Tiobon.Core.Common.Caches;
using System.Collections.Generic;
using MySqlX.XDevAPI.Relational;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using NPOI.POIFS.NIO;
using static Microsoft.Extensions.Logging.EventSource.LoggingEventSource;
using MySqlX.XDevAPI.Common;
using System.Text;
using Microsoft.AspNetCore.Identity;
using System.Linq;
using Amazon.Runtime.Internal.Transform;
namespace Tiobon.Core.Services;
namespace Tiobon.Core.Services
/// <summary>
/// 人员群组 (服务)
/// </summary>
public class Ghra_StaffGroupServices : BaseServices<Ghra_StaffGroup, Ghra_StaffGroupDto, InsertGhra_StaffGroupInput, EditGhra_StaffGroupInput>, IGhra_StaffGroupServices
{
/// <summary>
/// 人员群组 (服务)
/// </summary>
public class Ghra_StaffGroupServices : BaseServices<Ghra_StaffGroup, Ghra_StaffGroupDto, InsertGhra_StaffGroupInput, EditGhra_StaffGroupInput>, IGhra_StaffGroupServices
{
private readonly IBaseRepository<Ghra_StaffGroup> _dal;
private IGhra_StaffGroupDetailServices _StaffGroupDetailServices;
public Ghra_StaffGroupServices(ICaching caching, IBaseRepository<Ghra_StaffGroup> dal,
@ -168,7 +151,7 @@ namespace Tiobon.Core.Services
return ServiceResult<object>.OprateSuccess("查询成功!", result);
}
public async Task<ServiceResult<Dictionary<string, object>>> GetStaffGroupInfoByID(long Id,JObject FBody)
public async Task<ServiceResult<Dictionary<string, object>>> GetStaffGroupInfoByID(long Id, JObject FBody)
{
string LangID = App.User.GetLangId().ToString();
string BaseDate = FBody["BaseDate"]?.Value<string>() ?? DateTime.Now.ToString("yyyy-MM-dd");
@ -236,22 +219,22 @@ namespace Tiobon.Core.Services
string SqlStr = string.Empty;
List<StaffInfoColumn> staffInfoColumns = new List<StaffInfoColumn>();
staffInfoColumns.Add(new StaffInfoColumn() { StaffInfoColumnNo = "StaffID", StaffInfoColumnName = "ID",isHidden=true });
staffInfoColumns.Add(new StaffInfoColumn() { StaffInfoColumnNo = "StaffID", StaffInfoColumnName = "ID", isHidden = true });
staffInfoColumns.Add(new StaffInfoColumn() { StaffInfoColumnNo = "StaffNo", StaffInfoColumnName = "工号" });
staffInfoColumns.Add(new StaffInfoColumn() { StaffInfoColumnNo = "StaffName", StaffInfoColumnName = "姓名" });
staffInfoColumns.Add(new StaffInfoColumn() { StaffInfoColumnNo = "DeptFullPateName", StaffInfoColumnName = "全部门" });
foreach (DataRow dr in dt.Rows)
{
WhereSQL += " and "+dr["WhereStr"].ToString();
WhereSQL += " and " + dr["WhereStr"].ToString();
StaffInfoColumn staffInfo = new StaffInfoColumn();
staffInfo.StaffInfoColumnNo = dr["ColumnNo"].ToString();
staffInfo.StaffInfoColumnName = dr["ColumnName"].ToString();
; if ( !staffInfoColumns.Any(x => x.StaffInfoColumnNo == dr["ColumnNo"].ToString()))
; if (!staffInfoColumns.Any(x => x.StaffInfoColumnNo == dr["ColumnNo"].ToString()))
{
staffInfoColumns.Add(staffInfo);
SqlStr += ","+dr["SqlStr"].ToString();
SqlStr += "," + dr["SqlStr"].ToString();
}
}
@ -295,7 +278,4 @@ namespace Tiobon.Core.Services
public string SortNo { get; set; }
}
}
}

@ -8,7 +8,7 @@ global using System.Dynamic;
global using System.Linq.Expressions;
global using System.Reflection;
global using Tiobon.Core.Common;
global using Tiobon.Core.Common.Caches;
global using Tiobon.Core.Caches;
global using Tiobon.Core.Common.DB.Dapper;
global using Tiobon.Core.Common.DB.Dapper.Extensions;
global using Tiobon.Core.Common.Enums;

Loading…
Cancel
Save