| | |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_Core.Helper; |
| | | using Microsoft.Extensions.Logging; |
| | | using System.Net.Http.Headers; |
| | | using System.Security.Policy; |
| | | using Newtonsoft.Json; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | | public partial class TaskService |
| | | { |
| | | public string url = AppSettings.Configuration["WCS"]; |
| | | /// <summary> |
| | | /// PDAç³è¯·å
¥åº--å åæºç«åºå
¥åº |
| | | /// </summary> |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | _unitOfWorkManage.BeginTran(); |
| | | Dt_LocationInfo? locationInfo = _basicService.LocationInfoService.AssignLocation(stationCode, taskType); |
| | | //Dt_LocationInfo dt_LocationInfo = null; |
| | | if (locationInfo != null) |
| | |
| | | Dt_Task task = new() |
| | | { |
| | | CurrentAddress = stationCode, |
| | | Grade = 0, |
| | | Grade = 2, |
| | | PalletCode = palletCode, |
| | | NextAddress = locationInfo.LocationCode, |
| | | Roadway = locationInfo.RoadwayNo, |
| | |
| | | _basicService.LocationInfoService.UpdateLocationLock(locationInfo, task.TaskNum, StockChangeType.Inbound.ObjToInt(), false); |
| | | } |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | List<Dt_Task> tasks = new List<Dt_Task>(); |
| | | tasks.Add(task); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), orderNo, task.TaskNum); |
| | | |
| | | var response = HttpHelper.Post<WebResponseContent>(url + "ReceiveTask/", tasks, "å
¥åºä»»å¡ä¸å"); |
| | | if (!response.Status) |
| | | { |
| | | return content = WebResponseContent.Instance.Error("ä»»å¡ä¸åå¼å¸¸"); |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content = WebResponseContent.Instance.OK(); |
| | | } |
| | | return content = WebResponseContent.Instance.Error("æªæ¾å°å¯åé
è´§ä½"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | content = WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | return content; |