605 lines
25 KiB
C#
605 lines
25 KiB
C#
using Core.Web.App_Start;
|
||
using Core.Web.WebHelper;
|
||
using CRM.Core.BLL.Base;
|
||
using CRM.Core.BLL.Res;
|
||
using CRM.Core.BLL.Soft;
|
||
using CRM.Core.BLL.UserProtocol;
|
||
using CRM.Core.BLL.Util;
|
||
using CRM.Core.BLL.Wx;
|
||
using CRM.Core.Common.Layui;
|
||
using CRM.Core.Common.WebHelper;
|
||
using CRM.Core.Model.Entity;
|
||
using CRM.Core.Model.Enum;
|
||
using Newtonsoft.Json;
|
||
using NPOI.OpenXmlFormats;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.ComponentModel;
|
||
using System.Linq;
|
||
using System.Text;
|
||
using System.Web;
|
||
using System.Web.Helpers;
|
||
using System.Web.Mvc;
|
||
using WX.CRM.Common;
|
||
using WX.CRM.Common.BlowFish;
|
||
using WX.CRM.WebHelper;
|
||
|
||
namespace Core.Web.Controllers
|
||
{
|
||
public class ElderlyInvestmentController : BaseController
|
||
{
|
||
private static USER_PROTOCOL_BL userProtocolbll = new USER_PROTOCOL_BL();
|
||
private BAS_PARAMETER_BL paramter_bl = new BAS_PARAMETER_BL();
|
||
private ValidationErrors errors = new ValidationErrors();
|
||
private CACHE_BL cache_BL = new CACHE_BL();
|
||
/// <summary>
|
||
/// 协议列表
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[AuthorizeRedirect(RightsConfig.CONST_高龄风险确认书, ToolBarConfig.CONST_NotButton, true)]
|
||
public ActionResult Index()
|
||
{
|
||
ViewBag.rightCode = RightsConfig.CONST_高龄风险确认书;
|
||
var companyList = cache_BL.GetCompanyVirtual();
|
||
var allChannel = new List<Dictionary<string, string>>();
|
||
foreach (var company in companyList)
|
||
{
|
||
var channel = new Dictionary<string, string>
|
||
{
|
||
{ "name", company.CompanyName },
|
||
{ "value", company.Channel.Replace(",", ";") }
|
||
};
|
||
allChannel.Add(channel);
|
||
}
|
||
ViewBag.AllChannel = JsonHelper.ToJson(allChannel);
|
||
return View();
|
||
}
|
||
|
||
public JsonResult GetHtmlList(Laypage pager, string columns, string resid, string UMID, string username, string softusername,int? proType, int? status,
|
||
string subname,DateTime? subsdate,DateTime? subedate,string verifyname, DateTime? verifysdate,DateTime? verifyedate, string protocolno, string channel, string orderids)
|
||
{
|
||
pager.order = "desc";
|
||
List<ProListView> list = userProtocolbll.PageList(ref pager, resid, UMID, username, softusername, proType,status, subname,subsdate, subedate, verifyname,verifysdate, verifyedate, protocolno, channel, true, orderids);
|
||
|
||
LayuiData<ProListView> data = new LayuiData<ProListView>()
|
||
{
|
||
msg = "数据加载成功!",
|
||
count = pager.count,
|
||
code = 0,
|
||
data = list
|
||
};
|
||
return Json(data, JsonRequestBehavior.AllowGet);
|
||
}
|
||
|
||
[HttpGet]
|
||
[AuthorizeRedirect(RightsConfig.CONST_高龄风险确认书, ToolBarConfig.CONST_Export, false)]
|
||
public FileResult Export(string resid,string UMID, string username, string softusername, int? proType, int? status,
|
||
string subname, DateTime? subsdate, DateTime? subedate, string verifyname, DateTime? verifysdate, DateTime? verifyedate, string protocolno, string channel, string orderids)
|
||
{
|
||
Laypage pager = new Laypage();
|
||
pager.page = 1;
|
||
pager.limit = 30000;
|
||
List<ProListView> list = userProtocolbll.PageList(ref pager, resid, UMID, username, softusername, proType, status, subname, subsdate, subedate, verifyname, verifysdate, verifyedate, protocolno, channel, true, orderids);
|
||
|
||
List<ProtocolExport> data = new List<ProtocolExport>();
|
||
foreach(var item in list)
|
||
{
|
||
data.Add(new ProtocolExport
|
||
{
|
||
AUDITTIME = item.AUDITTIME,
|
||
UMID = item.UMID,
|
||
USERID = item.USERID,
|
||
CompanyName = item.CompanyName,
|
||
CREATER = item.CREATER,
|
||
CTIME = item.CTIME,
|
||
NOTE = item.NOTE,
|
||
Orderid = item.Orderid,
|
||
PROTOCOLNO = item.PROTOCOLNO,
|
||
PROTOCOLTYPENAME = item.PROTOCOLTYPENAME,
|
||
REVIEWER = item.REVIEWER,
|
||
STATUSNAME = item.STATUSNAME,
|
||
USERNAME = item.USERNAME
|
||
});
|
||
}
|
||
String file = string.Format("高龄风险确认书 {0}.xls", DateTime.Now.ToLocalTime().ToString("yyyyMMddHHmmssfffff"));
|
||
return File(ExcelHelper.ExportListModelToExcel<ProtocolExport>(data, "高龄风险确认书", 30000, null), "application/ms-excel", file);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 编辑
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[AuthorizeRedirect(RightsConfig.CONST_高龄风险确认书, ToolBarConfig.CONST_Edit, true)]
|
||
public ActionResult Edit() {
|
||
return View();
|
||
}
|
||
/// <summary>
|
||
/// 新增
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[AuthorizeRedirect(RightsConfig.CONST_高龄风险确认书, ToolBarConfig.CONST_Add, true)]
|
||
public ActionResult Add()
|
||
{
|
||
//select * from BAS_PARAMETERGROUP
|
||
ViewBag.ParamGroupList= paramter_bl.GetParamGroup();
|
||
|
||
return View();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 编辑2
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[AuthorizeRedirect(RightsConfig.CONST_高龄风险确认书, ToolBarConfig.CONST_Edit, true)]
|
||
public ActionResult Edit2(int ID)
|
||
{
|
||
SecurityHelper sHelper = new SecurityHelper();
|
||
var model = userProtocolbll.GetOne(ID);
|
||
var orderids = userProtocolbll.GetSzzOrderOne(ID);
|
||
var url = paramter_bl.GetValue_Parameter(Parameter.User_Protocol_NewUrl);
|
||
string pdfName = userProtocolbll.ProtocolName(model.PROTOCOLTYPE) + ".pdf";//协议名称
|
||
string timeF = "yyyy年MM月dd日";
|
||
//和解协议
|
||
#region 高龄人群投资风险告知确认书
|
||
var json = new
|
||
{
|
||
ctime = model.CTIME?.ToString(timeF),
|
||
uid = model.USERID,
|
||
agreementNum = model.ID,
|
||
htid = model.PROTOCOLNO,
|
||
sSzzyorderid = orderids
|
||
};
|
||
string clientid = SecurityHelper.OrderClientIdKey;
|
||
string content = sHelper.encyptData(clientid, Utility.ConvertToJSON(json));
|
||
string sign = sHelper.signData(clientid, content);
|
||
|
||
ViewBag.url = url + string.Format("/agreement/elderly-investment-risk-book?content={0}&sign={1}&clientId={2}", HttpUtility.UrlEncode(content), HttpUtility.UrlEncode(sign), clientid);
|
||
ViewBag.pdfName = pdfName;
|
||
//协议文件地址
|
||
if (model.STATUS != 0)
|
||
{
|
||
var pdfurl = paramter_bl.GetValue_Parameter(Parameter.UserCenter_RiaService_SignPdf);
|
||
var pdfcontent = sHelper.encyptData(clientid, string.Format("{0}_D_{1}", model.USERID, model.ID));
|
||
var pdfsign = sHelper.signData(clientid, pdfcontent);
|
||
string fxjssUrl = string.Format("{0}/{4}?content={1}&sign={2}&clientId={3}&employeeId={5}&employeeName={6}&viewSource={7}&pageSource={8}",
|
||
pdfurl,
|
||
HttpUtility.UrlEncode(pdfcontent),
|
||
HttpUtility.UrlEncode(pdfsign),
|
||
clientid,
|
||
pdfName,
|
||
Eid,
|
||
UserName,
|
||
"数智化合规",
|
||
"用户协议"
|
||
);
|
||
ViewBag.pdfUrl = fxjssUrl;
|
||
//ViewBag.pdfUrl = string.Format("{0}/{1}?content={2}&sign={3}&clientId={4}", pdfurl, pdfName, HttpUtility.UrlEncode(pdfcontent), HttpUtility.UrlEncode(pdfsign), clientid);
|
||
}
|
||
else
|
||
{
|
||
ViewBag.pdfUrl = "#";
|
||
}
|
||
|
||
ViewBag.status = model.STATUS;
|
||
#endregion
|
||
ViewBag.model = model;
|
||
ViewBag.Orderids = userProtocolbll.GetOrderOne(ID);
|
||
ViewBag.ModelJson = JsonHelper.ObjDivertToJson(model);
|
||
ViewBag.StatusName = userProtocolbll.StatusName(model.STATUS);
|
||
ViewBag.GiftStatusName = userProtocolbll.GetGiftOrderStatusStr(model.ORDERID);
|
||
return View();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 审核
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[AuthorizeRedirect(RightsConfig.CONST_高龄风险确认书, ToolBarConfig.CONST_Other1, true)]
|
||
public ActionResult Aduit(int ID)
|
||
{
|
||
SecurityHelper sHelper = new SecurityHelper();
|
||
var model = userProtocolbll.GetOne(ID);
|
||
var orderids = userProtocolbll.GetSzzOrderOne(ID);
|
||
var url = paramter_bl.GetValue_Parameter(Parameter.User_Protocol_NewUrl);
|
||
string pdfName = userProtocolbll.ProtocolName(model.PROTOCOLTYPE) + ".pdf";//协议名称
|
||
string timeF = "yyyy年MM月dd日";
|
||
//和解协议
|
||
#region 高龄人群投资风险告知确认书
|
||
var json = new
|
||
{
|
||
ctime = model.CTIME?.ToString(timeF),
|
||
uid = model.USERID,
|
||
agreementNum = model.ID,
|
||
htid = model.PROTOCOLNO,
|
||
sSzzyorderid = orderids
|
||
};
|
||
string clientid = SecurityHelper.OrderClientIdKey;
|
||
string content = sHelper.encyptData(clientid, Utility.ConvertToJSON(json));
|
||
string sign = sHelper.signData(clientid, content);
|
||
|
||
ViewBag.url = url + string.Format("/agreement/elderly-investment-risk-book?content={0}&sign={1}&clientId={2}", HttpUtility.UrlEncode(content), HttpUtility.UrlEncode(sign), clientid);
|
||
ViewBag.pdfName = pdfName;
|
||
//协议文件地址
|
||
if (model.STATUS != 0)
|
||
{
|
||
var pdfurl = paramter_bl.GetValue_Parameter(Parameter.UserCenter_RiaService_SignPdf);
|
||
var pdfcontent = sHelper.encyptData(clientid, string.Format("{0}_D_{1}", model.USERID, model.ID));
|
||
var pdfsign = sHelper.signData(clientid, pdfcontent);
|
||
string fxjssUrl = string.Format("{0}/{4}?content={1}&sign={2}&clientId={3}&employeeId={5}&employeeName={6}&viewSource={7}&pageSource={8}",
|
||
pdfurl,
|
||
HttpUtility.UrlEncode(pdfcontent),
|
||
HttpUtility.UrlEncode(pdfsign),
|
||
clientid,
|
||
pdfName,
|
||
Eid,
|
||
UserName,
|
||
"数智化合规",
|
||
"用户协议"
|
||
);
|
||
ViewBag.pdfUrl = fxjssUrl;
|
||
//ViewBag.pdfUrl = string.Format("{0}/{1}?content={2}&sign={3}&clientId={4}", pdfurl, pdfName, HttpUtility.UrlEncode(pdfcontent), HttpUtility.UrlEncode(pdfsign), clientid);
|
||
}
|
||
else
|
||
{
|
||
ViewBag.pdfUrl = "#";
|
||
}
|
||
|
||
ViewBag.status = model.STATUS;
|
||
#endregion
|
||
ViewBag.model = model;
|
||
ViewBag.Orderids = userProtocolbll.GetOrderOne(ID);
|
||
ViewBag.ModelJson = JsonHelper.ObjDivertToJson(model);
|
||
ViewBag.StatusName = userProtocolbll.StatusName(model.STATUS);
|
||
ViewBag.GiftStatusName = userProtocolbll.GetGiftOrderStatusStr(model.ORDERID);
|
||
return View();
|
||
}
|
||
/// <summary>
|
||
/// 数据插入
|
||
/// </summary>
|
||
/// <param name="model"></param>
|
||
/// <returns></returns>
|
||
public JsonResult Save(SubmitModel model) {
|
||
SYS_USER_PROTOCOL d = new SYS_USER_PROTOCOL();
|
||
//d.RESID = model.resid;
|
||
RES_CUSTOMER_BL res_customer_BL = new RES_CUSTOMER_BL();
|
||
d.RESID = res_customer_BL.getResCustomerByUmId(model.resid)?.RESID;
|
||
d.USERNAME = model.username;
|
||
d.PROTOCOLTYPE = model.protocolType;
|
||
d.PRODUCTTYPE = model.producttype;
|
||
d.SERVICENAME = model.servicename;
|
||
d.PRODUCTNAME = model.productname;
|
||
d.GIFTDAYS = model.giftdays ?? 0;
|
||
d.ORDERID = model.orderid;
|
||
d.PRICE = model.price ?? 0;
|
||
d.USERID = model.userid;
|
||
d.NOTE = model.note ?? "";
|
||
d.STATUS = 0;//默认未签订
|
||
d.CTIME = DateTime.Now;
|
||
d.creater = UserName;
|
||
d.PROTOCOLNO = CreateProtocolNo(model.protocolType);
|
||
//退款金额判断
|
||
if ((ProtocolType)model.protocolType == ProtocolType.退款和解协议)
|
||
{
|
||
WX_SZZYORDER_BL wx_SzzyOrder_BL = new WX_SZZYORDER_BL();
|
||
WX_SzzyOrderRefund_BL wx_szzyorderrefund_BL = new WX_SzzyOrderRefund_BL();
|
||
var list = wx_SzzyOrder_BL.GetModelByResId(model.resid);//查询订单
|
||
var refundList = wx_szzyorderrefund_BL.GetListByResid(model.resid);
|
||
var sumPrice = list.Where(m=> "80,90,200,205,220".Split(',').Contains(m.ORDERSTATUS)).Sum(m => m.ARRIVALPAY);
|
||
sumPrice -= refundList.Sum(m => m.refundprice);
|
||
if ((model.price ?? 0) > sumPrice) {
|
||
return Json(new { s = false,m= "退款金额不能大于(客户各订单到账金额总和-已退款金额)!" }, JsonRequestBehavior.AllowGet);
|
||
}
|
||
}
|
||
//验证通过后插入
|
||
var res = userProtocolbll.Create(ref errors,d);
|
||
if (!string.IsNullOrEmpty(model.orderids))
|
||
{
|
||
foreach (var orderid in model.orderids.Split(','))
|
||
{
|
||
if (int.TryParse(orderid, out int id))
|
||
{
|
||
userProtocolbll.CreateOrder(ref errors, new USER_PROTOCOL_ORDER
|
||
{
|
||
Orderid = id,
|
||
ProtocolId = d.ID
|
||
});
|
||
}
|
||
}
|
||
}
|
||
if (res)
|
||
{
|
||
return Json(new { s = true }, JsonRequestBehavior.AllowGet);
|
||
}
|
||
else {
|
||
|
||
return Json(new { s =false, errors }, JsonRequestBehavior.AllowGet);
|
||
}
|
||
|
||
}
|
||
|
||
private string CreateProtocolNo(int protocolType)
|
||
{
|
||
var no = "";
|
||
switch ((ProtocolType)protocolType)
|
||
{
|
||
case ProtocolType.退款和解协议:
|
||
case ProtocolType.不退款和解协议:
|
||
no = "HJ";
|
||
break;
|
||
case ProtocolType.退款赠与协议:
|
||
case ProtocolType.不退款赠与协议:
|
||
no = "ZY";
|
||
break;
|
||
case ProtocolType.撤销投诉协议:
|
||
no = "CX";
|
||
break;
|
||
case ProtocolType.高龄人群投资风险告知确认书:
|
||
no = "GL";
|
||
break;
|
||
|
||
}
|
||
no += $"{DateTimeOffset.Now.ToUnixTimeMilliseconds()}";
|
||
return no;
|
||
}
|
||
|
||
[AuthorizeRedirect(RightsConfig.CONST_高龄风险确认书, ToolBarConfig.CONST_Delete, false)]
|
||
public JsonResult Delete(int ID)
|
||
{
|
||
if (!userProtocolbll.Delete(ref errors, ID))
|
||
{
|
||
return Json(new { s = false, m = errors.First().ErrorMessage }, JsonRequestBehavior.AllowGet);
|
||
}
|
||
return Json(new { s = true, m = "操作成功!" }, JsonRequestBehavior.AllowGet);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 签订协议
|
||
/// </summary>
|
||
/// <param name="ID"></param>
|
||
/// <returns></returns>
|
||
[AuthorizeRedirect(RightsConfig.CONST_高龄风险确认书, ToolBarConfig.CONST_Other1, false)]
|
||
public JsonResult SignProtocol(int ID, int status)
|
||
{
|
||
try
|
||
{
|
||
var model = userProtocolbll.GetOne(ID);
|
||
var orderids = userProtocolbll.GetOrderOne(ID);
|
||
if (model != null && (model.STATUS == 1 || model.STATUS == -1))
|
||
{
|
||
var data = new
|
||
{
|
||
htid = model.PROTOCOLNO,
|
||
contractStatus = status
|
||
};
|
||
var url = paramter_bl.GetValue_Parameter(Parameter.User_Protocol_NewUrl);
|
||
SecurityHelper sHelper = new SecurityHelper();
|
||
string clientid = SecurityHelper.OrderClientIdKey;
|
||
string content = sHelper.encyptData(clientid, Utility.ConvertToJSON(data));
|
||
string sign = sHelper.signData(clientid, content);
|
||
url += $"/v1/api/contract/update/contract/status?content={content}&sign={sign}&clientId={clientid}";
|
||
var result = Utility.PostAjaxData(url, "", Encoding.UTF8);
|
||
var responese = JsonConvert.DeserializeObject<WX.CRM.Common.Employee.ApiResult>(result);
|
||
if (responese.code == 0)
|
||
{
|
||
var res = userProtocolbll.AuditModel(ID, status, UserName, orderids);//审核通过
|
||
return Json(new { s = res }, JsonRequestBehavior.AllowGet);
|
||
}
|
||
else
|
||
{
|
||
return Json(new { s = false, m = responese.message }, JsonRequestBehavior.AllowGet);
|
||
}
|
||
}
|
||
else {
|
||
return Json(new { s = false,m="签署后才能审核!" }, JsonRequestBehavior.AllowGet);
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
return Json(new { s = false,m=ex.Message }, JsonRequestBehavior.AllowGet);
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 编辑字段
|
||
/// </summary>
|
||
/// <param name="ID"></param>
|
||
/// <param name="field"></param>
|
||
/// <param name="orderids"></param>
|
||
/// <returns></returns>
|
||
public JsonResult EditField(int? ID, string field, string orderids)
|
||
{
|
||
try
|
||
{
|
||
if (!ID.HasValue)
|
||
{
|
||
return Json(new { s = false, m = "ID必填" }, JsonRequestBehavior.AllowGet);
|
||
}
|
||
|
||
if (string.IsNullOrEmpty(field))
|
||
{
|
||
return Json(new { s = false, m = "field必填" }, JsonRequestBehavior.AllowGet);
|
||
}
|
||
|
||
if (string.IsNullOrEmpty(orderids))
|
||
{
|
||
return Json(new { s = false, m = "请填写订单号" }, JsonRequestBehavior.AllowGet);
|
||
}
|
||
|
||
var order_ids = new List<decimal>();
|
||
var parts = orderids.Split(',');
|
||
foreach (var p in parts)
|
||
{
|
||
if (!decimal.TryParse(p, out decimal orderid))
|
||
{
|
||
return Json(new { s = false, m = "订单号无效" }, JsonRequestBehavior.AllowGet);
|
||
}
|
||
|
||
order_ids.Add(orderid);
|
||
}
|
||
|
||
var model = userProtocolbll.GetOne(ID.Value);
|
||
if (model == null)
|
||
{
|
||
return Json(new { s = false, m = $"参数ID无效:{ID}!" }, JsonRequestBehavior.AllowGet);
|
||
}
|
||
|
||
if (model.STATUS != 0)
|
||
{
|
||
return Json(new { s = false, m = $"该协议状态不是未签订,无法被编辑" }, JsonRequestBehavior.AllowGet);
|
||
}
|
||
|
||
|
||
var res = userProtocolbll.EditField(ID.Value, field, order_ids.ToArray());
|
||
return Json(new { s = res }, JsonRequestBehavior.AllowGet);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
return Json(new { s = false, m = ex.Message }, JsonRequestBehavior.AllowGet);
|
||
}
|
||
}
|
||
|
||
public JsonResult UserInfo(string resid)
|
||
{
|
||
WX_SZZYORDER_BL wx_SzzyOrder_BL = new WX_SZZYORDER_BL();
|
||
SOFT_USER_BL soft_user_bl = new SOFT_USER_BL();
|
||
|
||
if (string.IsNullOrEmpty(resid)) {
|
||
return Json(new {s=false }, JsonRequestBehavior.AllowGet);
|
||
}
|
||
var list = soft_user_bl.GetUserByResid(resid);
|
||
if (list.Any())
|
||
{
|
||
var userNameList = list.GroupBy(m => m.USERNAME).Select(m => m.Key);
|
||
var webapi = cache_BL.GetValue_Parameter(Parameter.Hg_Core_WebApi); //新地址
|
||
var url = $"{webapi}/api/Customer/Username"; // 新地址拼接
|
||
var cName = "";
|
||
foreach (var userName in userNameList)
|
||
{
|
||
if (string.IsNullOrEmpty(userName)) continue;
|
||
var para = $"softname={userName}";
|
||
if (string.IsNullOrEmpty(cName))
|
||
{
|
||
var result = Utility.GetData(url, para, Encoding.UTF8);
|
||
var data = JsonConvert.DeserializeObject<WX.CRM.Common.Employee.ApiResult<string>>(result);
|
||
if (data.code == 0)
|
||
{
|
||
cName = data.data;
|
||
if (string.IsNullOrEmpty(cName))
|
||
{
|
||
var bf = "{\"uid\": \"" + userName + "\"}";
|
||
var hqr = BlowFish.encode(bf);
|
||
var para2 = new { hqr };
|
||
string riskurl = paramter_bl.GetValue_Parameter(Parameter.UserCenter_RiaService_Risk);//封装出来的接口
|
||
if (string.IsNullOrEmpty(riskurl))
|
||
riskurl = "https://r2.soft.dn8188.com/riskevaluate/h5/get_riskinfo";
|
||
var res = Utility.PostAjaxData(riskurl, para2.ToJson(), Encoding.UTF8);
|
||
var ret = JsonHelper.JsonDivertToObj<RiskInfoDto>(res);
|
||
if (ret.ret == 0 || ret.ret == -104)
|
||
{
|
||
cName = ret.name;
|
||
continue;
|
||
}
|
||
}
|
||
continue;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
break;
|
||
}
|
||
}
|
||
|
||
var orders = wx_SzzyOrder_BL.GetElderlyInvestmentOrders(resid);
|
||
var orderList = orders.Select(x => new { name = x.ORDERID.ToString(), value = x.ORDERID.ToString(), cname = x.CNAME, softusername = x.SOFTUSERNAME });
|
||
if (!orderList.Any())
|
||
{
|
||
return Json(new { s = false, m = "用户无可申请协议的订单!" }, JsonRequestBehavior.AllowGet);
|
||
}
|
||
if (string.IsNullOrEmpty(cName))
|
||
{
|
||
return Json(new { s = false, m = "用户未实名!" }, JsonRequestBehavior.AllowGet);
|
||
}
|
||
return Json(new {s=true,d= new { userNameList, cName, orderList } }, JsonRequestBehavior.AllowGet);
|
||
}
|
||
else
|
||
{
|
||
return Json(new { s = false, m = "操作失败, 用户信息错误!" }, JsonRequestBehavior.AllowGet);
|
||
}
|
||
}
|
||
public class SubmitModel
|
||
{
|
||
public string resid { get; set; }
|
||
public string userid { get; set; }
|
||
public string username { get; set; }
|
||
public int protocolType { get; set; }
|
||
|
||
/// <summary>
|
||
/// 产品类型
|
||
/// </summary>
|
||
public int? producttype { get; set; }
|
||
/// <summary>
|
||
/// 赠送产品id
|
||
/// </summary>
|
||
public decimal? orderid { get; set; }
|
||
/// <summary>
|
||
/// 赠送产品名称
|
||
/// </summary>
|
||
public string productname { get; set; }
|
||
/// <summary>
|
||
/// 赠送服务名称
|
||
/// </summary>
|
||
public string servicename { get; set; }
|
||
/// <summary>
|
||
/// 赠送天数
|
||
/// </summary>
|
||
public int? giftdays { get; set; }
|
||
|
||
public decimal? price { get; set; }
|
||
public string note { get; set; }
|
||
|
||
public string orderids { get; set; }
|
||
}
|
||
|
||
public class ProtocolExport
|
||
{
|
||
[DisplayName("协议编号")]
|
||
public string PROTOCOLNO { get; set; }
|
||
|
||
[DisplayName("事业部")]
|
||
public string CompanyName { get; set; }
|
||
|
||
[DisplayName("客户id")]
|
||
public string UMID { get; set; }
|
||
|
||
[DisplayName("客户姓名")]
|
||
public string USERNAME { get; set; }
|
||
|
||
[DisplayName("用户名")]
|
||
public string USERID { get; set; }
|
||
|
||
[DisplayName("订单")]
|
||
public string Orderid { get; set; }
|
||
|
||
[DisplayName("协议")]
|
||
public string PROTOCOLTYPENAME { get; set; }
|
||
|
||
[DisplayName("协议状态")]
|
||
public string STATUSNAME { get; set; }
|
||
|
||
[DisplayName("备注")]
|
||
public string NOTE { get; set; }
|
||
|
||
[DisplayName("创建人")]
|
||
public string CREATER { get; set; }
|
||
|
||
[DisplayName("创建时间")]
|
||
public DateTime? CTIME { get; set; }
|
||
|
||
[DisplayName("审核人")]
|
||
public string REVIEWER { get; set; }
|
||
|
||
[DisplayName("审核时间")]
|
||
public DateTime? AUDITTIME { get; set; }
|
||
}
|
||
}
|
||
} |