Browse Source

增加删除随访短信任务接口

master
wxd 1 year ago
parent
commit
b298247421
  1. 20
      src/Shentun.Sms.Application.Contracts/SmsTasks/DeleteThirdPartySmsTaskByThirdIdInputDto.cs
  2. 20
      src/Shentun.Sms.Application/SmsTasks/SmsTaskAppService.cs

20
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
{
/// <summary>
/// 第三方ID 人员登记ID
/// </summary>
public string ThirdId { get; set; }
/// <summary>
/// 短信内容
/// </summary>
public string Content { get; set; }
}
}

20
src/Shentun.Sms.Application/SmsTasks/SmsTaskAppService.cs

@ -333,5 +333,25 @@ namespace Shentun.Sms.SmsTasks
await _smsSendRepository.InsertManyAsync(smsSendList);
}
/// <summary>
/// 移除短信任务 根据人员ID 危急值
/// </summary>
/// <returns></returns>
[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);
}
}
}
}
Loading…
Cancel
Save