| | |
| | | /// </summary> |
| | | [Description("审核拒绝")] |
| | | VerifyRefuse = 3, |
| | | |
| | | /// <summary> |
| | | /// 审核拒绝 |
| | | /// </summary> |
| | | [Description("取消资格")] |
| | | VerifyCancel = 4, |
| | | } |
| | | /// <summary> |
| | | /// 经销商订单记录表是否结算状态 |
| | |
| | | public System.Decimal price { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 经销商价格 |
| | | /// </summary> |
| | | public System.Decimal distributionPrice { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 经销商购买提成 |
| | | /// </summary> |
| | | public System.Decimal distributionCutMoney { get; set; } |
| | | /// <summary> |
| | | /// 普通商户购买提成 |
| | | /// </summary> |
| | | public System.Decimal cutMoney { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 货品市场价 |
| | | /// </summary> |
| | | |
| | |
| | | /// <param name="s"></param> |
| | | /// <returns></returns> |
| | | Task<List<SearchUserData>> SearchUserData(string s); |
| | | /// <summary> |
| | | /// 检查用户是否是经销商 |
| | | /// </summary> |
| | | /// <param name="UserId"></param> |
| | | /// <returns></returns> |
| | | |
| | | Task<bool> IsDictionary(int UserId); |
| | | } |
| | | |
| | | |
| | |
| | | * Description: 暂无 |
| | | ***********************************************************************/ |
| | | |
| | | using Chuanyin.Attribute; |
| | | using SqlSugar; |
| | | using System.ComponentModel; |
| | | using System.ComponentModel.DataAnnotations; |
| | |
| | | /// <summary> |
| | | /// 货品表 |
| | | /// </summary> |
| | | |
| | | public partial class CoreCmsProducts |
| | | { |
| | | /// <summary> |
| | |
| | | |
| | | |
| | | public System.Decimal costprice { get; set; } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 经销商价格 |
| | | /// </summary> |
| | | [Display(Name = "经销商价格")] |
| | | [Required(ErrorMessage = "请输入{0}")] |
| | | public System.Decimal distributionPrice { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 经销商提成 |
| | | /// </summary> |
| | | [Display(Name = "经销商提成")] |
| | | [Required(ErrorMessage = "请输入{0}")] |
| | | [SugarColumn( DefaultValue ="0",ColumnDescription = "经销商提成")] |
| | | public System.Decimal distributionCutMoney{ get; set; } |
| | | |
| | | /// <summary> |
| | | /// 普通商户提成 |
| | | /// </summary> |
| | | [Display(Name = "普通商户提成")] |
| | | [Required(ErrorMessage = "请输入{0}")] |
| | | [SugarColumn(DefaultValue = "0",ColumnDescription = "普通商户提成")] |
| | | public System.Decimal cutMoney { get; set; } |
| | | /// <summary> |
| | | /// 货品市场价 |
| | | /// </summary> |
| | |
| | | [SugarColumn(IsIgnore = true)] |
| | | public int reshipedNums { get; set; } = 0; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 货品信息 |
| | | /// </summary> |
| | | [Navigate(NavigateType.OneToOne, nameof(productId))] |
| | | public CoreCmsProducts productInfo { get; set; } |
| | | /// <summary> |
| | | /// 当前退货数量 |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | [SugarColumn(IsIgnore = true)] |
| | | public string parentNickName { get; set; } |
| | | /// <summary> |
| | | /// 用户等级 |
| | | /// </summary> |
| | | [Navigate(NavigateType.OneToOne, nameof(grade))]//一对一 SchoolId是StudentA类里面的 |
| | | public CoreCmsUserGrade gradeInfo { get; set; } |
| | | |
| | | } |
| | | } |
| | |
| | | using System.Threading.Tasks; |
| | | using CoreCms.Net.Configuration; |
| | | using CoreCms.Net.IServices; |
| | | using CoreCms.Net.IServices.baifenbingfa; |
| | | using CoreCms.Net.Loging; |
| | | using CoreCms.Net.Model.Entities; |
| | | using CoreCms.Net.Model.ViewModels.UI; |
| | |
| | | private readonly ICoreCmsUserServices _userServices; |
| | | private readonly ICoreCmsAgentOrderServices _agentOrderServices; |
| | | |
| | | private readonly IBfbfComAPIService _bfbfComAPIService; |
| | | |
| | | public OrderAgentOrDistributionSubscribe(ICoreCmsBillPaymentsServices billPaymentsServices, ICoreCmsDistributionOrderServices distributionOrderServices, ICoreCmsDistributionServices distributionServices, ICoreCmsSettingServices settingServices, ICoreCmsUserServices userServices, ICoreCmsAgentOrderServices agentOrderServices) |
| | | |
| | | public OrderAgentOrDistributionSubscribe(ICoreCmsBillPaymentsServices billPaymentsServices, ICoreCmsDistributionOrderServices distributionOrderServices, ICoreCmsDistributionServices distributionServices, ICoreCmsSettingServices settingServices, ICoreCmsUserServices userServices, ICoreCmsAgentOrderServices agentOrderServices ,IBfbfComAPIService bfbfComAPIService) |
| | | { |
| | | _billPaymentsServices = billPaymentsServices; |
| | | _distributionOrderServices = distributionOrderServices; |
| | |
| | | _settingServices = settingServices; |
| | | _userServices = userServices; |
| | | _agentOrderServices = agentOrderServices; |
| | | _bfbfComAPIService= bfbfComAPIService; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | var jm = await _distributionOrderServices.AddData(order); //添加分享关联订单日志 |
| | | //判断是否可以成为经销商 |
| | | //先判断是否已经是经销商了。 |
| | | //百分兵法同意判决经销商 |
| | | bool check = await _distributionServices.ExistsAsync(p => p.userId == order.userId); |
| | | var distributionType = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.DistributionType).ObjectToInt(0); |
| | | //bool check = await _bfbfComAPIService.IsDictionary( order.userId); |
| | | |
| | | var distributionType = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.DistributionType).ObjectToInt(0); |
| | | if (distributionType == 3) //无需审核,但是要满足提交 |
| | | { |
| | | var info = new CoreCmsDistribution(); |
| | |
| | | using CoreCms.Net.DTO.ComponentsDTO; |
| | | using CoreCms.Net.IRepository; |
| | | using CoreCms.Net.IRepository.UnitOfWork; |
| | | using CoreCms.Net.IServices.baifenbingfa; |
| | | using CoreCms.Net.Loging; |
| | | using CoreCms.Net.Model.Entities; |
| | | using CoreCms.Net.Model.FromBody; |
| | |
| | | using CoreCms.Net.Model.ViewModels.UI; |
| | | using CoreCms.Net.Utility.Helper; |
| | | using Newtonsoft.Json; |
| | | using NPOI.POIFS.Properties; |
| | | using SqlSugar; |
| | | |
| | | namespace CoreCms.Net.Repository |
| | |
| | | /// </summary> |
| | | public class CoreCmsGoodsRepository : BaseRepository<CoreCmsGoods>, ICoreCmsGoodsRepository |
| | | { |
| | | public CoreCmsGoodsRepository(IUnitOfWork unitOfWork) : base(unitOfWork) |
| | | private readonly IBfbfComAPIService _bfbfComAPIService; |
| | | public CoreCmsGoodsRepository(IUnitOfWork unitOfWork,IBfbfComAPIService bfbfComAPIService) : base(unitOfWork) |
| | | { |
| | | _bfbfComAPIService = bfbfComAPIService; |
| | | } |
| | | |
| | | |
| | |
| | | obj.goodsId = id; |
| | | obj.barcode = goods.bn; |
| | | obj.sn = p.sn; |
| | | |
| | | obj.price = p.price; |
| | | obj.costprice = p.costprice; |
| | | obj.mktprice = p.mktprice; |
| | |
| | | obj.isDefalut = p.isDefalut; |
| | | obj.isDel = false; |
| | | obj.images = p.images; |
| | | //百分兵法添加 |
| | | obj.distributionCutMoney = p.distributionCutMoney; |
| | | obj.cutMoney = p.cutMoney; |
| | | obj.distributionPrice= p.distributionPrice; |
| | | products.Add(obj); |
| | | |
| | | var pd = new CoreCmsProductsDistribution(); |
| | |
| | | pd.levelOne = p.levelOne; |
| | | pd.levelTwo = p.levelTwo; |
| | | pd.levelThree = p.levelThree; |
| | | |
| | | pds.Add(pd); |
| | | |
| | | }); |
| | |
| | | obj.isDefalut = true; |
| | | obj.isDel = false; |
| | | obj.images = oldObj.images; |
| | | obj.distributionCutMoney = oldObj.distributionCutMoney; |
| | | obj.cutMoney = oldObj.cutMoney; |
| | | obj.distributionPrice = oldObj.distributionPrice; |
| | | |
| | | if (string.IsNullOrEmpty(obj.images)) |
| | | { |
| | |
| | | p.points = child.points; |
| | | p.stock = child.stock; |
| | | p.weight = child.weight; |
| | | p.distributionPrice = child.distributionPrice; |
| | | p.cutMoney = child.cutMoney; |
| | | p.distributionCutMoney = child.distributionCutMoney; |
| | | |
| | | } |
| | | }); |
| | |
| | | obj.points = p.points; |
| | | obj.isDefalut = p.isDefalut; |
| | | obj.images = p.images; |
| | | obj.distributionPrice = p.distributionPrice; |
| | | obj.cutMoney = p.cutMoney; |
| | | obj.distributionCutMoney = p.distributionCutMoney; |
| | | if (string.IsNullOrEmpty(p.images)) |
| | | { |
| | | obj.images = oldModel.image; |
| | |
| | | obj.images = newObj.images; |
| | | obj.isDefalut = true; |
| | | obj.isDel = false; |
| | | obj.distributionPrice = newObj.distributionPrice; |
| | | obj.cutMoney = newObj.cutMoney; |
| | | obj.distributionCutMoney = newObj.distributionCutMoney; |
| | | if (string.IsNullOrEmpty(newObj.images)) |
| | | { |
| | | obj.images = oldModel.image; |
| | |
| | | obj.spesDesc = ""; |
| | | obj.isDefalut = true; |
| | | obj.isDel = false; |
| | | obj.distributionPrice = newObj.distributionPrice; |
| | | obj.cutMoney = newObj.cutMoney; |
| | | obj.distributionCutMoney = newObj.distributionCutMoney; |
| | | if (string.IsNullOrEmpty(newObj.images)) |
| | | { |
| | | obj.images = oldModel.image; |
| | |
| | | isRecommend = good.isRecommend, |
| | | isHot = good.isHot, |
| | | price = pd.price, |
| | | distributionCutMoney = pd.distributionCutMoney, |
| | | cutMoney = pd.cutMoney, |
| | | distributionPrice = pd.distributionPrice, |
| | | mktprice = pd.mktprice, |
| | | stock = pd.stock, |
| | | pointsDeduction = pd.pointsDeduction, |
| | |
| | | createTime = good.createTime, |
| | | isRecommend = good.isRecommend, |
| | | isHot = good.isHot, |
| | | distributionCutMoney = pd.distributionCutMoney, |
| | | cutMoney = pd.cutMoney, |
| | | distributionPrice = pd.distributionPrice, |
| | | price = pd.price, |
| | | mktprice = pd.mktprice, |
| | | stock = pd.stock, |
| | |
| | | labelIds = good.labelIds, |
| | | createTime = good.createTime, |
| | | isRecommend = good.isRecommend, |
| | | distributionPrice = pd.distributionPrice, |
| | | distributionCutMoney = pd.distributionCutMoney, |
| | | cutMoney = pd.cutMoney, |
| | | isHot = good.isHot, |
| | | price = pd.price, |
| | | mktprice = pd.mktprice, |
| | |
| | | isRecommend = good.isRecommend, |
| | | isHot = good.isHot, |
| | | price = pd.price, |
| | | distributionPrice = pd.distributionPrice, |
| | | distributionCutMoney = pd.distributionCutMoney, |
| | | cutMoney = pd.cutMoney, |
| | | mktprice = pd.mktprice, |
| | | stock = pd.stock, |
| | | pointsDeduction = pd.pointsDeduction, |
| | |
| | | labelIds = good.labelIds, |
| | | createTime = good.createTime, |
| | | isRecommend = good.isRecommend, |
| | | distributionCutMoney = pd.distributionCutMoney, |
| | | cutMoney = pd.cutMoney, |
| | | distributionPrice=pd.distributionPrice, |
| | | isHot = good.isHot, |
| | | price = pd.price, |
| | | mktprice = pd.mktprice, |
| | |
| | | isRecommend = good.isRecommend, |
| | | isHot = good.isHot, |
| | | price = pd.price, |
| | | distributionCutMoney = pd.distributionCutMoney, |
| | | cutMoney = pd.cutMoney, |
| | | distributionPrice = pd.distributionPrice, |
| | | mktprice = pd.mktprice, |
| | | stock = pd.stock, |
| | | pointsDeduction = pd.pointsDeduction, |
| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | using CoreCms.Net.Auth.HttpContextUser; |
| | | using CoreCms.Net.Configuration; |
| | | 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; |
| | |
| | | private readonly ICoreCmsSolitaireServices _solitaireServices; |
| | | private readonly ICoreCmsUserShipServices _userShipServices; |
| | | private readonly ICoreCmsStoreServices _storeServices; |
| | | private readonly IBfbfComAPIService _bfbfComAPIService; |
| | | private readonly IHttpContextUser _user; |
| | | |
| | | public CoreCmsCartServices( |
| | | ICoreCmsCartRepository dal |
| | |
| | | , ICoreCmsUserServices userServices |
| | | , ICoreCmsSettingServices settingServices |
| | | , ICoreCmsProductsServices productsServices |
| | | , ICoreCmsPinTuanGoodsServices pinTuanGoodsServices, ICoreCmsPromotionConditionServices promotionConditionServices, ICoreCmsGoodsServices goodsServices, ICoreCmsGoodsCategoryServices goodsCategoryServices, ICoreCmsPromotionResultServices promotionResultServices, ICoreCmsPinTuanRecordServices pinTuanRecordServices, ICoreCmsSolitaireServices solitaireServices, ICoreCmsUserShipServices userShipServices, ICoreCmsStoreServices storeServices) |
| | | , ICoreCmsPinTuanGoodsServices pinTuanGoodsServices |
| | | , IBfbfComAPIService bfbfComAPIService |
| | | ,ICoreCmsPromotionConditionServices promotionConditionServices |
| | | , ICoreCmsGoodsServices goodsServices |
| | | , ICoreCmsGoodsCategoryServices goodsCategoryServices |
| | | , ICoreCmsPromotionResultServices promotionResultServices |
| | | , ICoreCmsPinTuanRecordServices pinTuanRecordServices |
| | | , ICoreCmsSolitaireServices solitaireServices |
| | | , ICoreCmsUserShipServices userShipServices |
| | | , ICoreCmsStoreServices storeServices |
| | | ,IHttpContextUser user) |
| | | { |
| | | this._dal = dal; |
| | | base.BaseDal = dal; |
| | |
| | | _solitaireServices = solitaireServices; |
| | | _userShipServices = userShipServices; |
| | | _storeServices = storeServices; |
| | | _bfbfComAPIService = bfbfComAPIService; |
| | | _user = user; |
| | | } |
| | | |
| | | #region 设置购物车商品数量==================================================== |
| | |
| | | { |
| | | case (int)GlobalEnumVars.OrderType.Common: |
| | | //标准模式不需要修改订单数据和商品数据 |
| | | { |
| | | if(await _bfbfComAPIService.IsDictionary(_user.ID)) |
| | | { |
| | | foreach (var item in cartDto.list) |
| | | { |
| | | item.products.price=item.products.distributionPrice; |
| | | |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | case (int)GlobalEnumVars.OrderType.PinTuan: |
| | | //拼团模式走拼团价,去修改商品价格 |
| | |
| | | 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.ViewModels.Basics; |
| | |
| | | private readonly ICoreCmsGoodsServices _goodsServices; |
| | | private readonly ICoreCmsDistributionOrderDetailsServices _distributionOrderDetailsServices; |
| | | private readonly ICoreCmsSettingServices _settingServices; |
| | | private readonly IBfbfComAPIService _bfbfComAPIService; |
| | | |
| | | |
| | | private readonly IUnitOfWork _unitOfWork; |
| | | public CoreCmsDistributionOrderServices(IUnitOfWork unitOfWork, ICoreCmsDistributionOrderRepository dal, ICoreCmsDistributionServices distributionServices, ICoreCmsUserBalanceServices balanceServices, ICoreCmsOrderServices orderServices, ICoreCmsUserServices userServices, ICoreCmsOrderItemServices orderItemServices, ICoreCmsProductsDistributionServices productsDistributionServices, ICoreCmsProductsServices productsServices, ICoreCmsGoodsServices goodsServices, ICoreCmsDistributionOrderDetailsServices distributionOrderDetailsServices, ICoreCmsSettingServices settingServices) |
| | | public CoreCmsDistributionOrderServices(IBfbfComAPIService bfbfComAPIService, IUnitOfWork unitOfWork, ICoreCmsDistributionOrderRepository dal, ICoreCmsDistributionServices distributionServices, ICoreCmsUserBalanceServices balanceServices, ICoreCmsOrderServices orderServices, ICoreCmsUserServices userServices, ICoreCmsOrderItemServices orderItemServices, ICoreCmsProductsDistributionServices productsDistributionServices, ICoreCmsProductsServices productsServices, ICoreCmsGoodsServices goodsServices, ICoreCmsDistributionOrderDetailsServices distributionOrderDetailsServices, ICoreCmsSettingServices settingServices) |
| | | { |
| | | this._dal = dal; |
| | | _distributionServices = distributionServices; |
| | |
| | | _settingServices = settingServices; |
| | | base.BaseDal = dal; |
| | | _unitOfWork = unitOfWork; |
| | | _bfbfComAPIService = bfbfComAPIService; |
| | | } |
| | | |
| | | |
| | |
| | | if (user is { parentId: > 0 }) |
| | | { |
| | | //获取购物明细 |
| | | var orderItems = await _orderItemServices.QueryListByClauseAsync(p => p.orderId == order.orderId); |
| | | var orderItems = await _unitOfWork.GetDbClient().Queryable<CoreCmsOrderItem>().Where(p => p.orderId == order.orderId).Includes(x => x.productInfo).ToListAsync(); |
| | | //await _orderItemServices.QueryListByClauseAsync(p => p.orderId == order.orderId); |
| | | var goodIds = orderItems.Select(p => p.goodsId).ToList(); |
| | | var productIds = orderItems.Select(p => p.productId).ToList(); |
| | | //获取货品数据 |
| | |
| | | var user = await _userServices.QueryByClauseAsync(p => p.id == userId); |
| | | if (user != null) |
| | | { |
| | | |
| | | var commission = await _distributionServices.GetGradeAndCommission(user.id); |
| | | if (commission.status && commission.data != null) //不是经销商的,不返利。 |
| | | { |
| | |
| | | //直返本级 |
| | | decimal amount = 0; |
| | | var distributionOrderDetails = new List<CoreCmsDistributionOrderDetails>(); |
| | | |
| | | //百分兵法判断订单用户是否是经销商 |
| | | bool OderUserIsDic = await _bfbfComAPIService.IsDictionary(order.userId); |
| | | foreach (var item in orderItems) |
| | | { |
| | | var orderDetails = new CoreCmsDistributionOrderDetails(); |
| | |
| | | //如果去掉优惠需要负了,就为0 |
| | | if (itemAmount < 0) itemAmount = 0; |
| | | |
| | | |
| | | |
| | | mathMoney = level switch |
| | | { |
| | | //一级分销 |
| | |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | mathMoney = level switch |
| | | //百分兵法基数按 |
| | | switch (level) |
| | | { |
| | | 1 when productsDistribution.levelOne > 0 => Math.Round( |
| | | productsDistribution.levelOne * item.nums, 2), |
| | | 2 when productsDistribution.levelTwo > 0 => Math.Round( |
| | | productsDistribution.levelTwo * item.nums, 2), |
| | | 3 when productsDistribution.levelThree > 0 => Math.Round( |
| | | productsDistribution.levelThree * item.nums, 2), |
| | | _ => mathMoney |
| | | }; |
| | | case 1 : |
| | | |
| | | if(OderUserIsDic) |
| | | //是经销商购买 |
| | | mathMoney = item.productInfo.distributionCutMoney; |
| | | else |
| | | //非经销商购买 |
| | | mathMoney= item.productInfo.cutMoney ; |
| | | |
| | | break; |
| | | case 2 when productsDistribution.levelTwo > 0: |
| | | break; |
| | | case 3 when productsDistribution.levelThree>0: |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | //原佣金计算方法 |
| | | //mathMoney = level switch |
| | | //{ |
| | | // 1 when productsDistribution.levelOne > 0 => Math.Round( |
| | | // productsDistribution.levelOne * item.nums, 2), |
| | | // 2 when productsDistribution.levelTwo > 0 => Math.Round( |
| | | // productsDistribution.levelTwo * item.nums, 2), |
| | | // 3 when productsDistribution.levelThree > 0 => Math.Round( |
| | | // productsDistribution.levelThree * item.nums, 2), |
| | | // _ => mathMoney |
| | | //}; |
| | | } |
| | | |
| | | amount += mathMoney; |
| | |
| | | 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.Distribution; |
| | |
| | | private readonly ICoreCmsSettingServices _settingServices; |
| | | private readonly IUnitOfWork _unitOfWork; |
| | | private readonly ICoreCmsUserBalanceServices _userBalanceServices; |
| | | private readonly IBfbfComAPIService _bfbfComAPIService; |
| | | |
| | | public CoreCmsDistributionServices(IUnitOfWork unitOfWork, ICoreCmsDistributionRepository dal, ICoreCmsDistributionOrderRepository distributionOrderRepository, ICoreCmsUserRepository userRepository, ICoreCmsGoodsRepository goodsRepository, ICoreCmsUserGradeRepository userGradeRepository, ICoreCmsSettingServices settingServices, ICoreCmsOrderRepository orderRepository, ICoreCmsDistributionGradeRepository distributionGradeRepository, ICoreCmsDistributionResultRepository distributionResultRepository, ICoreCmsDistributionConditionServices coreCmsDistributionConditionServices, ICoreCmsUserBalanceServices userBalanceServices) |
| | | public CoreCmsDistributionServices(IBfbfComAPIService bfbfComAPIService, IUnitOfWork unitOfWork, ICoreCmsDistributionRepository dal, ICoreCmsDistributionOrderRepository distributionOrderRepository, ICoreCmsUserRepository userRepository, ICoreCmsGoodsRepository goodsRepository, ICoreCmsUserGradeRepository userGradeRepository, ICoreCmsSettingServices settingServices, ICoreCmsOrderRepository orderRepository, ICoreCmsDistributionGradeRepository distributionGradeRepository, ICoreCmsDistributionResultRepository distributionResultRepository, ICoreCmsDistributionConditionServices coreCmsDistributionConditionServices, ICoreCmsUserBalanceServices userBalanceServices) |
| | | { |
| | | this._dal = dal; |
| | | _distributionOrderRepository = distributionOrderRepository; |
| | |
| | | base.BaseDal = dal; |
| | | _unitOfWork = unitOfWork; |
| | | _userBalanceServices = userBalanceServices; |
| | | _bfbfComAPIService = bfbfComAPIService; |
| | | |
| | | |
| | | } |
| | |
| | | public async Task<WebApiCallBack> GetGradeAndCommission(int userId) |
| | | { |
| | | var jm = new WebApiCallBack(); |
| | | //百分兵法判断是否是经销商 |
| | | if(await _bfbfComAPIService.IsDictionary(userId)) |
| | | { |
| | | jm.msg = "不是经销商的,不返利"; |
| | | return jm; |
| | | } |
| | | |
| | | var info = await _dal.QueryByClauseAsync(p => p.userId == userId); |
| | | if (info == null) |
| | |
| | | var da= await _dal.GetCountAsync(x=>x.userId== Parma.UserID && x.verifyStatus== (int)GlobalEnumVars.DistributionVerifyStatus.VerifyYes,isDataCache:true,cacheTimes:1); |
| | | if (da == 0) |
| | | return true; |
| | | var oder = new DistributionAchievementOrder |
| | | DistributionAchievementOrder oder = new DistributionAchievementOrder |
| | | { |
| | | achievementTotal = Parma.Money, |
| | | createBy = "经销商业绩写入", |
| | |
| | | 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; |
| | |
| | | private readonly ICoreCmsOrderItemServices _orderItemServices; |
| | | private readonly ICoreCmsUserServices _userServices; |
| | | private readonly ICoreCmsUserGradeServices _userGradeServices; |
| | | private readonly IBfbfComAPIService _bfbfComAPIService; |
| | | |
| | | private readonly IServiceProvider _serviceProvider; |
| | | |
| | |
| | | , 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; |
| | |
| | | _userServices = userServices; |
| | | _userGradeServices = userGradeServices; |
| | | _serviceProvider = serviceProvider; |
| | | _bfbfComAPIService = bfbfComAPIService; |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | //获取会员级别优惠价 |
| | | //获取会员等级优惠价格体系 |
| | | decimal gradePrice = 0; |
| | | //百分兵法增加 |
| | | bool IsDictionary = await _bfbfComAPIService.IsDictionary(userId); |
| | | if (userId > 0 && type == "goods") |
| | | { |
| | | //获取用户信息 |
| | |
| | | if (userInfo != null) |
| | | { |
| | | var goodsGrades = await _goodsGradeServices.QueryByClauseAsync(p => p.goodsId == good.id && p.gradeId == userInfo.grade); |
| | | //对接经销商会员 |
| | | |
| | | if (goodsGrades != null) |
| | | { |
| | | gradePrice = goodsGrades.gradePrice; |
| | |
| | | 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.mktPrice = o.mktprice; |
| | |
| | | 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.mktPrice = o.mktprice; |
| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | using CoreCms.Net.Auth.HttpContextUser; |
| | | using CoreCms.Net.Configuration; |
| | | using CoreCms.Net.DTO.ComponentsDTO; |
| | | 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; |
| | |
| | | private readonly ICoreCmsPinTuanRuleServices _pinTuanRuleServices; |
| | | private readonly ICoreCmsServicesServices _servicesServices; |
| | | private readonly ICoreCmsGoodsCategoryExtendServices _goodsCategoryExtendServices; |
| | | |
| | | |
| | | private readonly IHttpContextUser _contextUser; |
| | | private readonly IBfbfComAPIService _bfbfComAPIService; |
| | | private readonly IUnitOfWork _unitOfWork; |
| | | public CoreCmsPagesServices(IUnitOfWork unitOfWork |
| | | , ICoreCmsPagesRepository dal |
| | | , ICoreCmsPagesItemsRepository pagesItemsRepository, ICoreCmsPromotionServices promotionServices, ICoreCmsNoticeServices noticeServices, ICoreCmsGoodsCategoryServices goodsCategoryServices, ICoreCmsSettingServices settingServices, ICoreCmsGoodsServices goodsServices, ICoreCmsArticleServices articleServices, ICoreCmsPromotionConditionServices promotionConditionServices, ICoreCmsPinTuanRuleServices pinTuanRuleServices, ICoreCmsServicesServices servicesServices, ICoreCmsArticleTypeServices articleTypeServices, ICoreCmsGoodsCategoryExtendServices goodsCategoryExtendServices) |
| | | , ICoreCmsPagesItemsRepository pagesItemsRepository, |
| | | ICoreCmsPromotionServices promotionServices, |
| | | ICoreCmsNoticeServices noticeServices, |
| | | ICoreCmsGoodsCategoryServices goodsCategoryServices, |
| | | ICoreCmsSettingServices settingServices, |
| | | ICoreCmsGoodsServices goodsServices, |
| | | ICoreCmsArticleServices articleServices, |
| | | ICoreCmsPromotionConditionServices promotionConditionServices, |
| | | ICoreCmsPinTuanRuleServices pinTuanRuleServices, |
| | | ICoreCmsServicesServices servicesServices, |
| | | ICoreCmsArticleTypeServices articleTypeServices, |
| | | ICoreCmsGoodsCategoryExtendServices goodsCategoryExtendServices, |
| | | IHttpContextUser httpContextUser, |
| | | IBfbfComAPIService bfbfComAPIService) |
| | | { |
| | | this._dal = dal; |
| | | _pagesItemsRepository = pagesItemsRepository; |
| | |
| | | _goodsCategoryExtendServices = goodsCategoryExtendServices; |
| | | base.BaseDal = dal; |
| | | _unitOfWork = unitOfWork; |
| | | _contextUser= httpContextUser; |
| | | _bfbfComAPIService = bfbfComAPIService; |
| | | } |
| | | |
| | | |
| | |
| | | /// <returns></returns> |
| | | public async Task<WebApiCallBack> GetPageConfig(string code) |
| | | { |
| | | |
| | | var userID= _contextUser.ID; |
| | | |
| | | var jm = new WebApiCallBack(); |
| | | |
| | | var wherePage = PredicateBuilder.True<CoreCmsPages>(); |
| | |
| | | break; |
| | | case "goodTabBar": |
| | | { |
| | | bool isDic = await _bfbfComAPIService.IsDictionary(_contextUser.ID); |
| | | var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); |
| | | if (parameters != null && parameters.ContainsKey("list")) |
| | | { |
| | |
| | | limit = limit > 0 ? limit : 10; |
| | | |
| | | var goods = await _goodsServices.QueryListByComponentsAsync(where, limit, p => p.createTime, OrderByType.Desc, true, true, 60); |
| | | |
| | | if(goods!=null) |
| | | { |
| | | //百分兵法经销商修改价格 |
| | | if(isDic) |
| | | { |
| | | foreach (var gd in goods) |
| | | { |
| | | gd.price = gd.distributionPrice; |
| | | } |
| | | } |
| | | } |
| | | if (goods != null && goods.Any()) |
| | | { |
| | | var result = JArray.FromObject(goods); |
| | |
| | | limit = limit > 0 ? limit : 10; |
| | | |
| | | var goods = await _goodsServices.QueryListByComponentsAsync(where, limit, " sort asc,id asc ", true, true, 60); |
| | | if (goods != null) |
| | | { |
| | | bool isDic = await _bfbfComAPIService.IsDictionary(_contextUser.ID); |
| | | //百分兵法经销商修改价格 |
| | | if (isDic) |
| | | { |
| | | foreach (var gd in goods) |
| | | { |
| | | gd.price = gd.distributionPrice; |
| | | } |
| | | } |
| | | } |
| | | if (goods != null && goods.Any()) |
| | | { |
| | | var result = JArray.FromObject(goods); |
| | |
| | | count = goodids.Count; |
| | | } |
| | | var goods = await _goodsServices.QueryListByComponentsAsync(where, count, orderBy, true, true, 60); |
| | | if (goods != null) |
| | | { |
| | | bool isDic = await _bfbfComAPIService.IsDictionary(_contextUser.ID); |
| | | //百分兵法经销商修改价格 |
| | | if (isDic) |
| | | { |
| | | foreach (var gd in goods) |
| | | { |
| | | gd.price = gd.distributionPrice; |
| | | } |
| | | } |
| | | } |
| | | if (goods != null && goods.Any()) |
| | | { |
| | | var result = JArray.FromObject(goods); |
| | |
| | | using CoreCms.Net.IRepository.UnitOfWork; |
| | | using CoreCms.Net.Configuration; |
| | | using CoreCms.Net.IRepository.UnitOfWork; |
| | | using CoreCms.Net.IServices; |
| | | using CoreCms.Net.IServices.baifenbingfa; |
| | | using CoreCms.Net.Model.Entities; |
| | | using CoreCms.Net.Utility.Helper; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | |
| | | private readonly ICoreCmsUserServices _userServices; |
| | | private readonly IUnitOfWork _unitOfWork; |
| | | |
| | | public BfbfComAPIService(ICoreCmsUserServices userServices,IUnitOfWork unitOfWork) |
| | | private readonly ICoreCmsSettingServices _coreCmsSettingServices; |
| | | public BfbfComAPIService(ICoreCmsUserServices userServices,IUnitOfWork unitOfWork, ICoreCmsSettingServices coreCmsSettingServices) |
| | | { |
| | | _userServices = userServices; |
| | | _unitOfWork = unitOfWork; |
| | | _coreCmsSettingServices = coreCmsSettingServices; |
| | | } |
| | | public async Task<List<SearchUserData>> SearchUserData(string s) |
| | | { |
| | |
| | | } |
| | | return ListData.Where(x => x.name.Contains(s)).ToList(); |
| | | } |
| | | |
| | | public async Task<bool> IsDictionary(int UserId) |
| | | { |
| | | if (UserId == 0) |
| | | return false; |
| | | var user=await _unitOfWork.GetDbClient().Queryable<CoreCmsUser>().Includes(x=>x.gradeInfo).Where(x=>x.id== UserId).WithCache(10).SingleAsync(); |
| | | if (user == null) |
| | | return false; |
| | | if(user.gradeInfo==null) |
| | | return false; |
| | | var allConfigs = await _coreCmsSettingServices.GetConfigDictionaries(); |
| | | var kc = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.DictionaryUserGroupKey); |
| | | if (user.gradeInfo.valueKey == kc) |
| | | return true; |
| | | return false; |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | container: 'LAY_app', // 容器ID |
| | | entry: 'index', // 默认视图文件名 |
| | | engine: '.html', // 视图文件后缀名 |
| | | pageTabs: true, // 是否开启页面选项卡功能。单页版不推荐开启 |
| | | pageTabs: false, // 是否开启页面选项卡功能。单页版不推荐开启 |
| | | refreshCurrPage: true, // 当跳转页面 url 与当前页 url 相同时,是否自动执行刷新 |
| | | |
| | | name: '百分兵法', |
| | |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-form-item"> |
| | | <label for="reMaker" class="layui-form-label" |
| | | >备注</label |
| | | > |
| | | <div class="layui-input-inline"> |
| | | <div class="layui-input-block"> |
| | | <input |
| | | name="reMaker" |
| | | lay-verType="tips" |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-form-item"> |
| | | <label for="reMaker" class="layui-form-label " |
| | | >备注</label |
| | | > |
| | |
| | | <div class="layui-form" id="batchSetting" style="display:none;"> |
| | | <div class="layui-tab" lay-filter="batchSetting-hash"> |
| | | <ul class="layui-tab-title"> |
| | | <li lay-id="22">SKU选择</li> |
| | | <li class="layui-this" lay-id="11">参数设置</li> |
| | | <li lay-id="22">图片设置</li> |
| | | </ul> |
| | | <div class="layui-tab-content"> |
| | | <div class="layui-tab-item"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">SKU选择</label> |
| | | <div class="layui-input-block" id="skuSetImage"></div> |
| | | </div> |
| | | <div class="layui-form-item layui-center"> |
| | | |
| | | <button class="layui-btn layui-btn-primary layui-border-blue layui-btn-xs" onclick="SellAll()">全选</button> |
| | | <button class="layui-btn layui-btn-primary layui-border-blue layui-btn-xs" onclick="SellNoOne()">全不选</button> |
| | | </div> |
| | | </div> |
| | | <div class="layui-tab-item layui-show"> |
| | | |
| | | <div class="layui-form-item"> |
| | |
| | | <input class="layui-input" id="oneKeySetWeight"> |
| | | </div> |
| | | <div class="layui-input-inline layui-inline-2"> |
| | | <button type="button" class="layui-btn layui-btn-warm layui-btn-sm" style="margin-top:5px;" onclick="oneKeySet(4)"> |
| | | <button type="button" class="layui-btn layui-btn-warm layui-btn-sm" style="margin-top:5px;" onclick="oneKeySetByName('product[weight]')"> |
| | | <i class="layui-icon layui-icon-set"></i>确定 |
| | | </button> |
| | | </div> |
| | |
| | | <i class="layui-icon layui-icon-set"></i>确定 |
| | | </button> |
| | | </div> |
| | | <label class="layui-form-label">经销商返现</label> |
| | | <label class="layui-form-label">普通用户购买返现</label> |
| | | <div class="layui-input-inline layui-inline-2"> |
| | | <input class="layui-input" id="oneKeySetLevelOne"> |
| | | </div> |
| | |
| | | |
| | | </div> |
| | | <div class="layui-tab-item"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">SKU选择</label> |
| | | <div class="layui-input-block" id="skuSetImage"></div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label" for="avatarImage">图片:</label> |
| | | <div class="layui-input-inline" style="margin-left:20px;"> |
| | |
| | | <th>积分最大<br />可抵金额</th> --> |
| | | <th>库存</th> |
| | | <th><i class="required-color">*</i>销售价</th> |
| | | <th>经销商价格</th> |
| | | <th>成本价</th> |
| | | <th>指导零售价</th> |
| | | <th>经销商返现</th> |
| | | <th>普通用户购买返现</th> |
| | | <th>经销商用户购买返现</th> |
| | | <!-- <th>二级返现</th> |
| | | <th>三级返现</th> --> |
| | | <th>操作</th> |
| | |
| | | <input type="text" name="product[price][]" value="{{item.price}}" placeholder="销售价" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[distributionPrice][]" value="{{item.distributionPrice||'0'}}" placeholder="经销商价格" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[costprice][]" value="{{item.costprice}}" placeholder="成本价" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[mktprice][]" value="{{item.mktprice}}" placeholder="指导零售价" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[levelOne][]" value="{{item.levelOne}}" placeholder="经销商返现" class="layui-input layui-inline-1"> |
| | | <input type="text" name="product[distributionCutMoney][]" value="{{item.distributionCutMoney||'0'}}" placeholder="经销商购买返现" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[cutMoney][]" value="{{item.cutMoney||'0'}}" placeholder="普通用户购买返现" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <!-- <td> |
| | | <input type="text" name="product[levelTwo][]" value="{{item.levelTwo}}" placeholder="二级返现" class="layui-input layui-inline-1"> |
| | |
| | | <div class="layui-input-inline"> |
| | | <button type="button" class="layui-btn layui-btn-warm layui-btn-sm" lay-active="getGenerateSpecBtn"><i class="layui-icon layui-icon-export"></i>生成SKU货品列表</button> |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <!-- <div class="layui-input-inline"> |
| | | <button type="button" class="aKeySetBtn layui-btn layui-btn-warm layui-btn-sm"> |
| | | <i class="layui-icon layui-icon-set"></i>一键设置 |
| | | </button> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | </div> |
| | | <div id="more_spec"></div> |
| | |
| | | <!--//一键设置SKU图片时自动生成选中的SKU--> |
| | | <script id="imageSetMoreSku_tpl" type="text/html"> |
| | | {{# layui.each(d, function(index, item){ }} |
| | | <input type="checkbox" name="skuAttrValue" value="{{item}}" title="{{item}}" lay-filter="skuAttrValue-filter"> |
| | | <input type="checkbox" name="skuAttrValue" value="{{item}}" title="{{item}}" class="class_onkeySet_checkbox_creat" lay-filter="skuAttrValue-filter"> |
| | | {{# }); }} |
| | | </script> |
| | | |
| | |
| | | view2.innerHTML = html; |
| | | }); |
| | | form.render("radio"); |
| | | |
| | | } |
| | | |
| | | //赋值数据 |
| | |
| | | //多参数产品库生成列表集合 |
| | | var products = []; |
| | | var productsCount = parseInt(field['productsCount']); |
| | | debugger |
| | | for (var i = 0; i < productsCount; i++) { |
| | | var productModel = {}; |
| | | productModel.costprice = field['product[costprice][' + i + ']']; |
| | |
| | | productModel.levelThree = field['product[levelThree][' + i + ']']; |
| | | productModel.pointsDeduction = field['product[pointsDeduction][' + i + ']']; |
| | | productModel.points = field['product[points][' + i + ']']; |
| | | //百分兵法添加 |
| | | productModel.distributionPrice = field['product[distributionPrice][' + i + ']']; |
| | | productModel.distributionCutMoney = field['product[distributionCutMoney][' + i + ']']; |
| | | productModel.cutMoney = field['product[cutMoney][' + i + ']']; |
| | | products.push(productModel); |
| | | } |
| | | //会员价格模型 |
| | |
| | | } |
| | | $('#imageIds').val(imgs); |
| | | } |
| | | function SellAll() |
| | | { |
| | | // 选取ID为ID_onkeySet_checkbox_creat的checkbox元素 |
| | | var checkBoxes = $(".class_onkeySet_checkbox_creat"); |
| | | |
| | | // 设置选中状态 |
| | | checkBoxes.prop("checked", true); |
| | | |
| | | // 如果使用了Layui Form模块,刷新表单状态 |
| | | if (typeof layui.form !== 'undefined') { |
| | | layui.form.render(); |
| | | } |
| | | } |
| | | |
| | | function SellNoOne() |
| | | { |
| | | // 选取ID为ID_onkeySet_checkbox_creat的checkbox元素 |
| | | var checkBoxes = $(".class_onkeySet_checkbox_creat"); |
| | | |
| | | // 设置选中状态 |
| | | checkBoxes.prop("checked", false); |
| | | |
| | | // 如果使用了Layui Form模块,刷新表单状态 |
| | | if (typeof layui.form !== 'undefined') { |
| | | layui.form.render(); |
| | | } |
| | | } |
| | | function setInputsValueTo(element, prefix, value) { |
| | | // 使用querySelectorAll获取所有input元素,其中name属性以prefix开头 |
| | | const inputs = element.querySelectorAll(`input[name^="${prefix}["]`); |
| | | |
| | | // 遍历所有找到的input元素 |
| | | inputs.forEach(input => { |
| | | // 检查name属性是否与prefix匹配 |
| | | if (new RegExp(`^${prefix}\\[\\d+\\]$`).test(input.name)) { |
| | | // 设置input的值为指定的value |
| | | input.value = value; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | function oneKeySetByName(name) |
| | | { |
| | | debugger |
| | | |
| | | setInputsValueTo(document.getElementById('productsTbody'),name,12); |
| | | // 调用递归函数,开始遍历指定父元素及其子孙元素 |
| | | // setValuesRecursively($("#yourParentElementId")); // 替换为实际父元素的ID |
| | | // 定义要遍历的父元素(例如:一个div) |
| | | //var parentElement = $("#productsTbody tr"); // 替换为实际父元素的ID |
| | | |
| | | // 使用正则表达式匹配name属性为scol[1-4]的input元素 |
| | | //parentElement.find(`input[${name}^='scol['][${name}$=']']`).val(12); |
| | | } |
| | | function oneKeySet(tag) { |
| | | var curValue = 0; |
| | | if (tag == 4) { |
| | |
| | | <th>积分最大<br />可抵金额</th> --> |
| | | <th>库存</th> |
| | | <th><i class="required-color">*</i>销售价</th> |
| | | <th>经销商价格</th> |
| | | <th>成本价</th> |
| | | <th>指导零售价</th> |
| | | <th>一级返现</th> |
| | | <th>普通用户购买返现</th> |
| | | <th>经销商用户购买返现</th> |
| | | <!-- <th>二级返现</th> |
| | | <th>三级返现</th> --> |
| | | <!-- <th>三级返现</th> --> --> |
| | | <th>冻结库存</th> |
| | | <th>操作</th> |
| | | </tr> |
| | |
| | | <input type="text" name="product[price][]" value="{{item.price}}" placeholder="销售价" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | |
| | | <input type="text" name="product[distributionPrice][]" value="{{item.distributionPrice||'0'}}" placeholder="经销商价格" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[costprice][]" value="{{item.costprice}}" placeholder="成本价" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[mktprice][]" value="{{item.mktprice}}" placeholder="指导零售价" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[levelOne][]" value="{{item.levelOne}}" placeholder="经销商返现" class="layui-input layui-inline-1"> |
| | | <input type="text" name="product[distributionCutMoney][]" value="{{item.distributionCutMoney||'0'}}" placeholder="经销商购买返现" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[cutMoney][]" value="{{item.cutMoney|'0'}}" placeholder="普通用户购买返现" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <!-- <td> |
| | | <input type="text" name="product[levelTwo][]" value="{{item.levelTwo}}" placeholder="二级返现" class="layui-input layui-inline-1"> |
| | |
| | | <div class="layui-input-inline"> |
| | | <button type="button" class="layui-btn layui-btn-warm layui-btn-sm" lay-active="getGenerateSpecBtn"><i class="layui-icon layui-icon-export"></i>生成SKU货品列表</button> |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <!-- <div class="layui-input-inline"> |
| | | <button type="button" class="aKeySetBtn layui-btn layui-btn-warm layui-btn-sm"> |
| | | <i class="layui-icon layui-icon-set"></i>一键设置 |
| | | </button> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | </div> |
| | | <div id="more_spec"></div> |
| | |
| | | productModel.levelThree = field['product[levelThree][' + i + ']']; |
| | | productModel.pointsDeduction = field['product[pointsDeduction][' + i + ']']; |
| | | productModel.points = field['product[points][' + i + ']']; |
| | | //添加 百分兵法 |
| | | productModel.distributionPrice = field['product[distributionPrice][' + i + ']']; |
| | | productModel.distributionCutMoney = field['product[distributionCutMoney][' + i + ']']; |
| | | productModel.cutMoney = field['product[cutMoney][' + i + ']']; |
| | | products.push(productModel); |
| | | } |
| | | //会员价格模型 |
| | |
| | | using CoreCms.Net.Configuration; |
| | | using CoreCms.Net.DTO.ComponentsDTO; |
| | | using CoreCms.Net.IServices; |
| | | using CoreCms.Net.IServices.baifenbingfa; |
| | | using CoreCms.Net.Model.Entities; |
| | | using CoreCms.Net.Model.Entities.Expression; |
| | | using CoreCms.Net.Model.FromBody; |
| | |
| | | private ICoreCmsAgentGradeServices _agentGradeServices; |
| | | private ICoreCmsGoodsCategoryExtendServices _goodsCategoryExtendServices; |
| | | private readonly ICoreCmsAreaServices _coreCmsAreaServices; |
| | | private readonly IBfbfComAPIService _bfbfComAPIService; |
| | | |
| | | /// <summary> |
| | | /// 构造函数 |
| | |
| | | ICoreCmsAgentProductsServices agentProductsServices, |
| | | ICoreCmsAgentGradeServices agentGradeServices, |
| | | ICoreCmsGoodsCategoryExtendServices goodsCategoryExtendServices, |
| | | ICoreCmsAreaServices areaServices |
| | | ICoreCmsAreaServices areaServices, |
| | | IBfbfComAPIService bfbfComAPIService |
| | | |
| | | ) |
| | | { |
| | |
| | | _agentGradeServices = agentGradeServices; |
| | | _goodsCategoryExtendServices = goodsCategoryExtendServices; |
| | | _coreCmsAreaServices = areaServices; |
| | | _bfbfComAPIService = bfbfComAPIService; |
| | | } |
| | | |
| | | //公共接口==================================================================================================== |
| | |
| | | var jm = new WebApiCallBack(); |
| | | |
| | | var where = PredicateBuilder.True<GoodListDTO>(); |
| | | //是否是经销商 |
| | | bool isDic = false; |
| | | if (_user.ID > 0) |
| | | { |
| | | isDic = await _bfbfComAPIService.IsDictionary(_user.ID); |
| | | |
| | | }; |
| | | |
| | | var className = string.Empty; |
| | | if (!string.IsNullOrWhiteSpace(entity.where)) |
| | |
| | | |
| | | //获取数据 |
| | | var list = await _goodsServices.QueryPageByDTOAsync(where, entity.page, entity.limit, true); |
| | | |
| | | |
| | | //获取品牌 |
| | | var brands = await _brandServices.QueryListByClauseAsync(p => p.isShow == true, p => p.sort, OrderByType.Desc, true, true); |
| | |
| | | |
| | | item.area+= (await _coreCmsAreaServices.GetAreaString(code)+""); |
| | | } |
| | | //调整经销商价格 百分兵法 |
| | | if(isDic) |
| | | { |
| | | item.price = item.distributionPrice; |
| | | } |
| | | |
| | | } |
| | | //返回数据 |
| | | jm.status = true; |
| | |
| | | } |
| | | |
| | | var model = await _goodsServices.GetGoodsDetail(entity.id, userId, false, "goods", 0, entity.data.ObjectToBool()); |
| | | |
| | | |
| | | if (model == null) |
| | | { |
| | | jm.msg = "商品获取失败"; |
| | | return jm; |
| | | } |
| | | if (await _bfbfComAPIService.IsDictionary(user.id)) |
| | | { |
| | | //百分兵法经销商 |
| | | model.product.price = model.product.distributionPrice; |
| | | } |
| | | var codelist = model.areaCode?.Split(","); |
| | | model.area = ""; |
| | | if(codelist!=null) |
| | |
| | | using AutoMapper; |
| | | using CoreCms.Net.Configuration; |
| | | using CoreCms.Net.IServices; |
| | | using CoreCms.Net.IServices.baifenbingfa; |
| | | using CoreCms.Net.Model.Entities; |
| | | using CoreCms.Net.Model.FromBody; |
| | | using CoreCms.Net.Model.ViewModels.DTO; |
| | |
| | | private readonly ICoreCmsPagesServices _pagesServices; |
| | | private readonly ICoreCmsOrderServices _orderServices; |
| | | private readonly ICoreCmsUserServices _userServices; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 构造函数 |
| | |
| | | , ICoreCmsSettingServices settingServices |
| | | , ICoreCmsPagesServices pagesServices |
| | | , ICoreCmsOrderServices orderServices |
| | | , ICoreCmsUserServices userServices) |
| | | , ICoreCmsUserServices userServices |
| | | ,IBfbfComAPIService bfbfComAPIService) |
| | | { |
| | | _mapper = mapper; |
| | | _settingServices = settingServices; |
| | | _pagesServices = pagesServices; |
| | | _orderServices = orderServices; |
| | | _userServices = userServices; |
| | | |
| | | } |
| | | |
| | | //公共接口==================================================================================================== |
| | |
| | | 商品相关接口处理 |
| | | </summary> |
| | | </member> |
| | | <member name="M:CoreCms.Net.Web.WebApi.Controllers.GoodController.#ctor(AutoMapper.IMapper,CoreCms.Net.Auth.HttpContextUser.IHttpContextUser,CoreCms.Net.IServices.ICoreCmsSettingServices,CoreCms.Net.IServices.ICoreCmsGoodsCategoryServices,CoreCms.Net.IServices.ICoreCmsGoodsServices,CoreCms.Net.IServices.ICoreCmsProductsServices,CoreCms.Net.IServices.ICoreCmsBrandServices,CoreCms.Net.IServices.ICoreCmsOrderItemServices,CoreCms.Net.IServices.ICoreCmsGoodsCommentServices,CoreCms.Net.IServices.ICoreCmsGoodsParamsServices,CoreCms.Net.IServices.ICoreCmsGoodsCollectionServices,CoreCms.Net.IServices.ICoreCmsUserServices,CoreCms.Net.IServices.ICoreCmsAgentServices,CoreCms.Net.IServices.ICoreCmsAgentProductsServices,CoreCms.Net.IServices.ICoreCmsAgentGradeServices,CoreCms.Net.IServices.ICoreCmsGoodsCategoryExtendServices,CoreCms.Net.IServices.ICoreCmsAreaServices)"> |
| | | <member name="M:CoreCms.Net.Web.WebApi.Controllers.GoodController.#ctor(AutoMapper.IMapper,CoreCms.Net.Auth.HttpContextUser.IHttpContextUser,CoreCms.Net.IServices.ICoreCmsSettingServices,CoreCms.Net.IServices.ICoreCmsGoodsCategoryServices,CoreCms.Net.IServices.ICoreCmsGoodsServices,CoreCms.Net.IServices.ICoreCmsProductsServices,CoreCms.Net.IServices.ICoreCmsBrandServices,CoreCms.Net.IServices.ICoreCmsOrderItemServices,CoreCms.Net.IServices.ICoreCmsGoodsCommentServices,CoreCms.Net.IServices.ICoreCmsGoodsParamsServices,CoreCms.Net.IServices.ICoreCmsGoodsCollectionServices,CoreCms.Net.IServices.ICoreCmsUserServices,CoreCms.Net.IServices.ICoreCmsAgentServices,CoreCms.Net.IServices.ICoreCmsAgentProductsServices,CoreCms.Net.IServices.ICoreCmsAgentGradeServices,CoreCms.Net.IServices.ICoreCmsGoodsCategoryExtendServices,CoreCms.Net.IServices.ICoreCmsAreaServices,CoreCms.Net.IServices.baifenbingfa.IBfbfComAPIService)"> |
| | | <summary> |
| | | 构造函数 |
| | | </summary> |
| | |
| | | 页面接口 |
| | | </summary> |
| | | </member> |
| | | <member name="M:CoreCms.Net.Web.WebApi.Controllers.PageController.#ctor(AutoMapper.IMapper,CoreCms.Net.IServices.ICoreCmsSettingServices,CoreCms.Net.IServices.ICoreCmsPagesServices,CoreCms.Net.IServices.ICoreCmsOrderServices,CoreCms.Net.IServices.ICoreCmsUserServices)"> |
| | | <member name="M:CoreCms.Net.Web.WebApi.Controllers.PageController.#ctor(AutoMapper.IMapper,CoreCms.Net.IServices.ICoreCmsSettingServices,CoreCms.Net.IServices.ICoreCmsPagesServices,CoreCms.Net.IServices.ICoreCmsOrderServices,CoreCms.Net.IServices.ICoreCmsUserServices,CoreCms.Net.IServices.baifenbingfa.IBfbfComAPIService)"> |
| | | <summary> |
| | | 构造函数 |
| | | </summary> |