| | |
| | | { |
| | | public partial class TaskService |
| | | { |
| | | /// <summary> |
| | | /// WCS IPå°å |
| | | /// </summary> |
| | | public string url = AppSettings.Configuration["WCS"]; |
| | | /// <summary> |
| | | /// AGV IPå°å |
| | | /// </summary> |
| | | public string AGVurl = AppSettings.Configuration["AGV"]; |
| | | /// <summary> |
| | | /// PDAç³è¯·å
¥åº--å åæºç«åºå
¥åº |
| | | /// </summary> |
| | |
| | | try |
| | | { |
| | | _unitOfWorkManage.BeginTran(); |
| | | Dt_LocationInfo? locationInfo = _basicService.LocationInfoService.AssignLocation(stationCode, taskType); |
| | | Dt_LocationInfo? locationInfo = _basicService.LocationInfoService.AssignLocation(ref stationCode, taskType); |
| | | if (locationInfo != null) |
| | | { |
| | | List<Dt_Task> tasks = new List<Dt_Task>(); |
| | |
| | | TargetAddress = locationInfo.LocationCode, |
| | | TaskStatus = InTaskStatusEnum.InNew.ObjToInt(), |
| | | TaskType = taskType, |
| | | Depth= locationInfo.Depth, |
| | | Depth = locationInfo.Depth, |
| | | }; |
| | | BaseDal.AddData(task); |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | |
| | | orderNo = stockInfo.Details.FirstOrDefault()?.OrderNo ?? ""; |
| | | |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(); |
| | | stockInfo.Details.ForEach(x => |
| | | { |
| | | x.Status = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(); |
| | | }); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | _stockService.StockInfoDetailService.Repository.UpdateData(stockInfo.Details); |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error("æªæ¾å°åºåä¿¡æ¯"); |
| | | return content.Error("æªæ¾å°åºåä¿¡æ¯"); |
| | | } |
| | | } |
| | | else |
| | |
| | | { |
| | | _basicService.LocationInfoService.UpdateLocationLock(locationInfo, task.TaskNum, StockChangeType.Inbound.ObjToInt(), false); |
| | | } |
| | | task.Grade = 1; |
| | | } |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | |
| | | |
| | | tasks.Add(task); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), orderNo, task.TaskNum); |
| | | |
| | |
| | | if (!response.Status) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content = WebResponseContent.Instance.Error($"{response.Message}"); |
| | | return content.Error($"{response.Message}"); |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content = WebResponseContent.Instance.OK(); |
| | | return content.OK(); |
| | | } |
| | | return content = WebResponseContent.Instance.Error("æªæ¾å°å¯åé
è´§ä½"); |
| | | return content.Error("æªæ¾å°å¯åé
è´§ä½"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | content = WebResponseContent.Instance.Error(ex.Message); |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | |
| | | { |
| | | return (false, "该æçå·å·²æä»»å¡!"); |
| | | } |
| | | if (BaseDal.QueryFirst(x => (x.SourceAddress == stationCode || x.CurrentAddress == stationCode) && x.TaskStatus == InTaskStatusEnum.InNew.ObjToInt()) != null) |
| | | |
| | | Dt_RoadwayInfo roadwayInfo = _basicService.RoadwayInfoService.Repository.QueryFirst(x => x.InStationCode == stationCode) ?? throw new Exception("æªæ¾å°è¯¥ç«å°å¯¹åºçå··éï¼è¯·æ£æ¥åºç¡é
置信æ¯!"); |
| | | |
| | | if (BaseDal.QueryFirst(x => (x.SourceAddress == roadwayInfo.InSCStationCode || x.CurrentAddress == roadwayInfo.InSCStationCode) && x.TaskStatus == InTaskStatusEnum.InNew.ObjToInt()) != null) |
| | | { |
| | | return (false, "å½åå
¥åºç«å°å·²æä¸æ¡æ°å»ºä»»å¡!"); |
| | | } |