|
@@ -1,5 +1,10 @@
|
|
|
using Hotline.Caching.Interfaces;
|
|
|
using Hotline.Settings;
|
|
|
+using Hotline.Share.Attributes;
|
|
|
+using Hotline.Share.Dtos.Snapshot;
|
|
|
+using Hotline.Snapshot.Interfaces;
|
|
|
+using Microsoft.AspNetCore.Http;
|
|
|
+using SqlSugar;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
@@ -13,10 +18,12 @@ public class SnapshotBulletinApplication : ISnapshotBulletinApplication, IScopeD
|
|
|
{
|
|
|
|
|
|
private readonly ISystemSettingCacheManager _systemSettingCacheManager;
|
|
|
+ private readonly ISnapshotBulletinRepository _bulletinRepository;
|
|
|
|
|
|
- public SnapshotBulletinApplication(ISystemSettingCacheManager systemSettingCacheManager)
|
|
|
+ public SnapshotBulletinApplication(ISystemSettingCacheManager systemSettingCacheManager, ISnapshotBulletinRepository bulletinRepository)
|
|
|
{
|
|
|
_systemSettingCacheManager = systemSettingCacheManager;
|
|
|
+ _bulletinRepository = bulletinRepository;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -65,4 +72,19 @@ public class SnapshotBulletinApplication : ISnapshotBulletinApplication, IScopeD
|
|
|
|
|
|
return sb.ToString();
|
|
|
}
|
|
|
+
|
|
|
+ [ExportExcel("随手拍公告")]
|
|
|
+ public ISugarQueryable<SnapshotBulletinItemsOutDto> QueryBulletinItems(SnapshotBulletinItemsInDto dto)
|
|
|
+ {
|
|
|
+ var query = _bulletinRepository.Queryable()
|
|
|
+ .Includes(x => x.ExaminMan)
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.SnapshotBulletinTypeName), d => d.SnapshotBulletinTypeName.Contains(dto.SnapshotBulletinTypeName))
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Title), d => d.Title.Contains(dto.Title))
|
|
|
+ .WhereIF(dto.BeginCreationTime.HasValue, d => d.BulletinTime >= dto.BeginCreationTime)
|
|
|
+ .WhereIF(dto.EndCreationTime.HasValue, d => d.BulletinTime <= dto.EndCreationTime)
|
|
|
+ .WhereIF(dto.State.HasValue, d => d.BulletinState == dto.State)
|
|
|
+ .OrderByDescending(d => d.CreationTime)
|
|
|
+ .Select<SnapshotBulletinItemsOutDto>();
|
|
|
+ return query;
|
|
|
+ }
|
|
|
}
|