| | |
| | | /*********************************************************************** |
| | | * ProjectName: 百分兵法管理系统 |
| | | * Web: hhtp://chuanyin.com |
| | | * Web: http://chuanyin.com |
| | | * Author: |
| | | * Email: |
| | | * CreateTime: 202403/02 |
| | |
| | | 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) |