Jelajahi Sumber

积分审核

qinchaoyue 1 bulan lalu
induk
melakukan
5e9c28a2d2

+ 1 - 1
src/Hotline.Application/Snapshot/Notifications/SnapshotHandler.cs

@@ -189,7 +189,7 @@ public class SnapshotStartWorkFlow : INotificationHandler<StartWorkflowNotify>
         try
         {
             if (_sysSetting.Snapshot == false && notification.Workflow.ModuleCode != WorkflowModuleConsts.OrderHandle) return;
-            await _snapshotPointsDomainService.AddPointsAsync(notification.Workflow.ExternalId, EPointsSource.Report, ERedPackAuditStatus.Agree, 0);
+            await _snapshotPointsDomainService.AddPointsAsync(notification.Workflow.ExternalId, EPointsSource.Report, ESnapshotSMSStatus.Agree, 0);
         }
         catch (Exception e)
         {

+ 7 - 1
src/Hotline.Application/Snapshot/RedPackApplication.cs

@@ -96,6 +96,12 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
         redPackAudit.AuditOrgId = _sessionContext.OrgId;
         redPackAudit.AuditOrgName = _sessionContext.OrgName;
         redPackAudit.ApprovedAmount = redPackAudit.ShouldAmount;
+        redPackAudit.Points = dto.Points;
+        redPackAudit.PointsStatus = dto.PointsStatus;
+        redPackAudit.PointsOpinion = dto.PointsOpinion;
+        redPackAudit.ExtraDeductedPoints = dto.ExtraDeductedPoints;
+        redPackAudit.ExtraDeductionPointsTypeId = dto.ExtraDeductionPointsTypeId;
+        redPackAudit.ExtraDeductionPointsTypeName = dto.ExtraDeductionPointsTypeName;
         var order = await _orderRepository.Queryable()
             .LeftJoin<OrderSnapshot>((order, snapshot) => order.Id == snapshot.Id)
             .Where((order, snapshot) => order.Id == redPackAudit.OrderId)
@@ -121,7 +127,7 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
             await _redPackRecordRepository.AddAsync(entity);
         }
         await _redPackAuditRepository.UpdateAsync(redPackAudit, token);
-        await _snapshotPointsDomainService.AddPointsAsync(order.Id, EPointsSource.Audit, status, dto.ExtraDeductedPoints);
+        await _snapshotPointsDomainService.AddPointsAsync(order.Id, EPointsSource.Audit, dto.PointsStatus, dto.ExtraDeductedPoints);
         if (dto.IsSendSms)
         {
             var smsTemplate = await _snapshotSMSTemplateRepository.GetAsync(dto.SMSTemplateId);

+ 5 - 0
src/Hotline.Share/Dtos/Snapshot/OrderDto.cs

@@ -1041,6 +1041,11 @@ public class UpdateRedPackAuditInDto
     /// 额外扣除积分
     /// </summary>
     public int? ExtraDeductedPoints { get; set; }
+
+    /// <summary>
+    /// 积分审核意见
+    /// </summary>
+    public string? PointsOpinion { get; set; }
 }
 
 public class GetRedPackRecordBaseDataOutDto

+ 1 - 1
src/Hotline/Snapshot/Contracts/ISnapshotPointsDomainService.cs

@@ -12,5 +12,5 @@ namespace Hotline.Snapshot.Contracts;
 /// </summary>
 public interface ISnapshotPointsDomainService
 {
-    Task AddPointsAsync(string orderId, EPointsSource source, ERedPackAuditStatus status, int? extraDeductedPoints);
+    Task AddPointsAsync(string orderId, EPointsSource source, ESnapshotSMSStatus status, int? extraDeductedPoints);
 }

+ 36 - 0
src/Hotline/Snapshot/RedPackAudit.cs

@@ -122,4 +122,40 @@ public class RedPackAudit : CreationSoftDeleteEntity
     /// </summary>
     [SugarColumn(ColumnDescription = "是否发送短信")]
     public bool? IsSendSMS { get; set; }
+
+    #region 积分
+    /// <summary>
+    /// 积分审核状态
+    /// </summary>
+    [SugarColumn(ColumnDescription = "积分审核状态")]
+    public ESnapshotSMSStatus? PointsStatus { get; set; }
+
+    /// <summary>
+    /// 积分
+    /// </summary>
+    [SugarColumn(ColumnDescription = "积分")]
+    public int? Points { get; set; }
+
+    /// <summary>
+    /// 额外扣除积分类型
+    /// </summary>
+    [SugarColumn(ColumnDescription = "额外扣除积分类型")]
+    public string? ExtraDeductionPointsTypeId { get; set; }
+
+    [SugarColumn(ColumnDescription = "额外扣除积分类型")]
+
+    public string? ExtraDeductionPointsTypeName { get; set; }
+
+    /// <summary>
+    /// 额外扣除积分
+    /// </summary>
+    [SugarColumn(ColumnDescription = "额外扣除积分")]
+    public int? ExtraDeductedPoints { get; set; }
+
+    /// <summary>
+    /// 积分审核意见
+    /// </summary>
+    [SugarColumn(ColumnDescription = "积分审核意见")]
+    public string? PointsOpinion { get; set; }
+    #endregion
 }

+ 3 - 3
src/Hotline/Snapshot/Services/SnapshotPointsDomainService.cs

@@ -22,7 +22,7 @@ public class SnapshotPointsDomainService : ISnapshotPointsDomainService, IScopeD
         _pointsRecordRepository = snapshotPointsRecordRepository;
     }
 
-    public async Task AddPointsAsync(string orderId, EPointsSource source, ERedPackAuditStatus status, int? extraDeductedPoints)
+    public async Task AddPointsAsync(string orderId, EPointsSource source, ESnapshotSMSStatus status, int? extraDeductedPoints)
     {
         var order = await _orderSnapshotRepository.Queryable()
             .LeftJoin<Industry>((snapshot, industry) => snapshot.IndustryId == industry.Id)
@@ -35,9 +35,9 @@ public class SnapshotPointsDomainService : ISnapshotPointsDomainService, IScopeD
         var point = 0;
         if (source == EPointsSource.Report)
             point = order.ReportPoints.Value;
-        if (source == EPointsSource.Audit && status == ERedPackAuditStatus.Agree)
+        if (source == EPointsSource.Audit && status == ESnapshotSMSStatus.Agree)
             point = order.ArgeePoints ?? 0;
-        if (source == EPointsSource.Audit && status == ERedPackAuditStatus.Refuse)
+        if (source == EPointsSource.Audit && status == ESnapshotSMSStatus.Refuse)
             point = order.RefusePoints ?? 0 + extraDeductedPoints ?? 0;
         await _pointsRecordRepository.AddAsync(new SnapshotPointsRecord
         {