|
@@ -4,6 +4,7 @@ using Hotline.Share.Enums.Order;
|
|
|
using Hotline.Share.Tools;
|
|
|
using Hotline.Snapshot;
|
|
|
using Hotline.Snapshot.Interfaces;
|
|
|
+using Senparc.Weixin.MP;
|
|
|
using SqlSugar;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
@@ -16,10 +17,12 @@ namespace Hotline.Application.Snapshot;
|
|
|
public class RedPackApplication : IRedPackApplication, IScopeDependency
|
|
|
{
|
|
|
private readonly IOrderSnapshotRepository _orderSnapshotRepository;
|
|
|
+ private readonly ISnapshotSMSTemplateRepository _snapshotSMSTemplateRepository;
|
|
|
|
|
|
- public RedPackApplication(IOrderSnapshotRepository orderSnapshotRepository)
|
|
|
+ public RedPackApplication(IOrderSnapshotRepository orderSnapshotRepository, ISnapshotSMSTemplateRepository snapshotSMSTemplateRepository)
|
|
|
{
|
|
|
_orderSnapshotRepository = orderSnapshotRepository;
|
|
|
+ _snapshotSMSTemplateRepository = snapshotSMSTemplateRepository;
|
|
|
}
|
|
|
|
|
|
public ISugarQueryable<SnapshotOrderAuditItemsOutDto> GetRedPackAuditItemsAsync(SnapshotOrderAuditItemsInDto dto)
|
|
@@ -46,6 +49,7 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
|
|
|
.WhereIF(dto.Status.HasValue, (s, o, r, j) => r.Status == dto.Status)
|
|
|
.Select((s, o, r, j) => new SnapshotOrderAuditItemsOutDto
|
|
|
{
|
|
|
+ Id = s.Id,
|
|
|
No = o.No,
|
|
|
Title = o.Title,
|
|
|
IndustryName = s.IndustryName,
|
|
@@ -80,4 +84,21 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
|
|
|
});
|
|
|
return query;
|
|
|
}
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 获取审核短信模板
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task<IList<GetRedPackAuditSMSTemplateOutDto>> GetRedPackAuditSMSTemplateAsync(GetRedPackAuditSMSTemplateInDto dto)
|
|
|
+ {
|
|
|
+ var items = await _snapshotSMSTemplateRepository.Queryable(includeDeleted: true)
|
|
|
+ .LeftJoin<Industry>((sms, industry) => sms.IndustryId == industry.Id)
|
|
|
+ .LeftJoin<OrderSnapshot>((sms, industry, snapshot) => snapshot.IndustryId == industry.Id)
|
|
|
+ .Where((sms, industry, snapshot) =>
|
|
|
+ snapshot.Id == dto.OrderId && sms.Status == dto.Status && sms.IsEnable == true)
|
|
|
+ .Select<GetRedPackAuditSMSTemplateOutDto>()
|
|
|
+ .ToListAsync();
|
|
|
+ return items;
|
|
|
+ }
|
|
|
}
|