using HH.AutoBom.Core;
|
using HH.WMS.Common;
|
using HH.WMS.Entitys;
|
using HH.WMS.WebUI.Controllers;
|
using Newtonsoft.Json;
|
using System;
|
using System.Collections.Generic;
|
using System.IO;
|
using System.Linq;
|
using System.Web;
|
using System.Web.Mvc;
|
|
namespace HH.WMS.WebUI.Areas.OutStock.Controllers
|
{
|
public class WaveController : BaseController
|
{
|
public ActionResult WaveList()
|
{
|
return View();
|
}
|
|
public ActionResult OutOfStock()
|
{
|
return View();
|
}
|
|
#region 打单
|
/// <summary>
|
/// 打单
|
/// </summary>
|
/// <param name="opNo"></param>
|
/// <returns></returns>
|
public string CreateBill(string opNos, string printer, string printTemplet)
|
{
|
return HttpWMS_Post("api/Wave/SimCreateBill", JsonConvert.SerializeObject(new
|
{
|
TokenId = ViewConstants.TokenId,
|
PostData = new
|
{
|
opNos = opNos,
|
printer = printer,
|
printTemplet = printTemplet
|
}
|
}));
|
}
|
#endregion
|
|
#region 获取出库订单子表
|
/// <summary>
|
/// 获取出库订单子表
|
/// </summary>
|
/// <param name="opNo"></param>
|
/// <returns></returns>
|
public string GetOutDtl(string opNo)
|
{
|
return HttpWMS_Get("api/Wave/GetOutDtl?opNo=" + opNo);
|
}
|
#endregion
|
|
#region 填写物流单
|
/// <summary>
|
/// 填写物流单
|
/// </summary>
|
/// <param name="opNo"></param>
|
/// <returns></returns>
|
public ActionResult EditLogistics()
|
{
|
return View();
|
}
|
#endregion
|
|
#region 打印物流单
|
/// <summary>
|
/// 打印物流单
|
/// </summary>
|
/// <returns></returns>
|
public ActionResult PrintLogistics()
|
{
|
return View();
|
}
|
#endregion
|
|
#region 打印单据
|
/// <summary>
|
/// 打印单据
|
/// </summary>
|
/// <returns></returns>
|
public ActionResult PrintBill()
|
{
|
return View();
|
}
|
#endregion
|
|
#region 获取多个出库单主表
|
/// <summary>
|
/// 获取多个出库单主表
|
/// </summary>
|
/// <param name="opNos"></param>
|
/// <returns></returns>
|
public string GetOutMstRange(string opNos)
|
{
|
return HttpWMS_Get("api/Out/GetOutMstRange?opNos=" + opNos);
|
}
|
#endregion
|
|
#region 保存物流
|
/// <summary>
|
/// 保存物流
|
/// </summary>
|
/// <returns></returns>
|
public string SaveWayBill()
|
{
|
var sr = new StreamReader(Request.InputStream);
|
var stream = sr.ReadToEnd();
|
List<TN_WM_OUT_MSTEntity> outMstList = JsonConvert.DeserializeObject<List<TN_WM_OUT_MSTEntity>>(stream);
|
return HttpWMS_Post("api/Wave/SaveWayBill", JsonConvert.SerializeObject(new
|
{
|
TokenId = ViewConstants.TokenId,
|
PostData = outMstList
|
}));
|
}
|
#endregion
|
|
#region 波次列表
|
/// <summary>
|
/// 波次列表
|
/// </summary>
|
/// <returns></returns>
|
[HttpPost]
|
public string WaveList(int pageIndex, int pageSize)
|
{
|
string result = HttpWMS_Post("api/Wave/WaveList",
|
JsonConvert.SerializeObject(new
|
{
|
TokenId = ViewConstants.TokenId,
|
PageIndex = pageIndex,
|
PageSize = pageSize
|
})
|
);
|
return result;
|
}
|
#endregion
|
|
#region 验证打单数据
|
/// <summary>
|
/// 验证打单数据
|
/// </summary>
|
/// <param name="opNos"></param>
|
/// <returns></returns>
|
public string ValidatePrint(string opNos)
|
{
|
return HttpWMS_Get("api/Wave/ValidatePrint?opNos=" + opNos);
|
}
|
#endregion
|
|
#region 保存物流打印
|
/// <summary>
|
/// 保存物流打印
|
/// </summary>
|
/// <param name="stockCode"></param>
|
/// <param name="printer"></param>
|
/// <param name="printTemplet"></param>
|
/// <param name="opNos"></param>
|
/// <returns></returns>
|
public string SavePrinter(string stockCode, string printer, string printTemplet, string opNos, int printType, int packNum = 0)
|
{
|
return HttpWMS_Post("api/Wave/SavePrinter", JsonConvert.SerializeObject(new
|
{
|
TokenId = ViewConstants.TokenId,
|
PostData = new
|
{
|
stockCode = stockCode,
|
printer = printer,
|
printTemplet = printTemplet,
|
opNos = opNos,
|
printType = printType,
|
packNum = packNum
|
}
|
}));
|
}
|
#endregion
|
|
#region 获取订单日志
|
/// <summary>
|
/// 获取订单日志
|
/// </summary>
|
/// <param name="opNo"></param>
|
/// <returns></returns>
|
public string GetBillExec(string opNo)
|
{
|
return HttpWMS_Get("api/Wave/GetBillExec?opNo=" + opNo);
|
}
|
#endregion
|
|
#region 生成顺丰物流单号
|
/// <summary>
|
/// 生成顺丰物流单号
|
/// </summary>
|
/// <param name="outNos"></param>
|
/// <returns></returns>
|
public string CreateLogistics(string outNos)
|
{
|
return HttpWMS_Get("api/Wave/CreateLogistics?outNos=" + outNos);
|
}
|
#endregion
|
|
#region 待上架物料
|
/// <summary>
|
/// 待上架物料
|
/// </summary>
|
/// <param name="items"></param>
|
/// <returns></returns>
|
public ActionResult NotStockItem(string items)
|
{
|
string[] notStockItems = items.Split(';');
|
List<object> notStockData = new List<object>();
|
foreach (var item in notStockItems)
|
{
|
string[] currentItem = item.Split('|');
|
notStockData.Add(new
|
{
|
ItemCode = currentItem[0],
|
ItemName = currentItem[1],
|
UpperNum = currentItem[2]
|
});
|
}
|
return View(notStockData);
|
}
|
#endregion
|
}
|
}
|