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.
2984 lines
122 KiB
2984 lines
122 KiB
using ICSSoft.DataProject;
|
|
using ICSSoft.Entity;
|
|
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Net.Http;
|
|
using System.Text;
|
|
using System.Web.Http;
|
|
using ICSSoft.Common;
|
|
using System.Data;
|
|
|
|
namespace ICSSoft.WebAPI.Controllers
|
|
{
|
|
|
|
public class WMSBarCoreController : ApiController
|
|
{
|
|
/// <summary>
|
|
/// 日志文件
|
|
/// </summary>
|
|
private static log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
|
HttpResponseMessage result = new HttpResponseMessage();
|
|
Result res = new Result();
|
|
AGVResult agvres = new AGVResult();
|
|
ForkLiftResult forkliftres = new ForkLiftResult();
|
|
string str = string.Empty;
|
|
/// <summary>
|
|
/// 多语言
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/PromptInformation/Get")]
|
|
public HttpResponseMessage PromptInformationGet([FromBody] object JsonData)
|
|
{
|
|
log.Info("多语言传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
WMSBarCoreModel model = new WMSBarCoreModel();
|
|
model = JsonConvert.DeserializeObject<WMSBarCoreModel>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//List<WMSBarCoreModel> resultStr = action.Get(model);
|
|
//res.Success = true;
|
|
//res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
//res.Data = resultStr;
|
|
var resultStr = ICSSubmitService.PromptInformationGet(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("多语言返回值:" + str);
|
|
return result;
|
|
}
|
|
|
|
//#region 委外送货单
|
|
///// <summary>
|
|
///// 委外送货单查询
|
|
///// </summary>
|
|
///// <returns></returns>
|
|
//[HttpPost]
|
|
//[Route("api/AdvancedShipmentNotice/NoticeGet")]
|
|
//public HttpResponseMessage NoticeGET([FromBody] object JsonData)
|
|
//{
|
|
// log.Info("委外送货单信息传入值" + JsonData);
|
|
// try
|
|
// {
|
|
// if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
// {
|
|
// OutsourcingModel model = new OutsourcingModel();
|
|
// model = JsonConvert.DeserializeObject<OutsourcingModel>(JsonData.ToString());
|
|
// OutsourcingSevice action = new OutsourcingSevice();
|
|
// OutsourcingModelInfo resultStr = action.Get(model);
|
|
// if (resultStr == null)
|
|
// {
|
|
// res.Success = false;
|
|
// res.Message = LanguageHelper.GetNameSingle("WMSAPI003");//"未查询到相关数据!";
|
|
// }
|
|
// else
|
|
// {
|
|
// res.Success = true;
|
|
// res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
// res.Data = resultStr;
|
|
// }
|
|
|
|
// }
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// log.Error("转换失败:" + ex.ToString());
|
|
// res.Success = false;
|
|
// res.Message = ex.Message;
|
|
// }
|
|
// finally
|
|
// {
|
|
// str = JsonConvert.SerializeObject(res);
|
|
// result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
// }
|
|
// log.Debug("委外送货单信息返回值:" + str);
|
|
// return result;
|
|
//}
|
|
//#endregion
|
|
|
|
|
|
///// <summary>
|
|
///// 委外送货单添加
|
|
///// </summary>
|
|
///// <param name="JsonData"></param>
|
|
///// <returns></returns>
|
|
//[HttpPost]
|
|
//[Route("api/AdvancedShipmentNotice/NoticeCreate")]
|
|
//public HttpResponseMessage NoticeCreate([FromBody] object JsonData)
|
|
//{
|
|
// log.Info("委外送货单添加信息传入值" + JsonData);
|
|
// try
|
|
// {
|
|
// if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
// {
|
|
// List<NoticeCreateIModel> model = new List<NoticeCreateIModel>();
|
|
// model = JsonConvert.DeserializeObject<List<NoticeCreateIModel>>(JsonData.ToString());
|
|
// OutsourcingSevice action = new OutsourcingSevice();
|
|
// var resultStr = action.Create(model);
|
|
// if (resultStr < 0)
|
|
// {
|
|
// res.Success = false;
|
|
// res.Message = LanguageHelper.GetNameSingle("WMSAPI003");//"未查询到相关数据!";
|
|
// }
|
|
// else
|
|
// {
|
|
// res.Success = true;
|
|
// res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
// res.Data = null;
|
|
// }
|
|
|
|
// }
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// log.Error("转换失败:" + ex.ToString());
|
|
// res.Success = false;
|
|
// res.Message = ex.Message;
|
|
// }
|
|
// finally
|
|
// {
|
|
// str = JsonConvert.SerializeObject(res);
|
|
// result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
// }
|
|
// log.Debug("委外送货单信息返回值:" + str);
|
|
// return result;
|
|
//}
|
|
|
|
///// <summary>
|
|
///// 委外送货单删除
|
|
///// </summary>
|
|
///// <param name="JsonData"></param>
|
|
///// <returns></returns>
|
|
//[HttpPost]
|
|
//[Route("api/AdvancedShipmentNotice/NoticeDelete")]
|
|
//public HttpResponseMessage NoticeDelete([FromBody] object JsonData)
|
|
//{
|
|
// log.Info("委外送货单删除信息传入值" + JsonData);
|
|
// try
|
|
// {
|
|
// if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
// {
|
|
// NoticeDelete model = new NoticeDelete();
|
|
// model = JsonConvert.DeserializeObject<NoticeDelete>(JsonData.ToString());
|
|
// OutsourcingSevice action = new OutsourcingSevice();
|
|
// var resultStr = action.Delete(model);
|
|
// if (resultStr == null)
|
|
// {
|
|
// res.Success = false;
|
|
// res.Message = LanguageHelper.GetNameSingle("WMSAPI003");//"未查询到相关数据!";
|
|
// }
|
|
// else
|
|
// {
|
|
// res.Success = true;
|
|
// res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
// res.Data = resultStr;
|
|
// }
|
|
|
|
// }
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// log.Error("转换失败:" + ex.ToString());
|
|
// res.Success = false;
|
|
// res.Message = ex.Message;
|
|
// }
|
|
// finally
|
|
// {
|
|
// str = JsonConvert.SerializeObject(res);
|
|
// result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
// }
|
|
// log.Debug("委外送货单删除信息返回值:" + str);
|
|
// return result;
|
|
//}
|
|
/// <summary>
|
|
/// 使用中
|
|
/// 获取源头单据信息
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/TransInformation/Get")]
|
|
public HttpResponseMessage TransInformationGet([FromBody] object JsonData)
|
|
{
|
|
log.Info("获取源头单据信息传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
WMSSourceDocumentModel model = new WMSSourceDocumentModel();
|
|
model = JsonConvert.DeserializeObject<WMSSourceDocumentModel>(JsonData.ToString());
|
|
var resultStr = ICSSubmitService.TransInformationGet(model);
|
|
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
res.Data = resultStr;
|
|
}
|
|
else
|
|
{
|
|
res.Success = false;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI003");//"未查询到相关数据!";
|
|
//res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("获取源头单据信息转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("获取源头单据信息返回值:" + str);
|
|
return result;
|
|
|
|
}
|
|
/// <summary>
|
|
/// 获取形态装换单的源头单据信息
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/MTTransInformation/Get")]
|
|
public HttpResponseMessage MTTransInformationGet([FromBody] object JsonData)
|
|
{
|
|
log.Info("获取源头单据信息传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
WMSSourceDocumentModel model = new WMSSourceDocumentModel();
|
|
model = JsonConvert.DeserializeObject<WMSSourceDocumentModel>(JsonData.ToString());
|
|
var resultStr = ICSSubmitService.MTTransInformationGet(model);
|
|
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
res.Data = resultStr;
|
|
}
|
|
else
|
|
{
|
|
res.Success = false;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI003");//"未查询到相关数据!";
|
|
//res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("获取源头单据信息转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("获取源头单据信息返回值:" + str);
|
|
return result;
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取拣料信息
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/GetICSMOPickMergeTemp/Get")]
|
|
public HttpResponseMessage GetICSMOPickMergeTemp([FromBody] object JsonData)
|
|
{
|
|
log.Info("获取源头单据信息传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
WMSSourceDocumentModel model = new WMSSourceDocumentModel();
|
|
model = JsonConvert.DeserializeObject<WMSSourceDocumentModel>(JsonData.ToString());
|
|
var resultStr = ICSSubmitService.GetICSMOPickMergeTemp(model);
|
|
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
res.Data = resultStr;
|
|
}
|
|
else
|
|
{
|
|
res.Success = false;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI003");//"未查询到相关数据!";
|
|
//res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("获取源头单据信息转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("获取源头单据信息返回值:" + str);
|
|
return result;
|
|
|
|
}
|
|
/// <summary>
|
|
/// 验证箱号是否可用
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/ContainerCheck/Get")]
|
|
public HttpResponseMessage ContainerCheck([FromBody] object JsonData)
|
|
{
|
|
log.Info("获取条码信息传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
ICSContainerInfo model = new ICSContainerInfo();
|
|
model = JsonConvert.DeserializeObject<ICSContainerInfo>(JsonData.ToString());
|
|
//var resultStr = ICSSubmitService.BarCodeInformationGet(model);
|
|
//res.Success = true;
|
|
//res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
//res.Data = resultStr;
|
|
res = ICSSubmitService.ContainerCheck(model);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("获取条码信息返回值:" + str);
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// 获取推荐库位
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/LocationRecommend/Get")]
|
|
public HttpResponseMessage LocationRecommend([FromBody] object JsonData)
|
|
{
|
|
log.Info("获取条码信息传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
ICSLocationRecommend model = new ICSLocationRecommend();
|
|
model = JsonConvert.DeserializeObject<ICSLocationRecommend>(JsonData.ToString());
|
|
//var resultStr = ICSSubmitService.BarCodeInformationGet(model);
|
|
//res.Success = true;
|
|
//res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
//res.Data = resultStr;
|
|
res = ICSSubmitService.LocationRecommend(model);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("获取条码信息返回值:" + str);
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// 使用中
|
|
/// 获取条码信息
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/BarCodeInformation/Get")]
|
|
public HttpResponseMessage BarCodeInformationGet([FromBody] object JsonData)
|
|
{
|
|
log.Info("获取条码信息传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
BarCodeModel model = new BarCodeModel();
|
|
model = JsonConvert.DeserializeObject<BarCodeModel>(JsonData.ToString());
|
|
//var resultStr = ICSSubmitService.BarCodeInformationGet(model);
|
|
//res.Success = true;
|
|
//res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
//res.Data = resultStr;
|
|
res = ICSSubmitService.BarCodeInformationGet(model);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("获取条码信息返回值:" + str);
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// 验证条码入库库位及区域是否符合单据要求
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/BarCodeLocationCheck/Get")]
|
|
public HttpResponseMessage BarCodeLocationCheck([FromBody] object JsonData)
|
|
{
|
|
log.Info("验证条码入库库位信息传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
BarCodeCheckModel model = new BarCodeCheckModel();
|
|
model = JsonConvert.DeserializeObject<BarCodeCheckModel>(JsonData.ToString());
|
|
res.Message = ICSSubmitService.CheckWHCode(model);
|
|
if (res.Message == "验证成功")
|
|
{
|
|
res.Success = true;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("验证条码入库库位信息返回值:" + str);
|
|
return result;
|
|
}
|
|
///// <summary>
|
|
///// 上架
|
|
///// </summary>
|
|
///// <param name="JsonData"></param>
|
|
///// <returns></returns>
|
|
//[HttpPost]
|
|
//[Route("api/LOTStockUp/Get")]
|
|
//public HttpResponseMessage LOTStockUpGet([FromBody] object JsonData)
|
|
//{
|
|
// log.Info("上架传入值" + JsonData);
|
|
// try
|
|
// {
|
|
// if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
// {
|
|
// WMSTBarCodeModel model = new WMSTBarCodeModel();
|
|
// model = JsonConvert.DeserializeObject<WMSTBarCodeModel>(JsonData.ToString());
|
|
// WMSBarCoreService action = new WMSBarCoreService();
|
|
// var resultStr = action.LOTStockUpGet(model);
|
|
// res.Success = true;
|
|
// res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
// res.Data = resultStr;
|
|
// }
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// log.Error("转换失败:" + ex.ToString());
|
|
// res.Success = false;
|
|
// res.Message = ex.Message;
|
|
// }
|
|
// finally
|
|
// {
|
|
// str = JsonConvert.SerializeObject(res);
|
|
// result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
// }
|
|
// log.Debug("获取条码信息返回值:" + str);
|
|
// return result;
|
|
//}
|
|
|
|
/// <summary>
|
|
/// 上架添加
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/LOTStockUp/Create")]
|
|
public HttpResponseMessage LOTStockUpCreate([FromBody] object JsonData)
|
|
{
|
|
log.Info("上架传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
List<LOTStockUpCreateIModel> model = new List<LOTStockUpCreateIModel>();
|
|
model = JsonConvert.DeserializeObject<List<LOTStockUpCreateIModel>>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.LOTStockCreate(model);
|
|
var resultStr = ICSSubmitService.LOTStockCreate(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("上架返回值:" + str);
|
|
return result;
|
|
}
|
|
[HttpPost]
|
|
[Route("api/MTDoc/Create")]
|
|
public HttpResponseMessage MTDocCreate([FromBody] object JsonData)
|
|
{
|
|
log.Info("上架传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
List<ICSMTDocModel> model = new List<ICSMTDocModel>();
|
|
model = JsonConvert.DeserializeObject<List<ICSMTDocModel>>(JsonData.ToString());
|
|
var resultStr = ICSSubmitService.MTDocCreate(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("上架返回值:" + str);
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 上架添加(货柜用)
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/LOTStockUpHG/Create")]
|
|
public HttpResponseMessage LOTStockUpHGCreate([FromBody] object JsonData)
|
|
{
|
|
log.Info("上架传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
LOTStockUpHGModel model = new LOTStockUpHGModel();
|
|
model = JsonConvert.DeserializeObject<LOTStockUpHGModel>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.LOTStockCreate(model);
|
|
var resultStr = ICSSubmitService.LOTStockCreateHG(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("上架返回值:" + str);
|
|
return result;
|
|
}
|
|
|
|
// <summary>
|
|
/// 叉车出入库
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/LOTStockChangeForkLift/Create")]
|
|
public HttpResponseMessage LOTStockChangeForkLift([FromBody] object JsonData)
|
|
{
|
|
log.Info("上架传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
LOTStockForkLiftModel model = new LOTStockForkLiftModel();
|
|
model = JsonConvert.DeserializeObject<LOTStockForkLiftModel>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.LOTStockCreate(model);
|
|
var resultStr = ICSSubmitService.LOTStockChangeForkLift(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("上架返回值:" + str);
|
|
return result;
|
|
}
|
|
|
|
/*
|
|
/// <summary>
|
|
/// 测试获取管控方式
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/ControlMode/Get")]
|
|
public HttpResponseMessage getControlMode()
|
|
{
|
|
log.Info("获取管控方式" );
|
|
try
|
|
{
|
|
ControlMode model = new ControlMode();
|
|
//model = JsonConvert.DeserializeObject<List<LOTStockUpCreateIModel>>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.LOTStockCreate(model);
|
|
var resultStr = ICSControlModeService.GetControlModes();
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.ToString() != "[]")
|
|
{
|
|
if (resultStr.itemCode.Equals("ControlMode01"))
|
|
{
|
|
res.Data = "启用批次";
|
|
}
|
|
else
|
|
{
|
|
res.Data = "启用物料";
|
|
}
|
|
//res.Data = resultStr.itemCode + "," + resultStr.itemName + "," + resultStr.enableMark + "," + resultStr.itemCode.Equals("ControlMode01");
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("上架返回值:" + str);
|
|
return result;
|
|
}
|
|
*/
|
|
|
|
///// <summary>
|
|
///// 上架删除
|
|
///// </summary>
|
|
///// <param name="JsonData"></param>
|
|
///// <returns></returns>
|
|
//[HttpPost]
|
|
//[Route("api/LOTStockUp/Delete")]
|
|
//public HttpResponseMessage LOTStockUpDelete([FromBody] object JsonData)
|
|
//{
|
|
// log.Info("上架删除传入值" + JsonData);
|
|
// try
|
|
// {
|
|
// if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
// {
|
|
// LOTStockUpDeleteIModel model = new LOTStockUpDeleteIModel();
|
|
// model = JsonConvert.DeserializeObject<LOTStockUpDeleteIModel>(JsonData.ToString());
|
|
// WMSBarCoreService action = new WMSBarCoreService();
|
|
// var resultStr = action.LOTStockDelete(model);
|
|
// res.Success = true;
|
|
// res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
// //res.Data = resultStr;
|
|
// }
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// log.Error("转换失败:" + ex.ToString());
|
|
// res.Success = false;
|
|
// res.Message = ex.Message;
|
|
// }
|
|
// finally
|
|
// {
|
|
// str = JsonConvert.SerializeObject(res);
|
|
// result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
// }
|
|
// log.Debug("上架删除返回值:" + str);
|
|
// return result;
|
|
//}
|
|
|
|
///// <summary>
|
|
///// 下架查询
|
|
///// </summary>
|
|
///// <param name="JsonData"></param>
|
|
///// <returns></returns>
|
|
//[HttpPost]
|
|
//[Route("api/LOTStockDown/Get")]
|
|
//public HttpResponseMessage LOTStockDownGet([FromBody] object JsonData)
|
|
//{
|
|
// log.Info("下架查询传入值" + JsonData);
|
|
// try
|
|
// {
|
|
// if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
// {
|
|
// WMSTBarCodeModel model = new WMSTBarCodeModel();
|
|
// model = JsonConvert.DeserializeObject<WMSTBarCodeModel>(JsonData.ToString());
|
|
// WMSBarCoreService action = new WMSBarCoreService();
|
|
// var resultStr = action.LOTStockUpGet(model);
|
|
// res.Success = true;
|
|
// res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
// //res.Data = resultStr;
|
|
// }
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// log.Error("转换失败:" + ex.ToString());
|
|
// res.Success = false;
|
|
// res.Message = ex.Message;
|
|
// }
|
|
// finally
|
|
// {
|
|
// str = JsonConvert.SerializeObject(res);
|
|
// result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
// }
|
|
// log.Debug("下架查询返回值:" + str);
|
|
// return result;
|
|
//}
|
|
|
|
|
|
/// <summary>
|
|
/// 下架添加
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/LOTStockDown/Create")]
|
|
public HttpResponseMessage LOTStockDownCreate([FromBody] object JsonData)
|
|
{
|
|
log.Info("下架传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
List<LOTStockModel> model = new List<LOTStockModel>();
|
|
model = JsonConvert.DeserializeObject<List<LOTStockModel>>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.LOTStockDownCreate(model);
|
|
var resultStr = ICSSubmitService.LOTStockDownCreate(model);
|
|
res.Success = true;
|
|
//res.PrintStr = DBHelper.ReadFileStream();
|
|
if (resultStr.Columns.Contains("OLDLotNo"))
|
|
{
|
|
res.PrintStr = DBHelper.ReadFileStream();
|
|
}
|
|
else
|
|
{
|
|
res.PrintStr = "";
|
|
}
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("下架返回值:" + str);
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 货柜下架添加
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/LOTStockDownHG/Create")]
|
|
public HttpResponseMessage LOTStockDownHGCreate([FromBody] object JsonData)
|
|
{
|
|
log.Info("下架传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
LOTStockDownHGModel model = new LOTStockDownHGModel();
|
|
model = JsonConvert.DeserializeObject<LOTStockDownHGModel>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.LOTStockDownCreate(model);
|
|
var resultStr = ICSSubmitService.LOTStockDownHGCreate(model, JsonData);
|
|
res.Success = true;
|
|
//res.PrintStr = DBHelper.ReadFileStream();
|
|
if (resultStr.Columns.Contains("OLDLotNo"))
|
|
{
|
|
res.PrintStr = DBHelper.ReadFileStream();
|
|
}
|
|
else
|
|
{
|
|
res.PrintStr = "";
|
|
}
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("下架返回值:" + str);
|
|
return result;
|
|
}
|
|
|
|
///// <summary>
|
|
///// 合并
|
|
///// </summary>
|
|
///// <param name="JsonData"></param>
|
|
///// <returns></returns>
|
|
//[HttpPost]
|
|
//[Route("api/LOTSplit/Get")]
|
|
//public HttpResponseMessage LOTSplitGet([FromBody] object JsonData)
|
|
//{
|
|
|
|
// log.Info("拆分查询传入值" + JsonData);
|
|
// try
|
|
// {
|
|
// if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
// {
|
|
// WMSTBarCodeModel model = new WMSTBarCodeModel();
|
|
// model = JsonConvert.DeserializeObject<WMSTBarCodeModel>(JsonData.ToString());
|
|
// WMSBarCoreService action = new WMSBarCoreService();
|
|
// var resultStr = action.LOTMergeGet(model);
|
|
// res.Success = true;
|
|
// res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
// res.Data = resultStr;
|
|
// }
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// log.Error("转换失败:" + ex.ToString());
|
|
// res.Success = false;
|
|
// res.Message = ex.Message;
|
|
// }
|
|
// finally
|
|
// {
|
|
// str = JsonConvert.SerializeObject(res);
|
|
// result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
// }
|
|
// log.Debug("拆分查询返回值:" + str);
|
|
// return result;
|
|
//}
|
|
|
|
/// <summary>
|
|
/// 合并
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/LOTMerge/Create")]
|
|
public HttpResponseMessage LOTMergeCreate([FromBody] object JsonData)
|
|
{
|
|
|
|
log.Info("合并传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
List<LOTCreateIModel> model = new List<LOTCreateIModel>();
|
|
model = JsonConvert.DeserializeObject<List<LOTCreateIModel>>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.LOTMergeCreate(model);
|
|
//res.Success = true;
|
|
//res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
////res.Data = resultStr;
|
|
var resultStr = ICSSubmitService.LOTMergeCreate(model);
|
|
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("合并返回值:" + str);
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 拆分
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/LOTSplit/Create")]
|
|
public HttpResponseMessage LOTSplitCreates([FromBody] object JsonData)
|
|
{
|
|
|
|
log.Info("拆分传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
List<LOTCreateIModel> model = new List<LOTCreateIModel>();
|
|
model = JsonConvert.DeserializeObject<List<LOTCreateIModel>>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.LOTSplitCreates(model);
|
|
var resultStr = ICSSubmitService.LOTSplitCreate(model);
|
|
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("拆分返回值:" + str);
|
|
return result;
|
|
}
|
|
|
|
///// <summary>
|
|
///// 修正
|
|
///// </summary>
|
|
///// <param name="JsonData"></param>
|
|
///// <returns></returns>
|
|
//[HttpPost]
|
|
//[Route("api/LOTRevise/Updete")]
|
|
//public HttpResponseMessage LOTReviseUpdete([FromBody] object JsonData)
|
|
//{
|
|
|
|
// log.Info("修正传入值" + JsonData);
|
|
// try
|
|
// {
|
|
// if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
// {
|
|
// //List<LOTReviseUpdateIModel> model = new List<LOTReviseUpdateIModel>();
|
|
// LOTReviseUpdateIModel model = JsonConvert.DeserializeObject<LOTReviseUpdateIModel>(JsonData.ToString());
|
|
// WMSBarCoreService action = new WMSBarCoreService();
|
|
// var resultStr = action.LOTReviseUpdate(model);
|
|
// res.Success = true;
|
|
// res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
// res.Data = resultStr;
|
|
// }
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// log.Error("转换失败:" + ex.ToString());
|
|
// res.Success = false;
|
|
// res.Message = ex.Message;
|
|
// }
|
|
// finally
|
|
// {
|
|
// str = JsonConvert.SerializeObject(res);
|
|
// result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
// }
|
|
// log.Debug("修正返回值:" + str);
|
|
// return result;
|
|
//}
|
|
|
|
///// <summary>
|
|
///// 盘点查询
|
|
///// </summary>
|
|
///// <param name="JsonData"></param>
|
|
///// <returns></returns>
|
|
//[HttpPost]
|
|
//[Route("api/LOTCheck/Get")]
|
|
//public HttpResponseMessage LOTCheckGet([FromBody] object JsonData)
|
|
//{
|
|
// log.Info("修正传入值" + JsonData);
|
|
// try
|
|
// {
|
|
// if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
// {
|
|
// //List<LOTReviseUpdateIModel> model = new List<LOTReviseUpdateIModel>();
|
|
// ICSCheck model = JsonConvert.DeserializeObject<ICSCheck>(JsonData.ToString());
|
|
// WMSBarCoreService action = new WMSBarCoreService();
|
|
// var resultStr = action.CheckGet(model);
|
|
// if (!string.IsNullOrWhiteSpace(resultStr.ToString()))
|
|
// {
|
|
// res.Success = true;
|
|
// res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
// res.Data = resultStr;
|
|
// }
|
|
// else
|
|
// {
|
|
// res.Success = false;
|
|
// res.Message = "数据为空!";
|
|
|
|
// }
|
|
// }
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// log.Error("转换失败:" + ex.ToString());
|
|
// res.Success = false;
|
|
// res.Message = ex.Message;
|
|
// }
|
|
// finally
|
|
// {
|
|
// str = JsonConvert.SerializeObject(res);
|
|
// result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
// }
|
|
// log.Debug("修正返回值:" + str);
|
|
// return result;
|
|
//}
|
|
|
|
/// <summary>
|
|
/// 盘点扫描
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/LOTCheck/Create")]
|
|
public HttpResponseMessage LOTCheckCreate([FromBody] object JsonData)
|
|
{
|
|
log.Info("盘点扫描传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
List<ICSCheck> model = JsonConvert.DeserializeObject<List<ICSCheck>>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.LOTCheckCreate(model);
|
|
//res.Success = true;
|
|
//res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
//res.Data = resultStr;
|
|
var resultStr = ICSSubmitService.LOTCheckCreate(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("盘点扫描返回值:" + str);
|
|
return result;
|
|
}
|
|
|
|
///// <summary>
|
|
///// 盘点删除
|
|
///// </summary>
|
|
///// <param name="JsonData"></param>
|
|
///// <returns></returns>
|
|
//[HttpPost]
|
|
//[Route("api/LOTCheck/Delete")]
|
|
//public HttpResponseMessage LOTCheckDelete([FromBody] object JsonData)
|
|
//{
|
|
// log.Info("盘点删除传入值" + JsonData);
|
|
// try
|
|
// {
|
|
// if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
// {
|
|
// List<ICSCheck> model = JsonConvert.DeserializeObject<List<ICSCheck>>(JsonData.ToString());
|
|
// WMSBarCoreService action = new WMSBarCoreService();
|
|
// var resultStr = action.LOTCheckDelete(model);
|
|
// res.Success = true;
|
|
// res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
// res.Data = resultStr;
|
|
// }
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// log.Error("转换失败:" + ex.ToString());
|
|
// res.Success = false;
|
|
// res.Message = ex.Message;
|
|
// }
|
|
// finally
|
|
// {
|
|
// str = JsonConvert.SerializeObject(res);
|
|
// result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
// }
|
|
// log.Debug("盘点删除返回值:" + str);
|
|
// return result;
|
|
//}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// 生产退料申请审核
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/MOIssueDocNegativeApply/Approve")]
|
|
public HttpResponseMessage MOIssueDocNegativeApplyApprove([FromBody] object JsonData)
|
|
{
|
|
log.Info("生产退料申请审核传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
List<ICSUser> model = JsonConvert.DeserializeObject<List<ICSUser>>(JsonData.ToString());
|
|
var resultStr = ICSSubmitService.MOIssueDocNegativeApplyApprove(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("生产退料申请审核返回值:" + str);
|
|
return result;
|
|
}
|
|
///// <summary>
|
|
///// 生产退料申请查询
|
|
///// </summary>
|
|
///// <param name="JsonData"></param>
|
|
///// <returns></returns>
|
|
//[HttpPost]
|
|
//[Route("api/MOIssueDocNegativeApply/Get")]
|
|
//public HttpResponseMessage MOIssueDocNegativeApplyGet([FromBody] object JsonData)
|
|
//{
|
|
|
|
// log.Info("生产退料申请查询传入值" + JsonData);
|
|
// try
|
|
// {
|
|
// // List<ICSMOApplyNeg> model = new List<ICSMOApplyNeg>();
|
|
// ICSMOApplyNeg model = new ICSMOApplyNeg();
|
|
// if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
// {
|
|
// model = JsonConvert.DeserializeObject<ICSMOApplyNeg>(JsonData.ToString());
|
|
// WMSBarCoreService action = new WMSBarCoreService();
|
|
// var resultStr = action.MOIssueDocNegativeApplyGet(model);
|
|
// if (resultStr.Count > 0)
|
|
// {
|
|
// res.Success = true;
|
|
// res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
// res.Data = resultStr;
|
|
// }
|
|
// else
|
|
// {
|
|
// res.Success = true;
|
|
// res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
// res.Data = "退料单号没有数据!";
|
|
// }
|
|
|
|
// }
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// log.Error("转换失败:" + ex.ToString());
|
|
// res.Success = false;
|
|
// res.Message = ex.Message;
|
|
// }
|
|
// finally
|
|
// {
|
|
// str = JsonConvert.SerializeObject(res);
|
|
// result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
// }
|
|
// log.Debug("生产退料申请查询返回值:" + str);
|
|
// return result;
|
|
//}
|
|
|
|
/// <summary>
|
|
/// 生产退料申请添加
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/MOIssueDocNegativeApply/Create")]
|
|
public HttpResponseMessage MOIssueDocNegativeApplyCreate([FromBody] object JsonData)
|
|
{
|
|
log.Info("生产退料申请添加传入值" + JsonData);
|
|
try
|
|
{
|
|
List<ICSMOApplyNeg> model = new List<ICSMOApplyNeg>();
|
|
//ICSMOApplyNeg model = new ICSMOApplyNeg();
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
model = JsonConvert.DeserializeObject<List<ICSMOApplyNeg>>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.MOIssueDocNegativeApplyCreate(model);
|
|
var resultStr = ICSSubmitService.MOIssueDocNegativeApplyCreate(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("生产退料申请添加返回值:" + str);
|
|
return result;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 生产退料申请添加
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/MOIssueDocNegativeApply/Update")]
|
|
public HttpResponseMessage MOIssueDocNegativeApplyUpdate([FromBody] object JsonData)
|
|
{
|
|
log.Info("生产退料申请修改传入值" + JsonData);
|
|
try
|
|
{
|
|
List<ICSMOApplyNeg> model = new List<ICSMOApplyNeg>();
|
|
//ICSMOApplyNeg model = new ICSMOApplyNeg();
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
model = JsonConvert.DeserializeObject<List<ICSMOApplyNeg>>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.MOIssueDocNegativeApplyUpdate(model);
|
|
var resultStr = ICSSubmitService.MOIssueDocNegativeApplyUpdate(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("生产退料申请修改返回值:" + str);
|
|
return result;
|
|
}
|
|
|
|
///// <summary>
|
|
///// 生产退料删除
|
|
///// </summary>
|
|
///// <param name="JsonData"></param>
|
|
///// <returns></returns>
|
|
//[HttpPost]
|
|
//[Route("api/MOIssueDocNegativeApply/Delete")]
|
|
//public HttpResponseMessage MOIssueDocNegativeApplyDelete([FromBody] object JsonData)
|
|
//{
|
|
// log.Info("生产退料申请添加传入值" + JsonData);
|
|
// try
|
|
// {
|
|
// List<ICSMOApplyNeg> model = new List<ICSMOApplyNeg>();
|
|
// if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
// {
|
|
// model = JsonConvert.DeserializeObject<List<ICSMOApplyNeg>>(JsonData.ToString());
|
|
// WMSBarCoreService action = new WMSBarCoreService();
|
|
// var resultStr = action.MOIssueDocNegativeApplyDelete(model);
|
|
// if (resultStr > 0)
|
|
// {
|
|
// res.Success = true;
|
|
// res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
// res.Data = resultStr;
|
|
// }
|
|
// else
|
|
// {
|
|
// res.Success = false;
|
|
// res.Message = "退料单号没有数据!";
|
|
// }
|
|
// }
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// log.Error("转换失败:" + ex.ToString());
|
|
// res.Success = false;
|
|
// res.Message = ex.Message;
|
|
// }
|
|
// finally
|
|
// {
|
|
// str = JsonConvert.SerializeObject(res);
|
|
// result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
// }
|
|
// log.Debug("生产退料申请添加返回值:" + str);
|
|
// return result;
|
|
//}
|
|
|
|
#region 到货单
|
|
///// <summary>
|
|
///// 到货单查询
|
|
///// </summary>
|
|
///// <param name="JsonData"></param>
|
|
///// <returns></returns>
|
|
//[HttpPost]
|
|
//[Route("api/DeliveryNotice/Get")]
|
|
//public HttpResponseMessage DeliveryNoticeGet([FromBody] object JsonData)
|
|
//{
|
|
// string DNType = "到货";
|
|
// log.Info("生产退料申请添加传入值" + JsonData);
|
|
// try
|
|
// {
|
|
// List<ICSDeliveryNotice> model = new List<ICSDeliveryNotice>();
|
|
// if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
// {
|
|
// model = JsonConvert.DeserializeObject<List<ICSDeliveryNotice>>(JsonData.ToString());
|
|
// WMSBarCoreService action = new WMSBarCoreService();
|
|
// var resultStr = action.DeliveryNoticeGet(model, DNType);
|
|
// if (!string.IsNullOrWhiteSpace(resultStr))
|
|
// {
|
|
// res.Success = true;
|
|
// res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
// res.Data = null;
|
|
// }
|
|
// else
|
|
// {
|
|
// res.Success = false;
|
|
// res.Message = resultStr;
|
|
// }
|
|
// }
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// log.Error("转换失败:" + ex.ToString());
|
|
// res.Success = false;
|
|
// res.Message = ex.Message;
|
|
// }
|
|
// finally
|
|
// {
|
|
// str = JsonConvert.SerializeObject(res);
|
|
// result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
// }
|
|
// log.Debug("生产退料申请添加返回值:" + str);
|
|
// return result;
|
|
//}
|
|
/// <summary>
|
|
/// 到货单添加
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/DeliveryNotice/Create")]
|
|
public HttpResponseMessage DeliveryNoticeCreate([FromBody] object JsonData)
|
|
{
|
|
//string DNType = "到货";
|
|
log.Info("采购到货传入值" + JsonData);
|
|
try
|
|
{
|
|
List<ICSDeliveryNotice> model = new List<ICSDeliveryNotice>();
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
model = JsonConvert.DeserializeObject<List<ICSDeliveryNotice>>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.DeliveryNoticeCreate(model, DNType);
|
|
var resultStr = ICSSubmitService.DeliveryNoticeCreate(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("采购到货返回值:" + str);
|
|
return result;
|
|
}
|
|
#endregion
|
|
|
|
#region 拒收单
|
|
/// <summary>
|
|
/// 拒收单添加
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/PurchaseRejectDoc/Create")]
|
|
public HttpResponseMessage PurchaseRejectDocCreate([FromBody] object JsonData)
|
|
{
|
|
//string DNType = "拒收";
|
|
log.Info("拒收单传入值" + JsonData);
|
|
try
|
|
{
|
|
List<ICSDeliveryNotice> model = new List<ICSDeliveryNotice>();
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
model = JsonConvert.DeserializeObject<List<ICSDeliveryNotice>>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.DeliveryNoticeCreate(model, DNType);
|
|
var resultStr = ICSSubmitService.PurchaseRejectDocCreate(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("拒收单返回值:" + str);
|
|
return result;
|
|
}
|
|
#endregion
|
|
|
|
#region 委外到货单
|
|
/// <summary>
|
|
/// 委外到货单添加
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/OutsourcingDeliveryNotice/Create")]
|
|
public HttpResponseMessage OutsourcingDeliveryNoticeCreate([FromBody] object JsonData)
|
|
{
|
|
log.Info("委外到货传入值" + JsonData);
|
|
try
|
|
{
|
|
List<ICSDeliveryNotice> model = new List<ICSDeliveryNotice>();
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
model = JsonConvert.DeserializeObject<List<ICSDeliveryNotice>>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.DeliveryNoticeODNCreate(model, DNType);
|
|
var resultStr = ICSSubmitService.OutsourcingDeliveryNoticeCreate(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("委外到货返回值:" + str);
|
|
return result;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 委外拒货单
|
|
|
|
/// <summary>
|
|
/// 委外单添加
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/OutsourcingRejectDoc/Create")]
|
|
public HttpResponseMessage DeliveryNoticeORJTCreate([FromBody] object JsonData)
|
|
{
|
|
log.Info("委外拒收传入值" + JsonData);
|
|
try
|
|
{
|
|
List<ICSDeliveryNotice> model = new List<ICSDeliveryNotice>();
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
model = JsonConvert.DeserializeObject<List<ICSDeliveryNotice>>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.DeliveryNoticeODNCreate(model, DNType);
|
|
var resultStr = ICSSubmitService.OutsourcingRejectDocCreate(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("委外拒收返回值:" + str);
|
|
return result;
|
|
|
|
}
|
|
#endregion
|
|
|
|
#region 仓库/库位
|
|
|
|
/// <summary>
|
|
/// 仓库/库位
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/Location/Get")]
|
|
public HttpResponseMessage LocationGet([FromBody] object JsonData)
|
|
{
|
|
log.Info("仓库/库位传入值" + JsonData);
|
|
try
|
|
{
|
|
ICSLocation model = new ICSLocation();
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
model = JsonConvert.DeserializeObject<ICSLocation>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.LocationGet(model);
|
|
//if (resultStr.Count > 0)
|
|
//{
|
|
// res.Success = true;
|
|
// res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
// res.Data = resultStr;
|
|
//}
|
|
//else
|
|
//{
|
|
// res.Success = false;
|
|
// res.Message = "仓库没有启用,请先启用仓库!";
|
|
|
|
//}
|
|
var resultStr = ICSSubmitService.LocationGet(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("仓库/库位返回值:" + str);
|
|
return result;
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
#region 委外退料 /OutsourcingIssueDoNegativeApply
|
|
///// <summary>
|
|
///// 委外退料
|
|
///// </summary>
|
|
///// <param name="JsonData"></param>
|
|
///// <returns></returns>
|
|
//[HttpPost]
|
|
//[Route("api/OutsourcingIssueDoNegativeApply/Get")]
|
|
//public HttpResponseMessage OutsourcingIssueDoNegativeApplyGet([FromBody] object JsonData)
|
|
//{
|
|
// log.Info("委外退料传入值" + JsonData);
|
|
// try
|
|
// {
|
|
// ICSOApplyNeg model = new ICSOApplyNeg();
|
|
// if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
// {
|
|
// model = JsonConvert.DeserializeObject<ICSOApplyNeg>(JsonData.ToString());
|
|
// WMSBarCoreService action = new WMSBarCoreService();
|
|
// var resultStr = action.OutsourcingIssueDoNegativeApplyGet(model);
|
|
// if (!string.IsNullOrWhiteSpace(resultStr.ToString()))
|
|
// {
|
|
// res.Success = true;
|
|
// res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
// res.Data = resultStr;
|
|
// }
|
|
// else
|
|
// {
|
|
// res.Success = false;
|
|
// res.Message = "数据为空!";
|
|
|
|
// }
|
|
|
|
// }
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// log.Error("转换失败:" + ex.ToString());
|
|
// res.Success = false;
|
|
// res.Message = ex.Message;
|
|
// }
|
|
// finally
|
|
// {
|
|
// str = JsonConvert.SerializeObject(res);
|
|
// result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
// }
|
|
// log.Debug("委外退料返回值:" + str);
|
|
// return result;
|
|
//}
|
|
|
|
|
|
/// <summary>
|
|
/// 委外退料Create
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/OutsourcingIssueDoNegativeApply/Create")]
|
|
public HttpResponseMessage OutsourcingIssueDoNegativeApplyCreate([FromBody] object JsonData)
|
|
{
|
|
log.Info("委外退料创建传入值" + JsonData);
|
|
try
|
|
{
|
|
List<ICSOApplyNeg> model = new List<ICSOApplyNeg>();
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
model = JsonConvert.DeserializeObject<List<ICSOApplyNeg>>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.OutsourcingIssueDoNegativeApplyCreate(model);
|
|
var resultStr = ICSSubmitService.OutsourcingIssueDoNegativeApplyCreate(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("委外退料创建返回值:" + str);
|
|
return result;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 委外退料Update
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/OutsourcingIssueDoNegativeApply/Update")]
|
|
public HttpResponseMessage OutsourcingIssueDoNegativeApplyUpdate([FromBody] object JsonData)
|
|
{
|
|
log.Info("委外退料修改传入值" + JsonData);
|
|
try
|
|
{
|
|
List<ICSOApplyNeg> model = new List<ICSOApplyNeg>();
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
model = JsonConvert.DeserializeObject<List<ICSOApplyNeg>>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.OutsourcingIssueDoNegativeApplyUpdate(model);
|
|
var resultStr = ICSSubmitService.OutsourcingIssueDoNegativeApplyUpdate(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("委外退料修改返回值:" + str);
|
|
return result;
|
|
}
|
|
|
|
|
|
///// <summary>
|
|
///// 委外退料Delete
|
|
///// </summary>
|
|
///// <param name="JsonData"></param>
|
|
///// <returns></returns>
|
|
//[HttpPost]
|
|
//[Route("api/OutsourcingIssueDoNegativeApply/Delete")]
|
|
//public HttpResponseMessage OutsourcingIssueDoNegativeApplyDelete([FromBody] object JsonData)
|
|
//{
|
|
// log.Info("委外退料传入值" + JsonData);
|
|
// try
|
|
// {
|
|
// List<ICSOApplyNeg> model = new List<ICSOApplyNeg>();
|
|
// if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
// {
|
|
// model = JsonConvert.DeserializeObject<List<ICSOApplyNeg>>(JsonData.ToString());
|
|
// WMSBarCoreService action = new WMSBarCoreService();
|
|
// var resultStr = action.OutsourcingIssueDoNegativeApplyDelete(model);
|
|
// if (resultStr > 0)
|
|
// {
|
|
// res.Success = true;
|
|
// res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
// res.Data = null;
|
|
// }
|
|
// else
|
|
// {
|
|
// res.Success = false;
|
|
// res.Message = "数据异常!";
|
|
|
|
// }
|
|
|
|
// }
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// log.Error("转换失败:" + ex.ToString());
|
|
// res.Success = false;
|
|
// res.Message = ex.Message;
|
|
// }
|
|
// finally
|
|
// {
|
|
// str = JsonConvert.SerializeObject(res);
|
|
// result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
// }
|
|
// log.Debug("委外退料返回值:" + str);
|
|
// return result;
|
|
//}
|
|
|
|
/// <summary>
|
|
/// 委外退料Approve
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/OutsourcingIssueDoNegativeApply/Approve")]
|
|
public HttpResponseMessage OutsourcingIssueDoNegativeApplyApprove([FromBody] object JsonData)
|
|
{
|
|
log.Info("委外退料审核传入值" + JsonData);
|
|
try
|
|
{
|
|
List<ICSUser> model = new List<ICSUser>();
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
model = JsonConvert.DeserializeObject<List<ICSUser>>(JsonData.ToString());
|
|
var resultStr = ICSSubmitService.OutsourcingIssueDoNegativeApplyApprove(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("委外退料审核返回值:" + str);
|
|
return result;
|
|
}
|
|
#endregion
|
|
|
|
#region 盘点单 Check
|
|
///// <summary>
|
|
///// 盘点单
|
|
///// </summary>
|
|
///// <param name="JsonData"></param>
|
|
///// <returns></returns>
|
|
//[HttpPost]
|
|
//[Route("api/Check/Get")]
|
|
//public HttpResponseMessage CheckGet([FromBody] object JsonData)
|
|
//{
|
|
// log.Info("委外退料传入值" + JsonData);
|
|
// try
|
|
// {
|
|
// ICSCheck model = new ICSCheck();
|
|
// if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
// {
|
|
// model = JsonConvert.DeserializeObject<ICSCheck>(JsonData.ToString());
|
|
// WMSBarCoreService action = new WMSBarCoreService();
|
|
// var resultStr = action.CheckGet(model);
|
|
// if (!string.IsNullOrWhiteSpace(resultStr.ToString()))
|
|
// {
|
|
// res.Success = true;
|
|
// res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
// res.Data = resultStr;
|
|
// }
|
|
// else
|
|
// {
|
|
// res.Success = false;
|
|
// res.Message = "数据为空!";
|
|
|
|
// }
|
|
|
|
// }
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// log.Error("转换失败:" + ex.ToString());
|
|
// res.Success = false;
|
|
// res.Message = ex.Message;
|
|
// }
|
|
// finally
|
|
// {
|
|
// str = JsonConvert.SerializeObject(res);
|
|
// result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
// }
|
|
// log.Debug("委外退料返回值:" + str);
|
|
// return result;
|
|
//}
|
|
|
|
|
|
/// <summary>
|
|
/// 盘点单
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/Check/Create")]
|
|
public HttpResponseMessage CheckCreate([FromBody] object JsonData)
|
|
{
|
|
//string Type = "库存盘点";
|
|
log.Info("盘点单传入值" + JsonData);
|
|
try
|
|
{
|
|
List<ICSCheck> model = new List<ICSCheck>();
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
model = JsonConvert.DeserializeObject<List<ICSCheck>>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.CheckCreate(model, Type);
|
|
var resultStr = ICSSubmitService.CheckCreate(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("盘点单返回值:" + str);
|
|
return result;
|
|
}
|
|
|
|
|
|
|
|
///// <summary>
|
|
///// 盘点审核
|
|
///// </summary>
|
|
///// <param name="JsonData"></param>
|
|
///// <returns></returns>
|
|
//[HttpPost]
|
|
//[Route("api/Create/Approve")]
|
|
//public HttpResponseMessage CreateApprove([FromBody] object JsonData)
|
|
//{
|
|
// log.Info("盘点审核传入值" + JsonData);
|
|
// try
|
|
// {
|
|
// ICSCheck model = new ICSCheck();
|
|
// if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
// {
|
|
// model = JsonConvert.DeserializeObject<ICSCheck>(JsonData.ToString());
|
|
// WMSBarCoreService action = new WMSBarCoreService();
|
|
// var resultStr = action.CreateApprove(model);
|
|
// if (resultStr == true)
|
|
// {
|
|
// res.Success = true;
|
|
// res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
// res.Data = resultStr;
|
|
// }
|
|
// else
|
|
// {
|
|
// res.Success = false;
|
|
// res.Message = "数据为空!";
|
|
|
|
// }
|
|
|
|
// }
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// log.Error("转换失败:" + ex.ToString());
|
|
// res.Success = false;
|
|
// res.Message = ex.Message;
|
|
// }
|
|
// finally
|
|
// {
|
|
// str = JsonConvert.SerializeObject(res);
|
|
// result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
// }
|
|
// log.Debug("盘点审核返回值:" + str);
|
|
// return result;
|
|
//}
|
|
|
|
///// <summary>
|
|
///// PDA盘点单
|
|
///// </summary>
|
|
///// <param name="JsonData"></param>
|
|
///// <returns></returns>
|
|
//[HttpPost]
|
|
//[Route("api/PDACheck/Create")]
|
|
//public HttpResponseMessage PDACheckCreate([FromBody] object JsonData)
|
|
//{
|
|
// string Type = "库存盘点";
|
|
// log.Info("盘点扫描传入值" + JsonData);
|
|
// try
|
|
// {
|
|
// List<ICSCheck> model = new List<ICSCheck>();
|
|
// if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
// {
|
|
// model = JsonConvert.DeserializeObject<List<ICSCheck>>(JsonData.ToString());
|
|
// WMSBarCoreService action = new WMSBarCoreService();
|
|
// var resultStr = action.PDACheckCreate(model, Type);
|
|
// if (!string.IsNullOrWhiteSpace(resultStr.ToString()))
|
|
// {
|
|
// res.Success = true;
|
|
// res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
// res.Data = null;
|
|
// }
|
|
// else
|
|
// {
|
|
// res.Success = false;
|
|
// res.Message = "数据为空!";
|
|
|
|
// }
|
|
|
|
// }
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// log.Error("转换失败:" + ex.ToString());
|
|
// res.Success = false;
|
|
// res.Message = ex.Message;
|
|
// }
|
|
// finally
|
|
// {
|
|
// str = JsonConvert.SerializeObject(res);
|
|
// result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
// }
|
|
// log.Debug("盘点扫描返回值:" + str);
|
|
// return result;
|
|
//}
|
|
#endregion
|
|
|
|
#region 先进先判断 FIFOJudgment
|
|
|
|
#endregion
|
|
|
|
#region 调拨单
|
|
[HttpPost]
|
|
[Route("api/TransferDoc/Update")]
|
|
public HttpResponseMessage TransferDocupdte([FromBody] object JsonData)
|
|
{
|
|
log.Info("调拨单传入值" + JsonData);
|
|
try
|
|
{
|
|
List<TransferDoc> model = new List<TransferDoc>();
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
model = JsonConvert.DeserializeObject<List<TransferDoc>>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.TransferDocupdte(model);
|
|
var resultStr = ICSSubmitService.OneStepTransferDocIn(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("调拨单返回值:" + str);
|
|
return result;
|
|
}
|
|
#endregion
|
|
|
|
|
|
#region 调拨单
|
|
[HttpPost]
|
|
[Route("api/TransferDoc/Create")]
|
|
public HttpResponseMessage TransferDocCreate([FromBody] object JsonData)
|
|
{
|
|
try
|
|
{
|
|
List<TransferDoc> model = new List<TransferDoc>();
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
model = JsonConvert.DeserializeObject<List<TransferDoc>>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.TransferDocupdte(model);
|
|
var resultStr = ICSSubmitService.TransferDocCreate(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("调拨单返回值:" + str);
|
|
return result;
|
|
}
|
|
#endregion
|
|
|
|
|
|
#region 调拨申请单
|
|
[HttpPost]
|
|
[Route("api/TransferApplication/Update")]
|
|
public HttpResponseMessage ICSTransferApplicationupdte([FromBody] object JsonData)
|
|
{
|
|
log.Info("调拨单传入值" + JsonData);
|
|
try
|
|
{
|
|
List<TransferApplication> model = new List<TransferApplication>();
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
model = JsonConvert.DeserializeObject<List<TransferApplication>>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.TransferDocupdte(model);
|
|
//var resultStr = ICSSubmitService.OneStepTransferDocIn(model);
|
|
var resultStr = ICSSubmitService.OneStepTransferApplicationIn(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("调拨申请单返回值:" + str);
|
|
return result;
|
|
}
|
|
#endregion
|
|
|
|
#region 调拨申请单(无来源)
|
|
[HttpPost]
|
|
[Route("api/TransferApplication/Create")]
|
|
public HttpResponseMessage TransferApplicationCreate([FromBody] object JsonData)
|
|
{
|
|
try
|
|
{
|
|
List<TransferApplication> model = new List<TransferApplication>();
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
model = JsonConvert.DeserializeObject<List<TransferApplication>>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.TransferDocupdte(model);
|
|
// var resultStr = ICSSubmitService.TransferDocCreate(model);
|
|
var resultStr = ICSSubmitService.TransferApplicationCreate(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("调拨申请单返回值:" + str);
|
|
return result;
|
|
}
|
|
#endregion
|
|
|
|
#region 调拨申请单
|
|
[HttpPost]
|
|
[Route("api/TransferApplicationIn/Create")]
|
|
public HttpResponseMessage TransferApplicationInCreate([FromBody] object JsonData)
|
|
{
|
|
try
|
|
{
|
|
List<TransferApplication> model = new List<TransferApplication>();
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
model = JsonConvert.DeserializeObject<List<TransferApplication>>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.TransferDocupdte(model);
|
|
// var resultStr = ICSSubmitService.TransferDocInCreate(model);
|
|
var resultStr = ICSSubmitService.TransferApplicationInCreate(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("调拨单返回值:" + str);
|
|
return result;
|
|
}
|
|
#endregion
|
|
|
|
#region 获取所有未发,未发完调拨单
|
|
[HttpPost]
|
|
[Route("api/TransferApplication/ Get")]
|
|
public HttpResponseMessage TransCodemationGet([FromBody] object JsonData)
|
|
{
|
|
try
|
|
{
|
|
TransferDoc model = new TransferDoc();
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
model = JsonConvert.DeserializeObject<TransferDoc>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.TransferDocupdte(model);
|
|
|
|
var resultStr = ICSSubmitService.TransCodemationGet(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
else
|
|
res.Data = new DataTable();
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("调拨单返回值:" + str);
|
|
return result;
|
|
}
|
|
#endregion
|
|
|
|
#region 扫描用户确认 UserCheck
|
|
/// <summary>
|
|
/// 扫描用户确认
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/UserCheck/Check")]
|
|
public HttpResponseMessage UserCheck([FromBody] object JsonData)
|
|
{
|
|
|
|
log.Info("用户确认" + JsonData);
|
|
try
|
|
{
|
|
Sys_SRM_User model = new Sys_SRM_User();
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
model = JsonConvert.DeserializeObject<Sys_SRM_User>(JsonData.ToString());
|
|
var resultStr = ICSSubmitService.UserCheck(model);
|
|
if (!string.IsNullOrWhiteSpace(resultStr.ToString()))
|
|
{
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
res.Data = resultStr;
|
|
}
|
|
else
|
|
{
|
|
res.Success = false;
|
|
res.Message = "确认失败!";
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("用户确认返回值:" + str);
|
|
return result;
|
|
}
|
|
#endregion
|
|
|
|
#region 登录 login
|
|
/// <summary>
|
|
/// 登录
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/login/login")]
|
|
public HttpResponseMessage login([FromBody] object JsonData)
|
|
{
|
|
|
|
log.Info("用户登录" + JsonData);
|
|
try
|
|
{
|
|
Sys_SRM_User model = new Sys_SRM_User();
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
model = JsonConvert.DeserializeObject<Sys_SRM_User>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.CheckLogin(model);
|
|
var resultStr = ICSSubmitService.CheckLogin(model);
|
|
if (!string.IsNullOrWhiteSpace(resultStr.ToString()))
|
|
{
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
res.Data = resultStr;
|
|
}
|
|
else
|
|
{
|
|
res.Success = false;
|
|
res.Message = "登录失败!";
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("用户登录返回值:" + str);
|
|
return result;
|
|
}
|
|
#endregion
|
|
|
|
#region 条码容器绑定
|
|
/// <summary>
|
|
/// 条码容器绑定
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/ContainerBind/Create")]
|
|
public HttpResponseMessage ContainerBindCreate([FromBody] object JsonData)
|
|
{
|
|
|
|
log.Info("合并传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
List<ICSContainerBind> model = new List<ICSContainerBind>();
|
|
model = JsonConvert.DeserializeObject<List<ICSContainerBind>>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.LOTMergeCreate(model);
|
|
//res.Success = true;
|
|
//res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
////res.Data = resultStr;
|
|
res = ICSSubmitService.ContainerBindCreate(model);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("条码料架绑定返回值:" + str);
|
|
return result;
|
|
}
|
|
#endregion
|
|
|
|
#region 条码容器解绑
|
|
/// <summary>
|
|
/// 条码容器解绑
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/ContainerUnBind/Create")]
|
|
public HttpResponseMessage ContainerUnBindCreate([FromBody] object JsonData)
|
|
{
|
|
|
|
log.Info("合并传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
List<ICSContainerBind> model = new List<ICSContainerBind>();
|
|
model = JsonConvert.DeserializeObject<List<ICSContainerBind>>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.LOTMergeCreate(model);
|
|
//res.Success = true;
|
|
//res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
////res.Data = resultStr;
|
|
res = ICSSubmitService.ContainerBindCreate(model);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("条码料架绑定返回值:" + str);
|
|
return result;
|
|
}
|
|
#endregion
|
|
#region 领料单料架绑定
|
|
/// <summary>
|
|
/// 领料单料架绑定
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/ContainerBind/ContainerBindTransCode")]
|
|
public HttpResponseMessage ContainerBindTransCode([FromBody] object JsonData)
|
|
{
|
|
|
|
log.Info("合并传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
List<ICSContainerTransCodeBind> model = new List<ICSContainerTransCodeBind>();
|
|
model = JsonConvert.DeserializeObject<List<ICSContainerTransCodeBind>>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.LOTMergeCreate(model);
|
|
//res.Success = true;
|
|
//res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
////res.Data = resultStr;
|
|
res = ICSSubmitService.ContainerTransCodeBind(model);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("领料单料架绑定返回值:" + str);
|
|
return result;
|
|
}
|
|
#endregion
|
|
|
|
#region 呼叫AGV开始搬运任务
|
|
/// <summary>
|
|
/// 呼叫AGV开始搬运任务
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/CallAGVStartTask/Start")]
|
|
public HttpResponseMessage CallAGVStartTask([FromBody] object JsonData)
|
|
{
|
|
|
|
log.Info("合并传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
List<ICSContainerBind> model = new List<ICSContainerBind>();
|
|
model = JsonConvert.DeserializeObject<List<ICSContainerBind>>(JsonData.ToString());
|
|
//WMSBarCoreService action = new WMSBarCoreService();
|
|
//var resultStr = action.LOTMergeCreate(model);
|
|
//res.Success = true;
|
|
//res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
////res.Data = resultStr;
|
|
res = ICSSubmitService.StartAGVTask(model);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("条码料架绑定返回值:" + str);
|
|
return result;
|
|
}
|
|
#endregion
|
|
|
|
#region 获取AGV绑定接口地址
|
|
/// <summary>
|
|
/// 条码容器解绑
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/GetAGVBindUrl/Get")]
|
|
public string GetAGVUrl()
|
|
{
|
|
try
|
|
{
|
|
string Url = ICSSubmitService.GetAGVBindUrl();
|
|
return Url;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw new Exception(ex.Message);
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 获取AGV搬运接口地址
|
|
/// <summary>
|
|
/// 条码容器解绑
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/GetAGVStartUrl/Get")]
|
|
public string GetAGVStartUrl()
|
|
{
|
|
try
|
|
{
|
|
string Url = ICSSubmitService.GetAGVStartUrl();
|
|
return Url;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw new Exception(ex.Message);
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 获取AGV取消任务接口地址
|
|
/// <summary>
|
|
/// 条码容器解绑
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/GetAGVCancelUrl/Get")]
|
|
public string GetAGVCancelUrl()
|
|
{
|
|
try
|
|
{
|
|
string Url = ICSSubmitService.GetAGVCancelUrl();
|
|
return Url;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw new Exception(ex.Message);
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 获取AGV搬运的目标位置
|
|
/// <summary>
|
|
/// 呼叫AGV开始搬运任务
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/GetAGVTaskPosition/Get")]
|
|
public HttpResponseMessage GetAGVTaskPosition([FromBody] object JsonData)
|
|
{
|
|
|
|
log.Info("合并传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
List<ICSContainerBind> model = new List<ICSContainerBind>();
|
|
model = JsonConvert.DeserializeObject<List<ICSContainerBind>>(JsonData.ToString());
|
|
res = ICSSubmitService.GetAGVTaskPosition(model);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
return result;
|
|
}
|
|
#endregion
|
|
|
|
#region 保存AGV生成的任务ID
|
|
/// <summary>
|
|
/// 保存AGV生成的任务ID
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/SaveAGVTaskCode/Get")]
|
|
public HttpResponseMessage SaveAGVTaskCode([FromBody] object JsonData)
|
|
{
|
|
|
|
log.Info("合并传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
List<ICSContainerBind> model = new List<ICSContainerBind>();
|
|
model = JsonConvert.DeserializeObject<List<ICSContainerBind>>(JsonData.ToString());
|
|
res = ICSSubmitService.SaveAGVTaskCode(model);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
return result;
|
|
}
|
|
#endregion
|
|
|
|
#region 提供给AGV调用的回写接口,用于AGV完成搬运任务后回传具体点位,点位用于调用叉车接口,呼叫叉车到指定点位开始入库
|
|
/// <summary>
|
|
/// 提供给AGV调用的回写接口
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/AGVTaskEnd/Get")]
|
|
public HttpResponseMessage AGVTaskEnd([FromBody] object JsonData)
|
|
{
|
|
|
|
log.Info("合并传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
agvres = ICSSubmitService.AGVTaskEnd(JsonConvert.DeserializeObject<AGVCallBackModel>(JsonData.ToString()), JsonData.ToString());
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
return result;
|
|
}
|
|
#endregion
|
|
|
|
#region 提供给叉车调用的回写接口,用于叉车完成搬运任务后回传任务编号,WMS入库并过账SAP(入库:PTWY上架 出库:PICK出库)
|
|
/// <summary>
|
|
/// 提供给AGV调用的回写接口
|
|
/// </summary>
|
|
/// <param name="JsonData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("api/ForkLiftTaskEndIn/Get")]
|
|
public HttpResponseMessage ForkLiftTaskEndIn([FromBody] object JsonData)
|
|
{
|
|
|
|
log.Info("合并传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
forkliftres = ICSSubmitService.ForkLiftTaskEndIn(JsonConvert.DeserializeObject<ForkLiftCallBackModel>(JsonData.ToString()), JsonData.ToString());
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
forkliftres.Ret = 0;
|
|
forkliftres.RetMsg = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(forkliftres);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
return result;
|
|
}
|
|
#endregion
|
|
|
|
#region 根据单据获取占料信息
|
|
[HttpPost]
|
|
[Route("api/MaterialOccupy/Get")]
|
|
public HttpResponseMessage MaterialOccupyGet([FromBody] object JsonData)
|
|
{
|
|
log.Info("获取占料信息传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
OccupyDocModel model = new OccupyDocModel();
|
|
model = JsonConvert.DeserializeObject<OccupyDocModel>(JsonData.ToString());
|
|
var resultStr = ICSSubmitService.MaterialOccupyGet(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("获取占料信息传入值返回值:" + str);
|
|
return result;
|
|
}
|
|
#endregion
|
|
|
|
#region 根据物料 站点 仓库获取库存数量(返回物料号,销售凭证,销售凭证项号,站点,仓库,库位以及根据前面几个条件汇总的数量)
|
|
[HttpPost]
|
|
[Route("api/GetWHQuantityInfo/Get")]
|
|
public HttpResponseMessage GetWHQuantityInfo([FromBody] object JsonData)
|
|
{
|
|
log.Info("SAP获取库存信息传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
SAPGetWMSWHInfoModel model = new SAPGetWMSWHInfoModel();
|
|
model = JsonConvert.DeserializeObject<SAPGetWMSWHInfoModel>(JsonData.ToString());
|
|
var resultStr = ICSSubmitService.GetWHQuantityInfo(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("SAP获取库存信息传入值:" + str);
|
|
return result;
|
|
}
|
|
#endregion
|
|
|
|
#region 根据物料 站点 仓库获取已拣配未过账数量(返回物料号,销售凭证,销售凭证项号,站点,仓库,以及根据前面几个条件汇总的数量)
|
|
//注:已拣配未过账数量针对SAP WMS中某些单据已部分出库,但因为SAP是整单过账,这部分库存只在WMS中出库,SAP尚未过账
|
|
//所以WMS中尚未全部出库单据的已出库部分为SAP的已拣配未过账数量
|
|
[HttpPost]
|
|
[Route("api/GetWHInHandleInfo/Get")]
|
|
public HttpResponseMessage GetWHInHandleInfo([FromBody] object JsonData)
|
|
{
|
|
log.Info("SAP获取库存信息传入值" + JsonData);
|
|
try
|
|
{
|
|
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
|
|
{
|
|
SAPGetWMSWHInfoModel model = new SAPGetWMSWHInfoModel();
|
|
model = JsonConvert.DeserializeObject<SAPGetWMSWHInfoModel>(JsonData.ToString());
|
|
var resultStr = ICSSubmitService.GetWHInHandleInfo(model);
|
|
res.Success = true;
|
|
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
|
|
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
|
|
{
|
|
res.Data = resultStr;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("转换失败:" + ex.ToString());
|
|
res.Success = false;
|
|
res.Message = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
str = JsonConvert.SerializeObject(res);
|
|
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
|
|
}
|
|
log.Debug("SAP获取库存信息传入值:" + str);
|
|
return result;
|
|
}
|
|
#endregion
|
|
}
|
|
}
|