dengjunjie
4 天以前 23f7d0e0cf31ea6a7cde81bf23ef07091bd4f3a7
н¨Îļþ¼Ð/WIDESEA_WMSServer/ClassLibrary2/InventoryInfoService.cs
@@ -6,6 +6,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.WareHouseEnum;
using WIDESEA_Core;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
@@ -24,6 +25,57 @@
        }
        public IRepository<Dt_InventoryInfo> Repository => BaseDal;
        /// <summary>
        /// èŽ·å–åº“å­˜
        /// </summary>
        /// <returns></returns>
        public WebResponseContent GetInventory()
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                List<object> lists = new List<object>();
                #region å†·å†»åº“
                string WareCodeLD = WarehouseEnum.冷冻库.ObjToInt().ToString("000");
                List<Dt_InventoryInfo> inventoryInfosLD = BaseDal.QueryData(x => x.WarehouseCode == WareCodeLD);
                object LDQty = new
                {
                    name = WarehouseEnum.冷冻库.ObjToString(),
                    count = inventoryInfosLD.Sum(x => x.StockQuantity).ObjToInt()
                };
                lists.Add(LDQty);
                #endregion
                #region éº»ç²¾åº“
                string WareCodeMJ = WarehouseEnum.麻精库.ObjToInt().ToString("000");
                List<Dt_InventoryInfo> inventoryInfosMJ = BaseDal.QueryData(x => x.WarehouseCode == WareCodeMJ);
                object MJQty = new
                {
                    name = WarehouseEnum.麻精库.ObjToString(),
                    count = inventoryInfosMJ.Sum(x => x.StockQuantity).ObjToInt()
                };
                lists.Add(MJQty);
                #endregion
                #region å¤§ä»¶åº“
                string WareCodeDJ = WarehouseEnum.大件库.ObjToInt().ToString("000");
                List<Dt_InventoryInfo> inventoryInfosDJ = BaseDal.QueryData(x => x.WarehouseCode == WareCodeDJ);
                object DJQty = new
                {
                    name = WarehouseEnum.大件库.ObjToString(),
                    count = inventoryInfosDJ.Sum(x => x.StockQuantity).ObjToInt()
                };
                lists.Add(DJQty);
                #endregion
                content.OK(data: lists);
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
    }
}