Commit 6656d33c authored by 黄奎's avatar 黄奎

页面修改

parent fcd1265f
......@@ -123,18 +123,11 @@ namespace Edu.Module.Course
courseModel = courseRepository.GetEntity(classModel.CouseId);
}
//课时单价
decimal classHourPrice = 0;
//原课时单价
//classHourPrice = orderModel.PreferPrice / orderModel.GuestNum / classModel.ClassHours;
//标准课时单价=课程卖价/课时
classHourPrice = courseModel.SellPrice / classModel.ClassHours;
//预计退款金额
decimal backMoney =0;
//违约金
decimal breakContractPrice = (classModel.ClassHours - FinishHours) * classHourPrice * Convert.ToDecimal(0.1);
backMoney = (orderModel.Income + orderModel.PlatformTax) - FinishHours * classHourPrice - breakContractPrice;
backMoney = orderRepository.CalcBackMoneyRepository(orderModel, courseModel, FinishHours,out _);
var backClassModel = new RB_Student_BackClass_ViewModel()
{
BackId = 0,
......
......@@ -58,6 +58,11 @@ namespace Edu.Module.Course
/// </summary>
private readonly RB_ClassRepository classRepository = new RB_ClassRepository();
/// <summary>
/// 课程仓储层对象
/// </summary>
private readonly RB_CourseRepository courseRepository = new RB_CourseRepository();
/// <summary>
/// 学校
/// </summary>
......@@ -117,23 +122,22 @@ namespace Edu.Module.Course
var stuCheckList = class_CheckRepository.GetGuestFinishMinutesRepository(backModel.GuestId.ToString());
//完成课时数
var FinishHours = stuCheckList?.Sum(qitem => qitem.FinishClassHours) ?? 0;
//课时单价
decimal classHourPrice = 0;
//原课时单价
//classHourPrice = orderModel.PreferPrice / orderModel.GuestNum / classModel.ClassHours;
//标准课时单价=课程卖价/课时
classHourPrice = classModel.SellPrice / classModel.ClassHours;
var courseModel = new RB_Course();
if (orderModel.CourseId > 0)
{
courseModel = courseRepository.GetEntity(orderModel.CourseId);
}
else
{
courseModel = courseRepository.GetEntity(classModel.CouseId);
}
//预计退款金额
decimal backMoney = 0;
//违约金
decimal breakContractPrice = (classModel.ClassHours - FinishHours) * classHourPrice * Convert.ToDecimal(0.1);
backMoney = (orderModel.Income + orderModel.PlatformTax) - FinishHours * classHourPrice - breakContractPrice;
decimal backMoney = orderRepository.CalcBackMoneyRepository(orderModel, courseModel, FinishHours,out decimal classHourPrice);
var obj = new
{
orderModel.PreferPrice,
orderModel.GuestNum,
classModel.ClassHours,
courseModel.ClassHours,
FinishHours,
classHourPrice,
backMoney = Math.Round(backMoney, 2)
......
......@@ -47,10 +47,7 @@ WHERE 1=1
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Examination_Paper_ViewModel.ParentId), query.ParentId);
}
else
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Examination_Paper_ViewModel.ParentId), 0);
}
if (query.PaperId > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Examination_Paper_ViewModel.PaperId), query.PaperId);
......@@ -59,6 +56,14 @@ WHERE 1=1
{
builder.AppendFormat(@" AND A.{0} IN({1}) ", nameof(RB_Examination_Paper_ViewModel.PaperId), query.QPaperIds);
}
if (query.CreateBy > 0)
{
builder.AppendFormat(@" AND (A.{0}={1} OR A.IsOpen=2) ", nameof(RB_Examination_Paper_ViewModel.CreateBy), query.CreateBy);
}
else
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Examination_Paper_ViewModel.ParentId), 0);
}
}
builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Examination_Paper_ViewModel.PaperId));
return GetPage<RB_Examination_Paper_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
......
using Edu.Common.Enum.Sale;
using Edu.Model.Entity.Course;
using Edu.Model.Entity.Grade;
using Edu.Model.Entity.Sell;
using Edu.Model.ViewModel.Sell;
......@@ -573,6 +574,30 @@ GROUP BY ClassId;";
return Get<RB_Order_ViewModel>(sql).ToList();
}
/// <summary>
/// 计算退款金额
/// </summary>
/// <param name="orderModel"></param>
/// <param name="courseModel"></param>
/// <param name="FinishHours"></param>
/// <returns></returns>
public decimal CalcBackMoneyRepository(RB_Order orderModel,RB_Course courseModel,decimal FinishHours,out decimal newClassHourPrice)
{
newClassHourPrice = 0;
//课时单价
decimal classHourPrice = 0;
//原课时单价
//classHourPrice = orderModel.PreferPrice / orderModel.GuestNum / classModel.ClassHours;
//标准课时单价=课程卖价/课时
classHourPrice = courseModel.SellPrice / courseModel.ClassHours;
newClassHourPrice = classHourPrice;
//预计退款金额
decimal backMoney = 0;
//违约金
decimal breakContractPrice = (courseModel.ClassHours - FinishHours) * classHourPrice * Convert.ToDecimal(0.1);
backMoney = (orderModel.Income + orderModel.PlatformTax-orderModel.Refund) / orderModel.GuestNum - FinishHours * classHourPrice - breakContractPrice;
return backMoney;
}
#region 销售提成
/// <summary>
......
......@@ -53,6 +53,11 @@ namespace Edu.WebApi.Controllers.Exam
QPaperIds = base.ParmJObj.GetStringValue("QPaperIds")
};
query.Group_Id = base.UserInfo.Group_Id;
//不是试卷管理员
if (!base.CheckUserActionAuth("Paper_Manager"))
{
query.CreateBy = base.UserInfo.Id;
}
List<object> result = new List<object>();
List<object> navList = new List<object>();
if (query.ParentId > 0)
......@@ -109,6 +114,10 @@ namespace Edu.WebApi.Controllers.Exam
IsExamine = base.ParmJObj.GetInt("IsExamine"),
IsOpen = base.ParmJObj.GetInt("IsOpen"),
};
if (string.IsNullOrEmpty(extModel.PaperName))
{
extModel.PaperName = DateTime.Now.ToString("yyyyMMdd") + "新建试卷";
}
extModel.GroupList = new List<RB_Examination_Group_ViewModel>();
string groups = base.ParmJObj.GetStringValue("GroupList");
if (!string.IsNullOrEmpty(groups))
......
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