调整部分业务逻辑
parent
8da2c4bc7a
commit
ecb063a114
|
|
@ -15,6 +15,7 @@ using New_College.Model;
|
|||
using New_College.Model.Models;
|
||||
using New_College.Model.Request;
|
||||
using New_College.Model.ViewModels;
|
||||
using New_College.Repository;
|
||||
|
||||
namespace New_College.Api.Controllers.Front
|
||||
{
|
||||
|
|
@ -27,12 +28,14 @@ namespace New_College.Api.Controllers.Front
|
|||
private readonly ID_UserSettingBaseServices _userSetting;
|
||||
private readonly ICasdoorUserServices _casdoorUserServices;
|
||||
private readonly ID_FansDistributionServices _fansDistributionServices;
|
||||
public CustomerController(IV_CustomerInfoServices IV_CustomerInfoServices, ID_UserSettingBaseServices userSetting, ICasdoorUserServices casdoorUserServices, ID_FansDistributionServices fansDistributionServices)
|
||||
private readonly IQuestionNaireRepository _naireRepository;
|
||||
public CustomerController(IV_CustomerInfoServices IV_CustomerInfoServices, ID_UserSettingBaseServices userSetting, ICasdoorUserServices casdoorUserServices, ID_FansDistributionServices fansDistributionServices, IQuestionNaireRepository questionNaireRepository)
|
||||
{
|
||||
_services = IV_CustomerInfoServices;
|
||||
_userSetting = userSetting;
|
||||
_casdoorUserServices = casdoorUserServices;
|
||||
_fansDistributionServices = fansDistributionServices;
|
||||
_naireRepository = questionNaireRepository;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -105,11 +108,12 @@ namespace New_College.Api.Controllers.Front
|
|||
}
|
||||
else
|
||||
{
|
||||
await _services.Add(new V_CustomerInfo() {
|
||||
|
||||
|
||||
await _services.Add(new V_CustomerInfo()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -282,7 +286,7 @@ namespace New_College.Api.Controllers.Front
|
|||
var count = (await _fansDistributionServices.Query(e => e.SaleId == saleId)).Count();//判断邀请人数是否满足三个人
|
||||
if (count >= 3)
|
||||
{
|
||||
|
||||
|
||||
await _services.UpdateIsVip(saleId);
|
||||
}
|
||||
return true;
|
||||
|
|
@ -498,5 +502,35 @@ namespace New_College.Api.Controllers.Front
|
|||
{
|
||||
return await _services.GetCustomerInfoById(query);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 问卷保存
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<MessageModel<bool>> QuestionNaireSave([FromBody] QuestionNaireDto dto)
|
||||
{
|
||||
var count = await _naireRepository.Add(new QuestionNaire()
|
||||
{
|
||||
Id = dto.id,
|
||||
CreateTime = DateTime.Now,
|
||||
infoList = dto.infoList,
|
||||
IsDelete = false,
|
||||
ModifyTime = DateTime.Now,
|
||||
OrderSort = 0
|
||||
});
|
||||
return new MessageModel<bool>()
|
||||
{
|
||||
response = count > 0,
|
||||
success = true,
|
||||
msg = "",
|
||||
status = 200
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
using SqlSugar;
|
||||
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 QuestionNaire : EntityModel
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable = false, IsPrimaryKey = true, IsIdentity = true)]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 学校名称
|
||||
/// </summary>
|
||||
[SugarColumn(Length = int.MaxValue)]
|
||||
public string infoList { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -22,6 +22,25 @@ namespace New_College.Model.ViewModels
|
|||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class QuestionNaireDto
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string infoList { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class UserBaseSettingDto
|
||||
{
|
||||
public int CustomerId { get; set; }
|
||||
|
|
|
|||
|
|
@ -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 IQuestionNaireRepository : IBaseRepository<QuestionNaire>
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
using New_College.IRepository;
|
||||
using New_College.IRepository.UnitOfWork;
|
||||
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 QuestionNaireRepository : BaseRepository<QuestionNaire>, IQuestionNaireRepository
|
||||
{
|
||||
public QuestionNaireRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue