Commit bc0602cc authored by 黄奎's avatar 黄奎
parents 30940852 e2dcbe9c
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Common.Plugin;
namespace Mall.Common.Enum.TradePavilion
{
/// <summary>
/// 榜单面向群体枚举
/// </summary>
public enum ListObjectTypeEnum
{
/// <summary>
/// 品牌
/// </summary>
[EnumField("品牌")]
Brand = 1,
/// <summary>
/// 载体
/// </summary>
[EnumField("载体")]
Carrier = 2,
/// <summary>
/// 服务商
/// </summary>
[EnumField("服务商")]
Servicer = 3
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Common.Plugin;
namespace Mall.Common.Enum.TradePavilion
{
/// <summary>
/// 榜单状态枚举
/// </summary>
public enum ListStateEnum
{
/// <summary>
/// 报名中
/// </summary>
[EnumField("报名中")]
Enroll = 1,
/// <summary>
/// 评比中 (需根据日期判断)
/// </summary>
[EnumField("评比中")]
Rating = 2,
/// <summary>
/// 已放榜
/// </summary>
[EnumField("已放榜")]
Confirmed = 3,
/// <summary>
/// 取消
/// </summary>
[EnumField("取消")]
Cancel = 4
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Common.Plugin;
namespace Mall.Common.Enum.TradePavilion
{
/// <summary>
/// 榜单类型枚举
/// </summary>
public enum ListTypeEnum
{
/// <summary>
/// 招引贡献
/// </summary>
[EnumField("招引贡献")]
Attract = 1,
/// <summary>
/// 首发
/// </summary>
[EnumField("首发")]
FirstPublish = 2,
/// <summary>
/// 首秀
/// </summary>
[EnumField("首秀")]
FirstShow = 3,
/// <summary>
/// 首展
/// </summary>
[EnumField("首展")]
FirstExhibit = 4
}
}
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_FirstShop_List
{
/// <summary>
/// Id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 榜单类型 枚举
/// </summary>
public ListTypeEnum ListType { get; set; }
/// <summary>
/// 面向群体 枚举
/// </summary>
public string ObjectTypeIds { get; set; }
/// <summary>
/// 主办方
/// </summary>
public string Sponsor { get; set; }
/// <summary>
/// 榜单名称
/// </summary>
public string ListName { get; set; }
/// <summary>
/// 封面图
/// </summary>
public string CoverImage { get; set; }
/// <summary>
/// 报名截止日期
/// </summary>
public DateTime DeadlineDate { get; set; }
/// <summary>
/// 公示日期
/// </summary>
public DateTime StartDate { get; set; }
/// <summary>
/// 详细内容
/// </summary>
public string Content { get; set; }
/// <summary>
/// 是否启用排名 1是
/// </summary>
public int EnableRank { get; set; }
/// <summary>
/// 入围名额
/// </summary>
public int PrizeNum { get; set; }
/// <summary>
/// 绑定状态 枚举
/// </summary>
public ListStateEnum ListState { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public int Status { get; set; }
/// <summary>
/// 商户号id
/// </summary>
public int TenantId { get; set; }
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateDate { get; set; }
/// <summary>
/// 修改人
/// </summary>
public int UpdateBy { get; set; }
/// <summary>
/// 修改时间
/// </summary>
public DateTime UpdateDate { 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_FirstShop_ListEnroll
{
/// <summary>
/// Id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 用户id
/// </summary>
public int UserId { get; set; }
/// <summary>
/// 类型 1品牌 2载体 3服务商
/// </summary>
public ListObjectTypeEnum ObjectType { get; set; }
/// <summary>
/// 表单内容
/// </summary>
public string Content { get; set; }
/// <summary>
/// 入榜评语
/// </summary>
public string Reviews { get; set; }
/// <summary>
/// 排名
/// </summary>
public int Rank { get; set; }
/// <summary>
/// 小奖章图片
/// </summary>
public string MedalImage { get; set; }
/// <summary>
/// 大奖章图片
/// </summary>
public string MedalImageBig { get; set; }
/// <summary>
/// 候选状态 1报名中 2候选 3淘汰
/// </summary>
public int CandidateState { get; set; }
/// <summary>
/// 上榜状态 1上榜 2未上榜
/// </summary>
public int RankListState { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public int Status { get; set; }
/// <summary>
/// 商户号id
/// </summary>
public int TenantId { get; set; }
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateDate { get; set; }
/// <summary>
/// 修改人
/// </summary>
public int UpdateBy { get; set; }
/// <summary>
/// 修改时间
/// </summary>
public DateTime UpdateDate { get; set; }
}
}
using Mall.Model.Entity.TradePavilion;
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Mall.Model.Extend.TradePavilion
{
/// <summary>
/// 榜单报名扩展实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_FirstShop_ListEnroll_Extend : RB_FirstShop_ListEnroll
{
/// <summary>
/// 用户名称
/// </summary>
public string UserName { get; set; }
}
}
using Mall.Model.Entity.TradePavilion;
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Mall.Model.Extend.TradePavilion
{
/// <summary>
/// 榜单扩展实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_FirstShop_List_Extend : RB_FirstShop_List
{
/// <summary>
/// 面向群里id
/// </summary>
public int ObjectTypeId { get; set; }
}
}
using Mall.Common.Enum;
using Mall.Model.Entity.TradePavilion;
using Mall.Model.Extend.TradePavilion;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Mall.Repository.TradePavilion
{
/// <summary>
/// 榜单报名仓储层
/// </summary>
public class RB_FirstShop_ListEnrollRepository : BaseRepository<RB_FirstShop_ListEnroll>
{
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_FirstShop_ListEnroll_Extend> GetPageList(int pageIndex, int pageSize, out long count, RB_FirstShop_ListEnroll_Extend dmodel)
{
var parameters = new DynamicParameters();
string where = $" 1=1 and Status =0";
if (dmodel.TenantId > 0)
{
where += $@" and w.{nameof(RB_FirstShop_ListEnroll_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and w.{nameof(RB_FirstShop_ListEnroll_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.UserId > 0)
{
where += $@" and w.{nameof(RB_FirstShop_ListEnroll_Extend.UserId)}={dmodel.UserId}";
}
if (dmodel.ObjectType > 0)
{
where += $@" and w.{nameof(RB_FirstShop_ListEnroll_Extend.ObjectType)}={dmodel.ObjectType}";
}
if (dmodel.CandidateState > 0)
{
where += $@" and w.{nameof(RB_FirstShop_ListEnroll_Extend.CandidateState)}={dmodel.CandidateState}";
}
if (dmodel.RankListState > 0)
{
where += $@" and w.{nameof(RB_FirstShop_ListEnroll_Extend.RankListState)}={dmodel.RankListState}";
}
string sql = $@"select w.*,u.Name as UserName from RB_FirstShop_ListEnroll w
left join rb_member_user u on w.UserId = u.Id
where {where} order by w.Id desc
";
return GetPage<RB_FirstShop_ListEnroll_Extend>(pageIndex, pageSize, out count, sql, parameters).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_FirstShop_ListEnroll_Extend> GetList(RB_FirstShop_ListEnroll_Extend dmodel)
{
var parameters = new DynamicParameters();
string where = $" 1=1 and Status =0";
if (dmodel.TenantId > 0)
{
where += $@" and w.{nameof(RB_FirstShop_ListEnroll_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and w.{nameof(RB_FirstShop_ListEnroll_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.UserId > 0)
{
where += $@" and w.{nameof(RB_FirstShop_ListEnroll_Extend.UserId)}={dmodel.UserId}";
}
if (dmodel.ObjectType > 0)
{
where += $@" and w.{nameof(RB_FirstShop_ListEnroll_Extend.ObjectType)}={dmodel.ObjectType}";
}
if (dmodel.CandidateState > 0)
{
where += $@" and w.{nameof(RB_FirstShop_ListEnroll_Extend.CandidateState)}={dmodel.CandidateState}";
}
if (dmodel.RankListState > 0)
{
where += $@" and w.{nameof(RB_FirstShop_ListEnroll_Extend.RankListState)}={dmodel.RankListState}";
}
string sql = $@"select w.*,u.Name as UserName from RB_FirstShop_ListEnroll w
left join rb_member_user u on w.UserId = u.Id
where {where} order by w.Id desc
";
return Get<RB_FirstShop_ListEnroll_Extend>(sql, parameters).ToList();
}
}
}
\ No newline at end of file
using Mall.Common.Enum;
using Mall.Model.Entity.TradePavilion;
using Mall.Model.Extend.TradePavilion;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Mall.Repository.TradePavilion
{
/// <summary>
/// 榜单仓储层
/// </summary>
public class RB_FirstShop_ListRepository : BaseRepository<RB_FirstShop_List>
{
/// <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> GetPageList(int pageIndex, int pageSize, out long count, RB_FirstShop_List_Extend dmodel)
{
var parameters = new DynamicParameters();
string where = $" 1=1 and Status =0";
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.ListType > 0)
{
where += $@" and w.{nameof(RB_FirstShop_List_Extend.ListType)}={(int)dmodel.ListType}";
}
if (dmodel.ObjectTypeId > 0)
{
where += $@" and find_in_set('{dmodel.ObjectTypeId}',w.{nameof(RB_FirstShop_List_Extend.ListType)})";
}
if (dmodel.ListState > 0)
{
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.DeadlineDate)} >='{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}'";
}
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.DeadlineDate)} <'{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}'";
}
else {
where += $@" and w.{nameof(RB_FirstShop_List_Extend.ListState)}={(int)dmodel.ListState}";
}
}
if (!string.IsNullOrEmpty(dmodel.Sponsor))
{
where += $@" and w.{nameof(RB_FirstShop_List_Extend.Sponsor)} @Sponsor";
parameters.Add("Sponsor", "%" + dmodel.Sponsor + "%");
}
if (!string.IsNullOrEmpty(dmodel.ListName))
{
where += $@" and w.{nameof(RB_FirstShop_List_Extend.ListName)} @ListName";
parameters.Add("ListName", "%" + dmodel.ListName + "%");
}
string sql = $@"select w.* from RB_FirstShop_List w
where {where} order by w.Id desc
";
return GetPage<RB_FirstShop_List_Extend>(pageIndex, pageSize, out count, sql, parameters).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_FirstShop_List_Extend> GetList(RB_FirstShop_List_Extend dmodel)
{
var parameters = new DynamicParameters();
string where = $" 1=1 and Status =0";
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.ListType > 0)
{
where += $@" and w.{nameof(RB_FirstShop_List_Extend.ListType)}={(int)dmodel.ListType}";
}
if (dmodel.ObjectTypeId > 0)
{
where += $@" and find_in_set('{dmodel.ObjectTypeId}',w.{nameof(RB_FirstShop_List_Extend.ListType)})";
}
if (dmodel.ListState > 0)
{
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.DeadlineDate)} >='{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}'";
}
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.DeadlineDate)} <'{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}'";
}
else
{
where += $@" and w.{nameof(RB_FirstShop_List_Extend.ListState)}={(int)dmodel.ListState}";
}
}
if (!string.IsNullOrEmpty(dmodel.Sponsor))
{
where += $@" and w.{nameof(RB_FirstShop_List_Extend.Sponsor)} @Sponsor";
parameters.Add("Sponsor", "%" + dmodel.Sponsor + "%");
}
if (!string.IsNullOrEmpty(dmodel.ListName))
{
where += $@" and w.{nameof(RB_FirstShop_List_Extend.ListName)} @ListName";
parameters.Add("ListName", "%" + dmodel.ListName + "%");
}
string sql = $@"select w.* from RB_FirstShop_List w
where {where} order by w.Id desc
";
return Get<RB_FirstShop_List_Extend>(sql, parameters).ToList();
}
}
}
\ No newline at end of file
......@@ -3090,6 +3090,7 @@ namespace Mall.WebApi.Controllers.MallBase
demodel.SourceMallBaseId = parms.MallBaseId;
demodel.SourceTenantId = parms.TenantId;
demodel.CreateBy = -1;
decimal MinProfitRate = 0;
if (demodel.TenantId == 1)
{
......@@ -3214,7 +3215,7 @@ namespace Mall.WebApi.Controllers.MallBase
item.SpecificationPriceList.ForEach(x => x.CreateDate = System.DateTime.Now);
item.SpecificationPriceList.ForEach(x => x.MallBaseId = RequestParm.MallBaseId);
model = item;
model.SourceTenantId = TenantId;
model.SourceMallBaseId = MallBaseId;
model.TenantId = RequestParm.TenantId;
......
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