| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using NPOI.HSSF.UserModel; |
| | | using SqlSugar; |
| | | using CoreCms.Net.Services; |
| | | |
| | | namespace CoreCms.Net.Web.Admin.Controllers |
| | | { |
| | |
| | | private readonly ICoreCmsStockLogServices _stockLogServices; |
| | | private readonly ISysUserServices _sysUserServices; |
| | | private readonly IHttpContextUser _user; |
| | | private readonly ICoreCmsGoodsCategoryServices _coreCmsGoodsCategoryServices; |
| | | |
| | | /// <summary> |
| | | /// 构造函数 |
| | | ///</summary> |
| | | public CoreCmsStockController(IWebHostEnvironment webHostEnvironment |
| | | , ICoreCmsStockServices stockServices, ICoreCmsProductsServices productsServices, IHttpContextUser user, ICoreCmsStockLogServices stockLogServices, ISysUserServices sysUserServices) |
| | | , ICoreCmsStockServices stockServices |
| | | , ICoreCmsProductsServices productsServices |
| | | , IHttpContextUser user |
| | | , ICoreCmsStockLogServices stockLogServices |
| | | , ISysUserServices sysUserServices, |
| | | ICoreCmsGoodsCategoryServices coreCmsGoodsCategoryServices) |
| | | { |
| | | _webHostEnvironment = webHostEnvironment; |
| | | _stockServices = stockServices; |
| | |
| | | _user = user; |
| | | _stockLogServices = stockLogServices; |
| | | _sysUserServices = sysUserServices; |
| | | _coreCmsGoodsCategoryServices = coreCmsGoodsCategoryServices; |
| | | |
| | | } |
| | | |
| | | #region 获取列表============================================================ |
| | |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Description("首页数据")] |
| | | public AdminUiCallBack GetIndex() |
| | | public async Task<AdminUiCallBack> GetIndex() |
| | | { |
| | | //返回数据 |
| | | var jm = new AdminUiCallBack { code = 0 }; |
| | | |
| | | var stockType = EnumHelper.EnumToList<GlobalEnumVars.StockType>(); |
| | | stockType = stockType.Where(p => p.value < 3).ToList(); |
| | | |
| | | var categories = await _coreCmsGoodsCategoryServices.QueryListByClauseAsync(p => p.isShow, p => p.sort, OrderByType.Asc, true, true); |
| | | var categoriesTree = GoodsHelper.GetTree(categories, false); |
| | | jm.data = new |
| | | { |
| | | stockType, |
| | | stockType |
| | | |
| | | }; |
| | | return jm; |
| | | } |