新增验证码信息查询功能

This commit is contained in:
liuzhen 2025-07-12 21:50:51 +08:00
parent d6676fcb70
commit c3a234bfee
6 changed files with 345 additions and 3 deletions

View File

@ -107,6 +107,7 @@
<Compile Include="Res\resetPwd.cs" /> <Compile Include="Res\resetPwd.cs" />
<Compile Include="Res\RfmDto.cs" /> <Compile Include="Res\RfmDto.cs" />
<Compile Include="Res\SceneDto.cs" /> <Compile Include="Res\SceneDto.cs" />
<Compile Include="Res\SmsRecordsDto.cs" />
<Compile Include="Res\SoftUserDto.cs" /> <Compile Include="Res\SoftUserDto.cs" />
<Compile Include="Res\Soft_User_GetCheckDTO.cs" /> <Compile Include="Res\Soft_User_GetCheckDTO.cs" />
<Compile Include="Res\TagDto.cs" /> <Compile Include="Res\TagDto.cs" />

View File

@ -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
{
/// <summary>
/// 渠道名称
/// </summary>
public string channel_name { get; set; }
public int id { get; set; }
/// <summary>
/// 资源ID
/// </summary>
public string umid { get; set; }
/// <summary>
/// 脱敏手机号
/// </summary>
public string mobile { get; set; }
/// <summary>
/// 内部单号
/// </summary>
public string trade_no { get; set; }
/// <summary>
/// 外部单号
/// </summary>
public string out_trade_no { get; set; }
/// <summary>
/// 模板类型ID
/// </summary>
public int sms_temp_type_id { get; set; }
/// <summary>
/// 渠道ID
/// </summary>
public int channel_id { get; set; }
/// <summary>
/// 渠道商模板ID
/// </summary>
public string template_id { get; set; }
/// <summary>
/// 短信内容
/// </summary>
public string sms_content { get; set; }
/// <summary>
/// 发送状态 0: 失败 1: 成功
/// </summary>
public bool send_state { get; set; }
/// <summary>
/// 发送时间
/// </summary>
public DateTime send_time { get; set; }
/// <summary>
/// 回执返回值
/// </summary>
public string receipt_code { get; set; }
/// <summary>
/// 回执状态码
/// </summary>
public string receipt_status { get; set; }
/// <summary>
/// 回执接收时间
/// </summary>
public DateTime? receipt_time { get; set; }
/// <summary>
/// 回执成功 0失败 1成功
/// </summary>
public bool receipt_success { get; set; }
}
}

View File

@ -1,10 +1,12 @@
using CRM.Core.DTO; using CRM.Core.DTO;
using CRM.Core.DTO.Res;
using Ninject; using Ninject;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions;
using System.Web.Mvc; using System.Web.Mvc;
using System.Web.UI; using System.Web.UI;
using System.Web.UI.WebControls; using System.Web.UI.WebControls;
@ -12,6 +14,7 @@ using System.Xml.Serialization;
using WX.CRM.BLL.Base; using WX.CRM.BLL.Base;
using WX.CRM.BLL.Soft; using WX.CRM.BLL.Soft;
using WX.CRM.Common; using WX.CRM.Common;
using WX.CRM.Common.Layui;
using WX.CRM.IBLL.Base; using WX.CRM.IBLL.Base;
using WX.CRM.IBLL.RedisBL; using WX.CRM.IBLL.RedisBL;
using WX.CRM.IBLL.Res; using WX.CRM.IBLL.Res;
@ -979,6 +982,70 @@ namespace WX.CRM.WEB.Areas.Res.Controllers
#endregion #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<SmsRecordsDto>();
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<WX.CRM.Common.Employee.ApiResult<List<SmsRecordsDto>>>();
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 private class ResTraceView
{ {
public string GroupName { get; set; } public string GroupName { get; set; }

View File

@ -0,0 +1,187 @@
@using WX.CRM.WebHelper;
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_content.cshtml";
}
<script src="/Scripts/jquery.easyui.min.js" type="text/javascript"></script>
<link href="/Content/themes/blue/easyui.css" rel="stylesheet" />
<link href="/Content/Site.css" rel="stylesheet" />
<script src="/Scripts/common.js"></script>
<link href="/Content/data_grid_list.css" rel="stylesheet" />
<script src="/Scripts/op/jquery.rewrite.js"></script>
<style type="text/css">
.xm-option {
line-height: 30px;
}
.layui-btn-red {
background: #FF4D4D;
}
</style>
<div class="layui-fluid" style="padding-left:0px;padding-top:10px;">
<div class="layui-card" id="topcard" style="width:100%;padding-top:10px;">
<div class="layui-card-header layui-self-header">
<div style="float:left;position:relative;">
验证码发送状态查找
</div>
<div class="hrclass" style="position:relative;float: left;"></div>
</div>
<div class="layui-card-body " id="contentBody">
<form class="layui-form selftopwhere" id="myform">
<div class="layui-form-item">
<div class="layui-inline" style="width:250px">
<input type="text" name="mobile" style="width:250px" required lay-verify="required" placeholder="请输入号码或客户Id" autocomplete="off" class="layui-input" value="">
</div>
<div class="layui-inline">
<input class="layui-btn layui-btn-sm layui-btn-ok" data-method="search" type="button" value="查询" />
<input class="layui-btn layui-btn-sm layui-btn-reset" data-method="reset" type="reset" value="清空" />
</div>
<div style="color:red">
1、接收状态“成功”客户确看不到验证码这种是客户收到验证码了但是可能手机短信屏蔽了,客户需要手机中翻翻看<br />
2、接收状态“失败”运营商发送出现了问题可以拿“返回状态码”翻看运营商对应的错误码<br />
<a target="_blank" href="https://cloud.tencent.com/document/product/382/59177">腾讯云错误码查看地址</a><br />
<a target="_blank" href="https://help.aliyun.com/zh/sms/developer-reference/delivery-receipt-error-codes">阿里云错误码查看地址</a><br />
</div>
</div>
</form>
<table class="layui-hide" id="tab_kefuzhuangtaiyi1" lay-filter="wochao"></table>
<iframe id="BillOpen" width="0" height="0" scrolling="no" frameborder="0" style="display:none;"></iframe>
</div>
</div>
</div>
<!--确定宽度-->
<script>
function onLoadSucced() {
}
</script>
<script>
var selectRow = {};
var winindex;
var layer;
var rowid;
//注意:选项卡 依赖 element 模块,否则无法进行功能性操作
layui.use('element', function () {
var element = layui.element;
element.on('tab(tonghuajiankong)', function (n) {
$(".bodytable").addClass("hidden");
$("#kefuzhuangtai" + (n.index + 1)).removeClass("hidden");
});
element.on('tab(maintab)', function (n) {
if (n.index == 0)
$("#bottomcard").removeClass("hidden");
else
$("#bottomcard").addClass("hidden");
});
});
layui.use(['laypage', 'layer', 'table', 'laydate', 'form'], function () {
var form = layui.form;
var laydate = layui.laydate;
layer = layui.layer;
table = layui.table;
table.render({
id: 'listReload'//列表别名ID
, elem: '#tab_kefuzhuangtaiyi1'
, url: 'GetSmsRecordGetList'
, method: 'POST'
, cellMinWidth: 80 //全局定义常规单元格的最小宽度layui 2.2.1 新增
, page: true
, limit: 90
, height: "full-160"
, autoSort: false
//, size:"sm"
, cols: [[
, { field: 'numbers', type: 'numbers' }
, { field: 'id', title: '消息ID', width: 80 }
, { field: 'umid', title: '客户Id', width: 300 }
, { field: 'mobile', title: '号码', width: 150 }
, { field: 'channel_name', title: '短信运营商', width: 150 }
, { field: 'sms_content', title: '内容', width: 340}
, {
field: 'send_state', title: '发送状态', templet: function (e) {
if (e.send_state) {
return "<font color='green'>成功</font>"
} else {
return "<font color='red'>失败</font>"
}
}, width: 100
}
, { field: 'send_time', title: '发送时间', width: 170 }
, { field: 'receipt_code', title: '返回状态码', width: 120 }
//, { field: 'receipt_status', title: '接收状态', width: 120}
, { field: 'receipt_time', title: '接收时间', width: 170 }
, {
field: 'receipt_success', title: '接收状态', width: 100, templet: function (e) {
if (e.receipt_code) {
if (e.receipt_code == 'DELIVERED' || e.receipt_code == 'DELIVRD') {
return "<font color='green'>成功</font>"
} else {
return "<font color='red'>失败</font>"
}
} else {
return ""
}
}
}
]], where: $("#myform").serializeFormJSON()
,
done: function (res, curr, count) {
$("#isExe").val("");
$("#fiterUser").val("");
}
});
//监听行单击事件单击事件为rowDouble
table.on('row(wochao)', function (obj) {
var data = obj.data;
//console.log(data);
//标注选中样式
obj.tr.addClass('self-table-click').siblings().removeClass('self-table-click');
selectRow = data;
});
table.on('sort(wochao)', function (obj) {
console.log(obj.field);
console.log(obj.type);
table.reload('listReload',
{
initSort: obj
, where: {
sort: obj.field,
order: obj.type
}
})
});
var active = {
search: function () {
var param = $("#myform").serializeFormJSON();
table.reload('listReload', {
where: param,
page: {
curr: 1
}
});
}, reset: function () {
$("#deptid").val("");
selectChannel.reset();
allChannel.forEach(function (item) {
item.selected = false;
})
selectChannel = xmSelect.render(optionsChannel);
selectChannel.update({ data: allChannel });
}
};
$('.layui-btn').on('click', function () {
var othis = $(this), method = othis.data('method');
console.log(method);
active[method] ? active[method].call(this, othis) : '';
});
});
function Closed() {
layer.close(winindex);
}
function TableReload() {
table.reload('listReload', {
});
}
</script>

View File

@ -103,6 +103,9 @@
<Reference Include="System.Web" /> <Reference Include="System.Web" />
<Reference Include="System.Web.Abstractions" /> <Reference Include="System.Web.Abstractions" />
<Reference Include="System.Web.Extensions" /> <Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Http">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.4.0.30506.0\lib\net40\System.Web.Http.dll</HintPath>
</Reference>
<Reference Include="System.Web.Routing" /> <Reference Include="System.Web.Routing" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
@ -123,9 +126,6 @@
</Reference> </Reference>
<Reference Include="System.Net.Http.WebRequest"> <Reference Include="System.Net.Http.WebRequest">
</Reference> </Reference>
<Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.4.0.30506.0\lib\net40\System.Web.Http.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.30506.0\lib\net40\System.Web.Http.WebHost.dll</HintPath> <HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.30506.0\lib\net40\System.Web.Http.WebHost.dll</HintPath>
</Reference> </Reference>
@ -2106,6 +2106,7 @@
<Content Include="Views\Hg\ShowCFD.cshtml" /> <Content Include="Views\Hg\ShowCFD.cshtml" />
<Content Include="Views\Hg\LookNoticeShow.cshtml" /> <Content Include="Views\Hg\LookNoticeShow.cshtml" />
<Content Include="Views\Res\TranUser\Index.cshtml" /> <Content Include="Views\Res\TranUser\Index.cshtml" />
<Content Include="Views\Res\Customer\SmsRecord.cshtml" />
<None Include="Views\StockPools\GetArticle.cshtml" /> <None Include="Views\StockPools\GetArticle.cshtml" />
<Content Include="Views\WeWork\WxResource\WxResourceTab.cshtml" /> <Content Include="Views\WeWork\WxResource\WxResourceTab.cshtml" />
<Content Include="Xml\CacheConfig.xml"> <Content Include="Xml\CacheConfig.xml">

View File

@ -1150,7 +1150,14 @@ namespace WX.CRM.WebHelper
RightName = "我的新单活动资源池", RightName = "我的新单活动资源池",
ToolBars = InitRights.CreateToolBar(CONST_我的新单活动资源池) ToolBars = InitRights.CreateToolBar(CONST_我的新单活动资源池)
}; };
public const string CONST_验证码发送状态查询 = "C144";
public static InnerRight = new InnerRight()
{
RightId = CONST_验证码发送状态查询,
RightName = "验证码发送状态查询",
ToolBars = InitRights.CreateToolBar(CONST_验证码发送状态查询)
};
#endregion C*** #endregion C***
#region S*** #region S***