| | |
| | | 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; |
| | |
| | | namespace CoreCms.Net.RedisMQ |
| | | { |
| | | /// <summary> |
| | | /// 订单完结后走代理或分销商提成处理 |
| | | /// 订单完结后走代理或经销商提成处理 |
| | | /// </summary> |
| | | public class OrderAgentOrDistributionSubscribe : IRedisSubscribe |
| | | { |
| | |
| | | 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> |
| | | /// 订单完结后走代理或分销商提成处理 |
| | | /// 订单完结后走代理或经销商提成处理 |
| | | /// </summary> |
| | | /// <param name="msg"></param> |
| | | /// <returns></returns> |
| | |
| | | case (int)GlobalEnumVars.CommissionChannel.仅分销 when openDistribution == 1: |
| | | { |
| | | 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(); |
| | | //判断是否分销商 |
| | | //判断是否经销商 |
| | | if (check == false) |
| | | { |
| | | await _distributionServices.CheckCondition(allConfigs, info, order.userId); |
| | |
| | | } |
| | | |
| | | await _distributionOrderServices.AddData(order); //添加分享关联订单日志 |
| | | //判断是否可以成为分销商 |
| | | //判断是否可以成为经销商 |
| | | //先判断是否已经是经销商了。 |
| | | bool check = await _distributionServices.ExistsAsync(p => p.userId == order.userId); |
| | | var distributionType = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.DistributionType).ObjectToInt(0); |
| | | if (distributionType == 3) //无需审核,但是要满足提交 |
| | | { |
| | | var info = new CoreCmsDistribution(); |
| | | //判断是否分销商 |
| | | //判断是否经销商 |
| | | if (check == false) |
| | | { |
| | | await _distributionServices.CheckCondition(allConfigs, info, order.userId); |
| | |
| | | iData.name = !string.IsNullOrEmpty(user.nickName) ? user.nickName : user.mobile; |
| | | iData.verifyStatus = (int)GlobalEnumVars.DistributionVerifyStatus.VerifyYes; |
| | | iData.verifyTime = DateTime.Now; |
| | | |
| | | await _distributionServices.AddData(iData, order.userId); |
| | | } |
| | | } |
| | |
| | | if (distributionType == 3) //无需审核,但是要满足提交 |
| | | { |
| | | var info = new CoreCmsDistribution(); |
| | | //判断是否分销商 |
| | | //判断是否经销商 |
| | | if (check == false) |
| | | { |
| | | await _distributionServices.CheckCondition(allConfigs, info, order.userId); |