From cc170291673472d3cda8d7ea77f6bd3a3b5dbb83 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期一, 09 九月 2024 14:06:09 +0800 Subject: [PATCH] 增加了一些统计修改 --- CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs | 44 ++++++++++++++++++++++++++++++++++++-------- 1 files changed, 36 insertions(+), 8 deletions(-) diff --git a/CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs b/CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs index cb0c9e3..b8fb661 100644 --- a/CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs +++ b/CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs @@ -1,10 +1,10 @@ /*********************************************************************** - * Project: CoreCms - * ProjectName: 鏍稿績鍐呭绠$悊绯荤粺 - * Web: https://www.corecms.net - * Author: 澶х伆鐏� - * Email: jianweie@163.com - * CreateTime: 2021/1/31 21:45:10 + * Project: baifenBinfa + * ProjectName: 鐧惧垎鍏垫硶绠$悊绯荤粺 + * Web: http://chuanyin.com + * Author: + * Email: + * CreateTime: 202403/02 * Description: 鏆傛棤 ***********************************************************************/ @@ -19,6 +19,7 @@ using CoreCms.Net.IRepository; using CoreCms.Net.IRepository.UnitOfWork; using CoreCms.Net.IServices; +using CoreCms.Net.IServices.baifenbingfa; using CoreCms.Net.Loging; using CoreCms.Net.Model.Entities; using CoreCms.Net.Model.Entities.Expression; @@ -53,6 +54,7 @@ private readonly ICoreCmsOrderItemServices _orderItemServices; private readonly ICoreCmsUserServices _userServices; private readonly ICoreCmsUserGradeServices _userGradeServices; + private readonly IBfbfComAPIService _bfbfComAPIService; private readonly IServiceProvider _serviceProvider; @@ -64,7 +66,7 @@ , ICoreCmsPromotionServices promotionServices , ICoreCmsGoodsCollectionServices goodsCollectionServices , ICoreCmsBrandServices brandServices - , ICoreCmsOrderItemServices orderItemServices, ICoreCmsUserServices userServices, ICoreCmsUserGradeServices userGradeServices, IServiceProvider serviceProvider) + , ICoreCmsOrderItemServices orderItemServices, ICoreCmsUserServices userServices, ICoreCmsUserGradeServices userGradeServices, IServiceProvider serviceProvider, IBfbfComAPIService bfbfComAPIService) { this._dal = dal; base.BaseDal = dal; @@ -79,6 +81,8 @@ _userServices = userServices; _userGradeServices = userGradeServices; _serviceProvider = serviceProvider; + _bfbfComAPIService = bfbfComAPIService; + } @@ -548,6 +552,9 @@ if (product == null) return null; good.skuList = await GetCoreCmsProductsView(good, products, userId, isPromotion, type, groupId); + var coutiscut = products.Where(x => x.isCustomizable == true).Count(); + if (coutiscut > 0) + good.isCustomizable = true; } else { @@ -609,6 +616,8 @@ //鑾峰彇浼氬憳绾у埆浼樻儬浠� //鑾峰彇浼氬憳绛夌骇浼樻儬浠锋牸浣撶郴 decimal gradePrice = 0; + //鐧惧垎鍏垫硶澧炲姞 + bool IsDictionary = await _bfbfComAPIService.IsDictionary(userId); if (userId > 0 && type == "goods") { //鑾峰彇鐢ㄦ埛淇℃伅 @@ -616,6 +625,8 @@ if (userInfo != null) { var goodsGrades = await _goodsGradeServices.QueryByClauseAsync(p => p.goodsId == good.id && p.gradeId == userInfo.grade); + //瀵规帴缁忛攢鍟嗕細鍛� + if (goodsGrades != null) { gradePrice = goodsGrades.gradePrice; @@ -818,9 +829,17 @@ item.goods_id = good.id.ToString(); item.goods_name = good.name; item.image = o.images; + if(!IsDictionary) item.price = o.price - gradePrice; //鍑忓幓浼氬憳绛夌骇浠锋牸 + else + item.price = o.distributionPrice; item.sku_name_arr = o.spesDesc.Split(",").Select(s => s.Split(":")[1]).ToList(); item.stock = o.stock; + item.cutMoney = o.cutMoney; + item.distributionCutMoney = o.distributionCutMoney; + item.mktPrice = o.mktprice; + item.selPrice = o.price; + item.isCustomizable = o.isCustomizable; if (type == GlobalEnumVars.OrderType.PinTuan.ToString().ToLowerInvariant()) { if (isMaxPinTuanGoodsNums) @@ -866,9 +885,18 @@ item.goods_id = good.id.ToString(); item.goods_name = good.name; item.image = o.images; - item.price = o.price - gradePrice; //鍑忓幓浼氬憳绛夌骇浠锋牸 + if (!IsDictionary) + item.price = o.price - gradePrice; //鍑忓幓浼氬憳绛夌骇浠锋牸 + else + item.price = o.distributionPrice; + //item.price = o.price - gradePrice; //鍑忓幓浼氬憳绛夌骇浠锋牸 item.sku_name_arr = new List<string> { "榛樿" }; item.stock = o.stock; + item.cutMoney = o.cutMoney; + item.distributionCutMoney = o.distributionCutMoney; + item.mktPrice = o.mktprice; + item.selPrice = o.price; + item.isCustomizable = o.isCustomizable; if (type == GlobalEnumVars.OrderType.PinTuan.ToString().ToLowerInvariant()) { if (isMaxPinTuanGoodsNums) -- Gitblit v1.9.1