| | |
| | | using System.Net.Http.Headers; |
| | | using System.Security.Policy; |
| | | using Newtonsoft.Json; |
| | | using WIDESEA_Core.LogHelper; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "1.0 ", ""); |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(palletCode); |
| | | //Logger.Write_Log("System/test_in", "", "1.1 ", ""); |
| | | (bool, string) result = CheckRequestInbound(stationCode, palletCode, true, stockInfo); |
| | | //Logger.Write_Log("System/test_in", "", "1.2 ", ""); |
| | | if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2); |
| | | //Logger.Write_Log("System/test_in", "", "1.3 ", ""); |
| | | content = AssignLocUpdateData(stationCode, TaskTypeEnum.Inbound.ObjToInt(), palletCode, true, stockInfo); |
| | | //Logger.Write_Log("System/test_in", "", "1.4 ", ""); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | //Logger.Write_Log("System/test_in", "", "2.0 "); |
| | | _unitOfWorkManage.BeginTran(); |
| | | Dt_LocationInfo? locationInfo = _basicService.LocationInfoService.AssignLocation(stationCode, taskType,palletCode); |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "2.1 "); |
| | | if (locationInfo != null) |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "2.2 "); |
| | | List<Dt_Task> tasks = new List<Dt_Task>(); |
| | | Dt_Task task = new() |
| | | { |
| | |
| | | BaseDal.AddData(task); |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "2.3 "); |
| | | if (isUpdateStock) |
| | | { |
| | | //Logger.Write_Log("System/test_in", "", "2.3.1 "); |
| | | locationInfo.LocationStatus = LocationStatusEnum.Lock.ObjToInt(); |
| | | if (locationInfo.Depth == 2) |
| | | { |
| | | //Logger.Write_Log("System/test_in", "", "2.3.1.1 "); |
| | | _basicService.LocationInfoService.UpdateLocationLock(locationInfo, task.TaskNum, StockChangeType.Inbound.ObjToInt(), false); |
| | | } |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "2.3.1.2 "); |
| | | if (stockInfo != null && stockInfo.Details != null && stockInfo.Details.Count > 0) |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "2.3.1.3 "); |
| | | orderNo = stockInfo.Details.FirstOrDefault()?.OrderNo ?? ""; |
| | | |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(); |
| | |
| | | } |
| | | else |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "2.3.1.4 "); |
| | | return content = WebResponseContent.Instance.Error("æªæ¾å°åºåä¿¡æ¯"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //Logger.Write_Log("System/test_in", "", "2.3.2 "); |
| | | locationInfo.LocationStatus = LocationStatusEnum.PalletLock.ObjToInt(); |
| | | if (locationInfo.Depth == 2) |
| | | { |
| | |
| | | } |
| | | task.Grade = 1; |
| | | } |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "2.4 "); |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | |
| | | tasks.Add(task); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), orderNo, task.TaskNum); |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "2.5 "); |
| | | var response = HttpHelper.Post<WebResponseContent>(url + "ReceiveTask/", tasks, "å
¥åºä»»å¡ä¸å"); |
| | | if (!response.Status) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content = WebResponseContent.Instance.Error($"{response.Message}"); |
| | | } |
| | | |
| | | _unitOfWorkManage.CommitTran(); |
| | | |
| | | //Logger.Write_Log("System/test_in", "", "2.6 "); |
| | | return content = WebResponseContent.Instance.OK(); |
| | | |
| | | } |
| | | return content = WebResponseContent.Instance.Error("æªæ¾å°å¯åé
è´§ä½"); |
| | | } |