You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

281 lines
7.3 KiB

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 ICSMoCreateLotController : ControllerBase
{
ICSMoCreateLotApp App = new ICSMoCreateLotApp();
// GET: OMAY/ICSMoCreateLot
public ActionResult ICSCreateLotByMO()
{
return View();
}
public ActionResult From()
{
return View();
}
public ActionResult ICSMOByproduct()
{
return View();
}
public ActionResult ICSMOByproductFrom()
{
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 MOCode, string Sequence, string WorkPoint,string MoTypeValue)
{
DataTable ListData = App.GetSubGridJsonChengPingByCreate(MOCode, Sequence, WorkPoint, MoTypeValue);
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 GetFCPAbsolveQty(string MOCode, string Sequence, string Qty)
{
var rows = App.GetFCPAbsolveQty(MOCode, Sequence, Qty);
return Content(rows.ToJson());
}
//工单调用接口来显示本次可生产数量
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetAbsolveQty(string MOCode, string Sequence, string Qty)
{
var rows = App.GetAbsolveQty(MOCode, Sequence, Qty);
return Content(rows.ToJson());
}
//工单生成条码
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult SubmitFormChengPing(string MOCode, string Sequence, string keyValue, string WorkPoint, string AMEnable)
{
int i = App.SubmitFormChengPing(MOCode, Sequence, keyValue, WorkPoint, AMEnable);
if (i > 0)
{
return Success("生成成功!");
}
else
{
return Error("生成失败!");
}
}
//副产品
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetGridJsonFCP(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetGridJsonFCP(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 GetSubGridJsonFCPCreate(string FCPMOCode, string Sequence, string WorkPoint, string MoTypeValue)
{
DataTable ListData = App.GetSubGridJsonFCPCreate(FCPMOCode, Sequence, WorkPoint, MoTypeValue);
var JsonData = new
{
rows = ListData,
};
return Content(JsonData.ToJson());
}
//联产品生成条码
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult SubmitFormFCP(string FCPMOCode, string Sequence, string keyValue, string WorkPoint, string AMEnable)
{
int i = App.SubmitFormFCP(FCPMOCode, 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());
}
[HttpGet]
[HandlerAjaxOnly]
public ActionResult SeachAmountEnablebyInvCode(string InvCode)
{
DataTable ListData = App.SeachAmountEnablebyInvCode(InvCode);
var JsonData = new
{
rows = ListData,
};
return Content(JsonData.ToJson());
}
//副产品生成条码
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult SubmitFormFCPNoCode(string keyValue, string WorkPoint, string AMEnable)
{
int i = App.SubmitFormFCPNoCode( keyValue, WorkPoint, AMEnable);
if (i > 0)
{
return Success("生成成功!");
}
else
{
return Error("生成失败!");
}
}
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult DeleteFCPLot(string keyValue)
{
string msg = App.DeleteFCPLot(keyValue);
if (string.IsNullOrEmpty(msg))
{
return Success("删除成功!");
}
else
{
return Error(msg);
}
}
}
}