Commit c9ac727d authored by 黄奎's avatar 黄奎

新增接口

parent 445f837d
......@@ -21,5 +21,11 @@ namespace Edu.Common.Enum.Sale
/// </summary>
[EnumField("已确认")]
Sure = 2,
/// <summary>
/// 已撤销
/// </summary>
[EnumField("已撤销")]
Cancel = 3,
}
}
\ No newline at end of file
......@@ -24,5 +24,10 @@ namespace Edu.Model.ViewModel.Course
/// 报价单编号【查询使用】
/// </summary>
public string QOfferIds { get; set; }
/// <summary>
/// 课程源数据
/// </summary>
public object SourceData { get; set; }
}
}
......@@ -41,6 +41,11 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
public string QCateIds { get; set; }
/// <summary>
/// 课程编号
/// </summary>
public string QCourseIds { get; set; }
/// <summary>
/// 是否查询优化价格
/// </summary>
......
......@@ -22,6 +22,11 @@ namespace Edu.Module.Course
/// </summary>
private readonly RB_Course_OfferDetailsRepository course_OfferDetailsRepository = new RB_Course_OfferDetailsRepository();
/// <summary>
/// 课程处理类对象
/// </summary>
private readonly CourseModule courseModule = new CourseModule();
/// <summary>
/// 获取报价单分页列表
/// </summary>
......@@ -167,8 +172,25 @@ namespace Edu.Module.Course
if (model != null)
{
model.OfferDetails = GetCourseOfferDetailsListModule(new RB_Course_OfferDetails_ViewModel() { OfferId = model.Id });
if (model.OfferDetails != null && model.OfferDetails.Count > 0)
{
string ids = string.Join(",", model.OfferDetails.Select(qitem => qitem.CourseId));
List<RB_Course_ViewModel> courseList = new List<RB_Course_ViewModel>();
if (!string.IsNullOrEmpty(ids))
{
courseList= courseModule.GetCourseListModule(new RB_Course_ViewModel()
{
IsQPrice = 1,
QCourseIds = ids,
Group_Id=model.Group_Id,
});
}
foreach (var item in model.OfferDetails)
{
item.SourceData = courseList?.Where(qitem => qitem.CourseId == item.CourseId)?.FirstOrDefault() ?? new RB_Course_ViewModel();
}
}
}
return model;
}
......
......@@ -39,6 +39,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Course_ViewModel.CateId), query.CateId);
}
if (!string.IsNullOrEmpty(query.QCourseIds))
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Course_ViewModel.CourseId), query.QCourseIds);
}
}
return Get<RB_Course_ViewModel>(builder.ToString(), parameters).ToList();
}
......
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