Commit 8123def6 authored by 黄奎's avatar 黄奎

页面修改

parents 0cfb82ec 1a6d7471
...@@ -139,5 +139,10 @@ namespace Mall.Model.Entity.TradePavilion ...@@ -139,5 +139,10 @@ namespace Mall.Model.Entity.TradePavilion
/// </summary> /// </summary>
public DateTime? AuditDate { get; set; } public DateTime? AuditDate { get; set; }
/// <summary>
/// 奖项来源ids
/// </summary>
public string SourceIds { get; set; }
} }
} }
...@@ -217,5 +217,7 @@ namespace Mall.Model.Entity.TradePavilion ...@@ -217,5 +217,7 @@ namespace Mall.Model.Entity.TradePavilion
/// 开店意愿(打分制) /// 开店意愿(打分制)
/// </summary> /// </summary>
public decimal OpenShopWish { get; set; } public decimal OpenShopWish { get; set; }
} }
} }
...@@ -159,5 +159,80 @@ namespace Mall.Model.Entity.TradePavilion ...@@ -159,5 +159,80 @@ namespace Mall.Model.Entity.TradePavilion
/// 归属于用户 /// 归属于用户
/// </summary> /// </summary>
public int UserId { get; set; } public int UserId { get; set; }
/// <summary>
/// 开业状态0-即将开业,1-已开业
/// </summary>
public int OpeningStatus { get; set; }
/// <summary>
/// 首店试验场 0-否,1-是
/// </summary>
public int FirstStoreTest { get; set; }
/// <summary>
/// 招商优惠政策
/// </summary>
public string Discount { get; set; }
/// <summary>
/// 载体荣誉
/// </summary>
public string Honor { get; set; }
/// <summary>
/// 去年业绩(单位:W)
/// </summary>
public decimal YeJi { get; set; }
/// <summary>
/// 店铺数量
/// </summary>
public int ShopNum { get; set; }
/// <summary>
/// 可租赁面积
/// </summary>
public decimal AreaRequirement { get; set; }
/// <summary>
/// 可租赁面积
/// </summary>
public decimal EndAreaRequirement { get; set; }
/// <summary>
/// 经营面积
/// </summary>
public decimal BuiltUpArea { get; set; }
/// <summary>
/// 经营面积
/// </summary>
public decimal EndBuiltUpArea { get; set; }
/// <summary>
/// 首店数量
/// </summary>
public string FirstShopNum { get; set; }
/// <summary>
/// 首发政策
/// </summary>
public string StartingInfo { get; set; }
/// <summary>
/// 首秀政策
/// </summary>
public string FirstShow { get; set; }
/// <summary>
/// 首展政策
/// </summary>
public string FirstExhibition { get; set; }
} }
} }
...@@ -165,5 +165,71 @@ namespace Mall.Model.Entity.TradePavilion ...@@ -165,5 +165,71 @@ namespace Mall.Model.Entity.TradePavilion
/// 现有的载体Id /// 现有的载体Id
/// </summary> /// </summary>
public int ExistCarrierId { get; set; } public int ExistCarrierId { get; set; }
/// <summary>
/// 招商优惠政策
/// </summary>
public string Discount { get; set; }
/// <summary>
/// 载体荣誉
/// </summary>
public string Honor { get; set; }
/// <summary>
/// 去年业绩(单位:W)
/// </summary>
public decimal YeJi { get; set; }
/// <summary>
/// 店铺数量
/// </summary>
public int ShopNum { get; set; }
/// <summary>
/// 可租赁面积
/// </summary>
public decimal AreaRequirement { get; set; }
/// <summary>
/// 可租赁面积
/// </summary>
public decimal EndAreaRequirement { get; set; }
/// <summary>
/// 经营面积
/// </summary>
public decimal BuiltUpArea { get; set; }
/// <summary>
/// 经营面积
/// </summary>
public decimal EndBuiltUpArea { get; set; }
/// <summary>
/// 首店数量
/// </summary>
public string FirstShopNum { get; set; }
/// <summary>
/// 首发政策
/// </summary>
public string StartingInfo { get; set; }
/// <summary>
/// 首秀政策
/// </summary>
public string FirstShow { get; set; }
/// <summary>
/// 首展政策
/// </summary>
public string FirstExhibition { get; set; }
} }
} }
...@@ -47,13 +47,18 @@ namespace Mall.Model.Entity.TradePavilion ...@@ -47,13 +47,18 @@ namespace Mall.Model.Entity.TradePavilion
/// <summary> /// <summary>
/// 报名截止日期 /// 报名截止日期
/// </summary> /// </summary>
public DateTime DeadlineDate { get; set; } public DateTime EndDate { get; set; }
/// <summary> /// <summary>
/// 公示日期 /// 报名开始日期
/// </summary> /// </summary>
public DateTime StartDate { get; set; } public DateTime StartDate { get; set; }
/// <summary>
/// 放榜日期
/// </summary>
public DateTime FinishDate { get; set; }
/// <summary> /// <summary>
/// 详细内容 /// 详细内容
/// </summary> /// </summary>
......
...@@ -19,6 +19,11 @@ namespace Mall.Model.Entity.TradePavilion ...@@ -19,6 +19,11 @@ namespace Mall.Model.Entity.TradePavilion
/// </summary> /// </summary>
public int Id { get; set; } public int Id { get; set; }
/// <summary>
/// 榜单Id
/// </summary>
public int ListId { get; set; }
/// <summary> /// <summary>
/// 用户id /// 用户id
/// </summary> /// </summary>
...@@ -29,6 +34,11 @@ namespace Mall.Model.Entity.TradePavilion ...@@ -29,6 +34,11 @@ namespace Mall.Model.Entity.TradePavilion
/// </summary> /// </summary>
public ListObjectTypeEnum ObjectType { get; set; } public ListObjectTypeEnum ObjectType { get; set; }
/// <summary>
/// 品牌/载体id
/// </summary>
public int ObjectId { get; set; }
/// <summary> /// <summary>
/// 表单内容 /// 表单内容
/// </summary> /// </summary>
...@@ -79,18 +89,13 @@ namespace Mall.Model.Entity.TradePavilion ...@@ -79,18 +89,13 @@ namespace Mall.Model.Entity.TradePavilion
/// </summary> /// </summary>
public int MallBaseId { get; set; } public int MallBaseId { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary> /// <summary>
/// 创建时间 /// 创建时间
/// </summary> /// </summary>
public DateTime CreateDate { get; set; } public DateTime CreateDate { get; set; }
/// <summary> /// <summary>
/// 修改人 /// 操作人 - 后台empId
/// </summary> /// </summary>
public int UpdateBy { get; set; } public int UpdateBy { get; set; }
......
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Common.Enum;
using Mall.Common.Enum.TradePavilion;
using VT.FW.DB;
namespace Mall.Model.Entity.TradePavilion
{
/// <summary>
/// 奖项实体表
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Prize
{
/// <summary>
/// 编号
/// </summary>
public int Id { get; set; }
///// <summary>
///// 类型 1载体 2品牌
///// </summary>
//public int Type { get; set; }
/// <summary>
/// 年份
/// </summary>
public int YearInfo { get; set; }
/// <summary>
/// 奖项名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 大奖章
/// </summary>
public string BigIco { get; set; }
/// <summary>
/// 小奖章
/// </summary>
public string SmallIco { get; set; }
/// <summary>
/// 商户号id
/// </summary>
public int TenantId { get; set; }
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateDate { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public int Status { get; set; }
}
}
...@@ -42,5 +42,10 @@ namespace Mall.Model.Extend.TradePavilion ...@@ -42,5 +42,10 @@ namespace Mall.Model.Extend.TradePavilion
/// 多个ids /// 多个ids
/// </summary> /// </summary>
public string Ids { get; set; } public string Ids { get; set; }
/// <summary>
/// 奖项
/// </summary>
public int PrizeId { get; set; }
} }
} }
...@@ -12,10 +12,24 @@ namespace Mall.Model.Extend.TradePavilion ...@@ -12,10 +12,24 @@ namespace Mall.Model.Extend.TradePavilion
/// </summary> /// </summary>
public string ClassName { get; set; } public string ClassName { get; set; }
/// <summary>
/// 品牌ids查询
/// </summary>
public string BrandIds { get; set; }
/// <summary>
/// 品牌Ids
/// </summary>
public string QBrandIds { get; set; }
public List<string> BannerList { get; set; } public List<string> BannerList { get; set; }
/// <summary>
///
/// </summary>
public string ProjectName { get; set; } public string ProjectName { get; set; }
/// <summary> /// <summary>
......
...@@ -13,6 +13,11 @@ namespace Mall.Model.Extend.TradePavilion ...@@ -13,6 +13,11 @@ namespace Mall.Model.Extend.TradePavilion
/// </summary> /// </summary>
public List<RB_CarrierMetro_Extend> CarrierMetroList { get; set; } public List<RB_CarrierMetro_Extend> CarrierMetroList { get; set; }
/// <summary>
/// 载体ids查询
/// </summary>
public string CarrierIds { get; set; }
/// <summary> /// <summary>
/// 介绍图 /// 介绍图
/// </summary> /// </summary>
...@@ -66,5 +71,30 @@ namespace Mall.Model.Extend.TradePavilion ...@@ -66,5 +71,30 @@ namespace Mall.Model.Extend.TradePavilion
/// 查询多少条数据 /// 查询多少条数据
/// </summary> /// </summary>
public int QTop { get; set; } public int QTop { get; set; }
/// 载体ids
/// </summary>
public string QCarrierIds { get; set; }
public List<FirstShopNumModel> FirstShopNumList { get; set; }
}
/// <summary>
/// 首店数量
/// </summary>
public class FirstShopNumModel
{
/// <summary>
/// 类型
/// </summary>
public int Id { get; set; }
/// <summary>
/// 数量
/// </summary>
public int Num { get; set; }
>>>>>>> .merge_file_a09588
} }
} }
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using Mall.Common.Enum.TradePavilion;
using Mall.Common.Plugin; using Mall.Common.Plugin;
using Mall.Model.Entity.TradePavilion; using Mall.Model.Entity.TradePavilion;
...@@ -8,6 +9,37 @@ namespace Mall.Model.Extend.TradePavilion ...@@ -8,6 +9,37 @@ namespace Mall.Model.Extend.TradePavilion
{ {
public class RB_Collect_Extend : RB_Collect public class RB_Collect_Extend : RB_Collect
{ {
/// <summary>
/// 品牌/载体名称
/// </summary>
public string SourceName { get; set; }
/// <summary>
/// 品牌全名
/// </summary>
public string SourceFullName { get; set; }
/// <summary>
/// 载体地址
/// </summary>
public string Address { get; set; }
/// <summary>
/// 项目类型
/// </summary>
public ProjectTypeEnum? ProjectType { get; set; }
/// <summary>
/// 品牌/载体图片
/// </summary>
public List<string> BannerList { get; set; }
} }
} }
...@@ -17,5 +17,15 @@ namespace Mall.Model.Extend.TradePavilion ...@@ -17,5 +17,15 @@ namespace Mall.Model.Extend.TradePavilion
/// 用户名称 /// 用户名称
/// </summary> /// </summary>
public string UserName { get; set; } public string UserName { get; set; }
/// <summary>
/// 品牌/载体名称
/// </summary>
public string ObjectName { get; set; }
/// <summary>
/// 品牌/载体图标
/// </summary>
public string ObjectIcon { get; set; }
} }
} }
...@@ -22,5 +22,30 @@ namespace Mall.Model.Extend.TradePavilion ...@@ -22,5 +22,30 @@ namespace Mall.Model.Extend.TradePavilion
/// 面向群里id /// 面向群里id
/// </summary> /// </summary>
public int ObjectTypeId { get; set; } public int ObjectTypeId { get; set; }
/// <summary>
/// 小程序端状态 1进行中 , 2报名已截止 , 3已放榜
/// </summary>
public int State { get; set; }
/// <summary>
/// 排序 1根据报名截止日期
/// </summary>
public int OrderBy { get; set; }
/// <summary>
/// 是否查询正常的 1是
/// </summary>
public int IsAppletSelectNor { get; set; }
/// <summary>
/// 报名
/// </summary>
public List<RB_FirstShop_ListEnroll_Extend> EnrollList { get; set; }
/// <summary>
/// 上榜列表
/// </summary>
public List<RB_FirstShop_ListEnroll_Extend> RankList { get; set; }
} }
} }
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.TradePavilion;
namespace Mall.Model.Extend.TradePavilion
{
/// <summary>
/// 奖项扩展表
/// </summary>
public class RB_Prize_Extend : RB_Prize
{
public int TotalCount { get; set; }
}
}
...@@ -59,7 +59,8 @@ namespace Mall.Module.TradePavilion ...@@ -59,7 +59,8 @@ namespace Mall.Module.TradePavilion
}; };
return authenticationRepository.Update(keyValues, wheres); return authenticationRepository.Update(keyValues, wheres);
} }
else { else
{
return authenticationRepository.Insert(demodel) > 0; return authenticationRepository.Insert(demodel) > 0;
} }
} }
...@@ -75,10 +76,13 @@ namespace Mall.Module.TradePavilion ...@@ -75,10 +76,13 @@ namespace Mall.Module.TradePavilion
public List<RB_Authentication_Extend> GetAuthenticationPageList(int pageIndex, int pageSize, out long count, RB_Authentication_Extend demodel) public List<RB_Authentication_Extend> GetAuthenticationPageList(int pageIndex, int pageSize, out long count, RB_Authentication_Extend demodel)
{ {
var list = authenticationRepository.GetPageList(pageIndex, pageSize, out count, demodel); var list = authenticationRepository.GetPageList(pageIndex, pageSize, out count, demodel);
if (list.Any()) { if (list.Any())
foreach (var item in list) { {
foreach (var item in list)
{
item.ImageList = new List<string>(); item.ImageList = new List<string>();
if (!string.IsNullOrEmpty(item.Images) && item.Images != "[]") { if (!string.IsNullOrEmpty(item.Images) && item.Images != "[]")
{
item.ImageList = JsonConvert.DeserializeObject<List<string>>(item.Images); item.ImageList = JsonConvert.DeserializeObject<List<string>>(item.Images);
} }
} }
...@@ -101,7 +105,8 @@ namespace Mall.Module.TradePavilion ...@@ -101,7 +105,8 @@ namespace Mall.Module.TradePavilion
{ {
string UserIds = string.Join(",", list.Select(x => x.CreateBy).Distinct()); string UserIds = string.Join(",", list.Select(x => x.CreateBy).Distinct());
List<Model.Extend.User.RB_Member_User_Extend> ulist = new List<Model.Extend.User.RB_Member_User_Extend>(); List<Model.Extend.User.RB_Member_User_Extend> ulist = new List<Model.Extend.User.RB_Member_User_Extend>();
if (!string.IsNullOrEmpty(UserIds)) { if (!string.IsNullOrEmpty(UserIds))
{
ulist = member_UserRepository.GetList(new Model.Extend.User.RB_Member_User_Extend() { UserIds = UserIds }); ulist = member_UserRepository.GetList(new Model.Extend.User.RB_Member_User_Extend() { UserIds = UserIds });
} }
foreach (var item in list) foreach (var item in list)
...@@ -128,17 +133,17 @@ namespace Mall.Module.TradePavilion ...@@ -128,17 +133,17 @@ namespace Mall.Module.TradePavilion
/// <returns></returns> /// <returns></returns>
public List<RB_Authentication_Extend> GetAuthenticationList(RB_Authentication_Extend query) public List<RB_Authentication_Extend> GetAuthenticationList(RB_Authentication_Extend query)
{ {
var list= authenticationRepository.GetList(query); var list = authenticationRepository.GetList(query);
list.ForEach(x => x.ImageList = (!string.IsNullOrEmpty(x.Images) && x.Images != "[]") ? JsonConvert.DeserializeObject<List<string>>(x.Images) : new List<string>()); list.ForEach(x => x.ImageList = (!string.IsNullOrEmpty(x.Images) && x.Images != "[]") ? JsonConvert.DeserializeObject<List<string>>(x.Images) : new List<string>());
return list; return list;
} }
/// <summary> /// <summary>
/// 获取认证详情 /// 获取认证详情
/// </summary> /// </summary>
/// <param name="authenticationId"></param> /// <param name="authenticationId"></param>
/// <returns></returns> /// <returns></returns>
public RB_Authentication_Extend GetAuthenticationInfo(int authenticationId) public RB_Authentication_Extend GetAuthenticationInfo(int authenticationId)
{ {
var model = authenticationRepository.GetEntity<RB_Authentication_Extend>(authenticationId); var model = authenticationRepository.GetEntity<RB_Authentication_Extend>(authenticationId);
if (model == null) { return null; } if (model == null) { return null; }
...@@ -185,10 +190,11 @@ namespace Mall.Module.TradePavilion ...@@ -185,10 +190,11 @@ namespace Mall.Module.TradePavilion
/// <returns></returns> /// <returns></returns>
public bool SetAuthenticationAudit(int authenticationId, int auditState, string auditRemark) public bool SetAuthenticationAudit(int authenticationId, int auditState, string auditRemark)
{ {
Dictionary<string, object> keyValues = new Dictionary<string, object>() { Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Authentication_Extend.AuditState),auditState}, { nameof(RB_Authentication_Extend.AuditState),auditState},
{ nameof(RB_Authentication_Extend.AuditRemark),auditRemark}, { nameof(RB_Authentication_Extend.AuditRemark),auditRemark},
{ nameof(RB_Authentication_Extend.AuditDate),DateTime.Now}, { nameof(RB_Authentication_Extend.AuditDate),DateTime.Now}
}; };
List<WhereHelper> wheres = new List<WhereHelper>() { List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){ new WhereHelper(){
...@@ -199,6 +205,29 @@ namespace Mall.Module.TradePavilion ...@@ -199,6 +205,29 @@ namespace Mall.Module.TradePavilion
}; };
return authenticationRepository.Update(keyValues, wheres); return authenticationRepository.Update(keyValues, wheres);
} }
/// <summary>
/// 审核
/// </summary>
/// <param name="authenticationId"></param>
/// <param name="auditState"></param>
/// <param name="auditRemark"></param>
/// <returns></returns>
public bool SetAuthenticationPrize(string authenticationIds, string SourceIds)
{
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Authentication_Extend.SourceIds),SourceIds},
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Authentication_Extend.Id),
FiledValue=authenticationIds,
OperatorEnum=OperatorEnum.IN
}
};
return authenticationRepository.Update(keyValues, wheres);
}
/// <summary> /// <summary>
...@@ -213,7 +242,7 @@ namespace Mall.Module.TradePavilion ...@@ -213,7 +242,7 @@ namespace Mall.Module.TradePavilion
Dictionary<string, object> keyValues = new Dictionary<string, object>() { Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Authentication_Extend.AuditState),auditState}, { nameof(RB_Authentication_Extend.AuditState),auditState},
{ nameof(RB_Authentication_Extend.AuditRemark),auditRemark}, { nameof(RB_Authentication_Extend.AuditRemark),auditRemark},
{ nameof(RB_Authentication_Extend.AuditDate),DateTime.Now}, { nameof(RB_Authentication_Extend.AuditDate),DateTime.Now}
}; };
List<WhereHelper> wheres = new List<WhereHelper>() { List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){ new WhereHelper(){
......
...@@ -63,6 +63,11 @@ namespace Mall.Module.TradePavilion ...@@ -63,6 +63,11 @@ namespace Mall.Module.TradePavilion
/// </summary> /// </summary>
private readonly RB_CollectRepository collectRepository = new RB_CollectRepository(); private readonly RB_CollectRepository collectRepository = new RB_CollectRepository();
/// <summary>
/// 奖项仓储层对象
/// </summary>
private readonly RB_PrizeRepository prizeRepository = new RB_PrizeRepository();
#region 载体 #region 载体
/// <summary> /// <summary>
/// 载体信息列表 /// 载体信息列表
...@@ -72,7 +77,7 @@ namespace Mall.Module.TradePavilion ...@@ -72,7 +77,7 @@ namespace Mall.Module.TradePavilion
/// <param name="rowCount">总条数</param> /// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param> /// <param name="query">查询条件</param>
/// <returns></returns> /// <returns></returns>
public List<RB_Carrier_Extend> GetCarrierPageList(int pageIndex, int pageSize, out long rowCount, RB_Carrier_Extend query, bool IsSelectUser=false) public List<RB_Carrier_Extend> GetCarrierPageList(int pageIndex, int pageSize, out long rowCount, RB_Carrier_Extend query, bool IsSelectUser = false)
{ {
var list = carrierRepository.GetCarrierPageList(pageIndex, pageSize, out rowCount, query); var list = carrierRepository.GetCarrierPageList(pageIndex, pageSize, out rowCount, query);
if (list != null && list.Any()) if (list != null && list.Any())
...@@ -90,7 +95,8 @@ namespace Mall.Module.TradePavilion ...@@ -90,7 +95,8 @@ namespace Mall.Module.TradePavilion
} }
} }
} }
if (IsSelectUser) { if (IsSelectUser)
{
if (list.Where(x => x.UserId > 0).Any()) if (list.Where(x => x.UserId > 0).Any())
{ {
//查询用户列表 //查询用户列表
...@@ -154,7 +160,7 @@ namespace Mall.Module.TradePavilion ...@@ -154,7 +160,7 @@ namespace Mall.Module.TradePavilion
var metroList = carrierMetroRepository.GetCarrierMetroList(new RB_CarrierMetro_Extend { TenantId = query.TenantId, MallBaseId = query.MallBaseId, CarrierId = model.ID }); var metroList = carrierMetroRepository.GetCarrierMetroList(new RB_CarrierMetro_Extend { TenantId = query.TenantId, MallBaseId = query.MallBaseId, CarrierId = model.ID });
if (metroList != null && metroList.Any()) if (metroList != null && metroList.Any())
{ {
model.CarrierMetroList = new List<RB_CarrierMetro_Extend>(); model.CarrierMetroList = new List<RB_CarrierMetro_Extend>();
model.CarrierMetroList = metroList; model.CarrierMetroList = metroList;
} }
...@@ -162,7 +168,8 @@ namespace Mall.Module.TradePavilion ...@@ -162,7 +168,8 @@ namespace Mall.Module.TradePavilion
{ {
model.BannerList = JsonConvert.DeserializeObject<List<string>>(model.Banner); model.BannerList = JsonConvert.DeserializeObject<List<string>>(model.Banner);
} }
else { else
{
model.BannerList = new List<string>(); model.BannerList = new List<string>();
} }
} }
...@@ -197,7 +204,9 @@ namespace Mall.Module.TradePavilion ...@@ -197,7 +204,9 @@ namespace Mall.Module.TradePavilion
{nameof(RB_Carrier_Extend.CarrierPlan),model.CarrierPlan }, {nameof(RB_Carrier_Extend.CarrierPlan),model.CarrierPlan },
{nameof(RB_Carrier_Extend.CarrierTarget),model.CarrierTarget }, {nameof(RB_Carrier_Extend.CarrierTarget),model.CarrierTarget },
{nameof(RB_Carrier_Extend.Location),model.Location }, {nameof(RB_Carrier_Extend.Location),model.Location },
{nameof(RB_Carrier_Extend.Crowd),model.Crowd } {nameof(RB_Carrier_Extend.Crowd),model.Crowd },
{nameof(RB_Carrier_Extend.FirstStoreTest),model.FirstStoreTest },
{nameof(RB_Carrier_Extend.OpeningStatus),model.OpeningStatus }
}; };
flag = carrierRepository.Update(fileds, new WhereHelper(nameof(RB_Carrier_Extend.ID), model.ID)); flag = carrierRepository.Update(fileds, new WhereHelper(nameof(RB_Carrier_Extend.ID), model.ID));
...@@ -317,7 +326,8 @@ namespace Mall.Module.TradePavilion ...@@ -317,7 +326,8 @@ namespace Mall.Module.TradePavilion
{ {
#region 验证载体申请是否已存在 #region 验证载体申请是否已存在
var oldList = carrierApplyForRepository.GetCarrierList(new RB_CarrierApplyFor_Extend() { MallBaseId = model.MallBaseId, CompanyId = model.CompanyId }); var oldList = carrierApplyForRepository.GetCarrierList(new RB_CarrierApplyFor_Extend() { MallBaseId = model.MallBaseId, CompanyId = model.CompanyId });
if (oldList.Any()) { if (oldList.Any())
{
return false; return false;
} }
#endregion #endregion
...@@ -673,12 +683,14 @@ namespace Mall.Module.TradePavilion ...@@ -673,12 +683,14 @@ namespace Mall.Module.TradePavilion
{ {
#region 验证品牌数据是否已存在 #region 验证品牌数据是否已存在
var oldList = brandApplyForRepository.GetBrandListByWhere(new RB_BrandApplyFor_Extend() { MallBaseId = model.MallBaseId, CompanyId = model.CompanyId }); var oldList = brandApplyForRepository.GetBrandListByWhere(new RB_BrandApplyFor_Extend() { MallBaseId = model.MallBaseId, CompanyId = model.CompanyId });
if (oldList.Any()) { if (oldList.Any())
{
return false; return false;
} }
#endregion #endregion
bool flag = brandApplyForRepository.Insert(model) > 0; bool flag = brandApplyForRepository.Insert(model) > 0;
if (flag) { if (flag)
{
//更新认证表 资料状态为完成 //更新认证表 资料状态为完成
Dictionary<string, object> keyValues = new Dictionary<string, object>() { Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Company_Extend.IsComplete),1} { nameof(RB_Company_Extend.IsComplete),1}
...@@ -801,7 +813,49 @@ namespace Mall.Module.TradePavilion ...@@ -801,7 +813,49 @@ namespace Mall.Module.TradePavilion
/// <returns></returns> /// <returns></returns>
public List<RB_Collect_Extend> GetPageList(int pageIndex, int pageSize, out long rowCount, RB_Collect_Extend query) public List<RB_Collect_Extend> GetPageList(int pageIndex, int pageSize, out long rowCount, RB_Collect_Extend query)
{ {
return collectRepository.GetPageList(pageIndex, pageSize, out rowCount, query); var list = collectRepository.GetPageList(pageIndex, pageSize, out rowCount, query);
string sourceIds = "";
if (list != null && list.Any())
{
sourceIds = string.Join(",", list.Select(x => x.SourceId));
}
if (query.Type == 1)//1-载体
{
if (!string.IsNullOrEmpty(sourceIds))
{
var sourceList = GetCarrierList(new RB_Carrier_Extend { TenantId = query.TenantId, MallBaseId = query.MallBaseId, QCarrierIds = sourceIds });
foreach (var item in list)
{
RB_Carrier_Extend carrierModel = sourceList.Where(x => x.ID == item.SourceId).FirstOrDefault();
if (carrierModel != null && carrierModel.ID > 0)
{
item.SourceName = carrierModel.CarrierName;
item.Address = carrierModel.Address;
item.ProjectType = carrierModel.ProjectType;
item.BannerList = carrierModel.BannerList;
}
}
}
}
else if (query.Type == 2)//2-品牌
{
if (!string.IsNullOrEmpty(sourceIds))
{
var sourceList = GetBrandListByWhere(new RB_Brand_Extend { TenantId = query.TenantId, MallBaseId = query.MallBaseId, QBrandIds = sourceIds });
foreach (var item in list)
{
RB_Brand_Extend carrierModel = sourceList.Where(x => x.ID == item.SourceId).FirstOrDefault();
if (carrierModel != null && carrierModel.ID > 0)
{
item.SourceName = carrierModel.BrandName;
item.SourceFullName = carrierModel.FullBrandName;
item.ProjectType = carrierModel.ProjectType;
item.BannerList = carrierModel.BannerList;
}
}
}
}
return list;
} }
/// <summary> /// <summary>
...@@ -855,6 +909,77 @@ namespace Mall.Module.TradePavilion ...@@ -855,6 +909,77 @@ namespace Mall.Module.TradePavilion
} }
return flag; return flag;
} }
#endregion
#region 奖项
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_Prize_Extend> GetPrizePageList(int pageIndex, int pageSize, out long rowCount, RB_Prize_Extend query)
{
return prizeRepository.GetPageList(pageIndex, pageSize, out rowCount, query);
}
/// <summary>
/// 奖项列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_Prize_Extend> GetPrizeList(RB_Prize_Extend query)
{
return prizeRepository.GetList(query);
}
/// <summary>
/// 新增/修改奖项
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetPrize(RB_Prize_Extend model)
{
if (model.Id == 0)
{
return prizeRepository.Insert(model) > 0;
}
else
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Prize_Extend.Name),model.Name },
{nameof(RB_Prize_Extend.YearInfo),model.YearInfo },
{nameof(RB_Prize_Extend.BigIco),model.BigIco },
{nameof(RB_Prize_Extend.SmallIco),model.SmallIco }
};
return prizeRepository.Update(fileds, new WhereHelper(nameof(RB_Prize_Extend.Id), model.Id));
}
}
/// <summary>
///删除奖项状态
/// </summary>
/// <param name="CompanyId"></param>
/// <param name="Status"></param>
/// <returns></returns>
public bool RemovePrizeModule(int prizeId)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Prize_Extend.Status),1 },
};
bool flag = prizeRepository.Update(fileds, new WhereHelper(nameof(RB_Prize_Extend.Id), prizeId));
return flag;
}
#endregion #endregion
} }
} }
using Mall.Common.Plugin; using Mall.Common;
using Mall.Common.Plugin;
using Mall.Model.Extend.TradePavilion; using Mall.Model.Extend.TradePavilion;
using Mall.Repository.TradePavilion; using Mall.Repository.TradePavilion;
using Mall.Repository.User; using Mall.Repository.User;
...@@ -24,6 +25,14 @@ namespace Mall.Module.TradePavilion ...@@ -24,6 +25,14 @@ namespace Mall.Module.TradePavilion
/// </summary> /// </summary>
private readonly RB_FirstShop_ListEnrollRepository firstShop_ListEnrollRepository = new RB_FirstShop_ListEnrollRepository(); private readonly RB_FirstShop_ListEnrollRepository firstShop_ListEnrollRepository = new RB_FirstShop_ListEnrollRepository();
/// <summary> /// <summary>
/// 品牌
/// </summary>
private readonly RB_BrandRepository brandRepository = new RB_BrandRepository();
/// <summary>
/// 载体
/// </summary>
private readonly RB_CarrierRepository carrierRepository = new RB_CarrierRepository();
/// <summary>
/// 用户 /// 用户
/// </summary> /// </summary>
private readonly RB_Member_UserRepository member_UserRepository = new RB_Member_UserRepository(); private readonly RB_Member_UserRepository member_UserRepository = new RB_Member_UserRepository();
...@@ -42,7 +51,7 @@ namespace Mall.Module.TradePavilion ...@@ -42,7 +51,7 @@ namespace Mall.Module.TradePavilion
if (list.Any()) { if (list.Any()) {
foreach (var item in list) { foreach (var item in list) {
if (item.ListState == Common.Enum.TradePavilion.ListStateEnum.Enroll && item.DeadlineDate <= DateTime.Now) if (item.ListState == Common.Enum.TradePavilion.ListStateEnum.Enroll && item.EndDate <= DateTime.Now)
{ {
item.ListState = Common.Enum.TradePavilion.ListStateEnum.Rating; item.ListState = Common.Enum.TradePavilion.ListStateEnum.Rating;
} }
...@@ -59,6 +68,48 @@ namespace Mall.Module.TradePavilion ...@@ -59,6 +68,48 @@ namespace Mall.Module.TradePavilion
return list; return list;
} }
/// <summary>
/// 获取小程序 - 榜单分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_FirstShop_List_Extend> GetAppletFirstShopListPageList(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 (item.ListState == Common.Enum.TradePavilion.ListStateEnum.Enroll && item.StartDate <= DateTime.Now && item.EndDate >= DateTime.Now)
{
item.State = 1;//进行中
}
else if (item.ListState == Common.Enum.TradePavilion.ListStateEnum.Enroll && item.EndDate <= DateTime.Now)
{
item.State = 2;//报名已截止
}
else if (item.ListState == Common.Enum.TradePavilion.ListStateEnum.Confirmed)
{
item.State = 3;//已放榜
}
item.ObjectTypeList = new List<string>();
if (!string.IsNullOrEmpty(item.ObjectTypeIds))
{
List<int> OIdList = JsonHelper.DeserializeObject<List<int>>("[" + item.ObjectTypeIds + "]");
foreach (var qitem in OIdList)
{
item.ObjectTypeList.Add(((Common.Enum.TradePavilion.ListObjectTypeEnum)qitem).GetEnumName());
}
}
}
}
return list;
}
/// <summary> /// <summary>
/// 获取榜单详情 /// 获取榜单详情
/// </summary> /// </summary>
...@@ -69,6 +120,85 @@ namespace Mall.Module.TradePavilion ...@@ -69,6 +120,85 @@ namespace Mall.Module.TradePavilion
return firstShop_ListRepository.GetEntity<RB_FirstShop_List_Extend>(listId); return firstShop_ListRepository.GetEntity<RB_FirstShop_List_Extend>(listId);
} }
/// <summary>
/// 小程序获取榜单详情
/// </summary>
/// <param name="listId"></param>
/// <returns></returns>
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.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()) {
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()) {
//查询品牌
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) {
var bmodel = blist.Where(x => x.ID == item.ObjectId).FirstOrDefault();
item.ObjectName = bmodel?.BrandName ?? "";
item.ObjectIcon = bmodel?.Logo ?? "";
}
}
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) {
var cmodel = clist.Where(x => x.ID == item.ObjectId).FirstOrDefault();
item.ObjectName = cmodel?.CarrierName ?? "";
item.ObjectIcon = cmodel?.Logo ?? "";
}
}
}
model.RankList = enrollList;
}
else {
//查询个人报名记录
var enrollList = firstShop_ListEnrollRepository.GetList(new RB_FirstShop_ListEnroll_Extend() { MallBaseId = userInfo.MallBaseId, ListId = listId, UserId = userInfo.UserId });
//查询 品牌/载体 名称 图片
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())
{
//查询品牌
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)
{
var bmodel = blist.Where(x => x.ID == item.ObjectId).FirstOrDefault();
item.ObjectName = bmodel?.BrandName ?? "";
item.ObjectIcon = bmodel?.Logo ?? "";
}
}
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)
{
var cmodel = clist.Where(x => x.ID == item.ObjectId).FirstOrDefault();
item.ObjectName = cmodel?.CarrierName ?? "";
item.ObjectIcon = cmodel?.Logo ?? "";
}
}
}
model.EnrollList = enrollList;
}
}
return model;
}
/// <summary> /// <summary>
/// 新增修改榜单 /// 新增修改榜单
/// </summary> /// </summary>
...@@ -90,8 +220,9 @@ namespace Mall.Module.TradePavilion ...@@ -90,8 +220,9 @@ namespace Mall.Module.TradePavilion
{ nameof(RB_FirstShop_List_Extend.Sponsor),demodel.Sponsor }, { nameof(RB_FirstShop_List_Extend.Sponsor),demodel.Sponsor },
{ nameof(RB_FirstShop_List_Extend.ListName),demodel.ListName }, { nameof(RB_FirstShop_List_Extend.ListName),demodel.ListName },
{ nameof(RB_FirstShop_List_Extend.CoverImage),demodel.CoverImage }, { nameof(RB_FirstShop_List_Extend.CoverImage),demodel.CoverImage },
{ nameof(RB_FirstShop_List_Extend.DeadlineDate),demodel.DeadlineDate }, { nameof(RB_FirstShop_List_Extend.FinishDate),demodel.FinishDate },
{ nameof(RB_FirstShop_List_Extend.StartDate),demodel.StartDate }, { nameof(RB_FirstShop_List_Extend.StartDate),demodel.StartDate },
{ nameof(RB_FirstShop_List_Extend.EndDate),demodel.EndDate },
{ nameof(RB_FirstShop_List_Extend.Content),demodel.Content }, { nameof(RB_FirstShop_List_Extend.Content),demodel.Content },
{ nameof(RB_FirstShop_List_Extend.EnableRank),demodel.EnableRank }, { nameof(RB_FirstShop_List_Extend.EnableRank),demodel.EnableRank },
{ nameof(RB_FirstShop_List_Extend.PrizeNum),demodel.PrizeNum }, { nameof(RB_FirstShop_List_Extend.PrizeNum),demodel.PrizeNum },
...@@ -141,5 +272,145 @@ namespace Mall.Module.TradePavilion ...@@ -141,5 +272,145 @@ namespace Mall.Module.TradePavilion
bool flag = firstShop_ListRepository.Update(keyValues, wheres); bool flag = firstShop_ListRepository.Update(keyValues, wheres);
return flag ? "" : "取消失败"; return flag ? "" : "取消失败";
} }
/// <summary>
/// 获取用户可报表的品牌/载体列表
/// </summary>
/// <param name="userInfo"></param>
/// <returns></returns>
public object GetAppletMyBrandCarrierList(int listId, int enrollId, AppletUserInfo userInfo)
{
List<object> RList = new List<object>();
//查询该榜单
var listModel = firstShop_ListRepository.GetEntity(listId);
if (listModel == null) { return null; }
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")) {
//品牌
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();
if (blist.Any())
{
foreach (var item in blist)
{
RList.Add(new
{
Id = item.ID,
Name = item.BrandName,
ObjectType = 1
});
}
}
}
//查询用户下所有的载体
if (listModel.ObjectTypeIds.Contains("2"))
{
var clist = carrierRepository.GetCarrierList(new RB_Carrier_Extend() { MallBaseId = userInfo.MallBaseId, UserId = userInfo.UserId });
clist = clist.Where(x => !enrollList.Where(x => x.ObjectType == Common.Enum.TradePavilion.ListObjectTypeEnum.Carrier).Select(y => y.ObjectId).Contains(x.ID)).ToList();
if (clist.Any())
{
foreach (var item in clist)
{
RList.Add(new
{
Id = item.ID,
Name = item.CarrierName,
ObjectType = 2
});
}
}
}
return RList;
}
/// <summary>
/// 新增修改报名
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
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) {
return "榜单不存在,请核实后再试";
}
if (listModel.StartDate > DateTime.Now) { return "榜单还未开始报名,无法报名"; }
if (listModel.EndDate < DateTime.Now) { return "榜单已截止报名"; }
if (demodel.Id > 0)
{
#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.Where(x => x.Id != demodel.Id).Any())
{
return "该品牌/载体已报名,无法重复报名";
}
#endregion
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_FirstShop_ListEnroll_Extend.ObjectType),demodel.ObjectType},
{ nameof(RB_FirstShop_ListEnroll_Extend.ObjectId),demodel.ObjectId},
{ nameof(RB_FirstShop_ListEnroll_Extend.Content),demodel.Content},
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_FirstShop_ListEnroll_Extend.Id),
FiledValue= demodel.Id,
OperatorEnum=OperatorEnum.Equal
}
};
bool flag = firstShop_ListEnrollRepository.Update(keyValues, wheres);
return flag ? "" : "修改失败,请联系管理人员";
}
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()) {
return "该品牌/载体已报名,无法重复报名";
}
#endregion
bool flag = firstShop_ListEnrollRepository.Insert(demodel) > 0;
return flag ? "" : "报名失败,请联系管理人员";
}
}
/// <summary>
/// 取消报名
/// </summary>
/// <param name="enrollId"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public string CancelAppletFirstShopListInfo(int enrollId, AppletUserInfo userInfo)
{
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_FirstShop_ListEnroll_Extend.Status),1},
{ nameof(RB_FirstShop_ListEnroll_Extend.UpdateDate),DateTime.Now},
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_FirstShop_ListEnroll_Extend.Id),
FiledValue= enrollId,
OperatorEnum=OperatorEnum.Equal
}
};
bool flag = firstShop_ListEnrollRepository.Update(keyValues, wheres);
return flag ? "" : "取消失败,请联系管理员";
}
/// <summary>
/// 获取小程序 我的报名榜单列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public List<RB_FirstShop_List_Extend> GetAppletMyEnrollFistShopListPageList(int pageIndex, int pageSize, out long count, RB_FirstShop_List_Extend demodel)
{
var list = firstShop_ListRepository.GetAppletMyEnrollFistShopListPageList(pageIndex, pageSize, out count, demodel);
return list;
}
} }
} }
...@@ -43,6 +43,10 @@ namespace Mall.Repository.TradePavilion ...@@ -43,6 +43,10 @@ namespace Mall.Repository.TradePavilion
{ {
builder.Append($" AND {nameof(RB_Authentication_Extend.Type)}={(int)query.Type}"); 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) if (query.BrandType > 0)
{ {
builder.Append($" AND {nameof(RB_Authentication_Extend.BrandType)}={(int)query.BrandType}"); builder.Append($" AND {nameof(RB_Authentication_Extend.BrandType)}={(int)query.BrandType}");
......
...@@ -48,6 +48,7 @@ WHERE 1=1 ...@@ -48,6 +48,7 @@ WHERE 1=1
{ {
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Brand_Extend.UserId), query.UserId); builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Brand_Extend.UserId), query.UserId);
} }
if (!string.IsNullOrEmpty(query.BrandName)) if (!string.IsNullOrEmpty(query.BrandName))
{ {
builder.AppendFormat(" AND a.{0} LIKE @Name ", nameof(RB_Brand_Extend.BrandName)); builder.AppendFormat(" AND a.{0} LIKE @Name ", nameof(RB_Brand_Extend.BrandName));
...@@ -145,7 +146,7 @@ WHERE 1=1 ...@@ -145,7 +146,7 @@ WHERE 1=1
{ {
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Brand_Extend.ProjectType), (int)query.ProjectType); builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Brand_Extend.ProjectType), (int)query.ProjectType);
} }
} }
return Get<RB_Brand_Extend>(builder.ToString(), parameters).FirstOrDefault(); return Get<RB_Brand_Extend>(builder.ToString(), parameters).FirstOrDefault();
} }
...@@ -193,6 +194,10 @@ WHERE 1=1 ...@@ -193,6 +194,10 @@ WHERE 1=1
{ {
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Brand_Extend.UserId), query.UserId); 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);
}
if (query.UserId == -1) if (query.UserId == -1)
{ {
builder.AppendFormat(" AND a.{0} =0 ", nameof(RB_Brand_Extend.UserId));//查询未绑定用户的 builder.AppendFormat(" AND a.{0} =0 ", nameof(RB_Brand_Extend.UserId));//查询未绑定用户的
......
...@@ -54,7 +54,14 @@ namespace Mall.Repository.TradePavilion ...@@ -54,7 +54,14 @@ namespace Mall.Repository.TradePavilion
{ {
builder.Append($" AND {nameof(RB_Carrier_Extend.UserId)}={query.UserId}"); builder.Append($" AND {nameof(RB_Carrier_Extend.UserId)}={query.UserId}");
} }
if (query.OpeningStatus > -1)
{
builder.Append($" AND {nameof(RB_Carrier_Extend.OpeningStatus)}={query.OpeningStatus}");
}
if (query.FirstStoreTest > -1)
{
builder.Append($" AND {nameof(RB_Carrier_Extend.FirstStoreTest)}={query.FirstStoreTest}");
}
if (!string.IsNullOrWhiteSpace(query.StartOpenTime)) if (!string.IsNullOrWhiteSpace(query.StartOpenTime))
{ {
builder.Append($" and DATE_FORMAT({nameof(RB_Carrier_Extend.OpenTime)},'%Y-%m-%d' )>=DATE_FORMAT('{query.StartOpenTime}','%Y-%m-%d' ) "); builder.Append($" and DATE_FORMAT({nameof(RB_Carrier_Extend.OpenTime)},'%Y-%m-%d' )>=DATE_FORMAT('{query.StartOpenTime}','%Y-%m-%d' ) ");
...@@ -113,6 +120,10 @@ namespace Mall.Repository.TradePavilion ...@@ -113,6 +120,10 @@ namespace Mall.Repository.TradePavilion
{ {
builder.Append($" AND {nameof(RB_Carrier_Extend.ID)}={query.ID}"); builder.Append($" AND {nameof(RB_Carrier_Extend.ID)}={query.ID}");
} }
if (!string.IsNullOrWhiteSpace(query.QCarrierIds))
{
builder.Append($" AND {nameof(RB_Carrier_Extend.ID)} in ({query.QCarrierIds})");
}
if (query.UserId > 0) if (query.UserId > 0)
{ {
builder.Append($" AND {nameof(RB_Carrier_Extend.UserId)}={query.UserId}"); builder.Append($" AND {nameof(RB_Carrier_Extend.UserId)}={query.UserId}");
......
...@@ -75,13 +75,17 @@ where {where} order by w.Id desc ...@@ -75,13 +75,17 @@ where {where} order by w.Id desc
{ {
where += $@" and w.{nameof(RB_FirstShop_ListEnroll_Extend.MallBaseId)}={dmodel.MallBaseId}"; where += $@" and w.{nameof(RB_FirstShop_ListEnroll_Extend.MallBaseId)}={dmodel.MallBaseId}";
} }
if (dmodel.ListId > 0)
{
where += $@" and w.{nameof(RB_FirstShop_ListEnroll_Extend.ListId)}={dmodel.ListId}";
}
if (dmodel.UserId > 0) if (dmodel.UserId > 0)
{ {
where += $@" and w.{nameof(RB_FirstShop_ListEnroll_Extend.UserId)}={dmodel.UserId}"; where += $@" and w.{nameof(RB_FirstShop_ListEnroll_Extend.UserId)}={dmodel.UserId}";
} }
if (dmodel.ObjectType > 0) if (dmodel.ObjectType > 0)
{ {
where += $@" and w.{nameof(RB_FirstShop_ListEnroll_Extend.ObjectType)}={dmodel.ObjectType}"; where += $@" and w.{nameof(RB_FirstShop_ListEnroll_Extend.ObjectType)}={(int)dmodel.ObjectType}";
} }
if (dmodel.CandidateState > 0) if (dmodel.CandidateState > 0)
{ {
......
...@@ -47,12 +47,13 @@ namespace Mall.Repository.TradePavilion ...@@ -47,12 +47,13 @@ namespace Mall.Repository.TradePavilion
if (dmodel.ListState == Common.Enum.TradePavilion.ListStateEnum.Enroll) if (dmodel.ListState == Common.Enum.TradePavilion.ListStateEnum.Enroll)
{ {
where += $@" and w.{nameof(RB_FirstShop_List_Extend.ListState)}={(int)Common.Enum.TradePavilion.ListStateEnum.Enroll}"; where += $@" and w.{nameof(RB_FirstShop_List_Extend.ListState)}={(int)Common.Enum.TradePavilion.ListStateEnum.Enroll}";
where += $@" and w.{nameof(RB_FirstShop_List_Extend.DeadlineDate)} >='{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}'"; where += $@" and w.{nameof(RB_FirstShop_List_Extend.StartDate)} <='{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}'";
where += $@" and w.{nameof(RB_FirstShop_List_Extend.EndDate)} >='{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}'";
} }
else if (dmodel.ListState == Common.Enum.TradePavilion.ListStateEnum.Rating) else if (dmodel.ListState == Common.Enum.TradePavilion.ListStateEnum.Rating)
{ {
where += $@" and w.{nameof(RB_FirstShop_List_Extend.ListState)}={(int)Common.Enum.TradePavilion.ListStateEnum.Enroll}"; where += $@" and w.{nameof(RB_FirstShop_List_Extend.ListState)}={(int)Common.Enum.TradePavilion.ListStateEnum.Enroll}";
where += $@" and w.{nameof(RB_FirstShop_List_Extend.DeadlineDate)} <'{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}'"; where += $@" and w.{nameof(RB_FirstShop_List_Extend.EndDate)} <'{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}'";
} }
else { else {
where += $@" and w.{nameof(RB_FirstShop_List_Extend.ListState)}={(int)dmodel.ListState}"; where += $@" and w.{nameof(RB_FirstShop_List_Extend.ListState)}={(int)dmodel.ListState}";
...@@ -68,10 +69,19 @@ namespace Mall.Repository.TradePavilion ...@@ -68,10 +69,19 @@ namespace Mall.Repository.TradePavilion
where += $@" and w.{nameof(RB_FirstShop_List_Extend.ListName)} @ListName"; where += $@" and w.{nameof(RB_FirstShop_List_Extend.ListName)} @ListName";
parameters.Add("ListName", "%" + dmodel.ListName + "%"); parameters.Add("ListName", "%" + dmodel.ListName + "%");
} }
if (dmodel.IsAppletSelectNor == 1) {
//小程序端查询
where += $@" and w.{nameof(RB_FirstShop_List_Extend.ListState)} <>{(int)Common.Enum.TradePavilion.ListStateEnum.Cancel}";
where += $@" and w.{nameof(RB_FirstShop_List_Extend.StartDate)} <='{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}'";
}
string orderBy = " order by w.Id desc";
if (dmodel.OrderBy == 1) {
orderBy = " order by w.EndDate desc";//根据报名截止日期
}
string sql = $@"select w.* from RB_FirstShop_List w string sql = $@"select w.* from RB_FirstShop_List w
where {where} order by w.Id desc where {where} {orderBy}
"; ";
return GetPage<RB_FirstShop_List_Extend>(pageIndex, pageSize, out count, sql, parameters).ToList(); return GetPage<RB_FirstShop_List_Extend>(pageIndex, pageSize, out count, sql, parameters).ToList();
} }
...@@ -106,12 +116,13 @@ where {where} order by w.Id desc ...@@ -106,12 +116,13 @@ where {where} order by w.Id desc
if (dmodel.ListState == Common.Enum.TradePavilion.ListStateEnum.Enroll) if (dmodel.ListState == Common.Enum.TradePavilion.ListStateEnum.Enroll)
{ {
where += $@" and w.{nameof(RB_FirstShop_List_Extend.ListState)}={(int)Common.Enum.TradePavilion.ListStateEnum.Enroll}"; where += $@" and w.{nameof(RB_FirstShop_List_Extend.ListState)}={(int)Common.Enum.TradePavilion.ListStateEnum.Enroll}";
where += $@" and w.{nameof(RB_FirstShop_List_Extend.DeadlineDate)} >='{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}'"; where += $@" and w.{nameof(RB_FirstShop_List_Extend.StartDate)} >='{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}'";
where += $@" and w.{nameof(RB_FirstShop_List_Extend.EndDate)} <='{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}'";
} }
else if (dmodel.ListState == Common.Enum.TradePavilion.ListStateEnum.Rating) else if (dmodel.ListState == Common.Enum.TradePavilion.ListStateEnum.Rating)
{ {
where += $@" and w.{nameof(RB_FirstShop_List_Extend.ListState)}={(int)Common.Enum.TradePavilion.ListStateEnum.Enroll}"; where += $@" and w.{nameof(RB_FirstShop_List_Extend.ListState)}={(int)Common.Enum.TradePavilion.ListStateEnum.Enroll}";
where += $@" and w.{nameof(RB_FirstShop_List_Extend.DeadlineDate)} <'{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}'"; where += $@" and w.{nameof(RB_FirstShop_List_Extend.EndDate)} <'{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}'";
} }
else else
{ {
...@@ -136,5 +147,36 @@ where {where} order by w.Id desc ...@@ -136,5 +147,36 @@ where {where} order by w.Id desc
return Get<RB_FirstShop_List_Extend>(sql, parameters).ToList(); return Get<RB_FirstShop_List_Extend>(sql, parameters).ToList();
} }
/// <summary>
/// 获取小程序 我的报名榜单分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_FirstShop_List_Extend> GetAppletMyEnrollFistShopListPageList(int pageIndex, int pageSize, out long count, RB_FirstShop_List_Extend dmodel)
{
var parameters = new DynamicParameters();
string where = $" 1=1 and w.Status =0 and e.Status =0 and w.ListState <>{(int)Common.Enum.TradePavilion.ListStateEnum.Cancel}";
if (dmodel.TenantId > 0)
{
where += $@" and w.{nameof(RB_FirstShop_List_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and w.{nameof(RB_FirstShop_List_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.CreateBy > 0)
{
where += $@" and w.{nameof(RB_FirstShop_ListEnroll_Extend.UserId)}={dmodel.CreateBy}";
}
string sql = $@"select w.* from RB_FirstShop_List w
left join rb_firstshop_listenroll e on w.Id = e.ListId
where {where} group by w.Id order by w.EndDate desc
";
return GetPage<RB_FirstShop_List_Extend>(pageIndex, pageSize, out count, sql, parameters).ToList();
}
} }
} }
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mall.Model.Entity.TradePavilion;
using Mall.Model.Extend.TradePavilion;
namespace Mall.Repository.TradePavilion
{
public class RB_PrizeRepository:BaseRepository<RB_Prize>
{
/// <summary>
/// 表名称
/// </summary>
public string TableName { get { return nameof(RB_Prize); } }
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
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 ");
if (query != null)
{
if (query.TenantId > 0)
{
builder.Append($" AND a.{nameof(RB_Prize_Extend.TenantId)}={query.TenantId}");
}
if (query.MallBaseId > 0)
{
builder.Append($" AND a.{nameof(RB_Prize_Extend.MallBaseId)}={query.MallBaseId}");
}
}
builder.Append($" order by Id desc");
return GetPage<RB_Prize_Extend>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList();
}
/// <summary>
/// 奖项列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_Prize_Extend> GetList(RB_Prize_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.Append($" SELECT * FROM {TableName} WHERE 1=1");
if (query != null)
{
if (query.TenantId > 0)
{
builder.Append($" AND {nameof(RB_Prize_Extend.TenantId)}={query.TenantId}");
}
if (query.MallBaseId > 0)
{
builder.Append($" AND {nameof(RB_Prize_Extend.MallBaseId)}={query.MallBaseId}");
}
if (query.Id > 0)
{
builder.Append($" AND {nameof(RB_Prize_Extend.Id)}={query.Id}");
}
if (query.Status > -1)
{
builder.Append($" AND {nameof(RB_Prize_Extend.Status)}={query.Status}");
}
}
builder.Append($" order by Id desc");
return Get<RB_Prize_Extend>(builder.ToString()).ToList();
}
}
}
...@@ -84,6 +84,10 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -84,6 +84,10 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// </summary> /// </summary>
private readonly Module.User.MiniProgramModule programModule = new Module.User.MiniProgramModule(); private readonly Module.User.MiniProgramModule programModule = new Module.User.MiniProgramModule();
/// <summary> /// <summary>
/// 榜单
/// </summary>
private readonly FirstShopListModule firstShopListModule = new FirstShopListModule();
/// <summary>
/// 心愿单 /// 心愿单
/// </summary> /// </summary>
private readonly FirstShopWishModule firstShopWishModule = new FirstShopWishModule(); private readonly FirstShopWishModule firstShopWishModule = new FirstShopWishModule();
...@@ -184,7 +188,8 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -184,7 +188,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public ApiResult GetCommpanyStatus() { public ApiResult GetCommpanyStatus()
{
var userInfo = AppletUserInfo; var userInfo = AppletUserInfo;
var model = companyModule.GetCommpanyStatus(userInfo.UserId); var model = companyModule.GetCommpanyStatus(userInfo.UserId);
return ApiResult.Success(data: model); return ApiResult.Success(data: model);
...@@ -350,7 +355,8 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -350,7 +355,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
{ {
return ApiResult.Success(); return ApiResult.Success();
} }
else { else
{
return ApiResult.Failed(); return ApiResult.Failed();
} }
} }
...@@ -406,11 +412,13 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -406,11 +412,13 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public ApiResult SetCommpanyCompleteCorvidae() { public ApiResult SetCommpanyCompleteCorvidae()
{
var userInfo = AppletUserInfo; var userInfo = AppletUserInfo;
JObject parms = JObject.Parse(RequestParm.msg.ToString()); JObject parms = JObject.Parse(RequestParm.msg.ToString());
int CompanyId = parms.GetInt("CompanyId", 0); int CompanyId = parms.GetInt("CompanyId", 0);
if (CompanyId <= 0) { if (CompanyId <= 0)
{
return ApiResult.ParamIsNull(); return ApiResult.ParamIsNull();
} }
...@@ -419,7 +427,8 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -419,7 +427,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
{ {
return ApiResult.Success(); return ApiResult.Success();
} }
else { else
{
return ApiResult.Failed(); return ApiResult.Failed();
} }
} }
...@@ -510,7 +519,7 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -510,7 +519,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
query.MallBaseId = userInfo.MallBaseId; query.MallBaseId = userInfo.MallBaseId;
query.TenantId = userInfo.TenantId; query.TenantId = userInfo.TenantId;
var list = carrierModule.GetCarrierList(query); var list = carrierModule.GetCarrierList(query);
return ApiResult.Success(data: list.Select(x => new return ApiResult.Success(data: list.Select(x => new
{ {
x.ID, x.ID,
...@@ -1247,7 +1256,9 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1247,7 +1256,9 @@ namespace Mall.WebApi.Controllers.TradePavilion
StartOpenTime = parms.GetStringValue("StartOpenTime"), StartOpenTime = parms.GetStringValue("StartOpenTime"),
EndOpenTime = parms.GetStringValue("EndOpenTime"), EndOpenTime = parms.GetStringValue("EndOpenTime"),
ProjectType = (Common.Enum.TradePavilion.ProjectTypeEnum)parms.GetInt("ProjectType", 0), ProjectType = (Common.Enum.TradePavilion.ProjectTypeEnum)parms.GetInt("ProjectType", 0),
OrderBy = parms.GetInt("OrderBy", 0) OrderBy = parms.GetInt("OrderBy", 0),
OpeningStatus = parms.GetInt("OpeningStatus", -1),
FirstStoreTest = parms.GetInt("FirstStoreTest", -1),
}; };
query.MallBaseId = RequestParm.MallBaseId; query.MallBaseId = RequestParm.MallBaseId;
query.TenantId = userInfo?.TenantId ?? 0; query.TenantId = userInfo?.TenantId ?? 0;
...@@ -1547,7 +1558,8 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1547,7 +1558,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
var collectModel = carrierModule.GetList(new RB_Collect_Extend { Status = 0, Type = 2, UserId = req.UserId, SourceId = extModel.ID, MallBaseId = query.MallBaseId, TenantId = query.TenantId }).FirstOrDefault(); var collectModel = carrierModule.GetList(new RB_Collect_Extend { Status = 0, Type = 2, UserId = req.UserId, SourceId = extModel.ID, MallBaseId = query.MallBaseId, TenantId = query.TenantId }).FirstOrDefault();
extModel.CollectId = collectModel?.Id ?? 0; extModel.CollectId = collectModel?.Id ?? 0;
} }
if (extModel.UserId > 0) { if (extModel.UserId > 0)
{
//获取首店年份 //获取首店年份
extModel.FirstShopYear = authenticationModule.GetFirstShopYear(extModel.UserId, req.MallBaseId); extModel.FirstShopYear = authenticationModule.GetFirstShopYear(extModel.UserId, req.MallBaseId);
if (req.UserId > 0) if (req.UserId > 0)
...@@ -1558,13 +1570,15 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1558,13 +1570,15 @@ namespace Mall.WebApi.Controllers.TradePavilion
{ {
//载体方 并且认证OK //载体方 并且认证OK
var wmodel = firstShopWishModule.GetWishList(new RB_FirstShop_Wish_Extend() { MallBaseId = req.MallBaseId, UserId = extModel.UserId }).FirstOrDefault(); var wmodel = firstShopWishModule.GetWishList(new RB_FirstShop_Wish_Extend() { MallBaseId = req.MallBaseId, UserId = extModel.UserId }).FirstOrDefault();
if (wmodel != null) { if (wmodel != null)
{
extModel.WishDescription = wmodel.Description; extModel.WishDescription = wmodel.Description;
extModel.WishCard = wmodel.NameCard; extModel.WishCard = wmodel.NameCard;
} }
} }
} }
} }
return ApiResult.Success(data: extModel); return ApiResult.Success(data: extModel);
} }
...@@ -1676,6 +1690,44 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1676,6 +1690,44 @@ namespace Mall.WebApi.Controllers.TradePavilion
} }
} }
} }
/// <summary>
/// 我的收藏
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetMyCollectPage()
{
var userInfo = AppletUserInfo;
ResultPageModel pageModel = JsonConvert.DeserializeObject<ResultPageModel>(RequestParm.msg.ToString());
JObject parms = JObject.Parse(RequestParm.msg.ToString());
var query = new RB_Collect_Extend()
{
Type = parms.GetInt("Type"),
UserId = userInfo.UserId
};
query.MallBaseId = userInfo.MallBaseId;
query.TenantId = userInfo.TenantId;
var list = carrierModule.GetPageList(pageModel.pageIndex, pageModel.pageSize, out long rowsCount, query);
pageModel.count = Convert.ToInt32(rowsCount);
pageModel.pageData = list.Select(x => new
{
x.Id,
x.SourceId,
x.Type,
x.SourceName,
x.SourceFullName,
x.BannerList,
x.Address,
ProjectType = x.ProjectType.HasValue ? x.ProjectType.GetEnumName() : ""
});
return ApiResult.Success(data: pageModel);
}
#endregion #endregion
...@@ -1685,7 +1737,8 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1685,7 +1737,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public ApiResult GetMyWishPageList() { public ApiResult GetMyWishPageList()
{
var userInfo = AppletUserInfo; var userInfo = AppletUserInfo;
var requst = RequestParm; var requst = RequestParm;
ResultPageModel pageModel = JsonHelper.DeserializeObject<ResultPageModel>(requst.msg.ToString()); ResultPageModel pageModel = JsonHelper.DeserializeObject<ResultPageModel>(requst.msg.ToString());
...@@ -1693,7 +1746,8 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1693,7 +1746,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
demodel.MallBaseId = userInfo.MallBaseId; demodel.MallBaseId = userInfo.MallBaseId;
demodel.TenantId = userInfo.TenantId; demodel.TenantId = userInfo.TenantId;
if (demodel.UserId <= 0) { if (demodel.UserId <= 0)
{
return ApiResult.ParamIsNull("请传递用户id"); return ApiResult.ParamIsNull("请传递用户id");
} }
...@@ -1720,11 +1774,13 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1720,11 +1774,13 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public ApiResult GetMyWishInfo() { public ApiResult GetMyWishInfo()
{
var userInfo = AppletUserInfo; var userInfo = AppletUserInfo;
JObject parms = JObject.Parse(RequestParm.msg.ToString()); JObject parms = JObject.Parse(RequestParm.msg.ToString());
int WishId = parms.GetInt("WishId", 0); int WishId = parms.GetInt("WishId", 0);
if (WishId <= 0) { if (WishId <= 0)
{
return ApiResult.ParamIsNull(); return ApiResult.ParamIsNull();
} }
...@@ -1751,7 +1807,8 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1751,7 +1807,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public ApiResult SetMyWishInfo() { public ApiResult SetMyWishInfo()
{
var userInfo = AppletUserInfo; var userInfo = AppletUserInfo;
RB_FirstShop_Wish_Extend demodel = JsonConvert.DeserializeObject<RB_FirstShop_Wish_Extend>(RequestParm.msg.ToString()); RB_FirstShop_Wish_Extend demodel = JsonConvert.DeserializeObject<RB_FirstShop_Wish_Extend>(RequestParm.msg.ToString());
...@@ -1787,10 +1844,235 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1787,10 +1844,235 @@ namespace Mall.WebApi.Controllers.TradePavilion
{ {
return ApiResult.Success(); return ApiResult.Success();
} }
else
{
return ApiResult.Failed(msg);
}
}
#endregion
#region 榜单管理
/// <summary>
/// 获取榜单分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetAppletFirstShopListPageList()
{
var userInfo = base.AppletUserInfo;
var req = base.RequestParm;
ResultPageModel pageModel = JsonHelper.DeserializeObject<ResultPageModel>(req.msg.ToString());
RB_FirstShop_List_Extend demodel = JsonHelper.DeserializeObject<RB_FirstShop_List_Extend>(req.msg.ToString());
demodel.TenantId = userInfo.TenantId;
demodel.MallBaseId = userInfo.MallBaseId;
demodel.IsAppletSelectNor = 1;
demodel.OrderBy = 1;
var list = firstShopListModule.GetAppletFirstShopListPageList(pageModel.pageIndex, pageModel.pageSize, out long count, demodel);
return ApiResult.Success("", list.Select(x => new
{
x.Id,
x.ListType,
ListTypeName = x.ListType.GetEnumName(),
x.ObjectTypeList,
x.Sponsor,
x.ListName,
x.CoverImage,
EndDate = x.EndDate.ToString("yyyy-MM-dd"),
StartDate = x.StartDate.ToString("yyyy-MM-dd"),
FinishDate = x.FinishDate.ToString("yyyy-MM-dd HH:mm"),
x.PrizeNum,
x.State
}));
}
/// <summary>
/// 获取榜单详情
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetAppletFistShopListInfo()
{
var userInfo = base.AppletUserInfo;
var req = base.RequestParm;
JObject parms = JObject.Parse(req.msg.ToString());
int ListId = parms.GetInt("ListId", 0);//榜单id
if (ListId <= 0)
{
return ApiResult.ParamIsNull();
}
var model = firstShopListModule.GetAppletFirstShopListInfo(ListId, userInfo);
if (model == null) { return ApiResult.Failed("榜单不存在"); }
return ApiResult.Success("", new
{
model.Id,
model.ListType,
model.ObjectTypeIds,
model.Sponsor,
model.ListName,
model.CoverImage,
EndDate = model.EndDate.ToString("yyyy-MM-dd"),
StartDate = model.StartDate.ToString("yyyy-MM-dd"),
FinishDate = model.FinishDate.ToString("yyyy-MM-dd HH:mm"),
model.Content,
model.EnableRank,
model.PrizeNum,
model.ListState,
EnrollList = model.EnrollList?.Select(x=>new {
x.Id,
x.UserId,
x.UserName,
x.ObjectType,
ObjectTypeName = x.ObjectType.GetEnumName(),
x.ObjectId,
x.ObjectName,
x.ObjectIcon,
x.Content
}),
RankList = model.RankList?.Select(x=>new {
x.Id,
x.UserId,
x.UserName,
x.ObjectId,
x.ObjectType,
ObjectTypeName = x.ObjectType.GetEnumName(),
x.ObjectName,
x.ObjectIcon,
x.Reviews,
x.Rank,
x.MedalImage,
x.MedalImageBig
})
});
}
/// <summary>
/// 获取我的可报名的品牌载体
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetAppletMyBrandCarrierList() {
var userInfo = base.AppletUserInfo;
JObject parms = JObject.Parse(base.RequestParm.msg.ToString());
int ListId = parms.GetInt("ListId", 0);//榜单id
int EnrollId = parms.GetInt("EnrollId", 0);//报名Id
if (ListId <= 0) {
return ApiResult.ParamIsNull();
}
var list = firstShopListModule.GetAppletMyBrandCarrierList(ListId, EnrollId, userInfo);
return ApiResult.Success("", list);
}
/// <summary>
/// 榜单报名
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetAppletFirstShopListInfo() {
var userInfo = base.AppletUserInfo;
RB_FirstShop_ListEnroll_Extend demodel = JsonHelper.DeserializeObject<RB_FirstShop_ListEnroll_Extend>(base.RequestParm.msg.ToString());
if (demodel.ListId <= 0) {
return ApiResult.ParamIsNull("请传递榜单id");
}
if (demodel.ObjectType <= 0) {
return ApiResult.ParamIsNull("请传递类型");
}
if (demodel.ObjectId <= 0) {
return ApiResult.ParamIsNull("请传递品牌载体id");
}
if (string.IsNullOrEmpty(demodel.Content)) {
return ApiResult.ParamIsNull("请传递表单内容");
}
demodel.UserId = userInfo.UserId;
demodel.CandidateState = 1;
demodel.RankListState = 2;
demodel.Status = 0;
demodel.TenantId = userInfo.TenantId;
demodel.MallBaseId = userInfo.MallBaseId;
demodel.CreateDate = DateTime.Now;
demodel.UpdateDate = DateTime.Now;
string msg = firstShopListModule.SetAppletFirstShopListInfo(demodel);
if (msg == "")
{
return ApiResult.Success();
}
else {
return ApiResult.Failed(msg);
}
}
/// <summary>
/// 取消报名
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult CancelAppletFirstShopListInfo() {
var userInfo = base.AppletUserInfo;
JObject parms = JObject.Parse(base.RequestParm.msg.ToString());
int EnrollId = parms.GetInt("EnrollId", 0);//报名Id
if (EnrollId <= 0)
{
return ApiResult.ParamIsNull();
}
string msg = firstShopListModule.CancelAppletFirstShopListInfo(EnrollId, userInfo);
if (msg == "")
{
return ApiResult.Success();
}
else { else {
return ApiResult.Failed(msg); return ApiResult.Failed(msg);
} }
} }
/// <summary>
/// 获取榜单类型枚举列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetListTypeEnumList()
{
var list = EnumHelper.GetEnumList(typeof(Common.Enum.TradePavilion.ListTypeEnum));
return ApiResult.Success("", list.Select(x => new
{
Name = x.Key,
Id = Convert.ToInt32(x.Value)
}));
}
/// <summary>
/// 获取我报名的榜单分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetAppletMyEnrollFistShopListPageList() {
var userInfo = base.AppletUserInfo;
var req = base.RequestParm;
ResultPageModel pageModel = JsonHelper.DeserializeObject<ResultPageModel>(req.msg.ToString());
RB_FirstShop_List_Extend demodel = JsonHelper.DeserializeObject<RB_FirstShop_List_Extend>(req.msg.ToString());
demodel.TenantId = userInfo.TenantId;
demodel.MallBaseId = userInfo.MallBaseId;
var list = firstShopListModule.GetAppletMyEnrollFistShopListPageList(pageModel.pageIndex, pageModel.pageSize, out long count, demodel);
return ApiResult.Success("", list.Select(x => new
{
x.Id,
x.ListType,
ListTypeName = x.ListType.GetEnumName(),
x.Sponsor,
x.ListName,
x.CoverImage,
EndDate = x.EndDate.ToString("yyyy-MM-dd"),
StartDate = x.StartDate.ToString("yyyy-MM-dd"),
FinishDate = x.FinishDate.ToString("yyyy-MM-dd HH:mm"),
x.PrizeNum
}));
}
#endregion #endregion
#region 公司信息(管理端) #region 公司信息(管理端)
...@@ -1861,7 +2143,8 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1861,7 +2143,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
#region 验证登录用户具有审核权限 #region 验证登录用户具有审核权限
var adminModel = userModule.GetMemberUserInfo(userInfo.UserId); var adminModel = userModule.GetMemberUserInfo(userInfo.UserId);
if (adminModel == null) { return ApiResult.Failed("无权限审核"); } if (adminModel == null) { return ApiResult.Failed("无权限审核"); }
if (adminModel.IsAdmin != 1) { if (adminModel.IsAdmin != 1)
{
return ApiResult.Failed("不是管理员,无法操作"); return ApiResult.Failed("不是管理员,无法操作");
} }
#endregion #endregion
......
...@@ -373,7 +373,8 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -373,7 +373,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// 设置用户为管理员 /// 设置用户为管理员
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public ApiResult SetMemberUserIsAdmin() { public ApiResult SetMemberUserIsAdmin()
{
JObject parms = JObject.Parse(RequestParm.msg.ToString()); JObject parms = JObject.Parse(RequestParm.msg.ToString());
var UserId = parms.GetInt("UserId", 0); var UserId = parms.GetInt("UserId", 0);
var IsAdmin = parms.GetInt("IsAdmin", 0); var IsAdmin = parms.GetInt("IsAdmin", 0);
...@@ -381,13 +382,14 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -381,13 +382,14 @@ namespace Mall.WebApi.Controllers.TradePavilion
{ {
return ApiResult.Failed("请传递用户id"); return ApiResult.Failed("请传递用户id");
} }
var msg = companyModule.SetMemberUserIsAdmin(UserId, IsAdmin); var msg = companyModule.SetMemberUserIsAdmin(UserId, IsAdmin);
if (msg == "") if (msg == "")
{ {
return ApiResult.Success(); return ApiResult.Success();
} }
else { else
{
return ApiResult.Failed(msg); return ApiResult.Failed(msg);
} }
} }
...@@ -993,6 +995,7 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -993,6 +995,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
int AuthenticationId = parms.GetInt("AuthenticationId", 0); int AuthenticationId = parms.GetInt("AuthenticationId", 0);
int AuditState = parms.GetInt("AuditState", 0);//审核状态 2审核通过 3审核不通过 int AuditState = parms.GetInt("AuditState", 0);//审核状态 2审核通过 3审核不通过
string AuditRemark = parms.GetStringValue("AuditRemark"); string AuditRemark = parms.GetStringValue("AuditRemark");
if (AuthenticationId <= 0) if (AuthenticationId <= 0)
{ {
return ApiResult.ParamIsNull("请传递认证id"); return ApiResult.ParamIsNull("请传递认证id");
...@@ -1035,6 +1038,7 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1035,6 +1038,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
string AuthenticationIds = parms.GetStringValue("AuthenticationIds"); string AuthenticationIds = parms.GetStringValue("AuthenticationIds");
int AuditState = parms.GetInt("AuditState", 0);//审核状态 2审核通过 3审核不通过 int AuditState = parms.GetInt("AuditState", 0);//审核状态 2审核通过 3审核不通过
string AuditRemark = parms.GetStringValue("AuditRemark"); string AuditRemark = parms.GetStringValue("AuditRemark");
if (string.IsNullOrWhiteSpace(AuthenticationIds)) if (string.IsNullOrWhiteSpace(AuthenticationIds))
{ {
return ApiResult.ParamIsNull("请传递认证id"); return ApiResult.ParamIsNull("请传递认证id");
...@@ -1081,6 +1085,43 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1081,6 +1085,43 @@ namespace Mall.WebApi.Controllers.TradePavilion
return ApiResult.Failed(); return ApiResult.Failed();
} }
} }
/// <summary>
/// 批量设置奖项
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetAuthenticationPrize()
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
var userInfo = this.UserInfo;
string AuthenticationIds = parms.GetStringValue("AuthenticationIds");
string SourceIds = parms.GetStringValue("SourceIds");
if (string.IsNullOrWhiteSpace(AuthenticationIds))
{
return ApiResult.ParamIsNull("请传递认证id");
}
var list = authenticationModule.GetAuthenticationList(new RB_Authentication_Extend { TenantId = userInfo.TenantId, MallBaseId = userInfo.MallBaseId, Ids = AuthenticationIds });
if (list == null || !list.Any())
{
return ApiResult.Failed("请传入正确的id");
}
if (list.Any(x => x.AuditState != 2))
{
return ApiResult.Failed("未审核/审核不通过的不能授予奖章");
}
bool flag = authenticationModule.SetAuthenticationPrize(AuthenticationIds, SourceIds);
if (flag)
{
return ApiResult.Success();
}
else
{
return ApiResult.Failed();
}
}
#endregion #endregion
#region 载体信息 #region 载体信息
...@@ -1103,7 +1144,9 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1103,7 +1144,9 @@ namespace Mall.WebApi.Controllers.TradePavilion
StartOpenTime = parms.GetStringValue("StartOpenTime"), StartOpenTime = parms.GetStringValue("StartOpenTime"),
EndOpenTime = parms.GetStringValue("EndOpenTime"), EndOpenTime = parms.GetStringValue("EndOpenTime"),
ProjectType = (Common.Enum.TradePavilion.ProjectTypeEnum)parms.GetInt("ProjectType", 0), ProjectType = (Common.Enum.TradePavilion.ProjectTypeEnum)parms.GetInt("ProjectType", 0),
UserId = parms.GetInt("UserId", 0) UserId = parms.GetInt("UserId", 0),
OpeningStatus = parms.GetInt("OpeningStatus", -1),
FirstStoreTest = parms.GetInt("FirstStoreTest", -1),
}; };
query.MallBaseId = RequestParm.MallBaseId; query.MallBaseId = RequestParm.MallBaseId;
query.TenantId = RequestParm.TenantId; query.TenantId = RequestParm.TenantId;
...@@ -1330,8 +1373,8 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1330,8 +1373,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
case 14: case 14:
datarow.ExcelRows.Add(new ExcelColumn(value: item.Crowd) { }); break; datarow.ExcelRows.Add(new ExcelColumn(value: item.Crowd) { }); break;
case 15: case 15:
datarow.ExcelRows.Add(new ExcelColumn(value: (item.CarrierMetroList!=null&&item.CarrierMetroList.Any())?(string.Join(",", item.CarrierMetroList.Select(x => x.MetroNum + "号线" + x.MetroName + x.Distance))):"") { }); break; datarow.ExcelRows.Add(new ExcelColumn(value: (item.CarrierMetroList != null && item.CarrierMetroList.Any()) ? (string.Join(",", item.CarrierMetroList.Select(x => x.MetroNum + "号线" + x.MetroName + x.Distance))) : "") { }); break;
} }
} }
slist.Add(datarow); slist.Add(datarow);
...@@ -1506,7 +1549,7 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1506,7 +1549,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
Sewage = parms.GetInt("Sewage", -1), Sewage = parms.GetInt("Sewage", -1),
PaiYan = parms.GetInt("PaiYan", -1), PaiYan = parms.GetInt("PaiYan", -1),
DianLiang = parms.GetStringValue("DianLiang"), DianLiang = parms.GetStringValue("DianLiang"),
UserId = parms.GetInt("UserId", 0) UserId = parms.GetInt("UserId", 0),
}; };
query.MallBaseId = RequestParm.MallBaseId; query.MallBaseId = RequestParm.MallBaseId;
query.TenantId = RequestParm.TenantId; query.TenantId = RequestParm.TenantId;
...@@ -1817,8 +1860,9 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1817,8 +1860,9 @@ namespace Mall.WebApi.Controllers.TradePavilion
x.Sponsor, x.Sponsor,
x.ListName, x.ListName,
x.CoverImage, x.CoverImage,
DeadlineDate = x.DeadlineDate.ToString("yyyy-MM-dd HH:mm"), EndDate = x.EndDate.ToString("yyyy-MM-dd"),
StartDate = x.StartDate.ToString("yyyy-MM-dd HH:mm"), StartDate = x.StartDate.ToString("yyyy-MM-dd"),
FinishDate = x.FinishDate.ToString("yyyy-MM-dd HH:mm"),
x.Content, x.Content,
x.EnableRank, x.EnableRank,
x.PrizeNum, x.PrizeNum,
...@@ -1851,8 +1895,9 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1851,8 +1895,9 @@ namespace Mall.WebApi.Controllers.TradePavilion
model.Sponsor, model.Sponsor,
model.ListName, model.ListName,
model.CoverImage, model.CoverImage,
DeadlineDate = model.DeadlineDate.ToString("yyyy-MM-dd HH:mm"), EndDate = model.EndDate.ToString("yyyy-MM-dd"),
StartDate = model.StartDate.ToString("yyyy-MM-dd HH:mm"), StartDate = model.StartDate.ToString("yyyy-MM-dd"),
FinishDate = model.FinishDate.ToString("yyyy-MM-dd HH:mm"),
model.Content, model.Content,
model.EnableRank, model.EnableRank,
model.PrizeNum, model.PrizeNum,
...@@ -1887,6 +1932,7 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1887,6 +1932,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
return ApiResult.ParamIsNull("请输入入围名额"); return ApiResult.ParamIsNull("请输入入围名额");
} }
demodel.EndDate = Convert.ToDateTime(demodel.EndDate.ToString("yyyy-MM-dd") + " 23:59:59");
demodel.ListState = Common.Enum.TradePavilion.ListStateEnum.Enroll; demodel.ListState = Common.Enum.TradePavilion.ListStateEnum.Enroll;
demodel.TenantId = req.TenantId; demodel.TenantId = req.TenantId;
demodel.MallBaseId = req.MallBaseId; demodel.MallBaseId = req.MallBaseId;
...@@ -1983,7 +2029,8 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1983,7 +2029,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public ApiResult GetFirstShopWishPageList() { public ApiResult GetFirstShopWishPageList()
{
var requst = RequestParm; var requst = RequestParm;
ResultPageModel pageModel = JsonHelper.DeserializeObject<ResultPageModel>(requst.msg.ToString()); ResultPageModel pageModel = JsonHelper.DeserializeObject<ResultPageModel>(requst.msg.ToString());
RB_FirstShop_Wish_Extend demodel = JsonHelper.DeserializeObject<RB_FirstShop_Wish_Extend>(requst.msg.ToString()); RB_FirstShop_Wish_Extend demodel = JsonHelper.DeserializeObject<RB_FirstShop_Wish_Extend>(requst.msg.ToString());
...@@ -2013,11 +2060,13 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -2013,11 +2060,13 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public ApiResult DelFirstShopWishInfo() { public ApiResult DelFirstShopWishInfo()
{
var requst = RequestParm; var requst = RequestParm;
JObject prams = JObject.Parse(requst.msg.ToString()); JObject prams = JObject.Parse(requst.msg.ToString());
int WishId = prams.GetInt("WishId", 0); int WishId = prams.GetInt("WishId", 0);
if (WishId <= 0) { if (WishId <= 0)
{
return ApiResult.ParamIsNull(); return ApiResult.ParamIsNull();
} }
...@@ -2026,11 +2075,139 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -2026,11 +2075,139 @@ namespace Mall.WebApi.Controllers.TradePavilion
{ {
return ApiResult.Success(); return ApiResult.Success();
} }
else { else
{
return ApiResult.Failed(); return ApiResult.Failed();
} }
} }
#endregion
#region 奖项
/// <summary>
/// 获取奖项分页列表
/// </summary>
/// <returns></returns>
[HttpGet]
[HttpPost]
public ApiResult GetPrizePageList()
{
ResultPageModel pageModel = JsonConvert.DeserializeObject<ResultPageModel>(RequestParm.msg.ToString());
JObject parms = JObject.Parse(RequestParm.msg.ToString());
var query = new RB_Prize_Extend()
{
Name = parms.GetStringValue("Name"),
};
query.MallBaseId = RequestParm.MallBaseId;
query.TenantId = RequestParm.TenantId;
var list = carrierModule.GetPrizePageList(pageModel.pageIndex, pageModel.pageSize, out long rowsCount, query);
pageModel.count = Convert.ToInt32(rowsCount);
pageModel.pageData = list.Select(x => new
{
x.Id,
x.Name,
x.BigIco,
x.SmallIco,
x.TotalCount,
x.YearInfo
});
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 获取奖项实体
/// </summary>
/// <returns></returns>
[HttpGet]
[HttpPost]
public ApiResult GetPrizeDetails()
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
var query = new RB_Prize_Extend()
{
Id = parms.GetInt("Id", 0),
};
query.MallBaseId = RequestParm.MallBaseId;
query.TenantId = RequestParm.TenantId;
var extModel = carrierModule.GetPrizeList(query).FirstOrDefault();
if (extModel == null || extModel.Id == 0)
{
return ApiResult.Failed("奖项信息不存在");
}
return ApiResult.Success(data: extModel);
}
/// <summary>
/// 获取奖项实体
/// </summary>
/// <returns></returns>
[HttpGet]
[HttpPost]
public ApiResult GetPrizeList()
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
var query = new RB_Prize_Extend();
query.MallBaseId = RequestParm.MallBaseId;
query.TenantId = RequestParm.TenantId;
var extList = carrierModule.GetPrizeList(query);
return ApiResult.Success(data: extList);
}
/// <summary>
/// 新增/修改奖项信息
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetSetPrize()
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
RB_Prize_Extend query = JsonConvert.DeserializeObject<RB_Prize_Extend>(RequestParm.msg.ToString());
if (string.IsNullOrWhiteSpace(query.Name))
{
return ApiResult.Failed("请输入奖项名称");
}
if (string.IsNullOrWhiteSpace(query.BigIco))
{
return ApiResult.Failed("请上传大奖章");
}
if (string.IsNullOrWhiteSpace(query.SmallIco))
{
return ApiResult.Failed("请上传小奖章");
}
if (query.Id == 0)
{
query.CreateDate = System.DateTime.Now;
query.MallBaseId = RequestParm.MallBaseId;
query.TenantId = RequestParm.TenantId;
}
query.Status = 0;
bool flag = carrierModule.SetPrize(query);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 删除奖项信息
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult RemovePrize()
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
var Id = parms.GetInt("Id", 0);
var flag = carrierModule.RemovePrizeModule(Id);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion #endregion
} }
} }
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