Commit e7c50011 authored by 黄奎's avatar 黄奎

Merge branch 'master' of http://gitlab.oytour.com/Kui2/education

parents 20d178bc 79ef765a
......@@ -425,5 +425,10 @@ namespace Edu.Model.Entity.Sell
/// 內推续费返佣比例
/// </summary>
public decimal InnerRecommendReNewRatio { get; set; }
/// <summary>
/// 订单标识 1产品下单 2客户转订单
/// </summary>
public int OrderIdentify { get; set; }
}
}
......@@ -284,5 +284,15 @@ namespace Edu.Model.ViewModel.Sell
/// 课程图标
/// </summary>
public string B2BIcon { get; set; }
/// <summary>
/// 预计正常返佣
/// </summary>
public decimal NormalCommission { get; set; }
/// <summary>
/// 预计续费返佣
/// </summary>
public decimal RenewCommission { get; set; }
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -18,6 +18,7 @@ using Edu.Model.Entity.Contract;
using Edu.Model.Entity.Course;
using Edu.Model.ViewModel.Contract;
using Edu.Common.Enum.Course;
using Edu.Model.ViewModel.User;
namespace Edu.Module.Course
{
......@@ -298,5 +299,51 @@ namespace Edu.Module.Course
}
return flag;
}
/// <summary>
/// 获取客户转订单时客户的续费状态
/// </summary>
/// <param name="stuIds"></param>
/// <param name="userInfo"></param>
/// <param name="msg"></param>
/// <returns></returns>
public object GetOrderGuestRenewState(string stuIds, UserInfo userInfo, out string message)
{
message = "";
//查询学生列表
var StuList = studentRepository.GetStudentListRepository(new RB_Student_ViewModel() { Group_Id = userInfo.Group_Id, StuIds = stuIds });
//根据客人手机号码 验证是否是续费
if (StuList.Select(x => x.CustomerId).Distinct().Count() > 1)
{
message = "只能选择同一同行的客户报名";
return false;
}
int CustomerId = StuList.FirstOrDefault().CustomerId;
var glist = order_GuestRepository.GetGuestListForMobile(StuList.Select(x => x.StuTel).ToList(), CustomerId, userInfo.Group_Id);
if (glist.Any())
{
foreach (var item in StuList)
{
if (glist.Where(x => x.Mobile == item.StuTel).Any())
{
item.IsRenewGuest = 1;//是续费的
}
}
}
int RenewNum = glist.Select(x => x.Mobile).Distinct().Count();//续费订单数量
return new
{
CustomerId,
RenewNum,
StuList = StuList.Select(x => new
{
x.StuId,
x.StuName,
x.StuTel,
x.IsRenewGuest
})
};
}
}
}
\ No newline at end of file
......@@ -464,6 +464,27 @@ namespace Edu.WebApi.Controllers.Course
}));
}
/// <summary>
/// 获取客户转订单续费状态
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetOrderGuestRenewState() {
var userInfo = base.UserInfo;
string StuIds = base.ParmJObj.GetStringValue("StuIds");
if (string.IsNullOrEmpty(StuIds)) {
return ApiResult.ParamIsNull("请传递学生名单");
}
var Robj = orderModule.GetOrderGuestRenewState(StuIds, userInfo, out string msg);
if (msg == "")
{
return ApiResult.Success("", Robj);
}
else {
return ApiResult.Failed(msg);
}
}
/// <summary>
/// 新增修改订单
......@@ -503,7 +524,8 @@ namespace Edu.WebApi.Controllers.Course
LessPrice = base.ParmJObj.GetDecimal("LessPrice"),
PerLessMoney = base.ParmJObj.GetDecimal("PerLessMoney"),
CustomerId = base.ParmJObj.GetInt("CustomerId"),
StuIds = base.ParmJObj.GetStringValue("StuIds")
StuIds = base.ParmJObj.GetStringValue("StuIds"),
OrderIdentify = base.ParmJObj.GetInt("OrderIdentify"),
};
var IsInsertClass = base.ParmJObj.GetInt("IsChaBan");
if (IsInsertClass == 1)
......@@ -526,7 +548,10 @@ namespace Edu.WebApi.Controllers.Course
{
return ApiResult.ParamIsNull("请选择客人来源");
}
if (demodel.OrderIdentify == 2 && string.IsNullOrEmpty(demodel.StuIds))
{
return ApiResult.ParamIsNull("请传递选择客户");
}
if (!string.IsNullOrEmpty(demodel.StuIds)) {
int gNum = JsonHelper.DeserializeObject<List<int>>("[" + demodel.StuIds + "]").Count();
if (demodel.GuestNum != gNum) {
......
......@@ -696,6 +696,7 @@ namespace Edu.WebApi.Controllers.User
item.StuChannel,
StuChannelName= item.StuChannel.ToName(),
item.PlatformName,
item.CustomerId,
AssistList = item.AssistList.Select(qitem => new
{
qitem.Id,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment