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; namespace zhengcaioa.Controllers.BusinessOrder { [CheckLogin] public class CooperOrderController : Controller { private readonly ILogger _logger; private readonly ILiaotianService _liaotianService; private readonly IUserService _userService; private readonly ICooperOrderService _cooperOrderService; private readonly ICooperatecustomCustomerService _cooperatecustomCustomerService; private readonly IProjectService _projectService; private readonly IPltPageService _pltPageService; private readonly IFiBookService _fiBookService; private readonly IFiServiceService _fiServiceService; private readonly IFiMemberService _fiMemberService; public CooperOrderController(ILogger logger, ILiaotianService liaotianService, IUserService userService, ICooperOrderService cooperOrderService , ICooperatecustomCustomerService cooperatecustomCustomerService, IProjectService projectService, IPltPageService pltPageService, IFiBookService fiBookService , IFiServiceService fiServiceService, IFiMemberService fiMemberService) { _logger = logger; _liaotianService = liaotianService; _userService = userService; _cooperOrderService = cooperOrderService; _cooperatecustomCustomerService = cooperatecustomCustomerService; _projectService = projectService; _pltPageService = pltPageService; _fiBookService = fiBookService; _fiServiceService = fiServiceService; _fiMemberService = fiMemberService; } public IActionResult Index() { var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; List actionlist = new List(); 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); ViewData["ActionInfo"] = actionlist; List pageEntities = _pltPageService.GetUserPage(curentuser.Id, "/CooperOrder/Index/"); ViewBag.pageEntities = pageEntities; ViewBag.OrderType = _liaotianService.GetSYScode("CooperVisit", "jtype").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewBag.users = _userService.GetList().Where(x => x.IsYwjl == "A").Select(x => new { code = x.Id, label = x.UserName }).ToList(); ViewBag.Khlx = _liaotianService.GetSYScode("CooperatecustomCustomer", "khlx").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewBag.HuifangStatus = _liaotianService.GetSYScode("CooperOrder", "huifang_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewBag.PingjiaStatus = _liaotianService.GetSYScode("CooperOrder", "pingjia_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); return View(); } public IActionResult GetList(CooperOrderDTOSearch search) { var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; search.Creater = curentuser.Id; //JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver()); return new JsonResult(_cooperOrderService.SearchByPaging(search)); } public IActionResult ShouliList() { var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; List actionlist = new List(); ActionEntity actionEntity = new ActionEntity(); actionEntity.OpenType = 0; actionEntity.ActionUrl = ""; actionEntity.ActionFun = "Search"; actionEntity.PageIco = "fa fa-search"; actionEntity.ActionName = "查询"; actionlist.Add(actionEntity); ViewData["ActionInfo"] = actionlist; ViewBag.OrderType = _liaotianService.GetSYScode("CooperVisit", "jtype").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewBag.users = _userService.GetList().Where(x => x.IsYwjl == "A").Select(x => new { code = x.Id, label = x.UserName }).ToList(); ViewBag.Khlx = _liaotianService.GetSYScode("CooperatecustomCustomer", "khlx").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewBag.HuifangStatus = _liaotianService.GetSYScode("CooperOrder", "huifang_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewBag.PingjiaStatus = _liaotianService.GetSYScode("CooperOrder", "pingjia_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); return View(); } public IActionResult GetListshouli(CooperOrderDTOSearch search) { var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; //search.ShouliStatus = "A"; //JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver()); return new JsonResult(_cooperOrderService.SearchByPaging(search)); } public IActionResult ChedanList() { var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; List actionlist = new List(); ActionEntity actionEntity = new ActionEntity(); actionEntity.OpenType = 0; actionEntity.ActionUrl = ""; actionEntity.ActionFun = "Search"; actionEntity.PageIco = "fa fa-search"; actionEntity.ActionName = "查询"; actionlist.Add(actionEntity); ViewData["ActionInfo"] = actionlist; ViewBag.OrderType = _liaotianService.GetSYScode("CooperVisit", "jtype").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewBag.users = _userService.GetList().Where(x => x.IsYwjl == "A").Select(x => new { code = x.Id, label = x.UserName }).ToList(); ViewBag.Khlx = _liaotianService.GetSYScode("CooperatecustomCustomer", "khlx").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewBag.HuifangStatus = _liaotianService.GetSYScode("CooperOrder", "huifang_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewBag.PingjiaStatus = _liaotianService.GetSYScode("CooperOrder", "pingjia_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); return View(); } public IActionResult GetListchedan(CooperOrderDTOSearch search) { var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; //search.ShouliStatus = "A"; //JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver()); return new JsonResult(_cooperOrderService.SearchByPaging(search)); } public IActionResult WangongList() { var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; List actionlist = new List(); ActionEntity actionEntity = new ActionEntity(); actionEntity.OpenType = 0; actionEntity.ActionUrl = ""; actionEntity.ActionFun = "Search"; actionEntity.PageIco = "fa fa-search"; actionEntity.ActionName = "查询"; actionlist.Add(actionEntity); ViewData["ActionInfo"] = actionlist; ViewBag.OrderType = _liaotianService.GetSYScode("CooperVisit", "jtype").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewBag.users = _userService.GetList().Where(x => x.IsYwjl == "A").Select(x => new { code = x.Id, label = x.UserName }).ToList(); ViewBag.Khlx = _liaotianService.GetSYScode("CooperatecustomCustomer", "khlx").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewBag.HuifangStatus = _liaotianService.GetSYScode("CooperOrder", "huifang_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewBag.PingjiaStatus = _liaotianService.GetSYScode("CooperOrder", "pingjia_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); return View(); } public IActionResult GetListwangong(CooperOrderDTOSearch search) { var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; search.ShouliStatus = "A"; search.ChedanStatus = "D"; //JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver()); return new JsonResult(_cooperOrderService.SearchByPaging(search)); } public IActionResult SonghuoList() { var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; List actionlist = new List(); ActionEntity actionEntity = new ActionEntity(); actionEntity.OpenType = 0; actionEntity.ActionUrl = ""; actionEntity.ActionFun = "Search"; actionEntity.PageIco = "fa fa-search"; actionEntity.ActionName = "查询"; actionlist.Add(actionEntity); ViewData["ActionInfo"] = actionlist; ViewBag.OrderType = _liaotianService.GetSYScode("CooperVisit", "jtype").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewBag.users = _userService.GetList().Where(x => x.IsYwjl == "A").Select(x => new { code = x.Id, label = x.UserName }).ToList(); ViewBag.Khlx = _liaotianService.GetSYScode("CooperatecustomCustomer", "khlx").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewBag.HuifangStatus = _liaotianService.GetSYScode("CooperOrder", "huifang_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewBag.PingjiaStatus = _liaotianService.GetSYScode("CooperOrder", "pingjia_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); return View(); } public IActionResult GetListsonghuo(CooperOrderDTOSearch search) { var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; search.WangongStatus = "A"; search.ChedanStatus = "D"; //JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver()); return new JsonResult(_cooperOrderService.SearchByPaging(search)); } public IActionResult HuifangList() { var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; List actionlist = new List(); ActionEntity actionEntity = new ActionEntity(); actionEntity.OpenType = 0; actionEntity.ActionUrl = ""; actionEntity.ActionFun = "Search"; actionEntity.PageIco = "fa fa-search"; actionEntity.ActionName = "查询"; actionlist.Add(actionEntity); ViewData["ActionInfo"] = actionlist; ViewBag.OrderType = _liaotianService.GetSYScode("CooperVisit", "jtype").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewBag.users = _userService.GetList().Where(x => x.IsYwjl == "A").Select(x => new { code = x.Id, label = x.UserName }).ToList(); ViewBag.Khlx = _liaotianService.GetSYScode("CooperatecustomCustomer", "khlx").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewBag.HuifangStatus = _liaotianService.GetSYScode("CooperOrder", "huifang_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewBag.PingjiaStatus = _liaotianService.GetSYScode("CooperOrder", "pingjia_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); return View(); } public IActionResult GetListHuifang(CooperOrderDTOSearch search) { var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; search.SonghuoStatus = "A"; search.ChedanStatus = "D"; //JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver()); return new JsonResult(_cooperOrderService.SearchByPaging(search)); } public IActionResult PingjiaList() { var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; List actionlist = new List(); ActionEntity actionEntity = new ActionEntity(); actionEntity.OpenType = 0; actionEntity.ActionUrl = ""; actionEntity.ActionFun = "Search"; actionEntity.PageIco = "fa fa-search"; actionEntity.ActionName = "查询"; actionlist.Add(actionEntity); ViewData["ActionInfo"] = actionlist; ViewBag.OrderType = _liaotianService.GetSYScode("CooperVisit", "jtype").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewBag.users = _userService.GetList().Where(x => x.IsYwjl == "A").Select(x => new { code = x.Id, label = x.UserName }).ToList(); ViewBag.Khlx = _liaotianService.GetSYScode("CooperatecustomCustomer", "khlx").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewBag.HuifangStatus = _liaotianService.GetSYScode("CooperOrder", "huifang_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewBag.PingjiaStatus = _liaotianService.GetSYScode("CooperOrder", "pingjia_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); return View(); } public IActionResult GetListPingjia(CooperOrderDTOSearch search) { var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; search.HuifangStatussss = "A"; search.ChedanStatus = "D"; //JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver()); return new JsonResult(_cooperOrderService.SearchByPaging(search)); } public IActionResult YouhuiList() { var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; List actionlist = new List(); ActionEntity actionEntity = new ActionEntity(); actionEntity.OpenType = 0; actionEntity.ActionUrl = ""; actionEntity.ActionFun = "Search"; actionEntity.PageIco = "fa fa-search"; actionEntity.ActionName = "查询"; actionlist.Add(actionEntity); ViewData["ActionInfo"] = actionlist; ViewBag.OrderType = _liaotianService.GetSYScode("CooperVisit", "jtype").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewBag.users = _userService.GetList().Where(x => x.IsYwjl == "A").Select(x => new { code = x.Id, label = x.UserName }).ToList(); ViewBag.Khlx = _liaotianService.GetSYScode("CooperatecustomCustomer", "khlx").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewBag.HuifangStatus = _liaotianService.GetSYScode("CooperOrder", "huifang_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewBag.PingjiaStatus = _liaotianService.GetSYScode("CooperOrder", "pingjia_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); return View(); } public IActionResult GetListYouhui(CooperOrderDTOSearch search) { var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; search.ShouliStatus = "A"; search.ChedanStatus = "D"; //JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver()); return new JsonResult(_cooperOrderService.SearchByPaging(search)); } public IActionResult Edit(string id = null, string ShouliStatus = "1") { var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; CooperOrderDTO dto = new CooperOrderDTO(); if (!String.IsNullOrEmpty(id)) { dto = _cooperOrderService.Get(id); ViewBag.ShouliStatus = ShouliStatus; } else { dto.XdTime = DateTime.Now; ViewBag.ShouliStatus = "1"; } ViewBag.OrderType = _liaotianService.GetSYScode("CooperVisit", "jtype"); ViewBag.customer = _cooperatecustomCustomerService.GetList(); //ViewBag.project = _projectService.GetList(); ViewData.Model = dto; return View(); } /// /// 获取市 /// /// 省id /// /// [CheckLogin] public string getProject() { var shi = _projectService.GetList().Select(x => new { Id = x.Id, Name = x.Name }).ToList(); ; return JsonConvert.SerializeObject(shi); } /// /// 保存 /// /// 岗位实体类对象 /// /// [HttpPost] public IActionResult Save(CooperOrderDTO data) { ResultEntity resultEntity = new ResultEntity(); using (TransactionScope scope = new TransactionScope()) { var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; data.RecStatus = "A"; if (String.IsNullOrEmpty(data.Id)) { data.Creater = curentuser.Id; data.Createtime = DateTime.Now; data.XdTime = data.Createtime; } data.ShouliStatus = "1"; data.Modifier = curentuser.Id; data.Modifytime = DateTime.Now; resultEntity = _cooperOrderService.save(data); scope.Complete(); } return new JsonResult(resultEntity); } /// /// 删除主信息 /// /// 实体 /// /// public IActionResult Nullify(string Id = "") { var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; return new JsonResult(_cooperOrderService.ModifyStatus(Id, curentuser.Id)); } /// /// 受理 /// /// 岗位实体类对象 /// /// public IActionResult Shouli(string id) { var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; CooperOrderDTO dto= new CooperOrderDTO(); dto.Id = id; dto.Shoulier = curentuser.Id; dto.Shoulitime = DateTime.Now; dto.ShouliStatus = "2"; ResultEntity resultEntity = _cooperOrderService.shouli(dto); return new JsonResult(resultEntity); } /// /// 完工 /// /// 岗位实体类对象 /// /// public IActionResult Wangong(string id) { var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; CooperOrderDTO dto = _cooperOrderService.Get(id); //dto.Id = id; dto.Wangonger = curentuser.Id; dto.Wangongtime = DateTime.Now; dto.ShouliStatus = "4"; ResultEntity resultEntity = _cooperOrderService.save(dto); return new JsonResult(resultEntity); } /// /// 送货 /// /// 岗位实体类对象 /// /// public IActionResult Songhuo(string id) { var curentuser = JsonConvert.DeserializeObject(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); } public IActionResult Chedan(string id = null) { var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; ViewData["Chedanid"] = id; return View(); } public IActionResult chedantuihuan(decimal Price, string Chedanid) { ResultEntity resultEntity = new ResultEntity(); resultEntity.Result = true; var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; CooperOrderDTO dto = new CooperOrderDTO(); dto.Id = Chedanid; dto.Chedaner = curentuser.Id; dto.Chedantime = DateTime.Now; dto.ChedanStatus = "A"; dto.Chedan = Price; dto.ShouliStatus = "0"; resultEntity = _cooperOrderService.chedan(dto); return new JsonResult(resultEntity); } public IActionResult Huifang(string id = null) { var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; ViewData["Huifangid"] = id; return View(); } public IActionResult Huifangtuihuan(string Huifangremark, string Huifangid) { ResultEntity resultEntity = new ResultEntity(); resultEntity.Result = true; var curentuser = JsonConvert.DeserializeObject(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); } public IActionResult Pingjia(string id = null) { var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; ViewData["Pingjiaid"] = id; ViewData["PingjiaStatus"] = _liaotianService.GetSYScode("CooperOrder", "pingjia_status"); return View(); } public IActionResult Pingjiatuihuan(string PingjiaStatus, string Pingjiaid) { ResultEntity resultEntity = new ResultEntity(); resultEntity.Result = true; var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; CooperOrderDTO dto = new CooperOrderDTO(); dto.Id = Pingjiaid; dto.Pingjiaer = curentuser.Id; dto.Pingjiatime = DateTime.Now; dto.PingjiaStatus = PingjiaStatus; resultEntity = _cooperOrderService.pingjia(dto); return new JsonResult(resultEntity); } public IActionResult Print(string id = null) { var curentuser = JsonConvert.DeserializeObject(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; CooperOrderDTO dto = new CooperOrderDTO(); if (!String.IsNullOrEmpty(id)) { dto = _cooperOrderService.Getprint(id); if (dto.OrderType == "01") { dto.OrderType1 = _fiBookService.Get(dto.OrderType1).BookName; } if (dto.OrderType == "05") { dto.OrderType1 = _fiMemberService.Get(dto.OrderType1).MemberType; } } else { dto.XdTime = DateTime.Now; } ViewData.Model = dto; return View(); } /// /// 获取物品 /// /// 省id /// /// [CheckLogin] public string getOrderType(string OrderType) { string result = ""; if(OrderType == "01") { var shi = _fiBookService.GetList().Select(x => new { code = x.Id, label = x.BookName }).ToList(); result = JsonConvert.SerializeObject(shi); } if (OrderType == "02" || OrderType == "04" || OrderType == "06" || OrderType == "09") { var shi = _fiServiceService.GetList().Where(x=>x.ServiceTypeTop == OrderType).Select(x => new { code = x.ServiceType, label = x.ServiceType }).Distinct().ToList(); result = JsonConvert.SerializeObject(shi); } if ( OrderType == "03" || OrderType == "07" ) { var shi = _fiServiceService.GetList().Where(x => x.ServiceTypeTop == OrderType).Select(x => new { code = x.ServiceTypeTwo, label = x.ServiceTypeTwo }).ToList(); result = JsonConvert.SerializeObject(shi); } if (OrderType == "05" ) { var shi = _fiMemberService.GetList().Select(x => new { code = x.Id, label = x.MemberType }).ToList(); result = JsonConvert.SerializeObject(shi); } if (OrderType == "08" || OrderType == "10") { result = "[]"; } return result; } /// /// 获取物品 /// /// 省id /// /// [CheckLogin] public string getOrderType1(string OrderType,string OrderType1) { string result = ""; if (OrderType == "01") { var shi = _fiBookService.Get(OrderType1); result = JsonConvert.SerializeObject(shi); } if (OrderType == "03" || OrderType == "07") { var shi = _fiServiceService.GetList().Where(x => x.ServiceTypeTop == OrderType && x.ServiceTypeTwo == OrderType1).FirstOrDefault(); result = JsonConvert.SerializeObject(shi); } if (OrderType == "05") { var shi = _fiMemberService.Get(OrderType1); result = JsonConvert.SerializeObject(shi); } if ( OrderType == "04" || OrderType == "06" || OrderType == "09") { var shi = _fiServiceService.GetList().Where(x => x.ServiceTypeTop == OrderType && x.ServiceType == OrderType1).FirstOrDefault(); result = JsonConvert.SerializeObject(shi); } if (OrderType == "02" ) { if(OrderType1== "电话咨询" || OrderType1 == "当面咨询" || OrderType1 == "代拟质疑答复" || OrderType1 == "代拟投诉处理决定" || OrderType1 == "竞争对手和评审专家查询" || OrderType1 == "政采贷") { var shi = _fiServiceService.GetList().Where(x => x.ServiceTypeTop == OrderType && x.ServiceType == OrderType1).FirstOrDefault(); result = JsonConvert.SerializeObject(shi); } else { var shi = _fiServiceService.GetList().Where(x => x.ServiceTypeTop == OrderType && x.ServiceType == OrderType1).Select(x => new { code = x.ServiceTypeTwo, label = x.ServiceTypeTwo }).Distinct().ToList(); result = JsonConvert.SerializeObject(shi); } } return result; } /// /// 获取物品 /// /// 省id /// /// [CheckLogin] public string getOrderType2(string OrderType, string OrderType1, string OrderType2) { string result = ""; var shi = _fiServiceService.GetList().Where(x => x.ServiceTypeTop == OrderType && x.ServiceType == OrderType1 && x.ServiceTypeTwo == OrderType2).FirstOrDefault(); result = JsonConvert.SerializeObject(shi); return result; } } }