using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Estsh.Web.Service;
using System.Collections;
/***************************************************************************************************
*
* 作者:贾文涛
* 创建时间:2014.07.12
* 描述:订单管理模块控制类
* 修改日志:
*
* *************************************************************************************************/
namespace Estsh.Core.Web.Controllers
{
public class SortOrderManageController : Controller
{
private SortOrderManageService service = new SortOrderManageService();
public ActionResult Index()
{
return View();
}
///
/// 获取已释放未生产的排序单
///
///
///
///
///
///
public ActionResult GetNoProdOrderData(String startOrder,String endOrder,String startDate,String endDate)
{
Hashtable requestHt = new Hashtable();
requestHt.Add("@startOrder", startOrder);
requestHt.Add("@endOrder", endOrder);
requestHt.Add("@startDate", startDate);
requestHt.Add("@endDate", endDate);
Hashtable result = new Hashtable();
Hashtable dataHt = this.service.GetNoProdOrderData(requestHt);
result.Add("rows", dataHt["dataList"]);
return Json(result);
}
public ActionResult GetStockPartData()
{
Hashtable result = this.service.GetStockPartData();
return Json(result);
}
///
/// 获取未匹配成功的排序单数据
///
///
public ActionResult GetNoMatchOrderData()
{
Hashtable result = new Hashtable();
Hashtable dataHt = this.service.GetNoMatchOrderData();
result.Add("rows", dataHt["dataList"]);
return Json(result);
}
///
/// 获取即时库存明细
///
///
public ActionResult GetNowStock()
{
Hashtable result = new Hashtable();
Hashtable dataHt = this.service.GetNowStock();
result.Add("rows", dataHt["dataList"]);
return Json(result);
}
///
/// 获取即时库存汇总
///
///
public ActionResult GetNowTotalStock()
{
Hashtable result = new Hashtable();
Hashtable dataHt = this.service.GetNowTotalStock();
result.Add("rows", dataHt["dataList"]);
return Json(result);
}
///
/// 获取已经释放的生产指令明细
///
///
public ActionResult GetHasRealsed(String startOrder, String endOrder, String startDate, String endDate)
{
Hashtable requestHt = new Hashtable();
requestHt.Add("@startOrder", startOrder);
requestHt.Add("@endOrder", endOrder);
requestHt.Add("@startDate", startDate);
requestHt.Add("@endDate", endDate);
Hashtable result = new Hashtable();
Hashtable dataHt = this.service.GetHasRealsed(requestHt);
result.Add("rows", dataHt["dataList"]);
return Json(result);
}
///
/// 获取已经释放的生产指令汇总
///
///
public ActionResult GetHasRealsedTotal(String startOrder, String endOrder, String startDate, String endDate)
{
Hashtable requestHt = new Hashtable();
requestHt.Add("@startOrder", startOrder);
requestHt.Add("@endOrder", endOrder);
requestHt.Add("@startDate", startDate);
requestHt.Add("@endDate", endDate);
Hashtable result = new Hashtable();
Hashtable dataHt = this.service.GetHasRealsedTotal(requestHt);
result.Add("rows", dataHt["dataList"]);
return Json(result);
}
///
/// 指令撤销数据
///
///
///
///
///
public ActionResult GetDataCancel(String startOrder, String endOrder, String startDate, String endDate)
{
string carNo = "";
Hashtable result = new Hashtable();
Hashtable dataHt = this.service.GetDataCancel(carNo,startDate,endDate);
result.Add("rows", dataHt["dataList"]);
return Json(result);
}
///
/// 冲料列表
///
///
///
public ActionResult GetCharegeListData(String startOrder, String endOrder, String startDate, String endDate)
{
Hashtable result = new Hashtable();
Hashtable dataHt = this.service.GetCharegeListData(startDate, endDate,"");
result.Add("rows", dataHt["dataList"]);
return Json(result);
}
///
/// 充料作业
///
///
///
public ActionResult partReplace(String ids)
{
String message = "";
try
{
message = this.service.partReplace(ids);
}
catch (Exception e)
{
message = e.Message;
}
Hashtable result = new Hashtable();
result.Add("message", message);
return Json(result);
}
///
/// 把车号标记为跳过
///
///
///
public ActionResult SkipCarNo(String ids)
{
int count = 0;
try
{
count = this.service.SkipCarNo(ids);
}
catch (Exception e)
{
count = -1;
}
Hashtable result = new Hashtable();
result.Add("message", count);
return Json(result);
}
///
/// 指令撤销操作
///
///
///
public ActionResult UpdateOrderCancel(String ids)
{
int count = 0;
try
{
count = this.service.UpdateOrderCancel(ids);
}
catch (Exception e)
{
count = -1;
}
Hashtable result = new Hashtable();
result.Add("message", count);
return Json(result);
}
}
}