| | |
| | | TargetAddress = locationInfo.LocationCode, |
| | | TaskStatus = InTaskStatusEnum.InNew.ObjToInt(), |
| | | TaskType = taskType, |
| | | Depth= locationInfo.Depth, |
| | | Depth = locationInfo.Depth, |
| | | }; |
| | | BaseDal.AddData(task); |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | |
| | | task.Grade = 1; |
| | | } |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | |
| | | |
| | | tasks.Add(task); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), orderNo, task.TaskNum); |
| | | |
| | |
| | | |
| | | return (true, "æå!"); |
| | | } |
| | | |
| | | |
| | | //private static readonly object text = new object(); |
| | | /// <summary> |
| | | /// å
¥åºä»»å¡ |
| | | /// </summary> |
| | | /// <param name="saveModel"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent InboundTask(SaveModel saveModel) |
| | | { |
| | | lock (text) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | string stationcode = saveModel.MainData["stationcode"].ToString(); |
| | | string PalletCode = saveModel.MainData["PalletCode"].ToString();//éåºååºåï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ |
| | | string PointName = saveModel.MainData["PointName"].ToString(); |
| | | if (stationcode == "" || PalletCode == "" || PointName == "")//å¼å¸¸è¿åãããããã |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"æ·»å ä»»å¡å¼å¸¸,é误信æ¯:{"æ«ç æ°æ®ä¸è½ä¸ºç©º"}"); |
| | | } |
| | | Dt_CachePoint endCachePoint = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode.Contains("æååº") && x.PointName.Contains(PointName) && x.PointStatus == LocationStatusEnum.Free.ObjToInt()); |
| | | if (endCachePoint == null) |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"æ·»å ä»»å¡å¼å¸¸,é误信æ¯:{"æªæ¾å°æååºå¯ç¨åæ¾ç¼åæ¶"}"); |
| | | } |
| | | Dt_CachePoint point = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == stationcode && x.Materialtype == PalletCode); |
| | | if (point == null) |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"æ·»å ä»»å¡å¼å¸¸,é误信æ¯:{"æ«ç æ°æ®å¼å¸¸ï¼æªæ¾å°æ¤ç¼åæ¶æç©æç±»åä¸å¹é
"}"); |
| | | } |
| | | Dt_CachePoint points = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == stationcode && x.PointStatus == LocationStatusEnum.Free.ObjToInt()); |
| | | if (points == null) |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"æ·»å ä»»å¡å¼å¸¸,é误信æ¯:{"æ«ç æ°æ®å¼å¸¸ï¼æ¤ç¼åç¹å·²è¢«éå®"}"); |
| | | } |
| | | Dt_Task taskcode = BaseDal.QueryFirst(x => x.SourceAddress == stationcode || x.TargetAddress == stationcode); |
| | | if (taskcode != null) |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"æ·»å ä»»å¡å¼å¸¸,é误信æ¯:该ç«ç¹å·²åå¨ä»»å¡"); |
| | | } |
| | | List<Dt_Task> tasks = new List<Dt_Task>(); |
| | | Dt_Task task = new Dt_Task() |
| | | { |
| | | CurrentAddress = "", |
| | | Grade = 1, |
| | | NextAddress = "", |
| | | PalletCode = "", |
| | | Roadway = "", |
| | | SourceAddress = stationcode, |
| | | TargetAddress = endCachePoint.PointCode, |
| | | TaskStatus = AGVTaskStatusEnum.AGV_New.ObjToInt(), |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | Materialtype = PalletCode, |
| | | Depth = 1, |
| | | TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)) |
| | | }; |
| | | tasks.Add(task); |
| | | Repository.AddData(tasks); |
| | | HCJLock(task); |
| | | content = WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content = WebResponseContent.Instance.Error($"æ·»å ä»»å¡å¼å¸¸,é误信æ¯:{ex.Message}"); |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | } |
| | | } |