diff --git a/Core.DTO/Core.DTO.csproj b/Core.DTO/Core.DTO.csproj index 1634cec..7836191 100644 --- a/Core.DTO/Core.DTO.csproj +++ b/Core.DTO/Core.DTO.csproj @@ -107,6 +107,7 @@ + diff --git a/Core.DTO/Res/SmsRecordsDto.cs b/Core.DTO/Res/SmsRecordsDto.cs new file mode 100644 index 0000000..5aa8435 --- /dev/null +++ b/Core.DTO/Res/SmsRecordsDto.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CRM.Core.DTO.Res +{ + public class SmsRecordsDto + { + /// + /// 渠道名称 + /// + public string channel_name { get; set; } + public int id { get; set; } + /// + /// 资源ID + /// + public string umid { get; set; } + /// + /// 脱敏手机号 + /// + public string mobile { get; set; } + + /// + /// 内部单号 + /// + public string trade_no { get; set; } + /// + /// 外部单号 + /// + public string out_trade_no { get; set; } + + /// + /// 模板类型ID + /// + public int sms_temp_type_id { get; set; } + + /// + /// 渠道ID + /// + public int channel_id { get; set; } + /// + /// 渠道商模板ID + /// + public string template_id { get; set; } + + /// + /// 短信内容 + /// + public string sms_content { get; set; } + /// + /// 发送状态 0: 失败 1: 成功 + /// + public bool send_state { get; set; } + /// + /// 发送时间 + /// + public DateTime send_time { get; set; } + /// + /// 回执返回值 + /// + + public string receipt_code { get; set; } + /// + /// 回执状态码 + /// + public string receipt_status { get; set; } + + /// + /// 回执接收时间 + /// + public DateTime? receipt_time { get; set; } + /// + /// 回执成功 0:失败 1:成功 + /// + public bool receipt_success { get; set; } + } +} diff --git a/WEB/Controllers/Res/CustomerController.cs b/WEB/Controllers/Res/CustomerController.cs index 96d4e0a..4cfc753 100644 --- a/WEB/Controllers/Res/CustomerController.cs +++ b/WEB/Controllers/Res/CustomerController.cs @@ -1,10 +1,12 @@ using CRM.Core.DTO; +using CRM.Core.DTO.Res; using Ninject; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; +using System.Text.RegularExpressions; using System.Web.Mvc; using System.Web.UI; using System.Web.UI.WebControls; @@ -12,6 +14,7 @@ using System.Xml.Serialization; using WX.CRM.BLL.Base; using WX.CRM.BLL.Soft; using WX.CRM.Common; +using WX.CRM.Common.Layui; using WX.CRM.IBLL.Base; using WX.CRM.IBLL.RedisBL; using WX.CRM.IBLL.Res; @@ -979,6 +982,70 @@ namespace WX.CRM.WEB.Areas.Res.Controllers #endregion + [AuthorizeRedirect(Roles = InitRights.CONST_验证码发送状态查询)] + [HttpGet] + public ActionResult SmsRecord() + { + return View(); + } + + [AuthorizeRedirect(Roles = InitRights.CONST_验证码发送状态查询)] + [HttpPost] + public JsonResult GetSmsRecordGetList(Laypage pager, string mobile) + { + var layUidata = new LayuiData(); + try + { + if (string.IsNullOrEmpty(mobile)) + { + layUidata.SetFail(1, "请输入客户Id或者号码"); + return Json(layUidata); + } + mobile = mobile.Trim(); + string umid = mobile; + if (mobile.Length == 11)//表明不是号码了,那么直接是umid + { + umid = _cacheQ.GetUMid(mobile.Trim()); + } + + var webapi = _cacheQ.GetValue_Parameter(Model.Enum.Parameter.zxd_core_webapi_url); + var url = $"{webapi}Api/Customer/GetSmsRecord"; + var para = "umid=" + umid; + var result2 = Utility.GetData(url, para, Encoding.UTF8); + var data = result2.ToObject>>(); + if (data.code != 0) + { + layUidata.SetFail(1, data.message); + return Json(layUidata); + } + foreach (var item in data.data) + { + var hasAccess = (userRoleCodes.Contains("[GLY]") || userRoleCodes.Contains("[ZJ]") || userRoleCodes.Contains("[ZJZL]") || userRoleCodes.Contains("[CKYZM]")); + + if (!hasAccess) + { + item.sms_content = Regex.Replace(item.sms_content, "(\\d{6})", "******"); + } + + if (item.receipt_time.HasValue && item.receipt_time.Value == new DateTime(1990, 1, 1)) + { + item.receipt_time = null; // 默认时间置为空 + } + } + + layUidata.msg = "数据加载成功"; + layUidata.code = 0; + layUidata.data = data.data; + layUidata.count = pager.count; + } + catch (Exception ex) + { + LogHelper.Error(ex.ToString()); + layUidata.SetFail(1, "出现错误!" + ex.Message); + } + return Json(layUidata); + } + private class ResTraceView { public string GroupName { get; set; } diff --git a/WEB/Views/Res/Customer/SmsRecord.cshtml b/WEB/Views/Res/Customer/SmsRecord.cshtml new file mode 100644 index 0000000..848d14f --- /dev/null +++ b/WEB/Views/Res/Customer/SmsRecord.cshtml @@ -0,0 +1,187 @@ +@using WX.CRM.WebHelper; +@{ + ViewBag.Title = "Index"; + Layout = "~/Views/Shared/_content.cshtml"; +} + + + + + + + +
+
+
+
+ 验证码发送状态查找 +
+
+
+
+
+
+
+ +
+
+ + +
+
+ 1、接收状态“成功”,客户确看不到验证码,这种是客户收到验证码了,但是可能手机短信屏蔽了,客户需要手机中翻翻看
+ 2、接收状态“失败”,运营商发送出现了问题,可以拿“返回状态码”翻看运营商对应的错误码
+ 腾讯云错误码查看地址
+ 阿里云错误码查看地址
+
+
+
+
+ +
+
+
+ + + + diff --git a/WEB/WEB.csproj b/WEB/WEB.csproj index 086afa7..38f97dd 100644 --- a/WEB/WEB.csproj +++ b/WEB/WEB.csproj @@ -103,6 +103,9 @@ + + ..\packages\Microsoft.AspNet.WebApi.Core.4.0.30506.0\lib\net40\System.Web.Http.dll + @@ -123,9 +126,6 @@ - - ..\packages\Microsoft.AspNet.WebApi.Core.4.0.30506.0\lib\net40\System.Web.Http.dll - ..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.30506.0\lib\net40\System.Web.Http.WebHost.dll @@ -2106,6 +2106,7 @@ + diff --git a/WebHelper/UserRight/InitRights.cs b/WebHelper/UserRight/InitRights.cs index 49e126b..19a0fb4 100644 --- a/WebHelper/UserRight/InitRights.cs +++ b/WebHelper/UserRight/InitRights.cs @@ -1150,7 +1150,14 @@ namespace WX.CRM.WebHelper RightName = "我的新单活动资源池", ToolBars = InitRights.CreateToolBar(CONST_我的新单活动资源池) }; + public const string CONST_验证码发送状态查询 = "C144"; + public static InnerRight 验证码发送状态查询 = new InnerRight() + { + RightId = CONST_验证码发送状态查询, + RightName = "验证码发送状态查询", + ToolBars = InitRights.CreateToolBar(CONST_验证码发送状态查询) + }; #endregion 客户管理 以C***开头 #region 软件管理 以S***开头