Commit 1e02022c by 泽锋 李

fix

parent 5267f74e
...@@ -103,14 +103,14 @@ namespace AutoTurnOver.DB ...@@ -103,14 +103,14 @@ namespace AutoTurnOver.DB
List<auto_first_order_detailed_dto> data_detailed_list = new List<auto_first_order_detailed_dto>(); List<auto_first_order_detailed_dto> data_detailed_list = new List<auto_first_order_detailed_dto>();
if (item_rule.lower_limit_sku_count > 0 && itemGroup.Count() < item_rule.lower_limit_sku_count) if (item_rule.lower_limit_sku_count > 0 && itemGroup.Count() > item_rule.lower_limit_sku_count)
{ {
throw new Exception($" sku数量不超过 {item_rule.lower_limit_sku_count} 个 "); throw new Exception($" sku数量不应该超过 {item_rule.lower_limit_sku_count} 个 ");
} }
if (item_rule.lower_limit_sales > 0 && itemGroup.Max(v => v.product_sales) < item_rule.lower_limit_sales) if (item_rule.lower_limit_sales > 0 && itemGroup.Max(v => v.product_sales) < item_rule.lower_limit_sales)
{ {
throw new Exception($" 商品日均不超过 {item_rule.lower_limit_sales} 个 "); throw new Exception($" 商品日均不应该低于 {item_rule.lower_limit_sales} 个 ");
} }
// 固定数量 // 固定数量
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Baidu.AI" Version="3.6.14" />
<PackageReference Include="Bailun.ServiceFabric.Redis" Version="1.0.1" /> <PackageReference Include="Bailun.ServiceFabric.Redis" Version="1.0.1" />
<PackageReference Include="EPPlus.Core" Version="1.5.4" /> <PackageReference Include="EPPlus.Core" Version="1.5.4" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.1.1" /> <PackageReference Include="Microsoft.Extensions.Configuration" Version="2.1.1" />
......
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace AutoTurnOver.Utility
{
public class ImagerHelper
{
public static void BodySegDemo()
{
var APP_ID = "19939161";
var API_KEY = "HneGLpXGAT1mFcw1VG4SwG9D";
var SECRET_KEY = "IXfbEm2XqSgoXXf0t6dxUZbPunnQ5SyG";
var client = new Baidu.Aip.BodyAnalysis.Body(API_KEY, SECRET_KEY);
client.Timeout = 60000; // 修改超时时间
var image = File.ReadAllBytes(@"C:\Users\lizefeng\Desktop\GLUS~)30MWMOK0{M8}8C[{R.jpg");
// 调用人像分割,可能会抛出网络等异常,请使用try/catch捕获
var result = client.BodySeg(image);
Console.WriteLine(result);
// 如果有可选参数
var options = new Dictionary<string, object>{
{"type", "foreground"}
};
// 带参数调用人像分割
result = client.BodySeg(image, options);
Console.WriteLine(result);
}
}
}
using AutoTurnOver.DB; using AutoTurnOver.DB;
using AutoTurnOver.Services; using AutoTurnOver.Services;
using AutoTurnOver.Utility;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using System; using System;
......
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