Commit c0f9b830 authored by liudong1993's avatar liudong1993

1

parent be1472b6
......@@ -383,7 +383,7 @@ namespace Edu.Module.Course
[TransactionCallHandler]
public virtual bool SetClassOrderModule(RB_Order_ViewModel demodel, UserInfo userInfo, bool isEditOrder, out string message)
{
return SetClassOrderCommonModule(demodel, userInfo, isEditOrder, out message);
return SetClassOrderCommonModule(demodel, userInfo, isEditOrder, out message, out _);
}
/// <summary>
......@@ -403,11 +403,18 @@ namespace Edu.Module.Course
{
IsFirstBatch = false;//是续费 有历史订单
}
string RorderId = "";
foreach (var item in deList)
{
flag = SetClassOrderCommonModule(item, userInfo, isEditOrder, out message, IsFirstBatch);
if (flag == false) { return flag; }
flag = SetClassOrderCommonModule(item, userInfo, isEditOrder, out message, out int orderId, IsFirstBatch);
if (flag) { RorderId += orderId + "、"; }
else
{
message = "已创建成功订单:" + RorderId + ",后续创建失败,失败原因:" + message;
return flag;
}
}
message = "创建成功:" + RorderId;
return flag;
}
......@@ -814,10 +821,10 @@ namespace Edu.Module.Course
/// <param name="IsFirstBatch">首次批量制单</param>
/// <returns></returns>
public bool SetClassOrderCommonModule(RB_Order_ViewModel demodel, UserInfo userInfo, bool isEditOrder, out string message, bool IsFirstBatch = false)
public bool SetClassOrderCommonModule(RB_Order_ViewModel demodel, UserInfo userInfo, bool isEditOrder, out string message, out int ROrderId, bool IsFirstBatch = false)
{
bool flag = false;
message = "";
bool flag = false; ROrderId = demodel.OrderId;
message = "";
var orderModel = new RB_Order();
if (demodel.OrderId > 0)
{
......@@ -928,6 +935,17 @@ namespace Edu.Module.Course
}
RenewNum = glist.Select(x => x.Student_Id).Distinct().Count();//续费订单数量
}
if (!StuList.Where(x => x.IsRenewGuest == 1).Any())
{
//验证 是否从试听课过来
demodel.HelpEnterId = 0;// 2022-05-12 第一次报名 并且有试听 带入协助老师 否则 没有协助老师 ;
int vTeacherId = visitor_ReserveRepository.GetVisitorReserveTeacherId(StuList.FirstOrDefault().StuId, userInfo.Group_Id);
if (vTeacherId > 0)
{
var tModel = accountRepository.GetEmployeeListRepository(new Employee_ViewModel() { Group_Id = demodel.Group_Id, AccountId = vTeacherId, AccountType = AccountTypeEnum.Teacher }).FirstOrDefault();
demodel.HelpEnterId = tModel?.Id ?? 0;
}
}
int NormalNum = demodel.GuestNum - RenewNum;//首次报名数量
decimal dmoney = coursePrice * (courseModel.B2CRatio / 100) * NormalNum + coursePrice * (courseModel.B2CReNewRatio / 100) * RenewNum;
if (demodel.DiscountMoney != dmoney)
......@@ -1248,6 +1266,7 @@ namespace Edu.Module.Course
}
int OrderId = orderRepository.Insert(demodel);
demodel.OrderId = OrderId;
ROrderId = OrderId;
flag = OrderId > 0;
LogContent = "新增日语培训订单";
//记录订单备注
......
......@@ -333,18 +333,20 @@ namespace Edu.Module.Course
{
item.IsRenewGuest = 1;//是续费的
}
if (item.IsRenewGuest == 0) {
//验证 是否从试听课过来
int vTeacherId = visitor_ReserveRepository.GetVisitorReserveTeacherId(item.StuId, userInfo.Group_Id);
if (vTeacherId > 0) {
var tmodel = teacherRepository.GetEntity(vTeacherId);
item.HeadTeacherId = vTeacherId;
item.TeacherName = tmodel?.TeacherName ?? "";
}
}
}
}
if (!StuList.Where(x => x.IsRenewGuest == 1).Any()) {
var item = StuList.FirstOrDefault();
//验证 是否从试听课过来
int vTeacherId = visitor_ReserveRepository.GetVisitorReserveTeacherId(item.StuId, userInfo.Group_Id);
if (vTeacherId > 0)
{
var tModel = accountRepository.GetEmployeeListRepository(new Employee_ViewModel() { Group_Id = userInfo.Group_Id, AccountId = vTeacherId, AccountType = AccountTypeEnum.Teacher }).FirstOrDefault();
item.HeadTeacherId = tModel?.Id ?? 0;
item.TeacherName = tModel?.EmployeeName ?? "";
}
}
int RenewNum = glist.Select(x => x.Student_Id).Distinct().Count();//续费订单数量
//获取该学生的负责人
......
......@@ -289,7 +289,7 @@ namespace Edu.Module.EduTask
{
orderModel.FirstOrderId = oldOrderModel.FirstOrderId;
}
flag = orderModule.SetClassOrderCommonModule(orderModel, userInfo, false, out string message);
flag = orderModule.SetClassOrderCommonModule(orderModel, userInfo, false, out string message, out _);
#endregion
if (flag)
......@@ -742,7 +742,7 @@ namespace Edu.Module.EduTask
{
orderModel.FirstOrderId = oldOrderModel.FirstOrderId;
}
flag = orderModule.SetClassOrderCommonModule(orderModel, userInfo, false, out string message);
flag = orderModule.SetClassOrderCommonModule(orderModel, userInfo, false, out string message, out _);
#endregion
if (flag)
......
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