Commit 29dc6e05 authored by 黄奎's avatar 黄奎

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

parents 99857ad9 ccbb51fd
......@@ -491,5 +491,16 @@ namespace Edu.Module.Course
}
#endregion
/// <summary>
/// 验证学生是否已有其他订单
/// </summary>
/// <param name="stuIds"></param>
/// <param name="group_Id"></param>
/// <returns></returns>
public List<RB_Student_OrderGuest_ViewModel> ValidataStuOrder(string stuIds, int group_Id)
{
return student_OrderGuestRepository.ValidataStuOrder(stuIds, group_Id);
}
}
}
\ No newline at end of file
......@@ -235,6 +235,21 @@ INNER JOIN rb_order o on sog.OrderId = o.OrderId
return Get<RB_Student_OrderGuest_ViewModel>(sql).ToList();
}
/// <summary>
/// 获取学生是否有未付款有效订单
/// </summary>
/// <param name="stuIds"></param>
/// <param name="group_Id"></param>
/// <returns></returns>
public List<RB_Student_OrderGuest_ViewModel> ValidataStuOrder(string stuIds, int group_Id)
{
string sql = $@"select sog.*,s.StuName as GuestName from RB_Student_OrderGuest sog
INNER JOIN rb_student s on sog.Student_Id =s.StuId
INNER JOIN rb_order o on sog.OrderId =o.OrderId
where sog.Status =0 and o.Group_Id ={group_Id} and o.OrderState <>3 and IFNULL(o.Income,0) <=0 and sog.Student_Id in({stuIds})";
return Get<RB_Student_OrderGuest_ViewModel>(sql).ToList();
}
#region 学员跟进
/// <summary>
......
......@@ -573,6 +573,14 @@ namespace Edu.WebApi.Controllers.Course
{
return ApiResult.ParamIsNull("请传递选择客户");
}
if (demodel.OrderIdentify == 2 && !string.IsNullOrEmpty(demodel.StuIds)) {
//验证学生是否已有其他订单
var vlist = orderModule.ValidataStuOrder(demodel.StuIds, userInfo.Group_Id);
if (vlist.Any()) {
var vmodel = vlist.FirstOrDefault();
return ApiResult.Tip("学员" + vmodel.GuestName + "存在有效未付款订单" + vmodel.OrderId + ",请取消该订单后再试", vmodel.OrderId);
}
}
if (!string.IsNullOrEmpty(demodel.StuIds)) {
int gNum = JsonHelper.DeserializeObject<List<int>>("[" + demodel.StuIds + "]").Count();
if (demodel.GuestNum != gNum) {
......
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