|
@@ -55,6 +55,7 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
|
|
|
var entity = new RedPackRecord
|
|
|
{
|
|
|
OrderId = redPackAudit.OrderId,
|
|
|
+ RedPackAuditId = redPackAudit.Id,
|
|
|
PeopleType = EReadPackUserType.Citizen,
|
|
|
Name = order.FromName,
|
|
|
PickupStatus = ERedPackPickupStatus.Unreceived,
|
|
@@ -174,11 +175,35 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
|
|
|
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) => (sms.IsPublic == true || sms.IndustryId == snapshot.IndustryId)
|
|
|
+ .Where((sms, industry, snapshot) => (sms.IsPublic == true || sms.IndustryId == snapshot.IndustryId)
|
|
|
&& sms.Status == dto.Status && sms.IsEnable == true)
|
|
|
.Select<GetRedPackAuditSMSTemplateOutDto>()
|
|
|
.Distinct()
|
|
|
.ToListAsync();
|
|
|
return items;
|
|
|
}
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 审核添加备注
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task UpdateRedPackAuditRemarkAsync(UpdateRedPackAuditRemarkInDto dto)
|
|
|
+ {
|
|
|
+ var audit = await _redPackAuditRepository.GetAsync(dto.RedPackAuditId) ?? throw UserFriendlyException.SameMessage("审核记录不存在");
|
|
|
+ audit.AcutalAmount = dto.AcutalAmount;
|
|
|
+ if (dto.IsSend == false)
|
|
|
+ {
|
|
|
+ await _redPackRecordRepository.Queryable()
|
|
|
+ .Where(m => m.RedPackAuditId == audit.Id)
|
|
|
+ .FirstAsync()
|
|
|
+ .Then(async (record) =>
|
|
|
+ {
|
|
|
+ record.FailCase = dto.FailCase;
|
|
|
+ await _redPackRecordRepository.UpdateAsync(record);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ audit.SendRemarks = dto.SendRemarks;
|
|
|
+ await _redPackAuditRepository.UpdateAsync(audit);
|
|
|
+ }
|
|
|
}
|