Admin
8 天以前 96a77e69b0577c50adfaacd5fd8b89009242d3bd
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs
@@ -380,7 +380,7 @@
            {
                WebResponseContent content = new WebResponseContent();
                List<Dt_LocationInfo> loca = new List<Dt_LocationInfo>();
                Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == TaskNum);
                Dt_Task task = BaseDal.QueryData().Where(x => x.TaskNum == TaskNum).FirstOrDefault();
                if (task == null)
                {
                    return content = WebResponseContent.Instance.Error($"未找到该任务信息,任务号:{TaskNum}");
@@ -404,7 +404,7 @@
                    }
                    targetCodes[4] = "01";
                    string LocationCode = string.Join("-", targetCodes); //组装浅库位地址
                    Dt_LocationInfo locationInfos = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == LocationCode && (x.LocationStatus == (int)LocationStatusEnum.Free || x.LocationStatus == (int)LocationStatusEnum.InStock || x.LocationStatus == (int)LocationStatusEnum.Pallet));
                    Dt_LocationInfo locationInfos = _basicService.LocationInfoService.Repository.QueryData(x => x.LocationCode == LocationCode).Where(x=> x.LocationStatus == (int)LocationStatusEnum.Free || x.LocationStatus == (int)LocationStatusEnum.InStock || x.LocationStatus == (int)LocationStatusEnum.Pallet).FirstOrDefault();
                    if (locationInfos == null)
                    {
                        return content = WebResponseContent.Instance.Error($"未找到该货位信息,货位编号:{locationInfos}");
@@ -417,7 +417,7 @@
                        }
                        else
                        {
                            Dt_StockInfo dt_StockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.LocationCode == LocationCode && x.StockStatus== (int)StockStatusEmun.已入库);
                            Dt_StockInfo dt_StockInfo = _stockService.StockInfoService.Repository.QueryData(x => x.LocationCode == LocationCode).Where(x=> x.StockStatus == (int)StockStatusEmun.已入库).FirstOrDefault();
                            if (dt_StockInfo == null)
                            {
                                return content = WebResponseContent.Instance.Error($"未找到该货位的库存信息,货位编号:{LocationCode}");
@@ -439,25 +439,38 @@
                                if (dt_StockInfo.MaterialType == (int)InventoryMaterialType.成品)
                                {
                                    string[] targetCodesst = dt_StockInfo.PalletCode.Split("*");
                                    Dt_InboundOrder dt_Inbound = _inboundService.InbounOrderService.Repository.QueryFirst(x => x.OrderName == targetCodesst[0]);
                                    Dt_InboundOrder dt_Inbound = _inboundService.InbounOrderService.Repository.QueryData().Where(x => x.OrderName == targetCodesst[0]).FirstOrDefault();
                                    if (dt_Inbound.Startingcolumn != 0 || dt_Inbound.Terminationcolumn != 0)
                                    {
                                        newLocation = _basicService.LocationInfoService.GetLocation4(locationInfos.RoadwayNo, Locationtype, dt_Inbound.Startingcolumn, dt_Inbound.Terminationcolumn);
                                        if (newLocation == null)
                                        {
                                            return WebResponseContent.Instance.Error($"无法获取库位,没找到巷道:{locationInfos.RoadwayNo},列:{dt_Inbound.Startingcolumn}==>{dt_Inbound.Terminationcolumn},的可用货位,,,任务编号:{TaskNum}");
                                        }
                                    }
                                    else
                                    {
                                        newLocation = _basicService.LocationInfoService.GetLocation3(locationInfos.RoadwayNo, Locationtype);
                                        if (newLocation == null)
                                        {
                                            return WebResponseContent.Instance.Error($"无法获取库位,没找到巷道:{locationInfos.RoadwayNo},任务编号:{TaskNum}");
                                        }
                                    }
                                }
                                else
                                {
                                    newLocation = _basicService.LocationInfoService.GetLocation3(locationInfos.RoadwayNo, Locationtype);
                                    if (newLocation == null)
                                    {
                                        return WebResponseContent.Instance.Error($"无法获取库位,没找到巷道:{locationInfos.RoadwayNo},任务编号:{TaskNum}");
                                    }
                                }
                                //目标货位查找库位是否有货
                                Dt_StockInfo dt_StockCurren = _stockService.StockInfoService.Repository.QueryFirst(x => x.LocationCode == newLocation.LocationCode);
                                Dt_StockInfo dt_StockCurren = _stockService.StockInfoService.Repository.QueryData().Where(x => x.LocationCode == newLocation.LocationCode).FirstOrDefault();
                                if (dt_StockCurren != null) return content = WebResponseContent.Instance.Error($"入库失败,托盘条码:{dt_StockInfo.PalletCode},查找出的货位信息对应已有库存");
                                Dt_Task taskcurren = BaseDal.QueryFirst(x => x.TargetAddress == newLocation.LocationCode);