From 07b56c461476f7d580318749b2cd5f752aa38f3a Mon Sep 17 00:00:00 2001
From: yangpeixing <yangpeixing@hnkhzn.com>
Date: 星期四, 11 十二月 2025 17:22:00 +0800
Subject: [PATCH] 1
---
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs | 77 ++++++++++++++++++++++++++++++--------
1 files changed, 61 insertions(+), 16 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs"
index 58e3923..d522407 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs"
@@ -17,6 +17,7 @@
using System.Reflection;
using System.Reflection.Metadata;
using System.Security.Policy;
+using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using WIDESEA_Cache;
@@ -350,16 +351,16 @@
Quantity = g.Sum(item => item.Quantity),
})
.ToList();
- return new DtStockInfo()
- {
- PalletCode = task.PalletCode,
- LocationCode = task.TargetAddress,
- CreateDate = DateTime.Now,
- Creater = "system",
- IsFullExit = boxingInfo.IsFullExit,
- StockInfoDetails = mergedDetails,
- StockStatus = (int)StockStateEmun.宸插叆搴�
- };
+ return new DtStockInfo()
+ {
+ PalletCode = task.PalletCode,
+ LocationCode = task.TargetAddress,
+ CreateDate = DateTime.Now,
+ Creater = "system",
+ IsFullExit = boxingInfo.IsFullExit,
+ StockInfoDetails = mergedDetails,
+ StockStatus = (int)StockStateEmun.宸插叆搴�
+ };
}
#endregion 鍏ュ簱浠诲姟瀹屾垚
@@ -508,6 +509,7 @@
case 4:
case 5:
case 6:
+ case 7:
taskNew = InboundAGVCacheArea(taskDto, StartAddress, area);
break;
default:
@@ -519,6 +521,12 @@
await _unitOfWorkManage.UseTranAsync(async () =>
{
+ if (taskDto.AreaId == 3 || taskDto.AreaId == 7)
+ {
+ var result2 = UpdateLocationStatus(taskNew.TargetAddress, LocationEnum.Lock, taskNew.TaskNum.Value, (int)StatusChangeTypeEnum.AutomaticInbound);
+ await _locationStatusChangeRecordRepository.AddDataAsync(result2.Item1);
+ await _locationRepository.UpdateDataAsync(result2.Item2);
+ }
await _locationStatusChangeRecordRepository.AddDataAsync(result.Item1);
await _locationRepository.UpdateDataAsync(result.Item2);
BaseDal.AddData(taskNew);
@@ -657,7 +665,7 @@
});
var taskDto = CreateListTaskDTO(taskNew);
- var result = GetlcoationState(taskNew, StatusChangeTypeEnum.AutomaticOutbound);
+ var result = GetlcoationState(taskNew, StatusChangeTypeEnum.AutomaticOutbound, location);
await _unitOfWorkManage.UseTranAsync(async () =>
{
await BaseDal.AddDataAsync(taskNew);
@@ -732,7 +740,7 @@
stock.StockInfoDetails = details;
var taskDto = CreateListTaskDTO(taskNew);
- var result = GetlcoationState(taskNew, StatusChangeTypeEnum.AutomaticOutbound);
+ var result = GetlcoationState(taskNew, StatusChangeTypeEnum.AutomaticOutbound, stock.LocationInfo);
await _unitOfWorkManage.UseTranAsync(async () =>
{
await BaseDal.AddDataAsync(taskNew);
@@ -815,7 +823,7 @@
stock.StockInfoDetails = details;
var taskDto = CreateListTaskDTO(taskNew);
- var result = GetlcoationState(taskNew, StatusChangeTypeEnum.AutomaticOutbound);
+ var result = GetlcoationState(taskNew, StatusChangeTypeEnum.AutomaticOutbound, stock.LocationInfo);
await _unitOfWorkManage.UseTranAsync(async () =>
{
await BaseDal.AddDataAsync(taskNew);
@@ -832,13 +840,20 @@
}
}
- public (List<DtLocationStatusChangeRecord>,List<DtLocationInfo>) GetlcoationState(Dt_Task task, StatusChangeTypeEnum StatusChangeTypeEnum)
+ public (List<DtLocationStatusChangeRecord>,List<DtLocationInfo>) GetlcoationState(Dt_Task task, StatusChangeTypeEnum StatusChangeTypeEnum, DtLocationInfo location)
{
List<DtLocationStatusChangeRecord> locationStatusChangeRecords = new List<DtLocationStatusChangeRecord>();
List<DtLocationInfo> locations = new List<DtLocationInfo>();
var result = UpdateLocationStatus(task.SourceAddress, LocationEnum.InStockDisable, task.TaskNum.Value, (int)StatusChangeTypeEnum);
locationStatusChangeRecords.AddRange(result.Item1);
locations.AddRange(result.Item2);
+
+ if(location.AreaId ==3|| location.AreaId == 7)
+ {
+ var result2 = UpdateLocationStatus(task.TargetAddress, LocationEnum.Lock, task.TaskNum.Value, (int)StatusChangeTypeEnum);
+ locationStatusChangeRecords.AddRange(result2.Item1);
+ locations.AddRange(result2.Item2);
+ }
return (locationStatusChangeRecords,locations);
}
@@ -886,6 +901,7 @@
case 4:
case 5:
case 6:
+ case 7:
return OutboundAGVCacheArea(taskDto, StartAddress, area);
default:
throw new Exception("璇烽�夋嫨姝g‘鐨勫尯鍩熶俊鎭�");
@@ -1244,6 +1260,7 @@
switch (location.AreaId)
{
case 2:
+ case 7:
locationInfos = _locationRepository.QueryData(x => x.Row == location.Row && x.Column > location.Column && x.Remark == location.Remark && x.AreaId == location.AreaId);
break;
case 5:
@@ -1379,6 +1396,7 @@
case 4:
case 5:
case 6:
+ case 7:
locationInfo = await GetAGVEmptyCacheLocation(areaInfo.AreaID, location);
break;
default:
@@ -1984,6 +2002,32 @@
return (changeRecordDto, locations);
}
+ public (DtLocationStatusChangeRecord, DtLocationInfo) UpdateEndLocationStatus(string locationCode, LocationEnum locationStatus, int taskNum, StatusChangeTypeEnum StatusChangeType)
+ {
+ var location = _locationRepository.QueryFirst(x => x.LocationCode == locationCode);
+
+ if (location != null && (location.AreaId == 3 || location.AreaId == 7))
+ {
+ int Beforelocation = location.LocationStatus;
+
+ location.LocationStatus = (int)locationStatus;
+
+ DtLocationStatusChangeRecord dtLocationStatusChangeRecord = new DtLocationStatusChangeRecord()
+ {
+ ChangeType = (int)StatusChangeType,
+ LocationCode = locationCode,
+ LocationId = location.Id,
+ Creater = "System",
+ TaskNum = taskNum,
+ AfterStatus = location.LocationStatus,
+ BeforeStatus = Beforelocation,
+ };
+
+ return (dtLocationStatusChangeRecord, location);
+ }
+ return (null, null);
+ }
+
public (DtLocationStatusChangeRecord, DtLocationInfo) UpdateLocationStatus(string locationCode, LocationEnum locationStatus, int taskNum, StatusChangeTypeEnum StatusChangeType)
{
var location = _locationRepository.QueryFirst(x => x.LocationCode == locationCode);
@@ -2020,7 +2064,7 @@
}
}
}
- else if (location.AreaId == 2)
+ else if (location.AreaId == 2 || location.AreaId == 7)
{
var locationLateral = _locationRepository.QueryData(x => x.Row == location.Row && x.Column > location.Column && x.Remark == location.Remark);
if (locationLateral.Count > 0)
@@ -2397,6 +2441,7 @@
switch (AreaId)
{
case 2:
+ case 7:
return await FromShallowToDeep(AreaId, loc);
case 3:
return await AGVLIKU(AreaId);
@@ -2528,7 +2573,7 @@
}
}
- else if (location.AreaId == 2)
+ else if (location.AreaId == 2 || location.AreaId == 7)
{
var locationLateral = _locationRepository.QueryData(x => x.Row == location.Row && x.Column > location.Column && x.Remark == location.Remark);
--
Gitblit v1.9.3