From 37454e625df68d40897112b2e8c2e3cf4d7163e3 Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期三, 25 三月 2026 11:43:10 +0800
Subject: [PATCH] 1
---
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs | 226 +++++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 198 insertions(+), 28 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 7dcdc17..b564789 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"
@@ -12,12 +12,14 @@
using System.Data;
using System.Linq;
using System.Net;
+using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.AllocateEnum;
using WIDESEA_Common.CommonEnum;
using WIDESEA_Common.OrderEnum;
using WIDESEA_Common.StockEnum;
+using WIDESEA_Common.WareHouseEnum;
using WIDESEA_Core;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.Helper;
@@ -56,7 +58,8 @@
private readonly ILocationInfoService _locationInfoService;
private readonly IRepository<Dt_TakeStockOrder> _takeStockOrder;
private readonly IRepository<Dt_StockInfoDetail> _stockInfoDetailRepository;
- public InboundService(IUnitOfWorkManage unitOfWorkManage, IInboundOrderDetailService inboundOrderDetailService, IInboundOrderService inbounOrderService, IRepository<Dt_InboundOrder> inboundOrderRepository, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IRepository<Dt_LocationType> locationTypeRepository, IRepository<Dt_StockInfo> stockInfoRepository, IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository, IStockService stockService, IRepository<Dt_Task> taskRepository,IRepository<Dt_AllocateMaterialInfo> allocateMaterialInfo, HttpClientHelper httpClientHelper, IRepository<Dt_MesReturnRecord> mesReturnRecord,ILocationInfoService locationInfoService,IRepository<Dt_TakeStockOrder> takeStockOrder,IRepository<Dt_StockInfoDetail> stockInfoDetailRepository)
+ private readonly IRepository<Dt_AllocateOrder> _allocateOrderRepository;
+ public InboundService(IUnitOfWorkManage unitOfWorkManage, IInboundOrderDetailService inboundOrderDetailService, IInboundOrderService inbounOrderService, IRepository<Dt_InboundOrder> inboundOrderRepository, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IRepository<Dt_LocationType> locationTypeRepository, IRepository<Dt_StockInfo> stockInfoRepository, IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository, IStockService stockService, IRepository<Dt_Task> taskRepository,IRepository<Dt_AllocateMaterialInfo> allocateMaterialInfo, HttpClientHelper httpClientHelper, IRepository<Dt_MesReturnRecord> mesReturnRecord,ILocationInfoService locationInfoService,IRepository<Dt_TakeStockOrder> takeStockOrder,IRepository<Dt_StockInfoDetail> stockInfoDetailRepository, IRepository<Dt_AllocateOrder> allocateOrderRepository)
{
_unitOfWorkManage = unitOfWorkManage;
InboundOrderDetailService = inboundOrderDetailService;
@@ -74,6 +77,7 @@
_locationInfoService = locationInfoService;
_takeStockOrder = takeStockOrder;
_stockInfoDetailRepository = stockInfoDetailRepository;
+ _allocateOrderRepository = allocateOrderRepository;
}
public async Task<WebResponseContent> GroupPallet(GroupPalletDto palletDto)
@@ -94,10 +98,12 @@
var details = _inboundOrderDetailRepository.QueryData(x => (x.OutBoxbarcodes == palletDto.Barcode|| x.Barcode == palletDto.Barcode) && x.OrderDetailStatus == (int)InOrderStatusEnum.鏈紑濮�);
+
if (details.Count() <= 0)
{
- var inbounddetail =_inboundOrderDetailRepository.QueryFirst(x => x.Barcode == palletDto.Barcode || x.OutBoxbarcodes == palletDto.Barcode);
- if(inbounddetail == null)
+
+ var inbounddetail = _inboundOrderDetailRepository.QueryFirst(x => x.Barcode == palletDto.Barcode || x.OutBoxbarcodes == palletDto.Barcode);
+ if (inbounddetail == null)
{
return content.Error($"鏉$爜{palletDto.Barcode}涓嶅瓨鍦�");
}
@@ -107,26 +113,26 @@
return content.Error("鍗曟嵁涓嶈兘涓虹┖");
}
- var detail = _inboundOrderDetailRepository.Db.Queryable<Dt_InboundOrderDetail>().LeftJoin<Dt_InboundOrder>((d,o)=>d.OrderId==o.Id).Where((d, o) => d.OrderId == inbound.Id
+ var detail = _inboundOrderDetailRepository.Db.Queryable<Dt_InboundOrderDetail>().LeftJoin<Dt_InboundOrder>((d, o) => d.OrderId == o.Id).Where((d, o) => d.OrderId == inbound.Id
&& d.ReceiptQuantity != 0
&& d.OverInQuantity == 0).Select((d, o) => new
- {
- orderNo=o.InboundOrderNo,
- d.Barcode,
- d.MaterielCode,
- d.BatchNo,
- d.ReceiptQuantity,
- d.Unit,
- d.SupplyCode,
- d.WarehouseCode
- }).ToList();
- var palletId = _stockInfoDetailRepository.QueryFirst(x => x.Barcode == palletDto.Barcode);
+ {
+ orderNo = o.InboundOrderNo,
+ d.Barcode,
+ d.MaterielCode,
+ d.BatchNo,
+ d.ReceiptQuantity,
+ d.Unit,
+ d.SupplyCode,
+ d.WarehouseCode
+ }).ToList();
+ var palletId = _stockInfoDetailRepository.QueryFirst(x => x.Barcode == palletDto.Barcode);
if (palletId == null)
{
- return content.Error($"鏉$爜鏉$爜{palletDto.Barcode}涓嶅瓨鍦�");
+ return content.Error($"鏉$爜{palletDto.Barcode}宸茬粍鐩�");
}
- var pallet =_stockInfoRepository.QueryFirst(x => x.Id == palletId.StockId);
- return content.Error($"鏉$爜{palletDto.Barcode}宸茬粡缁勫埌{pallet.PalletCode}",detail);
+ var pallet = _stockInfoRepository.QueryFirst(x => x.Id == palletId.StockId);
+ return content.Error($"鏉$爜{palletDto.Barcode}宸茬粡缁勫埌{pallet.PalletCode}", detail);
}
inboundOrder = _inboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Includes(x=>x.Details).Where(x => x.Id == details.First().OrderId).First();
@@ -144,10 +150,22 @@
return content.Error($"褰撳墠鍘傚尯涓嶄竴鑷�");
}
- if(inboundOrder.BusinessType != "11"&& inboundOrder.Details.FirstOrDefault().WarehouseCode != palletDto.WarehouseType)
+ if(inboundOrder.BusinessType != "11")
{
- return content.Error($"璇ユ潯鐮佹墍灞炰粨搴撲负{inboundOrder.Details.FirstOrDefault().WarehouseCode}涓庡綋鍓嶄粨搴搟palletDto.WarehouseType}涓嶄竴鑷达紝涓嶅厑璁哥粍鐩�");
+ var warehouseType = _inboundOrderDetailRepository.Db.Queryable<Dt_InboundOrderDetail>().Where(x => x.Barcode == palletDto.Barcode || x.OutBoxbarcodes == palletDto.Barcode).Select(x => x.WarehouseCode).First();
+
+ if (string.IsNullOrEmpty(warehouseType))
+ {
+ return content.Error($"鏈煡璇㈠埌鏉$爜[{palletDto.Barcode}]瀵瑰簲鐨勪粨搴撲俊鎭紝涓嶅厑璁哥粍鐩�");
+ }
+
+ if (!warehouseType.Equals(palletDto.WarehouseType))
+ {
+ return content.Error($"璇ユ潯鐮佹墍灞炰粨搴撲负{warehouseType}涓庡綋鍓嶄粨搴搟palletDto.WarehouseType}涓嶄竴鑷达紝涓嶅厑璁哥粍鐩�");
+ }
}
+
+
Dt_StockInfo? stockInfo = await _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Includes(x => x.Details).Where(x => x.PalletCode == palletDto.PalletCode).FirstAsync();
@@ -172,6 +190,15 @@
{
return content.Error($"涓�涓噰璐崟鎹噷闈笉鍏佽缁勭洏涓や釜浠撳簱锛岃閲嶆柊閫夋嫨浠撳簱锛屼笂涓�涓粍鐩樹粨搴撲负{isWarehouse.WarehouseCode}");
}
+
+ if (inboundOrder.BusinessType == "11" && inboundOrder.IsTestMaterials == 1 && palletDto.WarehouseType != "1076" && palletDto.WarehouseType != "5057")
+ {
+ return content.Error($"璇ュ崟鎹负璇曚骇鐗╂枡锛岄渶瑕佸叆搴撳埌璇曚骇浠擄紝璇烽噸鏂版牴鎹巶鍖洪�夋嫨璇曚骇浠撳簱杩涜缁勭洏鍏ュ簱");
+ }
+ if (inboundOrder.IsTestMaterials == 0 && (palletDto.WarehouseType == "1076" || palletDto.WarehouseType == "5057"))
+ {
+ return content.Error($"璇ュ崟鎹负闈炶瘯浜х墿鏂欙紝涓嶈兘鍏ュ埌璇曚骇浠擄紝璇烽噸鏂版牴鎹粨搴撹繘琛岀粍鐩樺叆搴�");
+ }
if (!_locationInfoService.QueryLocationCount(Convert.ToInt32(palletDto.locationType)))
{
return content.Error($"璇ュ簱鍖簕palletDto.locationType}涓嶅瓨鍦ㄧ┖闂插簱浣�");
@@ -181,6 +208,11 @@
if (nullpallet != null)
{
return content.Error($"璇ユ墭鐩榹palletDto.PalletCode}宸茬粡杩涜绌烘墭缁勭洏,涓嶈兘鍦ㄨ繘琛岀粍鐩�");
+ }
+ var outbundPallet = _stockInfoRepository.QueryFirst(x => x.StockStatus == (int)StockStatusEmun.鍑哄簱瀹屾垚 && x.PalletCode == palletDto.PalletCode);
+ if (outbundPallet != null)
+ {
+ return content.Error($"璇ユ墭鐩榹palletDto.PalletCode}鏈繘琛屽彇绌虹,涓嶈兘杩涜缁勭洏");
}
foreach (var item in details)
@@ -274,7 +306,16 @@
{
return content.Error("宸蹭笂鏋剁殑鎵樼洏涓嶈兘鍐嶆缁勭洏");
}
-
+ var nullpallet = _stockInfoRepository.QueryFirst(x => x.PalletType == -1 && x.PalletCode == palletDto.PalletCode);
+ if (nullpallet != null)
+ {
+ return content.Error($"璇ユ墭鐩榹palletDto.PalletCode}宸茬粡杩涜绌烘墭缁勭洏,涓嶈兘鍦ㄨ繘琛岀粍鐩�");
+ }
+ var outbundPallet = _stockInfoRepository.QueryFirst(x => x.StockStatus == (int)StockStatusEmun.鍑哄簱瀹屾垚 && x.PalletCode == palletDto.PalletCode);
+ if (outbundPallet != null)
+ {
+ return content.Error($"璇ユ墭鐩榹palletDto.PalletCode}鏈繘琛屽彇绌虹,涓嶈兘杩涜缁勭洏");
+ }
if (_stockService.StockInfoDetailService.ExistBarcodes(palletDto.Barcode))
{
return content.Error($"{palletDto.Barcode} 鏉$爜鍦ㄥ簱瀛樹腑宸插瓨鍦�");
@@ -295,7 +336,10 @@
{
return content.Error($"鏈壘鍒拌鏉$爜{palletDto.Barcode}闇�璋冨叆鏅轰粨鐨勪俊鎭�");
}
-
+ if(allocateMaterialInfo.WarehouseCode != palletDto.WarehouseType)
+ {
+ return content.Error($"璇ユ潯鐮佽皟鍏ヤ粨搴撲负{allocateMaterialInfo.WarehouseCode},涓庨�夋嫨鐨剓palletDto.WarehouseType}浠撳簱涓嶄竴鑷�");
+ }
stockInfo.Details.Add(new Dt_StockInfoDetail
{
StockId = stockInfo == null ? 0 : stockInfo.Id,
@@ -417,9 +461,27 @@
WebResponseContent content = new WebResponseContent();
try
{
- var inboundOrder = _inboundOrderRepository.Db.Queryable<Dt_InboundOrder>()
+ Dt_InboundOrder inboundOrder = null;
+ var allocateOrder = _allocateOrderRepository.Db.Queryable<Dt_AllocateOrder>().Where(x => x.Id == id).First();
+ if (allocateOrder != null)
+ {
+ inboundOrder = _inboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Where(x => x.InboundOrderNo == allocateOrder.OrderNo).First();
+ if (inboundOrder.IsBatch == 0 && inboundOrder.OrderStatus == InOrderStatusEnum.鍏ュ簱涓�.ObjToInt())
+ {
+ return content = WebResponseContent.Instance.OK($"璇ュ崟鎹睘浜庝笉鍒嗘壒鑷姩鍥炰紶锛屼笉鍙墜鍔ㄥ垎鎵瑰洖浼�");
+ }
+ }else
+ {
+ inboundOrder = _inboundOrderRepository.Db.Queryable<Dt_InboundOrder>()
.Where(x => x.Id == id)
.First();
+ if (inboundOrder.IsBatch == 0 && inboundOrder.OrderStatus == InOrderStatusEnum.鍏ュ簱涓�.ObjToInt())
+ {
+ return content = WebResponseContent.Instance.OK($"璇ュ崟鎹睘浜庝笉鍒嗘壒鑷姩鍥炰紶锛屼笉鍙墜鍔ㄥ垎鎵瑰洖浼�");
+ }
+ }
+
+
List<Dt_MesReturnRecord> returnRecords = _mesReturnRecord.QueryData(x => x.OrderNo == inboundOrder.InboundOrderNo && x.OrderId == inboundOrder.Id && x.ReturnStatus == 2);
foreach (var item in returnRecords)
@@ -510,7 +572,18 @@
{
if (returnRecords.Count() == returnRecords.Count(x => x.ReturnStatus == 1))
{
- inboundOrder.ReturnToMESStatus = 1;
+ if (inboundOrder.OrderStatus == InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt())
+ {
+ inboundOrder.ReturnToMESStatus = 1;
+ }
+ else if (inboundOrder.OrderStatus == InOrderStatusEnum.鍏ュ簱涓�.ObjToInt())
+ {
+ inboundOrder.ReturnToMESStatus = 3;
+ }
+ else
+ {
+ inboundOrder.ReturnToMESStatus = 0;
+ }
}
else if (returnRecords.Count(x => x.ReturnStatus == 2) > 0)
{
@@ -521,7 +594,7 @@
inboundOrder.ReturnToMESStatus = 2;
}
_inboundOrderRepository.UpdateData(inboundOrder);
- return WebResponseContent.Instance.OK($"璇ュ崟鎹病鏈夐渶瑕佸洖浼犳槑缁嗭紝澶辫触鏁版嵁鍥炰紶{returnRecords.Count()}鏉★紝鍥炰紶鎴愬姛{returnRecords.Count(x => x.ReturnStatus == 1)}鏉★紝鍥炰紶澶辫触{returnRecords.Count(x => x.ReturnStatus == 2)}鏉�");
+ 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);
@@ -530,6 +603,22 @@
{
_inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 1 })
.Where(it => it.OrderId == inboundOrder.Id && inbounddetailID.Contains(it.Id)).ExecuteCommand();
+
+ if (inboundOrder.OrderStatus == InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt())
+ {
+ _inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 1 })
+ .Where(it => it.Id == inboundOrder.Id).ExecuteCommand();
+ }
+ else if (inboundOrder.OrderStatus == InOrderStatusEnum.鍏ュ簱涓�.ObjToInt())
+ {
+ _inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 3 })
+ .Where(it => it.Id == inboundOrder.Id).ExecuteCommand();
+ }
+ else
+ {
+ _inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 0 })
+ .Where(it => it.Id == inboundOrder.Id).ExecuteCommand();
+ }
_stockInfoRepository.Db.Updateable<Dt_StockInfoDetail>().SetColumns(it => new Dt_StockInfoDetail
{
@@ -540,6 +629,22 @@
{
_inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 2 })
.Where(it => inbounddetailID.Contains(it.Id)).ExecuteCommand();
+
+ if (inboundOrder.OrderStatus == InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt())
+ {
+ _inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 2 })
+ .Where(it => it.Id == inboundOrder.Id).ExecuteCommand();
+ }
+ else if (inboundOrder.OrderStatus == InOrderStatusEnum.鍏ュ簱涓�.ObjToInt())
+ {
+ _inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 4 })
+ .Where(it => it.Id == inboundOrder.Id).ExecuteCommand();
+ }
+ else
+ {
+ _inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 0 })
+ .Where(it => it.Id == inboundOrder.Id).ExecuteCommand();
+ }
return content.Error("鍥炰紶MES澶辫触");
}
}
@@ -562,7 +667,18 @@
{
if (returnRecords.Count() == returnRecords.Count(x => x.ReturnStatus == 1))
{
- inboundOrder.ReturnToMESStatus = 1;
+ if (inboundOrder.OrderStatus == InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt())
+ {
+ inboundOrder.ReturnToMESStatus = 1;
+ }
+ else if(inboundOrder.OrderStatus == InOrderStatusEnum.鍏ュ簱涓�.ObjToInt())
+ {
+ inboundOrder.ReturnToMESStatus = 3;
+ }
+ else
+ {
+ inboundOrder.ReturnToMESStatus = 0;
+ }
}
else if (returnRecords.Count(x => x.ReturnStatus == 2) > 0)
{
@@ -573,7 +689,7 @@
inboundOrder.ReturnToMESStatus = 2;
}
_inboundOrderRepository.UpdateData(inboundOrder);
- return WebResponseContent.Instance.OK($"璇ュ崟鎹病鏈夐渶瑕佸洖浼犳槑缁嗭紝澶辫触鏁版嵁鍥炰紶{returnRecords.Count()}鏉★紝鍥炰紶鎴愬姛{returnRecords.Count(x => x.ReturnStatus == 1)}鏉★紝鍥炰紶澶辫触{returnRecords.Count(x => x.ReturnStatus == 2)}鏉�");
+ return WebResponseContent.Instance.OK($"璇ュ崟鎹病鏈夐渶瑕佸洖浼犳槑缁嗭紝鍥炰紶{returnRecords.Count()}鏉★紝鍥炰紶鎴愬姛{returnRecords.Count(x => x.ReturnStatus == 1)}鏉★紝鍥炰紶澶辫触{returnRecords.Count(x => x.ReturnStatus == 2)}鏉�");
}
var response = responseModel(inboundOrder, 3, feedmodel);
@@ -581,6 +697,22 @@
{
_inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 1 })
.Where(it => inbounddetailID.Contains(it.Id)).ExecuteCommand();
+
+ if(inboundOrder.OrderStatus == InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt())
+ {
+ _inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 1 })
+ .Where(it => it.Id == inboundOrder.Id).ExecuteCommand();
+ }
+ else if(inboundOrder.OrderStatus == InOrderStatusEnum.鍏ュ簱涓�.ObjToInt())
+ {
+ _inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 3})
+ .Where(it => it.Id == inboundOrder.Id).ExecuteCommand();
+ }
+ else
+ {
+ _inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 0 })
+ .Where(it => it.Id == inboundOrder.Id).ExecuteCommand();
+ }
_stockInfoRepository.Db.Updateable<Dt_StockInfoDetail>().SetColumns(it => new Dt_StockInfoDetail
{
@@ -591,6 +723,22 @@
{
_inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 2 })
.Where(it => inbounddetailID.Contains(it.Id)).ExecuteCommand();
+
+ if (inboundOrder.OrderStatus == InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt())
+ {
+ _inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 2 })
+ .Where(it => it.Id == inboundOrder.Id).ExecuteCommand();
+ }
+ else if (inboundOrder.OrderStatus == InOrderStatusEnum.鍏ュ簱涓�.ObjToInt())
+ {
+ _inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 4 })
+ .Where(it => it.Id == inboundOrder.Id).ExecuteCommand();
+ }
+ else
+ {
+ _inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 0 })
+ .Where(it => it.Id == inboundOrder.Id).ExecuteCommand();
+ }
return content.Error("鍥炰紶MES澶辫触");
}
}
@@ -734,7 +882,16 @@
{
return content.Error("宸蹭笂鏋剁殑鎵樼洏涓嶈兘鍐嶆缁勭洏");
}
-
+ var nullpallet = _stockInfoRepository.QueryFirst(x => x.PalletType == -1 && x.PalletCode == palletDto.PalletCode);
+ if (nullpallet != null)
+ {
+ return content.Error($"璇ユ墭鐩榹palletDto.PalletCode}宸茬粡杩涜绌烘墭缁勭洏,涓嶈兘鍦ㄨ繘琛岀粍鐩�");
+ }
+ var outbundPallet = _stockInfoRepository.QueryFirst(x => x.StockStatus == (int)StockStatusEmun.鍑哄簱瀹屾垚 && x.PalletCode == palletDto.PalletCode);
+ if (outbundPallet != null)
+ {
+ return content.Error($"璇ユ墭鐩榹palletDto.PalletCode}鏈繘琛屽彇绌虹,涓嶈兘杩涜缁勭洏");
+ }
Dt_StockInfoDetail stockInfoDetail = _stockService.StockInfoDetailService.Db.Queryable<Dt_StockInfoDetail>()
.Where(x => x.Barcode == palletDto.Barcode && x.StockId == 0)
.First();
@@ -854,6 +1011,16 @@
{
return content.Error($"璇ユ墭鐩樼粍鐩樹粨搴撲负{stockInfo.Details.FirstOrDefault()?.WarehouseCode}涓庡綋鍓嶄粨搴搟palletDto.WarehouseType}涓嶄竴鑷达紝涓嶅厑璁哥粍鐩�");
}
+ var nullpallet = _stockInfoRepository.QueryFirst(x => x.PalletType == -1 && x.PalletCode == palletDto.PalletCode);
+ if (nullpallet != null)
+ {
+ return content.Error($"璇ユ墭鐩榹palletDto.PalletCode}宸茬粡杩涜绌烘墭缁勭洏,涓嶈兘鍦ㄨ繘琛岀粍鐩�");
+ }
+ var outbundPallet = _stockInfoRepository.QueryFirst(x => x.StockStatus == (int)StockStatusEmun.鍑哄簱瀹屾垚 && x.PalletCode == palletDto.PalletCode);
+ if (outbundPallet != null)
+ {
+ return content.Error($"璇ユ墭鐩榹palletDto.PalletCode}鏈繘琛屽彇绌虹,涓嶈兘杩涜缁勭洏");
+ }
Dt_StockInfoDetail stockInfoDetail = _stockInfoRepository.Db.Queryable<Dt_StockInfoDetail>().Where(x => x.Barcode == palletDto.Barcode && x.Status == StockStatusEmun.閲嶆涓�.ObjToInt()).First();
if(stockInfoDetail == null)
{
@@ -916,5 +1083,8 @@
return content.Error(ex.Message);
}
}
+
+
+
}
}
--
Gitblit v1.9.3