Commit 97d960b5 authored by 吴春's avatar 吴春

提交代码

parent e2dcbe9c
......@@ -139,5 +139,10 @@ namespace Mall.Model.Entity.TradePavilion
/// </summary>
public DateTime? AuditDate { get; set; }
/// <summary>
/// 奖项来源ids
/// </summary>
public string SourceIds { get; set; }
}
}
......@@ -217,5 +217,7 @@ namespace Mall.Model.Entity.TradePavilion
/// 开店意愿(打分制)
/// </summary>
public decimal OpenShopWish { get; set; }
}
}
......@@ -159,5 +159,80 @@ namespace Mall.Model.Entity.TradePavilion
/// 归属于用户
/// </summary>
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
/// 现有的载体Id
/// </summary>
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; }
}
}
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
/// 多个ids
/// </summary>
public string Ids { get; set; }
/// <summary>
/// 奖项
/// </summary>
public int PrizeId { get; set; }
}
}
......@@ -13,6 +13,11 @@ namespace Mall.Model.Extend.TradePavilion
public string ClassName { get; set; }
/// <summary>
/// 品牌Ids
/// </summary>
public string QBrandIds { get; set; }
public List<string> BannerList { get; set; }
/// <summary>
......@@ -21,6 +26,10 @@ namespace Mall.Model.Extend.TradePavilion
//public string ProjectName { get { return Common.Plugin.EnumHelper.GetEnumName(this.ProjectType); } }
/// <summary>
///
/// </summary>
public string ProjectName { get; set; }
/// <summary>
......
......@@ -61,5 +61,30 @@ namespace Mall.Model.Extend.TradePavilion
/// 认证用户头像
/// </summary>
public string UserIcon { get; set; }
/// <summary>
/// 载体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; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Common.Enum.TradePavilion;
using Mall.Common.Plugin;
using Mall.Model.Entity.TradePavilion;
......@@ -8,6 +9,37 @@ namespace Mall.Model.Extend.TradePavilion
{
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; }
}
}
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
};
return authenticationRepository.Update(keyValues, wheres);
}
else {
else
{
return authenticationRepository.Insert(demodel) > 0;
}
}
......@@ -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)
{
var list = authenticationRepository.GetPageList(pageIndex, pageSize, out count, demodel);
if (list.Any()) {
foreach (var item in list) {
if (list.Any())
{
foreach (var item in list)
{
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);
}
}
......@@ -101,7 +105,8 @@ namespace Mall.Module.TradePavilion
{
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>();
if (!string.IsNullOrEmpty(UserIds)) {
if (!string.IsNullOrEmpty(UserIds))
{
ulist = member_UserRepository.GetList(new Model.Extend.User.RB_Member_User_Extend() { UserIds = UserIds });
}
foreach (var item in list)
......@@ -128,17 +133,17 @@ namespace Mall.Module.TradePavilion
/// <returns></returns>
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>());
return list;
}
/// <summary>
/// 获取认证详情
/// </summary>
/// <param name="authenticationId"></param>
/// <returns></returns>
public RB_Authentication_Extend GetAuthenticationInfo(int authenticationId)
/// <summary>
/// 获取认证详情
/// </summary>
/// <param name="authenticationId"></param>
/// <returns></returns>
public RB_Authentication_Extend GetAuthenticationInfo(int authenticationId)
{
var model = authenticationRepository.GetEntity<RB_Authentication_Extend>(authenticationId);
if (model == null) { return null; }
......@@ -185,10 +190,11 @@ namespace Mall.Module.TradePavilion
/// <returns></returns>
public bool SetAuthenticationAudit(int authenticationId, int auditState, string auditRemark)
{
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Authentication_Extend.AuditState),auditState},
{ 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>() {
new WhereHelper(){
......@@ -199,6 +205,29 @@ namespace Mall.Module.TradePavilion
};
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>
......@@ -213,7 +242,7 @@ namespace Mall.Module.TradePavilion
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Authentication_Extend.AuditState),auditState},
{ 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>() {
new WhereHelper(){
......
......@@ -60,6 +60,11 @@ namespace Mall.Module.TradePavilion
/// </summary>
private readonly RB_CollectRepository collectRepository = new RB_CollectRepository();
/// <summary>
/// 奖项仓储层对象
/// </summary>
private readonly RB_PrizeRepository prizeRepository = new RB_PrizeRepository();
#region 载体
/// <summary>
/// 载体信息列表
......@@ -69,7 +74,7 @@ namespace Mall.Module.TradePavilion
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <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);
if (list != null && list.Any())
......@@ -87,7 +92,8 @@ namespace Mall.Module.TradePavilion
}
}
}
if (IsSelectUser) {
if (IsSelectUser)
{
if (list.Where(x => x.UserId > 0).Any())
{
//查询用户列表
......@@ -151,7 +157,7 @@ namespace Mall.Module.TradePavilion
var metroList = carrierMetroRepository.GetCarrierMetroList(new RB_CarrierMetro_Extend { TenantId = query.TenantId, MallBaseId = query.MallBaseId, CarrierId = model.ID });
if (metroList != null && metroList.Any())
{
model.CarrierMetroList = new List<RB_CarrierMetro_Extend>();
model.CarrierMetroList = metroList;
}
......@@ -159,7 +165,8 @@ namespace Mall.Module.TradePavilion
{
model.BannerList = JsonConvert.DeserializeObject<List<string>>(model.Banner);
}
else {
else
{
model.BannerList = new List<string>();
}
}
......@@ -194,7 +201,9 @@ namespace Mall.Module.TradePavilion
{nameof(RB_Carrier_Extend.CarrierPlan),model.CarrierPlan },
{nameof(RB_Carrier_Extend.CarrierTarget),model.CarrierTarget },
{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));
......@@ -314,7 +323,8 @@ namespace Mall.Module.TradePavilion
{
#region 验证载体申请是否已存在
var oldList = carrierApplyForRepository.GetCarrierList(new RB_CarrierApplyFor_Extend() { MallBaseId = model.MallBaseId, CompanyId = model.CompanyId });
if (oldList.Any()) {
if (oldList.Any())
{
return false;
}
#endregion
......@@ -670,12 +680,14 @@ namespace Mall.Module.TradePavilion
{
#region 验证品牌数据是否已存在
var oldList = brandApplyForRepository.GetBrandListByWhere(new RB_BrandApplyFor_Extend() { MallBaseId = model.MallBaseId, CompanyId = model.CompanyId });
if (oldList.Any()) {
if (oldList.Any())
{
return false;
}
#endregion
bool flag = brandApplyForRepository.Insert(model) > 0;
if (flag) {
if (flag)
{
//更新认证表 资料状态为完成
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Company_Extend.IsComplete),1}
......@@ -798,7 +810,49 @@ namespace Mall.Module.TradePavilion
/// <returns></returns>
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>
......@@ -852,6 +906,77 @@ namespace Mall.Module.TradePavilion
}
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
}
}
......@@ -43,6 +43,10 @@ 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}");
......
......@@ -48,6 +48,7 @@ WHERE 1=1
{
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Brand_Extend.UserId), query.UserId);
}
if (!string.IsNullOrEmpty(query.BrandName))
{
builder.AppendFormat(" AND a.{0} LIKE @Name ", nameof(RB_Brand_Extend.BrandName));
......@@ -145,7 +146,7 @@ WHERE 1=1
{
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Brand_Extend.ProjectType), (int)query.ProjectType);
}
}
return Get<RB_Brand_Extend>(builder.ToString(), parameters).FirstOrDefault();
}
......@@ -193,6 +194,10 @@ 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);
}
if (query.UserId == -1)
{
builder.AppendFormat(" AND a.{0} =0 ", nameof(RB_Brand_Extend.UserId));//查询未绑定用户的
......
......@@ -54,7 +54,14 @@ namespace Mall.Repository.TradePavilion
{
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))
{
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
{
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)
{
builder.Append($" AND {nameof(RB_Carrier_Extend.UserId)}={query.UserId}");
......
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();
}
}
}
......@@ -184,7 +184,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetCommpanyStatus() {
public ApiResult GetCommpanyStatus()
{
var userInfo = AppletUserInfo;
var model = companyModule.GetCommpanyStatus(userInfo.UserId);
return ApiResult.Success(data: model);
......@@ -350,7 +351,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
{
return ApiResult.Success();
}
else {
else
{
return ApiResult.Failed();
}
}
......@@ -406,11 +408,13 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetCommpanyCompleteCorvidae() {
public ApiResult SetCommpanyCompleteCorvidae()
{
var userInfo = AppletUserInfo;
JObject parms = JObject.Parse(RequestParm.msg.ToString());
int CompanyId = parms.GetInt("CompanyId", 0);
if (CompanyId <= 0) {
if (CompanyId <= 0)
{
return ApiResult.ParamIsNull();
}
......@@ -419,7 +423,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
{
return ApiResult.Success();
}
else {
else
{
return ApiResult.Failed();
}
}
......@@ -510,7 +515,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
query.MallBaseId = userInfo.MallBaseId;
query.TenantId = userInfo.TenantId;
var list = carrierModule.GetCarrierList(query);
return ApiResult.Success(data: list.Select(x => new
{
x.ID,
......@@ -1247,7 +1252,9 @@ namespace Mall.WebApi.Controllers.TradePavilion
StartOpenTime = parms.GetStringValue("StartOpenTime"),
EndOpenTime = parms.GetStringValue("EndOpenTime"),
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.TenantId = userInfo?.TenantId ?? 0;
......@@ -1547,7 +1554,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();
extModel.CollectId = collectModel?.Id ?? 0;
}
if (extModel.UserId > 0) {
if (extModel.UserId > 0)
{
//获取首店年份
extModel.FirstShopYear = authenticationModule.GetFirstShopYear(extModel.UserId, req.MallBaseId);
if (req.UserId > 0)
......@@ -1558,13 +1566,15 @@ namespace Mall.WebApi.Controllers.TradePavilion
{
//载体方 并且认证OK
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.WishCard = wmodel.NameCard;
}
}
}
}
return ApiResult.Success(data: extModel);
}
......@@ -1676,6 +1686,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
......@@ -1685,7 +1733,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetMyWishPageList() {
public ApiResult GetMyWishPageList()
{
var userInfo = AppletUserInfo;
var requst = RequestParm;
ResultPageModel pageModel = JsonHelper.DeserializeObject<ResultPageModel>(requst.msg.ToString());
......@@ -1693,7 +1742,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
demodel.MallBaseId = userInfo.MallBaseId;
demodel.TenantId = userInfo.TenantId;
if (demodel.UserId <= 0) {
if (demodel.UserId <= 0)
{
return ApiResult.ParamIsNull("请传递用户id");
}
......@@ -1720,11 +1770,13 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetMyWishInfo() {
public ApiResult GetMyWishInfo()
{
var userInfo = AppletUserInfo;
JObject parms = JObject.Parse(RequestParm.msg.ToString());
int WishId = parms.GetInt("WishId", 0);
if (WishId <= 0) {
if (WishId <= 0)
{
return ApiResult.ParamIsNull();
}
......@@ -1751,7 +1803,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetMyWishInfo() {
public ApiResult SetMyWishInfo()
{
var userInfo = AppletUserInfo;
RB_FirstShop_Wish_Extend demodel = JsonConvert.DeserializeObject<RB_FirstShop_Wish_Extend>(RequestParm.msg.ToString());
......@@ -1787,7 +1840,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
{
return ApiResult.Success();
}
else {
else
{
return ApiResult.Failed(msg);
}
}
......@@ -1861,7 +1915,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
#region 验证登录用户具有审核权限
var adminModel = userModule.GetMemberUserInfo(userInfo.UserId);
if (adminModel == null) { return ApiResult.Failed("无权限审核"); }
if (adminModel.IsAdmin != 1) {
if (adminModel.IsAdmin != 1)
{
return ApiResult.Failed("不是管理员,无法操作");
}
#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