From 8adbc609ea7b5982d5c7bd3c47beb2fa775c5399 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期一, 29 十二月 2025 18:43:08 +0800
Subject: [PATCH] 1
---
WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs | 46 +++++++++++++++++++++++++++++++++-------------
1 files changed, 33 insertions(+), 13 deletions(-)
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs b/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs
index 8246572..52073c7 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs
@@ -39,8 +39,7 @@
Dt_Task task = Repository.QueryFirst(x => x.PalletCode == palletCode);
if (task != null)
{
- PushTasksToWCS(new List<Dt_Task> { task });
- return WebResponseContent.Instance.OK($"璇ユ墭鐩樺凡鐢熸垚浠诲姟", _mapper.Map<WMSTaskDTO>(task));
+ return WebResponseContent.Instance.Error($"璇ユ墭鐩榹palletCode}宸茬敓鎴愪换鍔�");
}
Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == palletCode).Includes(x => x.Details).First();
@@ -52,21 +51,21 @@
string returnOrderNo = stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.OrderNo;
Dt_ReturnOrder returnOrder = _returnOrderRepository.QueryFirst(x => x.OrderNo == returnOrderNo && x.OrderStatus == InOrderStatusEnum.鏈紑濮�.ObjToInt());
Dt_RoadwayInfo returnRoadwayInfo = new Dt_RoadwayInfo();
- if(returnOrder != null && !string.IsNullOrEmpty(returnOrder.LocationCode))
+ if (returnOrder != null && !string.IsNullOrEmpty(returnOrder.LocationCode))
{
Dt_LocationInfo locationInfo1 = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == returnOrder.LocationCode);
- if(locationInfo1 == null)
+ if (locationInfo1 == null)
{
return WebResponseContent.Instance.Error($"鍥炲簱鍗曚腑璇ュ簱浣峽returnOrder.LocationCode}鏈壘鍒�");
}
returnRoadwayInfo = _basicRepository.RoadwayInfoRepository.QueryFirst(x => x.RoadwayNo == locationInfo1.RoadwayNo);
}
- if (Repository.QueryFirst(x => x.SourceAddress == (returnRoadwayInfo.InStationCode != null ? returnRoadwayInfo.InStationCode:stationCode) && x.TaskStatus == TaskStatusEnum.New.ObjToInt()) != null)
+ if (Repository.QueryFirst(x => x.SourceAddress == (returnRoadwayInfo.InStationCode != null ? returnRoadwayInfo.InStationCode : stationCode) && x.TaskStatus == TaskStatusEnum.New.ObjToInt()) != null)
{
return WebResponseContent.Instance.Error($"璇ョ珯鐐瑰凡鏈夋湭鎵ц鐨勪换鍔�");
}
-
+
var details = stockInfo.Details.FirstOrDefault();
if (!string.IsNullOrEmpty(stockInfo.LocationCode))
{
@@ -124,15 +123,15 @@
newTask.MaterielCode = MaterielCode;
newTask.Quantity = (float)Quantity;
}
- if(stockInfo.StockStatus == StockStatusEmun.浣欐枡閫�搴�.ObjToInt())
+ if (stockInfo.StockStatus == StockStatusEmun.浣欐枡閫�搴�.ObjToInt())
{
newTask.TaskType = TaskTypeEnum.SurplusReturn.ObjToInt();
}
- if(stockInfo.StockStatus == StockStatusEmun.鍙嶆嫞鍏ュ簱.ObjToInt())
+ if (stockInfo.StockStatus == StockStatusEmun.鍙嶆嫞鍏ュ簱.ObjToInt())
{
newTask.TaskType = TaskTypeEnum.ReverseIn.ObjToInt();
}
- if(stockInfo.StockStatus == StockStatusEmun.鐩樼偣搴撳瓨瀹屾垚.ObjToInt())
+ if (stockInfo.StockStatus == StockStatusEmun.鐩樼偣搴撳瓨瀹屾垚.ObjToInt())
{
newTask.TaskType = TaskTypeEnum.InInventory.ObjToInt();
}
@@ -173,16 +172,38 @@
}
_stockRepository.StockInfoRepository.UpdateData(stockInfo);
_locationInfoService.UpdateData(locationInfo);
-
+
_unitOfWorkManage.CommitTran();
WMSTaskDTO wMSTaskDTO = _mapper.Map<WMSTaskDTO>(newTask);
- //PushTasksToWCS(new List<Dt_Task> { newTask });
+ PushTasksToWCS(new List<Dt_Task> { newTask });
return WebResponseContent.Instance.OK(data: wMSTaskDTO);
}
catch (Exception ex)
{
_unitOfWorkManage.RollbackTran();
+ return WebResponseContent.Instance.Error(ex.Message);
+ }
+ }
+
+ /// <summary>
+ /// 杩斿洖鍏ュ簱浠撳簱
+ /// </summary>
+ /// <returns></returns>
+ public WebResponseContent ApplyLocation(string palletCode)
+ {
+ try
+ {
+ Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == palletCode).Includes(x => x.Details).First();
+
+ if (stockInfo == null)
+ {
+ return WebResponseContent.Instance.Error($"鏈壘鍒扮粍鐩樹俊鎭�");
+ }
+ return WebResponseContent.Instance.OK(data:stockInfo.WarehouseId);
+ }
+ catch (Exception ex)
+ {
return WebResponseContent.Instance.Error(ex.Message);
}
}
@@ -253,8 +274,7 @@
Dt_Task task = Repository.QueryFirst(x => x.PalletCode == palletCode);
if (task != null)
{
- PushTasksToWCS(new List<Dt_Task> { task });
- return WebResponseContent.Instance.OK($"璇ユ墭鐩樺凡鐢熸垚浠诲姟", _mapper.Map<WMSTaskDTO>(task));
+ return WebResponseContent.Instance.Error($"璇ユ墭鐩榹palletCode}宸茬敓鎴愪换鍔�");
}
// 鑾峰彇鍏ュ簱鍗曟槑缁�
var inboundOrderDet = GetInboundOrderDetail(palletCode);
--
Gitblit v1.9.3