using LogLibrary.Log;
|
using Masuit.Tools;
|
using Newtonsoft.Json;
|
using WIDESEA_Common.FangCang;
|
using WIDESEA_Core;
|
using WIDESEA_DTO;
|
using WIDESEA_Model.Models;
|
|
namespace WIDESEA_StoragIntegrationServices
|
{
|
public partial class ToMESService
|
{
|
/// <summary>
|
/// EDI出库订单 接收医药出库订单数据
|
/// </summary>
|
/// <param name="jsondata"></param>
|
/// <returns></returns>
|
public WebResponseContent ediIn(object jsondata)
|
{
|
WebResponseContent content = new WebResponseContent();
|
try
|
{
|
if (string.IsNullOrEmpty(jsondata.ToString())) throw new Exception("上传参数为空");
|
|
|
var result = JsonConvert.DeserializeObject<ediIn>(jsondata.ToString());
|
|
//todo 完成添加出库订单逻辑
|
if(result.inOrderType == "10") //销售入库订单
|
{
|
foreach (var item in result.details)
|
{
|
//todo
|
}
|
}
|
else if(result.inOrderType == "20") //盘盈入库库单
|
{
|
if (result.details[0].stocktakingDetails.Count <= 0) throw new Exception($"盘盈明细为空");
|
}
|
|
|
LogFactory.GetLog("EDI入库订单接口").Info(true, $"\r\r--------------------------------------");
|
LogFactory.GetLog("EDI入库订单接口").Info(true, jsondata.ToJsonString());
|
|
return content;
|
|
}
|
catch (Exception ex)
|
{
|
LogFactory.GetLog("EDI入库订单接口入").Info(true, $"\r\r--------------------------------------");
|
LogFactory.GetLog("EDI出库订单接口").Info(true, ex.Message);
|
return content.Error($"EDI入库订单接口请求异常:{ex.Message}");
|
}
|
}
|
}
|
}
|