Commit 697b674c authored by 黄奎's avatar 黄奎
parents 04bdfa09 ead1308c
......@@ -139,10 +139,11 @@ namespace Mall.Model.Entity.TradePavilion
/// </summary>
public DateTime? AuditDate { get; set; }
/// <summary>
/// 奖项来源ids
/// 现有品牌id
/// </summary>
public string SourceIds { get; set; }
public int ExistBrandId { get; set; }
}
}
......@@ -219,5 +219,11 @@ namespace Mall.Model.Entity.TradePavilion
public decimal OpenShopWish { get; set; }
/// <summary>
/// 奖项来源ids
/// </summary>
public string SourceIds { get; set; }
}
}
......@@ -17,7 +17,10 @@ namespace Mall.Model.Extend.TradePavilion
/// </summary>
public string BrandIds { get; set; }
/// <summary>
/// 奖项
/// </summary>
public int PrizeId { get; set; }
/// <summary>
/// 品牌Ids
......@@ -68,6 +71,14 @@ namespace Mall.Model.Extend.TradePavilion
public string UserIcon { get; set; }
/// <summary>
/// 奖项
/// </summary>
public List<RB_Prize_Extend> PrizeList { get; set; }
/// <summary>
/// 奖章
/// </summary>
public List<RB_FirstShop_ListEnroll_Extend> ListEnroll { get; set; }
/// 排序(1-默认,2主键倒序)
/// </summary>
public int QOrderBy { get; set; }
......
......@@ -21,6 +21,11 @@ namespace Mall.Model.Extend.TradePavilion
/// </summary>
public List<string> BannerList { get; set; }
/// <summary>
/// 载体荣誉图
/// </summary>
public List<string> HonorList { get; set; }
/// <summary>
/// 排序
/// </summary>
......@@ -59,5 +64,13 @@ namespace Mall.Model.Extend.TradePavilion
/// 项目类型
/// </summary>
public string ProjectName { get; set; }
/// <summary>
/// 首店数量
/// </summary>
public List<FirstShopNumModel> FirstShopNumList { get; set; }
}
}
......@@ -13,6 +13,12 @@ namespace Mall.Model.Extend.TradePavilion
/// </summary>
public List<RB_CarrierMetro_Extend> CarrierMetroList { get; set; }
/// <summary>
/// 载体荣誉图
/// </summary>
public List<string> HonorList { get; set; }
/// <summary>
/// 载体ids查询
/// </summary>
......@@ -78,6 +84,12 @@ namespace Mall.Model.Extend.TradePavilion
public List<FirstShopNumModel> FirstShopNumList { get; set; }
/// <summary>
/// 奖章
/// </summary>
public List<RB_FirstShop_ListEnroll_Extend> ListEnroll { get; set; }
}
/// <summary>
......@@ -95,5 +107,8 @@ namespace Mall.Model.Extend.TradePavilion
/// 数量
/// </summary>
public int Num { get; set; }
public string Name { get; set; }
}
}
......@@ -27,5 +27,11 @@ namespace Mall.Model.Extend.TradePavilion
/// 品牌/载体图标
/// </summary>
public string ObjectIcon { get; set; }
/// <summary>
/// 对象ids
/// </summary>
public string ObjectIds { get; set; }
}
}
......@@ -14,5 +14,10 @@ namespace Mall.Model.Extend.TradePavilion
public int TotalCount { get; set; }
/// <summary>
/// 奖项的ids
/// </summary>
public string QPrizeIds { get; set; }
}
}
......@@ -49,6 +49,8 @@ namespace Mall.Module.TradePavilion
{ nameof(RB_Authentication_Extend.Category),demodel.Category},
{ nameof(RB_Authentication_Extend.Contact),demodel.Contact},
{ nameof(RB_Authentication_Extend.ContactMobile),demodel.ContactMobile},
{ nameof(RB_Authentication_Extend.ExistBrandId),demodel.ExistBrandId},
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
......@@ -217,16 +219,16 @@ namespace Mall.Module.TradePavilion
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Authentication_Extend.SourceIds),SourceIds},
{ nameof(RB_Brand_Extend.SourceIds),SourceIds},
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Authentication_Extend.Id),
FiledName=nameof(RB_Brand_Extend.ID),
FiledValue=authenticationIds,
OperatorEnum=OperatorEnum.IN
}
};
return authenticationRepository.Update(keyValues, wheres);
return new RB_BrandRepository().Update(keyValues, wheres);
}
......
......@@ -136,6 +136,14 @@ namespace Mall.Module.TradePavilion
{
item.BannerList = JsonConvert.DeserializeObject<List<string>>(item.Banner);
}
if (!string.IsNullOrWhiteSpace(item.Honor))
{
item.HonorList = JsonConvert.DeserializeObject<List<string>>(item.Honor);
}
if (!string.IsNullOrWhiteSpace(item.FirstShopNum))
{
item.FirstShopNumList = JsonConvert.DeserializeObject<List<FirstShopNumModel>>(item.FirstShopNum);
}
item.CarrierMetroList = new List<RB_CarrierMetro_Extend>();
item.CarrierMetroList = metroList.Where(x => x.CarrierId == item.ID).ToList();
}
......@@ -172,6 +180,22 @@ namespace Mall.Module.TradePavilion
{
model.BannerList = new List<string>();
}
if (!string.IsNullOrWhiteSpace(model.Honor))
{
model.HonorList = JsonConvert.DeserializeObject<List<string>>(model.Honor);
}
else
{
model.HonorList = new List<string>();
}
if (!string.IsNullOrWhiteSpace(model.FirstShopNum))
{
model.FirstShopNumList = JsonConvert.DeserializeObject<List<FirstShopNumModel>>(model.FirstShopNum);
}
else
{
model.FirstShopNumList = new List<FirstShopNumModel>();
}
}
return model;
}
......@@ -206,7 +230,19 @@ namespace Mall.Module.TradePavilion
{nameof(RB_Carrier_Extend.Location),model.Location },
{nameof(RB_Carrier_Extend.Crowd),model.Crowd },
{nameof(RB_Carrier_Extend.FirstStoreTest),model.FirstStoreTest },
{nameof(RB_Carrier_Extend.OpeningStatus),model.OpeningStatus }
{nameof(RB_Carrier_Extend.OpeningStatus),model.OpeningStatus },
{nameof(RB_CarrierApplyFor_Extend.Discount),model.Discount },
{nameof(RB_CarrierApplyFor_Extend.Honor),model.Honor },
{nameof(RB_CarrierApplyFor_Extend.YeJi),model.YeJi },
{nameof(RB_CarrierApplyFor_Extend.ShopNum),model.ShopNum },
{nameof(RB_CarrierApplyFor_Extend.AreaRequirement ),model.AreaRequirement },
{nameof(RB_CarrierApplyFor_Extend.EndAreaRequirement),model.EndAreaRequirement },
{nameof(RB_CarrierApplyFor_Extend.BuiltUpArea),model.BuiltUpArea },
{nameof(RB_CarrierApplyFor_Extend.EndBuiltUpArea),model.EndBuiltUpArea },
{nameof(RB_CarrierApplyFor_Extend.FirstShopNum),model.FirstShopNum },
{nameof(RB_CarrierApplyFor_Extend.StartingInfo),model.StartingInfo },
{nameof(RB_CarrierApplyFor_Extend.FirstShow),model.FirstShow },
{nameof(RB_CarrierApplyFor_Extend.FirstExhibition),model.FirstExhibition },
};
flag = carrierRepository.Update(fileds, new WhereHelper(nameof(RB_Carrier_Extend.ID), model.ID));
......@@ -293,6 +329,18 @@ namespace Mall.Module.TradePavilion
{nameof(RB_CarrierApplyFor_Extend.Location),model.Location },
{nameof(RB_CarrierApplyFor_Extend.Crowd),model.Crowd },
{nameof(RB_CarrierApplyFor_Extend.ExistCarrierId),model.ExistCarrierId },
{nameof(RB_CarrierApplyFor_Extend.Discount),model.Discount },
{nameof(RB_CarrierApplyFor_Extend.Honor),model.Honor },
{nameof(RB_CarrierApplyFor_Extend.YeJi),model.YeJi },
{nameof(RB_CarrierApplyFor_Extend.ShopNum),model.ShopNum },
{nameof(RB_CarrierApplyFor_Extend.AreaRequirement ),model.AreaRequirement },
{nameof(RB_CarrierApplyFor_Extend.EndAreaRequirement),model.EndAreaRequirement },
{nameof(RB_CarrierApplyFor_Extend.BuiltUpArea),model.BuiltUpArea },
{nameof(RB_CarrierApplyFor_Extend.EndBuiltUpArea),model.EndBuiltUpArea },
{nameof(RB_CarrierApplyFor_Extend.FirstShopNum),model.FirstShopNum },
{nameof(RB_CarrierApplyFor_Extend.StartingInfo),model.StartingInfo },
{nameof(RB_CarrierApplyFor_Extend.FirstShow),model.FirstShow },
{nameof(RB_CarrierApplyFor_Extend.FirstExhibition),model.FirstExhibition },
};
flag = carrierApplyForRepository.Update(fileds, new WhereHelper(nameof(RB_CarrierApplyFor_Extend.ID), model.ID));
if (flag)
......@@ -473,6 +521,8 @@ namespace Mall.Module.TradePavilion
//查询用户列表
string userIds = string.Join(",", list.Where(x => x.UserId > 0).Select(x => x.UserId));
var ulist = member_UserRepository.GetList(new Model.Extend.User.RB_Member_User_Extend() { MallBaseId = query.MallBaseId, UserIds = userIds });
foreach (var item in list.Where(x => x.UserId > 0))
{
var umodel = ulist.Where(x => x.Id == item.UserId).FirstOrDefault();
......@@ -480,6 +530,33 @@ namespace Mall.Module.TradePavilion
item.UserIcon = umodel.Photo;
}
}
}
if (list != null && list.Any())//绑定奖章
{
string sourceIds = string.Join(",", list.Where(x => !string.IsNullOrWhiteSpace(x.SourceIds)).Select(x => x.SourceIds));
List<RB_Prize_Extend> prizeList = new List<RB_Prize_Extend>();
if (!string.IsNullOrWhiteSpace(sourceIds))
{
prizeList = prizeRepository.GetList(new RB_Prize_Extend { MallBaseId = query.MallBaseId, TenantId = query.TenantId, QPrizeIds = sourceIds });
}
if (prizeList != null && prizeList.Any())
{
foreach (var item in list.Where(x=>!string.IsNullOrWhiteSpace(x.SourceIds)))
{
item.PrizeList = new List<RB_Prize_Extend>();
foreach (var itemSourceId in item.SourceIds.Split(","))
{
var nowPrizeModel = prizeList.Where(x => x.Id.ToString() == itemSourceId).FirstOrDefault();
if (nowPrizeModel != null && nowPrizeModel.Id > 0)
{
item.PrizeList.Add(nowPrizeModel);
}
}
}
}
}
return list;
}
......@@ -841,12 +918,28 @@ namespace Mall.Module.TradePavilion
{
if (!string.IsNullOrEmpty(sourceIds))
{
var sourceList = GetBrandListByWhere(new RB_Brand_Extend { TenantId = query.TenantId, MallBaseId = query.MallBaseId, QBrandIds = sourceIds });
var sourceList = GetBrandListByWhere(new RB_Brand_Extend
{
TenantId = query.TenantId,
MallBaseId = query.MallBaseId,
QBrandIds = sourceIds,
RanQi = -1,
KongTiao = -1,
XinFeng = -1,
Plumbing = -1,
Caliber = -1,
Sewage = -1,
PaiYan = -1,
});
foreach (var item in list)
{
RB_Brand_Extend carrierModel = sourceList.Where(x => x.ID == item.SourceId).FirstOrDefault();
if (carrierModel != null && carrierModel.ID > 0)
{
if (!string.IsNullOrWhiteSpace(carrierModel.Banner))
{
carrierModel.BannerList = JsonConvert.DeserializeObject<List<string>>(carrierModel.Banner);
}
item.SourceName = carrierModel.BrandName;
item.SourceFullName = carrierModel.FullBrandName;
item.ProjectType = carrierModel.ProjectType;
......
......@@ -350,6 +350,24 @@ namespace Mall.Module.TradePavilion
{
model.CarrierModel.BannerList = new List<string>();
}
if (!string.IsNullOrWhiteSpace(model.CarrierModel.Honor))
{
model.CarrierModel.HonorList = JsonConvert.DeserializeObject<List<string>>(model.CarrierModel.Honor);
}
else
{
model.CarrierModel.HonorList = new List<string>();
}
if (!string.IsNullOrWhiteSpace(model.CarrierModel.FirstShopNum))
{
model.CarrierModel.FirstShopNumList = JsonConvert.DeserializeObject<List<FirstShopNumModel>>(model.CarrierModel.FirstShopNum);
}
else
{
model.CarrierModel.FirstShopNumList = new List<FirstShopNumModel>();
}
}
}
}
......@@ -605,6 +623,18 @@ namespace Mall.Module.TradePavilion
{nameof(RB_Carrier_Extend.Location),CarrierModel.Location },
{nameof(RB_Carrier_Extend.Crowd),CarrierModel.Crowd },
{nameof(RB_Carrier_Extend.UserId),cmodel.CreateBy },
{nameof(RB_Carrier_Extend.Discount),CarrierModel.Discount },
{nameof(RB_Carrier_Extend.Honor),CarrierModel.Honor },
{nameof(RB_Carrier_Extend.YeJi),CarrierModel.YeJi },
{nameof(RB_Carrier_Extend.ShopNum),CarrierModel.ShopNum },
{nameof(RB_Carrier_Extend.AreaRequirement ),CarrierModel.AreaRequirement },
{nameof(RB_Carrier_Extend.EndAreaRequirement),CarrierModel.EndAreaRequirement },
{nameof(RB_Carrier_Extend.BuiltUpArea),CarrierModel.BuiltUpArea },
{nameof(RB_Carrier_Extend.EndBuiltUpArea),CarrierModel.EndBuiltUpArea },
{nameof(RB_Carrier_Extend.FirstShopNum),CarrierModel.FirstShopNum },
{nameof(RB_Carrier_Extend.StartingInfo),CarrierModel.StartingInfo },
{nameof(RB_Carrier_Extend.FirstShow),CarrierModel.FirstShow },
{nameof(RB_Carrier_Extend.FirstExhibition),CarrierModel.FirstExhibition },
};
flag = carrierRepository.Update(filedsCarrier, new WhereHelper(nameof(RB_Carrier_Extend.ID), carrmodel.ID), trans);
if (flag)
......
......@@ -48,15 +48,18 @@ namespace Mall.Module.TradePavilion
public List<RB_FirstShop_List_Extend> GetFirstShopListPageList(int pageIndex, int pageSize, out long rowsCount, RB_FirstShop_List_Extend query)
{
var list = firstShop_ListRepository.GetPageList(pageIndex, pageSize, out rowsCount, query);
if (list.Any()) {
foreach (var item in list) {
if (list.Any())
{
foreach (var item in list)
{
if (item.ListState == Common.Enum.TradePavilion.ListStateEnum.Enroll && item.EndDate <= DateTime.Now)
{
item.ListState = Common.Enum.TradePavilion.ListStateEnum.Rating;
}
item.ObjectTypeList = new List<string>();
if (!string.IsNullOrEmpty(item.ObjectTypeIds)) {
if (!string.IsNullOrEmpty(item.ObjectTypeIds))
{
List<int> OIdList = JsonHelper.DeserializeObject<List<int>>("[" + item.ObjectTypeIds + "]");
foreach (var qitem in OIdList)
{
......@@ -128,30 +131,36 @@ namespace Mall.Module.TradePavilion
public RB_FirstShop_List_Extend GetAppletFirstShopListInfo(int listId, Common.AppletUserInfo userInfo)
{
var model = firstShop_ListRepository.GetEntity<RB_FirstShop_List_Extend>(listId);
if (model != null) {
if (model != null)
{
if (model.ListState == Common.Enum.TradePavilion.ListStateEnum.Confirmed)
{
//已放榜 查询所有上榜的列表
var enrollList = firstShop_ListEnrollRepository.GetList(new RB_FirstShop_ListEnroll_Extend() { MallBaseId = userInfo.MallBaseId, ListId = listId, RankListState = 1 });
//查询 品牌/载体 名称 图片
if (enrollList.Any()) {
if (enrollList.Any())
{
var e1list = enrollList.Where(x => x.ObjectType == Common.Enum.TradePavilion.ListObjectTypeEnum.Brand).ToList();
var e2list = enrollList.Where(x => x.ObjectType == Common.Enum.TradePavilion.ListObjectTypeEnum.Carrier).ToList();
if (e1list.Any()) {
if (e1list.Any())
{
//查询品牌
string bids = string.Join(",", e1list.Select(x => x.ObjectId));
var blist = brandRepository.GetBrandList(new RB_Brand_Extend() { MallBaseId = userInfo.MallBaseId, BrandIds = bids });
foreach (var item in e1list) {
foreach (var item in e1list)
{
var bmodel = blist.Where(x => x.ID == item.ObjectId).FirstOrDefault();
item.ObjectName = bmodel?.BrandName ?? "";
item.ObjectIcon = bmodel?.Logo ?? "";
}
}
if (e2list.Any()) {
if (e2list.Any())
{
//查询载体
string cids = string.Join(",", e2list.Select(x => x.ObjectId));
var clist = carrierRepository.GetCarrierList(new RB_Carrier_Extend() { MallBaseId = userInfo.MallBaseId, CarrierIds = cids });
foreach (var item in e2list) {
foreach (var item in e2list)
{
var cmodel = clist.Where(x => x.ID == item.ObjectId).FirstOrDefault();
item.ObjectName = cmodel?.CarrierName ?? "";
item.ObjectIcon = cmodel?.Logo ?? "";
......@@ -160,7 +169,8 @@ namespace Mall.Module.TradePavilion
}
model.RankList = enrollList;
}
else {
else
{
//查询个人报名记录
var enrollList = firstShop_ListEnrollRepository.GetList(new RB_FirstShop_ListEnroll_Extend() { MallBaseId = userInfo.MallBaseId, ListId = listId, UserId = userInfo.UserId });
//查询 品牌/载体 名称 图片
......@@ -209,7 +219,8 @@ namespace Mall.Module.TradePavilion
if (demodel.Id > 0)
{
var oldModel = firstShop_ListRepository.GetEntity(demodel.Id);
if (oldModel == null || oldModel.Status == 1 || oldModel.ListState == Common.Enum.TradePavilion.ListStateEnum.Cancel || oldModel.ListState == Common.Enum.TradePavilion.ListStateEnum.Confirmed) {
if (oldModel == null || oldModel.Status == 1 || oldModel.ListState == Common.Enum.TradePavilion.ListStateEnum.Cancel || oldModel.ListState == Common.Enum.TradePavilion.ListStateEnum.Confirmed)
{
return "绑单状态不正确";
}
......@@ -239,7 +250,8 @@ namespace Mall.Module.TradePavilion
bool flag = firstShop_ListRepository.Update(keyValues, wheres);
return flag ? "" : "修改失败,请联系管理员";
}
else {
else
{
//新增
bool flag = firstShop_ListRepository.Insert(demodel) > 0;
return flag ? "" : "新增失败,请联系管理员";
......@@ -287,7 +299,8 @@ namespace Mall.Module.TradePavilion
var enrollList = firstShop_ListEnrollRepository.GetList(new RB_FirstShop_ListEnroll_Extend() { MallBaseId = userInfo.MallBaseId, ListId = listId, UserId = userInfo.UserId });
if (enrollId > 0) { enrollList = enrollList.Where(x => x.Id != enrollId).ToList(); }//排除当前修改的
//查询用户下所有的品牌
if (listModel.ObjectTypeIds.Contains("1")) {
if (listModel.ObjectTypeIds.Contains("1"))
{
//品牌
var blist = brandRepository.GetBrandList(new RB_Brand_Extend() { MallBaseId = userInfo.MallBaseId, UserId = userInfo.UserId });
blist = blist.Where(x => !enrollList.Where(x => x.ObjectType == Common.Enum.TradePavilion.ListObjectTypeEnum.Brand).Select(y => y.ObjectId).Contains(x.ID)).ToList();
......@@ -334,7 +347,8 @@ namespace Mall.Module.TradePavilion
public string SetAppletFirstShopListInfo(RB_FirstShop_ListEnroll_Extend demodel)
{
var listModel = firstShop_ListRepository.GetEntity(demodel.ListId);
if (listModel == null || listModel.Status == 1 || listModel.ListState == Common.Enum.TradePavilion.ListStateEnum.Cancel) {
if (listModel == null || listModel.Status == 1 || listModel.ListState == Common.Enum.TradePavilion.ListStateEnum.Cancel)
{
return "榜单不存在,请核实后再试";
}
if (listModel.StartDate > DateTime.Now) { return "榜单还未开始报名,无法报名"; }
......@@ -364,10 +378,12 @@ namespace Mall.Module.TradePavilion
bool flag = firstShop_ListEnrollRepository.Update(keyValues, wheres);
return flag ? "" : "修改失败,请联系管理人员";
}
else {
else
{
#region 验证
var valistList = firstShop_ListEnrollRepository.GetList(new RB_FirstShop_ListEnroll_Extend() { MallBaseId = demodel.MallBaseId, UserId = demodel.UserId, ObjectType = demodel.ObjectType, ObjectId = demodel.ObjectId });
if (valistList.Any()) {
if (valistList.Any())
{
return "该品牌/载体已报名,无法重复报名";
}
#endregion
......@@ -412,5 +428,17 @@ namespace Mall.Module.TradePavilion
var list = firstShop_ListRepository.GetAppletMyEnrollFistShopListPageList(pageIndex, pageSize, out count, demodel);
return list;
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_FirstShop_ListEnroll_Extend> GetFirstShopListEnrollList(RB_FirstShop_ListEnroll_Extend dmodel)
{
return firstShop_ListEnrollRepository.GetList(dmodel);
}
}
}
......@@ -43,10 +43,7 @@ namespace Mall.Repository.TradePavilion
{
builder.Append($" AND {nameof(RB_Authentication_Extend.Type)}={(int)query.Type}");
}
if (query.PrizeId > 0)
{
builder.AppendFormat(" AND FIND_IN_SET({0},{1})) ", query.PrizeId, nameof(RB_Authentication_Extend.SourceIds));
}
if (query.BrandType > 0)
{
builder.Append($" AND {nameof(RB_Authentication_Extend.BrandType)}={(int)query.BrandType}");
......
......@@ -62,7 +62,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Brand_Extend.ProjectType), (int)query.ProjectType);
}
if (query.PrizeId > 0)
{
builder.AppendFormat(" AND FIND_IN_SET({0},a.{1}) ", query.PrizeId, nameof(RB_Brand_Extend.SourceIds));
}
if (query.RanQi > -1)
{
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Brand_Extend.RanQi), query.RanQi);
......@@ -194,6 +197,8 @@ WHERE 1=1
{
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Brand_Extend.UserId), query.UserId);
}
if (!string.IsNullOrWhiteSpace(query.QBrandIds))
{
builder.AppendFormat(" AND a.{0} in ({1}) ", nameof(RB_Brand_Extend.ID), query.QBrandIds);
......@@ -286,6 +291,7 @@ WHERE 1=1
{
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Brand_Extend.UserId), query.UserId);
}
if (query.UserId == -1)
{
builder.AppendFormat(" AND a.{0} =0 ", nameof(RB_Brand_Extend.UserId));//查询未绑定用户的
......
......@@ -91,6 +91,10 @@ where {where} order by w.Id desc
{
where += $@" and w.{nameof(RB_FirstShop_ListEnroll_Extend.CandidateState)}={dmodel.CandidateState}";
}
if (!string.IsNullOrWhiteSpace(dmodel.ObjectIds))
{
where += $@" and w.{nameof(RB_FirstShop_ListEnroll_Extend.ObjectId)} in ({dmodel.ObjectIds})";
}
if (dmodel.RankListState > 0)
{
where += $@" and w.{nameof(RB_FirstShop_ListEnroll_Extend.RankListState)}={dmodel.RankListState}";
......
......@@ -25,7 +25,7 @@ namespace Mall.Repository.TradePavilion
public List<RB_Prize_Extend> GetPageList(int pageIndex, int pageSize, out long rowCount, RB_Prize_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.Append($" SELECT a.*,(SELECT COUNT(*) from rb_authentication where `Status`=0 and FIND_IN_SET(a.Id,SourceIds)) FROM rb_prize as a WHERE `Status`=0 ");
builder.Append($" SELECT a.*,(SELECT COUNT(*) from rb_brand where `Status`=0 and FIND_IN_SET(a.Id,SourceIds)) FROM rb_prize as a WHERE `Status`=0 ");
if (query != null)
{
......@@ -63,6 +63,10 @@ namespace Mall.Repository.TradePavilion
builder.Append($" AND {nameof(RB_Prize_Extend.MallBaseId)}={query.MallBaseId}");
}
if (!string.IsNullOrWhiteSpace(query.QPrizeIds))
{
builder.Append($" AND {nameof(RB_Prize_Extend.Id)} in ({query.QPrizeIds})");
}
if (query.Id > 0)
{
builder.Append($" AND {nameof(RB_Prize_Extend.Id)}={query.Id}");
......
......@@ -1112,7 +1112,13 @@ namespace Mall.WebApi.Controllers.TradePavilion
{
return ApiResult.Failed("未审核/审核不通过的不能授予奖章");
}
bool flag = authenticationModule.SetAuthenticationPrize(AuthenticationIds, SourceIds);
var brandIds = string.Join(",", list.Where(x => x.ExistBrandId > 0).Select(x => x.ExistBrandId));
bool flag = false;
if (!string.IsNullOrWhiteSpace(brandIds))
{
flag = authenticationModule.SetAuthenticationPrize(brandIds, SourceIds);
}
if (flag)
{
return ApiResult.Success();
......@@ -1231,6 +1237,22 @@ namespace Mall.WebApi.Controllers.TradePavilion
{
query.Banner = "";
}
if (query.HonorList != null && query.HonorList.Any())
{
query.Honor = JsonConvert.SerializeObject(query.HonorList);
}
else
{
query.Honor = "";
}
if (query.FirstShopNumList != null && query.FirstShopNumList.Any())
{
query.FirstShopNum = JsonConvert.SerializeObject(query.FirstShopNumList);
}
else
{
query.FirstShopNum = "";
}
if (query.ID == 0)
{
query.CreateDate = System.DateTime.Now;
......
......@@ -9,7 +9,7 @@
<WebStackScaffolding_IsReferencingScriptLibrariesSelected>True</WebStackScaffolding_IsReferencingScriptLibrariesSelected>
<WebStackScaffolding_LayoutPageFile />
<WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
<NameOfLastUsedPublishProfile>E:\Work\Git_Project\Mall_Api\Mall.WebApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
<NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile>
<ShowAllFiles>false</ShowAllFiles>
</PropertyGroup>
</Project>
\ No newline at end of file
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