From a9b3ce04ed59794b648db00bc85001a4fb96c932 Mon Sep 17 00:00:00 2001
From: hutongqing <hutongqing@hnkhzn.com>
Date: 星期二, 24 十二月 2024 15:29:03 +0800
Subject: [PATCH] 分拣接口、货位分配及移库任务完成
---
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_CSJ.cs | 22 +-
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/CommonEnum/PalletTypeEnum.cs | 6
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService_Pick.cs | 51 +++++
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutStockLockInfoController.cs | 9
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Reloaction.cs | 75 +++++++-
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_RecordService/Service/StockQuantityChangeRecordService.cs | 38 ++++
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/cf601b15-8665-4e91-bf55-55e9b66ed6a7.vsidx | 0
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_GM.cs | 2
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs | 2
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/LocationEnum/LocationStatusEnum.cs | 12 +
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 29 ++
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Completed.cs | 38 ++++
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/52d14652-9578-4d37-be69-82ece695e359.vsidx | 0
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutStockLockInfoService.cs | 7
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs | 152 +++++++++++++---
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_ZH.cs | 2
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs | 11 +
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs | 6
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/6dfb708c-1dce-481d-8fd0-9391b26c11ff.vsidx | 0
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_PP.cs | 2
/dev/null | 0
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/3391ef1a-b377-4e97-8ef2-e56d3ee99c44.vsidx | 0
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IRecordService/IStockQuantityChangeRecordService.cs | 2
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/APIEnum/APIEnum.cs | 6
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/ILocationInfoService.cs | 2
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs | 15 +
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/9a102d22-50b2-4a33-9ca7-fb3c6c8dea03.vsidx | 0
27 files changed, 409 insertions(+), 80 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/671f6735-50dc-4160-a801-1403c5554dc0.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/671f6735-50dc-4160-a801-1403c5554dc0.vsidx"
deleted file mode 100644
index e5ce690..0000000
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/671f6735-50dc-4160-a801-1403c5554dc0.vsidx"
+++ /dev/null
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/6dfb708c-1dce-481d-8fd0-9391b26c11ff.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/6dfb708c-1dce-481d-8fd0-9391b26c11ff.vsidx"
new file mode 100644
index 0000000..5481cd1
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/6dfb708c-1dce-481d-8fd0-9391b26c11ff.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/APIEnum/APIEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/APIEnum/APIEnum.cs"
index 589a379..102375d 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/APIEnum/APIEnum.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/APIEnum/APIEnum.cs"
@@ -12,6 +12,10 @@
[Description("AGV鍙戦�佷换鍔℃帴鍙�")]
AgvSendTask,
[Description("AGV瀹夊叏淇″彿鍥炲")]
- AgvSecureReply
+ AgvSecureReply,
+
+ FeedBackWMSTaskCompleted,
+
+ UploadWMSTaskStatus
}
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
index ed090e0..7021a70 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
@@ -87,8 +87,6 @@
}
-
-
/// <summary>
/// 鎺ユ敹WMS浠诲姟淇℃伅
/// </summary>
@@ -112,23 +110,40 @@
task.Creater = "WMS";
task.TaskState = (int)TaskStatusEnum.New;
task.CurrentAddress = item.SourceAddress;
- task.NextAddress = item.TargetAddress;
List<Dt_WarehouseDevice> wades = warehouseDevices.Where(x => x.WarehouseId == item.WarehouseId).ToList();
+
+ Dt_Router? router = new Dt_Router();
if (string.IsNullOrEmpty(item.AGVArea))
{
Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == item.SourceAddress || x.StackerCraneCode == item.RoadWay);
-
- //stationManger.AGVStationCode
- //stationManger.StackerCraneCode
- //stationManger.StationDeviceCode
+ if (stationManger == null)
+ {
+ return WebResponseContent.Instance.Error($"鏈壘鍒扮珯鍙伴厤缃俊鎭�");
+ }
List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && (stationManger.StationDeviceCode == x.StartPosi || stationManger.StackerCraneCode == x.StartPosi));
+ if (routers.FirstOrDefault() == null)
+ {
+ return WebResponseContent.Instance.Error($"鏈壘鍒拌矾鐢遍厤缃俊鎭�");
+ }
+ router = routers.FirstOrDefault();
+ if (routers.Count == 1)
+ {
+ task.NextAddress = router?.NextPosi ?? "";
+ }
}
else
{
List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && item.AGVArea == x.StartPosi);
+ if (routers.FirstOrDefault() == null)
+ {
+ return WebResponseContent.Instance.Error($"鏈壘鍒拌矾鐢遍厤缃俊鎭�");
+ }
+ router = routers.FirstOrDefault();
+
+ task.NextAddress = router?.NextPosi ?? "";
}
tasks.Add(task);
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/3391ef1a-b377-4e97-8ef2-e56d3ee99c44.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/3391ef1a-b377-4e97-8ef2-e56d3ee99c44.vsidx"
new file mode 100644
index 0000000..0517ea6
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/3391ef1a-b377-4e97-8ef2-e56d3ee99c44.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/52d14652-9578-4d37-be69-82ece695e359.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/52d14652-9578-4d37-be69-82ece695e359.vsidx"
new file mode 100644
index 0000000..b9fd08a
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/52d14652-9578-4d37-be69-82ece695e359.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/9a102d22-50b2-4a33-9ca7-fb3c6c8dea03.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/9a102d22-50b2-4a33-9ca7-fb3c6c8dea03.vsidx"
new file mode 100644
index 0000000..ffeaaa1
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/9a102d22-50b2-4a33-9ca7-fb3c6c8dea03.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/b0fe0eb0-0200-46f6-a7cd-e7eceefa6c9f.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/b0fe0eb0-0200-46f6-a7cd-e7eceefa6c9f.vsidx"
deleted file mode 100644
index ef77587..0000000
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/b0fe0eb0-0200-46f6-a7cd-e7eceefa6c9f.vsidx"
+++ /dev/null
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/cf601b15-8665-4e91-bf55-55e9b66ed6a7.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/cf601b15-8665-4e91-bf55-55e9b66ed6a7.vsidx"
new file mode 100644
index 0000000..70aef67
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/cf601b15-8665-4e91-bf55-55e9b66ed6a7.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/fc937dfc-f65e-4bef-aaa4-717ebb3be43e.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/fc937dfc-f65e-4bef-aaa4-717ebb3be43e.vsidx"
deleted file mode 100644
index 73a307b..0000000
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/fc937dfc-f65e-4bef-aaa4-717ebb3be43e.vsidx"
+++ /dev/null
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs"
index 9a147d6..9c037f2 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs"
@@ -87,7 +87,6 @@
Dt_LocationInfo? locationInfo = GetUsableLocation_BC(locationInfos, undefinedTypeEmptyLocation, palletType);
if (locationInfo != null)
{
- UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3);
locationCaches_BC.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
return locationInfo;
}
@@ -101,7 +100,6 @@
Dt_LocationInfo? locationInfo = GetUsableLocation_BC(locationInfos, definedTypeEmptyLocation, palletType);
if (locationInfo != null)
{
- UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3);
locationCaches_BC.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
return locationInfo;
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_CSJ.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_CSJ.cs"
index 3533316..ac15f3f 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_CSJ.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_CSJ.cs"
@@ -24,21 +24,21 @@
/// <summary>
/// 娴嬭瘯鏋朵粨璐т綅鍒嗛厤 <br/>
/// 鎵樼洏绫诲瀷锛� <br/>
- /// 1锛氭渶闀� <br/>
- /// 2锛氶暱 <br/>
- /// 3锛氫腑绛� <br/>
- /// 4锛氱煭 <br/>
- /// 3鍜�4閮芥槸3娣憋紝涓斿彲浠ユ贩鏀俱�� <br/>
- /// 1鍜�2閮芥槸2娣憋紝涓斿彲浠ユ贩鏀俱�� <br/>
+ /// 1锛氱煭 <br/>
+ /// 2锛氫腑绛� <br/>
+ /// 3锛氶暱 <br/>
+ /// 4锛氱壒闀� <br/>
+ /// 1鍜�2閮芥槸3娣憋紝涓斿彲浠ユ贩鏀俱�� <br/>
+ /// 3鍜�4閮芥槸2娣憋紝涓斿彲浠ユ贩鏀俱�� <br/>
/// 绉诲簱鏃跺彧鑳芥槸鍚屼晶璐т綅銆�
/// </summary>
/// <param name="roadwayNo">宸烽亾鍙�</param>
/// <param name="palletType">
/// 鎵樼洏绫诲瀷 <br/>
- /// 1锛氭渶闀� <br/>
- /// 2锛氶暱 <br/>
- /// 3锛氫腑绛� <br/>
- /// 4锛氱煭
+ /// 1锛氱煭 <br/>
+ /// 2锛氫腑绛� <br/>
+ /// 3锛氶暱 <br/>
+ /// 4锛氱壒闀�
/// </param>
/// <returns></returns>
public Dt_LocationInfo? AssignLocation_CSJ(string roadwayNo, PalletTypeEnum palletType, string beRelocationCode = "")
@@ -99,7 +99,6 @@
Dt_LocationInfo? locationInfo = GetUsableLocation_CSJ(locationInfos, undefinedTypeEmptyLocation, palletType);
if (locationInfo != null)
{
- UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3);
locationCaches_CSJ.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
return locationInfo;
}
@@ -113,7 +112,6 @@
Dt_LocationInfo? locationInfo = GetUsableLocation_CSJ(locationInfos, definedTypeEmptyLocation, palletType);
if (locationInfo != null)
{
- UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3);
locationCaches_CSJ.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
return locationInfo;
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_GM.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_GM.cs"
index 6e1254e..3fedb80 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_GM.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_GM.cs"
@@ -87,7 +87,6 @@
Dt_LocationInfo? locationInfo = GetUsableLocation_GM(locationInfos, undefinedTypeEmptyLocation, palletType);
if (locationInfo != null)
{
- UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3);
locationCaches_GM.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
return locationInfo;
}
@@ -101,7 +100,6 @@
Dt_LocationInfo? locationInfo = GetUsableLocation_GM(locationInfos, definedTypeEmptyLocation, palletType);
if (locationInfo != null)
{
- UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3);
locationCaches_GM.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
return locationInfo;
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_PP.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_PP.cs"
index 99d093f..0eac5f3 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_PP.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_PP.cs"
@@ -87,7 +87,6 @@
Dt_LocationInfo? locationInfo = GetUsableLocation_PP(locationInfos, undefinedTypeEmptyLocation, palletType);
if (locationInfo != null)
{
- UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3);
locationCaches_PP.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
return locationInfo;
}
@@ -101,7 +100,6 @@
Dt_LocationInfo? locationInfo = GetUsableLocation_PP(locationInfos, definedTypeEmptyLocation, palletType);
if (locationInfo != null)
{
- UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3);
locationCaches_PP.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
return locationInfo;
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_ZH.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_ZH.cs"
index 9715b79..e0e812b 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_ZH.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_ZH.cs"
@@ -87,7 +87,6 @@
Dt_LocationInfo? locationInfo = GetUsableLocation_ZH(locationInfos, undefinedTypeEmptyLocation, palletType);
if (locationInfo != null)
{
- UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3);
locationCaches_ZH.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
return locationInfo;
}
@@ -101,7 +100,6 @@
Dt_LocationInfo? locationInfo = GetUsableLocation_ZH(locationInfos, definedTypeEmptyLocation, palletType);
if (locationInfo != null)
{
- UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3);
locationCaches_ZH.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
return locationInfo;
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs"
index 146b0b7..3cd8b9c 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs"
@@ -45,27 +45,27 @@
};
}
- public bool LittleDepthLocationIsEmpty(Dt_LocationInfo locationInfo, PalletTypeEnum palletType)
- {
- Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == locationInfo.WarehouseId);
- if (warehouse == null)
- {
- throw new Exception($"鏈壘鍒颁粨搴撲俊鎭�");
- }
+ //public bool LittleDepthLocationIsEmpty(Dt_LocationInfo locationInfo, PalletTypeEnum palletType)
+ //{
+ // Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == locationInfo.WarehouseId);
+ // if (warehouse == null)
+ // {
+ // throw new Exception($"鏈壘鍒颁粨搴撲俊鎭�");
+ // }
- return warehouse.WarehouseName switch
- {
- "鏉挎潗浠�" => false,
- "PP浠�" => false,
- "骞茶啘浠�" => false,
- "娴嬭瘯鏋朵粨" => LittleDepthLocationIsEmpty_CSJ(locationInfo, palletType),
- "闃荤剨浠�" => false,
- "娌瑰ⅷ浠�" => true,
- "鎴愬搧浠�" => true,
- "杈呮枡浠�" => true,
- _ => throw new Exception($"鏈壘鍒颁粨搴撹揣浣嶅垎閰嶆柟娉�")
- };
- }
+ // return warehouse.WarehouseName switch
+ // {
+ // "鏉挎潗浠�" => false,
+ // "PP浠�" => false,
+ // "骞茶啘浠�" => false,
+ // "娴嬭瘯鏋朵粨" => LittleDepthLocationIsEmpty_CSJ(locationInfo, palletType),
+ // "闃荤剨浠�" => false,
+ // "娌瑰ⅷ浠�" => true,
+ // "鎴愬搧浠�" => true,
+ // "杈呮枡浠�" => true,
+ // _ => throw new Exception($"鏈壘鍒颁粨搴撹揣浣嶅垎閰嶆柟娉�")
+ // };
+ //}
private readonly static object _locker = new object();
private static List<LocationCache> locationCaches = new List<LocationCache>();
@@ -132,8 +132,40 @@
{
for (int i = 0; i < locations.Count; i++)
{
- locations[i].LocationStatus = locationStatus.ObjToInt();
- locations[i].LocationType = palletType.ObjToInt();
+ if (locations[i].LocationType != palletType.ObjToInt())
+ {
+ locations[i].LocationType = palletType.ObjToInt();
+ }
+
+ if (locations[i].LocationCode == location.LocationCode)
+ {
+ locations[i].LocationStatus = locationStatus.ObjToInt();
+ }
+ else
+ {
+ if (locationStatus == LocationStatusEnum.Lock)
+ {
+ if (locations[i].LocationStatus == LocationStatusEnum.InStock.ObjToInt())
+ {
+ locations[i].LocationStatus = LocationStatusEnum.InStockLock.ObjToInt();
+ }
+ else if (locations[i].LocationStatus == LocationStatusEnum.Free.ObjToInt())
+ {
+ locations[i].LocationStatus = LocationStatusEnum.FreeLock.ObjToInt();
+ }
+ }
+ else if (locationStatus == LocationStatusEnum.Free || locationStatus == LocationStatusEnum.InStock)
+ {
+ if (locations[i].LocationStatus == LocationStatusEnum.InStockLock.ObjToInt())
+ {
+ locations[i].LocationStatus = LocationStatusEnum.InStock.ObjToInt();
+ }
+ else if (locations[i].LocationStatus == LocationStatusEnum.FreeLock.ObjToInt())
+ {
+ locations[i].LocationStatus = LocationStatusEnum.Free.ObjToInt();
+ }
+ }
+ }
}
Dt_LocationInfo? nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Column == location.Column + 1);
@@ -142,11 +174,44 @@
List<Dt_LocationInfo> nearLocations = GetGroupLocations(locationInfos, nearLocation);
for (int i = 0; i < nearLocations.Count; i++)
{
- nearLocations[i].LocationType = palletType.ObjToInt();
- if (palletType == PalletTypeEnum.LargePallet)
+ if (nearLocations[i].LocationType != palletType.ObjToInt())
{
- nearLocations[i].LocationStatus = locationStatus.ObjToInt();
+ nearLocations[i].LocationType = palletType.ObjToInt();
}
+
+ if (palletType.ObjToInt() >= PalletTypeEnum.LargePallet.ObjToInt())
+ {
+ if (nearLocations[i].LocationCode == nearLocation.LocationCode)
+ {
+ nearLocations[i].LocationStatus = locationStatus.ObjToInt();
+ }
+ else
+ {
+ if (locationStatus == LocationStatusEnum.Lock)
+ {
+ if (nearLocations[i].LocationStatus == LocationStatusEnum.InStock.ObjToInt())
+ {
+ nearLocations[i].LocationStatus = LocationStatusEnum.InStockLock.ObjToInt();
+ }
+ else if (nearLocations[i].LocationStatus == LocationStatusEnum.Free.ObjToInt())
+ {
+ nearLocations[i].LocationStatus = LocationStatusEnum.FreeLock.ObjToInt();
+ }
+ }
+ else if (locationStatus == LocationStatusEnum.Free || locationStatus == LocationStatusEnum.InStock)
+ {
+ if (nearLocations[i].LocationStatus == LocationStatusEnum.InStockLock.ObjToInt())
+ {
+ nearLocations[i].LocationStatus = LocationStatusEnum.InStock.ObjToInt();
+ }
+ else if (nearLocations[i].LocationStatus == LocationStatusEnum.FreeLock.ObjToInt())
+ {
+ nearLocations[i].LocationStatus = LocationStatusEnum.Free.ObjToInt();
+ }
+ }
+ }
+ }
+
}
locations.AddRange(nearLocations);
}
@@ -155,13 +220,46 @@
{
for (int i = 0; i < locations.Count; i++)
{
- locations[i].LocationStatus = locationStatus.ObjToInt();
- locations[i].LocationType = palletType.ObjToInt();
+ if (locations[i].LocationCode == location.LocationCode)
+ {
+ locations[i].LocationStatus = locationStatus.ObjToInt();
+ }
+ else
+ {
+ if (locationStatus == LocationStatusEnum.Lock)
+ {
+ if (locations[i].LocationStatus == LocationStatusEnum.InStock.ObjToInt())
+ {
+ locations[i].LocationStatus = LocationStatusEnum.InStockLock.ObjToInt();
+ }
+ else if (locations[i].LocationStatus == LocationStatusEnum.Free.ObjToInt())
+ {
+ locations[i].LocationStatus = LocationStatusEnum.FreeLock.ObjToInt();
+ }
+ }
+ else if (locationStatus == LocationStatusEnum.Free || locationStatus == LocationStatusEnum.InStock)
+ {
+ if (locations[i].LocationStatus == LocationStatusEnum.InStockLock.ObjToInt())
+ {
+ locations[i].LocationStatus = LocationStatusEnum.InStock.ObjToInt();
+ }
+ else if (locations[i].LocationStatus == LocationStatusEnum.FreeLock.ObjToInt())
+ {
+ locations[i].LocationStatus = LocationStatusEnum.Free.ObjToInt();
+ }
+ }
+ }
+ if (locations[i].LocationType != palletType.ObjToInt())
+ {
+ locations[i].LocationType = palletType.ObjToInt();
+ }
}
}
Repository.UpdateData(locations);
}
+
+
/// <summary>
/// 鑾峰彇涓嶅悓娣卞害鐨勫悓缁勮揣浣嶄俊鎭�
/// </summary>
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/CommonEnum/PalletTypeEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/CommonEnum/PalletTypeEnum.cs"
index aee9c69..acd2a2b 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/CommonEnum/PalletTypeEnum.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/CommonEnum/PalletTypeEnum.cs"
@@ -8,15 +8,17 @@
{
public enum PalletTypeEnum
{
+ None = 0,
+
/// <summary>
/// 灏忔墭鐩�
/// </summary>
- SmallPallet = 1,
+ SmallPallet = 1,
/// <summary>
/// 涓墭鐩�
/// </summary>
- MediumPallet = 2,
+ MediumPallet = 2,
/// <summary>
/// 澶ф墭鐩�
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/LocationEnum/LocationStatusEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/LocationEnum/LocationStatusEnum.cs"
index 123091b..dd54520 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/LocationEnum/LocationStatusEnum.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/LocationEnum/LocationStatusEnum.cs"
@@ -24,6 +24,18 @@
Lock = 1,
/// <summary>
+ /// 鏈夎揣閿佸畾
+ /// </summary>
+ [Description("鏈夎揣閿佸畾")]
+ InStockLock = 10,
+
+ /// <summary>
+ ///
+ /// </summary>
+ [Description("绌洪棽閿佸畾")]
+ FreeLock = 20,
+
+ /// <summary>
/// 鏈夎揣
/// </summary>
[Description("鏈夎揣")]
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/ILocationInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/ILocationInfoService.cs"
index 1e79cc9..a03995e 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/ILocationInfoService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/ILocationInfoService.cs"
@@ -89,6 +89,6 @@
/// <param name="locationInfo">璐т綅淇℃伅</param>
/// <param name="palletType">鎵樼洏绫诲瀷</param>
/// <returns></returns>
- bool LittleDepthLocationIsEmpty(Dt_LocationInfo locationInfo, PalletTypeEnum palletType);
+ //bool LittleDepthLocationIsEmpty(Dt_LocationInfo locationInfo, PalletTypeEnum palletType);
}
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutStockLockInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutStockLockInfoService.cs"
index 3898b49..58c2951 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutStockLockInfoService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutStockLockInfoService.cs"
@@ -22,5 +22,12 @@
List<Dt_OutStockLockInfo> GetByOrderDetailId(int orderDetailId, OutLockStockStatusEnum outStockStatus);
List<Dt_OutStockLockInfo> GetStockOutboundOrder(SaveModel saveModel);
+
+ /// <summary>
+ /// 鍒嗘嫞
+ /// </summary>
+ /// <param name="palletCode">鎵樼洏鍙�</param>
+ /// <returns></returns>
+ WebResponseContent MaterialPick(string palletCode);
}
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IRecordService/IStockQuantityChangeRecordService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IRecordService/IStockQuantityChangeRecordService.cs"
index 8550885..2630049 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IRecordService/IStockQuantityChangeRecordService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IRecordService/IStockQuantityChangeRecordService.cs"
@@ -16,5 +16,7 @@
IStockQuantityChangeRecordRepository Repository { get; }
void AddStockChangeRecord(Dt_StockInfo stockInfo, List<Dt_StockInfoDetail> stockInfoDetails, float beforeQuantity, float totalQuantity, StockChangeTypeEnum changeType, int? taskNum = null);
+
+ void AddStockChangeRecord(Dt_StockInfo stockInfo, List<Dt_StockInfoDetail> updateDetails, List<Dt_StockInfoDetail> deleteDetails, StockChangeTypeEnum changeType, int? taskNum = null);
}
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs"
index a2c4d72..ba14fef 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs"
@@ -9,16 +9,25 @@
using WIDESEA_Core.Enums;
using WIDESEA_Core.Helper;
using WIDESEA_IOutboundRepository;
+using WIDESEA_IRecordService;
+using WIDESEA_IStockService;
using WIDESEA_Model.Models;
namespace WIDESEA_IOutboundService
{
public partial class OutStockLockInfoService : ServiceBase<Dt_OutStockLockInfo, IOutStockLockInfoRepository>, IOutStockLockInfoService
{
+
+ private readonly IStockService _stockService;
+ private readonly IRecordService _recordService;
+
public IOutStockLockInfoRepository Repository => BaseDal;
- public OutStockLockInfoService(IOutStockLockInfoRepository BaseDal) : base(BaseDal)
+
+ public OutStockLockInfoService(IOutStockLockInfoRepository BaseDal, IStockService stockService, IRecordService recordService) : base(BaseDal)
{
+ _recordService = recordService;
+ _stockService = stockService;
}
public List<Dt_OutStockLockInfo> GetOutStockLockInfos(Dt_OutboundOrder outboundOrder, Dt_OutboundOrderDetail outboundOrderDetail, List<Dt_StockInfo> outStocks, int? taskNum = null)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService_Pick.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService_Pick.cs"
index d682cdc..e5e22ed 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService_Pick.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService_Pick.cs"
@@ -9,15 +9,20 @@
using WIDESEA_Core.Enums;
using WIDESEA_Core.Helper;
using WIDESEA_IOutboundRepository;
+using WIDESEA_IRecordService;
using WIDESEA_IStockService;
using WIDESEA_Model.Models;
namespace WIDESEA_IOutboundService
{
- public partial class OutStockLockInfoService : ServiceBase<Dt_OutStockLockInfo, IOutStockLockInfoRepository>, IOutStockLockInfoService
+ public partial class OutStockLockInfoService
{
- IStockService _stockService;
+ /// <summary>
+ /// 鍒嗘嫞
+ /// </summary>
+ /// <param name="palletCode">鎵樼洏鍙�</param>
+ /// <returns></returns>
public WebResponseContent MaterialPick(string palletCode)
{
try
@@ -27,16 +32,50 @@
{
return WebResponseContent.Instance.Error($"鏈壘鍒拌鎵樼洏搴撳瓨淇℃伅");
}
+ if (stockInfo.StockStatus != StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt())
+ {
+ return WebResponseContent.Instance.Error($"璇ユ墭鐩樿繕鏈嚭搴撳畬鎴�");
+ }
List<Dt_OutStockLockInfo> outStockLockInfos = Repository.QueryData(x => x.PalletCode == palletCode);
for (int i = 0; i < outStockLockInfos.Count; i++)
{
- float assignQuantity = outStockLockInfos[i].AssignQuantity;
- List<Dt_StockInfoDetail> stockInfoDetails = stockInfo.Details.Where(x => x.MaterielCode == outStockLockInfos[i].MaterielCode).ToList();
- for (int j = 0; j < stockInfoDetails.Count; j++)
+ outStockLockInfos[i].Status = OutLockStockStatusEnum.鍑哄簱瀹屾垚.ObjToInt();
+ }
+ List<Dt_StockInfoDetail> beforeDetaile = stockInfo.Details.GroupBy(x => x.MaterielCode).Select(x => new Dt_StockInfoDetail { MaterielCode = x.Key, StockQuantity = x.Sum(v => v.StockQuantity) }).ToList();
+
+ List<Dt_StockInfoDetail> updateDetailList = new List<Dt_StockInfoDetail>();
+ List<Dt_StockInfoDetail> deleteDetailList = new List<Dt_StockInfoDetail>();
+ for (int i = 0; i < stockInfo.Details.Count; i++)
+ {
+ if (stockInfo.Details[i].OutboundQuantity > 0)
{
- // if(assignQuantity > stockInfoDetails[j])
+ if (stockInfo.Details[i].StockQuantity > stockInfo.Details[i].OutboundQuantity)
+ {
+ stockInfo.Details[i].StockQuantity -= stockInfo.Details[i].OutboundQuantity;
+ updateDetailList.Add(stockInfo.Details[i]);
+ }
+ else
+ {
+ deleteDetailList.Add(stockInfo.Details[i]);
+ }
}
}
+
+ List<string> mCodes = stockInfo.Details.GroupBy(x => x.MaterielCode).Select(x => x.Key).ToList();
+ foreach (string code in mCodes)
+ {
+ _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, updateDetailList, deleteDetailList, StockChangeTypeEnum.Outbound);
+ }
+
+ updateDetailList.ForEach(x =>
+ {
+ x.OutboundQuantity = 0;
+ });
+
+ //_stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(deleteDetailList, OperateTypeEnum.鑷姩瀹屾垚);
+ _stockService.StockInfoDetailService.Repository.UpdateData(updateDetailList);
+ BaseDal.UpdateData(outStockLockInfos);
+
return WebResponseContent.Instance.OK();
}
catch (Exception ex)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_RecordService/Service/StockQuantityChangeRecordService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_RecordService/Service/StockQuantityChangeRecordService.cs"
index be97eb1..fd0185e 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_RecordService/Service/StockQuantityChangeRecordService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_RecordService/Service/StockQuantityChangeRecordService.cs"
@@ -44,6 +44,7 @@
x.ChangeType = changeType.ObjToInt();
beforeQuantity += x.ChangeQuantity;
x.TaskNum = taskNum;
+ index++;
});
BaseDal.AddData(stockQuantityChangeRecords);
}
@@ -52,5 +53,42 @@
throw new Exception(ex.Message);
}
}
+
+ public void AddStockChangeRecord(Dt_StockInfo stockInfo, List<Dt_StockInfoDetail> updateDetails, List<Dt_StockInfoDetail> deleteDetails, StockChangeTypeEnum changeType, int? taskNum = null)
+ {
+ try
+ {
+ List<Dt_StockQuantityChangeRecord> stockQuantityChangeRecords = new List<Dt_StockQuantityChangeRecord>();
+
+ int index1 = 0;
+ List<Dt_StockQuantityChangeRecord> records1 = _mapper.Map<List<Dt_StockQuantityChangeRecord>>(updateDetails);
+ records1.ForEach(x =>
+ {
+ x.PalleCode = stockInfo.PalletCode;
+ x.BeforeQuantity = deleteDetails[index1].StockQuantity + deleteDetails[index1].OutboundQuantity;
+ x.ChangeQuantity = -deleteDetails[index1].OutboundQuantity;
+ x.AfterQuantity = deleteDetails[index1].StockQuantity;
+ index1++;
+ });
+ stockQuantityChangeRecords.AddRange(records1);
+ int index2 = 0;
+ List<Dt_StockQuantityChangeRecord> records2 = _mapper.Map<List<Dt_StockQuantityChangeRecord>>(deleteDetails);
+ records2.ForEach(x =>
+ {
+ x.PalleCode = stockInfo.PalletCode;
+ x.BeforeQuantity = deleteDetails[index2].StockQuantity;
+ x.ChangeQuantity = -deleteDetails[index2].StockQuantity;
+ x.AfterQuantity = 0;
+ index2++;
+ });
+ stockQuantityChangeRecords.AddRange(records2);
+
+ BaseDal.AddData(stockQuantityChangeRecords);
+ }
+ catch (Exception ex)
+ {
+ throw new Exception(ex.Message);
+ }
+ }
}
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
index 008afe2..bc617ce 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
@@ -92,7 +92,7 @@
/// 浠诲姟淇℃伅鎺ㄩ�佽嚦WCS
/// </summary>
/// <returns></returns>
- public WebResponseContent PushTasksToWCS(List<Dt_Task> tasks, string agvDescription="")
+ public WebResponseContent PushTasksToWCS(List<Dt_Task> tasks, string agvDescription = "")
{
try
{
@@ -179,7 +179,7 @@
_unitOfWorkManage.BeginTran();
BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.浜哄伐瀹屾垚 : OperateTypeEnum.鑷姩瀹屾垚);
- _basicService.LocationInfoService.Repository.UpdateData(locationInfo);
+ _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, (PalletTypeEnum)stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId);
_stockRepository.StockInfoRepository.UpdateData(stockInfo);
_stockRepository.StockInfoDetailRepository.UpdateData(stockInfo.Details);
@@ -252,7 +252,7 @@
int beforeStatus = locationInfo.LocationStatus;
locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt();
- _basicService.LocationInfoService.Repository.UpdateData(locationInfo);
+ _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, (PalletTypeEnum)stockInfo.PalletType, LocationStatusEnum.Free, stockInfo.WarehouseId);
BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);
_recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, (LocationStatusEnum)beforeStatus, LocationChangeType.OutboundCompleted, stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum);
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Completed.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Completed.cs"
new file mode 100644
index 0000000..5d4650e
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Completed.cs"
@@ -0,0 +1,38 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Common.CommonEnum;
+using WIDESEA_Common.LocationEnum;
+using WIDESEA_Common.OtherEnum;
+using WIDESEA_Common.StockEnum;
+using WIDESEA_Common.TaskEnum;
+using WIDESEA_Core;
+using WIDESEA_Core.Helper;
+using WIDESEA_DTO.Task;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_TaskInfoService
+{
+ public partial class TaskService
+ {
+ //public WebResponseContent TaskCompleted(int taskNum)
+ //{
+ // try
+ // {
+ // Dt_Task task = Repository.QueryFirst(x => x.TaskNum == taskNum);
+ // if (task == null)
+ // {
+ // return WebResponseContent.Instance.Error($"鏈壘鍒颁换鍔′俊鎭�");
+ // }
+ // if(task.TaskType.get)
+
+ // }
+ // catch (Exception ex)
+ // {
+ // return WebResponseContent.Instance.Error(ex.Message);
+ // }
+ //}
+ }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Reloaction.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Reloaction.cs"
index e0ae17a..bcc8769 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Reloaction.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Reloaction.cs"
@@ -17,6 +17,12 @@
{
public partial class TaskService
{
+ /// <summary>
+ /// 鍒ゆ柇鏄惁闇�瑕佺Щ搴�
+ /// </summary>
+ /// <param name="taskNum"></param>
+ /// <param name="locationCode"></param>
+ /// <returns></returns>
public WebResponseContent IsRelocation(int taskNum, string locationCode)
{
try
@@ -32,19 +38,29 @@
return WebResponseContent.Instance.Error($"鏈壘鍒颁换鍔′俊鎭�");
}
- if (!_basicService.LocationInfoService.LittleDepthLocationIsEmpty(locationInfo, (PalletTypeEnum)task.PalletType))
+ List<Dt_LocationInfo> littleDepthLocations = _basicService.LocationInfoService.GetGroupLocations(locationInfo);
+
+ Dt_LocationInfo? needRelocationItem = littleDepthLocations.Where(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && x.LocationStatus != LocationStatusEnum.PalletLock.ObjToInt() && x.LocationStatus != LocationStatusEnum.FreeLock.ObjToInt() && x.Depth < locationInfo.Depth).OrderBy(x => x.Depth).FirstOrDefault();
+
+ if (needRelocationItem == null)
{
return WebResponseContent.Instance.OK(data: _mapper.Map<WMSTaskDTO>(task));
}
else
{
- Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.LocationCode == locationCode);
+ Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.LocationCode == needRelocationItem.LocationCode);
if (stockInfo == null)
{
return WebResponseContent.Instance.Error($"鏈壘鍒板搴旇揣浣嶇殑搴撳瓨淇℃伅");
}
- Dt_LocationInfo? newLocation = _basicService.LocationInfoService.AssignLocation(task.Roadway, (PalletTypeEnum)task.PalletType, task.WarehouseId);
+ Dt_Task taskTemp = Repository.QueryFirst(x => x.PalletCode == stockInfo.PalletCode);
+ if (taskTemp != null)
+ {
+ return WebResponseContent.Instance.OK(data: taskTemp);
+ }
+
+ Dt_LocationInfo? newLocation = _basicService.LocationInfoService.AssignLocation(needRelocationItem.RoadwayNo, (PalletTypeEnum)task.PalletType, task.WarehouseId);
if (newLocation != null)
{
Dt_Task newTask = new Dt_Task()
@@ -57,7 +73,7 @@
OrderNo = "",
PalletCode = stockInfo.PalletCode,
PalletType = stockInfo.PalletType,
- SourceAddress = locationCode,
+ SourceAddress = needRelocationItem.LocationCode,
TargetAddress = newLocation.LocationCode,
TaskNum = Repository.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
TaskStatus = 0,
@@ -68,20 +84,18 @@
Repository.AddData(newTask);
{
LocationStatusEnum lastStatus = (LocationStatusEnum)newLocation.LocationStatus;
- newLocation.LocationStatus = LocationStatusEnum.Lock.ObjToInt();
_basicService.LocationInfoService.UpdateLocationStatus(newLocation, (PalletTypeEnum)task.PalletType, LocationStatusEnum.Lock, stockInfo.WarehouseId);
- _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, lastStatus, LocationChangeType.RelocationAssignLocation, taskNum: newTask.TaskNum);
+ _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(newLocation, lastStatus, LocationChangeType.RelocationAssignLocation, taskNum: newTask.TaskNum);
}
{
- LocationStatusEnum lastStatus = (LocationStatusEnum)locationInfo.LocationStatus;
- locationInfo.LocationStatus = LocationStatusEnum.Lock.ObjToInt();
- _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, (PalletTypeEnum)task.PalletType, LocationStatusEnum.Lock, stockInfo.WarehouseId);
- _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, lastStatus, LocationChangeType.RelocationAssignLocation, taskNum: newTask.TaskNum);
+ LocationStatusEnum lastStatus = (LocationStatusEnum)needRelocationItem.LocationStatus;
+ _basicService.LocationInfoService.UpdateLocationStatus(needRelocationItem, (PalletTypeEnum)task.PalletType, LocationStatusEnum.Lock, stockInfo.WarehouseId);
+ _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(needRelocationItem, lastStatus, LocationChangeType.RelocationAssignLocation, taskNum: newTask.TaskNum);
}
stockInfo.StockStatus = StockStatusEmun.绉诲簱閿佸畾.ObjToInt();
_stockRepository.StockInfoRepository.UpdateData(stockInfo);
- _unitOfWorkManage.RollbackTran();
+ _unitOfWorkManage.CommitTran();
return WebResponseContent.Instance.OK(data: _mapper.Map<WMSTaskDTO>(newTask));
}
@@ -93,6 +107,45 @@
}
catch (Exception ex)
{
+ _unitOfWorkManage.RollbackTran();
+ return WebResponseContent.Instance.Error(ex.Message);
+ }
+ }
+
+ public WebResponseContent RelocationTaskCompleted(Dt_Task task)
+ {
+ try
+ {
+ Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress);
+ if (stockInfo == null)
+ {
+ return WebResponseContent.Instance.Error($"鏈壘鍒板搴旇揣浣嶇殑搴撳瓨淇℃伅");
+ }
+
+ Dt_LocationInfo locationInfoStart = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress);
+ if (locationInfoStart == null)
+ {
+ return WebResponseContent.Instance.Error($"鏈壘鍒板搴旂殑璧风偣璐т綅淇℃伅");
+ }
+
+ Dt_LocationInfo locationInfoEnd = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress);
+ if (locationInfoEnd == null)
+ {
+ return WebResponseContent.Instance.Error($"鏈壘鍒板搴旂殑缁堢偣璐т綅淇℃伅");
+ }
+
+ _unitOfWorkManage.BeginTran();
+ stockInfo.LocationCode = locationInfoEnd.LocationCode;
+ _stockService.StockInfoService.Repository.UpdateData(stockInfo);
+ _basicService.LocationInfoService.UpdateLocationStatus(locationInfoStart, (PalletTypeEnum)stockInfo.PalletType, LocationStatusEnum.Free, stockInfo.WarehouseId);
+ _basicService.LocationInfoService.UpdateLocationStatus(locationInfoEnd, (PalletTypeEnum)stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId);
+ BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.浜哄伐瀹屾垚 : WIDESEA_Core.Enums.OperateTypeEnum.鑷姩瀹屾垚);
+ _unitOfWorkManage.CommitTran();
+ return WebResponseContent.Instance.OK();
+ }
+ catch (Exception ex)
+ {
+ _unitOfWorkManage.RollbackTran();
return WebResponseContent.Instance.Error(ex.Message);
}
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs"
index f98e93f..97aa6e5 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs"
@@ -4,6 +4,7 @@
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using WIDESEA_Common.CommonEnum;
+using WIDESEA_Common.LocationEnum;
using WIDESEA_Core;
using WIDESEA_Core.BaseController;
using WIDESEA_Core.Enums;
@@ -68,5 +69,19 @@
{
return Service.LocationDisableStatus(keys); ;
}
+
+ [HttpPost, Route("UpdateLocationStatus"), AllowAnonymous]
+ public WebResponseContent UpdateLocationStatus(string locationCode, PalletTypeEnum palletType, LocationStatusEnum locationStatus, int warehousId)
+ {
+ try
+ {
+ Service.UpdateLocationStatus(locationCode, palletType, locationStatus, warehousId);
+ return WebResponseContent.Instance.OK();
+ }
+ catch (Exception e)
+ {
+ return WebResponseContent.Instance.Error(e.Message);
+ }
+ }
}
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutStockLockInfoController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutStockLockInfoController.cs"
index 22a25d5..29dec73 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutStockLockInfoController.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutStockLockInfoController.cs"
@@ -1,4 +1,5 @@
-锘縰sing Microsoft.AspNetCore.Http;
+锘縰sing Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WIDESEA_Core;
using WIDESEA_Core.BaseController;
@@ -25,5 +26,11 @@
{
return Service.GetStockOutboundOrder(saveModel);
}
+
+ [HttpPost, HttpGet, Route("MaterialPick"), AllowAnonymous]
+ public WebResponseContent MaterialPick(string palletCode)
+ {
+ return Service.MaterialPick(palletCode);
+ }
}
}
--
Gitblit v1.9.3