From ce40df5daffae0d17b4e9fa7cb6d677afaa4d66f Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期五, 17 十月 2025 11:20:30 +0800
Subject: [PATCH] 更新最新程序,ERP代码,MES代码等

---
 项目代码/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Reloaction.cs |  186 +++++++++++++++++++++++-----------------------
 1 files changed, 93 insertions(+), 93 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Reloaction.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Reloaction.cs"
index ac1e206..309e5c9 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Reloaction.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Reloaction.cs"
@@ -27,109 +27,109 @@
         /// <param name="taskNum"></param>
         /// <param name="locationCode"></param>
         /// <returns></returns>
-        public WebResponseContent IsRelocation(int taskNum, string locationCode)
-        {
-            try
-            {
-                Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == locationCode);
-                if (locationInfo == null)
-                {
-                    return WebResponseContent.Instance.Error($"鏈壘鍒板搴旂殑璐т綅淇℃伅");
-                }
+        //public WebResponseContent IsRelocation(int taskNum, string locationCode)
+        //{
+        //    try
+        //    {
+        //        Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == locationCode);
+        //        if (locationInfo == null)
+        //        {
+        //            return WebResponseContent.Instance.Error($"鏈壘鍒板搴旂殑璐т綅淇℃伅");
+        //        }
 
-                Dt_Task task = Repository.QueryFirst(x => x.TaskNum == taskNum);
-                if (task == null)
-                {
-                    return WebResponseContent.Instance.Error($"鏈壘鍒颁换鍔′俊鎭�");
-                }
+        //        Dt_Task task = Repository.QueryFirst(x => x.TaskNum == taskNum);
+        //        if (task == null)
+        //        {
+        //            return WebResponseContent.Instance.Error($"鏈壘鍒颁换鍔′俊鎭�");
+        //        }
 
-                List<Dt_LocationInfo> littleDepthLocations = _basicService.LocationInfoService.GetGroupLocations(locationInfo);
+        //        List<Dt_LocationInfo> littleDepthLocations = _basicService.LocationInfoService.GetGroupLocations(locationInfo);
 
-                Dt_LocationInfo? needRelocationItem = littleDepthLocations.Where(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && x.LocationStatus != LocationStatusEnum.FreeLock.ObjToInt() && x.Depth < locationInfo.Depth).OrderBy(x => x.Depth).FirstOrDefault();
+        //        Dt_LocationInfo? needRelocationItem = littleDepthLocations.Where(x => x.LocationStatus != LocationStatusEnum.Free.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 == needRelocationItem.LocationCode);
-                    if (stockInfo == null)
-                    {
-                        return WebResponseContent.Instance.Error($"鏈壘鍒板搴旇揣浣嶇殑搴撳瓨淇℃伅");
-                    }
+        //        if (needRelocationItem == null)
+        //        {
+        //            return WebResponseContent.Instance.OK(data: _mapper.Map<WMSTaskDTO>(task));
+        //        }
+        //        else
+        //        {
+        //            Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.LocationCode == needRelocationItem.LocationCode);
+        //            if (stockInfo == null)
+        //            {
+        //                return WebResponseContent.Instance.Error($"鏈壘鍒板搴旇揣浣嶇殑搴撳瓨淇℃伅");
+        //            }
 
-                    Dt_Task taskTemp = Repository.QueryFirst(x => x.PalletCode == stockInfo.PalletCode);
-                    if (taskTemp != null)
-                    {
-                        return WebResponseContent.Instance.OK(data: _mapper.Map<WMSTaskDTO>(taskTemp));
-                    }
+        //            Dt_Task taskTemp = Repository.QueryFirst(x => x.PalletCode == stockInfo.PalletCode);
+        //            if (taskTemp != null)
+        //            {
+        //                return WebResponseContent.Instance.OK(data: _mapper.Map<WMSTaskDTO>(taskTemp));
+        //            }
 
-                    int heightType = 0;
-                    if(needRelocationItem.Layer == 5)
-                    {
-                        heightType = 3;
-                    }
-                    else if(needRelocationItem.Layer == 4)
-                    {
-                        heightType = 2;
-                    }
-                    else if(needRelocationItem.Layer <= 3 && needRelocationItem.Layer >= 1)
-                    {
-                        heightType = 1;
-                    }
+        //            int heightType = 0;
+        //            if(needRelocationItem.Layer == 5)
+        //            {
+        //                heightType = 3;
+        //            }
+        //            else if(needRelocationItem.Layer == 4)
+        //            {
+        //                heightType = 2;
+        //            }
+        //            else if(needRelocationItem.Layer <= 3 && needRelocationItem.Layer >= 1)
+        //            {
+        //                heightType = 1;
+        //            }
 
-                    Dt_LocationInfo? newLocation = _basicService.LocationInfoService.AssignLocation(needRelocationItem.RoadwayNo, task.PalletType, task.WarehouseId, needRelocationItem.LocationCode, heightType);
-                    if (newLocation != null)
-                    {
-                        Dt_Task newTask = new Dt_Task()
-                        {
-                            Roadway = task.Roadway,
-                            WarehouseId = task.WarehouseId,
-                            CurrentAddress = locationCode,
-                            Grade = 99,
-                            NextAddress = newLocation.LocationCode,
-                            OrderNo = "",
-                            PalletCode = stockInfo.PalletCode,
-                            PalletType = stockInfo.PalletType,
-                            SourceAddress = needRelocationItem.LocationCode,
-                            TargetAddress = newLocation.LocationCode,
-                            TaskNum = Repository.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
-                            TaskStatus = 0,
-                            TaskType = TaskTypeEnum.Relocation.ObjToInt()
-                        };
+        //            Dt_LocationInfo? newLocation = _basicService.LocationInfoService.AssignLocation(needRelocationItem.RoadwayNo, task.PalletType, task.WarehouseId, needRelocationItem.LocationCode);
+        //            if (newLocation != null)
+        //            {
+        //                Dt_Task newTask = new Dt_Task()
+        //                {
+        //                    Roadway = task.Roadway,
+        //                    WarehouseId = task.WarehouseId,
+        //                    CurrentAddress = locationCode,
+        //                    Grade = 99,
+        //                    NextAddress = newLocation.LocationCode,
+        //                    OrderNo = "",
+        //                    PalletCode = stockInfo.PalletCode,
+        //                    PalletType = stockInfo.PalletType,
+        //                    SourceAddress = needRelocationItem.LocationCode,
+        //                    TargetAddress = newLocation.LocationCode,
+        //                    TaskNum = Repository.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
+        //                    TaskStatus = 0,
+        //                    TaskType = TaskTypeEnum.Relocation.ObjToInt()
+        //                };
 
-                        _unitOfWorkManage.BeginTran();
-                        Repository.AddData(newTask);
-                        {
-                            LocationStatusEnum lastStatus = (LocationStatusEnum)newLocation.LocationStatus;
-                            _basicService.LocationInfoService.UpdateLocationStatus(newLocation, task.PalletType, LocationStatusEnum.Lock, stockInfo.WarehouseId);
-                            _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(newLocation, lastStatus, LocationStatusEnum.Lock, LocationChangeType.RelocationAssignLocation, taskNum: newTask.TaskNum);
-                        }
-                        {
-                            LocationStatusEnum lastStatus = (LocationStatusEnum)needRelocationItem.LocationStatus;
-                            _basicService.LocationInfoService.UpdateLocationStatus(needRelocationItem, task.PalletType, LocationStatusEnum.Lock, stockInfo.WarehouseId);
-                            _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(needRelocationItem, lastStatus, LocationStatusEnum.Lock, LocationChangeType.RelocationAssignLocation, taskNum: newTask.TaskNum);
-                        }
-                        stockInfo.StockStatus = StockStatusEmun.绉诲簱閿佸畾.ObjToInt();
-                        _stockRepository.StockInfoRepository.UpdateData(stockInfo);
+        //                _unitOfWorkManage.BeginTran();
+        //                Repository.AddData(newTask);
+        //                {
+        //                    LocationStatusEnum lastStatus = (LocationStatusEnum)newLocation.LocationStatus;
+        //                    _basicService.LocationInfoService.UpdateLocationStatus(newLocation, task.PalletType, LocationStatusEnum.Lock, stockInfo.WarehouseId);
+        //                    _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(newLocation, lastStatus, LocationStatusEnum.Lock, LocationChangeType.RelocationAssignLocation, taskNum: newTask.TaskNum);
+        //                }
+        //                {
+        //                    LocationStatusEnum lastStatus = (LocationStatusEnum)needRelocationItem.LocationStatus;
+        //                    _basicService.LocationInfoService.UpdateLocationStatus(needRelocationItem, task.PalletType, LocationStatusEnum.Lock, stockInfo.WarehouseId);
+        //                    _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(needRelocationItem, lastStatus, LocationStatusEnum.Lock, LocationChangeType.RelocationAssignLocation, taskNum: newTask.TaskNum);
+        //                }
+        //                stockInfo.StockStatus = StockStatusEmun.绉诲簱閿佸畾.ObjToInt();
+        //                _stockRepository.StockInfoRepository.UpdateData(stockInfo);
 
-                        _unitOfWorkManage.CommitTran();
+        //                _unitOfWorkManage.CommitTran();
 
-                        return WebResponseContent.Instance.OK(data: _mapper.Map<WMSTaskDTO>(newTask));
-                    }
-                    else
-                    {
-                        return WebResponseContent.Instance.Error($"鏈壘鍒板彲鍒嗛厤璐т綅,璇锋煡鐪嬭宸烽亾銆恵task.Roadway}銆戞槸鍚﹁繕鏈夌┖闂插彲浣跨敤璐т綅");
-                    }
-                }
-            }
-            catch (Exception ex)
-            {
-                _unitOfWorkManage.RollbackTran();
-                return WebResponseContent.Instance.Error(ex.Message);
-            }
-        }
+        //                return WebResponseContent.Instance.OK(data: _mapper.Map<WMSTaskDTO>(newTask));
+        //            }
+        //            else
+        //            {
+        //                return WebResponseContent.Instance.Error($"鏈壘鍒板彲鍒嗛厤璐т綅,璇锋煡鐪嬭宸烽亾銆恵task.Roadway}銆戞槸鍚﹁繕鏈夌┖闂插彲浣跨敤璐т綅");
+        //            }
+        //        }
+        //    }
+        //    catch (Exception ex)
+        //    {
+        //        _unitOfWorkManage.RollbackTran();
+        //        return WebResponseContent.Instance.Error(ex.Message);
+        //    }
+        //}
         public WebResponseContent RelocationTaskCompleted(Dt_Task task)
         {
             try

--
Gitblit v1.9.3