From 3460ffdc967b65ea67c959212c2505a19008401e Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期四, 16 四月 2026 13:39:56 +0800
Subject: [PATCH] 盘点优化,智仓调智仓防呆
---
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_BasicService/MESOperation/FeedbackMesService.cs | 45 +++++++++++++++++++++++++++++++++++++++------
1 files changed, 39 insertions(+), 6 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_BasicService/MESOperation/FeedbackMesService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_BasicService/MESOperation/FeedbackMesService.cs"
index cc34fe3..b584824 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_BasicService/MESOperation/FeedbackMesService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_BasicService/MESOperation/FeedbackMesService.cs"
@@ -56,6 +56,16 @@
{
return webResponse = WebResponseContent.Instance.OK($"璇ュ崟鎹棤闇�鍥炰紶MES");
}
+
+ if (outboundOrder.IsBatch == 0 && outboundOrder.OrderStatus != OutOrderStatusEnum.鍑哄簱瀹屾垚.ObjToInt())
+ {
+ return webResponse = WebResponseContent.Instance.OK($"璇ュ崟鎹睘浜庝笉鍒嗘壒鑷姩鍥炰紶锛屼笉鍙墜鍔ㄥ垎鎵瑰洖浼�");
+ }
+ Dt_OutStockLockInfo outStockLockInfo = _allocateRepository.Db.Queryable<Dt_OutStockLockInfo>().Where(x => x.OrderNo == outboundOrder.OrderNo).First();
+ if (outStockLockInfo != null)
+ {
+ return WebResponseContent.Instance.Error("璇ュ崟鎹繕瑕佹湭鎷i�夌殑鐗╂枡锛岃鍏堟嫞閫夊畬鎴愬啀鐐瑰嚮鍥炰紶");
+ }
List<Dt_MesReturnRecord> returnRecords = BaseDal.QueryData(x => x.OrderNo == orderNo && x.OrderId == outboundOrder.Id && x.ReturnStatus == 2);
foreach (var item in returnRecords)
@@ -104,7 +114,19 @@
{
if (returnRecords.Count() == returnRecords.Count(x => x.ReturnStatus == 1))
{
- outboundOrder.ReturnToMESStatus = 1;
+ if(outboundOrder.OrderStatus == OutOrderStatusEnum.鍑哄簱瀹屾垚.ObjToInt())
+ {
+ outboundOrder.ReturnToMESStatus = 1;
+ }
+ else if (outboundOrder.OrderStatus == OutOrderStatusEnum.鍑哄簱涓�.ObjToInt())
+ {
+ outboundOrder.ReturnToMESStatus = 3;
+ }
+ else
+ {
+ outboundOrder.ReturnToMESStatus = 0;
+ }
+
}
else if (returnRecords.Count(x => x.ReturnStatus == 2) > 0)
{
@@ -117,7 +139,7 @@
_outboundOrderRepository.UpdateData(outboundOrder);
- return webResponse = WebResponseContent.Instance.OK($"璇ュ崟鎹病鏈夐渶瑕佸洖浼犳槑缁嗭紝澶辫触鏁版嵁鍥炰紶{returnRecords.Count()}鏉★紝鍥炰紶鎴愬姛{returnRecords.Count(x=>x.ReturnStatus == 1)}鏉★紝鍥炰紶澶辫触{returnRecords.Count(x => x.ReturnStatus == 2)}鏉�");
+ return webResponse = WebResponseContent.Instance.OK($"璇ュ崟鎹病鏈夐渶瑕佸洖浼犳槑缁嗭紝鍥炰紶{returnRecords.Count()}鏉★紝鍥炰紶鎴愬姛{returnRecords.Count(x=>x.ReturnStatus == 1)}鏉★紝鍥炰紶澶辫触{returnRecords.Count(x => x.ReturnStatus == 2)}鏉�");
}
@@ -151,7 +173,18 @@
{
if(returnRecords.Count() == returnRecords.Count(x => x.ReturnStatus == 1))
{
- outboundOrder.ReturnToMESStatus = 1;
+ if (outboundOrder.OrderStatus == OutOrderStatusEnum.鍑哄簱瀹屾垚.ObjToInt())
+ {
+ outboundOrder.ReturnToMESStatus = 1;
+ }
+ else if (outboundOrder.OrderStatus == OutOrderStatusEnum.鍑哄簱涓�.ObjToInt())
+ {
+ outboundOrder.ReturnToMESStatus = 3;
+ }
+ else
+ {
+ outboundOrder.ReturnToMESStatus = 0;
+ }
}
else if(returnRecords.Count(x => x.ReturnStatus == 2)>0)
{
@@ -164,7 +197,7 @@
_outboundOrderRepository.UpdateData(outboundOrder);
- return webResponse = WebResponseContent.Instance.OK($"璇ュ崟鎹病鏈夐渶瑕佸洖浼犳槑缁嗭紝澶辫触鏁版嵁鍥炰紶{returnRecords.Count()}鏉★紝鍥炰紶鎴愬姛{returnRecords.Count(x => x.ReturnStatus == 1)}鏉★紝鍥炰紶澶辫触{returnRecords.Count(x => x.ReturnStatus == 2)}鏉�");
+ return webResponse = WebResponseContent.Instance.OK($"璇ュ崟鎹病鏈夐渶瑕佸洖浼犳槑缁嗭紝鍥炰紶{returnRecords.Count()}鏉★紝鍥炰紶鎴愬姛{returnRecords.Count(x => x.ReturnStatus == 1)}鏉★紝鍥炰紶澶辫触{returnRecords.Count(x => x.ReturnStatus == 2)}鏉�");
}
string apiUrl = AppSettings.GetValue("AllocationFeedbackUrl");
@@ -234,7 +267,7 @@
mesReturnRecord.ReturnType = outboundOrder.Details.Count == outboundOrderDetails.Count ? 1 : 2;
- if (outboundOrder.Details.Count == outboundOrderDetails.Count && outboundOrderDetails.All(x => x.ReturnToMESStatus == 1 || x.ReturnToMESStatus == 2))
+ if (outboundOrder.OrderStatus == OutOrderStatusEnum.鍑哄簱瀹屾垚.ObjToInt() && outboundOrderDetails.All(x => x.ReturnToMESStatus == 1 || x.ReturnToMESStatus == 2))
{
outboundOrder.ReturnToMESStatus = isSuccess ? 1 : 2;
}
@@ -497,7 +530,7 @@
Dt_MesReturnRecord mesReturnRecord = new Dt_MesReturnRecord()
{
ApiUrl = httpResponseResult.ApiUrl,
- InterfaceType = 1,
+ InterfaceType = 4,
OrderId = materialCodeInfo.OrderId ?? 0,
OrderNo = materialCodeInfo.OrderNo ?? "",
RequestCode = reqCode,
--
Gitblit v1.9.3