From f69d1c71f7a7c278b4fc68cd069e3c023bbb9be6 Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期二, 18 十一月 2025 11:31:48 +0800
Subject: [PATCH] 提交
---
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs | 60 +++++++++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 49 insertions(+), 11 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_TaskInfoService/TaskService.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_TaskInfoService/TaskService.cs"
index f772492..7bc7977 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_TaskInfoService/TaskService.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_TaskInfoService/TaskService.cs"
@@ -108,6 +108,7 @@
_outStockLockInfoService = outStockLockInfoService;
}
+
/// <summary>
///
/// </summary>
@@ -259,15 +260,16 @@
};
- var groupedData = inboundOrder.Details.GroupBy(item => new { item.MaterielCode, item.SupplyCode, item.BatchNo, item.lineNo, item.BarcodeUnit, item.WarehouseCode})
+ var groupedData = inboundOrder.Details.GroupBy(item => new { item.MaterielCode, item.SupplyCode, item.BatchNo, item.lineNo, item.BarcodeUnit, item.WarehouseCode })
.Select(group => new FeedbackInboundDetailsModel
{
materialCode = group.Key.MaterielCode,
supplyCode = group.Key.SupplyCode,
batchNo = group.Key.BatchNo,
lineNo = group.Key.lineNo,
- warehouseCode = group.Key.WarehouseCode ,
- // warehouseCode= "1072",
+ warehouseCode = group.Key.WarehouseCode,
+ qty=group.Sum(x=>x.BarcodeQty),
+ // warehouseCode= "1072",
unit = group.Key.BarcodeUnit,
barcodes = group.Select(row => new FeedbackBarcodesModel
{
@@ -276,20 +278,51 @@
}).ToList()
}).ToList();
feedmodel.details = groupedData;
-
+
_invokeMESService.FeedbackInbound(feedmodel);
}
}
}
- catch (Exception ex) {
+ catch (Exception ex)
+ {
_logger.LogInformation("InboundTaskCompleted 鍥炲啓MES澶辫触: " + ex.Message);
}
return WebResponseContent.Instance.OK();
}
+ public WebResponseContent OutboundTaskCompleted(Dt_Task task)
+ {
+ _logger.LogInformation($"TaskService OutboundTaskCompleted: {task.TaskNum}");
+ //鏌ヨ揣浣�
+ Dt_LocationInfo locationInfo = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress);
+ if (locationInfo == null)
+ {
+ return WebResponseContent.Instance.Error($"鏈壘鍒板搴旂殑缁堢偣璐т綅淇℃伅");
+ }
+ locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt();
+ _locationInfoService.Repository.UpdateData(locationInfo);
+ var outloks = _outStockLockInfoService.Db.Queryable<Dt_OutStockLockInfo>().Where(x => x.TaskNum == task.TaskNum).ToList();
+ outloks.ForEach(o =>
+ {
+ o.Status = OutLockStockStatusEnum.宸插嚭搴�.ObjToInt();
+ });
+ _outStockLockInfoService.Db.Updateable(outloks).ExecuteCommand();
+
+ var locationCodes = outloks.Select(it => it.LocationCode).Distinct().ToList();
+
+ //_stockRepository.Db.Updateable<Dt_StockInfo>()
+ // .SetColumns(it => new Dt_StockInfo { StockStatus = StockStatusEmun.})
+ // .Where(it => locationCodes.Contains(it.LocationCode))
+ // .ExecuteCommand();
+
+
+ return WebResponseContent.Instance.OK();
+
+
+ }
public async Task<WebResponseContent> InEmptyTaskCompleted(Dt_Task task)
{
@@ -343,14 +376,20 @@
}
}
+ public WebResponseContent InPickTaskCompleted(Dt_Task task)
+ {
+ _logger.LogInformation($"TaskService InPickTaskCompleted: {task.TaskNum}");
+
+ return WebResponseContent.Instance.OK();
+ }
public async Task<WebResponseContent> OutEmptyTaskCompleted(Dt_Task task)
{
WebResponseContent content = new WebResponseContent();
try
{
- Dt_StockInfo stockInfo = _stockRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == task.PalletCode ).First();
+ Dt_StockInfo stockInfo = _stockRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == task.PalletCode).First();
if (stockInfo == null)
{
return WebResponseContent.Instance.Error($"鏈壘鍒版墭鐩樺搴旂殑搴撳瓨淇℃伅");
@@ -362,7 +401,6 @@
return content.Error($"鏈壘鍒板搴旂殑缁堢偣璐т綅淇℃伅");
}
- _stockRepository.Db.Deleteable(stockInfo).ExecuteCommand();
int beforeStatus = locationInfo.LocationStatus;
@@ -374,6 +412,7 @@
task.TaskStatus = TaskStatusEnum.Finish.ObjToInt();
BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);
_stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);
+ _stockRepository.Db.Deleteable(stockInfo).ExecuteCommand();
_locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Outbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum);
@@ -388,10 +427,9 @@
-
+
/// <summary>
- /// 鍥炲簱瀹屾垚鍥炶皟 - AGV灏嗘墭鐩樻斁鍥炶揣浣嶅悗璋冪敤
- /// </summary>
+ /// 鍥炲簱瀹屾垚鍥炶皟
public async Task<WebResponseContent> BackToStockComplete(Dt_Task task)
{
try
@@ -471,7 +509,7 @@
// 鏇存柊浠诲姟鐘舵�佷负宸插畬鎴�
task.TaskStatus = (int)TaskStatusEnum.Finish;
-
+
await Db.Updateable(task).ExecuteCommandAsync();
_unitOfWorkManage.CommitTran();
--
Gitblit v1.9.3