From 49699dc35dd326b3079fc78d3750f54255069332 Mon Sep 17 00:00:00 2001
From: 移动系统liao <liaoxujun@qq.com>
Date: 星期二, 07 五月 2024 09:07:13 +0800
Subject: [PATCH] 增加获取客户端IPAPI
---
CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs | 23 +++++++++++++++++++++--
1 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs b/CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs
index b0d34f9..3841395 100644
--- a/CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs
+++ b/CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs
@@ -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;
+
}
@@ -609,6 +613,8 @@
//鑾峰彇浼氬憳绾у埆浼樻儬浠�
//鑾峰彇浼氬憳绛夌骇浼樻儬浠锋牸浣撶郴
decimal gradePrice = 0;
+ //鐧惧垎鍏垫硶澧炲姞
+ bool IsDictionary = await _bfbfComAPIService.IsDictionary(userId);
if (userId > 0 && type == "goods")
{
//鑾峰彇鐢ㄦ埛淇℃伅
@@ -616,6 +622,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 +826,14 @@
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;
if (type == GlobalEnumVars.OrderType.PinTuan.ToString().ToLowerInvariant())
@@ -868,9 +881,15 @@
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;
if (type == GlobalEnumVars.OrderType.PinTuan.ToString().ToLowerInvariant())
--
Gitblit v1.9.1