Commit b6b0e740 authored by 吴春's avatar 吴春

提交代码

parent 7895cfb6
......@@ -97,6 +97,12 @@ namespace Mall.Model.Extend.Reserve
/// 查询时间条件
/// </summary>
public string EndWorkDate { get; set; }
/// <summary>
/// 排序
/// </summary>
public int OrderBy { get; set; }
}
......@@ -162,7 +168,7 @@ namespace Mall.Model.Extend.Reserve
public string UserName { get; set; }
public string BuyerMessage { get; set; }
public string Mobile { get; set; }
......
......@@ -228,16 +228,31 @@ namespace Mall.Module.Reserve
/// <summary>
/// 套餐卡信息列表 订单数和商品数还未关联
///小程序端服务人员信息列表 待完善
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_Reserve_ServicePersonal_Extend> GetMinServicePersonalList(int pageIndex, int pageSize, out long rowCount, RB_Reserve_ServicePersonal_Extend query)
public List<RB_Reserve_ServicePersonal_Extend> GetServicePersonalDetailList(int pageIndex, int pageSize, out long rowCount, RB_Reserve_ServicePersonal_Extend query)
{
var list = servicePersonalRepository.GetServicePersonalDetailList(pageIndex, pageSize, out rowCount, query);
return list;
}
/// <summary>
/// 套餐卡信息列表 订单数和商品数还未关联
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_Reserve_ServicePersonal_Extend> GetMinServicePersonalList(int pageIndex, int pageSize, out long rowCount, RB_Reserve_ServicePersonal_Extend query)
{
var list = servicePersonalRepository.GetMinServicePersonalList(pageIndex, pageSize, out rowCount, query);
//if (list != null && list.Any())
......
......@@ -116,8 +116,14 @@ LEFT JOIN (SELECT ServicePersonalId,COUNT(*) as CommentNum from rb_goods_commen
public List<RB_Reserve_ServicePersonal_Extend> GetServicePersonalDetailList(int pageIndex, int pageSize, out long rowCount, RB_Reserve_ServicePersonal_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.Append(@$" SELECT a.*,b.CommentNum FROM {TableName} as A
LEFT JOIN (SELECT ServicePersonalId,COUNT(*) as CommentNum from rb_goods_comment where Is_Show=1 and Status=0 GROUP by ServicePersonalId) as b on a.ID=b.ServicePersonalId WHERE a.{nameof(RB_Reserve_ServicePersonal_Extend.Status)}=0");
builder.Append(@$" SELECT a.*,b.OrderNum FROM {TableName} as A
LEFT JOIN (SELECT od.ServicepersonalId,COUNT(*) OrderNum FROM rb_goods_orderdetail od
INNER JOIN rb_goods_order o on o.OrderId=od.OrderId
where o.OrderClassify=3 and o.OrderStatus in(2,3,4,5,6)
and DATE_FORMAT(o.PaymentTime,'%Y-%m-%d' )>=DATE_FORMAT('{System.DateTime.Now.AddDays(-30)}','%Y-%m-%d')
and DATE_FORMAT(o.PaymentTime,'%Y-%m-%d' )<=DATE_FORMAT('{System.DateTime.Now}','%Y-%m-%d')
GROUP BY od.ServicepersonalId) as b
on a.ID=b.ServicePersonalId WHERE a.{nameof(RB_Reserve_ServicePersonal_Extend.Status)}=0");
if (query != null)
{
if (query.TenantId > 0)
......@@ -141,7 +147,38 @@ LEFT JOIN (SELECT ServicePersonalId,COUNT(*) as CommentNum from rb_goods_commen
builder.Append($" AND a.{nameof(RB_Reserve_ServicePersonal_Extend.Name)} like '%{query.Name}%'");
}
}
builder.Append($" order by a.{nameof(RB_Reserve_ServicePersonal_Extend.ID)} desc");
if (!string.IsNullOrWhiteSpace(query.WorkDate))
{
builder.Append($" and DATE_FORMAT(b.Date,'%Y-%m-%d' )=DATE_FORMAT('{query.WorkDate}','%Y-%m-%d')");
}
if (!string.IsNullOrEmpty(query.QIds))
{
builder.Append($" AND a.{nameof(RB_Reserve_ServicePersonal_Extend.ID)} IN({query.QIds}) ");
}
if (query.OrderBy == 0)
{
builder.Append($" order by a.{nameof(RB_Reserve_ServicePersonal_Extend.ID)} desc");
}
else if (query.OrderBy == 1)
{
builder.Append($" order by a.{nameof(RB_Reserve_ServicePersonal_Extend.Score)} desc");
}
else if (query.OrderBy == 2)
{
builder.Append($" order by a.{nameof(RB_Reserve_ServicePersonal_Extend.Score)} asc");
}
else if (query.OrderBy == 3)
{
builder.Append($" order by b.OrderNum desc");
}
else if (query.OrderBy == 4)
{
builder.Append($" order by b.OrderNum asc");
}
return GetPage<RB_Reserve_ServicePersonal_Extend>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList();
}
......
......@@ -249,6 +249,40 @@ namespace Mall.WebApi.Controllers.Reserve
}
[HttpPost]
[AllowAnonymous]
public ApiResult GetServicePersonalDetailList(object requestMsg)
{
var parms = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString());
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(parms.msg.ToString());
RB_Reserve_ServicePersonal_Extend demodel = JsonConvert.DeserializeObject<RB_Reserve_ServicePersonal_Extend>(parms.msg.ToString());
demodel.TenantId = parms.TenantId;
demodel.MallBaseId = parms.MallBaseId;
demodel.ServiceStatus = 1;
var list = reserveModule.GetServicePersonalDetailList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list.Select(x => new
{
x.ID,
x.ServiceLogo,
x.Name,
Score = x.Score == 0 ? "5" : x.Score.ToString(),
x.OrderNum,
CreateDateStr = x.CreateDate.ToString("yyyy-MM-dd HH:mm:ss"),
x.ServiceStatus,
x.Telephone,
x.Major,
x.WorkYears,
x.Gender,
ServiceTypeStr = x.ServiceType.GetEnumName(),
x.ServiceType,
x.FictitiousReserveNum,
x.CommentNum
});
return ApiResult.Success("", pagelist);
}
/// <summary>
/// 获取详情
/// </summary>
......
......@@ -166,6 +166,10 @@ namespace Mall.WebApi.Controllers.Reserve
}
/// <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