feat:新增粉丝裂变Id
parent
bba933cf62
commit
99901ec2a0
|
|
@ -26,11 +26,13 @@ namespace New_College.Api.Controllers.Front
|
||||||
private readonly IV_CustomerInfoServices _services;
|
private readonly IV_CustomerInfoServices _services;
|
||||||
private readonly ID_UserSettingBaseServices _userSetting;
|
private readonly ID_UserSettingBaseServices _userSetting;
|
||||||
private readonly ICasdoorUserServices _casdoorUserServices;
|
private readonly ICasdoorUserServices _casdoorUserServices;
|
||||||
public CustomerController(IV_CustomerInfoServices IV_CustomerInfoServices, ID_UserSettingBaseServices userSetting, ICasdoorUserServices casdoorUserServices)
|
private readonly ID_FansDistributionServices _fansDistributionServices;
|
||||||
|
public CustomerController(IV_CustomerInfoServices IV_CustomerInfoServices, ID_UserSettingBaseServices userSetting, ICasdoorUserServices casdoorUserServices, ID_FansDistributionServices fansDistributionServices)
|
||||||
{
|
{
|
||||||
_services = IV_CustomerInfoServices;
|
_services = IV_CustomerInfoServices;
|
||||||
_userSetting = userSetting;
|
_userSetting = userSetting;
|
||||||
_casdoorUserServices = casdoorUserServices;
|
_casdoorUserServices = casdoorUserServices;
|
||||||
|
_fansDistributionServices = fansDistributionServices;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -198,8 +200,12 @@ namespace New_College.Api.Controllers.Front
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
|
await DistrFanc(request.SaleId, customerinfo.Id);
|
||||||
newId = await updatesync(customerinfo.Phone);
|
newId = await updatesync(customerinfo.Phone);
|
||||||
}catch (Exception ex) {
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new MessageModel<string>()
|
return new MessageModel<string>()
|
||||||
|
|
@ -210,6 +216,36 @@ namespace New_College.Api.Controllers.Front
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 增加粉丝
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="saleId"></param>
|
||||||
|
/// <param name="fancId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private async Task<bool> DistrFanc(int saleId, int fancId)
|
||||||
|
{
|
||||||
|
if (saleId > 0)
|
||||||
|
{
|
||||||
|
var exist = await _fansDistributionServices.Query(q => q.FansId == fancId);
|
||||||
|
if (!exist.Any())
|
||||||
|
{
|
||||||
|
await _fansDistributionServices.Add(new D_FansDistribution()
|
||||||
|
{
|
||||||
|
CreateTime = DateTime.Now,
|
||||||
|
IsDelete = false,
|
||||||
|
OrderSort = 0,
|
||||||
|
ModifyTime = DateTime.Now,
|
||||||
|
FansId = fancId,
|
||||||
|
SaleId = saleId,
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 同步合并数据
|
/// 同步合并数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -210,6 +210,21 @@
|
||||||
|
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:New_College.Model.Models.D_FansDistribution">
|
||||||
|
<summary>
|
||||||
|
销售分销表
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.Models.D_FansDistribution.FansId">
|
||||||
|
<summary>
|
||||||
|
客户Id
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.Models.D_FansDistribution.SaleId">
|
||||||
|
<summary>
|
||||||
|
销售id
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:New_College.Model.Models.D_HollandMapExplain.Tag">
|
<member name="P:New_College.Model.Models.D_HollandMapExplain.Tag">
|
||||||
<summary>
|
<summary>
|
||||||
标签
|
标签
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
using New_College.IServices.BASE;
|
||||||
|
using New_College.Model.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace New_College.IServices
|
||||||
|
{
|
||||||
|
|
||||||
|
public interface ID_FansDistributionServices : IBaseServices<D_FansDistribution>
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace New_College.Model.Models
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 销售分销表
|
||||||
|
/// </summary>
|
||||||
|
public class D_FansDistribution : EntityModel
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 客户Id
|
||||||
|
/// </summary>
|
||||||
|
public int FansId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 销售id
|
||||||
|
/// </summary>
|
||||||
|
public int SaleId { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -28,6 +28,8 @@ namespace New_College.Model.Request
|
||||||
{
|
{
|
||||||
public string openId { get; set; }
|
public string openId { get; set; }
|
||||||
public string code { get; set; }
|
public string code { get; set; }
|
||||||
|
public int SaleId { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
using New_College.IRepository.UnitOfWork;
|
||||||
|
using New_College.IRepository;
|
||||||
|
using New_College.Model.Models;
|
||||||
|
using New_College.Repository.Base;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace New_College.Repository
|
||||||
|
{
|
||||||
|
|
||||||
|
public class D_FansDistributionRepository : BaseRepository<D_FansDistribution>, ID_FansDistributionRepository
|
||||||
|
{
|
||||||
|
public D_FansDistributionRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
using New_College.IRepository.Base;
|
||||||
|
using New_College.Model.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace New_College.Repository
|
||||||
|
{
|
||||||
|
public interface ID_FansDistributionRepository : IBaseRepository<D_FansDistribution>
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
using New_College.IRepository.Base;
|
||||||
|
using New_College.IServices;
|
||||||
|
using New_College.Model.Models;
|
||||||
|
using New_College.Services.BASE;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace New_College.Services
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 销售粉丝统计
|
||||||
|
/// </summary>
|
||||||
|
public class D_FansDistributionServices : BaseServices<D_FansDistribution>, ID_FansDistributionServices
|
||||||
|
{
|
||||||
|
private readonly IBaseRepository<D_FansDistribution> _dal;
|
||||||
|
public D_FansDistributionServices(IBaseRepository<D_FansDistribution> dal)
|
||||||
|
{
|
||||||
|
this._dal = dal;
|
||||||
|
base.BaseDal = dal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue