Commit 53286bfe authored by 黄奎's avatar 黄奎

页面修改

parent 3c4ea52b
......@@ -47,5 +47,10 @@ namespace Mall.Model.Extend.TradePavilion
/// 奖项
/// </summary>
public int PrizeId { get; set; }
/// <summary>
/// 查询用户编号
/// </summary>
public string QCreateBy { get; set; }
}
}
......@@ -59,9 +59,12 @@ namespace Mall.Model.Extend.TradePavilion
/// 性质名称
/// </summary>
public string NatureName { get { return this.Nature.GetEnumName(); } }
}
/// <summary>
/// 用户数量
/// </summary>
public int UserCount { get; set; }
}
/// <summary>
/// 首店活动报名
......@@ -103,8 +106,6 @@ namespace Mall.Model.Extend.TradePavilion
public class FirstShopLinkManModel
{
/// <summary>
/// 联系人
/// </summary>
......@@ -126,4 +127,61 @@ namespace Mall.Model.Extend.TradePavilion
/// </summary>
public string CountryInfo { get; set; }
}
/// <summary>
/// 报名信息
/// </summary>
public class ActivityUserItem
{
/// <summary>
/// 小程序用户编号
/// </summary>
public int UserId { get; set; }
/// <summary>
/// 小程序用户名称
/// </summary>
public string UserName { get; set; }
/// <summary>
/// 报名用户列表
/// </summary>
public List<SignUserItem> SignUserList { get; set; }
}
/// <summary>
/// 报名详情
/// </summary>
public class SignUserItem
{
/// <summary>
/// 报名编号
/// </summary>
public int Id { get; set; }
/// <summary>
/// 活动编号
/// </summary>
public int ActivityId { get; set; }
/// <summary>
/// 联系人
/// </summary>
public string LinkMan { get; set; }
/// <summary>
/// 联系电话
/// </summary>
public string LinkTel { get; set; }
/// <summary>
/// 岗位
/// </summary>
public string Post { get; set; }
/// <summary>
/// 地址信息
/// </summary>
public string CountryInfo { get; set; }
}
}
......@@ -39,11 +39,48 @@ namespace Mall.Module.TradePavilion
/// </summary>
private readonly RB_Miai_MessageRepository miai_MessageRepository = new RB_Miai_MessageRepository();
/// <summary>
/// 认证仓储层对象
/// </summary>
private readonly RB_AuthenticationRepository authenticationRepository = new RB_AuthenticationRepository();
/// <summary>
/// 获取商会活动报名分页列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<ActivityUserItem> GetCommerceConsultPageModule(int pageIndex, int pageSize, out long rowsCount, RB_Commerce_Consult_Extend query)
{
List<ActivityUserItem> result = new List<ActivityUserItem>();
var list = consultRepository.GetCommerceConsultStatisticsPageRepository(pageIndex, pageSize, out rowsCount, query);
if (list != null && list.Count > 0)
{
string userids = string.Join(",", list.Select(qitem => qitem.UserId));
var authList = authenticationRepository.GetList(new RB_Authentication_Extend() { QCreateBy = userids });
var memberList = member_UserRepository.GetList(new RB_Member_User_Extend()
{
UserIds = userids
});
var userList = list.GroupBy(qitem => new { qitem.UserId, qitem.ActivityId }).Select(qitem => new { qitem.Key.UserId, qitem.Key.ActivityId });
foreach (var item in userList)
{
var userModel = memberList?.Where(qitem => qitem.Id == item.UserId)?.FirstOrDefault();
var authModel = authList?.Where(qitem => qitem.CreateBy == item.UserId)?.FirstOrDefault();
ActivityUserItem activity = new ActivityUserItem()
{
UserId = item.UserId,
UserName = userModel?.Name ?? "",
SignUserList = new List<SignUserItem>(),
};
result.Add(activity);
}
};
return result;
}
/// <summary>
/// 获取商会活动报名列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
......
......@@ -132,6 +132,10 @@ namespace Mall.Repository.TradePavilion
{
builder.Append($" AND {nameof(RB_Authentication_Extend.CreateBy)}={(int)query.CreateBy}");
}
if (!string.IsNullOrEmpty(query.QCreateBy))
{
builder.Append($" AND {nameof(RB_Authentication_Extend.CreateBy)} IN({query.QCreateBy}) ");
}
if (query.AuditState > 0)
{
builder.Append($" AND {nameof(RB_Authentication_Extend.AuditState)}={query.AuditState}");
......
......@@ -15,7 +15,82 @@ namespace Mall.Repository.TradePavilion
public class RB_Commerce_ConsultRepository : BaseRepository<RB_Commerce_Consult>
{
/// <summary>
/// 获取商会活动报名分页列表
/// 获取商会活动报名统计分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Commerce_Consult_Extend> GetCommerceConsultStatisticsPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_Commerce_Consult_Extend query)
{
rowsCount = 0;
DynamicParameters parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT ActivityId,UserId,Count(1) AS UserCount
FROM RB_Commerce_Consult
WHERE 1=1
");
if (query == null)
{
return new List<RB_Commerce_Consult_Extend>();
}
else
{
if (query.EnrollState > 0)
{
if (query.EnrollState == 1)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Commerce_Consult_Extend.Status), (int)DateStateEnum.Normal);
}
else if (query.EnrollState == 2)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Commerce_Consult_Extend.Status), (int)DateStateEnum.Delete);
}
}
else
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Commerce_Consult_Extend.Status), (int)DateStateEnum.Normal);
}
if (query.TenantId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Commerce_Consult_Extend.TenantId), query.TenantId);
}
if (query.MallBaseId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Commerce_Consult_Extend.MallBaseId), query.MallBaseId);
}
if (!string.IsNullOrEmpty(query.LinkMan))
{
builder.AppendFormat(" AND {0} LIKE @Name ", nameof(RB_Commerce_Consult_Extend.LinkMan));
parameters.Add("Name", "%" + query.LinkMan.Trim() + "%");
}
if (query.ActivityId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Commerce_Consult_Extend.ActivityId), query.ActivityId);
}
if (!string.IsNullOrEmpty(query.QActivityIds))
{
builder.AppendFormat(" AND {0} IN({1}) ", nameof(RB_Commerce_Consult_Extend.ActivityId), query.QActivityIds);
}
if (!string.IsNullOrEmpty(query.QUserIds))
{
builder.AppendFormat(" AND {0} IN({1}) ", nameof(RB_Commerce_Consult_Extend.UserId), query.QUserIds);
}
if (query.UserId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Commerce_Consult_Extend.UserId), query.UserId);
}
}
builder.Append(" GROUP BY ActivityId,UserId ");
return GetPage<RB_Commerce_Consult_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
/// <summary>
/// 获取商会活动报名列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
......
......@@ -189,7 +189,8 @@ namespace Mall.WebApi.Controllers.MallBase
name = item.NavName,
page_id = 0,
template_id = item.Id,
template = templateData
template = templateData,
templateBg = new { titleColor = "#111" }
};
list.Add(tempObj);
}
......@@ -262,7 +263,8 @@ namespace Mall.WebApi.Controllers.MallBase
name = (index == 0 ? "首页" : item.NavName),
page_id = 0,
template_id = item.Id,
template = templateData
template = templateData,
templateBg = new { titleColor = "#111" }
};
list.Add(tempObj);
index++;
......
......@@ -609,6 +609,26 @@ namespace Mall.WebApi.Controllers.TradePavilion
return ApiResult.Success(data: list);
}
/// <summary>
/// 获取商会活动报名分页列表
/// </summary>
/// <returns></returns>
public ApiResult GetCommerceConsultStaticPage()
{
ResultPageModel pageModel = JsonConvert.DeserializeObject<ResultPageModel>(RequestParm.msg.ToString());
JObject parms = JObject.Parse(RequestParm.msg.ToString());
var query = new RB_Commerce_Consult_Extend()
{
LinkMan = parms.GetStringValue("LinkMan")
};
query.MallBaseId = RequestParm.MallBaseId;
query.TenantId = RequestParm.TenantId;
var list = consultModule.GetCommerceConsultPageModule(pageModel.pageIndex, pageModel.pageSize, out long rowsCount, query);
pageModel.count = Convert.ToInt32(rowsCount);
pageModel.pageData = list;
return ApiResult.Success(data: pageModel);
}
/// <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