Commit 1dd27880 authored by 黄奎's avatar 黄奎

页面修改

parent 6e5383ec
......@@ -71,5 +71,15 @@ namespace Edu.Model.ViewModel.User
/// 学员名称
/// </summary>
public string GuestName { get; set; }
/// <summary>
/// 合同表主键编号
/// </summary>
public int ContractId { get; set; }
/// <summary>
/// 合同编号
/// </summary>
public string ContractNo { get; set; }
}
}
......@@ -394,10 +394,11 @@ namespace Edu.Module.Customer
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public object GetStuOrderGuestContractPageModule(int pageIndex, int pageSize, out long rowsCount, RB_Student_OrderGuest_ViewModel query)
public List<RB_Student_OrderGuest_ViewModel> GetStuOrderGuestContractPageModule(int pageIndex, int pageSize, out long rowsCount, RB_Student_OrderGuest_ViewModel query)
{
rowsCount = 0;
return null;
var list = student_OrderGuestRepository.GetStuContractGuestPageRepository(pageIndex, pageSize, out rowsCount, query);
return list;
}
}
}
......@@ -59,7 +59,7 @@ WHERE 1=1
parameters.Add("Description", "%" + query.Description.Trim() + "%");
}
}
return GetPage<RB_Customer_BalanceDetail_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
return GetPage<RB_Customer_BalanceDetail_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
/// <summary>
......@@ -112,7 +112,7 @@ WHERE 1=1
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Customer_BalanceDetail_ViewModel.OrderId), query.QOrderIds);
}
}
return Get<RB_Customer_BalanceDetail_ViewModel>(builder.ToString()).ToList();
return Get<RB_Customer_BalanceDetail_ViewModel>(builder.ToString(),parameters).ToList();
}
......
......@@ -112,5 +112,57 @@ WHERE 1=1
return GetPage<RB_Student_OrderGuest_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
}
/// <summary>
/// 获取学员关联订单合同分页列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_OrderGuest_ViewModel> GetStuContractGuestPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_Student_OrderGuest_ViewModel query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,IFNULL(B.ClassName,'') AS ClassName,IFNULL(B.ClassNo,'') AS ClassNo,IFNULL(C.JoinType,0) AS StuJoinType,IFNULL(D.GuestState,0) AS StuGuestState
,C.OrderState,IFNULL(D.TotalHours,0) AS TotalHours,IFNULL(D.CompleteHours,0) AS CompleteHours,IFNULL(B.ClassStatus,0) AS ClassStatus,IFNULL(D.RenewState,0) AS RenewState
,IFNULL(D.GuestName,'') AS GuestName,IFNULL(E.CourseName,'') AS CourseName,IFNULL(F.Id,0) AS ContractId,F.ContractNo
FROM RB_Student_OrderGuest AS A INNER JOIN rb_class AS B ON A.ClassId=B.ClassId
INNER JOIN rb_order AS C ON A.OrderId=C.OrderId
INNER JOIN rb_order_guest AS D ON A.GuestId=D.Id
INNER JOIN rb_course AS E ON c.CourseId=E.CourseId
INNER JOIN rb_education_contract AS F ON A.GuestId=F.GuestId AND A.OrderId=F.OrderId
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_OrderGuest_ViewModel.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.ClassId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_OrderGuest_ViewModel.ClassId), query.ClassId);
}
if (query.OrderId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_OrderGuest_ViewModel.OrderId), query.OrderId);
}
if (query.GuestId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_OrderGuest_ViewModel.GuestId), query.GuestId);
}
if (query.Student_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_OrderGuest_ViewModel.Student_Id), query.Student_Id);
}
if (!string.IsNullOrEmpty(query.QStudentIds))
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Student_OrderGuest_ViewModel.Student_Id), query.QStudentIds);
}
if (query.Account_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_OrderGuest_ViewModel.Account_Id), query.Account_Id);
}
}
return GetPage<RB_Student_OrderGuest_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
}
}
}
......@@ -359,20 +359,22 @@ namespace Edu.WebApi.Controllers.Customer
//query.Group_Id = base.UserInfo.Group_Id;
var data = customerStudentModule.GetStuOrderGuestContractPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
List<object> list = new List<object>();
//foreach (var item in data)
//{
// list.Add(new
// {
// item.OrderId,
// item.Student_Id,
// item.ClassName,
// item.ClassNo,
// item.TotalHours,
// item.CompleteHours,
// item.GuestName,
// item.CourseName,
// });
//}
foreach (var item in data)
{
list.Add(new
{
item.OrderId,
item.Student_Id,
item.ClassName,
item.ClassNo,
item.TotalHours,
item.CompleteHours,
item.GuestName,
item.CourseName,
item.ContractId,
item.ContractNo,
});
}
pageModel.Count = rowsCount;
pageModel.PageData = list;
return ApiResult.Success(data: pageModel);
......
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