|
@@ -1,5 +1,6 @@
|
|
using Hotline.Orders;
|
|
using Hotline.Orders;
|
|
using Hotline.Share.Enums.Snapshot;
|
|
using Hotline.Share.Enums.Snapshot;
|
|
|
|
+using Hotline.Share.Tools;
|
|
using Hotline.Snapshot.Contracts;
|
|
using Hotline.Snapshot.Contracts;
|
|
using Hotline.Snapshot.IRepository;
|
|
using Hotline.Snapshot.IRepository;
|
|
using System;
|
|
using System;
|
|
@@ -23,7 +24,7 @@ public class SnapshotPointsDomainService : ISnapshotPointsDomainService, IScopeD
|
|
_pointsRecordRepository = snapshotPointsRecordRepository;
|
|
_pointsRecordRepository = snapshotPointsRecordRepository;
|
|
}
|
|
}
|
|
|
|
|
|
- public async Task AddPointsAsync(string orderId, EPointsSource source, ESnapshotSMSStatus? status, int? extraDeductedPoints)
|
|
|
|
|
|
+ public async Task AddPointsAsync(string orderId, EPointsSource source, ESnapshotSMSStatus? status, int? extraDeductedPoints, string? extraDeductionPointsTypeName)
|
|
{
|
|
{
|
|
if (status == null) return;
|
|
if (status == null) return;
|
|
var order = await _orderSnapshotRepository.Queryable()
|
|
var order = await _orderSnapshotRepository.Queryable()
|
|
@@ -62,8 +63,17 @@ public class SnapshotPointsDomainService : ISnapshotPointsDomainService, IScopeD
|
|
if (source == EPointsSource.Audit && status == ESnapshotSMSStatus.Refuse)
|
|
if (source == EPointsSource.Audit && status == ESnapshotSMSStatus.Refuse)
|
|
{
|
|
{
|
|
points.Direction = Share.Enums.CallCenter.EPointsDirection.Out;
|
|
points.Direction = Share.Enums.CallCenter.EPointsDirection.Out;
|
|
- points.Points = order.RefusePoints ?? 0 + extraDeductedPoints ?? 0;
|
|
|
|
|
|
+ points.Points = order.RefusePoints ?? 0;
|
|
points.Points *= -1;
|
|
points.Points *= -1;
|
|
|
|
+
|
|
|
|
+ if (extraDeductionPointsTypeName.NotNullOrEmpty() && extraDeductedPoints != null && extraDeductedPoints != 0)
|
|
|
|
+ {
|
|
|
|
+ var ex = points.ToJson().FromJson<SnapshotPointsRecord>();
|
|
|
|
+ ex.Source = EPointsSource.AuditDeduct;
|
|
|
|
+ ex.Points = extraDeductedPoints.Value * -1;
|
|
|
|
+ ex.Remark = extraDeductionPointsTypeName;
|
|
|
|
+ await _pointsRecordRepository.AddAsync(ex);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
await _pointsRecordRepository.AddAsync(points);
|
|
await _pointsRecordRepository.AddAsync(points);
|
|
}
|
|
}
|