3
1

7 Ревизии 90c7552d8a ... 2b60265631

Автор SHA1 Съобщение Дата
  libin 2b60265631 Merge branch 'test' into lib/test преди 3 дни
  libin 66e610a6da 常用意见导出优化 преди 3 дни
  tangjiang d6e3effbda Merge branch 'test' of http://110.188.24.182:10023/Fengwo/hotline into test преди 3 дни
  tangjiang 2e019034e6 排班统计修改bug преди 3 дни
  xf 96e9c2e084 简化全局查询过滤器实现,注释旧方法 преди 3 дни
  tangjiang 11afe37e20 Merge branch 'test' of http://110.188.24.182:10023/Fengwo/hotline into test преди 3 дни
  tangjiang 7b5713d7e7 排班统计bug修复,观察件增加id преди 3 дни

+ 2 - 1
src/Hotline.Api/Controllers/SchedulingController.cs

@@ -468,10 +468,11 @@ namespace Hotline.Api.Controllers
         private ISugarQueryable<SchedulingStatisticsDto> GetList(PagedKeywordRequest dto)
         {
             return _schedulingRepository.Queryable()
+                     .Where(p => p.WorkingTime.ToString() != "00:00:00")
                     .WhereIF(dto.StartTime.HasValue, p => p.SchedulingTime >= dto.StartTime)
                     .WhereIF(dto.EndTime.HasValue, p => p.SchedulingTime <= dto.EndTime)
                     .WhereIF(!string.IsNullOrEmpty(dto.Keyword), p => p.SchedulingUserName == dto.Keyword)
-                    .GroupBy(p => p.SchedulingTime.Value.ToString("yyyy-MM"))
+                    .GroupBy(p => new { Date=p.SchedulingTime.Value.ToString("yyyy-MM"), p.SchedulingUserName })
                     .Select(p => new SchedulingStatisticsDto
                     {
                         Date = p.SchedulingTime.Value.ToString("yyyy-MM"),

+ 14 - 3
src/Hotline.Api/Controllers/SysController.cs

@@ -37,6 +37,7 @@ using XF.Domain.Exceptions;
 using XF.Domain.Repository;
 using XF.Utility.EnumExtensions;
 using Hotline.Tools;
+using Hotline.Share.Dtos.TrCallCenter;
 
 namespace Hotline.Api.Controllers
 {
@@ -634,10 +635,20 @@ namespace Hotline.Api.Controllers
                 (total, items) = await query.ToPagedListAsync(dto.QueryDto.PageIndex, dto.QueryDto.PageSize, HttpContext.RequestAborted);
             }
 
-            dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass<SystemCommonOpinion>(dto.ColumnInfos);
+            var itemsResult = _mapper.Map<List<SystemCommonOpinionDto>>(items);
 
-            var dtos = _mapper.Map<ICollection<SystemCommonOpinion>>(items)
-                              .Select(stu => _mapper.Map(stu, typeof(SystemCommonOpinion), dynamicClass))
+            itemsResult.ForEach(x =>
+            {
+                if (x.IsOpen == true)
+                    x.IsOpenText = "公开常用意见";
+                else
+                    x.IsOpenText = "个人常用意见";
+            });
+
+            dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass<SystemCommonOpinionDto>(dto.ColumnInfos);
+
+            var dtos = _mapper.Map<ICollection<SystemCommonOpinionDto>>(itemsResult)
+                              .Select(stu => _mapper.Map(stu, typeof(SystemCommonOpinionDto), dynamicClass))
                               .Cast<object>()
                               .ToList();
 

+ 4 - 0
src/Hotline.Application/ObservationPiece/ObservationPieceApplication.cs

@@ -60,6 +60,8 @@ namespace Hotline.Application.ObservationPiece
                 .WhereIF(dto.Type == "1" && dto.DataSoure == "1", p => p.ObserveOrgId == _sessionContext.RequiredOrgId)
                 .Select(p => new ObservationPieceListDto
                 {
+                    Id = p.Id,
+                    OrderId = p.OrderId,
                     No = p.No,
                     Title = p.Order.Title,
                     AcceptType = p.Order.AcceptType,
@@ -121,6 +123,8 @@ namespace Hotline.Application.ObservationPiece
 
                 .Select(p => new ObservationPieceListDto
                 {
+                    Id = p.Id,
+                    OrderId = p.OrderId,
                     No = p.No,
                     Title = p.Order.Title,
                     AcceptType = p.Order.AcceptType,

+ 45 - 44
src/Hotline.Repository.SqlSugar/Extensions/SqlSugarStartupExtensions.cs

@@ -129,6 +129,7 @@ namespace Hotline.Repository.SqlSugar.Extensions
                 db =>
                 {
                     SetDbAop(db, services);
+                    db.QueryFilter.AddTableFilter<ISoftDelete>(entity => !entity.IsDeleted);
                 }
             );
 
@@ -331,52 +332,52 @@ namespace Hotline.Repository.SqlSugar.Extensions
                 }
             };
 
-            SetDeletedEntityFilter(db);
+            //SetDeletedEntityFilter(db);
         }
 
-        private static void SetDeletedEntityFilter(SqlSugarClient db)
-        {
-            var cacheKey = $"DbFilter:{db.CurrentConnectionConfig.ConfigId}:IsDeleted";
-            var tableFilterItemList = db.DataCache.Get<List<TableFilterItem<object>>>(cacheKey);
-            if (tableFilterItemList == null)
-            {
-                // 获取基类实体数据表
-                var entityTypes = AppDomain.CurrentDomain.GetAssemblies()
-                    .SelectMany(d => d.GetTypes())
-                    .Where(d => !d.IsInterface
-                                && !d.IsAbstract
-                                && d.IsClass
-                                && d.GetInterfaces().Any(x => x == typeof(ISoftDelete)));
-                if (!entityTypes.Any()) return;
-
-                var tableFilterItems = new List<TableFilterItem<object>>();
-                foreach (var entityType in entityTypes)
-                {
-                    if (entityType.GetProperty("IsDeleted") is null) continue;
-                    //// 排除非当前数据库实体
-                    //var tAtt = entityType.GetCustomAttribute<TenantAttribute>();
-                    //if ((tAtt != null && (string)db.CurrentConnectionConfig.ConfigId != tAtt.configId.ToString()) ||
-                    //    (tAtt == null && (string)db.CurrentConnectionConfig.ConfigId != SqlSugarConst.ConfigId))
-                    //    continue;
-
-                    var lambda = DynamicExpressionParser.ParseLambda(new[] {
-                        Expression.Parameter(entityType, "d") },
-                    typeof(bool),
-                    $"{nameof(SoftDeleteEntity.IsDeleted)} == @0", false);
-                    var tableFilterItem = new TableFilterItem<object>(entityType, lambda);
-                    tableFilterItems.Add(tableFilterItem);
-                    db.QueryFilter.Add(tableFilterItem);
-                }
-                db.DataCache.Add(cacheKey, tableFilterItems);
-            }
-            else
-            {
-                tableFilterItemList.ForEach(u =>
-                {
-                    db.QueryFilter.Add(u);
-                });
-            }
-        }
+        //private static void SetDeletedEntityFilter(SqlSugarClient db)
+        //{
+        //    var cacheKey = $"DbFilter:{db.CurrentConnectionConfig.ConfigId}:IsDeleted";
+        //    var tableFilterItemList = db.DataCache.Get<List<TableFilterItem<object>>>(cacheKey);
+        //    if (tableFilterItemList == null)
+        //    {
+        //        // 获取基类实体数据表
+        //        var entityTypes = AppDomain.CurrentDomain.GetAssemblies()
+        //            .SelectMany(d => d.GetTypes())
+        //            .Where(d => !d.IsInterface
+        //                        && !d.IsAbstract
+        //                        && d.IsClass
+        //                        && d.GetInterfaces().Any(x => x == typeof(ISoftDelete)));
+        //        if (!entityTypes.Any()) return;
+
+        //        var tableFilterItems = new List<TableFilterItem<object>>();
+        //        foreach (var entityType in entityTypes)
+        //        {
+        //            if (entityType.GetProperty("IsDeleted") is null) continue;
+        //            //// 排除非当前数据库实体
+        //            //var tAtt = entityType.GetCustomAttribute<TenantAttribute>();
+        //            //if ((tAtt != null && (string)db.CurrentConnectionConfig.ConfigId != tAtt.configId.ToString()) ||
+        //            //    (tAtt == null && (string)db.CurrentConnectionConfig.ConfigId != SqlSugarConst.ConfigId))
+        //            //    continue;
+
+        //            var lambda = DynamicExpressionParser.ParseLambda(new[] {
+        //                Expression.Parameter(entityType, "d") },
+        //            typeof(bool),
+        //            $"{nameof(SoftDeleteEntity.IsDeleted)} == @0", false);
+        //            var tableFilterItem = new TableFilterItem<object>(entityType, lambda);
+        //            tableFilterItems.Add(tableFilterItem);
+        //            db.QueryFilter.Add(tableFilterItem);
+        //        }
+        //        db.DataCache.Add(cacheKey, tableFilterItems);
+        //    }
+        //    else
+        //    {
+        //        tableFilterItemList.ForEach(u =>
+        //        {
+        //            db.QueryFilter.Add(u);
+        //        });
+        //    }
+        //}
 
         #endregion
     }

+ 4 - 0
src/Hotline.Share/Dtos/ObservationPiece/ObservationPieceListDto.cs

@@ -2,6 +2,10 @@
 {
     public class ObservationPieceListDto
     {
+        public string Id { get; set; }
+
+        public string OrderId { get; set; }
+
         public string? No { get; set; }
 
         public string? Title { get; set; }

+ 17 - 0
src/Hotline.Share/Dtos/Settings/SystemCommonOpinionDto.cs

@@ -0,0 +1,17 @@
+using Hotline.Share.Enums.Settings;
+
+namespace Hotline.Share.Dtos.Settings
+{
+    public class SystemCommonOpinionDto
+    {
+        public string? Content { get; set; }
+        public ECommonType? CommonType { get; set; }
+        public string? CommonTypeText { get; set; }
+        public bool? IsOpen { get; set; }
+        public string? IsOpenText { get; set; }
+        public string? CreatorName { get; set; }
+        public string? CreatorOrgName { get; set; }
+
+        public DateTime? CreationTime { get; set; }
+    }
+}