using Core.Web.App_Start; using Core.Web.WebHelper; using CRM.Core.BLL.Util; using CRM.Core.Common; using CRM.Core.Common.Layui; using CRM.Core.Common.WebHelper; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Web.Mvc; namespace Core.Web.Controllers { public class HgComplaintController : BaseController { private CACHE_BL cache_BL = new CACHE_BL(); public readonly string apiPath = ""; public HgComplaintController() { apiPath = cache_BL.GetValue_Parameter(CRM.Core.Model.Enum.Parameter.HgActionUrl) + "Api"; //apiPath = "https://localhost:7263/Api"; } [HttpGet] [AuthorizeRedirect(RightsConfig.CONST_潜在客户管理, ToolBarConfig.CONST_NotButton, true)] public ActionResult Index() { var allChannel = cache_BL.GetDeptDownList(); ViewBag.AllChannel = JsonHelper.ToJson(allChannel); ViewBag.rightCode = RightsConfig.CONST_潜在客户管理; ViewBag.apiPath = apiPath; ViewBag.hgServiceHost = cache_BL.GetValue_Parameter("HgCrm_ServiceHost"); return View(); } [HttpGet] [AuthorizeRedirect(RightsConfig.CONST_退款管理, ToolBarConfig.CONST_Other3, false)] public FileResult ExportData(string param) { var dto = JsonConvert.DeserializeObject(param); Laypage pager = new Laypage { page = 1, limit = 100000, }; //var list = _order.GetList(ref pager, dto); dto.pager = pager; var list = _orderRefund.GetList(dto); LogHelper.Info($"导出查询到{list.Count}数据"); string checkedFilds = Server.UrlDecode(Request.Cookies["checkedFilds"].Value); string checkedTitle = Server.UrlDecode(Request.Cookies["checkedTitles"].Value); Request.Cookies.Remove("checkedFilds");//用完后删除cookies Request.Cookies.Remove("checkedTitles");//用完后删除cookies //string checkedFilds = Request.QueryString["checkedFilds"]; //checkedFilds = checkedFilds.Replace("[]", ""); //string checkedTitles = Request.QueryString["checkedTitles"]; String file = string.Format("OrderList{0}.xls", DateTime.Now.ToLocalTime().ToString("yyyyMMddHHmmssfffff")); return File(ExcelHelper.ExportListModelToExcel(list, "OrderList", 30000, checkedFilds, checkedTitle, DataFormart), "application/ms-excel", file); } [HttpGet] [AuthorizeRedirect(RightsConfig.CONST_潜在客户管理, ToolBarConfig.CONST_Other2, true)] public ActionResult ChangeStatus(int? udid) { ViewBag.udid = udid; ViewBag.apiPath = apiPath; ViewBag.eid = Eid; ViewBag.Uname = UserName; return View(); } [HttpGet] [AuthorizeRedirect(RightsConfig.CONST_潜在客户管理, ToolBarConfig.CONST_Other1, true)] public ActionResult Add() { ViewBag.apiPath = apiPath; var allChannel = cache_BL.GetDeptDownList(); ViewBag.AllChannel = JsonHelper.ToJson(allChannel); return View(); } public ActionResult ComplaintInfo(int complaintLogId) { ViewBag.apiPath = apiPath; ViewBag.complaintLogId = complaintLogId; ViewBag.eid = Eid; ViewBag.Uname = UserName; return View(); } } }