Commit 1e0c950a authored by 吴春's avatar 吴春

提交小程序直播

parent e6f22bc0
......@@ -308,6 +308,15 @@ namespace Mall.Common
return new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("DeveloperKitsPort").Value;
}
}
/// <summary>
/// 小程序生成二维码跳转地址
/// </summary>
public static string FirstPage
{
get
{
return new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("FirstPage").Value;
}
}
}
}
\ No newline at end of file
......@@ -194,6 +194,7 @@ namespace Mall.Common.Plugin
}
}
/// <summary>
/// 获取年份月份中的最后一天
/// </summary>
......@@ -510,7 +511,8 @@ namespace Mall.Common.Plugin
{
TotalDay = Saturday + Sunday + 2;
}
else {
else
{
TotalDay = Saturday + Sunday + 1;
}
}
......@@ -567,22 +569,22 @@ namespace Mall.Common.Plugin
}
}
#endregion
#endregion
#region 字符转换
#region 字符转换
/// <summary>
/// 为字符串左边填充字符
/// <example>
/// 111 LPAD(,'0',8) --> 00000111
/// </example>
/// </summary>
/// <param name="str">字符串</param>
/// <param name="swap">替换的字符</param>
/// <param name="length">长度</param>
/// <returns></returns>
public static string LPAD(object str, string swap, int length)
/// <summary>
/// 为字符串左边填充字符
/// <example>
/// 111 LPAD(,'0',8) --> 00000111
/// </example>
/// </summary>
/// <param name="str">字符串</param>
/// <param name="swap">替换的字符</param>
/// <param name="length">长度</param>
/// <returns></returns>
public static string LPAD(object str, string swap, int length)
{
string s = str.ToString();
......
......@@ -6,7 +6,7 @@ namespace Mall.Common.Plugin
{
public class WeiXinHelper
{
}
/// <summary>
......
using Mall.Common.AOP;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Entity.AppletWeChat
{
/// <summary>
/// 直播房间信息
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Live_House
{
/// <summary>
/// 房间号
/// </summary>
public int ID { get; set; }
/// <summary>
/// 商户id
/// </summary>
public int TenantId { get; set; }
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId { get; set; }
public DateTime CreateDate { get; set; }
/// <summary>
/// 房间名
/// </summary>
public string name { get; set; }
/// <summary>
/// 房间id
/// </summary>
public string roomid { get; set; }
/// <summary>
/// 直播间背景墙
/// </summary>
public string cover_img { get; set; }
/// <summary>
/// 直播状态
/// </summary>
public string live_status { get; set; }
/// <summary>
/// 直播计划开始时间
/// </summary>
public string start_time { get; set; }
/// <summary>
/// 直播计划结束时间
/// </summary>
public string end_time { get; set; }
/// <summary>
/// 主播名
/// </summary>
public string anchor_name { get; set; }
/// <summary>
/// 主播图片
/// </summary>
public string anchor_img { get; set; }
}
}
using Mall.Common.AOP;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Entity.User
{
/// <summary>
/// 会员订阅消息实体表
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Member_Subscription
{
/// <summary>
/// 编号
/// </summary>
public int Id { get; set; }
/// <summary>
/// 会员id
/// </summary>
public int? UserId
{
get;
set;
}
/// <summary>
/// 订阅模板id
/// </summary>
public string TempleteId { get; set; }
/// <summary>
/// OpenId
/// </summary>
public string OpenId { get; set; }
/// <summary>
/// 类型 1赞羊
/// </summary>
public int? Type { get; set; }
/// <summary>
/// 删除
/// </summary>
public int Status { get; set; }
/// <summary>
/// 次数
/// </summary>
public int? Count { get; set; }
/// <summary>
/// 商户号id
/// </summary>
public int TenantId { get; set; }
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId { get; set; }
}
}
using Mall.Model.Entity.AppletWeChat;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Extend.AppletWeChat
{
public class RB_Live_House_Extend
{
/// <summary>
/// errcode = 0 代表成功;errcode = 1 代表未创建直播房间
/// </summary>
public string errcode { get; set; }
public string errmsg { get; set; }
public List<RB_Live_House> room_info { get; set; }
/// <summary>
/// 房间总数
/// </summary>
public string total { get; set; }
}
}
using Mall.Common.AOP;
using Mall.Model.Entity.User;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Extend.User
{
/// <summary>
/// 订阅消息扩展表
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Member_Subscription_Extend: RB_Member_Subscription
{
/// <summary>
/// 模板ids
/// </summary>
public List<string> TempleteIdList { get; set; }
}
}
......@@ -10,8 +10,6 @@
<ItemGroup>
<Folder Include="CacheEntity\" />
<Folder Include="Entity\AppletWeChat\" />
<Folder Include="Extend\AppletWeChat\" />
</ItemGroup>
<ItemGroup>
......
......@@ -191,23 +191,35 @@ namespace Mall.Module.MarketingCenter
{
id = model.ID;
flag = discountCouponRepository.Update(model, trans);
var listProduct = productRepository.GetCouponProductList(new RB_DiscountCoupon_Product { TenantId = model.TenantId, MallBaseId = model.MallBaseId, DiscountCouponId = id });
if (listProduct != null && listProduct.Any())
{
foreach (var item in model.ProductList)
{
IDictionary<string, object> fileds = new Dictionary<string, object>()
IDictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_DiscountCoupon_Product.Status),1},
{ nameof(RB_DiscountCoupon_Product.UpdateDate),model.UpdateDate},
};
IList<WhereHelper> whereHelpers = new List<WhereHelper>()
IList<WhereHelper> whereHelpers = new List<WhereHelper>()
{
new WhereHelper (){ FiledName=nameof(RB_DiscountCoupon_Product.ID),FiledValue=item.ID,OperatorEnum=OperatorEnum.Equal}
new WhereHelper (){ FiledName=nameof(RB_DiscountCoupon_Product.DiscountCouponId),FiledValue=id,OperatorEnum=OperatorEnum.Equal}
};
flag = productRepository.Update(fileds, whereHelpers, trans);
}
}
productRepository.Update(fileds, whereHelpers, trans);
////var listProduct = productRepository.GetCouponProductList(new RB_DiscountCoupon_Product { TenantId = model.TenantId, MallBaseId = model.MallBaseId, DiscountCouponId = id });
////if (listProduct != null && listProduct.Any())
////{
//// foreach (var item in listProduct)
//// {
//// IDictionary<string, object> fileds = new Dictionary<string, object>()
//// {
//// { nameof(RB_DiscountCoupon_Product.Status),1},
//// { nameof(RB_DiscountCoupon_Product.UpdateDate),model.UpdateDate},
//// };
//// IList<WhereHelper> whereHelpers = new List<WhereHelper>()
//// {
//// new WhereHelper (){ FiledName=nameof(RB_DiscountCoupon_Product.ID),FiledValue=item.ID,OperatorEnum=OperatorEnum.Equal}
//// };
//// flag = productRepository.Update(fileds, whereHelpers, trans);
//// }
////}
if (model.ProductList != null && model.ProductList.Any())
{
......
This diff is collapsed.
using Mall.Model.Entity.AppletWeChat;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Mall.Repository.AppletWeChat
{
/// <summary>
/// 直播房间仓储层
/// </summary>
public class RB_Live_HouseRepository : RepositoryBase<RB_Live_House>
{
/// <summary>
/// 表名称
/// </summary>
public string TableName { get { return nameof(RB_Live_House); } }
/// <summary>
/// 获取直播房间
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_Live_House> GetLiveHouseListRepository(RB_Live_House 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_Live_House.TenantId)}={query.TenantId}");
}
if (query.TenantId > 0)
{
builder.Append($" AND {nameof(RB_Live_House.MallBaseId)}={query.MallBaseId}");
}
}
return Get<RB_Live_House>(builder.ToString()).ToList();
}
/// <summary>
/// 获取直播房间
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_Live_House> GetLiveHousePageList(int pageIndex, int pageSize, out long rowCount, RB_Live_House 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_Live_House.TenantId)}={query.TenantId}");
}
if (query.TenantId > 0)
{
builder.Append($" AND {nameof(RB_Live_House.MallBaseId)}={query.MallBaseId}");
}
}
return GetPage<RB_Live_House>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList();
}
}
}
......@@ -21,8 +21,4 @@
<ProjectReference Include="..\Mall.Model\Mall.Model.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="AppletWeChat\" />
</ItemGroup>
</Project>
using Mall.Model.Entity.User;
using Mall.Model.Extend.User;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Mall.Repository.User
{
/// <summary>
/// 会员订阅微信消息仓储层
/// </summary>
public class RB_Member_SubscriptionRepository : RepositoryBase<RB_Member_Subscription>
{
/// <summary>
/// 表名称
/// </summary>
public string TableName { get { return nameof(RB_Member_Subscription); } }
/// <summary>
/// 获取列表
/// </summary>
/// <param name="where"></param>
/// <returns></returns>
public List<RB_Member_Subscription_Extend> GetList(RB_Member_Subscription_Extend where)
{
StringBuilder sb = new StringBuilder();
sb.Append($@"SELECT * from {TableName} where Status=0");
if (where != null)
{
if (where.MallBaseId > 0)
{
sb.AppendFormat(" and MallBaseId={0}", where.MallBaseId);
}
if (where.TenantId > 0)
{
sb.AppendFormat(" and TenantId={0}", where.TenantId);
}
if (where.UserId > 0)
{
sb.AppendFormat(" and UserId={0}", where.UserId);
}
if (where.Type > 0)
{
sb.AppendFormat(" and Type={0}", where.Type);
}
if (!string.IsNullOrEmpty(where.TempleteId))
{
sb.AppendFormat(" and TempleteId ='{0}'", where.TempleteId);
}
if (!string.IsNullOrEmpty(where.OpenId))
{
sb.AppendFormat(" and OpenId ='{0}'", where.OpenId);
}
}
return Get<RB_Member_Subscription_Extend>(sb.ToString()).ToList();
}
}
}
......@@ -8,4 +8,9 @@
<TimeStampOfAssociatedLegacyPublishXmlFile />
<_PublishTargetUrl>F:\网站发布\Mall.oytour.com</_PublishTargetUrl>
</PropertyGroup>
<ItemGroup>
<File Include="run.cmd">
<publishTime>04/22/2020 10:26:33</publishTime>
</File>
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -22,7 +22,8 @@
"Mongo": "mongodb://192.168.2.214:27017",
"MongoDBName": "Mall",
"ProjectUrl": "D:/project/GitProject/tripfriend",
"DeveloperKitsPort": "54333",
"DeveloperKitsPort": "63994",
"FirstPage": "pages/index/index.html",
"RedisSetting": {
"RedisServer": "192.168.2.214",
"RedisPort": "6379",
......
......@@ -5,9 +5,11 @@
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath=".\Mall.WebApi.exe" arguments=".\Mall.WebApi.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="OutOfProcess">
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess">
<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
<environmentVariable name="ASPNETCORE_HTTPS_PORT" value="44370" />
<environmentVariable name="COMPLUS_ForceENC" value="1" />
</environmentVariables>
</aspNetCore>
</system.webServer>
......
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