Commit 88c46d40 by guanzhenshan

增加生成统计sku利润服务

parent 547222fd
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Dapper" Version="1.60.6" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="2.2.0" />
<PackageReference Include="MySql.Data" Version="8.0.16" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Bailun.DC.Common\Bailun.DC.Common.csproj" />
<ProjectReference Include="..\Bailun.DC.DB\Bailun.DC.DB.csproj" />
<ProjectReference Include="..\Bailun.DC.Models\Bailun.DC.Models.csproj" />
</ItemGroup>
</Project>
FROM microsoft/dotnet:2.1-runtime AS base
WORKDIR /app
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY Bailun.DC.SkuProfitService/Bailun.DC.SkuProfitService.csproj Bailun.DC.SkuProfitService/
COPY Bailun.DC.Common/Bailun.DC.Common.csproj Bailun.DC.Common/
COPY Bailun.DC.DB/Bailun.DC.DB.csproj Bailun.DC.DB/
COPY Bailun.DC.Models/Bailun.DC.Models.csproj Bailun.DC.Models/
RUN dotnet restore Bailun.DC.SkuProfitService/Bailun.DC.SkuProfitService.csproj
COPY . .
WORKDIR /src/Bailun.DC.SkuProfitService
RUN dotnet build Bailun.DC.SkuProfitService.csproj -c Release -o /app
FROM build AS publish
RUN dotnet publish Bailun.DC.SkuProfitService.csproj -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "Bailun.DC.SkuProfitService.dll"]
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.SkuProfitService.Models
{
/// <summary>
/// 入库数量
/// </summary>
public class mPutIn
{
public string bailun_sku { get; set; }
public string warehouse_code { get; set; }
public int count { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.SkuProfitService.Models
{
/// <summary>
/// sku信息
/// </summary>
public class mSkuBase
{
public string bailun_sku { get; set; }
public int category_id { get; set; }
public string category_name { get; set; }
public decimal unit_price { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.SkuProfitService.Models
{
public class mSkuWarehouse
{
/// <summary>
/// Sku
/// </summary>
public string bailun_sku { get; set; }
/// <summary>
/// 仓库编码
/// </summary>
public string warehouse_code { get; set; }
/// <summary>
/// 仓库名称
/// </summary>
public string warehouse_name { get; set; }
/// <summary>
/// 销售数量
/// </summary>
public int count { get; set; }
/// <summary>
/// 销售金额
/// </summary>
public decimal amount { get; set; }
/// <summary>
/// 利润 (毛利)
/// </summary>
public decimal profit_total { get; set; }
/// <summary>
/// 采购价格
/// </summary>
public decimal unit_price { get; set; }
/// <summary>
/// 分类id
/// </summary>
public int category_id { get; set; }
/// <summary>
/// 分类名称
/// </summary>
public string category_name { get; set; }
/// <summary>
/// 可用库存
/// </summary>
public int usable_stock { get; set; }
/// <summary>
/// 采购在途
/// </summary>
public int quantity_purchase { get; set; }
/// <summary>
/// 调拨在途
/// </summary>
public int quantity_transfer { get; set; }
/// <summary>
/// sku中文标题
/// </summary>
public string sku_title_cn { get; set; }
}
}
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System;
using System.Threading.Tasks;
namespace Bailun.DC.SkuProfitService
{
class Program
{
static async Task Main(string[] args)
{
Console.WriteLine("启动服务 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
{
services.AddHostedService<Services>();
});
await builder.RunConsoleAsync();
}
//static void Main(string[] args)
//{
// Console.WriteLine("启动服务 "+DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
// var _service = new Services();
// _service.Save();
//}
}
}
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