using BLL; using BLL.DAL; using BLL.IDAL; using Common; using Json; using Lib; using Model; using System; using System.Collections.Generic; using System.Linq; using System.Web.Mvc; using System.Web.Script.Serialization; namespace wms.Areas.Business.Controllers { public class IPalletMatOutAjaxController : AjaxPage { [LoginFilter] public ActionResult GetList() { try { var dd = Request["ajaxdata"]; var models = new JavaScriptSerializer().Deserialize(dd); if (models != null) { PageInfo pageInfo = new PageInfo() { PageIndex = models.pageIndex, PageSize = models.pageSize }; models.DepartGuid = this.LoginDepartNum; IDALPalletMatOut provider = new DALPalletMatOut(); List entity = provider.GetList(models, ref pageInfo).ToList(); string json = JsonHelper.IListToJson(entity, "List"); string pjson = ConvertJson.Serializer(pageInfo); ReturnJson.AddProperty("Result", new JsonObject(json)); ReturnJson.AddProperty("PageInfo", new JsonObject(pjson)); ReturnJson.AddProperty("Code", 1); ReturnJson.AddProperty("Message", "响应成功"); return Content(this.ReturnJson.ToString()); } return Content(null); } catch (Exception ex) { WriteFileLog(ex.Message.ToString(), System.Reflection.MethodBase.GetCurrentMethod()); return Content(null); } } [LoginFilter] public ActionResult PalletOut() { try { var dd = Request["ajaxdata"]; var models = new JavaScriptSerializer().Deserialize(dd); if (models == null) { return Content(null); } int r = -1; DALPalletMatOut pmo = new DALPalletMatOut(); if (!pmo.IsCanPalletOut(models.Palno, models.LocationCode)) { ReturnJson.AddProperty("Code", -1); ReturnJson.AddProperty("Message", "请检查托盘是否存在或库位状态!"); return Content(this.ReturnJson.ToString()); } // 验证托盘类型 A3高度托盘禁止出往C口 if (models.AccessCode == "03") { if (models.Palno.Contains("A3")) { ReturnJson.AddProperty("Code", -1); ReturnJson.AddProperty("Message", "A3类型的托盘禁止出往C口!"); return Content(this.ReturnJson.ToString()); } } DALWMSApi dalWMSApi = new DALWMSApi(); dalWMSApi.Send(models.Palno, models.LocationCode, models.AccessCode); // 插入改变出库库位状态 //pub.InsertPicking("", models.Palno, models.LocationCode); DAL_Pub pub = new DAL_Pub(); pub.UpdateLocationState(models.LocationCode, "04"); ReturnJson.AddProperty("Code", 1); ReturnJson.AddProperty("Message", "出盘命令发送成功"); return Content(this.ReturnJson.ToString()); } catch (Exception ex) { WriteFileLog(ex.Message.ToString(), System.Reflection.MethodBase.GetCurrentMethod()); return Content(null); } } } }