Commit 4a726f87 authored by 黄奎's avatar 黄奎

页面修改

parent 998b4dc0
......@@ -311,6 +311,7 @@ namespace Edu.Module.EduTask
{
OrderId = orderChangeModel.SourceOrderId,
GuestId = orderChangeModel.OrderGuestId,
Status=-1,
}).Where(qitem => qitem.Status == 0 || qitem.Status == 1 || qitem.Status == 2)?.FirstOrDefault();
//创建老订单合同
CreateContract(oldOrderModel, newCourseModel, oldContract, orderChangeModel.OrderGuestId);
......@@ -755,6 +756,7 @@ namespace Edu.Module.EduTask
{
OrderId = orderChangeModel.SourceOrderId,
GuestId = orderChangeModel.OrderGuestId,
Status=-1,
}).Where(qitem => qitem.Status == 0 || qitem.Status == 1 || qitem.Status == 2)?.FirstOrDefault();
//生成老订单合同
CreateContract(oldOrderModel, oldCourseModel, oldContract, orderChangeModel.OrderGuestId);
......@@ -905,13 +907,16 @@ namespace Edu.Module.EduTask
/// 回归原班上课
/// </summary>
/// <returns></returns>
public bool RegressSourceClassModule(int OrderId, int GuestId,int oldOrderId,int oldGuestId)
public bool RegressSourceClassModule(int OrderId)
{
bool flag = false;
var oldOrder = orderRepository.GetEntity(oldOrderId);
var order = orderRepository.GetEntity(OrderId);
var oldGuest = guestRepository.GetEntity(oldGuestId);
var guest = guestRepository.GetEntity(GuestId);
var oldOrder = orderRepository.GetEntity(order.FirstOrderId);
var orderguestList = guestRepository.GetOrderGuestListRepository(new RB_Order_Guest_ViewModel() {
OrderIds = OrderId + "," + order.FirstOrderId
});
var oldGuest = orderguestList.Where(qitem=>qitem.OrderId==oldOrder.OrderId)?.FirstOrDefault()??new RB_Order_Guest_ViewModel ();
var guest = orderguestList.Where(qitem => qitem.OrderId == order.OrderId)?.FirstOrDefault() ?? new RB_Order_Guest_ViewModel();
var classList = classRepository.GetClassListRepository(new RB_Class_ViewModel()
{
Q_ClassIds = oldOrder.ClassId + "," + order.ClassId
......@@ -921,12 +926,14 @@ namespace Edu.Module.EduTask
{
OrderId = oldOrder.OrderId,
GuestId = oldGuest.Id,
Status=-1,
}).Where(qitem => qitem.Status == 0 || qitem.Status == 1 || qitem.Status == 2)?.FirstOrDefault();
var newContract = education_ContractRepository.GetList(new RB_Education_Contract_ViewModel()
{
OrderId = order.OrderId,
GuestId = guest.Id,
Status=-1,
}).Where(qitem => qitem.Status == 0 || qitem.Status == 1 || qitem.Status == 2)?.FirstOrDefault();
var oldClassModel = classList?.Where(qitem => qitem.ClassId == oldOrder.ClassId)?.FirstOrDefault() ?? new RB_Class_ViewModel();
......@@ -998,7 +1005,7 @@ namespace Edu.Module.EduTask
{
ChangeType = 2,
ClassId = order.ClassId,
GuestId = GuestId,
GuestId = guest.Id,
OrderId = order.OrderId,
GuestName = guest.GuestName,
InCome = refundMoney,
......@@ -1015,7 +1022,7 @@ namespace Edu.Module.EduTask
{
ChangeType = 2,
ClassId = oldOrder.ClassId,
GuestId = GuestId,
GuestId = guest.Id,
OrderId = oldOrder.OrderId,
GuestName = guest.GuestName,
InCome = refundMoney,
......
......@@ -85,7 +85,7 @@ namespace Edu.WebApi.Controllers.EduTask
{
return ApiResult.ParamIsNull(message: "原订单号不存在!");
}
if (oldOrderModel.PreferPrice != (oldOrderModel.Income + oldOrderModel.PlatformTax - oldOrderModel.Refund))
if (oldOrderModel.PreferPrice != (oldOrderModel.Income +oldOrderModel.DiscountMoney+ oldOrderModel.PlatformTax - oldOrderModel.Refund))
{
return ApiResult.ParamIsNull(message: "原订单款未收齐,不能转班!");
}
......@@ -166,7 +166,7 @@ namespace Edu.WebApi.Controllers.EduTask
{
return ApiResult.ParamIsNull(message: "原订单号不存在!");
}
if (oldOrderModel.PreferPrice != (oldOrderModel.Income + oldOrderModel.PlatformTax - oldOrderModel.Refund))
if (oldOrderModel.PreferPrice != (oldOrderModel.Income +oldOrderModel.DiscountMoney+ oldOrderModel.PlatformTax - oldOrderModel.Refund))
{
return ApiResult.ParamIsNull(message: "原订单款未收齐,不能转班!");
}
......@@ -203,10 +203,7 @@ namespace Edu.WebApi.Controllers.EduTask
public ApiResult RegressSourceClass()
{
var OrderId = base.ParmJObj.GetInt("OrderId");
var GuestId = base.ParmJObj.GetInt("GuestId");
var oldOrderId = base.ParmJObj.GetInt("oldOrderId");
var oldGuestId = base.ParmJObj.GetInt("oldGuestId");
bool flag = orderChangeModule.RegressSourceClassModule(OrderId, GuestId, oldOrderId, oldGuestId);
bool flag = orderChangeModule.RegressSourceClassModule(OrderId);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
}
......
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