|
@@ -22,12 +22,8 @@ public class SnapshotPointsDomainService : ISnapshotPointsDomainService, IScopeD
|
|
|
_pointsRecordRepository = snapshotPointsRecordRepository;
|
|
|
}
|
|
|
|
|
|
- public async Task AddPointsAsync(string orderId, EPointsSource source, ERedPackAuditStatus status)
|
|
|
+ public async Task AddPointsAsync(string orderId, EPointsSource source, ERedPackAuditStatus status, int? extraDeductedPoints)
|
|
|
{
|
|
|
- var ineustryId = await _orderSnapshotRepository.Queryable()
|
|
|
- .Where(m => m.Id == orderId)
|
|
|
- .Select(m => m.IndustryId)
|
|
|
- .FirstAsync() ?? throw new UserFriendlyException($"{orderId} 工单不存在");
|
|
|
var order = await _orderSnapshotRepository.Queryable()
|
|
|
.LeftJoin<Industry>((snapshot, industry) => snapshot.IndustryId == industry.Id)
|
|
|
.Where((snapshot, industry) => snapshot.Id == orderId)
|
|
@@ -40,9 +36,9 @@ public class SnapshotPointsDomainService : ISnapshotPointsDomainService, IScopeD
|
|
|
if (source == EPointsSource.Report)
|
|
|
point = order.ReportPoints.Value;
|
|
|
if (source == EPointsSource.Audit && status == ERedPackAuditStatus.Agree)
|
|
|
- point = order.ArgeePoints.Value;
|
|
|
+ point = order.ArgeePoints ?? 0;
|
|
|
if (source == EPointsSource.Audit && status == ERedPackAuditStatus.Refuse)
|
|
|
- point = order.RefusePoints.Value;
|
|
|
+ point = order.RefusePoints ?? 0 + extraDeductedPoints ?? 0;
|
|
|
await _pointsRecordRepository.AddAsync(new SnapshotPointsRecord
|
|
|
{
|
|
|
OrderId = orderId,
|