From 9a886d711d8b21adc335fdf8c39350584c7ba6fd Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期二, 14 十月 2025 02:12:14 +0800
Subject: [PATCH] 更新代码,取消MES出库单号同步标识,平库转立库功能,寄售周期判断取消,精品标识等
---
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Reloaction.cs | 80 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 80 insertions(+), 0 deletions(-)
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 7319ce3..ce2efb9 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"
@@ -10,6 +10,7 @@
using WIDESEA_Common.TaskEnum;
using WIDESEA_Core;
using WIDESEA_Core.Helper;
+using WIDESEA_DTO.Basic;
using WIDESEA_DTO.Task;
using WIDESEA_Model.Models;
@@ -138,6 +139,84 @@
return WebResponseContent.Instance.Error(ex.Message);
}
}
+ /// <summary>
+ /// 鎵嬪姩绉诲簱
+ /// </summary>
+ /// <returns></returns>
+ public WebResponseContent ManualRelocation(RelocationDTO relocationDTO)
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == relocationDTO.warehouseId);
+ if (warehouse == null)
+ {
+ return content.Error($"鏈壘鍒板搴旂殑{relocationDTO.warehouseId}浠撳簱淇℃伅");
+ }
+ Dt_LocationInfo locationInfoStart = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == relocationDTO.locationStart && x.WarehouseId== warehouse.WarehouseId && x.RoadwayNo == relocationDTO.locationRoadway && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt());
+ Dt_LocationInfo locationInfoEnd = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == relocationDTO.locationEnd && x.WarehouseId == warehouse.WarehouseId && x.RoadwayNo== relocationDTO.locationRoadway && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus==EnableStatusEnum.Normal.ObjToInt());
+ if (locationInfoStart == null || locationInfoEnd==null)
+ {
+ return content.Error($"鏈壘鍒板搴旂殑璐т綅淇℃伅鎴栬捣鐐瑰強缁堢偣璐т綅鏉′欢涓嶆弧瓒�");
+ }
+ if (locationInfoStart.Column!= locationInfoEnd.Column || locationInfoStart.Layer != locationInfoEnd.Layer || locationInfoStart.Depth>= locationInfoEnd.Depth)
+ {
+ return content.Error($"璧风偣鍜岀粓鐐圭Щ搴撹揣浣嶉渶瑕佹弧瓒冲悓鍒楀悓灞傜粓鐐硅揣浣嶆繁浣嶉渶瑕佸ぇ浜庤捣鐐硅揣浣�");
+ }
+ Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.LocationCode == locationInfoStart.LocationCode);
+ if (stockInfo == null)
+ {
+ return content.Error($"鏈壘鍒板搴旇揣浣嶇殑搴撳瓨淇℃伅");
+ }
+
+ Dt_Task taskTemp = Repository.QueryFirst(x => x.PalletCode == stockInfo.PalletCode);
+ if (taskTemp != null)
+ {
+ return content.Error($"鎵樼洏{stockInfo.PalletCode}浠诲姟宸插瓨鍦�");
+ }
+ Dt_Task newTask = new Dt_Task()
+ {
+ Roadway = locationInfoStart.RoadwayNo,
+ WarehouseId = locationInfoStart.WarehouseId,
+ CurrentAddress = locationInfoStart.LocationCode,
+ Grade = 99,
+ NextAddress = locationInfoEnd.LocationCode,
+ OrderNo = "",
+ PalletCode = stockInfo.PalletCode,
+ PalletType = stockInfo.PalletType,
+ SourceAddress = locationInfoStart.LocationCode,
+ TargetAddress = locationInfoEnd.LocationCode,
+ TaskNum = Repository.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
+ TaskStatus = TaskStatusEnum.SC_Execute.ObjToInt(),
+ TaskType = TaskTypeEnum.Relocation.ObjToInt()
+ };
+
+ if (stockInfo.StockLength > 0)
+ {
+ newTask.TaskLength = stockInfo.StockLength;
+ }
+ _unitOfWorkManage.BeginTran();
+ Repository.AddData(newTask);
+ LocationStatusEnum lastStatusEnd = (LocationStatusEnum)locationInfoEnd.LocationStatus;
+ _basicService.LocationInfoService.UpdateLocationStatus(locationInfoEnd, newTask.PalletType, LocationStatusEnum.Lock, stockInfo.WarehouseId);
+ _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfoEnd, lastStatusEnd, LocationStatusEnum.Lock, LocationChangeType.RelocationAssignLocation, taskNum: newTask.TaskNum);
+
+ LocationStatusEnum lastStatusStart = (LocationStatusEnum)locationInfoStart.LocationStatus;
+ _basicService.LocationInfoService.UpdateLocationStatus(locationInfoStart, newTask.PalletType, LocationStatusEnum.Lock, stockInfo.WarehouseId);
+ _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfoStart, lastStatusStart, LocationStatusEnum.Lock, LocationChangeType.RelocationAssignLocation, taskNum: newTask.TaskNum);
+ stockInfo.StockStatus = StockStatusEmun.绉诲簱閿佸畾.ObjToInt();
+ _stockRepository.StockInfoRepository.UpdateData(stockInfo);
+ _unitOfWorkManage.CommitTran();
+ //鎺ㄩ�佷换鍔�
+ PushTasksToWCS(new List<Dt_Task> { newTask });
+ return content.OK(data: _mapper.Map<WMSTaskDTO>(newTask));
+ }
+ catch (Exception ex)
+ {
+ _unitOfWorkManage.RollbackTran();
+ return content.Error(ex.Message);
+ }
+ }
public WebResponseContent RelocationTaskCompleted(Dt_Task task)
{
@@ -170,6 +249,7 @@
_basicService.LocationInfoService.UpdateLocationStatus(locationInfoEnd, 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)
--
Gitblit v1.9.3