using HH.WMS.Common;
|
using HH.WMS.Entitys;
|
using HH.WMS.Entitys.Basic;
|
using HH.WMS.WebUI.Controllers;
|
using Newtonsoft.Json;
|
using Newtonsoft.Json.Linq;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Web;
|
using System.Web.Mvc;
|
|
namespace HH.WMS.WebUI.Areas.Basic.Controllers
|
{
|
public class LogisticsController : BaseController
|
{
|
public ActionResult Index()
|
{
|
return View();
|
}
|
|
public ActionResult PrintTemplet(string guid)
|
{
|
TN_WM_LOGISTICS_TEMPLET_RELEntity entity = new TN_WM_LOGISTICS_TEMPLET_RELEntity();
|
if (!string.IsNullOrEmpty(guid))
|
{
|
string result = HttpWMS_Get("api/Logistics/LogisticsTempletListByGuid?guid=" + guid);
|
OperateResult opResult = JsonConvert.DeserializeObject<OperateResult>(result);
|
if (!opResult.Success)
|
{
|
entity.OperateMessage = opResult.Msg;
|
}
|
else
|
{
|
entity = opResult.GetData<TN_WM_LOGISTICS_TEMPLET_RELEntity>();
|
}
|
}
|
return View(entity);
|
}
|
|
public ActionResult Edit(string guid)
|
{
|
TN_WM_LOGISTICS_COMPANYEntity entity = new TN_WM_LOGISTICS_COMPANYEntity();
|
if (!string.IsNullOrEmpty(guid))
|
{
|
string result = HttpWMS_Get("api/Logistics/GetById?guid=" + guid);
|
OperateResult opResult = JsonConvert.DeserializeObject<OperateResult>(result);
|
if (!opResult.Success)
|
{
|
entity.OperateMessage = opResult.Msg;
|
}
|
else
|
{
|
entity = opResult.GetData<TN_WM_LOGISTICS_COMPANYEntity>();
|
}
|
}
|
return View(entity);
|
}
|
|
#region 新增修改
|
/// <summary>
|
/// 新增修改
|
/// </summary>
|
/// <param name="entity"></param>
|
/// <returns></returns>
|
[HttpPost]
|
public string Edit(TN_WM_LOGISTICS_COMPANYEntity entity)
|
{
|
return HttpWMS_Post("api/Logistics/Edit", JsonConvert.SerializeObject(new
|
{
|
TokenId = ViewConstants.TokenId,
|
PostData = entity
|
}));
|
}
|
#endregion
|
|
public string Delete(string guid)
|
{
|
return HttpWMS_Get("api/Logistics/Delete?guid=" + guid);
|
}
|
|
public string DeleteTemplet(string guid)
|
{
|
return HttpWMS_Get("api/Logistics/DeleteTemplet?guid=" + guid);
|
}
|
|
public string LogisticsList(string logistics, int pageIndex, int pageSize)
|
{
|
return HttpWMS_Post("api/Logistics/LogisticsList", JsonConvert.SerializeObject(new
|
{
|
TokenId = ViewConstants.TokenId,
|
PageIndex = pageIndex,
|
PageSize = pageSize,
|
SearchCondition = new
|
{
|
logistics = logistics
|
}
|
}));
|
}
|
|
public string LogisticsTempletList(string logisticsFlag)
|
{
|
string datas = HttpWMS_Get("api/Logistics/LogisticsTempletList?logisticsFlag=" + logisticsFlag);
|
return datas;
|
}
|
|
#region 根据模版类型获取所有模版
|
/// <summary>
|
/// 根据模版类型获取所有模版
|
/// </summary>
|
/// <param name="type">模版名称</param>
|
/// <returns></returns>
|
public string GetPrintTempletByType(string type)
|
{
|
return HttpWMS_Get("api/PrintTemplet/GetPrintTempletByType?type=" + type);
|
}
|
#endregion
|
|
|
#region 新增物料公司与打印模版
|
/// <summary>
|
/// 新增物料公司与打印模版
|
/// </summary>
|
/// <param name="obj">实体类</param>
|
/// <returns></returns>
|
public string add(JObject obj)
|
{
|
TN_WM_LOGISTICS_TEMPLET_RELEntity entity = JsonHelper.ParseFormJson<TN_WM_LOGISTICS_TEMPLET_RELEntity>(obj.Value<object>("rows").ToString());
|
return HttpWMS_Post("api/Logistics/addLogisticsTemplet", new
|
{
|
TokenId = ViewConstants.TokenId,
|
PostData = entity
|
});
|
}
|
#endregion
|
}
|
}
|