Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DataCenter_Core2.1_20190520
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bltdc
DataCenter_Core2.1_20190520
Commits
17169819
Commit
17169819
authored
Sep 14, 2021
by
zhoujinhui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
up
parent
03100caf
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
257 additions
and
6 deletions
+257
-6
Bailun.DC.SyncMonthStockWeighting.csproj
...thStockWeighting/Bailun.DC.SyncMonthStockWeighting.csproj
+22
-0
Dockerfile
Bailun.DC.SyncMonthStockWeighting/Dockerfile
+21
-0
WMSDataResponseDto.cs
...un.DC.SyncMonthStockWeighting/Model/WMSDataResponseDto.cs
+27
-0
WMSRequestDto.cs
Bailun.DC.SyncMonthStockWeighting/Model/WMSRequestDto.cs
+68
-0
Program.cs
Bailun.DC.SyncMonthStockWeighting/Program.cs
+21
-0
SyncMonthStockWeightingServices.cs
...yncMonthStockWeighting/SyncMonthStockWeightingServices.cs
+26
-0
SyncWmsStockFlowServices.cs
...un.DC.SyncMonthStockWeighting/SyncWmsStockFlowServices.cs
+66
-0
Bailun.DC.sln
Bailun.DC.sln
+6
-6
No files found.
Bailun.DC.SyncMonthStockWeighting/Bailun.DC.SyncMonthStockWeighting.csproj
0 → 100644
View file @
17169819
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="2.1.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Bailun.DC.Services\Bailun.DC.Services.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="Dockerfile">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
Bailun.DC.SyncMonthStockWeighting/Dockerfile
0 → 100644
View file @
17169819
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.SyncMonthStockWeighting/Bailun.DC.SyncMonthStockWeighting.csproj Bailun.DC.SyncMonthStockWeighting/
COPY
Bailun.DC.Services/Bailun.DC.Services.csproj Bailun.DC.Services/
COPY
Bailun.DC.Common/Bailun.DC.Common.csproj Bailun.DC.Common/
RUN
dotnet restore Bailun.DC.SyncMonthStockWeighting/Bailun.DC.SyncMonthStockWeighting.csproj
COPY
. .
WORKDIR
/src/Bailun.DC.SyncMonthStockWeighting
RUN
dotnet build Bailun.DC.SyncMonthStockWeighting.csproj
-c
Release
-o
/app
FROM
build AS publish
RUN
dotnet publish Bailun.DC.SyncMonthStockWeighting.csproj
-c
Release
-o
/app
FROM
base AS final
WORKDIR
/app
COPY
--from=publish /app .
ENTRYPOINT
["dotnet", "Bailun.DC.SyncMonthStockWeighting.dll"]
Bailun.DC.SyncMonthStockWeighting/Model/WMSDataResponseDto.cs
0 → 100644
View file @
17169819
using
Bailun.DC.Models.Dtos.Stock
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Bailun.DC.SyncMonthStockWeighting.Model
{
public
class
WMSDataResponseDto
{
/// <summary>
/// 指示是否成功
/// </summary>
public
bool
IsSuccess
{
get
;
set
;
}
/// <summary>
/// 消息
/// </summary>
public
string
Message
{
get
;
set
;
}
public
ProductStockFlowPagesOutputDto
Data
{
get
;
set
;
}
}
public
class
ProductStockFlowPagesOutputDto
{
public
List
<
ProductStockFlowApiResponseDto
>
Items
{
get
;
set
;
}
}
}
Bailun.DC.SyncMonthStockWeighting/Model/WMSRequestDto.cs
0 → 100644
View file @
17169819
using
Bailun.DC.Models.Stock
;
namespace
Bailun.DC.SyncMonthStockWeighting.Model
{
public
class
WMSRequestDto
{
/// <summary>
///
/// </summary>
public
ProductStockFlowPagesInputDto
Data
{
get
;
set
;
}
}
public
class
ProductStockFlowPagesInputDto
{
/// <summary>
/// 交易流水号
/// </summary>
public
string
SysSerialNumber
{
get
;
set
;
}
/// <summary>
/// 产品sku
/// </summary>
public
string
Sku
{
get
;
set
;
}
/// <summary>
/// 仓库编码
/// </summary>
public
string
WarehouseCode
{
get
;
set
;
}
/// <summary>
/// 第三方单号
/// </summary>
public
string
ThirdSysOrderNo
{
get
;
set
;
}
/// <summary>
/// 第三方单号类型
/// </summary>
public
ThirdSysOrderType
?
ThirdSysOrderType
{
get
;
set
;
}
/// <summary>
/// 第三方单创建时间
/// </summary>
public
string
[]
OrderCreationTimes
{
get
;
set
;
}
/// <summary>
/// 交易流水记录生成时间
/// </summary>
public
string
[]
CreationTimes
{
get
;
set
;
}
/// <summary>
/// 分页信息
/// </summary>
public
Pagination
Page
{
get
;
set
;
}
}
public
class
Pagination
{
/// <summary>
///
/// </summary>
public
int
Page
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
int
Rows
{
get
;
set
;
}
}
}
Bailun.DC.SyncMonthStockWeighting/Program.cs
0 → 100644
View file @
17169819
using
Microsoft.Extensions.DependencyInjection
;
using
Microsoft.Extensions.Hosting
;
using
System
;
using
System.Threading.Tasks
;
namespace
Bailun.DC.SyncMonthStockWeighting
{
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
<
SyncMonthStockWeightingServices
>();
services
.
AddHostedService
<
SyncWmsStockFlowServices
>();
});
await
builder
.
RunConsoleAsync
();
}
}
}
Bailun.DC.SyncMonthStockWeighting/SyncMonthStockWeightingServices.cs
0 → 100644
View file @
17169819
using
Bailun.DC.Services.WebApiService
;
using
Microsoft.Extensions.Hosting
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
Bailun.DC.SyncMonthStockWeighting
{
public
class
SyncMonthStockWeightingServices
:
BackgroundService
{
private
Timer
_timer
;
protected
override
Task
ExecuteAsync
(
CancellationToken
stoppingToken
)
{
_timer
=
new
Timer
(
DoWork
,
null
,
TimeSpan
.
Zero
,
TimeSpan
.
FromMinutes
(
1
));
new
FinanceService
().
SynchMonthStockWeighting
();
return
Task
.
CompletedTask
;
}
private
void
DoWork
(
object
state
)
{
}
}
}
Bailun.DC.SyncMonthStockWeighting/SyncWmsStockFlowServices.cs
0 → 100644
View file @
17169819
using
Bailun.DC.Models.Stock
;
using
Bailun.DC.Services
;
using
Bailun.DC.SyncMonthStockWeighting.Model
;
using
Microsoft.Extensions.Hosting
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
static
Bailun
.
DC
.
Common
.
HttpHelper
;
namespace
Bailun.DC.SyncMonthStockWeighting
{
public
class
SyncWmsStockFlowServices
:
BackgroundService
{
private
Timer
_timer
;
protected
override
Task
ExecuteAsync
(
CancellationToken
stoppingToken
)
{
_timer
=
new
Timer
(
DoWork
,
null
,
TimeSpan
.
Zero
,
TimeSpan
.
FromMinutes
(
1
));
return
Task
.
CompletedTask
;
}
private
void
DoWork
(
object
state
)
{
var
now
=
DateTime
.
Now
;
if
(
now
.
Day
==
1
&&
now
.
Hour
==
1
&&
now
.
Minute
==
1
)
{
SynchWmsData
();
}
}
private
void
SynchWmsData
()
{
try
{
Console
.
WriteLine
(
$"SynchWmsData--
{
DateTime
.
Now
}
"
);
string
url
=
"http://api.wms.bailuntec.com/api/services/app/ProductStockFlowService/GetProductStockFlowPages"
;
var
requestData
=
new
WMSRequestDto
{
Data
=
new
ProductStockFlowPagesInputDto
{
OrderCreationTimes
=
new
string
[]
{
"2021-06-30"
,
DateTime
.
Now
.
Date
.
ToString
()
},
Page
=
new
Pagination
{
Rows
=
50
}
}
};
var
inventoryServices
=
new
InventoryServices
();
for
(
int
i
=
1
;
i
<
1000000
;
i
++)
{
requestData
.
Data
.
Page
.
Page
=
i
;
var
str
=
NetHelper
.
HttpPostJson
(
url
,
Newtonsoft
.
Json
.
JsonConvert
.
SerializeObject
(
requestData
));
if
(
string
.
IsNullOrWhiteSpace
(
str
))
break
;
var
resopnse
=
Newtonsoft
.
Json
.
JsonConvert
.
DeserializeObject
<
WMSDataResponseDto
>(
str
);
if
(
resopnse
==
null
||
resopnse
.
Data
==
null
||
resopnse
.
Data
.
Items
.
Count
<=
0
)
return
;
foreach
(
var
item
in
resopnse
.
Data
.
Items
)
{
var
insertModel
=
new
dc_base_wms_stock_flow
(
item
);
var
isSuccess
=
inventoryServices
.
InsertWmsStockFlow
(
insertModel
);
if
(!
isSuccess
)
break
;
Console
.
WriteLine
(
$"
{
item
.
SysSerialNumber
}
--
{
DateTime
.
Now
}
"
);
}
}
}
catch
(
Exception
ex
)
{
Console
.
WriteLine
(
ex
.
Message
);
}
}
}
}
Bailun.DC.sln
View file @
17169819
...
@@ -93,7 +93,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bailun.DC.SyncMonthSalesPro
...
@@ -93,7 +93,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bailun.DC.SyncMonthSalesPro
EndProject
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bailun.DC.ExportTask", "Bailun.DC.ExportTask\Bailun.DC.ExportTask.csproj", "{C4C4990D-14DC-4B76-A7EB-6F3FC5BE8B94}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bailun.DC.ExportTask", "Bailun.DC.ExportTask\Bailun.DC.ExportTask.csproj", "{C4C4990D-14DC-4B76-A7EB-6F3FC5BE8B94}"
EndProject
EndProject
Project("{
FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bailun.DC.SyncMonthStockWeighting", "..\Bailun.DC.SyncMonthStockWeighting\Bailun.DC.SyncMonthStockWeighting.csproj", "{ED1647F9-6EA3-41A8-805F-DC46B8AD8835
}"
Project("{
9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bailun.DC.SyncMonthStockWeighting", "Bailun.DC.SyncMonthStockWeighting\Bailun.DC.SyncMonthStockWeighting.csproj", "{66D159A3-63A6-4900-AB21-C04ADE5A3D01
}"
EndProject
EndProject
Global
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
GlobalSection(SolutionConfigurationPlatforms) = preSolution
...
@@ -277,10 +277,10 @@ Global
...
@@ -277,10 +277,10 @@ Global
{C4C4990D-14DC-4B76-A7EB-6F3FC5BE8B94}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C4C4990D-14DC-4B76-A7EB-6F3FC5BE8B94}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C4C4990D-14DC-4B76-A7EB-6F3FC5BE8B94}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C4C4990D-14DC-4B76-A7EB-6F3FC5BE8B94}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C4C4990D-14DC-4B76-A7EB-6F3FC5BE8B94}.Release|Any CPU.Build.0 = Release|Any CPU
{C4C4990D-14DC-4B76-A7EB-6F3FC5BE8B94}.Release|Any CPU.Build.0 = Release|Any CPU
{
ED1647F9-6EA3-41A8-805F-DC46B8AD8835
}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{
66D159A3-63A6-4900-AB21-C04ADE5A3D01
}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{
ED1647F9-6EA3-41A8-805F-DC46B8AD8835
}.Debug|Any CPU.Build.0 = Debug|Any CPU
{
66D159A3-63A6-4900-AB21-C04ADE5A3D01
}.Debug|Any CPU.Build.0 = Debug|Any CPU
{
ED1647F9-6EA3-41A8-805F-DC46B8AD8835
}.Release|Any CPU.ActiveCfg = Release|Any CPU
{
66D159A3-63A6-4900-AB21-C04ADE5A3D01
}.Release|Any CPU.ActiveCfg = Release|Any CPU
{
ED1647F9-6EA3-41A8-805F-DC46B8AD8835
}.Release|Any CPU.Build.0 = Release|Any CPU
{
66D159A3-63A6-4900-AB21-C04ADE5A3D01
}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
HideSolutionNode = FALSE
...
@@ -323,7 +323,7 @@ Global
...
@@ -323,7 +323,7 @@ Global
{B0E4B05A-2330-46E1-8CF7-C6D69DBB7850} = {AE2CE86A-8538-4142-920F-684DCF47C064}
{B0E4B05A-2330-46E1-8CF7-C6D69DBB7850} = {AE2CE86A-8538-4142-920F-684DCF47C064}
{DEAD70F9-01C4-4178-AB0B-1C4874AA7A61} = {AE2CE86A-8538-4142-920F-684DCF47C064}
{DEAD70F9-01C4-4178-AB0B-1C4874AA7A61} = {AE2CE86A-8538-4142-920F-684DCF47C064}
{C4C4990D-14DC-4B76-A7EB-6F3FC5BE8B94} = {AE2CE86A-8538-4142-920F-684DCF47C064}
{C4C4990D-14DC-4B76-A7EB-6F3FC5BE8B94} = {AE2CE86A-8538-4142-920F-684DCF47C064}
{
ED1647F9-6EA3-41A8-805F-DC46B8AD8835
} = {AE2CE86A-8538-4142-920F-684DCF47C064}
{
66D159A3-63A6-4900-AB21-C04ADE5A3D01
} = {AE2CE86A-8538-4142-920F-684DCF47C064}
EndGlobalSection
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6E53AF28-A282-4FB0-A769-EAEA9769C02A}
SolutionGuid = {6E53AF28-A282-4FB0-A769-EAEA9769C02A}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment