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

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

parents fd2f34e8 cdfbafea
......@@ -6,6 +6,7 @@ using Edu.Common.Plugin;
using Edu.Model.CacheModel;
using Edu.Model.ViewModel.Course;
using Edu.Model.ViewModel.Log;
using Edu.Model.ViewModel.User;
using Edu.Repository.Course;
using Edu.Repository.Log;
using Edu.Repository.User;
......@@ -927,5 +928,49 @@ namespace Edu.Module.Course
return orderRepository.GetMyOrderStatistics(demodel);
}
#endregion
#region 订单操作
/// <summary>
/// 财务 更新订单实收,退款
/// </summary>
/// <param name="orderId"></param>
/// <param name="income"></param>
/// <param name="refund"></param>
/// <param name="empModel"></param>
/// <returns></returns>
public bool UpdateEduOrderIncome(int orderId, decimal income, decimal refund, Employee_ViewModel empModel)
{
var orderModel = orderRepository.GetEntity(orderId);
if (orderModel == null) { return false; }
if (orderModel.Income == income && orderModel.Refund == refund) { return true; }
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Order_ViewModel.Income),income},
{ nameof(RB_Order_ViewModel.Refund),refund}
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Order_ViewModel.OrderId),
FiledValue=orderId,
OperatorEnum=OperatorEnum.Equal
}
};
bool flag = orderRepository.Update(keyValues, wheres);
if (flag) {
//写入日志
changeLogRepository.Insert(new Model.Entity.Log.RB_User_ChangeLog()
{
Id = 0,
Type = 2,
CreateBy = empModel.Id,
CreateTime = DateTime.Now,
Group_Id = empModel.Group_Id,
LogContent = $"【{empModel.EmployeeName}({empModel.Id})】单据审核通过,更新订单实收【{income}】,退款【{refund}】",
School_Id = empModel.School_Id,
SourceId = orderId
});
}
return flag;
}
#endregion
}
}
......@@ -539,6 +539,15 @@ namespace Edu.WebApi.Controllers.Course
return ApiResult.Success();
}
/// <summary>
/// 订单使用最新班级报价
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetClassOrderUseNewPrice() {
return ApiResult.Success();
}
#endregion
#region 学生名单
......
using Edu.Common.API;
using Edu.Common.Plugin;
using Edu.Module.Course;
using Edu.Module.User;
using Edu.WebApi.Filter;
using Microsoft.AspNetCore.Authorization;
......@@ -24,6 +25,10 @@ namespace Edu.WebApi.Controllers.Third
/// 员工处理类
/// </summary>
private readonly EmployeeModule employeeModule = new EmployeeModule();
/// <summary>
/// 订单处理类
/// </summary>
private readonly OrderModule orderModule = new OrderModule();
/// <summary>
/// 根部部门层级获取部门主管
......@@ -117,5 +122,44 @@ namespace Edu.WebApi.Controllers.Third
qitem.GroupName
}));
}
/// <summary>
/// 更新订单实收、退款金额
/// </summary>
/// <returns></returns>
[HttpGet]
[HttpPost]
[AllowAnonymous]
public ApiResult UpdateEduOrderIncome()
{
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int EmployeeId = parms.GetInt("EmployeeId", 0);
int OrderId = parms.GetInt("OrderId", 0);
decimal Income = parms.GetDecimal("Income");
decimal Refund = parms.GetDecimal("Refund");
if (EmployeeId <= 0)
{
return ApiResult.ParamIsNull("请传递用户id");
}
if (OrderId <= 0)
{
return ApiResult.ParamIsNull("请传递订单id");
}
var empModel = employeeModule.GetEmployeeListModule(new Model.ViewModel.User.Employee_ViewModel() { Id = EmployeeId })?.FirstOrDefault();
if (empModel == null)
{
return ApiResult.ParamIsNull(message: "当前员工编号不存在!");
}
bool flag = orderModule.UpdateEduOrderIncome(OrderId, Income, Refund, empModel);
if (flag)
{
return ApiResult.Success();
}
else
{
return ApiResult.Failed();
}
}
}
}
......@@ -850,6 +850,19 @@ namespace Edu.WebApi.Controllers.User
}
/// <summary>
/// 获取触发事件枚举
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetAccountRemarkTypeEnumList()
{
int type = base.ParmJObj.GetInt("Type", 0);
var list = EnumHelper.EnumToList(typeof(RemarkTypeEnum));
return ApiResult.Success("", list);
}
/// <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