From f16d0987bde5e22ecf444da0c64fd2eec8977188 Mon Sep 17 00:00:00 2001 From: sanji Date: Wed, 1 Nov 2023 16:08:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5jdxx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SiNan.API/Program.cs | 4 +- SiNan.API/appsettings.json | 3 +- SiNan.Business/FreeSqlMultiDBManager.cs | 2 + SiNan.Model/Db/JDXX/Skus.cs | 452 ++++++++++++++++++++++++ SiNan.Model/Db/JDXX/__razor.cshtml.txt | 67 ++++ SiNan.Model/Db/JDXX/__重新生成.bat | 2 + SiNan.Model/SiNan.Model.csproj | 5 + 7 files changed, 533 insertions(+), 2 deletions(-) create mode 100644 SiNan.Model/Db/JDXX/Skus.cs create mode 100644 SiNan.Model/Db/JDXX/__razor.cshtml.txt create mode 100644 SiNan.Model/Db/JDXX/__重新生成.bat diff --git a/SiNan.API/Program.cs b/SiNan.API/Program.cs index c9a12c9..1e1f404 100644 --- a/SiNan.API/Program.cs +++ b/SiNan.API/Program.cs @@ -25,11 +25,13 @@ services.AddSingleton(typeof(IIdGenerator), idGenerator); var fsql = new FreeSql.FreeSqlBuilder().UseConnectionString(FreeSql.DataType.MySql, configuration.GetConnectionString("BBWYCDB")).Build(); services.AddSingleton(typeof(IFreeSql), fsql); var fsql2 = new FreeSql.FreeSqlBuilder().UseConnectionString(FreeSql.DataType.MySql, configuration.GetConnectionString("MDSDB")).Build(); +var fsql3 = new FreeSql.FreeSqlBuilder().UseConnectionString(FreeSql.DataType.MySql, configuration.GetConnectionString("XXDB")).Build(); services.AddSingleton(new FreeSqlMultiDBManager() { MDSfsql = fsql2, - BBWYCfsql = fsql + BBWYCfsql = fsql, + XXfsql = fsql3 }); services.AddSingleton(); diff --git a/SiNan.API/appsettings.json b/SiNan.API/appsettings.json index bda8420..5306809 100644 --- a/SiNan.API/appsettings.json +++ b/SiNan.API/appsettings.json @@ -10,6 +10,7 @@ "ConnectionStrings": { //"DB": "data source=rm-bp1508okrh23710yfao.mysql.rds.aliyuncs.com;port=3306;user id=qyroot;password=kaicn1132+-;initial catalog=bbwy;charset=utf8;sslmode=none;" "BBWYCDB": "data source=rm-bp1508okrh23710yfao.mysql.rds.aliyuncs.com;port=3306;user id=qyroot;password=kaicn1132+-;initial catalog=bbwy_test;charset=utf8;sslmode=none;", - "MDSDB": "data source=rm-bp1508okrh23710yfao.mysql.rds.aliyuncs.com;port=3306;user id=qyroot;password=kaicn1132+-;initial catalog=mds;charset=utf8;sslmode=none;" + "MDSDB": "data source=rm-bp1508okrh23710yfao.mysql.rds.aliyuncs.com;port=3306;user id=qyroot;password=kaicn1132+-;initial catalog=mds;charset=utf8;sslmode=none;", + "XXDB": "data source=rm-bp1508okrh23710yfao.mysql.rds.aliyuncs.com;user id=qyroot;password=kaicn1132+-;initial catalog=jdxx;charset=utf8;sslmode=none;" } } diff --git a/SiNan.Business/FreeSqlMultiDBManager.cs b/SiNan.Business/FreeSqlMultiDBManager.cs index 4689284..d0cfc3b 100644 --- a/SiNan.Business/FreeSqlMultiDBManager.cs +++ b/SiNan.Business/FreeSqlMultiDBManager.cs @@ -7,5 +7,7 @@ public IFreeSql MDSfsql { get; set; } public IFreeSql BBWYCfsql { get; set; } + + public IFreeSql XXfsql { get; set; } } } diff --git a/SiNan.Model/Db/JDXX/Skus.cs b/SiNan.Model/Db/JDXX/Skus.cs new file mode 100644 index 0000000..25a956e --- /dev/null +++ b/SiNan.Model/Db/JDXX/Skus.cs @@ -0,0 +1,452 @@ +using FreeSql.DataAnnotations; + +namespace SiNan.Server.Model.Db +{ + + /// + /// sku表 + /// + [ Table(Name = "skus", DisableSyncStructure = true)] + public partial class Skus { + + /// + /// Id + /// + [Column(StringLength = 50, IsPrimary = true, IsNullable = false)] + public string Id { get; set; } + + /// + /// 加购物车数量 + /// + [Column(DbType = "int")] + public int? AddCardCount { get; set; } + + /// + /// 加购人数 + /// + [Column(DbType = "int")] + public int? AddCardMember { get; set; } + + /// + /// 加购率 + /// + [Column(DbType = "decimal(11,2)")] + public decimal? AddCardRate { get; set; } + + /// + /// 点击次数 + /// + [Column(DbType = "int")] + public int? ClickCount { get; set; } + + /// + /// 点击率 + /// + [Column(DbType = "decimal(11,2)")] + public decimal? ClickRate { get; set; } + + /// + /// 栏目订单 + /// + [Column(DbType = "int")] + public int? ColumnOrder { get; set; } + + /// + /// 转化率 + /// + [Column(DbType = "decimal(11,2)")] + public decimal? ConversionRate { get; set; } + + /// + /// 收费流量 + /// + [Column(DbType = "int")] + public int? CostUv { get; set; } + + /// + /// 创建时间 + /// + [Column(DbType = "datetime")] + public DateTime CreateTime { get; set; } + + /// + /// 创建人Id + /// + [Column(StringLength = 50)] + public string CreatorId { get; set; } + + /// + /// 创建人 + /// + [Column(StringLength = 50, IsNullable = false)] + public string CreatorRealName { get; set; } + + /// + /// 盈亏小节 + /// + [Column(DbType = "decimal(19,4)")] + public decimal? EarningsPrice { get; set; } + + /// + /// 曝光量 + /// + [Column(DbType = "int")] + public int? Exposure { get; set; } + + /// + /// 快车点击率 + /// + [Column(DbType = "decimal(11,2)")] + public decimal? ExposureClickRate { get; set; } + + /// + /// 快车点击 + /// + [Column(DbType = "int")] + public int? ExpressClick { get; set; } + + /// + /// 快车花费 + /// + [Column(DbType = "decimal(19,4)")] + public decimal? ExpressCost { get; set; } + + /// + /// 快车展现 + /// + + public decimal? ExpressExposure { get; set; } + + /// + /// 快车订单 + /// + [Column(DbType = "int")] + public int? ExpressOrder { get; set; } + + /// + /// 快车成交额 + /// + [Column(DbType = "decimal(19,4)")] + public decimal? ExpressPayPrice { get; set; } + + /// + /// 快车人均点击 + /// + [Column(DbType = "decimal(11,4)")] + public decimal? ExpressPeopleClick { get; set; } + + /// + /// 快车访客 + /// + [Column(DbType = "int")] + public int? ExpressUv { get; set; } + + /// + /// 免费订单 + /// + [Column(DbType = "int")] + public int? FreeOrder { get; set; } + + /// + /// 免费成交额 + /// + [Column(DbType = "decimal(19,4)")] + public decimal? FreePayPrice { get; set; } + + /// + /// 免费流量 + /// + [Column(DbType = "int")] + public int? FreeUv { get; set; } + + /// + /// 首页访客 + /// + [Column(DbType = "int")] + public int? IndexUv { get; set; } + + /// + /// 是否收藏 + /// + [Column(DbType = "tinyint")] + public sbyte? IsStar { get; set; } + + /// + /// 新品交易榜单 + /// + [Column(DbType = "int")] + public int? NewSaleTopIndex { get; set; } + + /// + /// 新品人气榜单 + /// + [Column(DbType = "int")] + public int? NewUvTopIndex { get; set; } + + /// + /// 一级类目 + /// + [Column(StringLength = 50)] + public string OneCatId { get; set; } + + /// + /// 其他订单 + /// + [Column(DbType = "int")] + public int? OtherOrder { get; set; } + + /// + /// 其他成交额 + /// + [Column(DbType = "decimal(19,4)")] + public decimal? OtherPrice { get; set; } + + /// + /// 其他访客 + /// + [Column(DbType = "int")] + public int? OtherUv { get; set; } + + /// + /// 流量路径 + /// + [Column(StringLength = -2)] + public string PathList { get; set; } + + /// + /// 下单商品件数 + /// + [Column(DbType = "int")] + public int? PayItemCount { get; set; } + + /// + /// 下单客户数 + /// + [Column(DbType = "int")] + public int? PayMember { get; set; } + + /// + /// 下单数 + /// + [Column(DbType = "int")] + public int? PayOrder { get; set; } + + /// + /// 下单金额 + /// + [Column(DbType = "decimal(19,4)")] + public decimal? PayPrice { get; set; } + + /// + /// 下单转化率 + /// + [Column(DbType = "decimal(11,2)")] + public decimal? PayRate { get; set; } + + /// + /// 毛利 + /// + [Column(DbType = "decimal(19,4)")] + public decimal? Profits { get; set; } + + /// + /// 流量 + /// + [Column(DbType = "int")] + public int? Pv { get; set; } + + /// + /// 真实转化率 + /// + [Column(DbType = "decimal(11,2)")] + public decimal? RealConversionRate { get; set; } + + /// + /// 真实成交额 + /// + [Column(DbType = "decimal(19,4)")] + public decimal? RealPrice { get; set; } + + /// + /// 成交客户数 + /// + [Column(DbType = "int")] + public int? SaleMember { get; set; } + + /// + /// 成交金额 + /// + [Column(DbType = "decimal(19,4)")] + public decimal? SalePrice { get; set; } + + /// + /// 成交转化率 + /// + [Column(DbType = "decimal(11,2)")] + public decimal? SaleRate { get; set; } + + /// + /// 成交件数 + /// + [Column(DbType = "int")] + public int? Sales { get; set; } + + /// + /// 交易榜单排名 + /// + [Column(DbType = "int")] + public int? SaleTopIndex { get; set; } + + /// + /// 风向标 + /// + [Column(DbType = "decimal(11,2)")] + public decimal? ScoreRank { get; set; } + + /// + /// 刷单花费 + /// + [Column(DbType = "decimal(19,4)")] + public decimal? SdCost { get; set; } + + /// + /// 刷单单量 + /// + [Column(DbType = "int")] + public int? SdOrder { get; set; } + + /// + /// 刷单成交额 + /// + [Column(DbType = "decimal(19,4)")] + public decimal? SdPrice { get; set; } + + /// + /// 搜索访客 + /// + [Column(DbType = "int")] + public int? SearchUv { get; set; } + + /// + /// 二级类目 + /// + [Column(StringLength = 50)] + public string SecondCatId { get; set; } + + /// + /// 自主订单 + /// + [Column(DbType = "int")] + public int? SelfOrder { get; set; } + + /// + /// 店铺Id + /// + [Column(StringLength = 50)] + public string ShopsId { get; set; } + + /// + /// 海投点击 + /// + [Column(DbType = "int")] + public int? ShotgunClick { get; set; } + + /// + /// 海投点击率 + /// + [Column(DbType = "decimal(11,2)")] + public decimal? ShotgunClickRate { get; set; } + + /// + /// 海投花费 + /// + [Column(DbType = "decimal(19,4)")] + public decimal? ShotgunCost { get; set; } + + /// + /// 海投展现 + /// + [Column(DbType = "decimal(11,2)")] + public decimal? ShotgunExposure { get; set; } + + /// + /// 海投订单 + /// + [Column(DbType = "int")] + public int? ShotgunOrder { get; set; } + + /// + /// 海投成交额 + /// + [Column(DbType = "decimal(19,4)")] + public decimal? ShotgunPayPrice { get; set; } + + /// + /// 海投人均点击 + /// + [Column(DbType = "decimal(11,4)")] + public decimal? ShotgunPeopleClick { get; set; } + + /// + /// 海投访客 + /// + [Column(DbType = "int")] + public int? ShotgunUv { get; set; } + + /// + /// sku + /// + [Column(StringLength = 50)] + public string Sku { get; set; } + + /// + /// Spu + /// + [Column(StringLength = 50)] + public string Spu { get; set; } + + /// + /// SpuId + /// + [Column(StringLength = 50)] + public string SpusId { get; set; } + + /// + /// 推荐访客 + /// + [Column(DbType = "int")] + public int? StarUv { get; set; } + + /// + /// 三级类目 + /// + [Column(StringLength = 50)] + public string ThirdCatId { get; set; } + + /// + /// 标题 + /// + [Column(StringLength = -1)] + public string Title { get; set; } + + /// + /// 总花费 + /// + [Column(DbType = "decimal(19,4)")] + public decimal? TotalCost { get; set; } + + /// + /// 访客 + /// + [Column(DbType = "int")] + public int? Uv { get; set; } + + /// + /// 人气榜单排名 + /// + [Column(DbType = "int")] + public int? UvTopIndex { get; set; } + + } + +} diff --git a/SiNan.Model/Db/JDXX/__razor.cshtml.txt b/SiNan.Model/Db/JDXX/__razor.cshtml.txt new file mode 100644 index 0000000..8997b3b --- /dev/null +++ b/SiNan.Model/Db/JDXX/__razor.cshtml.txt @@ -0,0 +1,67 @@ +using FreeSql.DatabaseModel;@{ +var gen = Model as RazorModel; + +Func GetAttributeString = attr => { + if (string.IsNullOrEmpty(attr)) return ""; + return string.Concat(", ", attr.Trim('[', ']')); +}; +Func GetDefaultValue = defval => { + if (string.IsNullOrEmpty(defval)) return ""; + return " = " + defval + ";"; +}; +}@{ +switch (gen.fsql.Ado.DataType) { + case FreeSql.DataType.PostgreSQL: +@:using System; +@:using System.Collections; +@:using System.Collections.Generic; +@:using System.Linq; +@:using System.Reflection; +@:using System.Threading.Tasks; +@:using Newtonsoft.Json; +@:using FreeSql.DataAnnotations; +@:using System.Net; +@:using Newtonsoft.Json.Linq; +@:using System.Net.NetworkInformation; +@:using NpgsqlTypes; +@:using Npgsql.LegacyPostgis; + break; + case FreeSql.DataType.SqlServer: + case FreeSql.DataType.MySql: + default: +@:using System; +@:using System.Collections; +@:using System.Collections.Generic; +@:using System.Linq; +@:using System.Reflection; +@:using System.Threading.Tasks; +@:using Newtonsoft.Json; +@:using FreeSql.DataAnnotations; + break; +} +} + +namespace @gen.NameSpace { + +@if (string.IsNullOrEmpty(gen.table.Comment) == false) { + @:/// + @:/// @gen.table.Comment.Replace("\r\n", "\n").Replace("\n", "\r\n /// ") + @:/// +} + [JsonObject(MemberSerialization.OptIn)@GetAttributeString(gen.GetTableAttribute())] + public partial class @gen.GetCsName(gen.FullTableName) { + + @foreach (var col in gen.columns) { + + if (string.IsNullOrEmpty(col.Comment) == false) { + @:/// + @:/// @col.Comment.Replace("\r\n", "\n").Replace("\n", "\r\n /// ") + @:/// + } + @:@("[JsonProperty" + GetAttributeString(gen.GetColumnAttribute(col, true)) + "]") + @:public @gen.GetCsType(col) @gen.GetCsName(col.Name) { get; set; }@GetDefaultValue(gen.GetColumnDefaultValue(col, false)) +@: + } + } +@gen.GetMySqlEnumSetDefine() +} \ No newline at end of file diff --git a/SiNan.Model/Db/JDXX/__重新生成.bat b/SiNan.Model/Db/JDXX/__重新生成.bat new file mode 100644 index 0000000..7df5a50 --- /dev/null +++ b/SiNan.Model/Db/JDXX/__重新生成.bat @@ -0,0 +1,2 @@ + +FreeSql.Generator -Razor "__razor.cshtml.txt" -NameOptions 1,0,0,0 -NameSpace SiNan.Server.Model.Db -DB "MySql,data source=rm-bp1508okrh23710yfao.mysql.rds.aliyuncs.com;user id=qyroot;password=kaicn1132+-;initial catalog=jdxx;charset=utf8;sslmode=none;" -FileName "{name}.cs" diff --git a/SiNan.Model/SiNan.Model.csproj b/SiNan.Model/SiNan.Model.csproj index 3c3d390..7620268 100644 --- a/SiNan.Model/SiNan.Model.csproj +++ b/SiNan.Model/SiNan.Model.csproj @@ -16,4 +16,9 @@ + + + + +