zhengcaioa/zhengcaioa/Controllers/BusinessOrder/CooperOrderController.cs
@@ -72,6 +72,15 @@
            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/");
@@ -87,6 +96,7 @@
            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();
        }
@@ -348,6 +358,8 @@
            actionEntity.ActionName = "查询";
            actionlist.Add(actionEntity);
            ViewData["ActionInfo"] = actionlist;
            ViewBag.OrderType = _liaotianService.GetSYScode("CooperVisit", "jtype").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
@@ -386,6 +398,7 @@
            else
            {
                dto.XdTime = DateTime.Now;
                dto.OrderNum = 1;
                ViewBag.ShouliStatus = "1";
            }
@@ -484,13 +497,22 @@
        {
            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);
        }
@@ -518,27 +540,7 @@
            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);
        }
        public IActionResult Chedan(string id = null)
        {
@@ -553,13 +555,21 @@
        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";
@@ -577,29 +587,82 @@
            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)
        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>
        ///
        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();
        }
        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);
        }
        public IActionResult Pingjia(string id = null)
        {
@@ -662,6 +725,20 @@
        }
        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();
        }
        /// <summary>
        /// 获取物品