| | |
| | | using CommonToolsCore; |
| | | using Services; |
| | | using System.Transactions; |
| | | using System.IdentityModel.Tokens.Jwt; |
| | | |
| | | namespace zhengcaioa.Controllers.BusinessOrder |
| | | { |
| | | [CheckLogin] |
| | | |
| | | public class CooperOrderController : Controller |
| | | { |
| | | private readonly ILogger<CooperOrderController> _logger; |
| | |
| | | _fiMemberService = fiMemberService; |
| | | } |
| | | |
| | | |
| | | [CheckLogin] |
| | | public IActionResult Index() |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | |
| | | 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); |
| | | |
| | | ViewData["ActionInfo"] = actionlist; |
| | | |
| | | List<PageEntity> pageEntities = _pltPageService.GetUserPage(curentuser.Id, "/CooperOrder/Index/"); |
| | |
| | | |
| | | ViewBag.PingjiaStatus = _liaotianService.GetSYScode("CooperOrder", "pingjia_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); |
| | | |
| | | ViewBag.ShouliStatus = _liaotianService.GetSYScode("CooperOrder", "shouli_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); |
| | | return View(); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | [CheckLogin] |
| | | public IActionResult GetList(CooperOrderDTOSearch search) |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ViewData["curentuser"] = curentuser; |
| | | search.Creater = curentuser.Id; |
| | | //search.Creater = curentuser.Id; |
| | | //JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver()); |
| | | return new JsonResult(_cooperOrderService.SearchByPaging(search)); |
| | | } |
| | | |
| | | |
| | | [CheckLogin] |
| | | public IActionResult ShouliList() |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | |
| | | return View(); |
| | | |
| | | } |
| | | |
| | | [CheckLogin] |
| | | public IActionResult GetListshouli(CooperOrderDTOSearch search) |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | [CheckLogin] |
| | | public IActionResult ChedanList() |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | |
| | | return View(); |
| | | |
| | | } |
| | | |
| | | [CheckLogin] |
| | | public IActionResult GetListchedan(CooperOrderDTOSearch search) |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | |
| | | return new JsonResult(_cooperOrderService.SearchByPaging(search)); |
| | | } |
| | | |
| | | |
| | | [CheckLogin] |
| | | public IActionResult WangongList() |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | |
| | | return View(); |
| | | |
| | | } |
| | | |
| | | [CheckLogin] |
| | | public IActionResult GetListwangong(CooperOrderDTOSearch search) |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | |
| | | //JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver()); |
| | | return new JsonResult(_cooperOrderService.SearchByPaging(search)); |
| | | } |
| | | |
| | | [CheckLogin] |
| | | public IActionResult SonghuoList() |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | |
| | | return View(); |
| | | |
| | | } |
| | | |
| | | [CheckLogin] |
| | | public IActionResult GetListsonghuo(CooperOrderDTOSearch search) |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | |
| | | //JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver()); |
| | | return new JsonResult(_cooperOrderService.SearchByPaging(search)); |
| | | } |
| | | |
| | | [CheckLogin] |
| | | public IActionResult HuifangList() |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | |
| | | return View(); |
| | | |
| | | } |
| | | |
| | | [CheckLogin] |
| | | public IActionResult GetListHuifang(CooperOrderDTOSearch search) |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | |
| | | //JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver()); |
| | | return new JsonResult(_cooperOrderService.SearchByPaging(search)); |
| | | } |
| | | |
| | | [CheckLogin] |
| | | public IActionResult PingjiaList() |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | |
| | | return View(); |
| | | |
| | | } |
| | | |
| | | [CheckLogin] |
| | | public IActionResult GetListPingjia(CooperOrderDTOSearch search) |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | |
| | | actionEntity.ActionName = "查询"; |
| | | actionlist.Add(actionEntity); |
| | | |
| | | |
| | | |
| | | ViewData["ActionInfo"] = actionlist; |
| | | |
| | | ViewBag.OrderType = _liaotianService.GetSYScode("CooperVisit", "jtype").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); |
| | |
| | | return View(); |
| | | |
| | | } |
| | | |
| | | [CheckLogin] |
| | | public IActionResult GetListYouhui(CooperOrderDTOSearch search) |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | |
| | | //JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver()); |
| | | return new JsonResult(_cooperOrderService.SearchByPaging(search)); |
| | | } |
| | | [CheckLogin] |
| | | public IActionResult Edit(string id = null, string ShouliStatus = "1") |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | |
| | | else |
| | | { |
| | | dto.XdTime = DateTime.Now; |
| | | dto.OrderNum = 1; |
| | | ViewBag.ShouliStatus = "1"; |
| | | } |
| | | |
| | |
| | | /// <param name="data">岗位实体类对象</param> |
| | | /// <returns></returns> |
| | | /// |
| | | [CheckLogin] |
| | | [HttpPost] |
| | | public IActionResult Save(CooperOrderDTO data) |
| | | { |
| | |
| | | /// <param name="info">实体</param> |
| | | /// <returns></returns> |
| | | /// |
| | | [CheckLogin] |
| | | public IActionResult Nullify(string Id = "") |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | |
| | | /// <param name="data">岗位实体类对象</param> |
| | | /// <returns></returns> |
| | | /// |
| | | |
| | | [CheckLogin] |
| | | public IActionResult Shouli(string id) |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ViewData["curentuser"] = curentuser; |
| | | CooperOrderDTO dto= new CooperOrderDTO(); |
| | | dto.Id = id; |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | resultEntity.Result = false; |
| | | |
| | | CooperOrderDTO dto = _cooperOrderService.Get(id); |
| | | if(dto.ShouliStatus != "1") |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "只有已下单状态的订单才能受理"; |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | |
| | | dto.Shoulier = curentuser.Id; |
| | | dto.Shoulitime = DateTime.Now; |
| | | dto.ShouliStatus = "2"; |
| | | |
| | | ResultEntity resultEntity = _cooperOrderService.shouli(dto); |
| | | resultEntity = _cooperOrderService.shouli(dto); |
| | | |
| | | return new JsonResult(resultEntity); |
| | | } |
| | |
| | | /// <param name="data">岗位实体类对象</param> |
| | | /// <returns></returns> |
| | | /// |
| | | |
| | | [CheckLogin] |
| | | public IActionResult Wangong(string id) |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 送货 |
| | | /// </summary> |
| | | /// <param name="data">岗位实体类对象</param> |
| | | /// <returns></returns> |
| | | /// |
| | | |
| | | public IActionResult Songhuo(string id) |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ViewData["curentuser"] = curentuser; |
| | | CooperOrderDTO dto = _cooperOrderService.Get(id); |
| | | // dto.Id = id; |
| | | dto.Songhuoer = curentuser.Id; |
| | | dto.Songhuotime = DateTime.Now; |
| | | dto.ShouliStatus = "5"; |
| | | |
| | | ResultEntity resultEntity = _cooperOrderService.save(dto); |
| | | |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | |
| | | [CheckLogin] |
| | | public IActionResult Chedan(string id = null) |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | |
| | | |
| | | return View(); |
| | | } |
| | | |
| | | [CheckLogin] |
| | | public IActionResult chedantuihuan(decimal Price, string Chedanid) |
| | | { |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | resultEntity.Result = true; |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ViewData["curentuser"] = curentuser; |
| | | |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | resultEntity.Result = false; |
| | | |
| | | CooperOrderDTO dto = _cooperOrderService.Get(Chedanid); |
| | | if (dto.ShouliStatus != "2") |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "只有受理状态的订单才能撤单"; |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | |
| | | |
| | | CooperOrderDTO dto = new CooperOrderDTO(); |
| | | dto.Id = Chedanid; |
| | | dto.Chedaner = curentuser.Id; |
| | | dto.Chedantime = DateTime.Now; |
| | | dto.ChedanStatus = "A"; |
| | |
| | | |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | |
| | | [CheckLogin] |
| | | public IActionResult Huifang(string id = null) |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ViewData["curentuser"] = curentuser; |
| | | ViewData["Huifangid"] = id; |
| | | |
| | | |
| | | ViewData["PingjiaStatus"] = _liaotianService.GetSYScode("CooperOrder", "pingjia_status"); |
| | | ViewData.Model = _cooperOrderService.Get(id); |
| | | |
| | | return View(); |
| | | } |
| | | |
| | | public IActionResult Huifangtuihuan(string Huifangremark, string Huifangid) |
| | | [CheckLogin] |
| | | public IActionResult Huifangtuihuan(CooperOrderDTO dto) |
| | | { |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | resultEntity.Result = true; |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ViewData["curentuser"] = curentuser; |
| | | |
| | | CooperOrderDTO dto = new CooperOrderDTO(); |
| | | dto.Id = Huifangid; |
| | | |
| | | |
| | | dto.Huifanger = curentuser.Id; |
| | | dto.Huifangtime = DateTime.Now; |
| | | dto.HuifangStatus = "A"; |
| | | dto.Huifangremark = Huifangremark; |
| | | |
| | | |
| | | resultEntity = _cooperOrderService.huifang(dto); |
| | | |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 送货 |
| | | /// </summary> |
| | | /// <param name="data">岗位实体类对象</param> |
| | | /// <returns></returns> |
| | | /// |
| | | [CheckLogin] |
| | | public IActionResult Songhuo(string id) |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ViewData["curentuser"] = curentuser; |
| | | ViewData["Huifangid"] = id; |
| | | |
| | | var cooperOrderDTO = _cooperOrderService.Get(id); |
| | | if (!cooperOrderDTO.SonghuoTime1.HasValue) |
| | | { |
| | | cooperOrderDTO.SonghuoTime1 = DateTime.Now; |
| | | } |
| | | |
| | | ViewData.Model = cooperOrderDTO; |
| | | |
| | | return View(); |
| | | |
| | | |
| | | } |
| | | |
| | | [CheckLogin] |
| | | public IActionResult Songhuotuihuan(CooperOrderDTO dto) |
| | | { |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | resultEntity.Result = true; |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ViewData["curentuser"] = curentuser; |
| | | var cooperOrderDTO = _cooperOrderService.Get(dto.Id); |
| | | if (cooperOrderDTO.ShouliStatus != "2") |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "只有受理状态的订单才能送货"; |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | |
| | | dto.Songhuoer = curentuser.Id; |
| | | dto.Songhuotime = DateTime.Now; |
| | | dto.ShouliStatus = "5"; |
| | | |
| | | resultEntity = _cooperOrderService.Songhuo(dto); |
| | | |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | |
| | | [CheckLogin] |
| | | public IActionResult Pingjia(string id = null) |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | |
| | | |
| | | return View(); |
| | | } |
| | | |
| | | [CheckLogin] |
| | | public IActionResult Pingjiatuihuan(string PingjiaStatus, string Pingjiaid) |
| | | { |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | [CheckLogin] |
| | | public IActionResult Print(string id = null) |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | |
| | | ViewData.Model = dto; |
| | | return View(); |
| | | } |
| | | |
| | | [CheckLogin] |
| | | public IActionResult printList(CooperOrderDTOSearch search) |
| | | { |
| | | //JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver()); |
| | | search.rows = 1000; |
| | | search.page = 1; |
| | | ViewBag.ListCooperOrderDTO = _cooperOrderService.SearchByPaging(search).DataList as List<CooperOrderDTO>; |
| | | |
| | | |
| | | |
| | | return View(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | |
| | | if (OrderType == "02" ) |
| | | { |
| | | if(OrderType1== "电话咨询" || OrderType1 == "当面咨询" || OrderType1 == "代拟质疑答复" || OrderType1 == "代拟投诉处理决定" || OrderType1 == "竞争对手和评审专家查询" || OrderType1 == "政采贷") |
| | | if(OrderType1== "电话咨询" || OrderType1 == "当面咨询" || OrderType1 == "代拟质疑答复" || OrderType1 == "代拟投诉处理决定" || OrderType1 == "竞争对手和评审专家参加政府采购数据信息查询" || OrderType1 == "政采贷") |
| | | { |
| | | var shi = _fiServiceService.GetList().Where(x => x.ServiceTypeTop == OrderType && x.ServiceType == OrderType1).FirstOrDefault(); |
| | | result = JsonConvert.SerializeObject(shi); |
| | |
| | | return result; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //提问 |
| | | public IActionResult GetHuiYuanOrder([FromBody]CooperOrderDTOSearch search) |
| | | { |
| | | ReturnMsg<List<UserOrders>> returnMsg = new ReturnMsg<List<UserOrders>>(); |
| | | 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; |
| | | |
| | | } |
| | | //LZhuanjiahuidumDTOSearch searchEntity = new LZhuanjiahuidumDTOSearch(); |
| | | //searchEntity.Userid = userid; |
| | | ////searchEntity.HuidaStatus = "A"; |
| | | //searchEntity.page = 1; |
| | | //searchEntity.rows = 1000; |
| | | search.HuiyuanId = userid; |
| | | ResultDataEntity<CooperOrderDTO> resultDataEntity = _cooperOrderService.SearchByPaging(search); |
| | | List<CooperOrderDTO> cooperOrderDTOs = resultDataEntity.DataList; |
| | | List<UserOrders> userOrders = new List<UserOrders>(); |
| | | //封装订单 |
| | | foreach (var cooperOrderDTO in cooperOrderDTOs) |
| | | { |
| | | UserOrders userOrder = new UserOrders(); |
| | | userOrder.order_goods = new List<usercart_items>(); |
| | | usercart_items usercart_Item = new usercart_items(); |
| | | |
| | | userOrder.order_type = "offline"; |
| | | userOrder.order_no = cooperOrderDTO.OrderNo; |
| | | userOrder.accept_name = cooperOrderDTO.Shr; |
| | | userOrder.mobile = cooperOrderDTO.ShrTel; |
| | | userOrder.address = cooperOrderDTO.ShrAddress; |
| | | userOrder.order_amount = cooperOrderDTO.Money.HasValue ? cooperOrderDTO.Money.Value: 0; |
| | | userOrder.statusChs = cooperOrderDTO.ShouliStatusName; |
| | | userOrder.add_time = cooperOrderDTO.Createtime; |
| | | |
| | | usercart_Item.sell_price = cooperOrderDTO.Price.HasValue ? cooperOrderDTO.Price.Value : 0; |
| | | usercart_Item.quantity = cooperOrderDTO.OrderNum.HasValue ? decimal.ToInt32(cooperOrderDTO.OrderNum.Value) : 0; |
| | | usercart_Item.name = cooperOrderDTO.OrderTypeName + "-" + cooperOrderDTO.OrderType1Name + (string.IsNullOrEmpty(cooperOrderDTO.OrderType2)?"": "-"+cooperOrderDTO.OrderType2); |
| | | |
| | | |
| | | |
| | | userOrder.order_goods.Add(usercart_Item); |
| | | userOrders.Add(userOrder); |
| | | } |
| | | returnMsg.code = 1; |
| | | returnMsg.returnObj = userOrders; |
| | | returnMsg.count = resultDataEntity.DataList.Count; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | returnMsg.code = 2; |
| | | returnMsg.error = "没有获取到token"; |
| | | returnMsg.count = 0; |
| | | |
| | | } |
| | | return new JsonResult(returnMsg); |
| | | } |
| | | |
| | | } |
| | | } |