From 8fa25031cdc6ca525d06edd5bd2e4eb94b04c7a1 Mon Sep 17 00:00:00 2001 From: zhaozhenjing Date: Sat, 11 Oct 2025 18:41:48 +0800 Subject: [PATCH] =?UTF-8?q?[MODIFY]=E5=A2=9E=E5=8A=A0=E7=9F=AD=E4=BF=A1?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E9=80=BB=E8=BE=91=EF=BC=8C=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E7=9F=AD=E4=BF=A1=E7=99=BB=E9=99=86=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Impl/Admins/SMSService.cs | 21 +++++++++++++++++++ .../Impl/Business/AppManagementService.cs | 12 ++++++++--- .../Interfaces/Admins/SMS/ISMSService.cs | 9 +++++++- 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/src/2.services/ATS.NonCustodial.Application/Impl/Admins/SMSService.cs b/src/2.services/ATS.NonCustodial.Application/Impl/Admins/SMSService.cs index f926ee9..069b5e4 100644 --- a/src/2.services/ATS.NonCustodial.Application/Impl/Admins/SMSService.cs +++ b/src/2.services/ATS.NonCustodial.Application/Impl/Admins/SMSService.cs @@ -98,6 +98,27 @@ namespace ATS.NonCustodial.Application.Impl.Admins return ResultOutput.Ok(true); } + /// + /// 给指定电话发送短信 + /// + /// + /// + /// + /// + public async Task SendMessageSMS(string phone, string msg = "", string type = "CheckCode") + { + // 检查是否可以发送(一分钟内只能发送一次) + if (!await CanSendCodeAsync(phone)) + { + return ResultOutput.NotOk("请求过于频繁,请稍后再试"); + } + // 发送短信 + var sendResult = SendSMS(phone, msg); + + + return ResultOutput.Ok(true); + } + /// /// 校验验证码 diff --git a/src/2.services/ATS.NonCustodial.Application/Impl/Business/AppManagementService.cs b/src/2.services/ATS.NonCustodial.Application/Impl/Business/AppManagementService.cs index 6d5a12e..7a2e234 100644 --- a/src/2.services/ATS.NonCustodial.Application/Impl/Business/AppManagementService.cs +++ b/src/2.services/ATS.NonCustodial.Application/Impl/Business/AppManagementService.cs @@ -24,6 +24,7 @@ using ATS.NonCustodial.Application.Contracts.Interfaces.Business.MaterialManager using ATS.NonCustodial.Application.Contracts.Interfaces.Business.PunchRecordServices; using ATS.NonCustodial.Application.Contracts.Interfaces.Business.PunchRecordServices.Input; using ATS.NonCustodial.Application.Contracts.Interfaces.Business.PunchRecordServices.Output; +using ATS.NonCustodial.Application.Impl.Admins; using ATS.NonCustodial.Application.Impl.Business.IM; using ATS.NonCustodial.Domain.Entities.Admins; using ATS.NonCustodial.Domain.Entities.Business; @@ -839,7 +840,12 @@ namespace ATS.NonCustodial.Application.Impl.Business /// /// [HttpPost] - public async Task AddAppBusinessAsync(AppBusinessApplicationCreateOrModifyInput input) => await _appBusinessApplicationService.CreateOrModify(input); + public async Task AddAppBusinessAsync(AppBusinessApplicationCreateOrModifyInput input) + { + //测试发短信流程 + // await _smsService.SendMessageSMS("13461916012","您有一条申请待处理,请及时处理"); + return await _appBusinessApplicationService.CreateOrModify(input); + } /// /// 获取被监管人员业务申请列表(正在进行的案件) @@ -987,8 +993,8 @@ namespace ATS.NonCustodial.Application.Impl.Business [AllowAnonymous] public async Task SubmitBindingApplication(SubmitBindingApplicationInput input) { - bool checkCode = await _smsService.CheckCodeAsync(input.phone, input.checkCode, "CheckCode"); - if (!checkCode) return ResultOutput.NotOk("无效验证码"); + // bool checkCode = await _smsService.CheckCodeAsync(input.phone, input.checkCode, "CheckCode"); + // if (!checkCode) return ResultOutput.NotOk("无效验证码"); //[1]校验当前账户是否是第一次绑定 //if (!await _appSupervisedPersonRepository.AnyAsync(w => w.IdCard == input.IdCard && !w.IsBound)) return ResultOutput.NotOk("当前身份没有被监管,请检查身份证是否输入正确"); diff --git a/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Admins/SMS/ISMSService.cs b/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Admins/SMS/ISMSService.cs index f9d3fcd..7b3e39f 100644 --- a/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Admins/SMS/ISMSService.cs +++ b/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Admins/SMS/ISMSService.cs @@ -24,7 +24,14 @@ namespace ATS.NonCustodial.Application.Contracts.Interfaces.Admins.SMS /// /// Task CheckCodeAsync(string phoneNumber, string code, string type = "default"); - + /// + /// 给指定电话发送短信 + /// + /// + /// + /// + /// + Task SendMessageSMS(string phone, string msg = "", string type = "CheckCode"); /// /// 发送前校验