Browse Source

新增实体

yijia
shanji 2 years ago
parent
commit
81e3724d2a
  1. 39
      BBWYB.Server.Model/Db/Product/Skuoptimizationhistory.cs
  2. 74
      BBWYB.Server.Model/Db/Product/Skutotalsaleinfo.cs
  3. 2
      WebTest/WebTest.csproj
  4. 21
      WebTest/WebView2Manager.cs

39
BBWYB.Server.Model/Db/Product/Skuoptimizationhistory.cs

@ -0,0 +1,39 @@
using FreeSql.DataAnnotations;
namespace BBWYB.Server.Model.Db
{
/// <summary>
/// Sku历史优化表
/// </summary>
[Table(Name = "skuoptimizationhistory", DisableSyncStructure = true)]
public partial class SkuOptimizationHistory
{
[Column(DbType = "bigint", IsPrimary = true)]
public long Id { get; set; }
/// <summary>
/// 优化时间
/// </summary>
[Column(DbType = "datetime")]
public DateTime? CreateTime { get; set; }
/// <summary>
/// 优化率
/// </summary>
[Column(DbType = "decimal(18,2)")]
public decimal? OptimizationRatio { get; set; }
[Column(StringLength = 50)]
public string ProductId { get; set; }
[Column(DbType = "bigint")]
public long? ShopId { get; set; }
[Column(StringLength = 50)]
public string SkuId { get; set; }
}
}

74
BBWYB.Server.Model/Db/Product/Skutotalsaleinfo.cs

@ -0,0 +1,74 @@
using FreeSql.DatabaseModel;
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;
namespace BBWYB.Server.Model.Db
{
/// <summary>
/// Sku总销量表
/// </summary>
[Table(Name = "skutotalsaleinfo", DisableSyncStructure = true)]
public partial class SkuTotalSaleInfo
{
/// <summary>
/// Sku
/// </summary>
[Column(StringLength = 50, IsPrimary = true, IsNullable = false)]
public string SkuId { get; set; }
[Column(DbType = "datetime")]
public DateTime? CreateTime { get; set; }
/// <summary>
/// 是否有效
/// </summary>
public bool? IsEnabled { get; set; } = false;
/// <summary>
/// 是否需要议价
/// </summary>
public bool? IsNeedOptimization { get; set; } = false;
/// <summary>
/// 销量,销售件数
/// </summary>
[Column(DbType = "bigint")]
public long? ItemCount { get; set; }
/// <summary>
/// 上次优化时的销量
/// </summary>
[Column(DbType = "bigint")]
public long? LastOptimizationItemCount { get; set; }
/// <summary>
/// 上次优化时间
/// </summary>
[Column(DbType = "datetime")]
public DateTime? LastOptimizationTime { get; set; }
/// <summary>
/// Spu
/// </summary>
[Column(StringLength = 50)]
public string ProductId { get; set; }
[Column(DbType = "bigint")]
public long? ShopId { get; set; }
[Column(DbType = "datetime")]
public DateTime? UpdateTime { get; set; }
}
}

2
WebTest/WebTest.csproj

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>

21
WebTest/WebView2Manager.cs

@ -46,9 +46,28 @@ namespace WebTest
OnNavigationCompleted?.Invoke(e);
}
private void Wb2_CoreWebView2InitializationCompleted(object sender, CoreWebView2InitializationCompletedEventArgs e)
private async void Wb2_CoreWebView2InitializationCompleted(object sender, CoreWebView2InitializationCompletedEventArgs e)
{
wb2.CoreWebView2.AddWebResourceRequestedFilter("*", CoreWebView2WebResourceContext.All);
wb2.CoreWebView2.WebResourceRequested += CoreWebView2_WebResourceRequested;
//Mozilla/5.0 (Linux; Android 11; M2006J10C Build/RP1A.200720.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 Mobile Safari/537.36 T7/13.8 SP-engine/2.46.0 baiduboxapp/13.8.1.10 (Baidu; P1 11) NABar/1.0 Edg/117.0.0.0
//Mozilla/5.0 (Linux; Android 12; PEDM00 Build/SKQ1.210216.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 Mobile Safari/537.36 T7/12.29 SP-engine/2.38.0 other/12.29.5.10 (Baidu; P1 12) NABar/1.0
var platform = "Android";
var userAgent = "Mozilla/5.0 (Linux; Android 12; PEDM00 Build/SKQ1.210216.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 Mobile Safari/537.36 T7/12.29 SP-engine/2.38.0 other/12.29.5.10 (Baidu; P1 12) NABar/1.0";
await wb2.CoreWebView2.AddScriptToExecuteOnDocumentCreatedAsync(
"(() => {" +
$"const platform = \"{platform}\";" +
$"const userAgent = \"{userAgent}\";" +
"if (platform || userAgent) {" +
"const navigator = window.navigator;" +
"if (platform) Object.defineProperty(navigator, \"platform\", { value: platform, configurable: false, enumerable: true, writable: false });" +
"if (userAgent) Object.defineProperty(navigator, \"userAgent\", { value: userAgent, configurable: false, enumerable: true, writable: false });" +
"}" +
"})();");
CoreWebView2InitializationCompleted?.Invoke(e);
IsInitializationCompleted = true;
}

Loading…
Cancel
Save