| | |
| | | public partial class TaskService |
| | | { |
| | | public string url = AppSettings.Configuration["WCS"]; |
| | | /// <summary> |
| | | /// PDAç³è¯·å
¥åº--å åæºç«åºå
¥åº |
| | | /// </summary> |
| | | /// <param name="stationCode">èµ·å§å°å</param> |
| | | /// <param name="taskType">ä»»å¡ç±»å--å
¥ç©ºï¼å
¥æ</param> |
| | | /// <param name="palletCode">æçç¼å·</param> |
| | | /// <returns>è¿åå¤çç»æ</returns> |
| | | public WebResponseContent GenerateInboundTask(string stationCode, int taskType, string palletCode) |
| | | { |
| | | string? name = Enum.GetName(typeof(TaskTypeEnum), taskType); |
| | | MethodInfo? methodInfo = GetType().GetMethod(name + "Request"); |
| | | if (methodInfo != null) |
| | | { |
| | | WebResponseContent? responseContent = (WebResponseContent?)methodInfo.Invoke(this, new object[] { stationCode, palletCode }); |
| | | if (responseContent != null) |
| | | { |
| | | return responseContent; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return WebResponseContent.Instance.Error("æªæ¾å°è¯¥ä»»å¡ç±»åä¸å¡"); |
| | | } |
| | | return WebResponseContent.Instance.Error($"é误"); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 空æçå
¥åº |
| | | /// </summary> |
| | | /// <param name="stationCode">èµ·å§å°å</param> |
| | | /// <param name="palletCode">æçç¼å·</param> |
| | | /// <returns>è¿åå¤çç»æ</returns> |
| | | public WebResponseContent PalletInboundRequest(string stationCode, string palletCode) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | (bool, string) result = CheckRequestInbound(stationCode, palletCode, false); |
| | | if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2); |
| | | //content = AssignLocUpdateData(stationCode, TaskTypeEnum.PalletInbound.ObjToInt(), palletCode, false); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content = WebResponseContent.Instance.Error($"{ex.Message}"); |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ç©æå
¥åº |
| | |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"æ·»å ä»»å¡å¼å¸¸,é误信æ¯:{"æ«ç æ°æ®ä¸è½ä¸ºç©º"}"); |
| | | } |
| | | Dt_CachePoint endCachePoint = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode.Contains("æååº") && x.PointStatus == LocationStatusEnum.Free.ObjToInt()); |
| | | Dt_CachePoint endCachePoint = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode.Contains("æååº") && x.PointStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt().ObjToInt()); |
| | | if (endCachePoint == null) |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"æ·»å ä»»å¡å¼å¸¸,é误信æ¯:{"æªæ¾å°æååºå¯ç¨åæ¾ç¼åæ¶"}"); |
| | | } |
| | | Dt_CachePoint point = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == stationcode);//&& x.Materialtype == PalletCode |
| | | Dt_CachePoint point = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == stationcode && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt());//&& x.Materialtype == PalletCode |
| | | if (point == null) |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"æ·»å ä»»å¡å¼å¸¸,é误信æ¯:{"æ«ç æ°æ®å¼å¸¸ï¼æªæ¾å°æ¤ç¼åæ¶æç©æç±»åä¸å¹é
"}"); |
| | | return content = WebResponseContent.Instance.Error($"æ·»å ä»»å¡å¼å¸¸,é误信æ¯:{"æ«ç æ°æ®å¼å¸¸ï¼æªæ¾å°æ¤ç¼åæ¶æå·²ç¦ç¨"}"); |
| | | } |
| | | Dt_CachePoint points = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == stationcode && x.PointStatus == LocationStatusEnum.Free.ObjToInt()); |
| | | if (points == null) |