From bfa52edd6a430978873367426da7b379730da411 Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期二, 28 四月 2026 08:51:43 +0800
Subject: [PATCH] PLS接口优化
---
项目代码/WMS/WMSServices/WIDESEA_Core/AOP/SqlSugarAop.cs | 2
项目代码/WMS/WMSServices/WIDESEA_IInboundService/IMoInboundOrderService.cs | 9
项目代码/WMS/WMSServices/WIDESEA_External/IMLSService/IInvokeMLSService.cs | 15 +
项目代码/WMS/WMSServices/WIDESEA_External/WIDESEA_External.csproj | 4
项目代码/WMS/WMSServices/WIDESEA_DTO/PLS/ReturnMoInboundStatuModel.cs | 2
项目代码/WMS/WMSServices/WIDESEA_External/PLSService/MD5Util.cs | 462 +++++++++++++++++++++++++++++++++
项目代码/WMS/WMSServices/WIDESEA_DTO/MLS/MLSRequestContent.cs | 39 ++
项目代码/WMS/WMSServices/WIDESEA_DTO/PLS/PLSRequestContent.cs | 4
项目代码/WMS/WMSServices/WIDESEA_Common/APIEnum/APIEnum.cs | 10
项目代码/WMS/WMSServices/WIDESEA_WMSServer/Controllers/PLS/PlsController.cs | 5
项目代码/WMS/WMSServices/WIDESEA_External/PLSService/InvokePLSService.cs | 33 ++
项目代码/WMS/WMSServices/WIDESEA_DTO/PLS/PlsResponseContent.cs | 8
项目代码/WMS/WMSServices/WIDESEA_DTO/PLS/VMIItemCodeInfo.cs | 2
项目代码/WMS/WMSServices/WIDESEA_WMSServer/appsettings.json | 11
项目代码/WMS/WMSServices/WIDESEA_DTO/PLS/MoInboundOrderDTO.cs | 2
项目代码/WMS/WMSServices/WIDESEA_WMSServer/Controllers/Inbound/MoInboundOrderController.cs | 31 ++
项目代码/WMS/WMSServices/WIDESEA_IBasicService/IMaterielInfoService.cs | 1
项目代码/WMS/WMSServices/WIDESEA_DTO/PLS/PLSBaseModel.cs | 4
项目代码/WMS/WMSServices/WIDESEA_External/PLSService/InvokeMLSService.cs | 73 +++++
项目代码/WMS/WMSServices/WIDESEA_BasicService/WIDESEA_BasicService.csproj | 1
项目代码/WMS/WMSServices/WIDESEA_DTO/MLS/ReceiveMLSToken.cs | 24 +
项目代码/WMS/WMSServices/WIDESEA_Model/Models/Inbound/Dt_MoInboundOrder.cs | 6
项目代码/WMS/WMSServices/WIDESEA_BasicService/Service/MaterielInfoService.cs | 32 +-
项目代码/WMS/WMSServices/WIDESEA_InboundService/MoInboundOrderService.cs | 13
项目代码/WMS/WMSServices/WIDESEA_Model/Models/Basic/Dt_ApiInfo.cs | 2
25 files changed, 755 insertions(+), 40 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_BasicService/Service/MaterielInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_BasicService/Service/MaterielInfoService.cs"
index 817cd43..91521a6 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_BasicService/Service/MaterielInfoService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_BasicService/Service/MaterielInfoService.cs"
@@ -1,17 +1,11 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using WIDESEA_BasicRepository;
-using WIDESEA_Common.CommonEnum;
-using WIDESEA_Common.MaterielEnum;
+锘縰sing WIDESEA_Common.CommonEnum;
using WIDESEA_Core;
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.Helper;
-using WIDESEA_DTO.Basic;
+using WIDESEA_DTO;
using WIDESEA_DTO.ERP;
using WIDESEA_DTO.PLS;
+using WIDESEA_External.PLSService;
using WIDESEA_IBasicRepository;
using WIDESEA_IBasicService;
using WIDESEA_Model.Models;
@@ -181,9 +175,16 @@
return WebResponseContent.Instance.Error("鎺ュ彛浼犲叆鐨勭墿鏂欐暟鎹泦鍚堜笉鑳戒负绌�");
}
+ ///绛惧悕鏍¢獙
+ bool IsSign = MD5Util.CheckPLSSign(vmiModel);
+ if (!IsSign)
+ {
+ return WebResponseContent.Instance.Error("绛惧悕楠岃瘉澶辫触锛岃妫�鏌�");
+ }
+
foreach (var itemData in vmiModel.Data)
{
- var existMateriel = BaseDal.QueryFirst(x => x.MaterielCode == itemData.ItemCode);
+ var existMateriel = BaseDal.QueryFirst(x => x.MaterielCode == itemData.ItemCode && x.OrgId == itemData.OrgId && x.MaterielInvOrgId == itemData.SupplierCode);
if (existMateriel == null)
{
@@ -193,22 +194,20 @@
OrgId = itemData.OrgId,
MaterielInvOrgId = itemData.SupplierCode,
PackageQty = itemData.PackageQty,
- MaterielState = itemData.DeleteFlag == "0" ? EnableEnum.Enable : EnableEnum.Disable,
+ MaterielState = itemData.DeleteFlag == 0 ? EnableEnum.Enable : EnableEnum.Disable,
WarehouseId = 0,
MaterielSourceType = 0,
Creater = itemData.CreateUser,
- CreateDate = itemData.CreateDate,
- Modifier = itemData.UpdateUser,
- ModifyDate = itemData.UpdateDate
+ CreateDate = DateTime.Now,
};
- BaseDal.AddData(addEntity);
+ _basicRepository.MaterielInfoRepository.AddData(addEntity);
}
else
{
existMateriel.OrgId = itemData.OrgId;
existMateriel.MaterielInvOrgId = itemData.SupplierCode;
existMateriel.PackageQty = itemData.PackageQty;
- existMateriel.MaterielState = itemData.DeleteFlag == "0" ? EnableEnum.Enable : EnableEnum.Disable;
+ existMateriel.MaterielState = itemData.DeleteFlag == 0 ? EnableEnum.Enable : EnableEnum.Disable;
existMateriel.Modifier = itemData.UpdateUser;
existMateriel.ModifyDate = itemData.UpdateDate;
@@ -225,5 +224,6 @@
return WebResponseContent.Instance.Error($"VMI鐗╂枡鍚屾澶辫触锛歿ex.Message}");
}
}
+
}
}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_BasicService/WIDESEA_BasicService.csproj" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_BasicService/WIDESEA_BasicService.csproj"
index a136ce2..3b9bdaf 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_BasicService/WIDESEA_BasicService.csproj"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_BasicService/WIDESEA_BasicService.csproj"
@@ -7,6 +7,7 @@
</PropertyGroup>
<ItemGroup>
+ <ProjectReference Include="..\WIDESEA_External\WIDESEA_External.csproj" />
<ProjectReference Include="..\WIDESEA_IBasicService\WIDESEA_IBasicService.csproj" />
<ProjectReference Include="..\WIDESEA_IRecordService\WIDESEA_IRecordService.csproj" />
<ProjectReference Include="..\WIDESEA_ISystemRepository\WIDESEA_ISystemRepository.csproj" />
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Common/APIEnum/APIEnum.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Common/APIEnum/APIEnum.cs"
index 5083169..7f86f08 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Common/APIEnum/APIEnum.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Common/APIEnum/APIEnum.cs"
@@ -77,6 +77,14 @@
/// PLS鎺ュ彛璋冪敤
/// </summary>
[Description("PLS鎺ュ彛璋冪敤")]
- InvokePLSApi
+ InvokePLSApi,
+
+ /// <summary>
+ /// MLS鑾峰彇token鎺ュ彛璋冪敤
+ /// </summary>
+ [Description("MLS鑾峰彇token鎺ュ彛璋冪敤")]
+ InvokeMLSTokenApi
+
+
}
}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Core/AOP/SqlSugarAop.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Core/AOP/SqlSugarAop.cs"
index 14b05f2..fdbda23 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Core/AOP/SqlSugarAop.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Core/AOP/SqlSugarAop.cs"
@@ -85,7 +85,7 @@
baseEntity.ModifyDate = DateTime.Now;
}
- //if (App.User?.UserId > 0)
+ if (App.User?.UserId > 0)
{
switch (entityInfo.OperationType)
{
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/MLS/MLSRequestContent.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/MLS/MLSRequestContent.cs"
new file mode 100644
index 0000000..ddb6c77
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/MLS/MLSRequestContent.cs"
@@ -0,0 +1,39 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEA_DTO.MLS
+{
+ /// <summary>
+ /// 璋冪敤MLS鎺ュ彛鍥炲弬
+ /// </summary>
+ public class MLSRequestContent
+ {
+ /// <summary>
+ /// 鐘舵�佺爜 0-鎴愬姛锛�1-澶辫触
+ /// </summary>
+ public string Code { get; set; }
+
+ /// <summary>
+ /// 鍝嶅簲淇℃伅
+ /// </summary>
+ public string Msg { get; set; }
+
+ /// <summary>
+ /// 閿欒淇℃伅
+ /// </summary>
+ public string ErrMsg { get; set; }
+
+ /// <summary>
+ /// 鏃堕棿鎴�
+ /// </summary>
+ public string Timestamp { get; set; }
+
+ /// <summary>
+ /// 鍝嶅簲鏁版嵁
+ /// </summary>
+ public object Data { get; set; }
+ }
+}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/MLS/ReceiveMLSToken.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/MLS/ReceiveMLSToken.cs"
new file mode 100644
index 0000000..e2fe628
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/MLS/ReceiveMLSToken.cs"
@@ -0,0 +1,24 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEA_DTO.MLS
+{
+ /// <summary>
+ /// 鑾峰彇token璇锋眰瀹炰綋
+ /// </summary>
+ public class ReceiveMLSToken
+ {
+ /// <summary>
+ /// MLS鎻愪緵璐﹀彿
+ /// </summary>
+ public string MlsUser { get; set; }
+
+ /// <summary>
+ /// MLS鎻愪緵瀵嗙爜
+ /// </summary>
+ public string MlsPwd { get; set; }
+ }
+}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/PLS/MoInboundOrderDTO.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/PLS/MoInboundOrderDTO.cs"
index 767b71c..5ee325d 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/PLS/MoInboundOrderDTO.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/PLS/MoInboundOrderDTO.cs"
@@ -43,7 +43,7 @@
/// <summary>
/// VMI鐗╂祦鐘舵��
/// </summary>
- public string Status { get; set; }
+ public int Status { get; set; }
/// <summary>
/// 鍗曟嵁鍙�
/// </summary>
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/PLS/PLSBaseModel.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/PLS/PLSBaseModel.cs"
index 91778d2..ef09578 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/PLS/PLSBaseModel.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/PLS/PLSBaseModel.cs"
@@ -14,6 +14,10 @@
/// <summary>
/// 鏃堕棿鎴�
/// </summary>
+ public string AppId { get; set; }
+ /// <summary>
+ /// 鏃堕棿鎴�
+ /// </summary>
public long TimeStamp { get; set; }
/// <summary>
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/PLS/PLSRequestContent.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/PLS/PLSRequestContent.cs"
index f992de4..3c27be0 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/PLS/PLSRequestContent.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/PLS/PLSRequestContent.cs"
@@ -7,7 +7,7 @@
namespace WIDESEA_DTO.PLS
{
/// <summary>
- /// PLS鎺ュ彛鍝嶅簲瀹炰綋
+ /// 鎺ユ敹PLS鎺ュ彛鍝嶅簲瀹炰綋
/// </summary>
public class PLSRequestContent
{
@@ -15,7 +15,7 @@
/// <summary>
/// 鐘舵�佺爜 0-鎴愬姛锛�1-澶辫触
/// </summary>
- public int Code { get; set; }
+ public string Code { get; set; }
/// <summary>
/// 鍝嶅簲淇℃伅
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/PLS/PlsResponseContent.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/PLS/PlsResponseContent.cs"
index 3680234..7dea4ea 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/PLS/PlsResponseContent.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/PLS/PlsResponseContent.cs"
@@ -14,7 +14,7 @@
/// <summary>
/// 鐘舵�佺爜 0-鎴愬姛 1-澶辫触
/// </summary>
- public int Code { get; set; } = 0;
+ public string Code { get; set; } = "0";
/// <summary>
/// 鍝嶅簲淇℃伅
@@ -39,7 +39,7 @@
/// </summary>
public ApiResponseContent OK(string message = null)
{
- Code = 0;
+ Code = "0";
Msg = message ?? "鎴愬姛";
Data = null??"鏃�";
return this;
@@ -50,7 +50,7 @@
/// </summary>
public ApiResponseContent Error(string message = null)
{
- Code = 1;
+ Code = "1";
Msg = message ?? "澶辫触";
Data = null ?? "鏃�";
return this;
@@ -61,7 +61,7 @@
/// </summary>
public ApiResponseContent OK(List<LabelNoData> dataList, string message = null)
{
- Code = 0;
+ Code = "0";
Msg = message ?? "鎴愬姛";
Data = dataList;
return this;
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/PLS/ReturnMoInboundStatuModel.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/PLS/ReturnMoInboundStatuModel.cs"
index a8e7579..bb3bf36 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/PLS/ReturnMoInboundStatuModel.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/PLS/ReturnMoInboundStatuModel.cs"
@@ -22,7 +22,7 @@
/// <summary>
/// VMI鐗╂祦鐘舵��
/// </summary>
- public string Status { get; set; }
+ public int Status { get; set; }
/// <summary>
/// 鍗曟嵁鍙�
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/PLS/VMIItemCodeInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/PLS/VMIItemCodeInfo.cs"
index 79d9088..fe53668 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/PLS/VMIItemCodeInfo.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_DTO/PLS/VMIItemCodeInfo.cs"
@@ -60,7 +60,7 @@
/// <summary>
/// 鏈夋晥鏍囪瘑
/// </summary>
- public string DeleteFlag { get; set; }
+ public int DeleteFlag { get; set; }
/// <summary>
/// 鍒涘缓浜�
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_External/IMLSService/IInvokeMLSService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_External/IMLSService/IInvokeMLSService.cs"
new file mode 100644
index 0000000..70d8fa2
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_External/IMLSService/IInvokeMLSService.cs"
@@ -0,0 +1,15 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core;
+using WIDESEA_DTO.MLS;
+
+namespace WIDESEA_External.IMLSService
+{
+ public interface IInvokeMLSService
+ {
+ string ReceiveTokenVoid();
+ }
+}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_External/PLSService/InvokeMLSService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_External/PLSService/InvokeMLSService.cs"
new file mode 100644
index 0000000..d94cc57
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_External/PLSService/InvokeMLSService.cs"
@@ -0,0 +1,73 @@
+锘縰sing Newtonsoft.Json.Serialization;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_DTO.MLS;
+using WIDESEA_External.IMLSService;
+using WIDESEA_IBasicRepository;
+using WIDESEA_Common.APIEnum;
+using WIDESEA_Core.Helper;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_External.PLSService
+{
+ public class InvokeMLSService : IInvokeMLSService
+ {
+ private readonly IApiInfoRepository _apiInfoRepository;
+
+ public InvokeMLSService(IApiInfoRepository apiInfoRepository)
+ {
+ _apiInfoRepository = apiInfoRepository;
+ }
+ JsonSerializerSettings settings = new JsonSerializerSettings
+ {
+ ContractResolver = new CamelCasePropertyNamesContractResolver()
+ };
+
+ /// <summary>
+ /// 鑾峰彇token
+ /// </summary>
+ /// <param name="receiveMLSToken"></param>
+ /// <returns></returns>
+ /// <exception cref="NotImplementedException"></exception>
+ public string ReceiveTokenVoid()
+ {
+ try
+ {
+ Dt_ApiInfo apiInfo = _apiInfoRepository.QueryFirst(x => x.ApiCode == APIEnum.InvokeMLSTokenApi.ToString());
+
+ string MlsPwd = AppSettings.Get("MlsPwd");
+ string MlsUser = AppSettings.Get("MlsUser");
+ var finalRequest = new
+ {
+ mlsUser = MlsUser,
+ mlsPwd = MlsPwd
+ };
+
+ string requestJson = JsonConvert.SerializeObject(finalRequest, settings);
+
+ string response = HttpHelper.Post(apiInfo.ApiAddress, requestJson);
+
+ MLSRequestContent mLSRequestContent = response.DeserializeObject<MLSRequestContent>();
+
+ if (mLSRequestContent.Code == "0" && mLSRequestContent.Data!= null)
+ {
+ apiInfo.Remark = (string)mLSRequestContent.Data;
+ _apiInfoRepository.UpdateData(apiInfo);
+ }
+ else
+ {
+ return "鑾峰彇token澶辫触锛屾垨杩斿洖token鍊间负绌�";
+ }
+ return response;
+ }
+ catch(Exception ex)
+ {
+ return ex.Message;
+ }
+ }
+ }
+}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_External/PLSService/InvokePLSService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_External/PLSService/InvokePLSService.cs"
index 080f77d..54bbd30 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_External/PLSService/InvokePLSService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_External/PLSService/InvokePLSService.cs"
@@ -27,17 +27,42 @@
{
ContractResolver = new CamelCasePropertyNamesContractResolver()
};
+
+ /// <summary>
+ /// 鑾峰彇MO绁�
+ /// </summary>
+ /// <param name="moInboundStatuModel"></param>
+ /// <returns></returns>
public string InvokeMoInboundStatuApi(ReturnMoInboundStatuModel moInboundStatuModel)
{
Dt_ApiInfo apiInfo = _apiInfoRepository.QueryFirst(x => x.ApiCode == APIEnum.InvokePLSApi.ToString());
- PLSBaseModel<ReturnMoInboundStatuModel> model = new PLSBaseModel<ReturnMoInboundStatuModel>()
+
+ string appId = AppSettings.Get("LocalAppId");
+ string appSecret = AppSettings.Get("LocalAppSecret");
+
+ var requestModel = new
{
Data = moInboundStatuModel,
TimeStamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
- Sign = "RWMS001"
+ AppId = appId
};
- string request = JsonConvert.SerializeObject(model, settings);
- string response = HttpHelper.Post(apiInfo.ApiAddress, request);
+
+ string paramStr = MD5Util.GetParamStr(requestModel);
+
+ string sign = MD5Util.GetMD5_32(paramStr + appSecret);
+
+ var finalRequest = new
+ {
+ requestModel.Data,
+ requestModel.TimeStamp,
+ requestModel.AppId,
+ Sign = sign
+ };
+
+ string requestJson = JsonConvert.SerializeObject(finalRequest, settings);
+
+ string response = HttpHelper.Post(apiInfo.ApiAddress, requestJson);
+
return response;
}
}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_External/PLSService/MD5Util.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_External/PLSService/MD5Util.cs"
new file mode 100644
index 0000000..328d31c
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_External/PLSService/MD5Util.cs"
@@ -0,0 +1,462 @@
+锘縰sing Newtonsoft.Json.Linq;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.Helper;
+using Newtonsoft.Json.Serialization;
+
+namespace WIDESEA_External.PLSService
+{
+ public class MD5Util
+ {
+ // 鑾峰緱32浣嶇殑MD5鍔犲瘑
+
+ public static string GetMD5_32(string input)
+ {
+ System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create();
+ byte[] data = md5.ComputeHash(Encoding.UTF8.GetBytes(input));
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < data.Length; i++)
+ {
+ sb.Append(data[i].ToString("x2"));
+ }
+ return sb.ToString();
+ }
+
+
+ // 鑾峰緱16浣嶇殑MD5鍔犲瘑
+
+ public static string GetMD5_16(string input)
+ {
+ return GetMD5_32(input).Substring(8, 16);
+ }
+
+
+ // 鑾峰緱8浣嶇殑MD5鍔犲瘑
+
+ public static string GetMD5_8(string input)
+ {
+ return GetMD5_32(input).Substring(8, 8);
+ }
+
+
+ // 鑾峰緱4浣嶇殑MD5鍔犲瘑
+
+ public static string GetMD5_4(string input)
+ {
+ return GetMD5_32(input).Substring(8, 4);
+ }
+
+
+ // 娣诲姞MD5鐨勫墠缂�锛屼究浜庢鏌ユ湁鏃犵鏀�
+
+ public static string AddMD5Profix(string input)
+ {
+ return GetMD5_4(input) + input;
+ }
+
+
+ // 绉婚櫎MD5鐨勫墠缂�
+
+ public static string RemoveMD5Profix(string input)
+ {
+ return input.Substring(4);
+ }
+
+
+ // 楠岃瘉MD5鍓嶇紑澶勭悊鐨勫瓧绗︿覆鏈夋棤琚鏀�
+ public static bool ValidateValue(string input)
+ {
+ bool res = false;
+ if (input.Length >= 4)
+ {
+ string tmp = input.Substring(4);
+ if (input.Substring(0, 4) == GetMD5_4(tmp))
+ {
+ res = true;
+ }
+ }
+ return res;
+ }
+
+
+
+ /// <summary>
+ /// 瀵筳son寰楅敭杩涜鎺掑簭
+ /// </summary>
+ /// <param name="json"></param>
+ /// <returns></returns>
+ public static string SortJson(string json)
+ {
+ var tokenType = GetJsonType(json);
+ if (tokenType == JTokenType.Object)
+ {
+ var dic = JsonConvert.DeserializeObject<SortedDictionary<string, object>>(json);
+ SortedDictionary<string, object> keyValues = new SortedDictionary<string, object>(dic);
+ keyValues.OrderBy(m => m.Key);//鍗囧簭 鎶奒ey鎹㈡垚Value 灏辨槸瀵筕alue杩涜鎺掑簭
+ //keyValues.OrderByDescending(m => m.Key);//闄嶅簭
+ SortedDictionary<string, object> tempKeyValues = new SortedDictionary<string, object>(keyValues);
+ foreach (KeyValuePair<string, object> kv in tempKeyValues)
+ {
+ // 鍒ゆ柇value鏄笉鏄疛Object绫诲瀷
+ Type t1 = kv.Value.GetType();
+ if (t1 == typeof(JObject))
+ {
+ // value鏄疛Object绫诲瀷
+ string jsonItem = JsonConvert.SerializeObject(kv.Value);
+ jsonItem = SortJson(jsonItem);
+ keyValues[kv.Key] = JsonConvert.DeserializeObject<JObject>(jsonItem);
+ }
+ else if (t1 == typeof(JArray))
+ {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.Append("[");
+ bool isFirst = true;
+ foreach (JToken item in (JArray)kv.Value)
+ {
+ if (item.Type == JTokenType.Object)
+ {
+ string jsonArrayItem = JsonConvert.SerializeObject(item);
+ jsonArrayItem = SortJson(jsonArrayItem);
+ if (isFirst)
+ {
+ stringBuilder.Append(jsonArrayItem);
+ }
+ else
+ {
+ stringBuilder.Append($",{jsonArrayItem}");
+ }
+
+ }
+ else if (item.Type == JTokenType.Array)
+ {
+ var arrayTmpRes = SortJson(JsonConvert.SerializeObject(item));
+ if (isFirst)
+ {
+ stringBuilder.Append(arrayTmpRes);
+ }
+ else
+ {
+ stringBuilder.Append($",{arrayTmpRes}");
+ }
+ }
+ else
+ {
+ string jsonArrayItem = JsonConvert.SerializeObject(item);
+ if (isFirst)
+ {
+ stringBuilder.Append(jsonArrayItem);
+ }
+ else
+ {
+ stringBuilder.Append($",{jsonArrayItem}");
+ }
+ }
+ isFirst = false;
+ }
+ stringBuilder.Append("]");
+ var tmpJsonStr = stringBuilder.ToString();
+ keyValues[kv.Key] = JsonConvert.DeserializeObject<JArray>(tmpJsonStr);
+ }
+ }
+ return JsonConvert.SerializeObject(keyValues);
+ }
+ else if (tokenType == JTokenType.Array)
+ {
+ var arraies = JsonConvert.DeserializeObject<JArray>(json);
+ StringBuilder stringBuilder2 = new StringBuilder();
+ stringBuilder2.Append("[");
+ bool isFirst2 = true;
+ foreach (JToken item in arraies)
+ {
+ if (item.Type == JTokenType.Object)
+ {
+ string jsonArrayItem = JsonConvert.SerializeObject(item);
+ jsonArrayItem = SortJson(jsonArrayItem);
+ if (isFirst2)
+ {
+ stringBuilder2.Append(jsonArrayItem);
+ }
+ else
+ {
+ stringBuilder2.Append($",{jsonArrayItem}");
+ }
+
+ }
+ else if (item.Type == JTokenType.Array)
+ {
+ var arrayTmpRes = SortJson(JsonConvert.SerializeObject(item));
+ if (isFirst2)
+ {
+ stringBuilder2.Append(arrayTmpRes);
+ }
+ else
+ {
+ stringBuilder2.Append($",{arrayTmpRes}");
+ }
+ }
+ else
+ {
+ string jsonArrayItem = JsonConvert.SerializeObject(item);
+ if (isFirst2)
+ {
+ stringBuilder2.Append(jsonArrayItem);
+ }
+ else
+ {
+ stringBuilder2.Append($",{jsonArrayItem}");
+ }
+ }
+ isFirst2 = false;
+ }
+ stringBuilder2.Append("]");
+ return stringBuilder2.ToString();
+ }
+ return json;
+ }
+
+ /// <summary>
+ /// 鏍规嵁json鍒ゆ柇json绫诲瀷
+ /// </summary>
+ /// <param name="json"></param>
+ /// <returns></returns>
+ public static JTokenType GetJsonType(string json)
+ {
+ JToken token = JToken.Parse(json);
+ return token.Type;
+ }
+
+
+
+ #region MD5绛惧悕楠岃瘉
+ /// <summary>
+ /// 瀵圭粰瀹氭枃浠惰矾寰勭殑鏂囦欢鍔犱笂鏍囩
+ /// </summary>
+ /// <param name="path">瑕佸姞瀵嗙殑鏂囦欢鐨勮矾寰�</param>
+ /// <returns>鏍囩鐨勫��</returns>
+ public static bool AddMD5(string path)
+ {
+ bool IsNeed = true;
+ //宸茶繘琛孧D5澶勭悊
+ if (CheckMD5(path))
+ IsNeed = false;
+
+ try
+ {
+ FileStream fsread = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read);
+ byte[] md5File = new byte[fsread.Length];
+ // 灏嗘枃浠舵祦璇诲彇鍒癇uffer涓�
+ fsread.Read(md5File, 0, (int)fsread.Length);
+ fsread.Close();
+
+ if (IsNeed)
+ {
+ // 瀵笲uffer涓殑瀛楄妭鍐呭绠桵D5
+ string result = MD5Buffer(md5File, 0, md5File.Length);
+ // 灏嗗瓧绗︿覆杞崲鎴愬瓧鑺傛暟缁勪互渚垮啓浜哄埌鏂囦欢涓�
+ byte[] md5 = System.Text.Encoding.ASCII.GetBytes(result);
+ FileStream fsWrite = new FileStream(path, FileMode.Open, FileAccess.ReadWrite);
+ // 灏嗘枃浠讹紝MD5鍊� 閲嶆柊鍐欏叆鍒版枃浠朵腑銆�
+ fsWrite.Write(md5File, 0, md5File.Length);
+ fsWrite.Write(md5, 0, md5.Length);
+ fsWrite.Close();
+ }
+ else
+ {
+ FileStream fsWrite = new FileStream(path, FileMode.Open, FileAccess.ReadWrite);
+ fsWrite.Write(md5File, 0, md5File.Length);
+ fsWrite.Close();
+ }
+ }
+ catch
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ /// <summary>
+ /// 瀵圭粰瀹氳矾寰勭殑鏂囦欢杩涜楠岃瘉
+ /// </summary>
+ /// <param name="path"></param>
+ /// <returns>鏄惁鍔犱簡鏍囩鎴栨槸鍚︽爣绛惧�间笌鍐呭鍊间竴鑷�</returns>
+ public static bool CheckMD5(string path)
+ {
+ try
+ {
+ FileStream get_file = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read);
+ // 璇诲叆鏂囦欢
+ byte[] md5File = new byte[get_file.Length];
+ get_file.Read(md5File, 0, (int)get_file.Length);
+ get_file.Close();
+ // 瀵规枃浠堕櫎鏈�鍚�32浣嶄互澶栫殑瀛楄妭璁$畻MD5锛岃繖涓�32鏄洜涓烘爣绛句綅涓�32浣嶃��
+ string result = MD5Buffer(md5File, 0, md5File.Length - 32);
+ //璇诲彇鏂囦欢鏈�鍚�32浣嶏紝鍏朵腑淇濆瓨鐨勫氨鏄疢D5鍊�
+ string md5 = Encoding.ASCII.GetString(md5File, md5File.Length - 32, 32);
+ return result == md5;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ /// <summary>
+ /// 璁$畻鏂囦欢鐨凪D5鍊�
+ /// </summary>
+ /// <param name="MD5File">MD5绛惧悕鏂囦欢瀛楃鏁扮粍</param>
+ /// <param name="index">璁$畻璧峰浣嶇疆</param>
+ /// <param name="count">璁$畻缁堟浣嶇疆</param>
+ /// <returns>璁$畻缁撴灉</returns>
+ private static string MD5Buffer(byte[] MD5File, int index, int count)
+ {
+ System.Security.Cryptography.MD5CryptoServiceProvider get_md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
+ byte[] hash_byte = get_md5.ComputeHash(MD5File, index, count);
+ string result = BitConverter.ToString(hash_byte);
+
+ result = result.Replace("-", "");
+ return result;
+ }
+ #endregion
+
+ //鑷畾涔夊簭鍒楀寲宸ュ叿绫�
+ public class JsonPropertySortResolver : Newtonsoft.Json.Serialization.DefaultContractResolver
+ {
+ protected override IList<Newtonsoft.Json.Serialization.JsonProperty> CreateProperties(Type type, MemberSerialization memberSerialization)
+ {
+ return base.CreateProperties(type, memberSerialization).OrderBy(p => p.PropertyName).ToList();
+ }
+ }
+
+
+public class SortedCamelCaseContractResolver : DefaultContractResolver
+ {
+ protected override IList<JsonProperty> CreateProperties(Type type, MemberSerialization memberSerialization)
+ {
+ // 鑾峰彇鎵�鏈夐渶瑕佸簭鍒楀寲鐨勫睘鎬э紙鍩虹被鏂规硶宸茶繃婊ゅ拷鐣ュ睘鎬х瓑锛�
+ var properties = base.CreateProperties(type, memberSerialization).ToList();
+
+ // 鍏堝姣忎釜灞炴�у簲鐢� CamelCase 鍛藉悕锛堢‘淇濇渶缁堣緭鍑虹殑瀛楁鍚嶆槸灏忛┘宄帮級
+ foreach (var prop in properties)
+ {
+ prop.PropertyName = GetCamelCaseName(prop.UnderlyingName);
+ }
+
+ // 鎸夊睘鎬у悕锛堝嵆灏忛┘宄板悗鐨勫悕绉帮級瀛楁瘝鍗囧簭鎺掑簭
+ return properties.OrderBy(p => p.PropertyName).ToList();
+ }
+
+ private string GetCamelCaseName(string name)
+ {
+ if (string.IsNullOrEmpty(name) || char.IsLower(name[0]))
+ return name;
+ return char.ToLower(name[0]) + name.Substring(1);
+ }
+}
+
+ //鍏ュ弬鍔犲瘑鍓嶇疆鏍煎紡鍖�
+ public static string GetParamStr<T>(T objectParam)
+ {
+ // 鑾峰彇JSON涓�,浣嗘帓闄ign瀛楁
+ Func<object, string, object, bool> filter = (object obj, string field, object value) => !field.Equals("sign");
+ string paramStr = JsonConvert.SerializeObject(objectParam, new JsonSerializerSettings
+ {
+ ContractResolver = new SortedCamelCaseContractResolver(),
+ NullValueHandling = NullValueHandling.Ignore,
+ Formatting = Formatting.None,
+ ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
+ DateFormatString = "yyyy-MM-dd HH:mm:ss",
+ DateTimeZoneHandling = DateTimeZoneHandling.Unspecified,
+ Converters = new List<JsonConverter> { new DecimalWithoutTrailingZerosConverter() }
+ });
+ //鎺掑簭JOSN,寰楀埌鏍煎紡鍖栫殑涓�
+ return SortJson(paramStr);
+ }
+
+ public class DecimalWithoutTrailingZerosConverter : JsonConverter<decimal>
+ {
+ public override void WriteJson(JsonWriter writer, decimal value, JsonSerializer serializer)
+ {
+ // 鍒ゆ柇鏄惁涓烘暣鏁帮紙灏炬暟涓洪浂锛�
+ if (value == Math.Floor(value))
+ {
+ writer.WriteValue(Convert.ToInt64(value));
+ }
+ else
+ {
+ writer.WriteValue(value);
+ }
+ }
+
+ public override decimal ReadJson(JsonReader reader, Type objectType, decimal existingValue, bool hasExistingValue, JsonSerializer serializer)
+ {
+ // 鍙嶅簭鍒楀寲鏃剁洿鎺ヨ浆鎹负 decimal锛屽吋瀹规暣鏁板拰灏忔暟
+ return Convert.ToDecimal(reader.Value);
+ }
+ }
+ /// <summary>
+ /// 閫氱敤PLS鎺ュ彛绛惧悕鏍¢獙
+ /// </summary>
+ public static bool CheckPLSSign<T>(T model) where T : class
+ {
+ try
+ {
+ // 鍥哄畾閰嶇疆
+ string localAppId = AppSettings.Get("LocalAppId");
+ string localAppSecret = AppSettings.Get("LocalAppSecret");
+ var type = typeof(T);
+ object signModel = null;
+
+ // ========== 鑷姩鑾峰彇鍏叡瀛楁 ==========
+ var timeStampProp = type.GetProperty("TimeStamp");
+ var signProp = type.GetProperty("Sign");
+ var dataProp = type.GetProperty("Data");
+
+ if (timeStampProp == null || signProp == null || dataProp == null)
+ return false;
+
+ // 鑾峰彇鍊�
+ string requestSign = signProp.GetValue(model)?.ToString() ?? "";
+ object timeStampVal = timeStampProp.GetValue(model);
+ object dataVal = dataProp.GetValue(model);
+
+ //鏃堕棿鎴虫牎楠�
+ long nowTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
+ long timeStamp = 0;
+
+ if (timeStampVal is long lng)
+ timeStamp = lng;
+ else if (timeStampVal is string str && long.TryParse(str, out long t))
+ timeStamp = t;
+
+ //鏋勫缓绛惧悕瀵硅薄
+ if (localAppId != null)
+ {
+ signModel = new
+ {
+ AppId = localAppId,
+ TimeStamp = timeStamp,
+ Data = dataVal
+ };
+ }
+ else
+ {
+ return false;
+ }
+
+ string paramStr = GetParamStr(signModel);
+ string localSign = GetMD5_32(paramStr + localAppSecret);
+ ///绛惧悕姣斿
+ return localSign.Equals(requestSign, StringComparison.OrdinalIgnoreCase);
+ }
+ catch
+ {
+ return false;
+ }
+ }
+ }
+}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_External/WIDESEA_External.csproj" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_External/WIDESEA_External.csproj"
index 5c192fd..9b97c2a 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_External/WIDESEA_External.csproj"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_External/WIDESEA_External.csproj"
@@ -13,4 +13,8 @@
<ProjectReference Include="..\WIDESEA_IBasicRepository\WIDESEA_IBasicRepository.csproj" />
</ItemGroup>
+ <ItemGroup>
+ <Folder Include="MLSService\" />
+ </ItemGroup>
+
</Project>
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_IBasicService/IMaterielInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_IBasicService/IMaterielInfoService.cs"
index 2d8cd82..d48d095 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_IBasicService/IMaterielInfoService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_IBasicService/IMaterielInfoService.cs"
@@ -5,6 +5,7 @@
using System.Threading.Tasks;
using WIDESEA_Core;
using WIDESEA_Core.BaseServices;
+using WIDESEA_DTO;
using WIDESEA_DTO.Basic;
using WIDESEA_DTO.ERP;
using WIDESEA_DTO.PLS;
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_IInboundService/IMoInboundOrderService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_IInboundService/IMoInboundOrderService.cs"
index 6402dde..a59c235 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_IInboundService/IMoInboundOrderService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_IInboundService/IMoInboundOrderService.cs"
@@ -4,6 +4,8 @@
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseServices;
+using WIDESEA_DTO.PLS;
+using WIDESEA_DTO;
using WIDESEA_IInboundRepository;
using WIDESEA_Model.Models;
@@ -12,5 +14,12 @@
public interface IMoInboundOrderService : IService<Dt_MoInboundOrder>
{
IMoInboundOrderRepository Repository { get; }
+
+ /// <summary>
+ /// 鎺ユ敹MO绁ㄤ俊鎭�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ public ApiResponseContent ReceiveMoStatus(MoInboundOrderDTO model);
}
}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_InboundService/MoInboundOrderService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_InboundService/MoInboundOrderService.cs"
index 32aff98..30f364e 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_InboundService/MoInboundOrderService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_InboundService/MoInboundOrderService.cs"
@@ -13,6 +13,8 @@
using WIDESEA_IInboundRepository;
using WIDESEA_IInboundService;
using WIDESEA_Model.Models;
+using WIDESEA_External.PLSService;
+using WIDESEA_Core;
namespace WIDESEA_InboundService
{
@@ -57,8 +59,15 @@
throw new Exception("鏍囩鍙� LabelNo 涓嶈兘涓虹┖");
}
- // 鏌ヨMO绁ㄦ槸鍚﹀凡瀛樺湪
- var existMo = BaseDal.QueryFirst(x => x.LabelNo == item.LabelNo);
+ ///绛惧悕鏍¢獙
+ bool IsSign = MD5Util.CheckPLSSign(model);
+ if (!IsSign)
+ {
+ return ApiResponseContent.Instance.Error("绛惧悕楠岃瘉澶辫触锛岃妫�鏌�");
+ }
+
+ // 鏌ヨ鍞竴閿槸鍚﹀凡瀛樺湪锛坥rgId+labelNo锛�
+ var existMo = BaseDal.QueryFirst(x => x.LabelNo == item.LabelNo && x.OrgId == item.OrgId);
if (existMo == null)
{
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Model/Models/Basic/Dt_ApiInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Model/Models/Basic/Dt_ApiInfo.cs"
index e0dc8f8..1763b81 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Model/Models/Basic/Dt_ApiInfo.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Model/Models/Basic/Dt_ApiInfo.cs"
@@ -37,7 +37,7 @@
/// <summary>
/// 澶囨敞
/// </summary>
- [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "澶囨敞")]
+ [SugarColumn(IsNullable = true, Length = 500, ColumnDescription = "澶囨敞")]
public string Remark { get; set; }
}
}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Model/Models/Inbound/Dt_MoInboundOrder.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Model/Models/Inbound/Dt_MoInboundOrder.cs"
index fcc3540..64cb0c5 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Model/Models/Inbound/Dt_MoInboundOrder.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Model/Models/Inbound/Dt_MoInboundOrder.cs"
@@ -40,10 +40,10 @@
public string BarcodeNumber { get; set; }
/// <summary>
- /// VMI鐗╂祦鐘舵��(宸插垱寤猴紝宸插璐э紝宸插彂杩愶紝宸插彇娑�)
+ /// VMI鐗╂祦鐘舵��(0-宸插垱寤猴紝1-寰呮嫞璐э紝2-宸插璐э紝3-宸插彂杩愶紝4-宸插彇娑�)
/// </summary>
- [SugarColumn(IsNullable = false, Length = 10, ColumnDescription = "VMI鐗╂祦鐘舵��(宸插垱寤猴紝宸插璐э紝宸插彂杩愶紝宸插彇娑�)")]
- public string Status { get; set; }
+ [SugarColumn(IsNullable = false, Length = 10, ColumnDescription = "VMI鐗╂祦鐘舵��(0-宸插垱寤猴紝1-寰呮嫞璐э紝2-宸插璐э紝3-宸插彂杩愶紝4-宸插彇娑�)")]
+ public int Status { get; set; }
/// <summary>
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_WMSServer/Controllers/Inbound/MoInboundOrderController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_WMSServer/Controllers/Inbound/MoInboundOrderController.cs"
new file mode 100644
index 0000000..bf791c9
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_WMSServer/Controllers/Inbound/MoInboundOrderController.cs"
@@ -0,0 +1,31 @@
+锘縰sing Microsoft.AspNetCore.Mvc;
+using WIDESEA_Core;
+using WIDESEA_Core.BaseController;
+using WIDESEA_DTO.PLS;
+using WIDESEA_DTO;
+using WIDESEA_IInboundService;
+using WIDESEA_Model.Models;
+using Microsoft.AspNetCore.Authorization;
+
+namespace WIDESEA_WMSServer.Controllers.Inbound
+{
+ [Route("api/MoInboundOrder")]
+ [ApiController]
+ public class MoInboundOrderController : ApiBaseController<IMoInboundOrderService, Dt_MoInboundOrder>
+ {
+ public MoInboundOrderController(IMoInboundOrderService service) : base(service)
+ {
+ }
+
+ /// <summary>
+ /// 鍚屾MO绁ㄤ俊鎭�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [HttpPost, HttpGet, Route("ReceiveMoStatus"),AllowAnonymous]
+ public ApiResponseContent ReceiveMoStatus([FromBody] MoInboundOrderDTO model)
+ {
+ return Service.ReceiveMoStatus(model);
+ }
+ }
+}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_WMSServer/Controllers/PLS/PlsController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_WMSServer/Controllers/PLS/PlsController.cs"
index 661b1ac..ec2f856 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_WMSServer/Controllers/PLS/PlsController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_WMSServer/Controllers/PLS/PlsController.cs"
@@ -13,6 +13,9 @@
namespace WIDESEA_WMSServer.Controllers.PLS
{
+ /// <summary>
+ /// PLS鎺ュ彛
+ /// </summary>
[Route("api/Pls")]
[ApiController]
public class PlsController:ControllerBase
@@ -39,7 +42,7 @@
return ApiResponseContent.Instance.OK();
}
else {
- return ApiResponseContent.Instance.Error();
+ return ApiResponseContent.Instance.Error(content.Message);
}
}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_WMSServer/appsettings.json" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_WMSServer/appsettings.json"
index cc3c481..1731d60 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_WMSServer/appsettings.json"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_WMSServer/appsettings.json"
@@ -10,6 +10,7 @@
"AllowedHosts": "*",
"ConnectionStringsEncryption": false,
"MainDB": "DB_WIDESEA", //褰撳墠椤圭洰鐨勪富搴擄紝鎵�瀵瑰簲鐨勮繛鎺ュ瓧绗︿覆鐨凟nabled蹇呴』涓簍rue
+
//杩炴帴瀛楃涓�
//"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=",
//"ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWMS_HUAIAN;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
@@ -27,12 +28,18 @@
},
"WCS": "http://localhost:9291",
"LogAopEnable": false,
- "PrintSql": true, //鎵撳嵃SQL璇彞
+ "PrintSql": false, //鎵撳嵃SQL璇彞
"ApiName": "WIDESEA",
"ExpMinutes": 120,
"QuartzJobAutoStart": true,
"PDAVersion": "4",
"WebSocketPort": "9296锛�",
- "DBSeedEnable": true
+ "DBSeedEnable": false,
+ //PLS绛惧悕璐﹀彿鍙婂瘑閽�
+ "LocalAppId": "RWMS",
+ "LocalAppSecret": "pW6wny!#3P9nb#68",
+ //MLS璐﹀彿瀵嗙爜
+ "MlsUser": "123",
+ "MlsPwd": "wewe"
}
--
Gitblit v1.9.3