Commit cde9b8a0 authored by 黄奎's avatar 黄奎

Merge branch 'master' of http://gitlab.oytour.com/Kui2/education

parents cf2cd446 cd17720f
......@@ -879,7 +879,44 @@ namespace Edu.Module.Course
}
}
/// <summary>
/// 设置订单应收金额
/// </summary>
/// <param name="orderId"></param>
/// <param name="preferPrice"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public bool SetOrderPreferPrice(int orderId, decimal preferPrice, UserInfo userInfo)
{
var orderModel = orderRepository.GetEntity(orderId);
if (orderModel == null) { return false; }
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Order_ViewModel.PreferPrice),preferPrice}
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Order_ViewModel.OrderId),
FiledValue=orderId,
OperatorEnum=OperatorEnum.Equal
}
};
var flag = orderRepository.Update(keyValues, wheres);
if (flag)
{
changeLogRepository.Insert(new Model.Entity.Log.RB_User_ChangeLog()
{
Id = 0,
Type = 2,
CreateBy = userInfo.Id,
CreateTime = DateTime.Now,
Group_Id = userInfo.Group_Id,
LogContent = "修改订单应收总额,由【" + orderModel.PreferPrice + "】修改为【" + preferPrice + "】",
School_Id = userInfo.School_Id,
SourceId = orderId
});
}
return flag;
}
/// <summary>
/// 获取班级订单列表
......
......@@ -299,6 +299,30 @@ namespace Edu.WebApi.Controllers.Course
return orderModule.SetClassOrder(demodel, userInfo);
}
/// <summary>
/// 设置订单应收总额
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetOrderPreferPrice() {
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int OrderId = parms.GetInt("OrderId", 0);
decimal PreferPrice = parms.GetDecimal("PreferPrice");
if (OrderId <= 0) {
return ApiResult.ParamIsNull("请传递订单id");
}
bool flag = orderModule.SetOrderPreferPrice(OrderId, PreferPrice, userInfo);
if (flag)
{
return ApiResult.Success();
}
else {
return ApiResult.Failed();
}
}
/// <summary>
/// 获取订单详情
/// </summary>
......
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