代码提交

This commit is contained in:
朱小炯 2025-06-28 10:46:35 +08:00
parent 8b968e1c25
commit d6676fcb70
7 changed files with 601 additions and 106 deletions

View File

@ -14,6 +14,8 @@ using WX.CRM.Model.Enum;
using WX.CRM.Model.MAP;
using WX.CRM.BLL.Application.UserComBox;
using WX.CRM.Model.QueryMap;
using System.Data.OracleClient;
using WX.CRM.DAL;
namespace WX.CRM.BLL.Ord
{
@ -401,7 +403,7 @@ namespace WX.CRM.BLL.Ord
#endregion
#region
/// <summary>
/// 获取所有工单的前十五条数据
/// 获取所有工单的前第一条数据
/// </summary>
/// <param name="ResId"></param>
/// <returns></returns>
@ -580,6 +582,49 @@ namespace WX.CRM.BLL.Ord
}
}
public Dictionary<string, LastServerMemoInfo> GetLastServerMemo(IEnumerable<string> resids)
{
using (var db = new crmContext())
{
if (resids == null || !resids.Any())
return new Dictionary<string, LastServerMemoInfo>();
// 修改点1将SqlParameter改为OracleParameter
var parameters = resids.Select((r, i) => new OracleParameter($":p{i}", r)).ToArray();
var inClause = string.Join(",", parameters.Select(p => p.ParameterName));
var sql = $@"
SELECT s.RESID, s.INNERUSERID, s.CTIME
FROM ORD_SERVICEMEMO s
WHERE s.MEMOID IN (
SELECT MAX(s2.MEMOID)
FROM ORD_SERVICEMEMO s2
WHERE s2.RESID IN ({inClause})
GROUP BY s2.RESID
)";
// 修改点2移除不必要的类型转换
//return db.Database.SqlQuery<LastServerMemoResult>(sql, parameters)
// .ToDictionary(
// k => k.RESID,
// v => new LastServerMemoInfo
// {
// UserId = v.INNERUSERID,
// Ctime = v.CTIME
// });
var list = OracleHelper.DataQueray(CommandType.Text, sql, parameters).Tables[0].ToList<LastServerMemoResult>();
return list.ToDictionary(
k => k.RESID,
v => new LastServerMemoInfo
{
UserId = v.INNERUSERID,
Ctime = v.CTIME
});
}
}
#region addtoRedis
private void AddToRedis(ORD_MEMOCONTENT entry, CACHE_ORD_MEMO cacheOrd, bool result = true)
{

View File

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using WX.CRM.Common;
using WX.CRM.Model.MAP;
@ -19,5 +20,21 @@ namespace WX.CRM.IBLL.Ord
List<WX.CRM.Model.Entity.ORD_SERVICEMEMO> GetNoCallTimeByMemoId(decimal[] MemoIds);
List<WX.CRM.Model.Entity.ORD_SERVICEMEMO> GetHgServiceMemo(decimal Memoid, decimal memosubtypeId);
WX.CRM.Model.Entity.ORD_SERVICEMEMO GetHgServiceModel(decimal Memoid);
Dictionary<string, LastServerMemoInfo> GetLastServerMemo(IEnumerable<string> resids);
}
// 新增结果包装类
public class LastServerMemoInfo
{
public decimal? UserId { get; set; }
public DateTime? Ctime { get; set; }
}
// 保持原有查询结果类不变
public class LastServerMemoResult
{
public string RESID { get; set; }
public decimal? INNERUSERID { get; set; }
public DateTime? CTIME { get; set; }
}
}

View File

@ -0,0 +1,153 @@
using Ninject;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
using WX.CRM.BLL.Util;
using WX.CRM.Common;
using WX.CRM.Common.Layui;
using WX.CRM.IBLL.Ord;
using WX.CRM.IBLL.Wx;
using WX.CRM.Model.DTO;
using WX.CRM.Model.QueryMap;
using WX.CRM.WebHelper;
namespace WX.CRM.WEB.Controllers.Res
{
public class TranUserController : Controller
{
[Inject]
public CACHE_BL _cache { get; set; }
[Inject]
public IWX_SZZYMIDPRODUCT _midProduct { get; set; }
[Inject]
public IORD_SERVICEMEMO_Q _ordServerMemo { get; set; }
[HttpGet]
public ActionResult Index()
{
var data = new List<SelectListItem>();
var list = _midProduct.GetList();
foreach (var item in list)
{
data.Add(new SelectListItem() { Text = item.MIDPRODUCTNAME, Value = item.MIDPRODUCTID.ToString() });
}
ViewBag.midproductList = data;
return View();
}
[HttpPost]
public JsonResult Index(WxTranUserQueryDTO dto)
{
//LogHelper.Info($"WxTranUserQueryDTO=>{dto.ToJson()}");
var layUidata = new LayuiData<WxTranUserResultDTO>();
try
{
var host = _cache.GetValue_Parameter("Core_ZxdService_Api");
var url = $"{host}/TranUserHandler.ashx";
// 使用列表收集非空参数
var parameters = new List<string>();
parameters.Add($"action={dto.action}");
if (!string.IsNullOrEmpty(dto.umid)) parameters.Add($"umid={dto.umid}");
if (dto.starttime.HasValue) parameters.Add($"starttime={dto.starttime}");
if (dto.endtime.HasValue) parameters.Add($"endtime={dto.endtime}");
if (!string.IsNullOrEmpty(dto.midproductId)) parameters.Add($"MidProductId={dto.midproductId}");
if (!string.IsNullOrEmpty(dto.subProductId)) parameters.Add($"SubProductId={dto.subProductId}");
if (!string.IsNullOrEmpty(dto.txt_eid)) parameters.Add($"Eid={dto.txt_eid}");
if (!string.IsNullOrEmpty(dto.txt_groupIds)) parameters.Add($"Gid={dto.txt_groupIds}");
if (!string.IsNullOrEmpty(dto.txt_deptId)) parameters.Add($"DeptId={dto.txt_deptId}");
parameters.Add($"page={dto.page}");
parameters.Add($"limit={dto.limit}");
var para = string.Join("&", parameters);
// 删除原来的 umid 判断代码(已整合到参数列表)
LogHelper.Info($"请求url=>{url}?{para}");
var result = Utility.GetData(url, para, Encoding.UTF8);
var data = result.ToObject<LayuiData<WxTranUserResultDTO>>();
var resids = data.data.Select(p => p.ResId).Distinct();
var dic = _ordServerMemo.GetLastServerMemo(resids);
foreach (var item in data.data)
{
if (!string.IsNullOrEmpty(item.Eids))
{
var eidArr = item.Eids.Split(';');
var eidandname = string.Empty;
if(eidArr.Any())
{
foreach (var eid in eidArr)
{
eidandname += InnerUserHelper.Instance.GetEidAndNameByEid(Convert.ToDecimal(eid)) + ";";
}
}
else
{
eidandname = InnerUserHelper.Instance.GetEidAndNameByEid(Convert.ToDecimal(item.Eids));
}
item.Eids = eidandname;
}
if (dic.TryGetValue(item.ResId, out LastServerMemoInfo memo))
{
item.LastServiceTime = memo.Ctime == null ? string.Empty : memo.Ctime.ToString();
item.LastServiceEid = InnerUserHelper.Instance.GetEidAndTrueName(memo.UserId);
}
}
layUidata.msg = "数据加载成功";
layUidata.code = 0;
layUidata.data = data.data;
layUidata.count = data.count;
}
catch (Exception ex)
{
LogHelper.Error(ex.ToString());
layUidata.SetFail(1, "出现错误!" + ex.Message);
}
return Json(layUidata);
}
}
public class WxTranUserQueryDTO
{
public string action { get; set; }
public string umid { get; set; }
public DateTime? starttime { get; set; }
public DateTime? endtime { get; set; }
public string midproductId { get; set; }
public string subProductId { get; set; }
public string txt_groupIds { get; set; }
public string txt_eid { get; set; }
public string txt_departmentid { get; set; }
public string txt_userId { get; set; }
public string txt_deptIds { get; set; }
public string txt_deptId { get; set; }
public int page { get; set; } = 1;
public int limit { get; set; } = 10;
}
public class WxTranUserResultDTO
{
public string SoftUserName { get; set; }
public string Umid { get; set; }
public string ResId { get; set; }
public string CName { get; set; }
public string MidProductId { get; set; }
public string SubProductId { get; set; }
public string SubProductName { get; set; }
public DateTime? EndTime { get; set; }
public string Eids { get; set; }
public string Gids { get; set; }
public string Deptids { get; set; }
public bool HasInComplaint { get; set; }
public bool HasOutComplaint { get; set; }
public string LastServiceTime { get; set; }
public string LastServiceEid { get; set;}
}
}

View File

@ -5144,7 +5144,7 @@ namespace WX.CRM.WEB.Controllers.WeiXin
//产品或服务不适当警示确认书
content = sHelper.encyptData(clientid, "I_DN" + order.SZZYORDERID.ToString());
sign = sHelper.signData(clientid, content);
string cphfwUrl = string.Format("{0}/{4}-产品或服务不适当警示及投资者确认书.pdf ?content={1}&sign={2}&clientId={3}&employeeId={5}&employeeName={6}&viewSource={7}&pageSource={8}",
string cphfwUrl = string.Format("{0}/{4}-产品或服务风险警示及投资者确认书.pdf ?content={1}&sign={2}&clientId={3}&employeeId={5}&employeeName={6}&viewSource={7}&pageSource={8}",
url, HttpUtility.UrlEncode(content), HttpUtility.UrlEncode(sign), clientid, order.SUBPRODUCTNAME,
Eid,
UserName,
@ -5157,7 +5157,7 @@ namespace WX.CRM.WEB.Controllers.WeiXin
//适当性评估结果确认书
content = sHelper.encyptData(clientid, "S_DN" + order.SZZYORDERID.ToString());
sign = sHelper.signData(clientid, content);
string sdxpgUrl = string.Format("{0}/{4}-适当性评估结果确认书.pdf ?content={1}&sign={2}&clientId={3}&employeeId={5}&employeeName={6}&viewSource={7}&pageSource={8}",
string sdxpgUrl = string.Format("{0}/{4}-适当性匹配意见及投资者确认书.pdf ?content={1}&sign={2}&clientId={3}&employeeId={5}&employeeName={6}&viewSource={7}&pageSource={8}",
url, HttpUtility.UrlEncode(content), HttpUtility.UrlEncode(sign), clientid, order.SUBPRODUCTNAME,
Eid,
UserName,
@ -5167,6 +5167,10 @@ namespace WX.CRM.WEB.Controllers.WeiXin
}
}
}
ViewBag.RiskLevel = ret1.riskType.level;
ViewBag.IsC0User = ret1.isC0User;
ViewBag.IsC1_0User = ret1.isC1_0User;
}
////适当性评估结果确认书
@ -6612,16 +6616,32 @@ namespace WX.CRM.WEB.Controllers.WeiXin
public class RiskInfoDto
{
public int ret { get; set; }
public string name { get; set; }
public string idCard { get; set; }
public string answer { get; set; }
public Int64 createTime { get; set; }
public string idCard { get; set; }
public string name { get; set; }
public string key { get; set; }
public string style { get; set; }
public int index { get; set; }
public string version { get; set; }
public string expTime { get; set; }
public RiskType riskType { get; set; }
public int verifyType { get; set; }
public int auditStatus { get; set; }
public string auditRemark { get; set; }
public bool isC0User { get; set; } = false;
public bool isC1_0User { get; set; } = false;
public string businesstype { get; set; }
public int paperId { get; set; }
}
public class RiskType
{
public int min { get; set; }
public int max { get; set; }
public string des { get; set; }
public string name { get; set; }
public string level { get; set; }
}
public class WX_MYSZZYORDER_EXPORT
{

View File

@ -0,0 +1,270 @@
@using WX.CRM.WebHelper
@{
ViewBag.Title = "bas_salesDepartment";
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>
<div class="layui-fluid" style="padding-left:0px;padding-top:10px;">
<style>
.self-table-click td {
background-color: #f3ebbc;
}
</style>
<div class="layui-card" id="topcard" style="width:100%;padding-top:10px;">
<div class="layui-card-body " id="contentBody">
<form class="layui-form selftopwhere" id="myform">
<div class="layui-form-item">
<div class="layui-form-item">
@Html.Action("UserSSOComBox", "Control", new
{
currentRight = WX.CRM.WebHelper.InitRights.CONST_我的订单,
@class = "layui-input", // 添加Layui输入框样式
style = "width:150px;" // 保持与相邻select一致的宽度
})
</div>
客户id
<div class="layui-inline">
<input type="text" name="umid" placeholder="请输入" autocomplete="off" class="layui-input">
</div>
到期时间:
<div class="layui-inline">
<input class="layui-input" placeholder="开始日" name="starttime" id="starttime" style="width:120px;">
</div>
<div class="layui-inline">
<input class="layui-input" placeholder="截止日" name="endtime" id="endtime" style="width:120px;">
</div>
产品大类:
<div class="layui-inline">
<select id="slt_midproductId" name="midproductId"
style="width:150px;height:22px"
lay-filter="midproduct"
onChange="changeMidProduct(this.value)">
<option value="">--请选中产品大类--</option>
@foreach (var item in ViewBag.midproductList as List<SelectListItem>)
{
<option value="@item.Value">@item.Text</option>
}
</select>
</div>
产品小类:
<div class="layui-inline">
<select id="slt_subProductId" name="subProductId" style="width:220px;height:22px">
<option value="">--请选中产品小类--</option>
</select>
</div>
<input class="layui-btn layui-btn-sm layui-btn-ok" data-method="search" type="button" value="查询" />
</div>
</form>
<table class="layui-hide" id="tabl1" lay-filter="tabl1"></table>
</div>
</div>
</div>
<script>
var selectRow = {};
var winindex;
var layer;
var rowid;
//注意:选项卡 依赖 element 模块,否则无法进行功能性操作
layui.use(['laypage', 'layer', 'table', 'laydate', 'form'], function () {
var form = layui.form;
var laydate = layui.laydate;
layer = layui.layer;
table = layui.table;
// 添加表单组件初始化
form.render('select'); // 初始化所有select元素
laydate.render({ elem: '#starttime' });
laydate.render({ elem: '#endtime' });
var token = $.cookie("AuthToken");
var param = $("#myform").serializeFormJSON();
for (let k in param) {
if (param[k] == "") {
delete param[k];
}
}
param.action = "list";
var tableIns = table.render({
id: 'listReload'
, elem: '#tabl1'
, url: '/Res/TranUser'
, method: 'post'
, headers: {
auth: token
}
, cellMinWidth: 80
, page: true
, limit: 20
, limits: [10, 20, 30] // 添加可选分页大小
, height: "full-160"
, size: "sm"
, cols: [[
{ field: 'Umid', title: '客户ID' }
, { field: 'SoftUserName', title: '用户名' }
, { field: 'CName', title: '客户名称' }
, { field: 'SubProductName', title: '产品名称' }
, {
field: 'EndTime',
title: '到期时间',
templet: function(d) {
return formatDate(d.EndTime);
}
}
, {
field: 'RemainDays',
title: '剩余天数',
templet: function(d) {
if (!d.EndTime) return '';
var endDate = new Date(parseInt(d.EndTime.match(/\d+/)[0]));
var today = new Date();
// 设置时间为同一天的0点避免时间差影响天数计算
today.setHours(0, 0, 0, 0);
endDate.setHours(0, 0, 0, 0);
var timeDiff = endDate - today;
var daysDiff = Math.ceil(timeDiff / (1000 * 60 * 60 * 24));
// 已过期显示0当天显示1
return daysDiff < 0 ? 0 : (daysDiff === 0 ? 1 : daysDiff);
}
}
, {
field: 'RiskLevel',
title: '风险标签',
templet: function(d) {
var tags = [];
if (d.HasInComplaint) {
tags.push('<span class="layui-badge layui-bg-orange" style="margin-right:5px;">内诉</span>');
}
if (d.HasOutComplaint) {
tags.push('<span class="layui-badge layui-bg-yellow">外诉</span>');
}
return tags.length ? tags.join('') : '';
},
width: 120 // 设置固定宽度
}
, { field: 'Eids', title: '添加员工' }
, { field: 'LastServiceTime', title: '最新跟进时间' }
, { field: 'LastServiceEid', title: '最新跟进人员' }
//, { field: 'Eids', title: '添加员工' }
]]
, where: param
, parseData: function(res){ // 新增数据解析调试
console.log('响应数据:', res);
return {
"code": res.code,
"msg": res.msg,
"count": res.count,
"data": res.data
};
}
, error: function(res, msg){
console.error('表格加载错误:', res, msg);
}
});
//触发单元格工具事件
table.on('tool(tabl1)', function (obj) {
var data = obj.data;
//console.log(data)
if (obj.event === 'edit') {
layer.open({
title: '明细',
type: 2,
area: ['60%', '80%'],
content: '/WeiXin/Invoice/Detail?id=' + data.Id
});
}
});
//监听行单击事件
table.on('row(tabl1)', function (obj) {
var data = obj.data;
//标注选中样式
console.log(data);
obj.tr.addClass('self-table-click').siblings().removeClass('self-table-click');
selectRow = data;
});
// 在layui.use回调中添加
form.on('select(midproduct)', function (data) {
changeMidProduct(data.value);
});
var active = {
add: function () {
var url = "/WeiXin/Invoice/Add";
layer.open({
title: '发票申请',
type: 2,
maxmin: true,
content: url,
area: ['80%', '70%']
});
},
search: function () {
tableIns.config.where = {};
var param = $("#myform").serializeFormJSON();
for (let k in param) {
if (param[k] == "") {
delete param[k];
}
}
param.action = "list";
tableIns.reload({
where: param,
headers: { auth: token },
page: {
curr: 1 // 重置到第一页但保留分页大小
}
});
}
};
$('.layui-btn').on('click', function () {
var othis = $(this), method = othis.data('method');
console.log(method);
active[method] ? active[method].call(this, othis) : '';
});
});
function changeMidProduct(productId) {
if (productId == 0) {
$("#slt_subProductId").html("<option value='0'>--请选中产品小类--</option>");
layui.form.render('select'); // 修复作用域问题
return;
}
$.r_post("/JzOrder/GetAllSubProductList?productId=0&midproductId=" + productId, function (data) {
$("#slt_subProductId").html("<option value=''>--请选中产品小类--</option>");
$(data).each(function (n, m) {
$("#slt_subProductId").append("<option value='" + m.Value + "'>" + m.Text + "</option>");
});
layui.form.render('select'); // 直接调用layui的form模块
}, "json");
}
function onLoadSucced() {
console.log(1);
//$('#tablist').tablegrid("Search");
}// 在表格初始化前添加日期格式化函数
function formatDate(timestamp) {
if(!timestamp) return '';
// 处理ASP.NET的日期格式 /Date(1574063481000)/
var date = new Date(parseInt(timestamp.match(/\d+/)[0]));
return date.toLocaleDateString();
}
</script>

View File

@ -67,6 +67,25 @@
<p style="color: red">如签名模糊需要重新签订,只需要在原链接上让客户重新签名即可!</p>
</td>
</tr>
<tr>
<td>客户等级:</td>
<td style="color:red">
@if (ViewBag.IsC0User)
{
@Html.Raw("不符合准入条件")
}
else if (ViewBag.IsC1_0User)
{
@Html.Raw("C1_0最低风险承受类别")
}
else
{
@Html.Raw("C" + ViewBag.RiskLevel)
}
</td>
</tr>
@if (!string.IsNullOrEmpty(ViewBag.CONTRACTCODE))
{
<tr>
<td>
合同号:
@ -157,45 +176,14 @@
}
</td>
</tr>
@*<tr>
<td>
<p>合规状态:</p>
@if (ViewBag.RiskCtrlStatus == -1)
{
<p>合规驳回备注:</p>
}
</td>
<td>
@if (ViewBag.RiskCtrlStatus == -1)
{
<span style="color:orange; font-weight:bold;padding-right:20px;">未通过,已驳回</span>
}
else if (ViewBag.RiskCtrlStatus == 0)
{
<span style="font-weight:bold;">未审核</span>
}
else if (ViewBag.RiskCtrlStatus == 1)
{
<span style="font-weight:bold;">分部已审核</span>
}
else if (ViewBag.RiskCtrlStatus == 2)
{
<span style="color: green; font-weight:bold;">已通过</span>
}
else
{
<span>未知</span>
<tr>
<td></td>
<td>未签订合同</td>
</tr>
}
@if (ViewBag.RiskCtrlStatus == -1)
{
<p>@ViewBag.RejectRemark</p>
}
</td>
</tr>*@
@*<tr>
<td><input type="button" value="确认" id="btnSave" /></td>
<td>(备注:风控完成,点击确认按钮提交到总部)</td>
</tr>*@
</table>
@*<a id="threeBtn">切回二要素</a>*@
@*<div id="rejectRemarkDiv">

View File

@ -271,6 +271,7 @@
<Compile Include="Controllers\Res\SeniorSharedPoolController.cs" />
<Compile Include="Controllers\Res\SharedCustomerController.cs" />
<Compile Include="Controllers\Res\SharedPoolController.cs" />
<Compile Include="Controllers\Res\TranUserController.cs" />
<Compile Include="Controllers\Res\VIPCustomerController.cs" />
<Compile Include="Controllers\Res\WXController.cs" />
<Compile Include="Controllers\Sms\BatchModelMsgController.cs" />
@ -2104,6 +2105,7 @@
<Content Include="Views\Hg\ShowTZD.cshtml" />
<Content Include="Views\Hg\ShowCFD.cshtml" />
<Content Include="Views\Hg\LookNoticeShow.cshtml" />
<Content Include="Views\Res\TranUser\Index.cshtml" />
<None Include="Views\StockPools\GetArticle.cshtml" />
<Content Include="Views\WeWork\WxResource\WxResourceTab.cshtml" />
<Content Include="Xml\CacheConfig.xml">