From 32420f572c9e4d2f0c424214bc92f75e7dfe56f1 Mon Sep 17 00:00:00 2001
From: hutongqing <hutongqing@hnkhzn.com>
Date: 星期二, 14 一月 2025 09:01:37 +0800
Subject: [PATCH] 1
---
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs | 48 ++++++++++++++++++++++++++++++------------------
1 files changed, 30 insertions(+), 18 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
index 4b1835e..a654e01 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
@@ -112,7 +112,12 @@
{
x.AGVArea = agvDescription;
});
- string response = HttpHelper.Post("http://127.0.0.1:9291/api/Task/ReceiveTask", taskDTOs.Serialize());
+ string url = AppSettings.Get("WCS");
+ if (string.IsNullOrEmpty(url))
+ {
+ return WebResponseContent.Instance.Error($"鏈壘鍒癢CSApi鍦板潃,璇锋鏌ラ厤缃枃浠�");
+ }
+ string response = HttpHelper.Post($"{url}/api/Task/ReceiveTask", taskDTOs.Serialize());
return JsonConvert.DeserializeObject<WebResponseContent>(response) ?? WebResponseContent.Instance.Error("杩斿洖閿欒");
}
@@ -130,7 +135,12 @@
{
try
{
- string response = HttpHelper.Post("http://127.0.0.1:9281/api/CTU_AGV/PutFinish", code);
+ string url = AppSettings.Get("WCS");
+ if (string.IsNullOrEmpty(url))
+ {
+ return WebResponseContent.Instance.Error($"鏈壘鍒癢CSAApi鍦板潃,璇锋鏌ラ厤缃枃浠�");
+ }
+ string response = HttpHelper.Post($"{url}/api/CTU_AGV/PutFinish", code);
return JsonConvert.DeserializeObject<WebResponseContent>(response) ?? WebResponseContent.Instance.Error("杩斿洖閿欒");
}
@@ -188,11 +198,11 @@
stockInfo.LocationCode = locationInfo.LocationCode;
- #region 绌虹鍏ュ簱
- if (stockInfo.PalletType == PalletTypeEnum.Empty.ObjToInt())
+ #region 绌虹鍏ュ簱/鎷i�夊洖搴�
+ if (task.TaskType == TaskTypeEnum.InEmpty.ObjToInt() || task.TaskType == TaskTypeEnum.InPick.ObjToInt())
{
stockInfo.StockStatus = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt();
- task.TaskStatus = (int)TaskStatusEnum.Finish;
+ task.TaskStatus = TaskStatusEnum.Finish.ObjToInt();
_unitOfWorkManage.BeginTran();
BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.浜哄伐瀹屾垚 : OperateTypeEnum.鑷姩瀹屾垚);
_basicService.LocationInfoService.UpdateLocationStatus(locationInfo, stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId);
@@ -205,16 +215,13 @@
Dt_InboundOrder? inboundOrder = _inboundRepository.InboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Where(x => x.InboundOrderNo == stockInfo.Details.FirstOrDefault().OrderNo).Includes(x => x.Details).First();
List<Dt_InboundOrderDetail> inboundOrderDetails = new List<Dt_InboundOrderDetail>();
+ List<ERPInboundDetailModel> detailModels = new List<ERPInboundDetailModel>();
if (stockInfo.StockStatus == StockStatusEmun.鍏ュ簱纭.ObjToInt())
{
- //鎺ㄩ�佸叆搴撳畬鎴愮粰Erp
if (inboundOrder == null)
{
return WebResponseContent.Instance.Error($"瀵瑰簲鍏ュ簱鍗曚笉瀛樺湪");
}
-
- List<ERPInboundDetailModel> detailModels = new List<ERPInboundDetailModel>();
-
foreach (var item in stockInfo.Details)
{
Dt_InboundOrderDetail? inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.RowNo == item.InboundOrderRowNo);
@@ -251,10 +258,7 @@
{
inboundOrder.OrderStatus = InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt();
}
- if (!_inboundOrderService.FeedbackInboundOrder(stockInfo, inboundOrder, detailModels).Status)//todo 淇敼澶勭悊
- {
- return WebResponseContent.Instance.Error($"鍏ュ簱鍚屾Erp澶辫触");
- }
+
}
if ((stockInfo.StockStatus == StockStatusEmun.鍏ュ簱纭.ObjToInt() || stockInfo.StockStatus == StockStatusEmun.鎵嬪姩缁勭洏鍏ュ簱纭.ObjToInt()) && warehouse.WarehouseCode == WarehouseEnum.HA64.ToString())
@@ -294,6 +298,10 @@
_inboundRepository.InboundOrderRepository.UpdateData(inboundOrder);
}
_unitOfWorkManage.CommitTran();
+ if (stockInfo.StockStatus == StockStatusEmun.鍏ュ簱纭.ObjToInt())
+ {
+ _inboundOrderService.FeedbackInboundOrder(stockInfo, inboundOrder, detailModels);
+ }
return WebResponseContent.Instance.OK();
}
catch (Exception ex)
@@ -334,7 +342,7 @@
List<Dt_OutboundOrderDetail> outboundOrderDetails = new List<Dt_OutboundOrderDetail>();
List<Dt_MesOutboundOrder> mesOutboundOrders = new List<Dt_MesOutboundOrder>();
- if ((outStockLockInfos == null || outStockLockInfos.Count == 0) && warehouse.WarehouseCode != WarehouseEnum.HA64.ToString())
+ if ((outStockLockInfos == null || outStockLockInfos.Count == 0) && warehouse.WarehouseCode != WarehouseEnum.HA64.ToString() && task.TaskType != TaskTypeEnum.OutEmpty.ObjToInt())
{
return WebResponseContent.Instance.Error($"鏈壘鍒板嚭搴撹鎯呬俊鎭�");
}
@@ -344,7 +352,7 @@
{
if (task.TaskType == TaskTypeEnum.MesOutbound.ObjToInt())
{
- Dt_MesOutboundOrder mesOutboundOrder = _outboundService.MesOutboundOrderService.Repository.QueryFirst(x => x.Id == item.OrderDetailId);
+ Dt_MesOutboundOrder mesOutboundOrder = _outboundService.MesOutboundOrderService.Repository.QueryFirst(x => x.TaskNo == item.OrderNo);
if (mesOutboundOrder != null)
{
mesOutboundOrder.OverOutQuantity = item.AssignQuantity;
@@ -386,6 +394,11 @@
stockInfo.StockStatus = StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt();
_stockService.StockInfoService.Repository.UpdateData(stockInfo);
}
+ else if (task.TaskType == TaskTypeEnum.OutEmpty.ObjToInt())
+ {
+ _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, stockInfo.PalletType, LocationStatusEnum.Free, stockInfo.WarehouseId);
+ _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);
+ }
else if (task.TaskType == TaskTypeEnum.MesOutbound.ObjToInt())
{
_outboundService.MesOutboundOrderService.Repository.UpdateData(mesOutboundOrders);
@@ -405,13 +418,12 @@
if (warehouse.WarehouseCode != WarehouseEnum.HA64.ToString() && task.TaskType == TaskTypeEnum.Outbound.ObjToInt())
{
- _outboundService.OutboundOrderService.TestOutUpload(outboundOrderDetails.FirstOrDefault().Id, outStockLockInfos);
+ _outboundService.OutboundOrderService.TestOutUpload(outboundOrderDetails.FirstOrDefault().OrderId, outStockLockInfos);
}
if (task.TaskType == TaskTypeEnum.MesOutbound.ObjToInt())
{
MesMaterialLotaAceptModel model = GetMesMaterialLotaAceptModel(stockInfo, stockInfo.Details.FirstOrDefault(), mesOutboundOrders.FirstOrDefault().TaskNo, warehouse.WarehouseCode, mesOutboundOrders.FirstOrDefault().OrderQuantity);
-
- UploadMesMaterialLotaAcept(model);
+ UploadMesMaterialLotaAcept(model);
}
return WebResponseContent.Instance.OK();
}
--
Gitblit v1.9.3