From 1866b69e8f67e382a0a75268d63e6418c8ae02e7 Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期二, 13 一月 2026 09:55:01 +0800
Subject: [PATCH] 1
---
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs | 22 +++++++++++++++++-----
1 files changed, 17 insertions(+), 5 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_InboundService/InboundService.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_InboundService/InboundService.cs"
index 18d4a5f..3c2b957 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_InboundService/InboundService.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_InboundService/InboundService.cs"
@@ -10,6 +10,7 @@
using System.Collections.Generic;
using System.Data;
using System.Linq;
+using System.Net;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.AllocateEnum;
@@ -23,6 +24,7 @@
using WIDESEA_Core.Utilities;
using WIDESEA_DTO.Allocate;
using WIDESEA_DTO.Inbound;
+using WIDESEA_DTO.Mes;
using WIDESEA_DTO.ReturnMES;
using WIDESEA_IBasicService;
using WIDESEA_IInboundService;
@@ -83,11 +85,12 @@
}
Dt_InboundOrder inboundOrder = new Dt_InboundOrder();
+
var details = _inboundOrderDetailRepository.QueryData(x => (x.OutBoxbarcodes == palletDto.Barcode|| x.Barcode == palletDto.Barcode) && x.OrderDetailStatus == (int)InOrderStatusEnum.鏈紑濮�);
if (details.Count() <= 0)
{
- return content.Error("鏈壘鍒拌鏉$爜鍗曟嵁淇℃伅璇风‘璁ゆ槸鍚﹀凡缁忕粍鐩樺畬鎴�");
+ return content.Error("璇风‘璁ゆ槸鍚﹀凡缁忕粍鐩�");
}
inboundOrder = _inboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Includes(x=>x.Details).Where(x => x.Id == details.First().OrderId).First();
@@ -95,8 +98,17 @@
{
return content.Error("鏈壘鍒拌鏉$爜涓诲崟淇℃伅");
}
+ if(inboundOrder.OrderStatus == (int)InOrderStatusEnum.鎵嬪姩鍏抽棴)
+ {
+ return content.Error("璇ュ崟鎹殑鐘舵�佷笉鑳界粍鐩�");
+ }
+ var warehouse =_warehouseAreaRepository.QueryFirst(x => x.Code == palletDto.WarehouseType);
+ if(inboundOrder.BusinessType=="11" && inboundOrder.FactoryArea != warehouse.FactoryArea)
+ {
+ return content.Error($"褰撳墠鍘傚尯涓嶄竴鑷�");
+ }
- if(inboundOrder.BusinessType != MESDocumentType.PurchaseInbound.ToString() && inboundOrder.Details.FirstOrDefault().WarehouseCode != palletDto.WarehouseType)
+ if(inboundOrder.BusinessType != "11"&& inboundOrder.Details.FirstOrDefault().WarehouseCode != palletDto.WarehouseType)
{
return content.Error($"璇ユ潯鐮佹墍灞炰粨搴撲负{inboundOrder.Details.FirstOrDefault().WarehouseCode}涓庡綋鍓嶄粨搴搟palletDto.WarehouseType}涓嶄竴鑷达紝涓嶅厑璁哥粍鐩�");
}
@@ -115,7 +127,7 @@
stockInfo.Details = new List<Dt_StockInfoDetail>();
}
- if (stockInfo != null && stockInfo.Details.Count > 0 && stockInfo.Details.FirstOrDefault()?.WarehouseCode != palletDto.WarehouseType)
+ if (inboundOrder.BusinessType != MESDocumentType.PurchaseInbound.ToString() && stockInfo != null && stockInfo.Details.Count > 0 && stockInfo.Details.FirstOrDefault()?.WarehouseCode != palletDto.WarehouseType)
{
return content.Error($"璇ユ墭鐩樼粍鐩樹粨搴撲负{stockInfo.Details.FirstOrDefault()?.WarehouseCode}涓庡綋鍓嶄粨搴搟palletDto.WarehouseType}涓嶄竴鑷达紝涓嶅厑璁哥粍鐩�");
}
@@ -429,7 +441,7 @@
if (allocatefeedmodel.Details.Count <= 0)
{
- throw new Exception("鏈壘鍒伴渶瑕佸洖浼犵殑鏁版嵁");
+ return WebResponseContent.Instance.OK($"璇ュ崟鎹病鏈夐渶瑕佸洖浼犳槑缁嗭紝澶辫触鏁版嵁鍥炰紶{returnRecords.Count()}鏉★紝鍥炰紶鎴愬姛{returnRecords.Count(x => x.ReturnStatus == 1)}鏉★紝鍥炰紶澶辫触{returnRecords.Count(x => x.ReturnStatus == 2)}鏉�");
}
var response = responseModel(inboundOrder, 3, null, allocatefeedmodel);
@@ -463,7 +475,7 @@
if (feedmodel.details.Count<=0)
{
- throw new Exception("鏈壘鍒伴渶瑕佸洖浼犵殑鏁版嵁");
+ return WebResponseContent.Instance.OK($"璇ュ崟鎹病鏈夐渶瑕佸洖浼犳槑缁嗭紝澶辫触鏁版嵁鍥炰紶{returnRecords.Count()}鏉★紝鍥炰紶鎴愬姛{returnRecords.Count(x => x.ReturnStatus == 1)}鏉★紝鍥炰紶澶辫触{returnRecords.Count(x => x.ReturnStatus == 2)}鏉�");
}
var response = responseModel(inboundOrder, 3, feedmodel);
--
Gitblit v1.9.3