|
@@ -1,11 +1,13 @@
|
|
using Hotline.Orders;
|
|
using Hotline.Orders;
|
|
using Hotline.Share.Dtos.Snapshot;
|
|
using Hotline.Share.Dtos.Snapshot;
|
|
using Hotline.Share.Enums.Order;
|
|
using Hotline.Share.Enums.Order;
|
|
|
|
+using Hotline.Share.Enums.Snapshot;
|
|
using Hotline.Share.Tools;
|
|
using Hotline.Share.Tools;
|
|
using Hotline.Snapshot;
|
|
using Hotline.Snapshot;
|
|
using Hotline.Snapshot.Interfaces;
|
|
using Hotline.Snapshot.Interfaces;
|
|
using Mapster;
|
|
using Mapster;
|
|
using SqlSugar;
|
|
using SqlSugar;
|
|
|
|
+using SqlSugar.Extensions;
|
|
using XF.Domain.Dependency;
|
|
using XF.Domain.Dependency;
|
|
using XF.Domain.Exceptions;
|
|
using XF.Domain.Exceptions;
|
|
|
|
|
|
@@ -41,8 +43,18 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
|
|
.Select((i, o) => new { i.Id, i.CitizenReadPackAmount })
|
|
.Select((i, o) => new { i.Id, i.CitizenReadPackAmount })
|
|
.FirstAsync();
|
|
.FirstAsync();
|
|
outDto.Amount = industry.CitizenReadPackAmount;
|
|
outDto.Amount = industry.CitizenReadPackAmount;
|
|
- outDto.RedPackTxt = $"15826142797【】元; 今天审批【1】个";
|
|
|
|
- //await _redPackAuditRepository.Queryable()
|
|
|
|
|
|
+ outDto.RedPackTxt = $"{order.FromPhone}【】元; ";
|
|
|
|
+ var dayStart = DateTime.Now.ToString("yyyy-MM-dd 00:00:00").ObjToDate();
|
|
|
|
+ var dayEnd = DateTime.Now.ToString("yyyy-MM-dd 23:59:59").ObjToDate();
|
|
|
|
+ var query = _redPackAuditRepository.Queryable()
|
|
|
|
+ .Where(m => m.PhoneNumber == order.FromPhone && m.AuditTime >= dayStart && m.AuditTime <= dayEnd && m.Status == ERedPackAuditStatus.Agree);
|
|
|
|
+
|
|
|
|
+ var totalAmount = await query.SumAsync(m => m.ApprovedAmount);
|
|
|
|
+ if (totalAmount != 0)
|
|
|
|
+ outDto.RedPackTxt = $"{order.FromPhone}【{totalAmount}】元; ";
|
|
|
|
+ var count = await query.CountAsync();
|
|
|
|
+ if (count != 0)
|
|
|
|
+ outDto.RedPackTxt += $"今天审批【{count}】个";
|
|
|
|
|
|
return outDto;
|
|
return outDto;
|
|
}
|
|
}
|