wankeda
2025-06-24 1caea0fdc7ed1788d854a2aba8853984b4494e01
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs
@@ -18,53 +18,7 @@
    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>
        /// ç‰©æ–™å…¥åº“
@@ -246,15 +200,15 @@
                    {
                        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)