74 lines
2.8 KiB
C#
74 lines
2.8 KiB
C#
using Infrastructure;
|
|
using Infrastructure.Attribute;
|
|
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Globalization;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using U8Server.Util;
|
|
using ZR.Model.MES.wms;
|
|
using ZR.Service.mes.wms.IService;
|
|
using ZR.Service.mes.wms_u8.IService;
|
|
|
|
namespace ZR.Service.mes.wms_u8
|
|
{
|
|
[AppService(ServiceType = typeof(IERP_WMS_interactive), ServiceLifetime = LifeTime.Transient)]
|
|
public class ERP_WMS_interactiveService : IERP_WMS_interactive
|
|
{
|
|
/// <summary>
|
|
/// 入库接口
|
|
/// </summary>
|
|
/// <param name="urlBase"></param>
|
|
/// <param name="eRP_WMS_InteractiveModels"></param>
|
|
/// <returns></returns>
|
|
public ERP_WMS_interactiveModelResult Inbounded(string urlBase,List<ERP_WMS_interactiveModelQuery> eRP_WMS_InteractiveModels)
|
|
{
|
|
string url = urlBase + "/wms/mes/inbounded";
|
|
|
|
string contentType = "application/json";
|
|
Dictionary<string, string> headers = new Dictionary<string, string>();
|
|
headers.Add("appid", "gN9yId!!lfwaRoi3");
|
|
headers.Add("timestamp", DateTime.Now.ToString("yyyyMMddHHmmss", CultureInfo.InvariantCulture));
|
|
headers.Add("sign", GetSign.GetBy16Md5());
|
|
|
|
string postData = JsonConvert.SerializeObject(eRP_WMS_InteractiveModels);
|
|
Object result = HttpHelper.HttpPost(url, postData, contentType, 30, headers);
|
|
if (result != null && result is ERP_WMS_interactiveModelResult)
|
|
{
|
|
return (ERP_WMS_interactiveModelResult)result;
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 出库接口
|
|
/// </summary>
|
|
/// <param name="urlBase"></param>
|
|
/// <param name="eRP_WMS_InteractiveModels"></param>
|
|
/// <returns></returns>
|
|
public ERP_WMS_interactiveModelResult Outbounded(string urlBase, List<ERP_WMS_interactiveModelQuery> eRP_WMS_InteractiveModels)
|
|
{
|
|
string url = urlBase + "/wms/mes/outbounded";
|
|
|
|
string contentType = "application/json";
|
|
Dictionary<string, string> headers = new Dictionary<string, string>();
|
|
headers.Add("appid", "gN9yId!!lfwaRoi3");
|
|
headers.Add("timestamp", DateTime.Now.ToString("yyyyMMddHHmmss", CultureInfo.InvariantCulture));
|
|
headers.Add("sign", GetSign.GetBy16Md5());
|
|
|
|
string postData = JsonConvert.SerializeObject(eRP_WMS_InteractiveModels);
|
|
Object result = HttpHelper.HttpPost(url, postData, contentType, 30, headers);
|
|
if (result != null && result is ERP_WMS_interactiveModelResult)
|
|
{
|
|
return (ERP_WMS_interactiveModelResult)result;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
}
|