wangxinhui
2025-03-01 d11b1f9c98e8765d3cee15abd4474b0e05a5acbc
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs
@@ -473,9 +473,9 @@
                    PalletCode = model.CarrierCode,
                    PalletType = palletTypeInfo.PalletType,
                    WarehouseId = warehouse.WarehouseId,
                    StockStatus = stockInfoDetail.StockQuantity<=0.0? StockStatusEmun.MES空托退库.ObjToInt():StockStatusEmun.MES退库.ObjToInt(),
                    StockStatus = stockInfoDetail.StockQuantity <= 0.0 ? StockStatusEmun.MES空托退库.ObjToInt() : StockStatusEmun.MES退库.ObjToInt(),
                    Details = new List<Dt_StockInfoDetail> { stockInfoDetail },
                    Remark= stockInfoDetail.StockQuantity <= 0.0 ? StockStatusEmun.MES空托退库.ToString() : StockStatusEmun.MES退库.ToString()
                    Remark = stockInfoDetail.StockQuantity <= 0.0 ? StockStatusEmun.MES空托退库.ToString() : StockStatusEmun.MES退库.ToString()
                };
                //Dt_Task task = new Dt_Task()
                //{
@@ -522,7 +522,7 @@
                    {
                        return MesResponseContent.Instance.Error("仓库信息未配置");
                    }
                    Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.QueryFirst(x => x.PalletCode == item.CarrierCode);
                    Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.QueryFirst(x => x.PalletCode == item.CarrierCode || x.WarehouseId == warehouse.WarehouseId);
                    if (stockInfo == null)
                    {
                        return MesResponseContent.Instance.Error("未找到此载具编号库存");
@@ -883,8 +883,6 @@
            }
        }
        /// <summary>
        ///  PP库存查询
        /// </summary>
@@ -895,6 +893,7 @@
            MesResponseContent content = new MesResponseContent();
            try
            {
                Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == WarehouseEnum.HA58.ToString());
                List<Dt_StockInfo> stockInfos = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x =>
                x.WarehouseId == warehouse.WarehouseId &&
@@ -967,5 +966,35 @@
            return content;
        }
        /// <summary>
        /// æˆå“è¿”工提库
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public MesResponseContent RworkTask(RworkTaskModel model)
        {
            try
            {
                Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == WarehouseEnum.HA72.ToString());
                //获取库存记录
                List<Dt_StockInfo> stockInfos = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x =>
                  x.WarehouseId == warehouse.WarehouseId &&
                  x.StockStatus == (int)StockStatusEmun.入库完成).Includes(x => x.Details).ToList();
                Dt_StockInfo? stockInfo = stockInfos.FirstOrDefault(x => x.Details.Any(x => x.BatchNo == model.ProductVersion));
                if (stockInfo == null)
                {
                    return MesResponseContent.Instance.Error($"尾数仓:{model.ProductVersion}无可用库存");
                }
                Dt_Task exsit2 = Repository.QueryFirst(x => x.PalletCode == stockInfo.PalletCode);
            }
            catch (Exception ex)
            {
                throw;
            }
            return MesResponseContent.Instance.OK();
        }
    }
}