From 5fc251a847ccc0540da8b112ed2bddba846455d8 Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期一, 17 十一月 2025 20:39:49 +0800
Subject: [PATCH] 提交
---
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs | 61 +++++++++++++++++++++++++-----
1 files changed, 51 insertions(+), 10 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 596284c..27d5101 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,7 +108,7 @@
_outStockLockInfoService = outStockLockInfoService;
}
-
+
/// <summary>
///
/// </summary>
@@ -119,6 +119,7 @@
try
{
Dt_Task task;
+
if (int.TryParse(taskNum, out var newTaskNum))
{
task = BaseDal.QueryFirst(x => x.TaskNum == newTaskNum);
@@ -131,6 +132,7 @@
{
return WebResponseContent.Instance.Error("鏈壘鍒颁换鍔′俊鎭�");
}
+ _logger.LogInformation($"TaskService TaskCompleted: {JsonConvert.SerializeObject(task)} , {task.TaskType} ");
MethodInfo? methodInfo = GetType().GetMethod(((TaskTypeEnum)task.TaskType) + "TaskCompleted");
if (methodInfo != null)
@@ -145,6 +147,7 @@
}
catch (Exception ex)
{
+ _logger.LogError($"TaskService TaskCompleted: {ex.Message} ");
return WebResponseContent.Instance.Error(ex.Message);
}
}
@@ -260,15 +263,15 @@
};
- 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,
+ // warehouseCode= "1072",
unit = group.Key.BarcodeUnit,
barcodes = group.Select(row => new FeedbackBarcodesModel
{
@@ -277,20 +280,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)
{
@@ -344,14 +378,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($"鏈壘鍒版墭鐩樺搴旂殑搴撳瓨淇℃伅");
@@ -363,7 +403,7 @@
return content.Error($"鏈壘鍒板搴旂殑缁堢偣璐т綅淇℃伅");
}
-
+
int beforeStatus = locationInfo.LocationStatus;
locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt();
@@ -383,13 +423,14 @@
}
catch (Exception ex)
{
+ _logger.LogError($"TaskService OutEmptyTaskCompleted: {ex.Message} ");
return await Task.FromResult(WebResponseContent.Instance.Error(ex.Message));
}
}
-
+
/// <summary>
/// 鍥炲簱瀹屾垚鍥炶皟
public async Task<WebResponseContent> BackToStockComplete(Dt_Task task)
@@ -471,7 +512,7 @@
// 鏇存柊浠诲姟鐘舵�佷负宸插畬鎴�
task.TaskStatus = (int)TaskStatusEnum.Finish;
-
+
await Db.Updateable(task).ExecuteCommandAsync();
_unitOfWorkManage.CommitTran();
--
Gitblit v1.9.3