Commit 5351d705 authored by liudong1993's avatar liudong1993

留学 价格设置

parent 7c72ee25
using Edu.Common.Enum;
using Edu.Common.Enum.Course;
using Edu.Common.Enum.Sale;
using Edu.Common.Enum.StudyAbroad;
using System;
......@@ -152,5 +153,170 @@ namespace Edu.Model.Entity.StudyAbroad
/// 留学国家编号
/// </summary>
public int StudyCountryId { get; set; }
/// <summary>
/// 直客首次报名优惠比例
/// </summary>
public decimal B2CRatio { get; set; }
/// <summary>
/// 直客续费优惠比例
/// </summary>
public decimal B2CReNewRatio { get; set; }
/// <summary>
/// 一般同行首次报名返佣比例
/// </summary>
public decimal B2BRebateRatio { get; set; }
/// <summary>
/// 一般同行首次报名返佣类型
/// </summary>
public CourseRebateSetEnum B2BRebateRatioType { get; set; }
/// <summary>
/// 一般同行首次报名返佣课程比例值
/// </summary>
public decimal B2BRebateRatioValue { get; set; }
/// <summary>
/// 一般同行续费返佣比例
/// </summary>
public decimal B2BReNewRatio { get; set; }
/// <summary>
/// 一般同行续费返佣类型
/// </summary>
public CourseRebateSetEnum B2BReNewRatioType { get; set; }
/// <summary>
/// 一般同行续费返佣课程比例值
/// </summary>
public decimal B2BReNewRatioValue { get; set; }
/// <summary>
/// 校代同行首次报名返佣比例
/// </summary>
public decimal SchoolRebateRatio { get; set; }
/// <summary>
/// 校代同行首次返佣类型
/// </summary>
public CourseRebateSetEnum SchoolRebateRatioType { get; set; }
/// <summary>
/// 校代同行首次返佣课程比例值
/// </summary>
public decimal SchoolRebateRatioValue { get; set; }
/// <summary>
/// 校代同行续费返佣比例
/// </summary>
public decimal SchoolReNewRatio { get; set; }
/// <summary>
/// 校代同行续费返佣类型
/// </summary>
public CourseRebateSetEnum SchoolReNewRatioType { get; set; }
/// <summary>
/// 校代同行续费返佣课程比例值
/// </summary>
public decimal SchoolReNewRatioValue { get; set; }
/// <summary>
/// 转介首次报名返佣比例
/// </summary>
public decimal TransIntroductceRatio { get; set; }
/// <summary>
/// 转介首次报名返佣类型
/// </summary>
public CourseRebateSetEnum TransIntroductceRatioType { get; set; }
/// <summary>
/// 转介首次报名返佣课程比例值
/// </summary>
public decimal TransIntroductceRatioValue { get; set; }
/// <summary>
/// 转介续费返佣比例
/// </summary>
public decimal TransIntroductceReNewRatio { get; set; }
/// <summary>
/// 转介续费返佣类型
/// </summary>
public CourseRebateSetEnum TransIntroductceReNewRatioType { get; set; }
/// <summary>
/// 转介续费返佣课程比例值
/// </summary>
public decimal TransIntroductceReNewRatioValue { get; set; }
/// <summary>
/// 內推首次报名返佣比例
/// </summary>
public decimal InnerRecommendRatio { get; set; }
/// <summary>
/// 內推首次报名返佣类型
/// </summary>
public CourseRebateSetEnum InnerRecommendRatioType { get; set; }
/// <summary>
/// 內推首次报名返佣课程比例值
/// </summary>
public decimal InnerRecommendRatioValue { get; set; }
/// <summary>
/// 內推续费返佣比例
/// </summary>
public decimal InnerRecommendReNewRatio { get; set; }
/// <summary>
/// 內推续费返佣类型
/// </summary>
public CourseRebateSetEnum InnerRecommendReNewRatioType { get; set; }
/// <summary>
/// 內推续费返佣课程比例值
/// </summary>
public decimal? InnerRecommendReNewRatioValue { get; set; }
/// <summary>
/// 返佣类型(1比例返佣,2-固定金额返佣)
/// </summary>
public int CommissionReType { get; set; }
/// <summary>
/// 直客首次报名返佣比例
/// </summary>
public decimal B2CRbRatio { get; set; }
/// <summary>
/// 直客首次报名返佣类型
/// </summary>
public CourseRebateSetEnum B2CRbRatioType { get; set; }
/// <summary>
/// 直客首次报名返佣类型值
/// </summary>
public decimal B2CRbRatioValue { get; set; }
/// <summary>
/// 直客续费返佣比例
/// </summary>
public decimal B2CRNRatio { get; set; }
/// <summary>
/// 直客续费返佣类型
/// </summary>
public CourseRebateSetEnum B2CRNRatioType { get; set; }
/// <summary>
/// 直客续费返佣类型值
/// </summary>
public decimal B2CRNRatioValue { get; set; }
}
}
......@@ -379,5 +379,62 @@ namespace Edu.Module.StudyAbroad
bool flag = studyAbroadRepository.Update(fileds, new WhereHelper(nameof(RB_StudyAbroad_ViewModel.Id), model.Id));
return flag;
}
/// <summary>
/// 设置留学就业产品价格及返佣
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public string SetStudyAbroadPrice(RB_StudyAbroad_ViewModel demodel)
{
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_StudyAbroad_ViewModel.SuggestPrice), demodel.SuggestPrice},
{ nameof(RB_StudyAbroad_ViewModel.SellPrice), demodel.SellPrice},
{ nameof(RB_StudyAbroad_ViewModel.B2CRatio), demodel.B2CRatio},
{ nameof(RB_StudyAbroad_ViewModel.B2CReNewRatio), demodel.B2CReNewRatio},
{ nameof(RB_StudyAbroad_ViewModel.B2BRebateRatio), demodel.B2BRebateRatio},
{ nameof(RB_StudyAbroad_ViewModel.B2BRebateRatioType), demodel.B2BRebateRatioType},
{ nameof(RB_StudyAbroad_ViewModel.B2BRebateRatioValue), demodel.B2BRebateRatioValue},
{ nameof(RB_StudyAbroad_ViewModel.B2BReNewRatio), demodel.B2BReNewRatio},
{ nameof(RB_StudyAbroad_ViewModel.B2BReNewRatioType), demodel.B2BReNewRatioType},
{ nameof(RB_StudyAbroad_ViewModel.B2BReNewRatioValue), demodel.B2BReNewRatioValue},
{ nameof(RB_StudyAbroad_ViewModel.SchoolRebateRatio), demodel.SchoolRebateRatio},
{ nameof(RB_StudyAbroad_ViewModel.SchoolRebateRatioType), demodel.SchoolRebateRatioType},
{ nameof(RB_StudyAbroad_ViewModel.SchoolRebateRatioValue), demodel.SchoolRebateRatioValue},
{ nameof(RB_StudyAbroad_ViewModel.SchoolReNewRatio), demodel.SchoolReNewRatio},
{ nameof(RB_StudyAbroad_ViewModel.SchoolReNewRatioType), demodel.SchoolReNewRatioType},
{ nameof(RB_StudyAbroad_ViewModel.SchoolReNewRatioValue), demodel.SchoolReNewRatioValue},
{ nameof(RB_StudyAbroad_ViewModel.TransIntroductceRatio), demodel.TransIntroductceRatio},
{ nameof(RB_StudyAbroad_ViewModel.TransIntroductceRatioType), demodel.TransIntroductceRatioType},
{ nameof(RB_StudyAbroad_ViewModel.TransIntroductceRatioValue), demodel.TransIntroductceRatioValue},
{ nameof(RB_StudyAbroad_ViewModel.TransIntroductceReNewRatio), demodel.TransIntroductceReNewRatio},
{ nameof(RB_StudyAbroad_ViewModel.TransIntroductceReNewRatioType), demodel.TransIntroductceReNewRatioType},
{ nameof(RB_StudyAbroad_ViewModel.TransIntroductceReNewRatioValue), demodel.TransIntroductceReNewRatioValue},
{ nameof(RB_StudyAbroad_ViewModel.InnerRecommendRatio), demodel.InnerRecommendRatio},
{ nameof(RB_StudyAbroad_ViewModel.InnerRecommendRatioType), demodel.InnerRecommendRatioType},
{ nameof(RB_StudyAbroad_ViewModel.InnerRecommendRatioValue), demodel.InnerRecommendRatioValue},
{ nameof(RB_StudyAbroad_ViewModel.InnerRecommendReNewRatio), demodel.InnerRecommendReNewRatio},
{ nameof(RB_StudyAbroad_ViewModel.InnerRecommendReNewRatioType), demodel.InnerRecommendReNewRatioType},
{ nameof(RB_StudyAbroad_ViewModel.InnerRecommendReNewRatioValue), demodel.InnerRecommendReNewRatioValue},
{ nameof(RB_StudyAbroad_ViewModel.CommissionReType), demodel.CommissionReType},
{ nameof(RB_StudyAbroad_ViewModel.B2CRbRatio), demodel.B2CRbRatio},
{ nameof(RB_StudyAbroad_ViewModel.B2CRbRatioType), demodel.B2CRbRatioType},
{ nameof(RB_StudyAbroad_ViewModel.B2CRbRatioValue), demodel.B2CRbRatioValue},
{ nameof(RB_StudyAbroad_ViewModel.B2CRNRatio), demodel.B2CRNRatio},
{ nameof(RB_StudyAbroad_ViewModel.B2CRNRatioType), demodel.B2CRNRatioType},
{ nameof(RB_StudyAbroad_ViewModel.B2CRNRatioValue), demodel.B2CRNRatioValue},
{ nameof(RB_StudyAbroad_ViewModel.UpdateBy), demodel.UpdateBy},
{ nameof(RB_StudyAbroad_ViewModel.UpdateTime), demodel.UpdateTime}
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName = nameof(RB_StudyAbroad_ViewModel.Id),
FiledValue = demodel.Id,
OperatorEnum =OperatorEnum.Equal
}
};
bool flag = studyAbroadRepository.Update(keyValues, wheres);
return flag ? "" : "出错了,请联系管理员";
}
}
}
......@@ -254,12 +254,12 @@ namespace Edu.WebApi.Controllers.StudyAbroad
item.SupplierName,
item.School_Id,
item.SchoolName,
SupplierContract=item.ContractUrl,
SupplierContract = item.ContractUrl,
item.SuggestPrice,
item.SellPrice,
item.Remark,
item.SaleState,
SaleStateName=Common.Plugin.EnumHelper.ToName(item.SaleState),
SaleStateName = Common.Plugin.EnumHelper.ToName(item.SaleState),
item.CreateByName,
CreateTimeStr = Common.ConvertHelper.FormatTime(item.CreateTime),
item.UpdateByName,
......@@ -278,10 +278,43 @@ namespace Edu.WebApi.Controllers.StudyAbroad
item.ImgCover,
item.Status,
item.ProductType,
ProductTypeName=item.ProductType.ToName(),
ProductTypeName = item.ProductType.ToName(),
item.StudyFeature,
item.StudyCountryId,
item.StudyCountryName,
item.B2CRatio,
item.B2CReNewRatio,
item.B2BRebateRatio,
item.B2BRebateRatioType,
item.B2BRebateRatioValue,
item.B2BReNewRatio,
item.B2BReNewRatioType,
item.B2BReNewRatioValue,
item.SchoolRebateRatio,
item.SchoolRebateRatioType,
item.SchoolRebateRatioValue,
item.SchoolReNewRatio,
item.SchoolReNewRatioType,
item.SchoolReNewRatioValue,
item.TransIntroductceRatio,
item.TransIntroductceRatioType,
item.TransIntroductceRatioValue,
item.TransIntroductceReNewRatio,
item.TransIntroductceReNewRatioType,
item.TransIntroductceReNewRatioValue,
item.InnerRecommendRatio,
item.InnerRecommendRatioType,
item.InnerRecommendRatioValue,
item.InnerRecommendReNewRatio,
item.InnerRecommendReNewRatioType,
item.InnerRecommendReNewRatioValue,
item.CommissionReType,
item.B2CRbRatio,
item.B2CRbRatioType,
item.B2CRbRatioValue,
item.B2CRNRatio,
item.B2CRNRatioType,
item.B2CRNRatioValue
});
}
pageModel.Count = rowsCount;
......@@ -430,6 +463,30 @@ namespace Edu.WebApi.Controllers.StudyAbroad
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 设置留学就业价格及返佣
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetStudyAbroadPrice() {
var userInfo = base.UserInfo;
RB_StudyAbroad_ViewModel demodel = JsonHelper.DeserializeObject<RB_StudyAbroad_ViewModel>(base.RequestParm.Msg.ToString());
if (demodel.Id <= 0) {
return ApiResult.ParamIsNull("请传递留学就业产品Id");
}
demodel.UpdateBy = userInfo.Id;
demodel.UpdateTime = DateTime.Now;
string msg = studyAbroadModule.SetStudyAbroadPrice(demodel);
if (msg == "")
{
return ApiResult.Success();
}
else {
return ApiResult.Failed(msg);
}
}
/// <summary>
/// 批量设置留学就业价格和优惠
/// </summary>
......@@ -516,6 +573,39 @@ namespace Edu.WebApi.Controllers.StudyAbroad
extModel.ImgCover,
extModel.ProductType,
extModel.StudyFeature,
extModel.B2CRatio,
extModel.B2CReNewRatio,
extModel.B2BRebateRatio,
extModel.B2BRebateRatioType,
extModel.B2BRebateRatioValue,
extModel.B2BReNewRatio,
extModel.B2BReNewRatioType,
extModel.B2BReNewRatioValue,
extModel.SchoolRebateRatio,
extModel.SchoolRebateRatioType,
extModel.SchoolRebateRatioValue,
extModel.SchoolReNewRatio,
extModel.SchoolReNewRatioType,
extModel.SchoolReNewRatioValue,
extModel.TransIntroductceRatio,
extModel.TransIntroductceRatioType,
extModel.TransIntroductceRatioValue,
extModel.TransIntroductceReNewRatio,
extModel.TransIntroductceReNewRatioType,
extModel.TransIntroductceReNewRatioValue,
extModel.InnerRecommendRatio,
extModel.InnerRecommendRatioType,
extModel.InnerRecommendRatioValue,
extModel.InnerRecommendReNewRatio,
extModel.InnerRecommendReNewRatioType,
extModel.InnerRecommendReNewRatioValue,
extModel.CommissionReType,
extModel.B2CRbRatio,
extModel.B2CRbRatioType,
extModel.B2CRbRatioValue,
extModel.B2CRNRatio,
extModel.B2CRNRatioType,
extModel.B2CRNRatioValue
};
return ApiResult.Success(data: obj);
}
......
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