| | |
| | | { |
| | | try |
| | | { |
| | | int containerType = taskDTO.containerCode.Contains("LLM") ? LocationTypeEnum.LargePallet.ObjToInt() : LocationTypeEnum.SmallPallet.ObjToInt();//è¿éæä¸ç¥éæ¯ä»ä¹ç±»å |
| | | //è·åè´§ä½ä¿¡æ¯ |
| | | Dt_HKLocationInfo? kLSLocationInfo = _hKLocationInfoService.Repository.QueryFirst(x => x.WarehouseId.ToString() == taskDTO.toAreaCode && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == containerType); |
| | | if (kLSLocationInfo == null) throw new Exception($"æªæ¾å°ç»ç¹åºåºã{taskDTO.toAreaCode}ãå¯ç¨ç©ºè´§ä½ï¼"); |
| | | Dt_HKLocationInfo? hKLocationInfo = _hKLocationInfoService.GetFreeLocationInfo(taskDTO.toAreaCode) ?? throw new Exception($"æªæ¾å°ç»ç¹åºåºã{taskDTO.toAreaCode}ãå¯ç¨ç©ºè´§ä½ï¼"); ; |
| | | Dt_Task dt_Task = new Dt_Task() |
| | | { |
| | | TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | |
| | | //WMSId = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | Grade = taskDTO.taskPriority, |
| | | PalletCode = taskDTO.containerCode, |
| | | Roadway = kLSLocationInfo.RoadwayNo, |
| | | Roadway = hKLocationInfo.RoadwayNo, |
| | | TaskState = TaskStatusEnum.New.ObjToInt(), |
| | | TaskType = taskType, |
| | | SourceAddress = taskDTO.fromLocationCode, |
| | | CurrentAddress = taskDTO.fromLocationCode, |
| | | NextAddress = kLSLocationInfo.LocationCode, |
| | | TargetAddress = kLSLocationInfo.LocationCode, |
| | | NextAddress = hKLocationInfo.LocationCode, |
| | | TargetAddress = hKLocationInfo.LocationCode, |
| | | Creater = "WMS", |
| | | }; |
| | | kLSLocationInfo.LocationStatus = LocationStatusEnum.InLock.ObjToInt(); |
| | | hKLocationInfo.LocationStatus = LocationStatusEnum.InLock.ObjToInt(); |
| | | Db.Ado.BeginTran(); |
| | | BaseDal.AddData(dt_Task); |
| | | _hKLocationInfoService.Repository.UpdateData(kLSLocationInfo); |
| | | _hKLocationInfoService.Repository.UpdateData(hKLocationInfo); |
| | | Db.Ado.CommitTran(); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | Dt_HKLocationInfo? hKLocationInfo = _hKLocationInfoService.Repository.QueryFirst(x => x.LocationCode == taskDTO.fromLocationCode); |
| | | if (hKLocationInfo == null) throw new Exception($"æªæ¾å°èµ·ç¹åºä½ã{taskDTO.fromLocationCode}ãï¼"); |
| | | Dt_HKLocationInfo? hKLocationInfo = _hKLocationInfoService.Repository.QueryFirst(x => x.LocationCode == taskDTO.fromLocationCode) ?? throw new Exception($"æªæ¾å°èµ·ç¹åºä½ã{taskDTO.fromLocationCode}ãï¼"); |
| | | if (hKLocationInfo.LocationStatus != LocationStatusEnum.InStock.ObjToInt()) throw new Exception($"èµ·ç¹åºä½ã{taskDTO.fromLocationCode}ãå½ååºä½ç¶æä¸å¯åºåºï¼"); |
| | | Dt_Task dt_Task = new Dt_Task() |
| | | { |