| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | List<object> objects = new List<object>(); |
| | | foreach (var item in taskDTOs) |
| | | { |
| | | foreach (var task in item.tasks) |
| | | { |
| | | #region 夿 |
| | | content = TaskHelpMethods.isOkTaskInfo(task, true, true); |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | if (!content.Status) |
| | | { |
| | | objects.Add(new |
| | | { |
| | | taskCode = task.taskCode, |
| | | Message = $"ä»»å¡å·ã{task.taskCode}ã{content.Message}" |
| | | }); |
| | | continue; |
| | | //throw new Exception(content.Message); |
| | | } |
| | | if (BaseDal.QueryFirst(x => x.WMSTaskNum == task.taskCode) != null) |
| | | throw new Exception($"ä»»å¡å·ã{task.taskCode}ãå·²åå¨ä»»å¡"); |
| | | { |
| | | objects.Add(new |
| | | { |
| | | taskCode = task.taskCode, |
| | | Message = $"ä»»å¡å·ã{task.taskCode}ãå·²åå¨ä»»å¡" |
| | | }); |
| | | continue; |
| | | //throw new Exception($"ä»»å¡å·ã{task.taskCode}ãå·²åå¨ä»»å¡"); |
| | | } |
| | | if (BaseDal.QueryFirst(x => x.PalletCode == task.containerCode) != null) |
| | | throw new Exception($"æçå·ã{task.containerCode}ãå·²åå¨ä»»å¡"); |
| | | { |
| | | objects.Add(new |
| | | { |
| | | taskCode = task.taskCode, |
| | | Message = $"æçå·ã{task.containerCode}ãå·²åå¨ä»»å¡" |
| | | }); |
| | | continue; |
| | | //throw new Exception($"æçå·ã{task.containerCode}ãå·²åå¨ä»»å¡"); |
| | | } |
| | | if (BaseDal.QueryFirst(x => x.SourceAddress == task.fromLocationCode) != null) |
| | | throw new Exception($"èµ·ç¹ä½ç½®ã{task.containerCode}ãå·²åå¨ä»»å¡"); |
| | | { |
| | | objects.Add(new |
| | | { |
| | | taskCode = task.taskCode, |
| | | Message = $"èµ·ç¹ä½ç½®ã{task.containerCode}ãå·²åå¨ä»»å¡" |
| | | }); |
| | | continue; |
| | | //throw new Exception($"èµ·ç¹ä½ç½®ã{task.containerCode}ãå·²åå¨ä»»å¡"); |
| | | } |
| | | #endregion |
| | | switch (item.taskType) |
| | | { |
| | | case (int)TaskTypeEnum.MLInbound: |
| | | CreateKLSNewInTask(task, item.taskType); |
| | | content = CreateKLSNewInTask(task, item.taskType); |
| | | objects.Add(content.Data); |
| | | break; |
| | | case (int)TaskTypeEnum.MLOutbound: |
| | | CreateKLSNewOutTask(task, item.taskType); |
| | | content = CreateKLSNewOutTask(task, item.taskType); |
| | | objects.Add(content.Data); |
| | | break; |
| | | case (int)TaskTypeEnum.CPInbound: |
| | | CreateRGVNewInTask(task, item.taskType); |
| | | content = CreateRGVNewInTask(task, item.taskType); |
| | | objects.Add(content.Data); |
| | | break; |
| | | case (int)TaskTypeEnum.CPOutbound: |
| | | CreateRGVNewOutTask(task, item.taskType); |
| | | content = CreateRGVNewOutTask(task, item.taskType); |
| | | objects.Add(content.Data); |
| | | break; |
| | | case (int)TaskTypeEnum.CJInbound: |
| | | CreateHKNewInTask(task, item.taskType); |
| | | content = CreateHKNewInTask(task, item.taskType); |
| | | objects.Add(content.Data); |
| | | break; |
| | | case (int)TaskTypeEnum.CJOutbound: |
| | | CreateHKNewOutTask(task, item.taskType); |
| | | content = CreateHKNewOutTask(task, item.taskType); |
| | | objects.Add(content.Data); |
| | | break; |
| | | case (int)TaskTypeEnum.Carry: |
| | | CarryTask(task, item.taskType); |
| | | content = CarryTask(task, item.taskType); |
| | | objects.Add(content.Data); |
| | | break; |
| | | case (int)TaskTypeEnum.CJCarry: |
| | | CJCarryTaske(task, item.taskType); |
| | | content = CJCarryTaske(task, item.taskType); |
| | | objects.Add(content.Data); |
| | | break; |
| | | default: |
| | | objects.Add(new |
| | | { |
| | | taskCode = task.taskCode, |
| | | Message = $"æªå®ä¹çä»»å¡ç±»å" |
| | | }); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | content.Data = objects; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | /// <param name="AreaCode"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="NotImplementedException">åºåå·</exception> |
| | | public WebResponseContent LocationInquiry(string AreaCode) |
| | | public WebResponseContent LocationInquiry(WMSGetLocationInfo getLocationInfo) |
| | | { |
| | | if (AreaCode == null) |
| | | WebResponseContent content = new WebResponseContent(); |
| | | List<object> list = new List<object>(); |
| | | try |
| | | { |
| | | //æ¥è¯¢è¾é线空æç¼åä¿¡æ¯æ¶è¿åç©ºä½æ°é |
| | | } |
| | | return WebResponseContent.Instance.OK(); |
| | | if (getLocationInfo == null) throw new Exception("请æ±åæ°ä¸è½ä¸ºç©ºï¼"); |
| | | if (getLocationInfo.AreaCode == null) throw new Exception("åºåºç¼å·ä¸è½ä¸ºç©ºï¼"); |
| | | if (getLocationInfo.WarehouseId == 0) throw new Exception("ä»åºIDä¸è½ä¸ºç©ºï¼"); |
| | | if (getLocationInfo.WarehouseId == 1) |
| | | { |
| | | List<Dt_RGVLocationInfo> rGVLocationInfos = _rGVLocationInfoService.Repository.QueryData(x => x.WarehouseId == getLocationInfo.AreaCode.ObjToInt()); |
| | | foreach (var item in rGVLocationInfos) |
| | | { |
| | | list.Add(new |
| | | { |
| | | LoctionCode = item.LocationCode, |
| | | LocationStatus = item.LocationStatus, |
| | | EnableStatus = item.EnableStatus |
| | | }); |
| | | } |
| | | content.Data = list; |
| | | } |
| | | else if (getLocationInfo.WarehouseId == 2) |
| | | { |
| | | |
| | | } |
| | | else if (getLocationInfo.WarehouseId == 3) |
| | | { |
| | | |
| | | } |
| | | else if (getLocationInfo.WarehouseId == 4) |
| | | { |
| | | |
| | | } |
| | | else if (getLocationInfo.WarehouseId == 5) |
| | | { |
| | | |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | |