using NFine.Application.OMAY; using NFine.Code; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Web; using System.Web.Mvc; namespace NFine.Web.Areas.OMAY.Controllers { public class ICSOOCreateLotController : ControllerBase { ICSOOCreateLotApp App = new ICSOOCreateLotApp(); // GET: OMAY/ICSOOCreateLot public ActionResult ICSCreateLotByOO() { return View(); } public ActionResult OOFrom() { return View(); } //奥美工单生成条码主表查询 [HttpGet] [HandlerAjaxOnly] public ActionResult GetGridJsonChengPing(Pagination pagination, string queryJson) { DataTable ListData = App.GetGridJsonChengPing(queryJson, ref pagination); var JsonData = new { total = pagination.total, page = pagination.page, records = pagination.records, rows = ListData, }; return Content(JsonData.ToJson()); } //生成条码子表查询 [HttpGet] [HandlerAjaxOnly] public ActionResult GetSubGridJson(string ApplyNegCode, string Sequence, string Type, Pagination pagination) { DataTable ListData = App.GetSubGridJson(ApplyNegCode, Sequence, Type, ref pagination); var JsonData = new { total = pagination.total, page = pagination.page, records = pagination.records, rows = ListData, }; return Content(JsonData.ToJson()); } //工单生成条码获取物料数量信息 [HttpGet] [HandlerAjaxOnly] public ActionResult GetSubGridJsonChengPingByCreate(string OOCode, string Sequence, string WorkPoint) { DataTable ListData = App.GetSubGridJsonChengPingByCreate(OOCode, Sequence, WorkPoint); var JsonData = new { rows = ListData, }; return Content(JsonData.ToJson()); } //查询超生比例 [HttpGet] [HandlerAjaxOnly] public ActionResult GetScale() { DataTable ListData = App.GetScale(); var JsonData = new { rows = ListData, }; return Content(JsonData.ToJson()); } //副产品调用接口来显示本次可生产数量 [HttpGet] [HandlerAjaxOnly] public ActionResult GetOOPickAbsolveQty(string OOCode, string Sequence, string Qty) { var rows = App.GetOOPickAbsolveQty(OOCode, Sequence, Qty); return Content(rows.ToJson()); } //工单调用接口来显示本次可生产数量 [HttpGet] [HandlerAjaxOnly] public ActionResult GetAbsolveQty(string OOCode, string Sequence, string Qty) { var rows = App.GetAbsolveQty(OOCode, Sequence, Qty); return Content(rows.ToJson()); } //工单生成条码 [HttpPost] [HandlerAjaxOnly] [ValidateAntiForgeryToken] public ActionResult SubmitFormChengPing(string OOCode, string Sequence, string keyValue, string WorkPoint, string AMEnable) { int i = App.SubmitFormChengPing(OOCode, Sequence, keyValue, WorkPoint, AMEnable); if (i > 0) { return Success("生成成功!"); } else { return Error("生成失败!"); } } //副产品 [HttpGet] [HandlerAjaxOnly] public ActionResult GetGridJsonOOPick(Pagination pagination, string queryJson) { DataTable ListData = App.GetGridJsonOOPick(queryJson, ref pagination); var JsonData = new { total = pagination.total, page = pagination.page, records = pagination.records, rows = ListData, }; return Content(JsonData.ToJson()); } //副产品生成条码获取物料数量信息 [HttpGet] [HandlerAjaxOnly] public ActionResult GetSubGridJsonOOPickCreate(string OOPickCode, string Sequence, string WorkPoint) { DataTable ListData = App.GetSubGridJsonOOPickCreate(OOPickCode, Sequence, WorkPoint); var JsonData = new { rows = ListData, }; return Content(JsonData.ToJson()); } //联产品生成条码 [HttpPost] [HandlerAjaxOnly] [ValidateAntiForgeryToken] public ActionResult SubmitFormOOPick(string OOPickCode, string Sequence, string keyValue, string WorkPoint, string AMEnable) { int i = App.SubmitFormOOPick(OOPickCode, Sequence, keyValue, WorkPoint, AMEnable); if (i > 0) { return Success("生成成功!"); } else { return Error("生成失败!"); } } [HttpGet] [HandlerAjaxOnly] public ActionResult GetByproductGridJson(Pagination pagination, string queryJson) { DataTable ListData = App.GetByproductGridJson(queryJson, ref pagination); var JsonData = new { total = pagination.total, page = pagination.page, records = pagination.records, rows = ListData, }; return Content(JsonData.ToJson()); } //获取料品信息 public ActionResult GetInvCode() { DataTable dt = App.GetInvCode(); return Content(dt.ToJson()); } //副产品生成条码 [HttpPost] [HandlerAjaxOnly] [ValidateAntiForgeryToken] public ActionResult SubmitFormOOPickNoCode(string keyValue, string WorkPoint, string AMEnable) { int i = App.SubmitFormOOPickNoCode( keyValue, WorkPoint, AMEnable); if (i > 0) { return Success("生成成功!"); } else { return Error("生成失败!"); } } } }