入库和出库

This commit is contained in:
qianhao.xu
2025-06-09 16:41:15 +08:00
parent 7b546e5979
commit 0d9571a5b7
8 changed files with 314 additions and 2 deletions

View File

@@ -0,0 +1,61 @@
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
{
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;
}
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;
}
}
}

View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZR.Model.MES.wms;
namespace ZR.Service.mes.wms_u8.IService
{
/// <summary>
/// 用友U8和WMS 交互接口
/// </summary>
public interface IERP_WMS_interactive
{
/// <summary>
/// 入库
/// </summary>
/// <returns></returns>
public ERP_WMS_interactiveModelResult inbounded(string urlBase, List<ERP_WMS_interactiveModelQuery> eRP_WMS_InteractiveModels);
/// <summary>
/// 出库
/// </summary>
/// <returns></returns>
public ERP_WMS_interactiveModelResult outbounded(string urlBase, List<ERP_WMS_interactiveModelQuery> eRP_WMS_InteractiveModels);
}
}