From a709afe7ba494808d923c3746c8edf1a3575977a Mon Sep 17 00:00:00 2001
From: wankeda <Administrator@DESKTOP-HAU3ST3>
Date: 星期四, 30 十月 2025 09:58:34 +0800
Subject: [PATCH] 代码提交
---
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs | 49 +++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 45 insertions(+), 4 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs"
index b7c8f5b..dc3ff0f 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs"
@@ -40,7 +40,46 @@
PushTasksToWCS(new List<Dt_Task> { task });
return WebResponseContent.Instance.OK($"璇ユ墭鐩樺凡鐢熸垚浠诲姟", _mapper.Map<WMSTaskDTO>(task));
}
+ if (Repository.QueryFirst(x => x.SourceAddress == stationCode && x.TaskStatus == TaskStatusEnum.New.ObjToInt()) != null)
+ {
+ return WebResponseContent.Instance.Error($"璇ョ珯鐐瑰凡鏈夋湭鎵ц鐨勪换鍔�");
+ }
+ //Dt_StockInfo stockInfo = _stockRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == palletCode).Includes(x => x.Details).First();
+ //if (stockInfo == null)
+ //{
+ // return WebResponseContent.Instance.Error($"鏈壘鍒扮粍鐩樹俊鎭�");
+ //}
+ //var details = stockInfo.Details.FirstOrDefault();
+ //if (!string.IsNullOrEmpty(stockInfo.LocationCode))
+ //{
+ // return WebResponseContent.Instance.Error($"璇ユ墭鐩樺凡缁戝畾璐т綅");
+ //}
+ Dt_RoadwayInfo roadwayInfo = _roadwayInforepository.QueryFirst(x => x.InStationCode == stationCode);
+ if (roadwayInfo == null)
+ {
+ return WebResponseContent.Instance.Error($"鏈壘鍒板垰鍏ュ簱绔欏彴鍦板潃");
+ }
+ Dt_Warehouse warehouse = _warehouseRepository.QueryFirst(x => x.WarehouseCode == roadwayInfo.RoadwayNo);
+ if (warehouse == null)
+ {
+ return WebResponseContent.Instance.Error("鏈壘鍒版敼浠撳簱");
+ }
+ Dt_LocationInfo? locationInfo = _basicService.LocationInfoService.AssignLocation(roadwayInfo.RoadwayNo, warehouse.WarehouseId, "");//
+ if (locationInfo == null)
+ {
+ return WebResponseContent.Instance.Error($"璐т綅鍒嗛厤澶辫触,鏈壘鍒板彲鍒嗛厤璐т綅");
+ }
+ var dt_Stock = new Dt_StockInfo
+ {
+ PalletCode = palletCode,
+ PalletType = 1,
+ LocationCode = locationInfo.LocationCode,
+ StockStatus = (int)StockStatusEmun.缁勭洏鏆傚瓨,
+ Creater = "WMS",
+ CreateDate = DateTime.Now,
+ WarehouseId = warehouse.WarehouseId,
+ };
Dt_Task newTask = new Dt_Task()
{
CurrentAddress = stationCode,
@@ -50,24 +89,26 @@
OrderNo = "1",
Roadway = "1",
SourceAddress = "",
- TargetAddress = "2-20-1",
+ TargetAddress = locationInfo.LocationCode,
TaskType = TaskTypeEnum.Inbound.ObjToInt(),
TaskStatus = TaskStatusEnum.New.ObjToInt(),
- WarehouseId = 1,
+ WarehouseId = warehouse.WarehouseId,
//PalletType = GetPalletType(warehouse, palletCode),//GetPalletType(warehouse, palletCode)
Creater = "WCS",
CreateDate = DateTime.Now
};
_unitOfWorkManage.BeginTran();
+ locationInfo.LocationStatus = LocationStatusEnum.Lock.ObjToInt();
int taskId = BaseDal.AddData(newTask);
newTask.TaskId = taskId;
+ _stockRepository.AddData(dt_Stock);
//_stockRepository.UpdateData(stockInfo);
- //_locationInfoRepository.UpdateData(locationInfo);
+ _locationInfoRepository.UpdateData(locationInfo);
_unitOfWorkManage.CommitTran();
WMSTaskDTO wMSTaskDTO = _mapper.Map<WMSTaskDTO>(newTask);
- //PushTasksToWCS(new List<Dt_Task> { newTask });
+ PushTasksToWCS(new List<Dt_Task> { newTask });
return WebResponseContent.Instance.OK(data: wMSTaskDTO);
}
catch (Exception ex)
--
Gitblit v1.9.3