From aa201fcecc1ce93da4f660a833f7b1176fc037cb Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期二, 02 十二月 2025 18:04:54 +0800
Subject: [PATCH] 1
---
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs | 97 +++++++++++++-----------------------------------
1 files changed, 27 insertions(+), 70 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 e9f8f4b..a6376fd 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"
@@ -363,64 +363,6 @@
}
#endregion 鍏ュ簱浠诲姟瀹屾垚
- #region AGV鎼繍浠诲姟瀹屾垚
- public async Task<WebResponseContent> CompleteCarryTaskAsync(Dt_Task task,DtStockInfo stockInfo)
- {
- WebResponseContent content = new WebResponseContent();
- try
- {
- var Sourcelocation = await _locationRepository.QueryFirstAsync(x => x.LocationCode == task.SourceAddress);
- var Targetlocation = await _locationRepository.QueryFirstAsync(x => x.LocationCode == task.TargetAddress);
-
- //UpdateLocationStatus(Sourcelocation, LocationEnum.Free);
- //UpdateLocationStatus(Targetlocation, LocationEnum.InStock);
-
- task.TaskState = (int)TaskAGVCarryStatusEnum.CarryFinish;
- var taskHty = task.Adapt<Dt_Task_Hty>();
- taskHty.FinishTime = DateTime.Now;
- taskHty.OperateType = App.User.UserName != null ? (int)OperateTypeEnum.浜哄伐瀹屾垚 : (int)OperateTypeEnum.鑷姩瀹屾垚;
- taskHty.Creater = App.User.UserName != null ? App.User.UserName : "System";
- await _unitOfWorkManage.UseTranAsync(async () =>
- {
- await DeleteTaskAsync(task.TaskId);
- await AddTaskHtyAsync(taskHty);
- });
- }
- catch (Exception ex)
- {
- return content.Error(ex.Message);
- }
- return content;
- }
-
- #endregion
-
- #region AGV璺ㄦゼ灞備换鍔″畬鎴�
- public async Task<WebResponseContent> CompleteAcrossFloorTaskAsync(Dt_Task task, DtStockInfo stockInfo)
- {
- WebResponseContent content = new WebResponseContent();
- try
- {
- task.TaskState = (int)TaskAcrossFloorStatusEnum.CarryFinish;
- var taskHty = task.Adapt<Dt_Task_Hty>();
- taskHty.FinishTime = DateTime.Now;
- taskHty.OperateType = App.User.UserName != null ? (int)OperateTypeEnum.浜哄伐瀹屾垚 : (int)OperateTypeEnum.鑷姩瀹屾垚;
- taskHty.Creater = App.User.UserName != null ? App.User.UserName : "System";
- await _unitOfWorkManage.UseTranAsync(async () =>
- {
- await DeleteTaskAsync(task.TaskId);
- await AddTaskHtyAsync(taskHty);
- });
- }
- catch (Exception ex)
- {
- return content.Error(ex.Message);
- }
- return content;
- }
-
- #endregion
-
#region 浠诲姟瀹屾垚
/// <summary>
@@ -522,14 +464,14 @@
return content.Error("鎵樼洏淇℃伅涓嶅瓨鍦紝璇风‘璁ゆ墭鐩樺凡缁勭洏鎴愬姛");
}
- foreach (var item in boxingInfo.BoxingInfoDetails)
- {
- var ERPStock = SqlSugarHelper.DBERP.Queryable<鐢ㄥ弸鍗虫椂搴撳瓨_ST>().Where(x => x.瀛樺偍鍦扮偣鍚嶇О == item.Warehouse && x.鏂欏彿 == item.MaterielCode && x.鍝佸悕 == item.MaterielName && x.搴撳瓨鏁伴噺 >= item.Quantity).ToList().FirstOrDefault();
- if (ERPStock == null)
- {
- return content.Error($"缁勭洏鏁版嵁鏈湪ERP搴撳瓨鏁版嵁涓紝璇蜂汉宸ョ‘璁ゆ暟鎹槸鍚︽纭�");
- }
- }
+ //foreach (var item in boxingInfo.BoxingInfoDetails)
+ //{
+ // var ERPStock = SqlSugarHelper.DBERP.Queryable<鐢ㄥ弸鍗虫椂搴撳瓨_ST>().Where(x => x.瀛樺偍鍦扮偣鍚嶇О == item.Warehouse && x.鏂欏彿 == item.MaterielCode && x.鍝佸悕 == item.MaterielName && x.搴撳瓨鏁伴噺 >= item.Quantity).ToList().FirstOrDefault();
+ // if (ERPStock == null)
+ // {
+ // return content.Error($"缁勭洏鏁版嵁鏈湪ERP搴撳瓨鏁版嵁涓紝璇蜂汉宸ョ‘璁ゆ暟鎹槸鍚︽纭�");
+ // }
+ //}
var StartAddress = await _locationRepository.QueryFirstAsync(x => x.LocationCode == taskDto.Position);
if (StartAddress == null)
@@ -566,6 +508,7 @@
case 4:
case 5:
case 6:
+ case 7:
taskNew = InboundAGVCacheArea(taskDto, StartAddress, area);
break;
default:
@@ -672,7 +615,7 @@
/// </summary>
/// <param name="palletCode"></param>
/// <returns></returns>
- public async Task<WebResponseContent> OutBoundTaskAsync(string palletCode,string remark)
+ public async Task<WebResponseContent> OutBoundTaskAsync(string palletCode,string remark,int doubleTray)
{
WebResponseContent content = new WebResponseContent();
try
@@ -699,7 +642,7 @@
return content.Error("璇ユ墭鐩樺簱瀛樺凡鍦ㄥ嚭搴撶紦瀛樺尯");
}
- Dt_Task taskNew = await RequestOutboundTaskAsync(new RequestTaskDto { PalletCode = palletCode, AreaId = 2, Position = stcok.LocationCode, TaskType = (int)TaskOutboundTypeEnum.Outbound });
+ Dt_Task taskNew = await RequestOutboundTaskAsync(new RequestTaskDto { PalletCode = palletCode, AreaId = 2, Position = stcok.LocationCode, TaskType = (int)TaskOutboundTypeEnum.Outbound, DoubleTray= doubleTray });
List<Dt_InventoryRecord> records = new List<Dt_InventoryRecord>();
stcok.StockInfoDetails.ForEach(x =>
{
@@ -732,6 +675,12 @@
}
}
+
+ /// <summary>
+ /// 鍏朵粬鍑哄簱
+ /// </summary>
+ /// <param name="details"></param>
+ /// <returns></returns>
public async Task<WebResponseContent> OtherOutBoundTaskAsync(List<DtStockInfoDetail> details)
{
@@ -938,6 +887,7 @@
case 4:
case 5:
case 6:
+ case 7:
return OutboundAGVCacheArea(taskDto, StartAddress, area);
default:
throw new Exception("璇烽�夋嫨姝g‘鐨勫尯鍩熶俊鎭�");
@@ -1149,6 +1099,7 @@
Remark = StartAddress.AreaId.ToString(),
AGVTaskNum = GenerateUniqueId(),
Floor = StartAddress.Floor,
+ DoubleTray = taskDto.DoubleTray,
};
}
@@ -1295,6 +1246,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:
@@ -1430,6 +1382,7 @@
case 4:
case 5:
case 6:
+ case 7:
locationInfo = await GetAGVEmptyCacheLocation(areaInfo.AreaID, location);
break;
default:
@@ -2071,7 +2024,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)
@@ -2109,6 +2062,7 @@
TaskType = task.TaskType,
Floor =task.Floor,
AGVTaskNum = task.AGVTaskNum,
+ DoubleTray = task.DoubleTray,
} };
}
@@ -2128,6 +2082,7 @@
AGVTaskNum = task.AGVTaskNum,
Remark = task.Remark,
Floor = task.Floor,
+ DoubleTray = task.DoubleTray,
};
}
private List<WMSTaskDTO> CreateTaskDTO(List<Dt_Task> task)
@@ -2149,6 +2104,7 @@
AGVTaskNum = item.AGVTaskNum,
Remark = item.Remark,
Floor = item.Floor,
+ DoubleTray = item.DoubleTray,
});
}
@@ -2445,6 +2401,7 @@
switch (AreaId)
{
case 2:
+ case 7:
return await FromShallowToDeep(AreaId, loc);
case 3:
return await AGVLIKU(AreaId);
@@ -2576,7 +2533,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