Commit e2ba7ba3 authored by liudong1993's avatar liudong1993

1

parent 6c93fdad
...@@ -56,6 +56,10 @@ namespace Edu.Model.Entity.Course ...@@ -56,6 +56,10 @@ namespace Edu.Model.Entity.Course
/// </summary> /// </summary>
public decimal DiscountMoney { get; set; } public decimal DiscountMoney { get; set; }
/// <summary> /// <summary>
/// 平台税金
/// </summary>
public decimal PlatformTax { get; set; }
/// <summary>
/// 订单状态 枚举 /// 订单状态 枚举
/// </summary> /// </summary>
public OrderStateEnum OrderState { get; set; } public OrderStateEnum OrderState { get; set; }
......
...@@ -334,6 +334,26 @@ namespace Edu.Module.Course ...@@ -334,6 +334,26 @@ namespace Edu.Module.Course
} }
} }
/// <summary>
/// 获取订单详情
/// </summary>
/// <param name="orderId"></param>
/// <returns></returns>
public RB_Order_ViewModel GetClassOrderInfo(int orderId)
{
return orderRepository.GetEntity<RB_Order_ViewModel>(orderId);
}
/// <summary>
/// 获取订单阶梯价格
/// </summary>
/// <param name="orderId"></param>
/// <returns></returns>
public List<RB_Order_StepPrice_ViewModel> GetClassOrderSetpPrice(int orderId)
{
return order_StepPriceRepository.GetList(new RB_Order_StepPrice_ViewModel() { OrderId = orderId });
}
/// <summary> /// <summary>
/// 获取日志列表 /// 获取日志列表
/// </summary> /// </summary>
...@@ -1061,18 +1081,29 @@ namespace Edu.Module.Course ...@@ -1061,18 +1081,29 @@ namespace Edu.Module.Course
/// </summary> /// </summary>
/// <param name="orderId"></param> /// <param name="orderId"></param>
/// <param name="income"></param> /// <param name="income"></param>
/// <param name="platformTax"></param>
/// <param name="refund"></param> /// <param name="refund"></param>
/// <param name="empModel"></param> /// <param name="empModel"></param>
/// <returns></returns> /// <returns></returns>
public bool UpdateEduOrderIncome(int orderId, decimal income, decimal refund, Employee_ViewModel empModel) public bool UpdateEduOrderIncome(int orderId, decimal income, decimal platformTax, decimal refund, Employee_ViewModel empModel)
{ {
var orderModel = orderRepository.GetEntity(orderId); var orderModel = orderRepository.GetEntity(orderId);
if (orderModel == null) { return false; } if (orderModel == null) { return false; }
if (orderModel.Income == income && orderModel.Refund == refund) { return true; } if (orderModel.Income == income && orderModel.Refund == refund) { return true; }
Dictionary<string, object> keyValues = new Dictionary<string, object>() { Dictionary<string, object> keyValues = new Dictionary<string, object>() { };
{ nameof(RB_Order_ViewModel.Income),income}, string LogContent;
{ nameof(RB_Order_ViewModel.Refund),refund} if (income >= 0)
}; {
keyValues.Add(nameof(RB_Order_ViewModel.Income), income);
keyValues.Add(nameof(RB_Order_ViewModel.PlatformTax), platformTax);
LogContent = $",更新订单实收【{income}】平台税金【{platformTax}】";
}
else if (refund >= 0)
{
keyValues.Add(nameof(RB_Order_ViewModel.Refund), refund);
LogContent = $",退款【{refund}】";
}
else { return false; }
List<WhereHelper> wheres = new List<WhereHelper>() { List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){ new WhereHelper(){
FiledName=nameof(RB_Order_ViewModel.OrderId), FiledName=nameof(RB_Order_ViewModel.OrderId),
...@@ -1090,7 +1121,7 @@ namespace Edu.Module.Course ...@@ -1090,7 +1121,7 @@ namespace Edu.Module.Course
CreateBy = empModel.Id, CreateBy = empModel.Id,
CreateTime = DateTime.Now, CreateTime = DateTime.Now,
Group_Id = empModel.Group_Id, Group_Id = empModel.Group_Id,
LogContent = $"【{empModel.EmployeeName}({empModel.Id})】单据审核通过,更新订单实收【{income}】,退款【{refund}", LogContent = $"【{empModel.EmployeeName}({empModel.Id})】单据审核通过{LogContent}",
School_Id = empModel.School_Id, School_Id = empModel.School_Id,
SourceId = orderId SourceId = orderId
}); });
......
...@@ -273,6 +273,47 @@ namespace Edu.WebApi.Controllers.Course ...@@ -273,6 +273,47 @@ namespace Edu.WebApi.Controllers.Course
return orderModule.SetClassOrder(demodel, userInfo); return orderModule.SetClassOrder(demodel, userInfo);
} }
/// <summary>
/// 获取订单详情
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetClassOrderInfo() {
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int OrderId = parms.GetInt("OrderId", 0);
if (OrderId <= 0)
{
return ApiResult.ParamIsNull();
}
var model = orderModule.GetClassOrderInfo(OrderId);
if (model == null) {
return ApiResult.Failed("订单不存在");
}
var list = orderModule.GetClassOrderSetpPrice(OrderId);
return ApiResult.Success("", new
{
OrderInfo = new
{
model.OrderId,
model.GuestNum,
model.Class_Price,
model.Unit_Price,
model.PreferPrice,
model.OrderSource,
OrderSourceName = model.OrderSource.ToName(),
model.SaleRemark
},
StepPriceList = list.Select(x => new
{
x.Id,
x.PersionNum,
x.PersionPrice
})
});
}
/// <summary> /// <summary>
/// 取消订单 /// 取消订单
/// </summary> /// </summary>
......
...@@ -136,6 +136,7 @@ namespace Edu.WebApi.Controllers.Third ...@@ -136,6 +136,7 @@ namespace Edu.WebApi.Controllers.Third
int EmployeeId = parms.GetInt("EmployeeId", 0); int EmployeeId = parms.GetInt("EmployeeId", 0);
int OrderId = parms.GetInt("OrderId", 0); int OrderId = parms.GetInt("OrderId", 0);
decimal Income = parms.GetDecimal("Income"); decimal Income = parms.GetDecimal("Income");
decimal PlatformTax = parms.GetDecimal("PlatformTax");
decimal Refund = parms.GetDecimal("Refund"); decimal Refund = parms.GetDecimal("Refund");
if (EmployeeId <= 0) if (EmployeeId <= 0)
{ {
...@@ -151,7 +152,7 @@ namespace Edu.WebApi.Controllers.Third ...@@ -151,7 +152,7 @@ namespace Edu.WebApi.Controllers.Third
return ApiResult.ParamIsNull(message: "当前员工编号不存在!"); return ApiResult.ParamIsNull(message: "当前员工编号不存在!");
} }
bool flag = orderModule.UpdateEduOrderIncome(OrderId, Income, Refund, empModel); bool flag = orderModule.UpdateEduOrderIncome(OrderId, Income, PlatformTax, Refund, empModel);
if (flag) if (flag)
{ {
return ApiResult.Success(); return ApiResult.Success();
......
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