using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using AutoMapper;
|
using AngleSharp.Html.Parser;
|
using DTO;
|
using IServices;
|
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.Bot.Builder.Integration.AspNet.Core;
|
using Microsoft.Extensions.Logging;
|
using Newtonsoft.Json;
|
using System.Net.Http;
|
using System.Threading.Tasks;
|
using zhengcaioa.Models;
|
using zhengcaioa.IService;
|
using CommonToolsCore;
|
using Services;
|
using System.Transactions;
|
using Microsoft.Extensions.Configuration;
|
using Newtonsoft.Json.Linq;
|
using System.Net.Http.Headers;
|
using System.IdentityModel.Tokens.Jwt;
|
|
namespace zhengcaioa.Controllers.BusinessOrder
|
{
|
public class OrderBanciOrderController : Controller
|
{
|
private readonly ILogger<OrderBanciOrderController> _logger;
|
private readonly ILiaotianService _liaotianService;
|
private readonly IOrderBanciService _orderBanciService;
|
private readonly IOrderBanciDtlService _orderBanciDtlService;
|
private readonly IOrderBanciOrderService _orderBanciOrderService;
|
private readonly IFiOrderrecievemoneyService _fiOrderrecievemoneyService;
|
private readonly ICooperOrderService _cooperOrderService;
|
private readonly IConfiguration _configuration;
|
private readonly IHttpClientFactory _clientFactory;
|
private readonly IPltPageService _pltPageService;
|
|
public OrderBanciOrderController(ILogger<OrderBanciOrderController> logger, ILiaotianService liaotianService, IOrderBanciService orderBanciService, IOrderBanciDtlService orderBanciDtlService
|
,IOrderBanciOrderService orderBanciOrderService
|
, IFiOrderrecievemoneyService fiOrderrecievemoneyService
|
, ICooperOrderService cooperOrderService
|
, IConfiguration configuration
|
, IHttpClientFactory clientFactory
|
, IPltPageService pltPageService)
|
{
|
_logger = logger;
|
_liaotianService = liaotianService;
|
_orderBanciService = orderBanciService;
|
_orderBanciDtlService = orderBanciDtlService;
|
_fiOrderrecievemoneyService = fiOrderrecievemoneyService;
|
_orderBanciOrderService = orderBanciOrderService;
|
_cooperOrderService = cooperOrderService;
|
_configuration = configuration;
|
_clientFactory = clientFactory;
|
_pltPageService = pltPageService;
|
}
|
|
[CheckLogin]
|
public IActionResult Index()
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
List<ActionEntity> actionlist = new List<ActionEntity>();
|
ActionEntity actionEntity = new ActionEntity();
|
actionEntity.OpenType = 0;
|
actionEntity.ActionUrl = "";
|
actionEntity.ActionFun = "Search";
|
actionEntity.PageIco = "fa fa-search";
|
actionEntity.ActionName = "查询";
|
actionlist.Add(actionEntity);
|
//ActionEntity actionEntity1 = new ActionEntity();
|
//actionEntity1.OpenType = 0;
|
//actionEntity1.ActionUrl = "";
|
//actionEntity1.ActionFun = "Add";
|
//actionEntity1.PageIco = "fa fa-plus";
|
//actionEntity1.ActionName = "新增";
|
//actionlist.Add(actionEntity1);
|
//ActionEntity actionEntity3 = new ActionEntity();
|
//actionEntity3.OpenType = 0;
|
//actionEntity3.ActionUrl = "";
|
//actionEntity3.ActionFun = "Print";
|
//actionEntity3.PageIco = "fa fa-print";
|
//actionEntity3.ActionName = "打印";
|
//actionlist.Add(actionEntity3);
|
|
|
//ActionEntity actionEntity4 = new ActionEntity();
|
//actionEntity4.OpenType = 0;
|
//actionEntity4.ActionUrl = "";
|
//actionEntity4.ActionFun = "Duanxin";
|
//actionEntity4.PageIco = "";
|
//actionEntity4.ActionName = "发送短信";
|
//actionlist.Add(actionEntity4);
|
var pageEntities = _pltPageService.GetUserPage(curentuser.Id, "/OrderBanciOrder/Index/");
|
var pageEntities1 = pageEntities.Where(x => x.PageMethod == "01").ToList();
|
foreach (var pageEntity in pageEntities1)
|
{
|
ActionEntity actionEntity1 = new ActionEntity();
|
actionEntity1.OpenType = pageEntity.OpenType;
|
actionEntity1.ActionUrl = "";
|
actionEntity1.ActionFun = pageEntity.PageShortcut;
|
actionEntity1.PageIco = pageEntity.PageIco;
|
actionEntity1.ActionName = pageEntity.PageName;
|
actionlist.Add(actionEntity1);
|
}
|
|
ViewData["ActionInfo"] = actionlist;
|
|
ViewBag.kechengleixing = _liaotianService.GetSYScode("order_banci_order", "kechengleixing_id").Where(x=>x.CodeSn=="3").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
ViewBag.Baomingtimebegin = DateTime.Now.AddYears(-1).ToString("yyyy-MM-dd");
|
ViewBag.Baomingtimeend = DateTime.Now.ToString("yyyy-MM-dd");
|
|
return View();
|
|
}
|
[CheckLogin]
|
public IActionResult GetList(OrderBanciOrderDTOSearch search)
|
{
|
//JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
|
return new JsonResult(_orderBanciOrderService.SearchByPaging(search));
|
}
|
|
[CheckLogin]
|
public IActionResult Indexzhuanjia()
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
List<ActionEntity> actionlist = new List<ActionEntity>();
|
ActionEntity actionEntity = new ActionEntity();
|
actionEntity.OpenType = 0;
|
actionEntity.ActionUrl = "";
|
actionEntity.ActionFun = "Search";
|
actionEntity.PageIco = "fa fa-search";
|
actionEntity.ActionName = "查询";
|
actionlist.Add(actionEntity);
|
//ActionEntity actionEntity1 = new ActionEntity();
|
//actionEntity1.OpenType = 0;
|
//actionEntity1.ActionUrl = "";
|
//actionEntity1.ActionFun = "Add";
|
//actionEntity1.PageIco = "fa fa-plus";
|
//actionEntity1.ActionName = "新增";
|
//actionlist.Add(actionEntity1);
|
//ActionEntity actionEntity3 = new ActionEntity();
|
//actionEntity3.OpenType = 0;
|
//actionEntity3.ActionUrl = "";
|
//actionEntity3.ActionFun = "Print";
|
//actionEntity3.PageIco = "fa fa-print";
|
//actionEntity3.ActionName = "打印";
|
//actionlist.Add(actionEntity3);
|
|
|
//ActionEntity actionEntity4 = new ActionEntity();
|
//actionEntity4.OpenType = 0;
|
//actionEntity4.ActionUrl = "";
|
//actionEntity4.ActionFun = "Duanxin";
|
//actionEntity4.PageIco = "";
|
//actionEntity4.ActionName = "发送短信";
|
//actionlist.Add(actionEntity4);
|
|
var pageEntities = _pltPageService.GetUserPage(curentuser.Id, "/OrderBanciOrder/Indexzhuanjia/");
|
var pageEntities1 = pageEntities.Where(x => x.PageMethod == "01").ToList();
|
foreach (var pageEntity in pageEntities1)
|
{
|
ActionEntity actionEntity1 = new ActionEntity();
|
actionEntity1.OpenType = pageEntity.OpenType;
|
actionEntity1.ActionUrl = "";
|
actionEntity1.ActionFun = pageEntity.PageShortcut;
|
actionEntity1.PageIco = pageEntity.PageIco;
|
actionEntity1.ActionName = pageEntity.PageName;
|
actionlist.Add(actionEntity1);
|
}
|
|
ViewData["ActionInfo"] = actionlist;
|
|
var pageEntities2 = pageEntities.Where(x => x.PageMethod == "02").ToList();
|
ViewData["ActionInfo2"] = pageEntities2;
|
|
ViewBag.kechengleixing = _liaotianService.GetSYScode("order_banci_order", "kechengleixing_id").Where(x => x.CodeSn != "3" && x.CodeSn != "7").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
ViewBag.Baomingtimebegin = DateTime.Now.AddYears(-1).ToString("yyyy-MM-dd");
|
ViewBag.Baomingtimeend = DateTime.Now.ToString("yyyy-MM-dd");
|
|
return View();
|
|
}
|
|
|
[CheckLogin]
|
public IActionResult IndexGuwen()
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
List<ActionEntity> actionlist = new List<ActionEntity>();
|
ActionEntity actionEntity = new ActionEntity();
|
actionEntity.OpenType = 0;
|
actionEntity.ActionUrl = "";
|
actionEntity.ActionFun = "Search";
|
actionEntity.PageIco = "fa fa-search";
|
actionEntity.ActionName = "查询";
|
actionlist.Add(actionEntity);
|
//ActionEntity actionEntity1 = new ActionEntity();
|
//actionEntity1.OpenType = 0;
|
//actionEntity1.ActionUrl = "";
|
//actionEntity1.ActionFun = "Add";
|
//actionEntity1.PageIco = "fa fa-plus";
|
//actionEntity1.ActionName = "新增";
|
//actionlist.Add(actionEntity1);
|
//ActionEntity actionEntity3 = new ActionEntity();
|
//actionEntity3.OpenType = 0;
|
//actionEntity3.ActionUrl = "";
|
//actionEntity3.ActionFun = "Print";
|
//actionEntity3.PageIco = "fa fa-print";
|
//actionEntity3.ActionName = "打印";
|
//actionlist.Add(actionEntity3);
|
|
|
//ActionEntity actionEntity4 = new ActionEntity();
|
//actionEntity4.OpenType = 0;
|
//actionEntity4.ActionUrl = "";
|
//actionEntity4.ActionFun = "Duanxin";
|
//actionEntity4.PageIco = "";
|
//actionEntity4.ActionName = "发送短信";
|
//actionlist.Add(actionEntity4);
|
var pageEntities = _pltPageService.GetUserPage(curentuser.Id, "/OrderBanciOrder/IndexGuwen/");
|
var pageEntities1 = pageEntities.Where(x => x.PageMethod == "01").ToList();
|
foreach (var pageEntity in pageEntities1)
|
{
|
ActionEntity actionEntity1 = new ActionEntity();
|
actionEntity1.OpenType = pageEntity.OpenType;
|
actionEntity1.ActionUrl = "";
|
actionEntity1.ActionFun = pageEntity.PageShortcut;
|
actionEntity1.PageIco = pageEntity.PageIco;
|
actionEntity1.ActionName = pageEntity.PageName;
|
actionlist.Add(actionEntity1);
|
}
|
|
ViewData["ActionInfo"] = actionlist;
|
|
ViewBag.kechengleixing = _liaotianService.GetSYScode("order_banci_order", "kechengleixing_id").Where(x => x.CodeSn == "7").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
|
ViewBag.Baomingtimebegin = DateTime.Now.AddYears(-1).ToString("yyyy-MM-dd");
|
ViewBag.Baomingtimeend = DateTime.Now.ToString("yyyy-MM-dd");
|
|
return View();
|
|
}
|
|
|
[CheckLogin]
|
public IActionResult Printhetong(string id = null)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
|
//投诉书
|
var orderBanciOrderDTO = _orderBanciOrderService.Get(id);
|
|
orderBanciOrderDTO.XuefeiName = MoneyToUpperHelper.MoneyToUpper(orderBanciOrderDTO.Xuefei.Value.ToString("0.##"));
|
|
|
var frameworkUser = _cooperOrderService.GetFrameworkUsers(orderBanciOrderDTO.PersonId);
|
if (frameworkUser != null)
|
{
|
orderBanciOrderDTO.Xingming = frameworkUser.Name;
|
orderBanciOrderDTO.Lianxidianhua = frameworkUser.Itcode;
|
}
|
|
|
|
ViewData.Model = orderBanciOrderDTO;
|
return View();
|
}
|
|
[CheckLogin]
|
public IActionResult print(OrderBanciOrderDTOSearch search)
|
{
|
//JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
|
search.rows = 1000;
|
search.page = 1;
|
ViewBag.listLiaotianDTO = _orderBanciOrderService.SearchByPaging(search).DataList as List<OrderBanciOrderDTO>;
|
|
|
|
return View();
|
}
|
|
[CheckLogin]
|
public IActionResult Duanxin(string id = null)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
ViewData["baifangid"] = id;
|
|
|
|
return View();
|
}
|
|
[CheckLogin]
|
public IActionResult Fasong(string neirong, string baifangid)
|
{
|
ResultEntity resultEntity = new ResultEntity();
|
resultEntity.Result = true;
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
List<OrderBanciOrderDTO> result = new List<OrderBanciOrderDTO>();
|
|
if (baifangid != null)
|
{
|
result = _orderBanciOrderService.GetList(baifangid.Split(","));
|
}
|
else
|
{
|
resultEntity.Result = false;
|
resultEntity.Message = "无联系人号码";
|
}
|
string customename = "";
|
StringBuilder number = new StringBuilder(); ;
|
if (result != null && result.Count > 0)
|
{
|
for (int i = 0; i < result.Count; i++)
|
{
|
number.Append(result[i].Lianxidianhua);
|
customename += result[i].Xingming + ",";
|
if (i != result.Count - 1)
|
{
|
number.Append(",");
|
}
|
}
|
}
|
else
|
{
|
resultEntity.Result = false;
|
resultEntity.Message = "无联系人";
|
}
|
|
string sss = SMSHelper.PushWToUserMES(number.ToString(), neirong );
|
if (int.Parse(sss) <= 0)
|
{
|
resultEntity.Result = false;
|
resultEntity.Message = "短信发送失败";
|
return new JsonResult(resultEntity);
|
}
|
|
_logger.LogInformation(curentuser.UserName + "发送短信给客户" + customename);
|
return new JsonResult(resultEntity);
|
}
|
|
|
|
|
/// <summary>
|
/// 保存
|
/// </summary>
|
/// <param name="data">岗位实体类对象</param>
|
/// <returns></returns>
|
///
|
[HttpPost]
|
public IActionResult Save([FromBody] OrderBanciOrderDTO data)
|
{
|
//var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
//ViewData["curentuser"] = curentuser;
|
ReturnMsg<OrderBanciOrderDTO> returnMsg = new ReturnMsg<OrderBanciOrderDTO>();
|
returnMsg.code = 2;
|
try
|
{
|
using (TransactionScope scope = new TransactionScope())
|
{
|
data.RecStatus = "A";
|
if (String.IsNullOrEmpty(data.Id))
|
{
|
data.Creater = "1";
|
data.Createtime = DateTime.Now;
|
}
|
data.Modifier = "1";
|
data.Modifytime = DateTime.Now;
|
|
OrderBanciOrderDTOSearch search = new OrderBanciOrderDTOSearch();
|
search.page = 1;
|
search.rows = 1000;
|
search.BanciId = data.BanciId;
|
ResultDataEntity<OrderBanciOrderDTO> resultDataEntity = _orderBanciOrderService.SearchByPaging(search);
|
|
if (data.Baomingrenshu.HasValue)
|
{
|
//if (resultDataEntity.DataList.Count > 0)
|
//{
|
// var orderBanciOrderDTO = resultDataEntity.DataList.OrderByDescending(x => x.Baomingrenshu).FirstOrDefault();
|
|
// data.Baomingrenshu += orderBanciOrderDTO.Baomingrenshu;
|
//}
|
}
|
else
|
{
|
//if (resultDataEntity.DataList.Count > 0)
|
//{
|
// var orderBanciOrderDTO = resultDataEntity.DataList.OrderByDescending(x => x.Baomingrenshu).FirstOrDefault();
|
|
// data.Baomingrenshu = orderBanciOrderDTO.Baomingrenshu+1;
|
//}
|
//else
|
//{
|
data.Baomingrenshu = 1;
|
//}
|
}
|
data.Jine = resultDataEntity.DataList.Sum(x => x.Xuefei);
|
data.Jine += data.Xuefei;
|
ResultEntity resultEntity = _orderBanciOrderService.save(data);
|
if (resultEntity.Result)
|
{
|
returnMsg.code = 1;
|
returnMsg.count = 1;
|
returnMsg.returnObj = data;
|
}
|
else
|
{
|
returnMsg.error = resultEntity.Message;
|
}
|
scope.Complete();
|
}
|
}
|
catch (Exception ex)
|
{
|
returnMsg.code = 2;
|
returnMsg.error = "没有获取到token";
|
returnMsg.count = 0;
|
|
}
|
|
return new JsonResult(returnMsg);
|
}
|
|
|
/// <summary>
|
/// 保存
|
/// </summary>
|
/// <param name="data">岗位实体类对象</param>
|
/// <returns></returns>
|
///
|
[HttpPost]
|
public IActionResult JifenSave([FromBody] OrderBanciOrderDTO data)
|
{
|
//var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
//ViewData["curentuser"] = curentuser;
|
ReturnMsg<OrderBanciOrderDTO> returnMsg = new ReturnMsg<OrderBanciOrderDTO>();
|
returnMsg.code = 2;
|
try
|
{
|
string userid = "";
|
var headers = Request.Headers;
|
if (headers != null)
|
{
|
//string SecurityKey = _configuration.GetSection("SecurityKey").Value;
|
var keyId = headers["Authorization"].FirstOrDefault();
|
if (string.IsNullOrEmpty("keyId"))
|
{
|
returnMsg.code = 2;
|
returnMsg.error = "没有获取到token";
|
returnMsg.count = 0;
|
|
return new JsonResult(returnMsg);
|
}
|
|
|
JwtSecurityToken jwt = null;
|
var handler = new JwtSecurityTokenHandler();
|
var key1 = keyId.Replace("Bearer", "").Trim();
|
jwt = handler.ReadJwtToken(key1);
|
System.Security.Claims.Claim sss = jwt.Claims.Where(x => x.Type == "id").FirstOrDefault();
|
userid = sss.Value;
|
|
}
|
else
|
{
|
returnMsg.code = 2;
|
returnMsg.error = "没有获取到token";
|
returnMsg.count = 0;
|
return new JsonResult(returnMsg);
|
}
|
|
using (TransactionScope scope = new TransactionScope())
|
{
|
data.RecStatus = "A";
|
if (String.IsNullOrEmpty(data.Id))
|
{
|
data.Creater = "1";
|
data.Createtime = DateTime.Now;
|
}
|
data.Modifier = "1";
|
data.Modifytime = DateTime.Now;
|
data.PersonId = userid;
|
//OrderBanciOrderDTOSearch search = new OrderBanciOrderDTOSearch();
|
//search.page = 1;
|
//search.rows = 1000;
|
//search.BanciId = data.BanciId;
|
//ResultDataEntity<OrderBanciOrderDTO> resultDataEntity = _orderBanciOrderService.SearchByPaging(search);
|
|
if (data.Baomingrenshu.HasValue)
|
{
|
//if (resultDataEntity.DataList.Count > 0)
|
//{
|
// var orderBanciOrderDTO = resultDataEntity.DataList.OrderByDescending(x => x.Baomingrenshu).FirstOrDefault();
|
|
// data.Baomingrenshu += orderBanciOrderDTO.Baomingrenshu;
|
//}
|
}
|
else
|
{
|
//if (resultDataEntity.DataList.Count > 0)
|
//{
|
// var orderBanciOrderDTO = resultDataEntity.DataList.OrderByDescending(x => x.Baomingrenshu).FirstOrDefault();
|
|
// data.Baomingrenshu = orderBanciOrderDTO.Baomingrenshu+1;
|
//}
|
//else
|
//{
|
data.Baomingrenshu = 1;
|
//}
|
}
|
//data.Jine = resultDataEntity.DataList.Sum(x => x.Xuefei);
|
//data.Jine += data.Xuefei;
|
ResultEntity resultEntity = _orderBanciOrderService.save(data);
|
if (resultEntity.Result)
|
{
|
returnMsg.code = 1;
|
returnMsg.count = 1;
|
returnMsg.returnObj = data;
|
}
|
else
|
{
|
returnMsg.error = resultEntity.Message;
|
}
|
int OnePorints = 0;
|
var orderBanciDTO = _orderBanciService.Get(data.BanciId);
|
var orderBanciDtlDTO = _orderBanciDtlService.GetList(data.BanciId).Where(x=>x.Shangxiawu == data.KechengleixingId).FirstOrDefault();
|
if(orderBanciDtlDTO!=null&& orderBanciDtlDTO.Jifen.HasValue)
|
{
|
OnePorints = decimal.ToInt32(orderBanciDtlDTO.Jifen.Value); ;
|
}
|
else
|
{
|
returnMsg.code = 2;
|
returnMsg.error = "该班次不能积分兑换";
|
returnMsg.count = 0;
|
return new JsonResult(returnMsg);
|
}
|
string huiyuanurl = _configuration.GetSection("huiyuanurl").Value;
|
string GetYGYaoQingYonghu = _configuration.GetSection("PassPoints").Value;
|
Uri postUrl2 = new Uri(huiyuanurl + GetYGYaoQingYonghu);
|
JObject questions2 = new JObject();
|
questions2.Add("UserID", data.PersonId);
|
questions2.Add("GoodsName", data.Peixunbanci);
|
questions2.Add("Content", data.Peixunbanci);
|
questions2.Add("ToatlPorints", data.Baomingrenshu.Value* OnePorints);//计算
|
questions2.Add("OnePorints", OnePorints);//计算
|
questions2.Add("Count", data.Baomingrenshu);
|
questions2.Add("OderID", data.Id);
|
questions2.Add("describe", data.Peixunbanci +"积分报名");
|
|
string requestJson2 = questions2.ToString();
|
string result2 = string.Empty;
|
|
result2 = HttpClientRequest.HttpClientPost(postUrl2.ToString(), "POST", requestJson2);
|
|
//using (HttpContent httpContent = new StringContent(requestJson2))
|
//{
|
// httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
|
|
// var httpClient2 = _clientFactory.CreateClient();
|
// httpClient2.Timeout = new TimeSpan(0, 0, 60);
|
// var Result2 = await httpClient2.PostAsync(postUrl2, httpContent);
|
// result2 = Result2.Content.ReadAsStringAsync().Result;
|
//}
|
|
_logger.LogInformation("result2:" + result2);
|
JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2);
|
|
if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1")
|
{
|
string OaWriteTrainClassOder = _configuration.GetSection("OaWriteTrainClassOder").Value;
|
Uri postUrl = new Uri(huiyuanurl + OaWriteTrainClassOder);
|
JObject questions = new JObject();
|
questions.Add("UserID", data.PersonId);
|
questions.Add("TrainClass", data.Peixunbanci);
|
questions.Add("TrainClassType", int.Parse(data.KechengleixingId));
|
questions.Add("Name", data.Xingming);//计算
|
questions.Add("IdentificationNumber", data.Shenfenzheng);//计算
|
questions.Add("PhoneNo", data.Lianxidianhua);
|
questions.Add("StartTime", orderBanciDTO.Shijian.Value.ToString("yyyy-MM-dd HH:mm:ss"));
|
questions.Add("BanciId", data.BanciId);
|
questions.Add("BanciAddr", orderBanciDTO.Didian);
|
questions.Add("PersonCount", data.Baomingrenshu);
|
questions.Add("Ptions", data.Baomingrenshu.Value * OnePorints);
|
string requestJson = questions.ToString();
|
string result = string.Empty;
|
|
result = HttpClientRequest.HttpClientPost(postUrl.ToString(), "POST", requestJson);
|
_logger.LogInformation("result:" + result);
|
scope.Complete();
|
}
|
else
|
{
|
returnMsg.code = 2;
|
returnMsg.error = jobjectresult["msg"].ToString();
|
returnMsg.count = 0;
|
return new JsonResult(returnMsg);
|
}
|
|
|
}
|
}
|
catch (Exception ex)
|
{
|
returnMsg.code = 2;
|
returnMsg.error = "没有获取到token";
|
returnMsg.count = 0;
|
|
}
|
|
return new JsonResult(returnMsg);
|
}
|
|
|
|
//获取当前的报名的人数
|
public IActionResult GetBaoMingRenShu([FromBody] OrderBanciOrderDTOSearch search)
|
{
|
ReturnMsg<List<OrderBanciOrderDTO>> returnMsg = new ReturnMsg<List<OrderBanciOrderDTO>>();
|
returnMsg.code = 2;
|
try
|
{
|
|
search.page = 1;
|
search.rows = 1;
|
ResultDataEntity<OrderBanciOrderDTO> resultDataEntity = _orderBanciOrderService.SearchByPaging(search);
|
|
returnMsg.code = 1;
|
returnMsg.count = search.totalrows;
|
returnMsg.returnObj = resultDataEntity.DataList;
|
|
}
|
catch (Exception ex)
|
{
|
returnMsg.code = 2;
|
returnMsg.error = "没有获取到token";
|
returnMsg.count = 0;
|
|
}
|
return new JsonResult(returnMsg);
|
}
|
|
|
//获取当前的业务类型
|
public IActionResult GetBusinessType()
|
{
|
ReturnMsg<List<SysCodeDtl>> returnMsg = new ReturnMsg<List<SysCodeDtl>>();
|
returnMsg.code = 2;
|
try
|
{
|
var sysCodeDtls = _liaotianService.GetSYScode("CooperVisit", "jtype");
|
|
|
|
returnMsg.code = 1;
|
returnMsg.count = sysCodeDtls.Count;
|
returnMsg.returnObj = sysCodeDtls;
|
|
}
|
catch (Exception ex)
|
{
|
returnMsg.code = 2;
|
returnMsg.error = "没有获取到token";
|
returnMsg.count = 0;
|
|
}
|
return new JsonResult(returnMsg);
|
}
|
|
|
//获取会员订单信息,支付完成的
|
public IActionResult GetOrderByHuiyuanId([FromBody] FiOrderrecievemoneyDTOSearch search)
|
{
|
ReturnMsg<List<FiOrderrecievemoneyDTO>> returnMsg = new ReturnMsg<List<FiOrderrecievemoneyDTO>>();
|
returnMsg.code = 2;
|
try
|
{
|
|
search.page = 1;
|
search.rows = 10000;
|
search.Fkzt = "03";
|
ResultDataEntity<FiOrderrecievemoneyDTO> resultDataEntity = _fiOrderrecievemoneyService.SearchByPaging(search);
|
|
returnMsg.code = 1;
|
returnMsg.count = search.totalrows;
|
returnMsg.returnObj = resultDataEntity.DataList;
|
|
}
|
catch (Exception ex)
|
{
|
returnMsg.code = 2;
|
returnMsg.error = "没有获取到token";
|
returnMsg.count = 0;
|
|
}
|
return new JsonResult(returnMsg);
|
}
|
|
|
/// <summary>
|
/// 保存
|
/// </summary>
|
/// <param name="data">岗位实体类对象</param>
|
/// <returns></returns>
|
///
|
public IActionResult Delete(string OrderId)
|
{
|
//var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
//ViewData["curentuser"] = curentuser;
|
ReturnMsg<OrderBanciOrderDTO> returnMsg = new ReturnMsg<OrderBanciOrderDTO>();
|
returnMsg.code = 2;
|
try
|
{
|
|
ResultEntity resultEntity = _orderBanciOrderService.DeleteStatus(OrderId);
|
if (resultEntity.Result)
|
{
|
returnMsg.code = 1;
|
returnMsg.count = 1;
|
returnMsg.returnObj = null;
|
}
|
else
|
{
|
returnMsg.error = resultEntity.Message;
|
}
|
|
}
|
catch (Exception ex)
|
{
|
returnMsg.code = 2;
|
returnMsg.error = "没有获取到token";
|
returnMsg.count = 0;
|
|
}
|
|
return new JsonResult(returnMsg);
|
}
|
|
|
|
}
|
}
|