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

页面修改

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