From b298247421e0405d0319e2af8ae183f6a5358f1e Mon Sep 17 00:00:00 2001
From: wxd <123@qq.com>
Date: Fri, 18 Oct 2024 11:28:02 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=A0=E9=99=A4=E9=9A=8F?=
=?UTF-8?q?=E8=AE=BF=E7=9F=AD=E4=BF=A1=E4=BB=BB=E5=8A=A1=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...eleteThirdPartySmsTaskByThirdIdInputDto.cs | 20 +++++++++++++++++++
.../SmsTasks/SmsTaskAppService.cs | 20 +++++++++++++++++++
2 files changed, 40 insertions(+)
create mode 100644 src/Shentun.Sms.Application.Contracts/SmsTasks/DeleteThirdPartySmsTaskByThirdIdInputDto.cs
diff --git a/src/Shentun.Sms.Application.Contracts/SmsTasks/DeleteThirdPartySmsTaskByThirdIdInputDto.cs b/src/Shentun.Sms.Application.Contracts/SmsTasks/DeleteThirdPartySmsTaskByThirdIdInputDto.cs
new file mode 100644
index 0000000..c5de9e5
--- /dev/null
+++ b/src/Shentun.Sms.Application.Contracts/SmsTasks/DeleteThirdPartySmsTaskByThirdIdInputDto.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shentun.Sms.SmsTasks
+{
+ public class DeleteThirdPartySmsTaskByThirdIdInputDto
+ {
+ ///
+ /// 第三方ID 人员登记ID
+ ///
+ public string ThirdId { get; set; }
+
+ ///
+ /// 短信内容
+ ///
+ public string Content { get; set; }
+
+ }
+}
diff --git a/src/Shentun.Sms.Application/SmsTasks/SmsTaskAppService.cs b/src/Shentun.Sms.Application/SmsTasks/SmsTaskAppService.cs
index 43cb71d..27f3d37 100644
--- a/src/Shentun.Sms.Application/SmsTasks/SmsTaskAppService.cs
+++ b/src/Shentun.Sms.Application/SmsTasks/SmsTaskAppService.cs
@@ -333,5 +333,25 @@ namespace Shentun.Sms.SmsTasks
await _smsSendRepository.InsertManyAsync(smsSendList);
}
+
+ ///
+ /// 移除短信任务 根据人员ID 危急值
+ ///
+ ///
+ [HttpPost]
+ public async Task DeleteThirdPartySmsTaskByThirdIdAsync(DeleteThirdPartySmsTaskByThirdIdInputDto input)
+ {
+ DataHelper.CheckEntityIsNull(input, "", "参数有误");
+
+ var smsTaskEnt = await _smsTaskRepository.FirstOrDefaultAsync(f => f.ThirdId == input.ThirdId && f.Content == input.Content);
+
+ var smsSendList = await _smsSendRepository.GetListAsync(m => m.SmsTaskId == smsTaskEnt.Id && m.PlanSendTime > DateTime.Now);
+
+ if (smsSendList.Any())
+ {
+ await _smsSendRepository.DeleteManyAsync(smsSendList);
+ }
+ }
+
}
}