pan
2025-12-03 98c5fbdce57cf9f0914ca5fb2c659c9396d3aed6
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs
@@ -31,20 +31,19 @@
        /// </summary>
        /// <param name="inTask"></param>
        /// <returns></returns>
        public async Task<WebResponseContent> PalletOutboundTask(int num)
        public async Task<WebResponseContent> PalletOutboundTask(int num, int locationType)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                var stockInfos = _stockRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletType == PalletTypeEnum.Empty.ObjToInt() && x.StockStatus == StockStatusEmun.入库完成.ObjToInt()).ToList();
                var stockInfos = _stockRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletType == PalletTypeEnum.Empty.ObjToInt() && x.StockStatus == StockStatusEmun.入库完成.ObjToInt()).WhereIF(locationType != 0, x => x.LocationType == locationType).Take(num).ToList();
                if (stockInfos.Count() == 0)
                {
                    return WebResponseContent.Instance.Error("未找到空托盘库存");
                }
                for (int i = 0; i < num; i++)
                foreach (var stockInfo in stockInfos)
                {
                    var stockInfo = stockInfos.Where(x=>x.StockStatus != StockStatusEmun.出库锁定.ObjToInt()).FirstOrDefault();
                    Dt_LocationInfo locationInfo = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == stockInfo.LocationCode);
                    if (locationInfo == null)
                    {
@@ -107,16 +106,7 @@
                    var result = await _eSSApiService.CreateTaskAsync(esstask);
                    _logger.LogInformation("创建任务PalletOutboundTask è¿”回:  " + result);
                    if (result)
                    {
                        return WebResponseContent.Instance.OK(200);
                    }
                    else
                    {
                        return WebResponseContent.Instance.Error("下发机器人任务失败!");
                    }
                }
                return content.OK("空托出库成功!");
            }
            catch (Exception ex)
@@ -475,7 +465,14 @@
            }
        }
        public async Task<WebResponseContent> GenerateAllocatOutboundTask(int orderDetailId, List<StockSelectViewDTO> stockSelectViews)
        /// <summary>
        /// æ™ºä»“调智仓
        /// </summary>
        /// <param name="orderDetailId"></param>
        /// <param name="stockSelectViews"></param>
        /// <param name="station"></param>
        /// <returns></returns>
        public async Task<WebResponseContent> GenerateAllocatOutboundTask(int orderDetailId, List<StockSelectViewDTO> stockSelectViews, string station = null)
        {
            try
            {
@@ -502,7 +499,7 @@
                    return WebResponseContent.Instance.Error("找不到出库明细单据");
                }
                (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) result = OutboundTaskDataHandle(outboundOrder.Details.First().Id, stockSelectViews);
                (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) result = OutboundTaskDataHandle(outboundOrder.Details.First().Id, stockSelectViews,station);
                WebResponseContent content =await GenerateOutboundTaskDataUpdate(result.Item1, result.Item2, result.Item3, result.Item4, result.Item5);