Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
data-center-auto
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
data-center-auto
Commits
6d207d00
Commit
6d207d00
authored
Jul 28, 2020
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
c0f1e0d9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
132 additions
and
13 deletions
+132
-13
report_cash_flow_dao.cs
AutoTurnOver.DB/report_cash_flow_dao.cs
+0
-0
AutoTurnOver.Services.csproj
AutoTurnOver.Services/AutoTurnOver.Services.csproj
+4
-0
ConfigServices.cs
AutoTurnOver.Services/ConfigServices.cs
+23
-0
ConfigController.cs
AutoTurnOver/Controllers/ConfigController.cs
+43
-5
CaseFlowBackgrounService.cs
ResetOutofstock/CaseFlowBackgrounService.cs
+15
-3
Program.cs
ResetOutofstock/Program.cs
+2
-2
ResetOutofstockBackgrounService.cs
ResetOutofstock/ResetOutofstockBackgrounService.cs
+45
-3
No files found.
AutoTurnOver.DB/report_cash_flow_dao.cs
View file @
6d207d00
This diff is collapsed.
Click to expand it.
AutoTurnOver.Services/AutoTurnOver.Services.csproj
View file @
6d207d00
...
...
@@ -11,4 +11,8 @@
<ProjectReference Include="..\AutoTurnOver.Utility\AutoTurnOver.Utility.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="AutoTurnOver\Models\" />
</ItemGroup>
</Project>
AutoTurnOver.Services/ConfigServices.cs
View file @
6d207d00
...
...
@@ -6,6 +6,7 @@ using System.IO;
using
AutoTurnOver.Utility
;
using
System.Linq
;
using
AutoTurnOver.Models.Base
;
using
AutoTurnOver.Models.Report
;
namespace
AutoTurnOver.Services
{
...
...
@@ -838,5 +839,27 @@ namespace AutoTurnOver.Services
}
#
endregion
#
region
物流商账期
public
List
<
dc_report_logistics_company_config_dto
>
LogisticsCompanyConfigPage
(
dc_report_logistics_company_config_search_dto
m
,
int
offset
,
int
limit
,
ref
int
total
)
{
return
DB
.
db_config
.
LogisticsCompanyConfigPage
(
m
,
offset
,
limit
,
ref
total
);
}
public
string
SaveLogisticsCompanyConfig
(
dc_report_logistics_company_config
m
)
{
return
DB
.
db_config
.
SaveLogisticsCompanyConfig
(
m
);
}
public
dc_report_logistics_company_config
GetLogisticsCompanyConfigById
(
int
id
)
{
return
DB
.
db_config
.
GetLogisticsCompanyConfigById
(
id
);
}
#
endregion
}
}
AutoTurnOver/Controllers/ConfigController.cs
View file @
6d207d00
...
...
@@ -5,6 +5,7 @@ using System.Linq;
using
System.Threading.Tasks
;
using
AutoTurnOver.Common
;
using
AutoTurnOver.Models
;
using
AutoTurnOver.Models.Report
;
using
AutoTurnOver.Utility
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Mvc
;
...
...
@@ -733,8 +734,6 @@ namespace AutoTurnOver.Controllers
#
region
销量预测模型配置
#
region
暴增配置
[
HttpGet
]
public
JsonResult
SalesForecastConfigList
(
int
limit
,
int
offset
,
string
order
,
string
sort
,
string
warehousecode
,
string
warehousetype
,
int
?
warehousearea
,
string
bailun_sku
)
{
...
...
@@ -769,7 +768,7 @@ namespace AutoTurnOver.Controllers
}
catch
(
Exception
ex
)
{
return
Json
(
new
{
success
=
false
,
message
=
ex
.
Message
});
return
Json
(
new
{
success
=
false
,
message
=
ex
.
Message
});
}
}
...
...
@@ -803,8 +802,6 @@ namespace AutoTurnOver.Controllers
#
endregion
#
endregion
#
region
现金流结算方式
...
...
@@ -844,5 +841,45 @@ namespace AutoTurnOver.Controllers
}
#
endregion
#
region
物流商账期
[
HttpGet
]
public
JsonResult
LogisticsCompanyConfigPage
(
int
limit
,
int
offset
,
string
order
,
string
sort
,
string
company_code
)
{
var
m
=
new
dc_report_logistics_company_config_search_dto
{
company_code
=
company_code
};
var
total
=
0
;
var
service
=
new
Services
.
ConfigServices
();
var
list
=
service
.
LogisticsCompanyConfigPage
(
m
,
offset
,
limit
,
ref
total
);
return
new
JsonResult
(
new
{
rows
=
list
,
total
=
total
,
});
}
[
HttpPost
]
public
JsonResult
SaveLogisticsCompanyConfig
([
FromBody
]
dc_report_logistics_company_config
m
)
{
var
result
=
new
Services
.
ConfigServices
().
SaveLogisticsCompanyConfig
(
m
);
return
new
JsonResult
(
result
);
}
[
HttpGet
]
public
JsonResult
GetLogisticsCompanyConfigById
(
int
id
)
{
var
m
=
new
Services
.
ConfigServices
().
GetLogisticsCompanyConfigById
(
id
);
return
new
JsonResult
(
m
);
}
#
endregion
}
}
\ No newline at end of file
ResetOutofstock/CaseFlowBackgrounService.cs
View file @
6d207d00
...
...
@@ -23,9 +23,9 @@ namespace ResetOutofstock
var
now
=
DateTime
.
Now
;
if
(
now
.
Hour
==
01
&&
now
.
Minute
==
01
)
{
Console
.
WriteLine
(
$"开始 刷新现金流 订单数据,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
report_cash_flow_dao
.
CalculationOrder
(
now
.
AddMonths
(-
3
),
DateTime
.
Parse
(
now
.
AddDays
(-
1
).
ToString
(
"yyyy-MM-dd 23:59:59"
)));
Console
.
WriteLine
(
$"结束刷新现金流 订单数据,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
Console
.
WriteLine
(
$"开始 刷新现金流 订单数据
(销售)
,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
report_cash_flow_dao
.
CalculationOrder
Sale
(
now
.
AddMonths
(-
3
),
DateTime
.
Parse
(
now
.
AddDays
(-
1
).
ToString
(
"yyyy-MM-dd 23:59:59"
)));
Console
.
WriteLine
(
$"结束刷新现金流 订单数据
(销售)
,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
}
if
(
now
.
Hour
==
01
&&
now
.
Minute
==
02
)
{
...
...
@@ -51,6 +51,18 @@ namespace ResetOutofstock
report_cash_flow_dao
.
CalculationOrderCostLogistics
(
now
.
AddMonths
(-
3
),
DateTime
.
Parse
(
now
.
AddDays
(-
1
).
ToString
(
"yyyy-MM-dd 23:59:59"
)));
Console
.
WriteLine
(
$"结束 刷新订单尾程费 退款数据,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
}
if
(
now
.
Hour
==
01
&&
now
.
Minute
==
06
)
{
Console
.
WriteLine
(
$"开始 刷新现金流 订单数据 (费),线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
report_cash_flow_dao
.
CalculationOrderFee
(
now
.
AddMonths
(-
3
),
DateTime
.
Parse
(
now
.
AddDays
(-
1
).
ToString
(
"yyyy-MM-dd 23:59:59"
)));
Console
.
WriteLine
(
$"结束刷新现金流 订单数据(费),线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
}
if
(
now
.
Hour
==
01
&&
now
.
Minute
==
07
)
{
Console
.
WriteLine
(
$"开始 刷新现金流 订单数据 (成本),线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
report_cash_flow_dao
.
CalculationOrderCost
(
now
.
AddMonths
(-
3
),
DateTime
.
Parse
(
now
.
AddDays
(-
1
).
ToString
(
"yyyy-MM-dd 23:59:59"
)));
Console
.
WriteLine
(
$"结束刷新现金流 订单数据(成本),线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
}
}
public
override
void
Dispose
()
...
...
ResetOutofstock/Program.cs
View file @
6d207d00
...
...
@@ -14,8 +14,8 @@ namespace ResetOutofstock
{
Console
.
WriteLine
(
"刷新缺货数据任务启动..."
);
//report_cash_flow_dao.CalculationOrderCostLogistics(now.AddMonths(-3), DateTime.Parse(now.AddDays(-1).ToString("yyyy-MM-dd 23:59:59")));
var
now
=
DateTime
.
Now
;
// report_cash_flow_dao.CalculationOrder(now.AddMonths(-3), DateTime.Parse(now.AddDays(-1).ToString("yyyy-MM-dd 23:59:59")));
var
builder
=
new
HostBuilder
().
ConfigureServices
((
hostContext
,
services
)
=>
{
services
.
AddHostedService
<
ResetOutofstockBackgrounService
>();
...
...
ResetOutofstock/ResetOutofstockBackgrounService.cs
View file @
6d207d00
...
...
@@ -20,10 +20,52 @@ namespace ResetOutofstock
try
{
Console
.
WriteLine
(
$"开始 刷新现金流 订单数据,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
Console
.
WriteLine
(
$"开始 刷新现金流 订单数据
(销售)
,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
var
now
=
DateTime
.
Now
;
report_cash_flow_dao
.
CalculationOrder
(
now
.
AddMonths
(-
3
),
DateTime
.
Parse
(
now
.
AddDays
(-
1
).
ToString
(
"yyyy-MM-dd 23:59:59"
)));
Console
.
WriteLine
(
$"结束刷新现金流 订单数据,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
report_cash_flow_dao
.
CalculationOrderFee
(
now
.
AddMonths
(-
3
),
DateTime
.
Parse
(
now
.
AddDays
(-
1
).
ToString
(
"yyyy-MM-dd 23:59:59"
)));
Console
.
WriteLine
(
$"结束刷新现金流 订单数据(销售),线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
}
catch
(
Exception
ex
)
{
Console
.
WriteLine
(
ex
.
Message
);
}
Thread
.
Sleep
(
240
*
60
*
60
*
1000
);
}
});
Task
.
Factory
.
StartNew
(()
=>
{
while
(
true
)
{
try
{
Console
.
WriteLine
(
$"开始 刷新现金流 订单数据(成本),线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
var
now
=
DateTime
.
Now
;
report_cash_flow_dao
.
CalculationOrderCost
(
now
.
AddMonths
(-
3
),
DateTime
.
Parse
(
now
.
AddDays
(-
1
).
ToString
(
"yyyy-MM-dd 23:59:59"
)));
Console
.
WriteLine
(
$"结束刷新现金流 订单数据(成本),线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
}
catch
(
Exception
ex
)
{
Console
.
WriteLine
(
ex
.
Message
);
}
Thread
.
Sleep
(
240
*
60
*
60
*
1000
);
}
});
Task
.
Factory
.
StartNew
(()
=>
{
while
(
true
)
{
try
{
Console
.
WriteLine
(
$"开始 刷新现金流 订单数据(费),线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
var
now
=
DateTime
.
Now
;
report_cash_flow_dao
.
CalculationOrderSale
(
now
.
AddMonths
(-
3
),
DateTime
.
Parse
(
now
.
AddDays
(-
1
).
ToString
(
"yyyy-MM-dd 23:59:59"
)));
Console
.
WriteLine
(
$"结束刷新现金流 订单数据(费),线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
}
catch
(
Exception
ex
)
{
...
...
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