|
@@ -36,19 +36,24 @@ public class SnapshotPointsDomainService : ISnapshotPointsDomainService, IScopeD
|
|
|
if (order.ReportPoints.HasValue == false)
|
|
|
throw new UserFriendlyException($"{order.Name} 行业未配置积分");
|
|
|
|
|
|
- var point = 0;
|
|
|
- if (source == EPointsSource.Report)
|
|
|
- point = order.ReportPoints.Value;
|
|
|
- if (source == EPointsSource.Audit && status == ESnapshotSMSStatus.Agree)
|
|
|
- point = order.ArgeePoints ?? 0;
|
|
|
- if (source == EPointsSource.Audit && status == ESnapshotSMSStatus.Refuse)
|
|
|
- point = order.RefusePoints ?? 0 + extraDeductedPoints ?? 0;
|
|
|
- await _pointsRecordRepository.AddAsync(new SnapshotPointsRecord
|
|
|
+ var points = new SnapshotPointsRecord
|
|
|
{
|
|
|
UserId = order.CreatorId,
|
|
|
OrderId = orderId,
|
|
|
Points = order.ReportPoints.Value,
|
|
|
- Source = source
|
|
|
- });
|
|
|
+ Source = source,
|
|
|
+ Direction = Share.Enums.CallCenter.EPointsDirection.In
|
|
|
+ };
|
|
|
+ if (source == EPointsSource.Report)
|
|
|
+ points.Points = order.ReportPoints.Value;
|
|
|
+ if (source == EPointsSource.Audit && status == ESnapshotSMSStatus.Agree)
|
|
|
+ points.Points = order.ArgeePoints ?? 0;
|
|
|
+ if (source == EPointsSource.Audit && status == ESnapshotSMSStatus.Refuse)
|
|
|
+ {
|
|
|
+ points.Direction = Share.Enums.CallCenter.EPointsDirection.Out;
|
|
|
+ points.Points = order.RefusePoints ?? 0 + extraDeductedPoints ?? 0;
|
|
|
+ points.Points *= -1;
|
|
|
+ }
|
|
|
+ await _pointsRecordRepository.AddAsync(points);
|
|
|
}
|
|
|
}
|